diff --git a/doc/api.md b/doc/api.md index 3554dd3..dfc1d42 100644 --- a/doc/api.md +++ b/doc/api.md @@ -627,7 +627,7 @@ | talkingHis | String | N | 接谈记录 | | talkingAdvice | String | N | 接谈意见 | | disputeLevel | String | N | 事件等级 | -| status | String | N | 诉求状态 | +| appealStatus | String | N | 诉求状态 | | dutyDeptIds | String | N | 负责部门ID, 以逗号分割 | | copyDeptIds | String | N | 抄送部门ID, 以逗号分割 | | feedbackDeadline | String | N | 反馈时限 | @@ -636,7 +636,7 @@ | visitTime | String | N | 来访时间 | | submitTime | String | N | 提交时间 | | fileList | list | N | 上传文件列表 | -| - url | list | N | 上传文件路径 | +| - fileAddr | list | N | 上传文件路径 | - 请求示例 ```json @@ -699,15 +699,16 @@ - 返回示例 ```json { - "code": 200, - "success": true, - "data": { - "link": "http://xxxx/file.png", - "domain": "http:xxx", - "name": "file.png", - "originalName": "file" - }, - "msg": "操作成功" + "code": 200, + "success": true, + "data": { + "link": "http://192.168.1.106:9000/mediation-paltform/upload/20230613/e39ca485ce9726eb1e2f65b794c9aba7.png", + "domain": "http://192.168.1.106:9000/mediation-paltform", + "name": "upload/20230613/e39ca485ce9726eb1e2f65b794c9aba7.png", + "originalName": "20230220174333.png", + "attachId": null + }, + "msg": "操作成功" } ``` @@ -749,15 +750,15 @@ - 返回示例 ```json { - "code": 200, - "success": true, - "data": { - "mon": "20", - "quarterly": "50", - "year": "200", - "all": "300" - }, - "msg": "操作成功" + "code": 200, + "success": true, + "data": { + "week": 7, + "year": 7, + "mon": 7, + "day": 4 + }, + "msg": "操作成功" } ``` diff --git a/doc/上传数据_模板.xls b/doc/上传数据_模板.xls new file mode 100644 index 0000000..3531fa3 Binary files /dev/null and b/doc/上传数据_模板.xls differ diff --git a/src/main/java/org/springblade/modules/business/controller/AppealRegController.java b/src/main/java/org/springblade/modules/business/controller/AppealRegController.java index 54bc489..c2ae92f 100644 --- a/src/main/java/org/springblade/modules/business/controller/AppealRegController.java +++ b/src/main/java/org/springblade/modules/business/controller/AppealRegController.java @@ -97,7 +97,7 @@ public class AppealRegController extends BladeController { IPage vos = regService.getPage(Condition.getPage(query), appealStatus, startTime, endTime, appealType, windowId, username); vos.getRecords().forEach(vo -> { String cardNo = vo.getCardno(); - if (Func.isNotBlank(cardNo)) { + if (Func.isNotBlank(cardNo) && cardNo.length() > 6) { vo.setCardno(cardNo.substring(0, cardNo.length() - 6) + "******"); } }); diff --git a/src/main/java/org/springblade/modules/business/entity/DataEntity.java b/src/main/java/org/springblade/modules/business/entity/DataEntity.java index 3bcf330..8530196 100644 --- a/src/main/java/org/springblade/modules/business/entity/DataEntity.java +++ b/src/main/java/org/springblade/modules/business/entity/DataEntity.java @@ -7,5 +7,5 @@ public class DataEntity { private String name; - private Integer num; + private Integer value; } diff --git a/src/main/java/org/springblade/modules/business/mapper/AppealRegMapper.xml b/src/main/java/org/springblade/modules/business/mapper/AppealRegMapper.xml index 79f8840..b5ea9be 100644 --- a/src/main/java/org/springblade/modules/business/mapper/AppealRegMapper.xml +++ b/src/main/java/org/springblade/modules/business/mapper/AppealRegMapper.xml @@ -60,7 +60,7 @@ /* 找出每个诉求的最后一次登记记录 */ FROM (SELECT t.* FROM (SELECT *, ROW_NUMBER() OVER(PARTITION BY appeal_id ORDER BY create_time DESC) AS row_index FROM mp_appeal_reg reg) t WHERE t.row_index = 1) t2 /* 找出每次登记的第一张用户 */ - LEFT JOIN (SELECT t.* FROM (SELECT *, ROW_NUMBER() OVER(PARTITION BY cardno ORDER BY sort ASC) AS row_index FROM mp_appeal_visitor vis) t WHERE t.row_index = 1) t3 ON t2.id = t3.appeal_reg_id + LEFT JOIN (SELECT t.* FROM (SELECT *, ROW_NUMBER() OVER(PARTITION BY appeal_reg_id ORDER BY sort ASC) AS row_index FROM mp_appeal_visitor vis) t WHERE t.row_index = 1) t3 ON t2.id = t3.appeal_reg_id ) b ON a.id = b.appeal_id LEFT JOIN blade_dict_biz biz ON a.dispute_id = biz.id WHERE a.source_type = 0 diff --git a/src/main/java/org/springblade/modules/business/service/ILargeScreenService.java b/src/main/java/org/springblade/modules/business/service/ILargeScreenService.java index 657a655..1de398b 100644 --- a/src/main/java/org/springblade/modules/business/service/ILargeScreenService.java +++ b/src/main/java/org/springblade/modules/business/service/ILargeScreenService.java @@ -42,7 +42,7 @@ public interface ILargeScreenService { Map> getAppealByMon(); - Map getAppealTypePercent(); + List> getAppealTypePercent(); Map getAppealSubmitCountByLoc(Integer timeFrame, String startTime, String endTime) throws ParseException; diff --git a/src/main/java/org/springblade/modules/business/service/impl/AppealMediationServiceImpl.java b/src/main/java/org/springblade/modules/business/service/impl/AppealMediationServiceImpl.java index e9a990b..560c8f6 100644 --- a/src/main/java/org/springblade/modules/business/service/impl/AppealMediationServiceImpl.java +++ b/src/main/java/org/springblade/modules/business/service/impl/AppealMediationServiceImpl.java @@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import org.springblade.common.constant.BusinessConstant; import org.springblade.core.tool.utils.BeanUtil; +import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; import org.springblade.modules.business.entity.*; import org.springblade.modules.business.mapper.AppealMediationMapper; @@ -73,8 +74,9 @@ public class AppealMediationServiceImpl extends BaseServiceImpl talkingHisList = entity.getTalkingHisList(); if (Func.isEmpty(talkingHisList)) return false; - mediation.setTalkingTime(talkingHisList.get(0).getTalkingTime()); - mediation.setTalkingHis(talkingHisList.get(0).getTalkingHis()); + mediation.setTalkingTime(talkingHisList.get(talkingHisList.size() - 1).getTalkingTime()); + mediation.setTalkingHis(talkingHisList.get(talkingHisList.size() - 1).getTalkingHis()); + mediation.setSubmitTime(Func.isEmpty(mediation.getSubmitTime()) ? DateUtil.now() : mediation.getSubmitTime()); save(mediation); List fileList = entity.getFileList(); - fileList.forEach(file -> { - file.setAppealId(mediation.getAppealId()); - file.setAppealId(mediation.getAppealRegId()); - file.setMediationId(mediation.getId()); - }); - fileService.saveBatch(fileList); + if (Func.isNotEmpty(fileList)) { + fileList.forEach(file -> { + file.setAppealId(mediation.getAppealId()); + file.setAppealRegId(mediation.getAppealRegId()); + file.setMediationId(mediation.getId()); + }); + fileService.saveBatch(fileList); + } return true; } @@ -130,7 +135,9 @@ public class AppealMediationServiceImpl extends BaseServiceImpl fileList = fileService.list( Wrappers.lambdaQuery().eq(AppealMediationFile::getMediationId, mediation.getId())); vo.setAttitude(mediation.getAttitude()); - vo.setTalkingAdvice(mediation.getAttitude()); - vo.setDutyDeptIds(mediation.getAttitude()); - vo.setCopyDeptIds(mediation.getAttitude()); + vo.setTalkingAdvice(mediation.getTalkingAdvice()); + vo.setDutyDeptIds(mediation.getDutyDeptIds()); + vo.setCopyDeptIds(mediation.getCopyDeptIds()); vo.setDisputeLevel(appeal.getDisputeLevel()); vo.setFeedbackDeadline(mediation.getFeedbackDeadline()); vo.setFinishDeadline(mediation.getFinishDeadline()); diff --git a/src/main/java/org/springblade/modules/business/service/impl/AppealRegServiceImpl.java b/src/main/java/org/springblade/modules/business/service/impl/AppealRegServiceImpl.java index 1f948b6..5693d4a 100644 --- a/src/main/java/org/springblade/modules/business/service/impl/AppealRegServiceImpl.java +++ b/src/main/java/org/springblade/modules/business/service/impl/AppealRegServiceImpl.java @@ -30,6 +30,7 @@ import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; +import org.springblade.core.tool.utils.SpringUtil; import org.springblade.modules.business.entity.Appeal; import org.springblade.modules.business.entity.AppealReg; import org.springblade.modules.business.entity.AppealVisitor; @@ -132,8 +133,10 @@ public class AppealRegServiceImpl extends BaseServiceImpllambdaQuery().eq(ServerWindowsDispute::getDisputeId, appeal.getDisputeId())); if (Func.isNotEmpty(swDispute)) { @@ -142,12 +145,12 @@ public class AppealRegServiceImpl extends BaseServiceImpl getMediateFinish() { @@ -98,23 +105,25 @@ public class LargeScreenServiceImpl implements ILargeScreenService { Map map = new HashMap<>(); LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - // 总化解数 - map.put("all", appealService.count(wrapper)); - wrapper.clear(); - // 本年度化解数 wrapper.between(Appeal::getFirstRegTime, LocalDateTimeUtils.yearStartTime(), LocalDateTimeUtils.yearEndTime()); map.put("year", appealService.count(wrapper)); wrapper.clear(); - // 本季度化解数 - wrapper.between(Appeal::getFirstRegTime, LocalDateTimeUtils.quarterStartTime(), LocalDateTimeUtils.quarterEndTime()); - map.put("quarterly", appealService.count(wrapper)); - wrapper.clear(); - - // 本月化解数 + // 本月度化解数 wrapper.between(Appeal::getFirstRegTime, LocalDateTimeUtils.monthStartTime(), LocalDateTimeUtils.monthEndTime()); map.put("mon", appealService.count(wrapper)); + wrapper.clear(); + + // 本周度化解数 + wrapper.between(Appeal::getFirstRegTime, LocalDateTimeUtils.weekStartTime(), LocalDateTimeUtils.weekEndTime()); + map.put("week", appealService.count(wrapper)); + wrapper.clear(); + + // 本日化解数 + wrapper.between(Appeal::getFirstRegTime, LocalDateTimeUtils.todayStartTime(), LocalDateTimeUtils.todayEndTime()); + map.put("day", appealService.count(wrapper)); + wrapper.clear(); return map; } @@ -127,8 +136,6 @@ public class LargeScreenServiceImpl implements ILargeScreenService { state.add(1); LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - // 只查这几个字段值 -// wrapper.select(Appeal::getId, Appeal::getDisputeName, Appeal::getFirstRegTime, Appeal::getStatus, Appeal::getStreetId); // 待处理、正在处理 wrapper.in(Appeal::getStatus, state); // 根据登记时间倒序 @@ -139,7 +146,11 @@ public class LargeScreenServiceImpl implements ILargeScreenService { List appealList = appeals.stream().limit(50).collect(Collectors.toList()); // 所属街道赋字典值 - appealList.forEach(appeal -> appeal.setStreet(DictBizCache.getById(appeal.getStreetId()).getDictValue())); + appealList.forEach(appeal -> { + appeal.setStreet(DictBizCache.getById(appeal.getStreetId()).getDictValue()); + String disputeName = Func.isEmpty(appeal.getDisputeName()) ? DictBizCache.getById(appeal.getDisputeId()).getDictValue() : appeal.getDisputeName(); + appeal.setDisputeName(disputeName); + }); return appealList; } @@ -177,9 +188,13 @@ public class LargeScreenServiceImpl implements ILargeScreenService { } @Override - public Map getAppealTypePercent() { + public List> getAppealTypePercent() { // 先查所有 List appeals = appealService.list(); + appeals.forEach(appeal -> { + String disputeName = Func.isEmpty(appeal.getDisputeName()) ? DictBizCache.getById(appeal.getDisputeId()).getDictValue() : appeal.getDisputeName(); + appeal.setDisputeName(disputeName); + }); // 根据纠纷类型分组 Map> collect = appeals.stream().collect(Collectors.groupingBy(Appeal::getDisputeName)); @@ -195,30 +210,41 @@ public class LargeScreenServiceImpl implements ILargeScreenService { List> list = new ArrayList<>(map.entrySet()); list.sort((o1, o2) -> o2.getValue() - o1.getValue()); + List result = new ArrayList(); Map hashMap = new HashMap<>(); DecimalFormat df = new DecimalFormat("#0.0"); - // 如果类型小于5,正常计算 if (list.size() <= 5) { + // 如果类型小于5,正常计算 for (Map.Entry entry : list) { - hashMap.put(entry.getKey(), df.format((double) entry.getValue() / (double) appeals.size() * 100) + "%"); + hashMap = new HashMap<>(); + hashMap.put("name", entry.getKey()); + hashMap.put("value", entry.getValue()); + result.add(hashMap); } - } - // 如果类型大于5,前五正常计算,其余全部按照其他纠纷计算 - else { + } else { + // 如果类型大于5,前五正常计算,其余全部按照其他纠纷计算 for (int i = 0; i < 5; i++) { Map.Entry entry = list.get(i); - hashMap.put(entry.getKey(), df.format((double) entry.getValue() / (double) appeals.size() * 100) + "%"); + hashMap = new HashMap<>(); + hashMap.put("name", entry.getKey()); + hashMap.put("value", entry.getValue()); + result.add(hashMap); } + int size = 0; for (int i = 5; i < list.size(); i++) { Map.Entry entry = list.get(i); size += entry.getValue(); } - hashMap.put("其他纠纷", df.format((double) size / (double) appeals.size() * 100) + "%"); + + hashMap = new HashMap<>(); + hashMap.put("name", "其他纠纷"); + hashMap.put("value", size); + result.add(hashMap); } - return hashMap; + return result; } @Override @@ -342,48 +368,62 @@ public class LargeScreenServiceImpl implements ILargeScreenService { public Map> getAppealHot() { Map> map = new HashMap(); // 化解成功状态数组 - List state = new ArrayList<>(); - state.add(2); - state.add(3); + List state = Arrays.asList(BusinessConstant.APPEAL_STATUS_AGREEMENT, BusinessConstant.APPEAL_STATUS_FINISH); + // 获取所有化解成功的诉求记录 LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.in(Appeal::getStatus, state); List appeals = appealService.list(wrapper); - appeals.forEach(appeal -> { - appeal.setStreet(DictBizCache.getById(appeal.getStreetId()).getDictValue()); - appeal.setName(userService.getById(appeal.getHandleDept()).getName()); - }); + // 过滤掉无街道和处理部门的, 防止异常 + appeals = appeals.stream().filter( + appeal -> Func.isNotEmpty(appeal.getStreetId()) && Func.isNotEmpty(appeal.getHandleDept()) + ).collect(Collectors.toList()); + + // 给街道和用户赋值 +// appeals.forEach(appeal -> { +// appeal.setStreet(DictBizCache.getById(appeal.getStreetId()).getDictValue()); +// appeal.setName(userService.getById(appeal.getHandleDept()).getName()); +// }); + + // 获取所有街道 + String code = "street"; + List dataList = dictService.getList(code); // 根据街道分组 - Map> street = appeals.stream().collect(Collectors.groupingBy(Appeal::getStreet)); - Set names = street.keySet(); + Map> street = appeals.stream().collect(Collectors.groupingBy(Appeal::getStreetId)); // 封装到数据对象 List strees = new ArrayList<>(); - for (String name : names) { + dataList.forEach(dictBiz -> { + Long dictBizId = dictBiz.getId(); DataEntity entity = new DataEntity(); - entity.setName(name); - entity.setNum(street.get(name).size()); + entity.setName(dictBiz.getDictValue()); + entity.setValue(street.containsKey(dictBizId) ? street.get(dictBizId).size() : 0); strees.add(entity); - } + }); + // 倒序 - List streeList = strees.stream().sorted(Comparator.comparing(DataEntity::getNum).reversed()).collect(Collectors.toList()); + List streeList = strees.stream().sorted(Comparator.comparing(DataEntity::getValue).reversed()).collect(Collectors.toList()); map.put("street", streeList); + // 获取所有部门 + String deptId = "1666621912872280065"; + List userList = userService.list(Wrappers.lambdaQuery().eq(User::getDeptId, deptId)); // 根据部门分组 - Map> town = appeals.stream().collect(Collectors.groupingBy(Appeal::getName)); - Set depts = town.keySet(); + Map> town = appeals.stream().collect(Collectors.groupingBy(Appeal::getHandleDept)); // 封装到数据对象 List towns = new ArrayList<>(); - for (String name : depts) { + userList.forEach(user -> { + Long id = user.getId(); DataEntity entity = new DataEntity(); - entity.setName(name); - entity.setNum(town.get(name).size()); + entity.setName(user.getName()); + entity.setValue(town.containsKey(id) ? town.get(id).size() : 0); towns.add(entity); - } + }); + // 倒序 - List townList = towns.stream().sorted(Comparator.comparing(DataEntity::getNum).reversed()).collect(Collectors.toList()); + List townList = towns.stream().sorted(Comparator.comparing(DataEntity::getValue).reversed()).collect(Collectors.toList()); map.put("town", townList); return map; diff --git a/src/main/java/org/springblade/modules/business/vo/AppealMediationVO.java b/src/main/java/org/springblade/modules/business/vo/AppealMediationVO.java index c5e6e15..425aac1 100644 --- a/src/main/java/org/springblade/modules/business/vo/AppealMediationVO.java +++ b/src/main/java/org/springblade/modules/business/vo/AppealMediationVO.java @@ -63,6 +63,11 @@ public class AppealMediationVO implements Serializable { */ private String disputeName; + /** + * 诉求状态 + */ + private Integer appealStatus; + /** * 何单位处理过-单位id */ @@ -150,6 +155,7 @@ public class AppealMediationVO implements Serializable { */ private String remark; + /** * 提交时间 */ diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index dc43369..c88f8f4 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -1,4 +1,4 @@ -#数据源配置 +##数据源配置 - dev spring: redis: ##redis 单机环境配置 @@ -7,10 +7,6 @@ spring: password: database: 0 ssl: false - ##redis 集群环境配置 - #cluster: - # nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003 - # commandTimeout: 5000 datasource: # MySql url: jdbc:mysql://localhost:3306/mediation_platform?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true @@ -22,17 +18,19 @@ social: enabled: true domain: http://127.0.0.1:1888 -#blade配置 -blade: - #分布式锁配置 - lock: - ##是否启用分布式锁 - enabled: false - ##redis服务地址 - address: redis://127.0.0.1:6379 - #本地文件上传 - file: - remote-mode: true - upload-domain: http://localhost:8999 - remote-path: /usr/share/nginx/html - +#server: +# port: 10000 +# +##数据源配置 +#spring: +# redis: +# ##redis 单机环境配置 +# host: 223.80.105.200 +# port: 41307 +# password: asdf.1234 +# database: 0 +# ssl: false +# datasource: +# url: jdbc:mysql://223.80.105.200:41306/mediation_platform?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true +# username: root +# password: asdf.1234 diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index fab7885..2740a5e 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -1,12 +1,15 @@ +server: + port: 10000 + #数据源配置 spring: redis: ##redis 单机环境配置 ##将docker脚本部署的redis服务映射为宿主机ip ##生产环境推荐使用阿里云高可用redis服务并设置密码 - host: 127.0.0.1 - port: 6379 - password: + host: 223.80.105.200 + port: 41307 + password: asdf.1234 database: 0 ssl: false ##redis 集群环境配置 @@ -14,9 +17,9 @@ spring: # nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003 # commandTimeout: 5000 datasource: - url: jdbc:mysql://localhost:3306/bladex_boot?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true + url: jdbc:mysql://223.80.105.200:41306/mediation_platform?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true username: root - password: root + password: asdf.1234 #第三方登陆 social: diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index fab7885..8568a3d 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -1,40 +1,226 @@ -#数据源配置 +#服务器配置 +server: + port: 10000 + undertow: + threads: + # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程 + io: 16 + # 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载 + worker: 400 + # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理 + buffer-size: 1024 + # 是否分配的直接内存 + direct-buffers: true + spring: redis: ##redis 单机环境配置 ##将docker脚本部署的redis服务映射为宿主机ip ##生产环境推荐使用阿里云高可用redis服务并设置密码 - host: 127.0.0.1 - port: 6379 - password: + host: 223.80.105.200 + port: 41307 + password: asdf.1234 database: 0 ssl: false - ##redis 集群环境配置 - #cluster: - # nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003 - # commandTimeout: 5000 datasource: - url: jdbc:mysql://localhost:3306/bladex_boot?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://223.80.105.200:41306/mediation_platform?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true username: root - password: root + password: asdf.1234 + druid: + # MySql、PostgreSQL、SqlServer、DaMeng校验 + validation-query: select 1 + # Oracle、YashanDB校验 + #oracle: true + #validation-query: select 1 from dual + validation-query-timeout: 2000 + initial-size: 5 + max-active: 20 + min-idle: 5 + max-wait: 60000 + test-on-borrow: false + test-on-return: false + test-while-idle: true + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + stat-view-servlet: + enabled: true + login-username: blade + login-password: 1qaz@WSX + web-stat-filter: + enabled: true + url-pattern: /* + exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*' + session-stat-enable: true + session-stat-max-count: 10 -#第三方登陆 -social: +# mybatis +mybatis-plus: + mapper-locations: classpath:org/springblade/**/mapper/*Mapper.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: org.springblade.**.entity + #typeEnumsPackage: org.springblade.dashboard.entity.enums + global-config: + # 关闭MP3.0自带的banner + banner: false + db-config: + #主键类型 0:"数据库ID自增", 1:"不操作", 2:"用户输入ID",3:"数字型snowflake", 4:"全局唯一ID UUID", 5:"字符串型snowflake"; + id-type: assign_id + #字段策略 + insert-strategy: not_null + update-strategy: not_null + where-strategy: not_null + #驼峰下划线转换 + table-underline: true + # 逻辑删除配置 + # 逻辑删除全局值(1表示已删除,这也是Mybatis Plus的默认配置) + logic-delete-value: 1 + # 逻辑未删除全局值(0表示未删除,这也是Mybatis Plus的默认配置) + logic-not-delete-value: 0 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + jdbc-type-for-null: 'null' + +#knife4j配置 +knife4j: + #启用 + enable: true + #基础认证 + basic: + enable: false + username: blade + password: blade + #增强配置 + setting: + enableSwaggerModels: true + enableDocumentManage: true + enableHost: false + enableHostText: http://localhost + enableRequestCache: true + enableFilterMultipartApis: false + enableFilterMultipartApiMethodType: POST + language: zh_cn + enableFooter: false + enableFooterCustom: true + footerCustomContent: Copyright © 2023 BladeX All Rights Reserved + +#报表配置 +report: + enabled: false + database: + provider: + prefix: blade- + +#oss默认配置 +oss: enabled: true - domain: http://127.0.0.1:1888 + name: qiniu + tenant-mode: true + endpoint: http://prt1thnw3.bkt.clouddn.com + access-key: N_Loh1ngBqcJovwiAJqR91Ifj2vgOWHOf8AwBA_h + secret-key: AuzuA1KHAbkIndCU0dB3Zfii2O3crHNODDmpxHRS + bucket-name: bladex #blade配置 blade: - #分布式锁配置 - lock: - ##是否启用分布式锁 - enabled: false - ##将docker脚本部署的redis服务映射为宿主机ip - ##生产环境推荐使用阿里云高可用redis服务并设置密码 - address: redis://127.0.0.1:6379 - password: 123456 - #本地文件上传 - file: - remote-mode: true - upload-domain: http://localhost:8999 - remote-path: /usr/share/nginx/html + #token配置 + token: + #是否有状态 + state: false + #是否单用户登录 + single: false + #单用户登录范围 + single-level: all + #token签名 + #使用 @org.springblade.test.SignKeyGenerator 获取 + sign-key: vaD8YIYMYcoCQi63y8X0szEGsKy8Gstj + #redis序列化方式 + redis: + # serializer-type: protostuff + serializer-type: json + #接口配置 + api: + #报文加密配置 + crypto: + #启用报文加密配置 + enabled: false + #使用AesUtil.genAesKey()生成 + aes-key: O2BEeIv399qHQNhD6aGW8R8DEj4bqHXm + #使用DesUtil.genDesKey()生成 + des-key: jMVCBsFGDQr1USHo + #jackson配置 + jackson: + #null自动转空值 + null-to-empty: true + #大数字自动转字符串 + big-num-to-string: true + #支持text文本请求,与报文加密同时开启 + support-text-plain: false + #日志配置 + log: + request: + #开启控制台请求日志 + enabled: true + #控制台请求日志忽略 + skip-url: + - /blade-desk/notice/list + - /blade-chat/weixin/** + #开启错误日志入库 + error-log: true + #xss配置 + xss: + enabled: true + skip-url: + - /blade-chat/weixin + - /blade-desk/notice/submit + #安全框架配置 + secure: + #接口放行 + skip-url: + - /blade-test/** + - /blade-business/** + - /blade-system/dict/common/** + #授权认证配置 + auth: + - method: POST + pattern: /blade-desk/dashboard/upload + expression: "hasTimeAuth(9, 17)" + - method: POST + pattern: /blade-desk/dashboard/submit + expression: "hasAnyRole('administrator', 'admin', 'user')" + #动态签名认证配置 + sign: + - method: ALL + pattern: /blade-desk/dashboard/sign + crypto: "sha1" + #多终端认证配置 + client: + - client-id: sword + path-patterns: + - /blade-sword/** + - client-id: saber + path-patterns: + - /blade-saber/** + #多租户配置 + tenant: + #多租户增强 + enhance: true + #多租户授权保护 + license: false + #动态数据源功能 + dynamic-datasource: false + #动态数据源全局扫描 + dynamic-global: false + #多租户字段名 + column: tenant_id + #排除多租户逻辑 + exclude-tables: + - blade_user + +#第三方登陆 +social: + enabled: false + domain: http://127.0.0.1:1888 + + diff --git a/src/main/resources/log/logback-dev.xml b/src/main/resources/log/logback-dev.xml index dacc4d8..792e330 100644 --- a/src/main/resources/log/logback-dev.xml +++ b/src/main/resources/log/logback-dev.xml @@ -21,10 +21,44 @@ + + + + + target/log/info-%d{yyyy-MM-dd}.log + + + %n%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId}] [%logger{50}] %n%-5level: %msg%n + + + + INFO + ACCEPT + DENY + + + + + + + + target/log/error-%d{yyyy-MM-dd}.log + + + %n%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId}] [%logger{50}] %n%-5level: %msg%n + + + + ERROR + ACCEPT + DENY + + + - + ${DESTINATION} @@ -53,6 +87,50 @@ + + + INFO + ACCEPT + DENY + + + + + + ${DESTINATION} + + + + + UTC + + + + { + "traceId": "%X{traceId}", + "requestId": "%X{requestId}", + "accountId": "%X{accountId}", + "tenantId": "%X{tenantId}", + "logLevel": "%level", + "serviceName": "${springAppName:-SpringApp}", + "pid": "${PID:-}", + "thread": "%thread", + "class": "%logger{40}", + "line":"%L", + "message": "%message" + } + + + + + + + + + ERROR + ACCEPT + DENY + @@ -60,54 +138,14 @@ - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/main/resources/log/logback-prod.xml b/src/main/resources/log/logback-prod.xml index ab6b102..792e330 100644 --- a/src/main/resources/log/logback-prod.xml +++ b/src/main/resources/log/logback-prod.xml @@ -25,7 +25,7 @@ - target/blade/log/info-%d{yyyy-MM-dd}.log + target/log/info-%d{yyyy-MM-dd}.log %n%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId}] [%logger{50}] %n%-5level: %msg%n @@ -42,7 +42,7 @@ - target/blade/log/error-%d{yyyy-MM-dd}.log + target/log/error-%d{yyyy-MM-dd}.log %n%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%X{traceId}] [%logger{50}] %n%-5level: %msg%n