From df3f587da9e3ae8a72f35b12c98546df226f974f Mon Sep 17 00:00:00 2001 From: wxc <191104855@qq.com> Date: Fri, 28 Mar 2025 17:28:16 +0800 Subject: [PATCH] 20250328 --- pom.xml | 2 - sql/20250213.sql | 33 +- sql/20250218.sql | 0 sql/20250224.sql | 9 + .../supervision/config/InterceptorConfig.java | 12 +- .../constants/enums/BusinessTypeEnum.java | 38 +- .../constants/enums/ComfortStatus.java | 3 + .../constants/enums/DepartGroupIdEnum.java | 18 + .../constants/enums/ModelDataTypeEnum.java | 20 + .../enums/ModelHandleDepartTypeEnum.java | 21 + .../constants/enums/ModelTypeEnum.java | 3 + .../enums/NegativeTaskCategoryEnum.java | 10 +- .../constants/enums/PersonTypeEnum.java | 18 + .../constants/enums/ProblemSourcesEnum.java | 2 +- .../controller/CommonController.java | 187 +- .../books/NegativeBookController.java | 104 +- .../data/DataCaseVerifController.java | 14 + .../data/DataMailBoxController.java | 51 + .../DataPetitionComplaint12337Controller.java | 22 +- .../data/DataPetitionComplaintController.java | 35 +- .../data/VideoInspectionController.java | 84 +- .../datav/DataVAuditController.java | 13 +- .../DataVSupervisionNotifyController.java | 141 +- .../rightsComfort/ComfortController.java | 94 +- .../rightsComfort/ComfortPacksController.java | 52 + .../RightPersonController.java | 18 +- .../ModelClueController.java | 2 +- .../SubOneSupervisionNotifyController.java | 8 +- .../controller/system/DepartController.java | 23 + .../system/DictContentController.java | 4 +- .../system/HandleResultMapingController.java | 66 + .../controller/system/PoliceController.java | 35 +- .../system/ProblemTypeMapingController.java | 3 +- .../system/VideoConfigController.java | 79 + .../work/MyCountersignController.java | 50 + .../work/NegativeImportController.java | 200 +- .../work/NegativeTaskController.java | 10 - .../controller/work/NewsController.java | 28 +- .../supervision/exception/AuthException.java | 7 + .../flow/action/ApplyCompletionAction.java | 5 +- .../flow/action/ApplyCountersignAction.java | 18 +- .../action/ConfirmationCompletionAction.java | 15 +- .../supervision/flow/action/SaveAction.java | 5 +- .../flow/action/SecondApproveAction.java | 4 + .../action/SecondExtensionApproveAction.java | 28 +- .../java/com/biutag/supervision/job/Job.java | 139 +- .../mapper/DataPetition12337Mapper.java | 9 + .../mapper/DwdAsjZfbaAjjbxxMapper.java | 18 + .../mapper/DwdAsjZfbaShrxx2Mapper.java | 20 + .../supervision/mapper/MailBlameMapper.java | 15 + .../mapper/NegativeCountersignMapper.java | 7 + .../mapper/NegativeFileMapper.java | 3 +- .../supervision/mapper/NegativeMapper.java | 11 +- .../supervision/mapper/RpcApplyMapper.java | 2 +- .../mapper/RpcComfortPacksMapper.java | 8 + .../mapper/RpcPacksComfortMapper.java | 8 + .../SupDictHandleResultMapingMapper.java | 8 + ...per.java => SupDictProblemTypeMapper.java} | 2 +- .../supervision/mapper/VideoConfigMapper.java | 8 + .../supervision/pojo/domain/NegativeVo.java | 9 +- .../supervision/pojo/domain/PoliceAuth.java | 2 + .../pojo/domain/RpcApplyDetail.java | 3 +- .../supervision/pojo/dto/ComfortPacksDto.java | 21 + .../supervision/pojo/dto/NegativeDto.java | 7 +- .../biutag/supervision/pojo/dto/NewsDto.java | 44 + .../supervision/pojo/dto/PoliceDto.java | 53 + .../supervision/pojo/dto/RpcApplyDto.java | 5 + .../pojo/dto/SjNegativeImportDto.java | 69 + .../dto/VideoInspectionDistributeDto.java | 1 + .../pojo/entity/DataAlarmAlarmInfo.java | 7 + .../pojo/entity/DataPetition12337.java | 5 +- .../pojo/entity/DwdAsjZfbaAjjbxx.java | 32 + .../pojo/entity/DwdAsjZfbaShrxx2.java | 512 +++ .../supervision/pojo/entity/Negative.java | 35 +- .../pojo/entity/NegativeCountersignApply.java | 7 + .../supervision/pojo/entity/NegativeTask.java | 5 + .../biutag/supervision/pojo/entity/News.java | 2 + .../supervision/pojo/entity/RpcApply.java | 14 +- .../pojo/entity/RpcApplyApprove.java | 4 +- .../pojo/entity/RpcComfortPacks.java | 56 + .../pojo/entity/RpcPacksComfort.java | 30 + .../supervision/pojo/entity/RpcPerson.java | 3 - .../entity/SupDictHandleResultMaping.java | 41 + .../supervision/pojo/entity/VideoConfig.java | 51 + .../pojo/entity/WvpDeviceChannel.java | 10 +- .../pojo/entity/mailbox/MailBlame.java | 46 + .../supervision/pojo/model/PoliceModel.java | 2 + .../supervision/pojo/model/UserAuth.java | 8 + .../DataPetitionComplaintQueryParam.java | 10 + .../pojo/param/NegativeTaskQueryParam.java | 2 + .../pojo/param/RpcApplyQueryParam.java | 2 + .../pojo/param/RpcComfortPacksParam.java | 23 + .../pojo/param/VideoConfigQueryParam.java | 16 + .../pojo/param/VideoInspectionQueryParam.java | 5 + .../pojo/vo/DataPetition12337ExportVo.java | 588 +++ .../DataPetitionComplaintExportGabxfVo.java | 1 + .../pojo/vo/ExportNegativeBlameVo.java | 39 +- .../pojo/vo/NegativeAuditExportVo.java | 59 + .../pojo/vo/RpcApplyApproveVo.java | 30 + .../supervision/pojo/vo/RpcApplyVo.java | 45 +- .../pojo/vo/RpcComfortPacksVo.java | 38 + .../pojo/vo/VideoInspectionVo.java | 1 - .../supervision/service/BaseUserService.java | 40 +- .../service/DataAlarmYjzjService.java | 13 + .../service/DataCaseVerifService.java | 21 +- .../service/DataPetition12337Service.java | 29 +- .../service/DataPetitionComplaintService.java | 20 +- .../service/DwdAsjZfbaShrxx2Service.java | 23 + .../supervision/service/FileService.java | 1 - .../supervision/service/MailService.java | 144 + .../supervision/service/ModelClueService.java | 34 +- .../supervision/service/ModelService.java | 7 +- .../service/NegativeBlameService.java | 7 +- .../service/NegativeBookService.java | 77 + .../service/NegativeCountersignService.java | 124 + .../NegativeExtensionApplyService.java | 11 +- .../service/NegativeFileService.java | 7 +- .../service/NegativeQueryService.java | 108 +- .../service/NegativeScoreService.java | 4 +- .../supervision/service/NegativeService.java | 59 +- .../service/NegativeTaskService.java | 41 +- .../supervision/service/NewsService.java | 17 +- .../service/RpcApplyApproveService.java | 38 +- .../supervision/service/RpcApplyService.java | 121 +- .../service/RpcApplyWorkService.java | 20 +- .../service/RpcComfortPacksService.java | 158 + .../service/RpcPacksComfortService.java | 35 + .../service/RpcRightPersonService.java | 12 + .../SupDictHandleResultMapingService.java | 18 + .../SupDictProblemTypeMapingService.java | 8 + ...ce.java => SupDictProblemTypeService.java} | 4 +- .../supervision/service/UserLoginService.java | 5 +- .../service/VideoConfigService.java | 11 + .../service/WvpDeviceChannelService.java | 2 +- .../support/ExcelImageConverter.java | 17 + .../support/ModelClueDistributionAware.java | 2 +- .../com/biutag/supervision/util/Arrays.java | 12 + .../com/biutag/supervision/util/ImgUtil.java | 23 + src/main/resources/application-dev.yml | 4 +- src/main/resources/application-local.yml | 10 +- src/main/resources/application-prod.yml | 5 +- .../mapper/DataPetition12337Mapper.xml | 8 + .../mapper/NegativeCointersignMapper.xml | 18 + src/main/resources/mapper/RpcApplyMapper.xml | 4 +- .../resources/mapper/SupDictContentMapper.xml | 2 +- ...apper.xml => SupDictProblemTypeMapper.xml} | 0 src/main/resources/mapper/SupPoliceMapper.xml | 4 +- .../ftl/1、抚慰金审批签呈.xml | 1585 ++++++++ .../ftl/2、维权抚慰登记表.xml | 1922 ++++++++++ .../ftl/3、抚慰金申报批处理表.xml | 2752 ++++++++++++++ .../4、抚慰金申请发放明细表.xml | 2218 +++++++++++ .../ftl/5、民警维权抚慰申请表.xml | 3379 +++++++++++++++++ .../com/biutag/supervision/DocToDocx.java | 50 + .../java/com/biutag/supervision/StrUtil.java | 98 +- .../SupervisionApplicationTests.java | 10 +- .../java/com/biutag/supervision/TestCase.java | 55 + .../supervision/tools/GenCodeTests.java | 2 +- 157 files changed, 16371 insertions(+), 823 deletions(-) create mode 100644 sql/20250218.sql create mode 100644 sql/20250224.sql create mode 100644 src/main/java/com/biutag/supervision/constants/enums/DepartGroupIdEnum.java create mode 100644 src/main/java/com/biutag/supervision/constants/enums/ModelDataTypeEnum.java create mode 100644 src/main/java/com/biutag/supervision/constants/enums/ModelHandleDepartTypeEnum.java create mode 100644 src/main/java/com/biutag/supervision/controller/data/DataMailBoxController.java create mode 100644 src/main/java/com/biutag/supervision/controller/rightsComfort/ComfortPacksController.java rename src/main/java/com/biutag/supervision/controller/{system => rightsComfort}/RightPersonController.java (72%) create mode 100644 src/main/java/com/biutag/supervision/controller/system/HandleResultMapingController.java create mode 100644 src/main/java/com/biutag/supervision/controller/system/VideoConfigController.java create mode 100644 src/main/java/com/biutag/supervision/controller/work/MyCountersignController.java create mode 100644 src/main/java/com/biutag/supervision/mapper/DwdAsjZfbaAjjbxxMapper.java create mode 100644 src/main/java/com/biutag/supervision/mapper/DwdAsjZfbaShrxx2Mapper.java create mode 100644 src/main/java/com/biutag/supervision/mapper/MailBlameMapper.java create mode 100644 src/main/java/com/biutag/supervision/mapper/RpcComfortPacksMapper.java create mode 100644 src/main/java/com/biutag/supervision/mapper/RpcPacksComfortMapper.java create mode 100644 src/main/java/com/biutag/supervision/mapper/SupDictHandleResultMapingMapper.java rename src/main/java/com/biutag/supervision/mapper/{SupDictContentMapper.java => SupDictProblemTypeMapper.java} (87%) create mode 100644 src/main/java/com/biutag/supervision/mapper/VideoConfigMapper.java create mode 100644 src/main/java/com/biutag/supervision/pojo/dto/ComfortPacksDto.java create mode 100644 src/main/java/com/biutag/supervision/pojo/dto/NewsDto.java create mode 100644 src/main/java/com/biutag/supervision/pojo/dto/PoliceDto.java create mode 100644 src/main/java/com/biutag/supervision/pojo/dto/SjNegativeImportDto.java create mode 100644 src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaAjjbxx.java create mode 100644 src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaShrxx2.java create mode 100644 src/main/java/com/biutag/supervision/pojo/entity/RpcComfortPacks.java create mode 100644 src/main/java/com/biutag/supervision/pojo/entity/RpcPacksComfort.java create mode 100644 src/main/java/com/biutag/supervision/pojo/entity/SupDictHandleResultMaping.java create mode 100644 src/main/java/com/biutag/supervision/pojo/entity/VideoConfig.java create mode 100644 src/main/java/com/biutag/supervision/pojo/entity/mailbox/MailBlame.java create mode 100644 src/main/java/com/biutag/supervision/pojo/param/RpcComfortPacksParam.java create mode 100644 src/main/java/com/biutag/supervision/pojo/param/VideoConfigQueryParam.java create mode 100644 src/main/java/com/biutag/supervision/pojo/vo/DataPetition12337ExportVo.java create mode 100644 src/main/java/com/biutag/supervision/pojo/vo/NegativeAuditExportVo.java create mode 100644 src/main/java/com/biutag/supervision/pojo/vo/RpcApplyApproveVo.java create mode 100644 src/main/java/com/biutag/supervision/pojo/vo/RpcComfortPacksVo.java create mode 100644 src/main/java/com/biutag/supervision/service/DwdAsjZfbaShrxx2Service.java create mode 100644 src/main/java/com/biutag/supervision/service/MailService.java create mode 100644 src/main/java/com/biutag/supervision/service/RpcComfortPacksService.java create mode 100644 src/main/java/com/biutag/supervision/service/RpcPacksComfortService.java create mode 100644 src/main/java/com/biutag/supervision/service/SupDictHandleResultMapingService.java rename src/main/java/com/biutag/supervision/service/{SupDictContentService.java => SupDictProblemTypeService.java} (91%) create mode 100644 src/main/java/com/biutag/supervision/service/VideoConfigService.java create mode 100644 src/main/java/com/biutag/supervision/support/ExcelImageConverter.java create mode 100644 src/main/java/com/biutag/supervision/util/Arrays.java create mode 100644 src/main/java/com/biutag/supervision/util/ImgUtil.java create mode 100644 src/main/resources/mapper/NegativeCointersignMapper.xml rename src/main/resources/mapper/{RiskPersonalMapper.xml => SupDictProblemTypeMapper.xml} (100%) create mode 100644 src/main/resources/static/templates/ftl/1、抚慰金审批签呈.xml create mode 100644 src/main/resources/static/templates/ftl/2、维权抚慰登记表.xml create mode 100644 src/main/resources/static/templates/ftl/3、抚慰金申报批处理表.xml create mode 100644 src/main/resources/static/templates/ftl/4、抚慰金申请发放明细表.xml create mode 100644 src/main/resources/static/templates/ftl/5、民警维权抚慰申请表.xml create mode 100644 src/test/java/com/biutag/supervision/DocToDocx.java create mode 100644 src/test/java/com/biutag/supervision/TestCase.java diff --git a/pom.xml b/pom.xml index 727cdcc..1657e0e 100644 --- a/pom.xml +++ b/pom.xml @@ -168,7 +168,6 @@ org.freemarker freemarker 2.3.32 - test @@ -195,7 +194,6 @@ 2.0.53 - net.logstash.logback logstash-logback-encoder diff --git a/sql/20250213.sql b/sql/20250213.sql index 2d96f3a..7f57f58 100644 --- a/sql/20250213.sql +++ b/sql/20250213.sql @@ -1,15 +1,24 @@ -CREATE TABLE `rpc_apply_work` ( - `id` int NOT NULL AUTO_INCREMENT, - `rpc_id` varchar(40) , - `handle_id_code` varchar(40) CHARACTER SET utf8mb4 COMMENT '办理人身份证', - `handle_depart_id` varchar(40) CHARACTER SET utf8mb4 COMMENT '办理单位', - `create_time` datetime DEFAULT NULL COMMENT '创建时间', - `status` varchar(255) CHARACTER SET utf8mb4 COMMENT '状态', - `council` tinyint DEFAULT NULL, - `step` int DEFAULT NULL, - `update_time` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=1; +CREATE TABLE `rpc_apply_approve` ( + `id` int NOT NULL AUTO_INCREMENT, + `rpc_id` varchar(40) , + `comments` text COMMENT '审批意见', + `return_flag` tinyint DEFAULT NULL COMMENT '是否退回', + `create_time` datetime DEFAULT NULL, + `handle_name` varchar(255) COMMENT '操作人', + `step` int DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB; + +ALTER TABLE `negative`.`rpc_apply` + ADD COLUMN `year` int COMMENT '年', + ADD COLUMN `number_index` int , + ADD COLUMN `approver` varchar(1000) COMMENT '当前审批人', + ADD COLUMN `step` int; + +ALTER TABLE `negative`.`rpc_apply_work` + ADD COLUMN `council` tinyint, + ADD COLUMN `step` int, + ADD COLUMN `update_time` datetime; update rpc_apply set rpc_status = 'completed'; diff --git a/sql/20250218.sql b/sql/20250218.sql new file mode 100644 index 0000000..e69de29 diff --git a/sql/20250224.sql b/sql/20250224.sql new file mode 100644 index 0000000..32dc431 --- /dev/null +++ b/sql/20250224.sql @@ -0,0 +1,9 @@ +CREATE TABLE `sup_dict_handle_result_maping` ( + `id` int NOT NULL AUTO_INCREMENT, + `external_name` varchar(255) DEFAULT NULL, + `internal_name` varchar(255) NOT NULL, + `internal_id` varchar(40) NOT NULL, + `create_time` datetime DEFAULT NULL, + `update_time` datetime DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=1; \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/config/InterceptorConfig.java b/src/main/java/com/biutag/supervision/config/InterceptorConfig.java index 5422da5..1de3721 100644 --- a/src/main/java/com/biutag/supervision/config/InterceptorConfig.java +++ b/src/main/java/com/biutag/supervision/config/InterceptorConfig.java @@ -2,8 +2,10 @@ package com.biutag.supervision.config; import cn.hutool.core.util.StrUtil; import cn.hutool.http.Header; +import com.biutag.supervision.common.UserContextHolder; import com.biutag.supervision.constants.RedisKeyConstants; import com.biutag.supervision.exception.AuthException; +import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.util.SpringUtil; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; @@ -55,11 +57,17 @@ public class InterceptorConfig implements WebMvcConfigurer { log.info("请求地址:{}", request.getRequestURI()); String authorization = request.getHeader(Header.AUTHORIZATION.getValue()); RedisTemplate redisTemplate = SpringUtil.getBean("redisTemplate", RedisTemplate.class); - if (StrUtil.isBlank(authorization) || Objects.isNull(redisTemplate.opsForValue().get(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, authorization)))) { - throw new AuthException(); + try { + if (StrUtil.isBlank(authorization) || Objects.isNull(redisTemplate.opsForValue().get(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, authorization)))) { + throw new AuthException(); + } + } catch (RuntimeException e) { + throw new AuthException(e.getMessage()); } // 更新 会话 有效期 redisTemplate.expire(String.format(RedisKeyConstants.LOGIN_USERINFO_KEY, authorization), tokenTimeout, TimeUnit.HOURS); + UserAuth user = UserContextHolder.getCurrentUser(); + log.info("请求用户:{}", user.getNickName()); return true; } diff --git a/src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java index e1ecc59..c257587 100644 --- a/src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java +++ b/src/main/java/com/biutag/supervision/constants/enums/BusinessTypeEnum.java @@ -7,19 +7,20 @@ import lombok.Getter; @Getter public enum BusinessTypeEnum { - JCJ_110("110接处警", "1", "110", true), - JCJ_122("122接处警", "2", "122", true), - RJCKFW("人境窗口服务", "3", "RJ", false), - CJGFF("车驾管服务", "4", "CJG", false), - JJCF("交警执法", "5", "JJ", false), - ZFBA("执法办案", "6", "CF", false), - ZXGZ("专项工作", "7", "ZX", false), - ABWW("安保维稳", "8", "AB", false), - JAFK("治安防控", "9", "ZA", false), - XZGL("行政管理", "10", "XZ", false), - FFJC("服务基层", "11", "FF", false), - DWGL("队伍管理", "12", "DW", false), - QT("其他", "13", "QT", false); + JCJ_110("110接处警", "1", "110"), + JCJ_122("122接处警", "2", "122"), + RJCKFW("人境窗口服务", "3", "RJ"), + CJGFF("车驾管服务", "4", "CJG"), + JJCF("交警执法", "5", "JJ"), + ZFBA("执法办案", "6", "CF"), + ZXGZ("专项工作", "7", "ZX"), + ABWW("安保维稳", "8", "AB"), + JAFK("治安防控", "9", "ZA"), + XZGL("行政管理", "10", "XZ"), + FFJC("服务基层", "11", "FF"), + DWGL("队伍管理", "12", "DW"), + JWBZ("警务保障", "14", "SJ"), + QT("其他", "13", "QT"); private String label; @@ -27,8 +28,6 @@ public enum BusinessTypeEnum { private String key; - private Boolean businessVolume; - public static BusinessTypeEnum get(String value) { for (BusinessTypeEnum businessTypeEnum : values()) { if (businessTypeEnum.value.equals(value)) { @@ -47,13 +46,4 @@ public enum BusinessTypeEnum { return null; } - public static boolean isBusinessVolume(String value) { - for (BusinessTypeEnum businessTypeEnum : values()) { - if (businessTypeEnum.value.equals(value)) { - return businessTypeEnum.businessVolume; - } - } - return false; - } - } diff --git a/src/main/java/com/biutag/supervision/constants/enums/ComfortStatus.java b/src/main/java/com/biutag/supervision/constants/enums/ComfortStatus.java index 2ecfa88..c9e0f85 100644 --- a/src/main/java/com/biutag/supervision/constants/enums/ComfortStatus.java +++ b/src/main/java/com/biutag/supervision/constants/enums/ComfortStatus.java @@ -9,6 +9,9 @@ public enum ComfortStatus { approval, // 已退回 returned, + + // 待呈报 + to_be_reported, completed } diff --git a/src/main/java/com/biutag/supervision/constants/enums/DepartGroupIdEnum.java b/src/main/java/com/biutag/supervision/constants/enums/DepartGroupIdEnum.java new file mode 100644 index 0000000..4e4ca50 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/DepartGroupIdEnum.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2025/3/6 + */ +@AllArgsConstructor +public enum DepartGroupIdEnum { + + COUNTY_AND_CITY_BUREAUS("3"); + + @Getter + private String value; + +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/ModelDataTypeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ModelDataTypeEnum.java new file mode 100644 index 0000000..347bd33 --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/ModelDataTypeEnum.java @@ -0,0 +1,20 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2025/3/7 + */ +@AllArgsConstructor +public enum ModelDataTypeEnum { + + // 预警问题 + YJWT("1"), + // 提醒通知 + TXTZ("2"); + + @Getter + private String value; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/ModelHandleDepartTypeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ModelHandleDepartTypeEnum.java new file mode 100644 index 0000000..6dcdc0b --- /dev/null +++ b/src/main/java/com/biutag/supervision/constants/enums/ModelHandleDepartTypeEnum.java @@ -0,0 +1,21 @@ +package com.biutag.supervision.constants.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * @author wxc + * @date 2025/3/7 + * 办理单位类型 + */ +@AllArgsConstructor +public enum ModelHandleDepartTypeEnum { + + // 涉及单位 + SJDW("1"), + // 指定单位 + ZDDW("2"); + + @Getter + private String value; +} diff --git a/src/main/java/com/biutag/supervision/constants/enums/ModelTypeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ModelTypeEnum.java index cae189a..8b7bcc0 100644 --- a/src/main/java/com/biutag/supervision/constants/enums/ModelTypeEnum.java +++ b/src/main/java/com/biutag/supervision/constants/enums/ModelTypeEnum.java @@ -10,7 +10,10 @@ import lombok.Getter; @AllArgsConstructor public enum ModelTypeEnum { + // 内部监督 NBJD("1"), + + // 个人极端 GRJD("2"); @Getter diff --git a/src/main/java/com/biutag/supervision/constants/enums/NegativeTaskCategoryEnum.java b/src/main/java/com/biutag/supervision/constants/enums/NegativeTaskCategoryEnum.java index 04aa08d..995993e 100644 --- a/src/main/java/com/biutag/supervision/constants/enums/NegativeTaskCategoryEnum.java +++ b/src/main/java/com/biutag/supervision/constants/enums/NegativeTaskCategoryEnum.java @@ -5,9 +5,17 @@ import lombok.Getter; @AllArgsConstructor public enum NegativeTaskCategoryEnum { - IMPORT("0"), + + // 批量导入 + BATCH_IMPORT("0"), + + // 导入记录 + IMPORT("1"), + + // 导出记录 EXPORT("2"); @Getter private String value; + } diff --git a/src/main/java/com/biutag/supervision/constants/enums/PersonTypeEnum.java b/src/main/java/com/biutag/supervision/constants/enums/PersonTypeEnum.java index 1702e5d..6b0b164 100644 --- a/src/main/java/com/biutag/supervision/constants/enums/PersonTypeEnum.java +++ b/src/main/java/com/biutag/supervision/constants/enums/PersonTypeEnum.java @@ -4,6 +4,7 @@ import lombok.AllArgsConstructor; import lombok.Getter; import java.util.List; +import java.util.Objects; /** * @author wxc @@ -34,4 +35,21 @@ public enum PersonTypeEnum { return null; } + public static PersonTypeEnum getByLabel(String value) { + for (PersonTypeEnum personTypeEnum : values()) { + if (personTypeEnum.getLabel().equals(value)) { + return personTypeEnum; + } + } + return null; + } + + public static String getLabel(String value) { + PersonTypeEnum personTypeEnum = get(value); + if (Objects.isNull(personTypeEnum)) { + return null; + } + return personTypeEnum.getLabel(); + } + } diff --git a/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java b/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java index e71fa5c..4c0598f 100644 --- a/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java +++ b/src/main/java/com/biutag/supervision/constants/enums/ProblemSourcesEnum.java @@ -25,7 +25,7 @@ public enum ProblemSourcesEnum { SJJD("审计监督", "26"), ZFTZSJ("政府投资审计", "27"), - ZFSACFSS("执法涉案财务审计", "28"), + ZFSACFSS("执法活动财物审计", "28"), JJZRSJ("经济责任审计", "29"), ZXSJ("专项审计", "30"), diff --git a/src/main/java/com/biutag/supervision/controller/CommonController.java b/src/main/java/com/biutag/supervision/controller/CommonController.java index c14a713..3537b7c 100644 --- a/src/main/java/com/biutag/supervision/controller/CommonController.java +++ b/src/main/java/com/biutag/supervision/controller/CommonController.java @@ -1,30 +1,18 @@ package com.biutag.supervision.controller; -import cn.hutool.core.io.FileUtil; -import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; -import cn.hutool.http.HttpResponse; -import cn.hutool.http.HttpUtil; -import com.alibaba.fastjson2.JSON; -import com.alibaba.fastjson2.JSONArray; -import com.alibaba.fastjson2.JSONObject; -import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; -import com.biutag.supervision.constants.enums.BusinessTypeEnum; -import com.biutag.supervision.constants.enums.InspectCaseEnum; -import com.biutag.supervision.constants.enums.ProblemSourcesEnum; -import com.biutag.supervision.constants.enums.ProcessingStatusEnum; -import com.biutag.supervision.mapper.MailMapper; +import com.biutag.supervision.constants.enums.ComfortStatus; +import com.biutag.supervision.constants.enums.RpcApplyTypeEnum; +import com.biutag.supervision.mapper.DwdAsjZfbaAjjbxxMapper; import com.biutag.supervision.pojo.entity.*; -import com.biutag.supervision.pojo.entity.mailbox.Mail; import com.biutag.supervision.service.*; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.io.InputStream; import java.time.LocalDateTime; +import java.time.ZoneId; import java.util.List; import java.util.Objects; @@ -38,130 +26,67 @@ import java.util.Objects; @RestController public class CommonController { - @Value("${mailbox.url}") - private String mailboxUrl; - - private final FileService fileService; - - private final NegativeThingFileService thingFileService; - - private final NegativeFileService negativeThingFile; - - private final SupPoliceService supPoliceService; - - private final NegativeBlameService blameService; - - private final MailMapper mailMapper; - - private final NegativeService negativeService; + private final MailService mailService; @RequestMapping("mailbox") public void mailbox() { - List mailList = mailMapper.selectList(new LambdaUpdateWrapper().eq(Mail::getMailState, "completion") - .in(Mail::getVerifyIsTrue, List.of("属实", "基本属实"))); - for (Mail item : mailList) { - // 判断是否存在 - if (negativeService.exists(new LambdaUpdateWrapper().eq(Negative::getOriginId, item.getId()).eq(Negative::getProblemSourcesCode, ProblemSourcesEnum.JZXX.getValue()))) { - log.info("信件 {} 已存在", item.getId()); - continue; - } - Negative negative = new Negative(); - negative.setId(IdUtil.getSnowflakeNextIdStr()); - negative.setOriginId(item.getId()); - negative.setDiscoveryTime(item.getCreateTime()); - negative.setResponderName(item.getContactName()); - negative.setContactPhone(item.getContactPhone()); - negative.setThingDesc(item.getContent()); - // 问题涉及单位 - // negative.setInvolveDepartName(); + mailService.saveMailbox(); + } - negative.setProblemSources(ProblemSourcesEnum.JZXX.getLabel()); - negative.setProblemSourcesCode(ProblemSourcesEnum.JZXX.getValue()); - negative.setBusinessTypeCode(BusinessTypeEnum.QT.getValue()); - negative.setBusinessTypeName(BusinessTypeEnum.QT.getLabel()); - if ("属实".equals(item.getVerifyIsTrue())) { - negative.setCheckStatus(InspectCaseEnum.TRUE.getValue()); - negative.setCheckStatusName(InspectCaseEnum.TRUE.getLabel()); + private final DwdAsjZfbaShrxx2Service dwdAsjZfbaShrxx2Service; + private final RpcApplyService rpcApplyService; + private final SupPoliceService policeService; + private final SupDepartService departService; + private final DwdAsjZfbaAjjbxxMapper dwdAsjZfbaAjjbxxMapper; + + @RequestMapping("rights") + public void rights() { + log.info("rights--------------------"); + // 维权 + List shrxxList = dwdAsjZfbaShrxx2Service.listAll(); + log.info("数据:{}条", shrxxList.size()); + shrxxList.forEach(item -> { + RpcApply rpcApply = new RpcApply(); + rpcApply.setRpcId(item.getZj()); + rpcApply.setCrtTime(LocalDateTime.now()); + rpcApply.setUptTime(LocalDateTime.now()); + // 姓名 + rpcApply.setApplicantEmpName(item.getXm()); + // 受害日期 + if (Objects.nonNull(item.getShrq())) { + rpcApply.setHappenTime(item.getShrq().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime()); } - if ("基本属实".equals(item.getVerifyIsTrue())) { - negative.setCheckStatus(InspectCaseEnum.PARTIALLY_TRUE.getValue()); - negative.setCheckStatusName(InspectCaseEnum.PARTIALLY_TRUE.getLabel()); - } - // 核办情况 - negative.setCheckStatusDesc(item.getVerifyDetails()); - negative.setProcessingStatus(ProcessingStatusEnum.completed.name()); - negative.setCrtTime(LocalDateTime.now()); - negativeService.save(negative); - - // 被举报人 - if (StrUtil.isNotBlank(item.getVerifyReportedPolices())) { - JSONArray jsonArray = JSON.parseArray(item.getVerifyReportedPolices()); - if (!jsonArray.isEmpty()) { - for (int i = 0; i < jsonArray.size(); i++) { - // [{"deptId":310,"empNo":"A00002","gender":null,"birthday":null,"name":"李四","mobile":null}] - JSONObject jsonObject = jsonArray.getJSONObject(i); - String empNo = jsonObject.getString("empNo"); - String name = jsonObject.getString("name"); - SupPolice police = supPoliceService.getOne(new LambdaUpdateWrapper().eq(SupPolice::getEmpNo, empNo).eq(SupPolice::getName, name)); - if (Objects.isNull(police)) { - log.error("没有该警员的数据! {}-{}", name, empNo); - continue; - } - NegativeBlame negativeBlame = new NegativeBlame(); - negativeBlame - .setBlameId(IdUtil.getSnowflakeNextIdStr()) - .setNegativeId(negative.getId()) - .setType("personal") - .setBlameEmpNo(empNo) - .setBlameIdCode(police.getIdCode()) - .setBlameName(name) - .setUpdTime(LocalDateTime.now()) - .setCrtTime(LocalDateTime.now()); - blameService.save(negativeBlame); - } - } + // 案件编号 + rpcApply.setCaseNumber(item.getAjbh()); + // 受害人警号 + SupPolice police = policeService.getByIdCode(item.getGmsfhm()); + if (Objects.nonNull(police)) { + // 警号 + rpcApply.setApplicantEmpNo(police.getEmpNo()); + SupDepart depart = departService.getById(police.getOrgId()); + rpcApply.setDepartId(depart.getId()); + rpcApply.setDepartId(depart.getName()); } - - // [{"filepath":"250102/_B5HQNhI.doc","orgiinFilename":"3、定级报告 .doc","type":"application/msword","size":95744,"docxFilepath":"250102/l-Tl5dux.docx"}] - if (StrUtil.isNotBlank(item.getAttachments())) { - JSONArray jsonArray = JSON.parseArray(item.getAttachments()); - if (!jsonArray.isEmpty()) { - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject jsonObject = jsonArray.getJSONObject(i); - HttpResponse httpResponse = HttpUtil.createGet(mailboxUrl + "api/file/steam/" + jsonObject.getString("filepath")).execute(); - InputStream is = httpResponse.bodyStream(); - String fileName = jsonObject.getString("orgiinFilename"); - String filePath = fileService.upload(is, 0L, FileUtil.extName(fileName)); - NegativeThingFile negativeThingFile = new NegativeThingFile(); - negativeThingFile.setFileName(fileName); - negativeThingFile.setFilePath(filePath); - negativeThingFile.setCreateTime(LocalDateTime.now()); - negativeThingFile.setNegativeId(negative.getId()); - thingFileService.save(negativeThingFile); - } + if (StrUtil.isNotBlank(item.getAjbh())) { + DwdAsjZfbaAjjbxx ajjbxx = dwdAsjZfbaAjjbxxMapper.selectByAjbh(item.getAjbh()); + // 案件信息 + rpcApply.setFactReason(ajjbxx.getJyaq()); + if ("刑事".equals(ajjbxx.getAjbzmc())) { + rpcApply.setInfringerHandle("刑事追究"); } - } - - if (StrUtil.isNotBlank(item.getVerifyAttachments())) { - JSONArray jsonArray = JSON.parseArray(item.getVerifyAttachments()); - if (!jsonArray.isEmpty()) { - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject jsonObject = jsonArray.getJSONObject(i); - HttpResponse httpResponse = HttpUtil.createGet(mailboxUrl + "api/file/steam/" + jsonObject.getString("filepath")).execute(); - InputStream is = httpResponse.bodyStream(); - String fileName = jsonObject.getString("orgiinFilename"); - String filePath = fileService.upload(is, 0L, FileUtil.extName(fileName)); - NegativeFile file = new NegativeFile(); - file.setFileName(fileName); - file.setFilePath(filePath); - file.setCrtTime(LocalDateTime.now()); - file.setNegtiveId(negative.getId()); - negativeThingFile.save(file); - } + if ("行政".equals(ajjbxx.getAjbzmc())) { + rpcApply.setInfringerHandle("行政处罚"); } } - - } + // 申请类型 + rpcApply.setType(RpcApplyTypeEnum.RIGHTS_PROTECTION.getValue()); + // 已办结 + rpcApply.setRpcStatus(ComfortStatus.completed.name()); + // 数据来源 + rpcApply.setSource("gbase"); + rpcApplyService.save(rpcApply); + }); } + } diff --git a/src/main/java/com/biutag/supervision/controller/books/NegativeBookController.java b/src/main/java/com/biutag/supervision/controller/books/NegativeBookController.java index 75b2286..2465132 100644 --- a/src/main/java/com/biutag/supervision/controller/books/NegativeBookController.java +++ b/src/main/java/com/biutag/supervision/controller/books/NegativeBookController.java @@ -1,20 +1,26 @@ package com.biutag.supervision.controller.books; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.io.IoUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.metadata.data.ImageData; +import com.alibaba.excel.metadata.data.WriteCellData; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.constants.enums.DepartLevelEnum; import com.biutag.supervision.constants.enums.ProblemSourcesEnum; import com.biutag.supervision.constants.enums.SpecialSupervisionEnum; -import com.biutag.supervision.mapper.DataPetitionComplaintMapper; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.entity.Negative; import com.biutag.supervision.pojo.entity.NegativeBlame; +import com.biutag.supervision.pojo.entity.NegativeFile; +import com.biutag.supervision.pojo.entity.NegativeProblemRelation; import com.biutag.supervision.pojo.param.NegativeQueryParam; import com.biutag.supervision.pojo.vo.*; import com.biutag.supervision.service.*; +import com.biutag.supervision.util.ImgUtil; import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -24,6 +30,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.io.IOException; +import java.io.InputStream; import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; @@ -47,10 +54,10 @@ public class NegativeBookController { private final SupDepartService departService; - private final DataPetitionComplaintMapper dataPetitionComplaintMapper; - private final NegativeBookService negativeBookService; + private final DataPetition12337Service dataPetition12337Service; + // 黄赌警情 @GetMapping("hdjq") public Result> page(NegativeQueryParam param) { @@ -221,23 +228,100 @@ public class NegativeBookController { } + @GetMapping("mail12337") + public Result> pageByXf(NegativeQueryParam param) { + Page pages = dataPetition12337Service.pageExportVo(param); + return Result.success(pages); + } @GetMapping("export/mail12337") public void exportByMail12337(NegativeQueryParam param, HttpServletResponse response) throws IOException { param.setCurrent(1); param.setSize(100000); - Page negativePage = caseVerifService.pageByBooks(Page.of(param.getCurrent(), param.getSize()), param); - List list = negativePage.getRecords().stream().map(item -> { - DataPetitionComplaintExportGabxfVo vo = new DataPetitionComplaintExportGabxfVo(); + Page pages = dataPetition12337Service.pageExportVo(param); + pages.getRecords().forEach(item -> { + if (StrUtil.isNotBlank(item.getHandlePolices())) { + item.setReviewPersonName(JSON.parseArray(item.getHandlePolices()).getJSONObject(0).getString("name")); + } + }); + String headerValue = "attachment; filename=\"" + URLEncoder.encode("12337信访投诉数据台账.xlsx", "UTF-8") + "\""; + response.setHeader("Content-Disposition", headerValue); + response.setContentType("application/octet-stream"); + EasyExcel.write(response.getOutputStream(), DataPetition12337ExportVo.class).inMemory(Boolean.TRUE).sheet("12337信访投诉数据台账").doWrite(pages.getRecords()); + } + + /** + * 审计台账 + * + * @param param + * @throws IOException + */ + @GetMapping("audit") + public Result> auditPage(NegativeQueryParam param) { + return Result.success(negativeBookService.auditPage(param)); + } + + private final NegativeProblemRelationService negativeProblemRelationService; + + private final NegativeFileService negativeFileService; + + private final FileService fileService; + + /** + * 审计台账导出 + * + * @param param + * @throws IOException + */ + @GetMapping("export/audit") + public void audit(NegativeQueryParam param, HttpServletResponse response) throws IOException { + param.setCurrent(1); + param.setSize(100000); + Page pages = negativeBookService.auditPage(param); + List negativeIds = pages.getRecords().stream().map(Negative::getId).toList(); + boolean emptyFlag = negativeIds.isEmpty(); + List negativeBlames = emptyFlag ? new ArrayList<>() : blameService.listByNegativeIds(negativeIds); + List problemRelations = emptyFlag ? new ArrayList<>() : negativeProblemRelationService.list(negativeIds); + List negativeFiles = emptyFlag ? new ArrayList<>() : negativeFileService.listByNegativeIds(negativeIds); + List list = pages.getRecords().stream().map(item -> { + NegativeAuditExportVo vo = new NegativeAuditExportVo(); BeanUtil.copyProperties(item, vo); + vo.setProblems(problemRelations.stream() + .filter(problem -> StrUtil.isNotBlank(problem.getOneLevelContent()) && StrUtil.isNotBlank(problem.getTwoLevelContent()) && StrUtil.isNotBlank(problem.getThreeLevelContentOther())) + .map(problem -> String.format("%s / %s / %s", problem.getOneLevelContent(), problem.getTwoLevelContent(), problem.getThreeLevelContentOther())) + .collect(Collectors.joining("、"))); + vo.setProblems(negativeBlames.stream() + .filter(blame -> StrUtil.isNotBlank(blame.getBlameName()) && StrUtil.isNotBlank(blame.getBlameEmpNo())) + .map(blame -> blame.getBlameName() + "-" + blame.getBlameEmpNo()) + .collect(Collectors.joining("、"))); + AtomicInteger i = new AtomicInteger(0); + List imageDataList = negativeFiles.stream().filter(file -> item.getId().equals(file.getNegtiveId())) + // 过滤图片 + .filter(file -> ImgUtil.isImg(file.getFileName())).map(file -> { + // 下载文件 + InputStream is = fileService.download(file.getFilePath()); + byte[] bytes = IoUtil.readBytes(is); + ImageData imageData = new ImageData(); + imageData.setImage(bytes); + imageData.setTop(0); + imageData.setBottom(0); + imageData.setLeft(i.get() * 10 + (i.get() == 0 ? 0 : 5)); // 0 15 25 + System.out.println(i.get() * 10 + (i.get() == 0 ? 0 : 5)); + imageData.setRight(i.get() * 15 + 10); // 10 25 35 + System.out.println(i.get() * 15 + 10); + System.out.println("==================="); + i.getAndIncrement(); + return imageData; + }).toList(); + WriteCellData writeCellData = new WriteCellData<>(); + writeCellData.setImageDataList(imageDataList); + vo.setFiles(writeCellData); return vo; }).toList(); - - String headerValue = "attachment; filename=\"" + URLEncoder.encode("12337信访投诉数据台账.xlsx", "UTF-8") + "\""; + String headerValue = "attachment; filename=\"" + URLEncoder.encode("审计监督数据台账.xlsx", "UTF-8") + "\""; response.setHeader("Content-Disposition", headerValue); response.setContentType("application/octet-stream"); - EasyExcel.write(response.getOutputStream(), DataPetitionComplaintExportGabxfVo.class).inMemory(Boolean.TRUE).sheet("12337信访投诉数据台账").doWrite(list); - + EasyExcel.write(response.getOutputStream(), NegativeAuditExportVo.class).inMemory(Boolean.TRUE).sheet("审计监督数据台账").doWrite(list); } } diff --git a/src/main/java/com/biutag/supervision/controller/data/DataCaseVerifController.java b/src/main/java/com/biutag/supervision/controller/data/DataCaseVerifController.java index 4bb893a..222cb42 100644 --- a/src/main/java/com/biutag/supervision/controller/data/DataCaseVerifController.java +++ b/src/main/java/com/biutag/supervision/controller/data/DataCaseVerifController.java @@ -13,9 +13,11 @@ import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.dto.DataCaseVerifDistribute; import com.biutag.supervision.pojo.dto.DataCaseVerifImportDto; import com.biutag.supervision.pojo.entity.DataCaseVerif; +import com.biutag.supervision.pojo.entity.Negative; import com.biutag.supervision.pojo.entity.SupDepart; import com.biutag.supervision.pojo.param.DataCaseVerifQueryParam; import com.biutag.supervision.service.DataCaseVerifService; +import com.biutag.supervision.service.NegativeService; import com.biutag.supervision.service.SupDepartService; import jakarta.validation.ConstraintViolation; import jakarta.validation.Validator; @@ -27,6 +29,7 @@ import org.springframework.web.multipart.MultipartFile; import java.io.IOException; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; @@ -40,6 +43,8 @@ public class DataCaseVerifController { private final SupDepartService departService; + private final NegativeService negativeService; + private final Validator validator; @GetMapping @@ -47,6 +52,15 @@ public class DataCaseVerifController { return Result.success(dataCaseVerifService.page(queryParam)); } + @GetMapping("getNegativeId") + public Result getNegativeId(String originId) { + Negative negative = negativeService.getByOriginId(originId); + if (Objects.isNull(negative)) { + throw new RuntimeException("未匹配到案件编号,无法查看详情"); + } + return Result.success(negative.getId()); + } + @PostMapping("import") public Result> importExcel(@RequestPart("file") MultipartFile file) throws IOException { log.info("文件导入中------------------------------"); diff --git a/src/main/java/com/biutag/supervision/controller/data/DataMailBoxController.java b/src/main/java/com/biutag/supervision/controller/data/DataMailBoxController.java new file mode 100644 index 0000000..e4b559c --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/data/DataMailBoxController.java @@ -0,0 +1,51 @@ +package com.biutag.supervision.controller.data; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.constants.enums.ProblemSourcesEnum; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.param.NegativeQueryParam; +import com.biutag.supervision.service.NegativeService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author wxc + * @date 2025/2/14 + */ +@Slf4j +@RequestMapping("data/mailbox") +@RequiredArgsConstructor +@RestController +public class DataMailBoxController { + + private final NegativeService negativeService; + + @GetMapping + public Result> list(NegativeQueryParam param) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() + .eq(Negative::getProblemSourcesCode, ProblemSourcesEnum.JZXX.getValue()) + .like(StrUtil.isNotBlank(param.getOriginId()), Negative::getOriginId, param.getOriginId()) + .like(StrUtil.isNotBlank(param.getThingDesc()), Negative::getThingDesc, param.getThingDesc()); + if (param.getDiscoveryTime().size() == 2) { + queryWrapper.between(Negative::getDiscoveryTime, param.getDiscoveryTime().get(0), param.getDiscoveryTime().get(1)); + } + if (StrUtil.isNotBlank(param.getResponderKey()) && StrUtil.isNotBlank(param.getResponderValue())) { + switch (param.getResponderKey()) { + case "name": + queryWrapper.like(Negative::getResponderName, param.getResponderValue()); + break; + case "phone": + queryWrapper.like(Negative::getContactPhone, param.getResponderValue()); + break; + } + } + return Result.success(negativeService.page(Page.of(param.getCurrent(), param.getSize()), queryWrapper)); + } + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaint12337Controller.java b/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaint12337Controller.java index f8cfa6e..9e705b3 100644 --- a/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaint12337Controller.java +++ b/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaint12337Controller.java @@ -57,21 +57,12 @@ public class DataPetitionComplaint12337Controller { @GetMapping public Result> list(DataPetitionComplaintQueryParam queryParam) { Page dataPetition12337Page = dataPetition12337Service.page(queryParam); - Page dataPetition12337VoPage =null; - // 获取分页内容并转换为 DataPetition12337Vo 对象 - if ( dataPetition12337Page !=null ){ - List records = dataPetition12337Page.getRecords(); - ArrayList voList = new ArrayList<>(); - for (DataPetition12337 oneRecord : records) { - DataPetition12337Vo dataPetition12337Vo = new DataPetition12337Vo(); - BeanUtils.copyProperties(oneRecord,dataPetition12337Vo); - voList.add(dataPetition12337Vo); - } - dataPetition12337VoPage = new Page<>(dataPetition12337Page.getCurrent(), dataPetition12337Page.getSize(), dataPetition12337Page.getTotal()); - dataPetition12337VoPage.setRecords(voList); - } - - return Result.success(dataPetition12337VoPage); + List list = dataPetition12337Page.getRecords().stream().map(item -> { + DataPetition12337Vo vo = new DataPetition12337Vo(); + BeanUtils.copyProperties(item, vo); + return vo; + }).toList(); + return Result.success(new Page().setTotal(dataPetition12337Page.getTotal()).setRecords(list)); } @@ -135,7 +126,6 @@ public class DataPetitionComplaint12337Controller { response.setHeader("Content-Disposition", headerValue); response.setContentType("application/octet-stream"); EasyExcel.write(response.getOutputStream(), DataPetition12337ExportDto.class).inMemory(Boolean.TRUE).sheet("问题台账").doWrite(list); - } diff --git a/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java b/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java index 80b188f..9b221c4 100644 --- a/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java +++ b/src/main/java/com/biutag/supervision/controller/data/DataPetitionComplaintController.java @@ -1,6 +1,7 @@ package com.biutag.supervision.controller.data; import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.ExcelReader; @@ -9,23 +10,26 @@ import com.alibaba.excel.read.listener.ReadListener; import com.alibaba.excel.read.metadata.ReadSheet; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.biutag.supervision.constants.enums.DistributionStateEnum; -import com.biutag.supervision.constants.enums.InitialPetition; -import com.biutag.supervision.constants.enums.ProblemSourcesEnum; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.enums.*; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.dto.DataDataPetitionComplainDistribute; import com.biutag.supervision.pojo.dto.DataPetitionComplaintGjImportDto; import com.biutag.supervision.pojo.dto.DataPetitionComplaintImportDto; import com.biutag.supervision.pojo.entity.DataPetitionComplaint; +import com.biutag.supervision.pojo.entity.NegativeTask; import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.pojo.param.DataPetitionComplaintQueryParam; import com.biutag.supervision.pojo.vo.DataPetitionComplaintVo; import com.biutag.supervision.service.DataPetitionComplaintService; +import com.biutag.supervision.service.NegativeTaskService; import com.biutag.supervision.service.SupDepartService; import jakarta.validation.Validator; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -51,7 +55,7 @@ public class DataPetitionComplaintController { private final SupDepartService departService; - private final Validator validator; + private final NegativeTaskService negativeTaskService; @GetMapping public Result> list(DataPetitionComplaintQueryParam queryParam) { @@ -108,6 +112,7 @@ public class DataPetitionComplaintController { } @PostMapping("gab") + @Transactional(rollbackFor = Exception.class) public Result add(@RequestBody List list) { List petitionComplaints = list.stream().map(item -> { DataPetitionComplaint dataPetitionComplaint = new DataPetitionComplaint(); @@ -140,6 +145,17 @@ public class DataPetitionComplaintController { return dataPetitionComplaint; }).toList(); dataPetitionComplaintService.saveOrUpdateBatch(petitionComplaints); + UserAuth user = UserContextHolder.getCurrentUser(); + NegativeTask task = new NegativeTask() + .setId(IdUtil.getSnowflakeNextIdStr()) + .setImportRow(petitionComplaints.size()) + .setSource("公安部信访") + .setCrtTime(LocalDateTime.now()) + .setCrtUser(user.getNickName()) + .setCrtUsername(user.getUserName()) + .setCategory(NegativeTaskCategoryEnum.IMPORT.getValue()) + .setStatus(NegativeTaskStatusEnum.SUCCESS.getValue()); + negativeTaskService.save(task); return Result.success(); } @@ -219,6 +235,17 @@ public class DataPetitionComplaintController { return dataPetitionComplaint; }).toList(); dataPetitionComplaintService.saveOrUpdateBatch(petitionComplaints); + UserAuth user = UserContextHolder.getCurrentUser(); + NegativeTask task = new NegativeTask() + .setId(IdUtil.getSnowflakeNextIdStr()) + .setImportRow(petitionComplaints.size()) + .setSource("国家信访") + .setCrtTime(LocalDateTime.now()) + .setCrtUser(user.getNickName()) + .setCrtUsername(user.getUserName()) + .setCategory(NegativeTaskCategoryEnum.IMPORT.getValue()) + .setStatus(NegativeTaskStatusEnum.SUCCESS.getValue()); + negativeTaskService.save(task); return Result.success(); } diff --git a/src/main/java/com/biutag/supervision/controller/data/VideoInspectionController.java b/src/main/java/com/biutag/supervision/controller/data/VideoInspectionController.java index 982e4cd..36246d4 100644 --- a/src/main/java/com/biutag/supervision/controller/data/VideoInspectionController.java +++ b/src/main/java/com/biutag/supervision/controller/data/VideoInspectionController.java @@ -1,7 +1,9 @@ package com.biutag.supervision.controller.data; +import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -14,14 +16,18 @@ import com.biutag.supervision.pojo.dto.VideoInspectionDistributeDto; import com.biutag.supervision.pojo.entity.*; import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.pojo.param.VideoInspectionQueryParam; +import com.biutag.supervision.pojo.vo.FileVo; import com.biutag.supervision.pojo.vo.VideoInspectionInfo; import com.biutag.supervision.pojo.vo.VideoInspectionVo; import com.biutag.supervision.service.*; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; +import java.io.IOException; +import java.io.InputStream; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.ArrayList; @@ -31,6 +37,7 @@ import java.util.List; * @author wxc * @date 2025/1/2 */ +@Slf4j @RequiredArgsConstructor @RequestMapping("videoInspection") @RestController @@ -52,15 +59,15 @@ public class VideoInspectionController { private final SupExternalDepartService externalDepartService; - @Value("${videoInspection.url}") - private String videoInspectionUrl; + private final FileService fileService; @GetMapping public Result> list(VideoInspectionQueryParam param) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.like(StrUtil.isNotBlank(param.getSystemKeyName()), "d.systemKeyName", param.getSystemKeyName()) - .like(StrUtil.isNotBlank(param.getSystemKeyName()), "d.title", param.getTitle()); + .like(StrUtil.isNotBlank(param.getTitle()), "d.title", param.getTitle()) + .eq("i.state", param.getState()) + .eq(StrUtil.isNotBlank(param.getDistributionState()), "i.distribution_state", param.getDistributionState()); if (StrUtil.isNotBlank(param.getDepartId())) { // 发生单位代码 List externalDepartList = externalDepartService.list(new LambdaUpdateWrapper().eq(SupExternalDepart::getInternalId, param.getDepartId()).eq(SupExternalDepart::getSource, @@ -68,7 +75,7 @@ public class VideoInspectionController { if (externalDepartList.isEmpty()) { return Result.success(new Page().setRecords(new ArrayList<>()).setTotal(0)); } - queryWrapper.in("", externalDepartList.stream().map(SupExternalDepart::getExternalId).toList()); + queryWrapper.in("i.fsdw_gajgjgdm", externalDepartList.stream().map(SupExternalDepart::getExternalId).toList()); } return Result.success(dataAlarmDispositionInfoMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper)); @@ -78,10 +85,7 @@ public class VideoInspectionController { public Result get(@PathVariable String id) { DataAlarmAlarmInfo alarmInfo = dataAlarmAlarmInfoService.getById(id); DataAlarmDispositionInfo dispositionInfo = dispositionInfoService.getOne(new LambdaUpdateWrapper().eq(DataAlarmDispositionInfo::getAlarmInfoId, id)); - List list = dataAlarmYjzjService.list(new LambdaUpdateWrapper().eq(DataAlarmYjzj::getAlarm_info_id, id)); - list.forEach(item -> { - item.setDzwjwz(videoInspectionUrl + item.getDzwjwz()); - }); + List list = dataAlarmYjzjService.list(id); VideoInspectionInfo info = new VideoInspectionInfo(); info.setZlList(list); info.setRqsj(alarmInfo.getRQSJ()); @@ -95,6 +99,18 @@ public class VideoInspectionController { return Result.success(info); } + /** + * 更新数据状态 + * @return + */ + @PutMapping("state/{id}") + public Result updateState(@PathVariable String id, String state) { + dataAlarmAlarmInfoService.update(new LambdaUpdateWrapper().eq(DataAlarmAlarmInfo::getId, id) + .set(DataAlarmAlarmInfo::getState, state) + .set(DataAlarmAlarmInfo::getUpdateTime, LocalDateTime.now())); + return Result.success(); + } + /** * 下发 * @param distributeData @@ -112,6 +128,7 @@ public class VideoInspectionController { negativeTask.setSource("视频督察"); UserAuth user = UserContextHolder.getCurrentUser(); negativeTask.setCrtUser(user.getNickName()); + negativeTask.setCrtUsername(user.getUserName()); negativeTaskService.save(negativeTask); data.forEach(item -> { if (StrUtil.isBlank(item.getFsdwGajgjgdm())) { @@ -123,30 +140,35 @@ public class VideoInspectionController { if (externalDepart == null || StrUtil.isBlank(externalDepart.getInternalId())) { throw new RuntimeException(String.format("%s-%s 未匹配单位映射,请联系管理员", item.getFsdwGajgmc(), item.getFsdwGajgjgdm())); } - SupDepart depart = departService.getById(externalDepart.getInternalId()); + // 问题涉及单位 + SupDepart involveDepart = departService.getById(externalDepart.getInternalId()); + // 办理单位 + SupDepart handleDepart; + if (StrUtil.isBlank(distributeData.getHandleDepartId())) { + handleDepart = involveDepart; + } else { + handleDepart = departService.getById(distributeData.getHandleDepartId()); + } NegativeDto negativeDto = new NegativeDto(); negativeDto.setThingDesc(item.getContent()); negativeDto.setDiscoveryTime(LocalDateTime.parse(item.getRqsj(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); - negativeDto.setInvolveDepartId(depart.getId()); - negativeDto.setInvolveDepartName(depart.getShortName()); + negativeDto.setInvolveDepartId(involveDepart.getId()); + negativeDto.setInvolveDepartName(involveDepart.getShortName()); negativeDto.setBusinessTypeCode(distributeData.getBusinessTypeCode()); negativeDto.setPoliceType(distributeData.getPoliceType()); negativeDto.setInvolveProblem(distributeData.getInvolveProblem()); // 视频督察 negativeDto.setProblemSourcesCode(ProblemSourcesEnum.SPDC.getValue()); negativeDto.setProblemSources(ProblemSourcesEnum.SPDC.getLabel()); - if (DepartLevelEnum.SECOND.getValue().equals(depart.getLevel())) { - negativeDto.setDepartId(depart.getId()); - negativeDto.setDepartName(depart.getShortName()); + if (DepartLevelEnum.SECOND.getValue().equals(handleDepart.getLevel())) { + negativeDto.setDepartId(handleDepart.getId()); - } else if(DepartLevelEnum.THREE.getValue().equals(depart.getLevel())) { + } else if(DepartLevelEnum.THREE.getValue().equals(handleDepart.getLevel())) { if (DistributionFlowEnum.SECOND.getValue().equals(distributeData.getDistributionFlow())) { - SupDepart parent = departService.getById(depart.getPid()); + SupDepart parent = departService.getById(handleDepart.getPid()); negativeDto.setDepartId(parent.getId()); - negativeDto.setDepartName(parent.getShortName()); } else { - negativeDto.setDepartId(depart.getId()); - negativeDto.setDepartName(depart.getShortName()); + negativeDto.setDepartId(handleDepart.getId()); } } else { throw new RuntimeException("数据异常,请联系系统管理员"); @@ -158,10 +180,30 @@ public class VideoInspectionController { negativeDto.setMaxHandleDuration(distributeData.getMaxHandleDuration()); negativeDto.setMaxExtensionDuration(distributeData.getMaxExtensionDuration()); negativeDto.setTaskId(negativeTask.getId()); + // 文件 + List list = dataAlarmYjzjService.list(item.getId()); + if (list.size() > 3) { + // 至少展示三张 ,前后各一张及中间一张 + list = List.of(list.get(0), list.get(list.size() / 2), list.get(list.size() - 1)); + } + List thingFiles = list.stream().map(file -> { + FileVo fileVo = new FileVo(); + String url = file.getDzwjwz(); + String fileName = url.substring(url.lastIndexOf("\\") + 1); + fileVo.setFileName(fileName); + InputStream is = HttpUtil.createGet(url).execute().bodyStream(); + try { + String path = fileService.upload(is, is.available(), FileUtil.extName(fileName)); + fileVo.setFilePath(path); + } catch (IOException e) { + log.error(e.getMessage(), e); + } + return fileVo; + }).toList(); + negativeDto.setThingFiles(thingFiles); negativeService.save(negativeDto); // 更新状态 dataAlarmAlarmInfoService.update(new LambdaUpdateWrapper().eq(DataAlarmAlarmInfo::getId, item.getId()).set(DataAlarmAlarmInfo::getDistributionState, DistributionStateEnum.DISTRIBUTED.getValue())); - }); return Result.success(); } diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataVAuditController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVAuditController.java index 708cf50..87ec5ef 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVAuditController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVAuditController.java @@ -1,7 +1,9 @@ package com.biutag.supervision.controller.datav; +import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSONObject; import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.News; import com.biutag.supervision.pojo.vo.NewsVo; import com.biutag.supervision.service.NewsService; import io.swagger.v3.oas.annotations.tags.Tag; @@ -29,17 +31,14 @@ import static com.biutag.supervision.constants.WorkDynamicConstants.SJGZDT; @RequiredArgsConstructor @RestController public class DataVAuditController { - private final NewsService newsService; - - + private final NewsService newsService; @GetMapping("/getWorkDynamics") - public Result getWorkDynamics(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + public Result> getWorkDynamics(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - List newsVoList = newsService.getWorkDynamics(beginTime, endTime, SJGZDT, null); - JSONObject data = new JSONObject().fluentPut("newsVoList", newsVoList); - return Result.success(data); + List newsList = newsService.getWorkDynamics(beginTime, DateUtil.endOfDay(endTime), SJGZDT, null); + return Result.success(newsList); } } diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java index 2ba1f91..6c2f1a9 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java @@ -1,8 +1,10 @@ package com.biutag.supervision.controller.datav; +import cn.hutool.core.date.DateUtil; import com.alibaba.fastjson.JSONObject; import com.biutag.supervision.mapper.NegativeMapper; import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.News; import com.biutag.supervision.pojo.vo.*; import com.biutag.supervision.service.NewsService; import io.swagger.v3.oas.annotations.Operation; @@ -20,6 +22,7 @@ import java.util.Date; import java.util.List; import static com.biutag.supervision.constants.WorkDynamicConstants.DCGZDT; +import static com.biutag.supervision.constants.WorkDynamicConstants.SJGZDT; import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.XCDC; import static com.biutag.supervision.constants.enums.ProblemSourcesEnum.ZXDC; @@ -137,8 +140,7 @@ public class DataVSupervisionNotifyController { // region 右边 /** - * 黄赌毒数据 - * + * 获取问题数 * @param beginTime 开始时间 * @param endTime 结束时间 * @return JSONObject @@ -146,124 +148,20 @@ public class DataVSupervisionNotifyController { @Operation(summary = "黄赌毒数据") @GetMapping("/getYellowBetDrug") public Result getYellowBetDrug(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - // 黄赌毒总览 - DayTimeSuperviseVo fxsjYellowBetOverview = negativeMapper.getYellowBetOverview(beginTime, endTime, 3, 1); - DayTimeSuperviseVo jsdwYellowBetOverview = negativeMapper.getYellowBetOverview(beginTime, endTime, 4, 1); - List fxsjYellowBetRankList = negativeMapper.getYellowBetRankList(beginTime, endTime, 3, 1); - List jsdwYellowBetRankList = negativeMapper.getYellowBetRankList(beginTime, endTime, 4, 1); - - JSONObject data = new JSONObject() - .fluentPut("fxsjYellowBetOverview", fxsjYellowBetOverview) - .fluentPut("jsdwYellowBetOverview", jsdwYellowBetOverview) - .fluentPut("fxsjYellowBetRankList", fxsjYellowBetRankList) - .fluentPut("jsdwYellowBetRankList", jsdwYellowBetRankList); - return Result.success(data); - } - - - /** - * 枪支管理数据 - * - * @param beginTime 开始时间 - * @param endTime 结束时间 - * @return JSONObject - */ - @Operation(summary = "枪支管理数据") - @GetMapping("/getGunController") - public Result getGunController(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - // 枪支管理总览 - DayTimeSuperviseVo fxsjGunControllerOverview = negativeMapper.getYellowBetOverview(beginTime, endTime, 3, 2); - DayTimeSuperviseVo jsdwGunControllerOverview = negativeMapper.getYellowBetOverview(beginTime, endTime, 4, 2); - // 枪支管理列表 - List fxsjGunControllerRankList = negativeMapper.getYellowBetRankList(beginTime, endTime, 3, 2); - List jsdwGunControllerRankList = negativeMapper.getYellowBetRankList(beginTime, endTime, 4, 2); - - JSONObject data = new JSONObject() - .fluentPut("fxsjGunControllerOverview", fxsjGunControllerOverview) - .fluentPut("jsdwGunControllerOverview", jsdwGunControllerOverview) - .fluentPut("fxsjGunControllerRankList", fxsjGunControllerRankList) - .fluentPut("jsdwGunControllerRankList", jsdwGunControllerRankList); - return Result.success(data); - } - - /** - * 涉企问题数据 - * - * @param beginTime 开始时间 - * @param endTime 结束时间 - * @return JSONObject - */ - @Operation(summary = "涉企问题数据") - @GetMapping("/getCompanyProblem") - public Result getCompanyProblem(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - // 涉企问题总览 - DayTimeSuperviseVo fxsjCompanyProblemOverview = negativeMapper.getYellowBetOverview(beginTime, endTime, 3, 3); - DayTimeSuperviseVo jsdwCompanyProblemOverview = negativeMapper.getYellowBetOverview(beginTime, endTime, 4, 3); - // 涉企问题列表 - List fxsjCompanyProblemRankList = negativeMapper.getYellowBetRankList(beginTime, endTime, 3, 3); - List jsdwCompanyProblemRankList = negativeMapper.getYellowBetRankList(beginTime, endTime, 4, 3); + @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime, + String dictValue) { + // 分县市局 + DayTimeSuperviseVo countyOverview = negativeMapper.getYellowBetOverview(beginTime, endTime, 3, dictValue); + List countyRankList = negativeMapper.getYellowBetRankList(beginTime, endTime, 3, dictValue); + // 局属单位 + DayTimeSuperviseVo bureauOverview = negativeMapper.getYellowBetOverview(beginTime, endTime, 4, dictValue); + List bureauRankList = negativeMapper.getYellowBetRankList(beginTime, endTime, 4, dictValue); JSONObject data = new JSONObject() - .fluentPut("fxsjCompanyProblemOverview", fxsjCompanyProblemOverview) - .fluentPut("jsdwCompanyProblemOverview", jsdwCompanyProblemOverview) - .fluentPut("fxsjCompanyProblemRankList", fxsjCompanyProblemRankList) - .fluentPut("jsdwCompanyProblemRankList", jsdwCompanyProblemRankList); - return Result.success(data); - } - - /** - * 执法办案数据 - * - * @param beginTime 开始时间 - * @param endTime 结束时间 - * @return JSONObject - */ - @Operation(summary = "执法办案数据") - @GetMapping("/getHandleCase") - public Result getHandleCase(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - // 执法办案总览 - DayTimeSuperviseVo fxsjHandleCaseOverview = negativeMapper.getYellowBetOverview(beginTime, endTime, 3, 4); - DayTimeSuperviseVo jsdwHandleCaseOverview = negativeMapper.getYellowBetOverview(beginTime, endTime, 4, 4); - // 执法办案列表 - List fxsjHandleCaseRankList = negativeMapper.getYellowBetRankList(beginTime, endTime, 3, 4); - List jsdwHandleCaseRankList = negativeMapper.getYellowBetRankList(beginTime, endTime, 4, 4); - - JSONObject data = new JSONObject() - .fluentPut("fxsjHandleCaseOverview", fxsjHandleCaseOverview) - .fluentPut("jsdwHandleCaseOverview", jsdwHandleCaseOverview) - .fluentPut("fxsjHandleCaseRankList", fxsjHandleCaseRankList) - .fluentPut("jsdwHandleCaseRankList", jsdwHandleCaseRankList); - return Result.success(data); - } - - - /** - * 工作日测酒数据 - * - * @param beginTime 开始时间 - * @param endTime 结束时间 - * @return JSONObject - */ - @Operation(summary = "工作日测酒数据") - @GetMapping("/getCheckBeer") - public Result getCheckBeer(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, - @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - // 工作日测酒总览 - DayTimeSuperviseVo fxsjCheckBeerOverview = negativeMapper.getYellowBetOverview(beginTime, endTime, 3, 5); - DayTimeSuperviseVo jsdwCheckBeerOverview = negativeMapper.getYellowBetOverview(beginTime, endTime, 4, 5); - // 工作日测酒列表 - List fxsjCheckBeerRankList = negativeMapper.getYellowBetRankList(beginTime, endTime, 3, 5); - List jsdwCheckBeerRankList = negativeMapper.getYellowBetRankList(beginTime, endTime, 4, 5); - - JSONObject data = new JSONObject() - .fluentPut("fxsjCheckBeerOverview", fxsjCheckBeerOverview) - .fluentPut("jsdwCheckBeerOverview", jsdwCheckBeerOverview) - .fluentPut("fxsjCheckBeerRankList", fxsjCheckBeerRankList) - .fluentPut("jsdwCheckBeerRankList", jsdwCheckBeerRankList); + .fluentPut("countyOverview", countyOverview) + .fluentPut("countyRankList", countyRankList) + .fluentPut("bureauOverview", bureauOverview) + .fluentPut("bureauRankList", bureauRankList); return Result.success(data); } @@ -276,11 +174,10 @@ public class DataVSupervisionNotifyController { */ @Operation(summary = "督察工作动态") @GetMapping("/getWorkDynamics") - public Result getWorkDynamics(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, + public Result> getWorkDynamics(@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - List newsVoList = newsService.getWorkDynamics(beginTime, endTime, DCGZDT, null); - JSONObject data = new JSONObject().fluentPut("newsVoList", newsVoList); - return Result.success(data); + List newsList = newsService.getWorkDynamics(beginTime, endTime, DCGZDT, null); + return Result.success(newsList); } // endregion diff --git a/src/main/java/com/biutag/supervision/controller/rightsComfort/ComfortController.java b/src/main/java/com/biutag/supervision/controller/rightsComfort/ComfortController.java index 75f6f6c..a9ac2bf 100644 --- a/src/main/java/com/biutag/supervision/controller/rightsComfort/ComfortController.java +++ b/src/main/java/com/biutag/supervision/controller/rightsComfort/ComfortController.java @@ -1,8 +1,5 @@ package com.biutag.supervision.controller.rightsComfort; -import cn.hutool.core.collection.CollectionUtil; -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -14,16 +11,12 @@ import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.domain.RpcApplyDetail; import com.biutag.supervision.pojo.dto.RpcApplyApproveDto; import com.biutag.supervision.pojo.dto.RpcApplyDto; -import com.biutag.supervision.pojo.entity.RpcApply; -import com.biutag.supervision.pojo.entity.RpcApplyPerson; -import com.biutag.supervision.pojo.entity.RpcApplyWork; -import com.biutag.supervision.pojo.entity.RpcPerson; +import com.biutag.supervision.pojo.entity.*; +import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.pojo.param.RpcApplyQueryParam; import com.biutag.supervision.pojo.vo.RpcApplyVo; import com.biutag.supervision.service.*; -import com.biutag.supervision.util.JSON; import lombok.RequiredArgsConstructor; -import org.springframework.beans.BeanUtils; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; @@ -52,7 +45,6 @@ public class ComfortController { public Result> list(RpcApplyQueryParam queryParam) { return Result.success(rpcApplyService.page(queryParam, RpcApplyTypeEnum.COMFORT.getValue())); } - // 待办 @GetMapping("todo") public Result> todos(RpcApplyQueryParam queryParam) { @@ -68,85 +60,53 @@ public class ComfortController { @GetMapping("{id}") public Result get(@PathVariable String id) { RpcApplyDetail rpcApplyDetail = new RpcApplyDetail(); - rpcApplyDetail.setApply(rpcApplyService.getById(id)); + RpcApply rpcApply = rpcApplyService.getById(id); + rpcApplyDetail.setApply(rpcApply); rpcApplyDetail.setPerson(rpcPersonService.getOne(new LambdaUpdateWrapper().eq(RpcPerson::getRpcId, id))); rpcApplyDetail.setApplyPerson(rpcApplyPersonService.getOne(new LambdaUpdateWrapper().eq(RpcApplyPerson::getRpcId, id))); - rpcApplyDetail.setApproves(rpcApplyApproveService.list(id)); + rpcApplyDetail.setApproves(rpcApplyApproveService.list(rpcApply)); return Result.success(rpcApplyDetail); } @Transactional(rollbackFor = Exception.class) @PostMapping public Result add(@RequestBody RpcApplyDto applyDto) { - RpcApply rpcApply = new RpcApply(); - BeanUtils.copyProperties(applyDto, rpcApply); - rpcApply.setRpcId(IdUtil.fastSimpleUUID()); - rpcApply.setCrtTime(LocalDateTime.now()); - rpcApply.setUptTime(LocalDateTime.now()); - // 警号 - rpcApply.setApplicantEmpNo(applyDto.getEmpNo()); - rpcApply.setType(RpcApplyTypeEnum.COMFORT.getValue()); - int year = DateUtil.year(applyDto.getApplyDate()); - rpcApply.setNumberIndex(rpcApplyService.getNewNumberIndex(year)); - rpcApply.setYear(year); - rpcApply.setNumber(String.format("长公抚申〔%s〕%s号", year, String.format("%03d", rpcApply.getNumberIndex()))); - if (CollectionUtil.isNotEmpty(applyDto.getDocumentFile())) { - rpcApply.setDocumentFile(JSON.toJSONString(applyDto.getDocumentFile())); - } - rpcApply.setRpcStatus(ComfortStatus.approval.name()); - rpcApply.setStep(2); - rpcApplyService.save(rpcApply); - // 已办 - RpcApplyWork done = new RpcApplyWork(); - done.setRpcId(rpcApply.getRpcId()); - done.setStatus(WorkStatusEnum.done.name()); - done.setHandleIdCode(UserContextHolder.getCurrentUser().getUserName()); - done.setCreateTime(LocalDateTime.now()); - done.setStep(2); - rpcApplyWorkService.save(done); - - // 待办 - RpcApplyWork todo = new RpcApplyWork(); - todo.setRpcId(rpcApply.getRpcId()); - todo.setStatus(WorkStatusEnum.todo.name()); - todo.setHandleDepartId(applyDto.getHandleDepartId()); - todo.setStep(2); - todo.setCreateTime(LocalDateTime.now()); - - rpcApplyWorkService.save(todo); - - RpcApplyPerson rpcApplyPerson = new RpcApplyPerson(); - BeanUtils.copyProperties(applyDto, rpcApplyPerson); - rpcApplyPerson.setRpcId(rpcApply.getRpcId()); - rpcApplyPerson.setCreatTime(LocalDateTime.now()); - rpcApplyPerson.setUdpTime(LocalDateTime.now()); - rpcApplyPerson.setType(RpcApplyTypeEnum.COMFORT.getValue()); - rpcApplyPersonService.save(rpcApplyPerson); - - RpcPerson rpcPerson = new RpcPerson(); - BeanUtils.copyProperties(applyDto, rpcPerson); - rpcPerson.setRpcId(rpcApply.getRpcId()); - rpcPersonService.save(rpcPerson); + rpcApplyService.save(applyDto); + return Result.success(); + } + + @Transactional(rollbackFor = Exception.class) + @PutMapping + public Result update(@RequestBody RpcApplyDto applyDto) { + rpcApplyService.remove(applyDto.getRpcId()); + rpcApplyService.save(applyDto); return Result.success(); } @DeleteMapping("{id}") public Result del(@PathVariable String id) { - rpcApplyService.removeById(id); - rpcPersonService.remove(new LambdaQueryWrapper().eq(RpcPerson::getRpcId, id)); - rpcApplyPersonService.remove(new LambdaQueryWrapper().eq(RpcApplyPerson::getRpcId, id)); - rpcApplyWorkService.remove(new LambdaQueryWrapper().eq(RpcApplyWork::getRpcId, id)); + rpcApplyService.remove(id); return Result.success(); } @Transactional(rollbackFor = Exception.class) @PostMapping("approve") public Result approve(@RequestBody RpcApplyApproveDto rpcApplyApproveDto) { + UserAuth user = UserContextHolder.getCurrentUser(); RpcApply rpcApply = rpcApplyService.getById(rpcApplyApproveDto.getRpcId()); rpcApplyWorkService.update(new LambdaUpdateWrapper().eq(RpcApplyWork::getRpcId, rpcApplyApproveDto.getRpcId()) .eq(RpcApplyWork::getStep, rpcApply.getStep()) .set(RpcApplyWork::getStatus, WorkStatusEnum.done.name()) + .set(RpcApplyWork::getHandleIdCode, user.getUserName()) .set(RpcApplyWork::getUpdateTime, LocalDateTime.now())); + RpcApplyApprove rpcApplyApprove = new RpcApplyApprove(); + rpcApplyApprove.setRpcId(rpcApplyApproveDto.getRpcId()); + rpcApplyApprove.setReturnFlag(rpcApplyApproveDto.getReturnFlag()); + rpcApplyApprove.setComments(rpcApplyApproveDto.getComments()); + rpcApplyApprove.setCreateTime(LocalDateTime.now()); + rpcApplyApprove.setHandleName(user.getNickName()); + rpcApplyApprove.setStep(rpcApply.getStep()); + rpcApplyApproveService.save(rpcApplyApprove); if (rpcApplyApproveDto.getReturnFlag()) { // 退回 rpcApplyWorkService.update(new LambdaUpdateWrapper().eq(RpcApplyWork::getRpcId, rpcApplyApproveDto.getRpcId()) @@ -173,9 +133,9 @@ public class ComfortController { .set(RpcApply::getStep, 3) .set(RpcApply::getUptTime, LocalDateTime.now())); } else { - // 办结 + // 待呈报 rpcApplyService.update(new LambdaUpdateWrapper().eq(RpcApply::getRpcId, rpcApplyApproveDto.getRpcId()) - .set(RpcApply::getRpcStatus, ComfortStatus.completed.name()) + .set(RpcApply::getRpcStatus, ComfortStatus.to_be_reported.name()) .set(RpcApply::getUptTime, LocalDateTime.now())); } } diff --git a/src/main/java/com/biutag/supervision/controller/rightsComfort/ComfortPacksController.java b/src/main/java/com/biutag/supervision/controller/rightsComfort/ComfortPacksController.java new file mode 100644 index 0000000..05e8ce0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/rightsComfort/ComfortPacksController.java @@ -0,0 +1,52 @@ +package com.biutag.supervision.controller.rightsComfort; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.ComfortPacksDto; +import com.biutag.supervision.pojo.entity.RpcComfortPacks; +import com.biutag.supervision.pojo.param.RpcComfortPacksParam; +import com.biutag.supervision.pojo.vo.RpcComfortPacksVo; +import com.biutag.supervision.service.RpcComfortPacksService; +import freemarker.template.TemplateException; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.io.IOException; + +/** + * @author wxc + * @date 2025/3/13 + */ +@RequiredArgsConstructor +@RequestMapping("comfort/packs") +@RestController +public class ComfortPacksController { + + private final RpcComfortPacksService rpcComfortPacksService; + + @GetMapping + public Result> list(RpcComfortPacksParam queryParam) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (CollectionUtil.isNotEmpty(queryParam.getReportTime())) { + queryWrapper.between(RpcComfortPacks::getReportTime, queryParam.getReportTime().get(0), queryParam.getReportTime().get(1)); + } + queryWrapper.like(StrUtil.isNotBlank(queryParam.getReportTitle()), RpcComfortPacks::getReportTitle, queryParam.getReportTitle()) + .orderByDesc(RpcComfortPacks::getReportTime); + return Result.success(rpcComfortPacksService.page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper)); + } + + @GetMapping("{id}") + public Result get(@PathVariable String id) { + return Result.success(rpcComfortPacksService.get(id)); + } + + @PostMapping + public Result add(@RequestBody ComfortPacksDto comfortPacksDto) throws TemplateException, IOException { + rpcComfortPacksService.save(comfortPacksDto); + return Result.success(); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/system/RightPersonController.java b/src/main/java/com/biutag/supervision/controller/rightsComfort/RightPersonController.java similarity index 72% rename from src/main/java/com/biutag/supervision/controller/system/RightPersonController.java rename to src/main/java/com/biutag/supervision/controller/rightsComfort/RightPersonController.java index 4d29128..0a10a91 100644 --- a/src/main/java/com/biutag/supervision/controller/system/RightPersonController.java +++ b/src/main/java/com/biutag/supervision/controller/rightsComfort/RightPersonController.java @@ -1,4 +1,4 @@ -package com.biutag.supervision.controller.system; +package com.biutag.supervision.controller.rightsComfort; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -6,11 +6,14 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.entity.RpcRightPerson; +import com.biutag.supervision.pojo.entity.SupDepart; import com.biutag.supervision.pojo.param.RpcRightPersonQueryParam; import com.biutag.supervision.service.RpcRightPersonService; +import com.biutag.supervision.service.SupDepartService; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; +import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -26,6 +29,8 @@ public class RightPersonController { private final RpcRightPersonService rpcRightPersonService; + private final SupDepartService departService; + @GetMapping public Result> list(RpcRightPersonQueryParam queryParam) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() @@ -38,7 +43,16 @@ public class RightPersonController { @GetMapping("depart/{departId}") public Result> list(@PathVariable String departId) { - return Result.success(rpcRightPersonService.list(new LambdaUpdateWrapper().eq(RpcRightPerson::getDepartId, departId))); + SupDepart depart = departService.getById(departId); + if (Objects.isNull(depart)) { + return Result.success(new ArrayList<>()); + } + if (depart.getLevel() == 2) { + return Result.success(rpcRightPersonService.list(new LambdaUpdateWrapper().eq(RpcRightPerson::getDepartId, departId))); + } else if (depart.getLevel() == 3) { + return Result.success(rpcRightPersonService.list(new LambdaUpdateWrapper().eq(RpcRightPerson::getDepartId, depart.getPid()))); + } + return Result.success(new ArrayList<>()); } @PostMapping diff --git a/src/main/java/com/biutag/supervision/controller/sensitiveperception/ModelClueController.java b/src/main/java/com/biutag/supervision/controller/sensitiveperception/ModelClueController.java index 52f9363..82c8435 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitiveperception/ModelClueController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitiveperception/ModelClueController.java @@ -44,7 +44,7 @@ public class ModelClueController { */ @PostMapping("task/distribute/manuel") public Result manuelDistribute(@RequestBody ModelClueTaskDistribute taskDistribute) { - return Result.success(modelClueService.distribution(taskDistribute)); + return Result.success(modelClueService.distributionByManuel(taskDistribute)); } @PostMapping("{id}/updateDepart") diff --git a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java index 7ff5107..babfc6a 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java @@ -3,6 +3,7 @@ package com.biutag.supervision.controller.subdatav; import com.alibaba.fastjson.JSONObject; import com.biutag.supervision.mapper.NegativeMapper; import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.News; import com.biutag.supervision.pojo.vo.*; import com.biutag.supervision.service.NewsService; import com.biutag.supervision.service.SubOneSupervisionNotifyService; @@ -299,12 +300,11 @@ public class SubOneSupervisionNotifyController { */ @Operation(summary = "督察工作动态") @GetMapping("/getSubOneWorkDynamics") - public Result getSubOneWorkDynamics(@RequestParam Integer departId, + public Result> getSubOneWorkDynamics(@RequestParam Integer departId, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date beginTime, @RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime) { - List newsVoList = newsService.getWorkDynamics(beginTime, endTime, DCGZDT, departId.toString()); - JSONObject data = new JSONObject().fluentPut("newsVoList", newsVoList); - return Result.success(data); + List newsList = newsService.getWorkDynamics(beginTime, endTime, DCGZDT, departId.toString()); + return Result.success(newsList); } // endregion diff --git a/src/main/java/com/biutag/supervision/controller/system/DepartController.java b/src/main/java/com/biutag/supervision/controller/system/DepartController.java index 1785a38..5a27b1a 100644 --- a/src/main/java/com/biutag/supervision/controller/system/DepartController.java +++ b/src/main/java/com/biutag/supervision/controller/system/DepartController.java @@ -6,6 +6,8 @@ import cn.hutool.core.util.NumberUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.DepartGroupIdEnum; import com.biutag.supervision.constants.enums.DepartLevelEnum; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.entity.SupDepart; @@ -16,6 +18,7 @@ import com.biutag.supervision.service.SupDepartService; import com.biutag.supervision.service.SupPoliceService; import jakarta.validation.ValidationException; import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; @@ -110,4 +113,24 @@ public class DepartController { return Result.success(departService.list(new LambdaQueryWrapper().eq(SupDepart::getPid, departId).orderByAsc(SupDepart::getOrderNo))); } + /** + * 获取分县市局 + * @return + */ + @GetMapping("tree/countyAndCityBureaus") + public Result> countyAndCityBureaus() { + List children = departService.list(new LambdaQueryWrapper().eq(SupDepart::getStatisticsGroupId, DepartGroupIdEnum.COUNTY_AND_CITY_BUREAUS.getValue()) + .orderByAsc(SupDepart::getOrderNo)) + .stream().map(item -> { + DepartTree departTree = new DepartTree(); + BeanUtils.copyProperties(item, departTree); + return departTree; + }).toList(); + DepartTree root = new DepartTree(); + root.setShortName(AppConstants.ROOT_DEPART_NAME); + root.setId(AppConstants.ROOT_DEPART_ID); + root.setChildren(children); + return Result.success(List.of(root)); + } + } diff --git a/src/main/java/com/biutag/supervision/controller/system/DictContentController.java b/src/main/java/com/biutag/supervision/controller/system/DictContentController.java index 203c210..9f617be 100644 --- a/src/main/java/com/biutag/supervision/controller/system/DictContentController.java +++ b/src/main/java/com/biutag/supervision/controller/system/DictContentController.java @@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.entity.SupDictProblemType; import com.biutag.supervision.pojo.vo.DictContentTree; -import com.biutag.supervision.service.SupDictContentService; +import com.biutag.supervision.service.SupDictProblemTypeService; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.*; @@ -17,7 +17,7 @@ import java.util.List; @RestController public class DictContentController { - private final SupDictContentService dictContentService; + private final SupDictProblemTypeService dictContentService; @GetMapping("tree") public Result> list() { diff --git a/src/main/java/com/biutag/supervision/controller/system/HandleResultMapingController.java b/src/main/java/com/biutag/supervision/controller/system/HandleResultMapingController.java new file mode 100644 index 0000000..61a9b11 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/HandleResultMapingController.java @@ -0,0 +1,66 @@ +package com.biutag.supervision.controller.system; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.SupDictHandleResultMaping; +import com.biutag.supervision.pojo.param.DepartMapingQueryParam; +import com.biutag.supervision.service.SupDictHandleResultMapingService; +import lombok.RequiredArgsConstructor; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; + +/** + * @author wxc + * @date 2024/12/31 + */ +@RequestMapping("handleResultMaping") +@RequiredArgsConstructor +@RestController +public class HandleResultMapingController { + + private final SupDictHandleResultMapingService handleResultMapingService; + + @GetMapping + public Result> list(DepartMapingQueryParam param) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.like(StrUtil.isNotBlank(param.getExternalName()), SupDictHandleResultMaping::getExternalName, param.getExternalName()) + .eq(StrUtil.isNotBlank(param.getInternalId()), SupDictHandleResultMaping::getInternalId, param.getInternalId()) + .orderByDesc(SupDictHandleResultMaping::getCreateTime); + return Result.success(handleResultMapingService.page(Page.of(param.getCurrent(), param.getSize()), queryWrapper)); + } + + @PostMapping + public Result add(@RequestBody SupDictHandleResultMaping data) { + if (handleResultMapingService.exists(new LambdaQueryWrapper() + .eq(SupDictHandleResultMaping::getExternalName, data.getExternalName()))) { + throw new RuntimeException(String.format("处理结果【%s】已存在", StrUtil.trim(data.getExternalName()))); + } + data.setExternalName(StrUtil.trim(data.getExternalName())); + data.setUpdateTime(LocalDateTime.now()); + data.setCreateTime(LocalDateTime.now()); + handleResultMapingService.save(data); + return Result.success(); + } + + @PutMapping + public Result update(@RequestBody SupDictHandleResultMaping data) { + if (handleResultMapingService.exists(new LambdaQueryWrapper() + .eq(SupDictHandleResultMaping::getExternalName, data.getExternalName()) + .ne(SupDictHandleResultMaping::getId, data.getId()))) { + throw new RuntimeException(String.format("单位编码【%s】已存在", data.getExternalName())); + } + data.setUpdateTime(LocalDateTime.now()); + handleResultMapingService.updateById(data); + return Result.success(); + } + + @DeleteMapping("{id}") + public Result del(@PathVariable String id) { + handleResultMapingService.removeById(id); + return Result.success(); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/system/PoliceController.java b/src/main/java/com/biutag/supervision/controller/system/PoliceController.java index 1dd59fc..2c42dcf 100644 --- a/src/main/java/com/biutag/supervision/controller/system/PoliceController.java +++ b/src/main/java/com/biutag/supervision/controller/system/PoliceController.java @@ -17,14 +17,19 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.constants.AppConstants; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.domain.PoliceAuth; +import com.biutag.supervision.pojo.dto.PoliceDto; import com.biutag.supervision.pojo.dto.PoliceImport; +import com.biutag.supervision.pojo.dto.UserDto; import com.biutag.supervision.pojo.entity.*; import com.biutag.supervision.pojo.model.PoliceModel; import com.biutag.supervision.pojo.param.PoliceQueryParam; import com.biutag.supervision.service.*; import jakarta.validation.ConstraintViolation; +import jakarta.validation.Valid; import jakarta.validation.Validator; import lombok.RequiredArgsConstructor; +import org.apache.xmlbeans.UserType; +import org.springframework.beans.BeanUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -46,6 +51,8 @@ public class PoliceController { private final NegSourceAuthorityService negSourceAuthorityService; + private final BaseUserService baseUserService; + private final Validator validator; @GetMapping @@ -60,21 +67,33 @@ public class PoliceController { } @PostMapping - public Result add(@RequestBody SupPolice police) { - SupPolice policeByEmpNo = policeService.getOne(new LambdaQueryWrapper().eq(SupPolice::getEmpNo, police.getEmpNo())); + public Result add(@Valid @RequestBody PoliceDto policeDto) { + SupPolice policeByEmpNo = policeService.getOne(new LambdaQueryWrapper().eq(SupPolice::getEmpNo, policeDto.getEmpNo())); if (Objects.nonNull(policeByEmpNo)) { SupDepart depart = departService.getById(policeByEmpNo.getOrgId()); - throw new RuntimeException(String.format("该人员[%s]已存在于“%s”单位中,请联系二级机构或市局管理员以进行人员调整。", police.getEmpNo(), depart.getName())); + throw new RuntimeException(String.format("该人员[%s]已存在于“%s”单位中,请联系二级机构或市局管理员以进行人员调整。", policeDto.getEmpNo(), depart.getName())); } - SupPolice one = policeService.getOne(new LambdaQueryWrapper().eq(SupPolice::getIdCode, police.getIdCode())); + SupPolice one = policeService.getOne(new LambdaQueryWrapper().eq(SupPolice::getIdCode, policeDto.getIdCode())); if (Objects.nonNull(one)) { SupDepart depart = departService.getById(one.getOrgId()); - throw new RuntimeException(String.format("该人员[%s]已存在于“%s”单位中,请联系二级机构或市局管理员以进行人员调整。", police.getIdCode(), depart.getName())); + throw new RuntimeException(String.format("该人员[%s]已存在于“%s”单位中,请联系二级机构或市局管理员以进行人员调整。", policeDto.getIdCode(), depart.getName())); } + SupPolice police = new SupPolice(); + BeanUtils.copyProperties(policeDto, police); police.setId(IdUtil.getSnowflakeNextIdStr()); police.setUpdatedAt(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT)); police.setCreatedAt(DateUtil.format(new Date(), DatePattern.NORM_DATETIME_FORMAT)); - return Result.success(policeService.save(police)); + policeService.save(police); + if (policeDto.getCreateUserFlag() && !userService.exists(new LambdaQueryWrapper().eq(BaseUser::getUserName, police.getIdCode()))) { + UserDto userDto = new UserDto(); + userDto.setUserName(police.getIdCode()); + userDto.setNickName(police.getName()); + userDto.setPassword(policeDto.getPassword()); + userDto.setUserType("normal"); + userDto.setRoleIds(new ArrayList<>()); + baseUserService.save(userDto); + } + return Result.success(); } @PutMapping @@ -124,7 +143,8 @@ public class PoliceController { @GetMapping("auth/{idCode}") public Result auth(@PathVariable String idCode) { PoliceAuth policeAuth = new PoliceAuth().setDeparts(negDepartAuthorityService.list(idCode).stream().map(NegDepartAuthority::getDepartId).toList()) - .setSources(negSourceAuthorityService.list(idCode).stream().map(NegSourceAuthority::getSource).toList()); + .setSources(negSourceAuthorityService.list(idCode).stream().map(NegSourceAuthority::getSource).toList()) + .setRoleIds(userService.getRoleIds(idCode)); return Result.success(policeAuth); } @@ -132,6 +152,7 @@ public class PoliceController { public Result auth(@PathVariable String idCode, @RequestBody PoliceAuth policeAuth) { negDepartAuthorityService.save(idCode, policeAuth.getDeparts()); negSourceAuthorityService.save(idCode, policeAuth.getSources()); + userService.updateRoleCodeByUserName(idCode, policeAuth.getRoleIds()); return Result.success(); } diff --git a/src/main/java/com/biutag/supervision/controller/system/ProblemTypeMapingController.java b/src/main/java/com/biutag/supervision/controller/system/ProblemTypeMapingController.java index 6eca03f..6a5674f 100644 --- a/src/main/java/com/biutag/supervision/controller/system/ProblemTypeMapingController.java +++ b/src/main/java/com/biutag/supervision/controller/system/ProblemTypeMapingController.java @@ -37,8 +37,9 @@ public class ProblemTypeMapingController { public Result add(@RequestBody SupDictProblemTypeMaping data) { if (problemTypeMapingMapper.exists(new LambdaQueryWrapper() .eq(SupDictProblemTypeMaping::getExternalName, data.getExternalName()))) { - throw new RuntimeException(String.format("单位编码【%s】已存在", data.getExternalName())); + throw new RuntimeException(String.format("问题类型【%s】已存在", StrUtil.trim(data.getExternalName()))); } + data.setExternalName(StrUtil.trim(data.getExternalName())); data.setUpdateTime(LocalDateTime.now()); data.setCreateTime(LocalDateTime.now()); problemTypeMapingMapper.insert(data); diff --git a/src/main/java/com/biutag/supervision/controller/system/VideoConfigController.java b/src/main/java/com/biutag/supervision/controller/system/VideoConfigController.java new file mode 100644 index 0000000..ff433f2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/system/VideoConfigController.java @@ -0,0 +1,79 @@ +package com.biutag.supervision.controller.system; + +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.VideoConfig; +import com.biutag.supervision.pojo.entity.WvpDeviceChannel; +import com.biutag.supervision.pojo.param.VideoConfigQueryParam; +import com.biutag.supervision.service.VideoConfigService; +import com.biutag.supervision.service.WvpDeviceChannelService; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * @author wxc + * @date 2025/2/20 + */ +@RequiredArgsConstructor +@RequestMapping("videoConfig") +@RestController + +public class VideoConfigController { + + private final WvpDeviceChannelService wvpDeviceChannelService; + + private final VideoConfigService videoConfigService; + + @Value("${videoInspection.video-ws}") + private String videoUrl; + + @Value("${videoInspection.video-img-url}") + private String videoImgUrl; + + @GetMapping + public Result> list(VideoConfigQueryParam queryParam) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(StrUtil.isNotBlank(queryParam.getDepartId()), VideoConfig::getDepartId, queryParam.getDepartId()) + .orderByDesc(VideoConfig::getCreateTime); + return Result.success(videoConfigService.page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper)); + } + + @GetMapping("getVideoWsUrl") + public Result getVideoWsUrl() { + return Result.success(videoUrl); + } + + @GetMapping("depart/{departId}") + public Result> list(@PathVariable String departId) { + return Result.success(videoConfigService.list(new LambdaQueryWrapper().eq(VideoConfig::getDepartId, departId).orderByAsc(VideoConfig::getSortId))); + } + + @PostMapping + public Result add(@RequestBody VideoConfig videoConfig) { + videoConfig.setCreateTime(LocalDateTime.now()); + videoConfig.setImgUrl(String.format("%sapi/device/query/snap/%s/%s", videoImgUrl, videoConfig.getParentId(), videoConfig.getDeviceId())); + return Result.success(videoConfigService.save(videoConfig)); + } + + @PutMapping + public Result update(@RequestBody VideoConfig videoConfig) { + return Result.success(videoConfigService.updateById(videoConfig)); + } + + @DeleteMapping("{id}") + public Result update(@PathVariable Integer id) { + return Result.success(videoConfigService.removeById(id)); + } + + @GetMapping("device") + public Result> deviceList() { + return Result.success(wvpDeviceChannelService.getDeviceList()); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/work/MyCountersignController.java b/src/main/java/com/biutag/supervision/controller/work/MyCountersignController.java new file mode 100644 index 0000000..027ae8f --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/work/MyCountersignController.java @@ -0,0 +1,50 @@ +package com.biutag.supervision.controller.work; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeTask; +import com.biutag.supervision.pojo.param.NegativeQueryParam; +import com.biutag.supervision.pojo.vo.NegativeQueryVo; +import com.biutag.supervision.service.NegativeCountersignService; +import com.biutag.supervision.service.NegativeTaskService; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author wxc + * @date 2025/2/14 + */ +@RequestMapping("work/countersign") +@RequiredArgsConstructor +@RestController +public class MyCountersignController { + + private final NegativeCountersignService negativeCountersignService; + + private final NegativeTaskService negativeTaskService; + + @GetMapping + public Result> list(NegativeQueryParam queryParam) { + return Result.success(negativeCountersignService.myCountersignPage(queryParam)); + } + + @PostMapping("export/excel") + public Result export(NegativeQueryParam queryParam) { + queryParam.setSize(10000); + queryParam.setCurrent(1); + Page page = negativeCountersignService.myCountersignPage(queryParam); + NegativeTask negativeTask = negativeTaskService.save(page.getRecords().size()); + negativeTaskService.exportExcel(page.getRecords().stream().map(item -> { + NegativeQueryVo negativeQueryVo = new NegativeQueryVo(); + BeanUtils.copyProperties(item, negativeQueryVo); + return negativeQueryVo; + }).toList(), negativeTask.getId()); + return Result.success(); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/work/NegativeImportController.java b/src/main/java/com/biutag/supervision/controller/work/NegativeImportController.java index a323989..eed44d9 100644 --- a/src/main/java/com/biutag/supervision/controller/work/NegativeImportController.java +++ b/src/main/java/com/biutag/supervision/controller/work/NegativeImportController.java @@ -1,17 +1,21 @@ package com.biutag.supervision.controller.work; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.read.listener.ReadListener; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; import com.biutag.supervision.constants.enums.*; import com.biutag.supervision.flow.FlowService; import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.dto.*; import com.biutag.supervision.pojo.dto.flow.VerifyData; import com.biutag.supervision.pojo.entity.*; +import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.pojo.vo.FileVo; import com.biutag.supervision.service.*; import com.biutag.supervision.util.SpringUtil; @@ -22,6 +26,8 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.*; @Slf4j @@ -39,7 +45,7 @@ public class NegativeImportController { private final SupPoliceService policeService; - private final SupDictContentService supDictContentService; + private final SupDictProblemTypeService supDictContentService; private static Map problemMaps = new HashMap<>(); @@ -57,7 +63,7 @@ public class NegativeImportController { @PostMapping @Transactional(rollbackFor = Exception.class) - public Result> importExcel(@RequestPart("file") MultipartFile file) throws IOException { + public Result importExcel(@RequestPart("file") MultipartFile file) throws IOException { log.info("importExcel-----------------------------------------------"); List negatives = new ArrayList<>(); List blames = new ArrayList<>(); @@ -137,7 +143,6 @@ public class NegativeImportController { negativeDto.setSpecialSupervision("1"); } negativeDto.setDepartId(departId); - negativeDto.setDepartName(departName); negativeDto.setInvolveDepartId(departId); negativeDto.setInvolveDepartName(departName); negativeDto.setApprovalFlow("3"); @@ -218,6 +223,195 @@ public class NegativeImportController { return Result.success(); } + private final SupDictDataService dictDataService; + private final NegativeBlameService blameService; + private final NegativeProblemRelationService negativeProblemRelationService; + + private final SupDictProblemTypeService problemTypeService; + + private final NegativeHistoryService historyService; + + + /** + * 审计导入 + * @param file + * @throws IOException + */ + @PostMapping("sj") + @Transactional(rollbackFor = Exception.class) + public Result importExcelBySj(@RequestPart("file") MultipartFile file) throws IOException { + + List negatives = new ArrayList<>(); + List handleResults = dictDataService.listByDictType("handleResult"); + EasyExcel.read(file.getInputStream(), SjNegativeImportDto.class, new ReadListener() { + @Override + public void invoke(SjNegativeImportDto data, AnalysisContext analysisContext) { + negatives.add(data); + } + + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + System.out.println(analysisContext); + } + }).build().read(EasyExcel.readSheet(0).build()).close(); + System.out.println(negatives); + + for (SjNegativeImportDto negativeDto : negatives) { + Negative negative = new Negative(); + ProblemSourcesEnum problemSourcesEnum = ProblemSourcesEnum.getByLabel(negativeDto.getProblemSources()); + negative.setProblemSourcesCode(problemSourcesEnum.getValue()); + negative.setProblemSources(problemSourcesEnum.getLabel()); + BusinessTypeEnum businessTypeEnum = BusinessTypeEnum.getByLabel(negativeDto.getBusinessTypeName()); + negative.setBusinessTypeCode(businessTypeEnum.getValue()); + negative.setBusinessTypeName(businessTypeEnum.getLabel()); + String originId = negativeService.generateOriginId(negative.getProblemSourcesCode(), negative.getBusinessTypeCode()); + negative.setOriginId(originId); // 如果是空就生成随机的线索源 + if (StrUtil.isNotBlank(negativeDto.getDiscoveryTime())) { + try { + negative.setDiscoveryTime(LocalDateTime.parse(negativeDto.getDiscoveryTime(), DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm"))); + } catch (RuntimeException e) { + log.error(e.getMessage(), e); + } + } + SupDepart depart = departService.getById(negativeDto.getDepartId()); + negative.setThingDesc(negativeDto.getThingDesc()) + .setCaseNumber(negativeDto.getCaseNumber()) + // 属实 + .setCheckStatus(InspectCaseEnum.TRUE.getValue()) + .setCheckStatusName(InspectCaseEnum.TRUE.getLabel()) + // 核查情况 + .setCheckStatusDesc(negativeDto.getRectifyDesc()) + .setRectifyDesc(negativeDto.getRectifyDesc()) + .setId(IdUtil.getSnowflakeNextIdStr()) // negative唯一标识 雪花 + .setProcessingStatus(ProcessingStatusEnum.completed.name()) + .setFlowKey(FlowNodeEnum.COMPLETED.getKey()) // 市局下发 + .setCrtDepartLevel(DepartLevelEnum.FIRST.getValue()) + .setInvolveDepartId(depart.getId()) + .setInvolveDepartName(depart.getShortName()) + .setCrtTime(LocalDateTime.now()) + .setUpdTime(LocalDateTime.now()); + SupDepart handleDepart; + if (StrUtil.isNotBlank(negativeDto.getHandleDepartId())) { + handleDepart = departService.getById(negativeDto.getHandleDepartId()); + } else { + handleDepart = depart; + } + if (handleDepart.getLevel() == 2) { + negative.setHandleSecondDepartId(handleDepart.getId()); + negative.setHandleSecondDepartName(handleDepart.getShortName()); + } + if (handleDepart.getLevel() == 3) { + negative.setHandleThreeDepartId(handleDepart.getId()); + negative.setHandleThreeDepartName(handleDepart.getShortName()); + SupDepart parent = departService.getById(handleDepart.getPid()); + negative.setHandleSecondDepartId(parent.getId()); + negative.setHandleSecondDepartName(parent.getShortName()); + } + negativeService.save(negative); + + UserAuth user = UserContextHolder.getCurrentUser(); + NegativeHistory history = new NegativeHistory(); + history.setHistoryId(IdUtil.getSnowflakeNextIdStr()); + history.setNegativeId(negative.getId()); + history.setDepartName(Optional.ofNullable(user.getDepartName()).orElse(AppConstants.ROOT_DEPART_NAME)); + history.setCrtUser(user.getUserId()); + history.setCrtName(user.getNickName()); + history.setActionName("EXCEL导入"); + history.setCrtTime(LocalDateTime.now()); + historyService.save(history); + if (StrUtil.isNotBlank(negativeDto.getBlameName())) { + SupPolice blamePolice; + if (StrUtil.isNotBlank(negativeDto.getBlameIdCode())) { + blamePolice = policeService.getByIdCode(negativeDto.getBlameIdCode()); + } else { + blamePolice = policeService.list(new LambdaQueryWrapper() + .eq(SupPolice::getName, negativeDto.getBlameName()).eq(SupPolice::getOrgId, negativeDto.getDepartId())) + .stream().findFirst().orElse(null); + } + if (Objects.nonNull(blamePolice)) { + NegativeBlame blame = new NegativeBlame(); + if (StrUtil.isBlank(negativeDto.getHandleResultName())) { + negativeDto.setHandleResultName("不予追责"); + } + String handleResultCode = handleResults.stream().filter(item -> item.getDictLabel().equals(negativeDto.getHandleResultName())).findFirst().map(SupDictData::getDictValue).orElse(null); + blame.setBlameId(IdUtil.getSnowflakeNextIdStr()) + .setNegativeId(negative.getId()) + .setBlameName(blamePolice.getName()) + .setBlameEmpNo(blamePolice.getEmpNo()) + .setBlameIdCode(blamePolice.getIdCode()) + .setIvPersonType(Optional.ofNullable(PersonTypeEnum.getByLabel(blamePolice.getPersonType())).map(PersonTypeEnum::getLabel).orElse(null)) + .setIvPersonTypeCode(blamePolice.getPersonType()) + .setHandleResultName(negativeDto.getHandleResultName()) + .setHandleResultCode(handleResultCode) + .setCrtTime(LocalDateTime.now()) + .setType("personal"); + blameService.save(blame); + if (StrUtil.isNotBlank(negativeDto.getProType())) { + SupDictProblemType threeProblem = problemTypeService.getById(negativeDto.getProType()); + SupDictProblemType twoProblem = problemTypeService.getById(threeProblem.getParentCode()); + SupDictProblemType oneProblem = problemTypeService.getById(twoProblem.getParentCode()); + NegativeProblemRelation problemRelation = new NegativeProblemRelation(); + problemRelation.setBlameId(blame.getBlameId()); + problemRelation.setNegativeId(negative.getId()); + problemRelation.setOneLevelCode(oneProblem.getId()); + problemRelation.setOneLevelContent(oneProblem.getName()); + problemRelation.setTwoLevelCode(twoProblem.getId()); + problemRelation.setTwoLevelContent(twoProblem.getName()); + problemRelation.setThreeLevelCode(threeProblem.getId()); + problemRelation.setThreeLevelContent(threeProblem.getName()); + negativeProblemRelationService.save(problemRelation); + } + } + } + + if (StrUtil.isNotBlank(negativeDto.getBlameName2())) { + SupPolice blamePolice; + if (StrUtil.isNotBlank(negativeDto.getBlameIdCode())) { + blamePolice = policeService.getByIdCode(negativeDto.getBlameIdCode2()); + } else { + blamePolice = policeService.list(new LambdaQueryWrapper() + .eq(SupPolice::getName, negativeDto.getBlameName2()).eq(SupPolice::getOrgId, negativeDto.getDepartId())) + .stream().findFirst().orElse(null); + } + if (Objects.nonNull(blamePolice)) { + NegativeBlame blame = new NegativeBlame(); + if (StrUtil.isBlank(negativeDto.getHandleResultName2())) { + negativeDto.setHandleResultName2("不予追责"); + } + String handleResultCode = handleResults.stream().filter(item -> item.getDictLabel().equals(negativeDto.getHandleResultName2())).findFirst().map(SupDictData::getDictValue).orElse(null); + blame.setBlameId(IdUtil.getSnowflakeNextIdStr()) + .setNegativeId(negative.getId()) + .setBlameName(blamePolice.getName()) + .setBlameEmpNo(blamePolice.getEmpNo()) + .setBlameIdCode(blamePolice.getIdCode()) + .setIvPersonType(Optional.ofNullable(PersonTypeEnum.getByLabel(blamePolice.getPersonType())).map(PersonTypeEnum::getLabel).orElse(null)) + .setIvPersonTypeCode(blamePolice.getPersonType()) + .setHandleResultName(negativeDto.getHandleResultName2()) + .setHandleResultCode(handleResultCode) + .setCrtTime(LocalDateTime.now()) + .setType("personal"); + blameService.save(blame); + if (StrUtil.isNotBlank(negativeDto.getProType())) { + SupDictProblemType threeProblem = problemTypeService.getById(negativeDto.getProType()); + SupDictProblemType twoProblem = problemTypeService.getById(threeProblem.getParentCode()); + SupDictProblemType oneProblem = problemTypeService.getById(twoProblem.getParentCode()); + NegativeProblemRelation problemRelation = new NegativeProblemRelation(); + problemRelation.setBlameId(blame.getBlameId()); + problemRelation.setNegativeId(negative.getId()); + problemRelation.setOneLevelCode(oneProblem.getId()); + problemRelation.setOneLevelContent(oneProblem.getName()); + problemRelation.setTwoLevelCode(twoProblem.getId()); + problemRelation.setTwoLevelContent(twoProblem.getName()); + problemRelation.setThreeLevelCode(threeProblem.getId()); + problemRelation.setThreeLevelContent(threeProblem.getName()); + negativeProblemRelationService.save(problemRelation); + } + } + + } + } + return Result.success(); + } } diff --git a/src/main/java/com/biutag/supervision/controller/work/NegativeTaskController.java b/src/main/java/com/biutag/supervision/controller/work/NegativeTaskController.java index ad40ae3..f07baee 100644 --- a/src/main/java/com/biutag/supervision/controller/work/NegativeTaskController.java +++ b/src/main/java/com/biutag/supervision/controller/work/NegativeTaskController.java @@ -57,16 +57,6 @@ public class NegativeTaskController { return Result.success(negativeTaskService.page(param)); } - /** - * 批量下发列表 - * @param param - * @return - */ - @GetMapping("importList") - public Result> pageByImport(NegativeTaskQueryParam param) { - return Result.success(negativeTaskService.pageByImport(param)); - } - @PostMapping("import") public Result> importExcel(@RequestPart("file") MultipartFile file) throws IOException { log.info("文件导入中------------------------------"); diff --git a/src/main/java/com/biutag/supervision/controller/work/NewsController.java b/src/main/java/com/biutag/supervision/controller/work/NewsController.java index b1ad897..2b44d9e 100644 --- a/src/main/java/com/biutag/supervision/controller/work/NewsController.java +++ b/src/main/java/com/biutag/supervision/controller/work/NewsController.java @@ -1,13 +1,17 @@ package com.biutag.supervision.controller.work; +import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.NewsDto; import com.biutag.supervision.pojo.entity.News; import com.biutag.supervision.pojo.param.NewsQueryParam; import com.biutag.supervision.service.NewsService; +import com.biutag.supervision.util.JSON; import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; import org.springframework.web.bind.annotation.*; import java.time.LocalDateTime; @@ -38,17 +42,27 @@ public class NewsController { } @PostMapping - public Result add(@RequestBody News data) { - data.setUpdateTime(LocalDateTime.now()); - data.setCreateTime(LocalDateTime.now()); - newsService.save(data); + public Result add(@RequestBody NewsDto data) { + News news = new News(); + BeanUtils.copyProperties(data, news); + if (CollectionUtil.isNotEmpty(data.getFiles())) { + news.setFiles(JSON.toJSONString(data.getFiles())); + } + news.setUpdateTime(LocalDateTime.now()); + news.setCreateTime(LocalDateTime.now()); + newsService.save(news); return Result.success(); } @PutMapping - public Result update(@RequestBody News data) { - data.setUpdateTime(LocalDateTime.now()); - newsService.updateById(data); + public Result update(@RequestBody NewsDto data) { + News news = new News(); + BeanUtils.copyProperties(data, news); + if (CollectionUtil.isNotEmpty(data.getFiles())) { + news.setFiles(JSON.toJSONString(data.getFiles())); + } + news.setUpdateTime(LocalDateTime.now()); + newsService.updateById(news); return Result.success(); } diff --git a/src/main/java/com/biutag/supervision/exception/AuthException.java b/src/main/java/com/biutag/supervision/exception/AuthException.java index 29389a5..ddb2a45 100644 --- a/src/main/java/com/biutag/supervision/exception/AuthException.java +++ b/src/main/java/com/biutag/supervision/exception/AuthException.java @@ -1,4 +1,11 @@ package com.biutag.supervision.exception; public class AuthException extends RuntimeException { + + public AuthException() { + } + + public AuthException(String message) { + super(message); + } } diff --git a/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java b/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java index 9e72da6..ada632f 100644 --- a/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/ApplyCompletionAction.java @@ -90,7 +90,7 @@ public class ApplyCompletionAction implements Action { .set(Negative::getUnrectifyReason, verifyData.getUnrectifyReason()) .set(Negative::getInvolveDepartName, departService.getById(verifyData.getInvolveDepartId()).getShortName()); // 经办人 - if (CollectionUtil.isNotEmpty(verifyData.getHandlePolices())) { + if (CollectionUtil.isNotEmpty(verifyData.getHandlePolices().stream().filter(item -> StrUtil.isNotBlank(item.getName())).toList())) { updateWrapper.set(Negative::getHandlePolices, JSON.toJSONString(verifyData.getHandlePolices())); } // 涉及单位 @@ -121,6 +121,9 @@ public class ApplyCompletionAction implements Action { List negativeBlames = blames.stream().map(item -> { NegativeBlame negativeBlame = new NegativeBlame(); BeanUtil.copyProperties(item, negativeBlame); + if (CollectionUtil.isNotEmpty(item.getHandleResultCode())) { + negativeBlame.setHandleResultCode(String.join(",", item.getHandleResultCode())); + } List blameLeaders = verifyData.getBlameLeaders().stream() .filter(leader -> leader.getBlameIdCodes().contains(item.getBlameIdCode())) .toList(); diff --git a/src/main/java/com/biutag/supervision/flow/action/ApplyCountersignAction.java b/src/main/java/com/biutag/supervision/flow/action/ApplyCountersignAction.java index f6c084b..05789e6 100644 --- a/src/main/java/com/biutag/supervision/flow/action/ApplyCountersignAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/ApplyCountersignAction.java @@ -39,18 +39,24 @@ public class ApplyCountersignAction implements Action { @Override public void next(ActionDto actionDto) { ApplyCountersignData applyCountersignData = BeanUtil.toBean(actionDto.getData(), ApplyCountersignData.class); - addWork(actionDto, applyCountersignData); - addCountersign(actionDto.getNegativeId(), applyCountersignData); + NegativeWork work = workService.getById(actionDto.getWorkId()); + addWork(actionDto, applyCountersignData, work); + addCountersign(actionDto.getNegativeId(), applyCountersignData, work); + } - private void addCountersign(String negativeId, ApplyCountersignData applyCountersignData) { + private void addCountersign(String negativeId, ApplyCountersignData applyCountersignData, NegativeWork work) { UserAuth user = UserContextHolder.getCurrentUser(); NegativeCountersignApply countersignApply = new NegativeCountersignApply(); countersignApply.setNegativeId(negativeId) .setRequirement(applyCountersignData.getRequirement()) .setCreateTime(LocalDateTime.now()) .setCreator(user.getUserName()) - .setCreatorName(user.getNickName()); + .setCreatorName(user.getNickName()) + .setCreateRoleCode(work.getRoleCode()); + if (!RoleCodeEnum.FIRST_ADMIN.getCode().equals(work.getRoleCode())) { + countersignApply.setCreateDepartId(work.getDepartId()); + } countersignApplyService.save(countersignApply); Set departIds = applyCountersignData.getCountersignDeparts().stream().map(ApplyCountersignData.CountersignDepart::getId).collect(Collectors.toSet()); @@ -71,7 +77,7 @@ public class ApplyCountersignAction implements Action { .set(Negative::getUpdTime, LocalDateTime.now())); } - private void addWork(ActionDto actionDto, ApplyCountersignData applyCountersignData) { + private void addWork(ActionDto actionDto, ApplyCountersignData applyCountersignData, NegativeWork work) { List works = workService.list(actionDto.getNegativeId()); Set departIds = applyCountersignData.getCountersignDeparts().stream() .map(ApplyCountersignData.CountersignDepart::getId) @@ -85,8 +91,6 @@ public class ApplyCountersignAction implements Action { // 删除 之前work记录,避免重复 workService.remove(new LambdaQueryWrapper().eq(NegativeWork::getNegativeId, actionDto.getNegativeId()).in(NegativeWork::getDepartId, workDepartIds)); } - Integer workId = actionDto.getWorkId(); - NegativeWork work = workService.getById(workId); List negativeWorks = departIds.stream().map(departId -> { NegativeWork w = new NegativeWork(); SupDepart depart = departService.getById(departId); diff --git a/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java b/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java index fc4bfdf..e1015ad 100644 --- a/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/ConfirmationCompletionAction.java @@ -37,18 +37,21 @@ public class ConfirmationCompletionAction implements Action { @Override public void next(ActionDto actionDto) { + UserAuth user = UserContextHolder.getCurrentUser(); + if (!user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode()) && !user.getRoleCodes().contains(RoleCodeEnum.SECOND_ADMIN.getCode())) { + throw new RuntimeException("该流程已被处理,请刷新后重试!"); + } ConfirmationCompletionData completionData = BeanUtil.toBean(actionDto.getData(), ConfirmationCompletionData.class); String negativeId = actionDto.getNegativeId(); //addNegativeScorePolice(negativeId, completionData); updateApprove(negativeId, completionData.getCompletionComment(), actionDto.getWorkId()); - doneWork(actionDto.getWorkId()); + doneWork(actionDto.getWorkId(), actionDto.getNegativeId()); // 最后更新状态 updateNegative(negativeId, completionData); } - public void addNegativeScorePolice(String negativeId, ConfirmationCompletionData completionData) { String formula = "%s + (1 * %s) + (1 * %s)"; Negative negative = negativeService.getById(negativeId); @@ -99,12 +102,18 @@ public class ConfirmationCompletionAction implements Action { .set(Negative::getUpdTime, LocalDateTime.now()); negativeService.update(updateWrapper); } - public void doneWork(Integer workId) { + public void doneWork(Integer workId, String negativeId) { LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() .eq(NegativeWork::getId, workId) .set(NegativeWork::getStatus, WorkStatusEnum.done.name()) .set(NegativeWork::getUpdateTime, LocalDateTime.now()); workService.update(updateWrapper); + + LambdaUpdateWrapper doneUpdateWrapper = new LambdaUpdateWrapper() + .eq(NegativeWork::getNegativeId, negativeId) + .eq(NegativeWork::getStatus, WorkStatusEnum.todo.name()) + .set(NegativeWork::getStatus, WorkStatusEnum.done.name()); + workService.update(doneUpdateWrapper); } } diff --git a/src/main/java/com/biutag/supervision/flow/action/SaveAction.java b/src/main/java/com/biutag/supervision/flow/action/SaveAction.java index 2bdfc76..16877e7 100644 --- a/src/main/java/com/biutag/supervision/flow/action/SaveAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/SaveAction.java @@ -61,7 +61,7 @@ public class SaveAction implements Action { .set(Negative::getUnrectifyReason, verifyData.getUnrectifyReason()) .set(Negative::getCheckStatusName, verifyData.getCheckStatusName()); // 经办人 - if (CollectionUtil.isNotEmpty(verifyData.getHandlePolices())) { + if (CollectionUtil.isNotEmpty(verifyData.getHandlePolices().stream().filter(item -> StrUtil.isNotBlank(item.getName())).toList())) { updateWrapper.set(Negative::getHandlePolices, JSON.toJSONString(verifyData.getHandlePolices())); } // 涉及单位 @@ -99,6 +99,9 @@ public class SaveAction implements Action { List negativeBlames = verifyData.getBlames().stream().map(item -> { NegativeBlame negativeBlame = new NegativeBlame(); BeanUtil.copyProperties(item, negativeBlame); + if (CollectionUtil.isNotEmpty(item.getHandleResultCode())) { + negativeBlame.setHandleResultCode(String.join(",", item.getHandleResultCode())); + } VerifyData.BlameLeader blameLeader = verifyData.getBlameLeaders().stream() .filter(leader -> leader.getBlameIdCodes().contains(item.getBlameIdCode())).findFirst().orElse(null); if (Objects.nonNull(blameLeader)) { diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java index c6d2260..000916a 100644 --- a/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/SecondApproveAction.java @@ -35,6 +35,10 @@ public class SecondApproveAction implements Action { @Override public void next(ActionDto actionDto) { + UserAuth user = UserContextHolder.getCurrentUser(); + if (!user.getRoleCodes().contains(RoleCodeEnum.SECOND_ADMIN.getCode())) { + throw new RuntimeException("该流程已被处理,请刷新后重试!"); + } ApproveData approveData = BeanUtil.toBean(actionDto.getData(), ApproveData.class); updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey()); updateApprove(actionDto.getNegativeId(), actionDto.getActionKey(), approveData.getComments(), actionDto.getWorkId()); diff --git a/src/main/java/com/biutag/supervision/flow/action/SecondExtensionApproveAction.java b/src/main/java/com/biutag/supervision/flow/action/SecondExtensionApproveAction.java index 3405931..91645ee 100644 --- a/src/main/java/com/biutag/supervision/flow/action/SecondExtensionApproveAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/SecondExtensionApproveAction.java @@ -1,19 +1,23 @@ package com.biutag.supervision.flow.action; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.NumberUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.biutag.supervision.common.UserContextHolder; import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.ApprovalFlowEnum; import com.biutag.supervision.constants.enums.ApproveStateEnum; import com.biutag.supervision.constants.enums.RoleCodeEnum; import com.biutag.supervision.constants.enums.WorkStatusEnum; import com.biutag.supervision.pojo.dto.ActionDto; import com.biutag.supervision.pojo.dto.flow.ApproveData; import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeExtensionApply; import com.biutag.supervision.pojo.entity.NegativeExtensionApprove; import com.biutag.supervision.pojo.entity.NegativeWork; import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.service.NegativeExtensionApplyService; import com.biutag.supervision.service.NegativeExtensionApproveService; import com.biutag.supervision.service.NegativeService; import com.biutag.supervision.service.NegativeWorkService; @@ -35,16 +39,24 @@ public class SecondExtensionApproveAction implements Action { private final NegativeWorkService workService; + private final NegativeExtensionApplyService extensionApplyService; + @Override public void next(ActionDto actionDto) { ApproveData approveData = BeanUtil.toBean(actionDto.getData(), ApproveData.class); - addExtensionApprove(actionDto, approveData.getComments()); + Negative negative = negativeService.getById(actionDto.getNegativeId()); + addExtensionApprove(actionDto, approveData.getComments(), negative); doneWork(actionDto.getWorkId()); - addWork(actionDto, RoleCodeEnum.FIRST_ADMIN.getCode(), actionDto.getNextFlowKey()); + if (ApprovalFlowEnum.SECOND_APPROVAL.getValue().equals(negative.getApprovalFlow())) { + updateNegative(negative); + } else { + addWork(actionDto, RoleCodeEnum.FIRST_ADMIN.getCode(), actionDto.getNextFlowKey()); + } + } - public void addExtensionApprove(ActionDto actionDto, String comments) { - Negative negative = negativeService.getById(actionDto.getNegativeId()); + public void addExtensionApprove(ActionDto actionDto, String comments, Negative negative) { + UserAuth user = UserContextHolder.getCurrentUser(); NegativeWork work = workService.getById(actionDto.getWorkId()); NegativeExtensionApprove extensionApprove = new NegativeExtensionApprove() @@ -85,4 +97,12 @@ public class SecondExtensionApproveAction implements Action { workService.save(work); } + public void updateNegative(Negative negative) { + NegativeExtensionApply extensionApply = extensionApplyService.getById(negative.getNegativeExtensionApplyId()); + negativeService.update(new LambdaUpdateWrapper() + .set(Negative::getExtensionApplyFlag, true) + // 延期天数 + .set(Negative::getExtensionDays, NumberUtil.nullToZero(negative.getExtensionDays()) + extensionApply.getExtensionDays()) + .eq(Negative::getId, negative.getId())); + } } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/job/Job.java b/src/main/java/com/biutag/supervision/job/Job.java index 6bd31b6..52f3682 100644 --- a/src/main/java/com/biutag/supervision/job/Job.java +++ b/src/main/java/com/biutag/supervision/job/Job.java @@ -2,22 +2,20 @@ package com.biutag.supervision.job; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.NumberUtil; -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson2.JSON; -import com.alibaba.fastjson2.JSONArray; -import com.alibaba.fastjson2.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.biutag.supervision.constants.enums.BusinessTypeEnum; import com.biutag.supervision.constants.enums.InspectCaseEnum; import com.biutag.supervision.constants.enums.ProblemSourcesEnum; import com.biutag.supervision.constants.enums.ProcessingStatusEnum; +import com.biutag.supervision.mapper.MailBlameMapper; import com.biutag.supervision.mapper.MailMapper; import com.biutag.supervision.pojo.entity.Negative; import com.biutag.supervision.pojo.entity.NegativeBlame; import com.biutag.supervision.pojo.entity.SupDepart; import com.biutag.supervision.pojo.entity.SupPolice; import com.biutag.supervision.pojo.entity.mailbox.Mail; +import com.biutag.supervision.pojo.entity.mailbox.MailBlame; import com.biutag.supervision.service.*; import com.biutag.supervision.util.TimeUtil; import lombok.RequiredArgsConstructor; @@ -111,133 +109,15 @@ public class Job { businessPoliceService.generate(happenTime); } -// @Scheduled(cron = "0 0 5 * * ?") - public void executeModel() { - modelClueService.generate(1); - } - - private final MailMapper mailMapper; - - @Value("${mailbox.url}") - private String mailboxUrl; - - private final FileService fileService; - - private final NegativeThingFileService thingFileService; - - private final NegativeFileService negativeThingFile; - private final SupPoliceService supPoliceService; - - private final NegativeBlameService blameService; + private final MailService mailService; /** * 凌晨1点执行 */ -// @Scheduled(cron = "0 0 1 * * ?") + @Scheduled(cron = "0 0 1 * * ?") public void mailbox() { - List mailList = mailMapper.selectList(new LambdaUpdateWrapper().eq(Mail::getMailState, "completion") - .in(Mail::getVerifyIsTrue, List.of("属实", "基本属实"))); - for (Mail item : mailList) { - Negative negative = new Negative(); - negative.setId(IdUtil.getSnowflakeNextIdStr()); - negative.setOriginId(item.getId()); - negative.setDiscoveryTime(item.getCreateTime()); - negative.setResponderName(item.getContactName()); - negative.setContactPhone(item.getContactPhone()); - negative.setThingDesc(item.getContent()); - // 问题涉及单位 - // negative.setInvolveDepartName(); - - negative.setProblemSources(ProblemSourcesEnum.JZXX.getLabel()); - negative.setProblemSourcesCode(ProblemSourcesEnum.JZXX.getValue()); - negative.setBusinessTypeCode(BusinessTypeEnum.QT.getValue()); - negative.setBusinessTypeName(BusinessTypeEnum.QT.getLabel()); - if ("属实".equals(item.getVerifyIsTrue())) { - negative.setCheckStatus(InspectCaseEnum.TRUE.getValue()); - negative.setCheckStatusName(InspectCaseEnum.TRUE.getLabel()); - } - if ("基本属实".equals(item.getVerifyIsTrue())) { - negative.setCheckStatus(InspectCaseEnum.PARTIALLY_TRUE.getValue()); - negative.setCheckStatusName(InspectCaseEnum.PARTIALLY_TRUE.getLabel()); - } - // 核办情况 - negative.setCheckStatusDesc(item.getVerifyDetails()); - negative.setProcessingStatus(ProcessingStatusEnum.completed.name()); - negative.setCrtTime(LocalDateTime.now()); - negativeService.save(negative); - - // 被举报人 - if (StrUtil.isNotBlank(item.getVerifyReportedPolices())) { - JSONArray jsonArray = JSON.parseArray(item.getVerifyReportedPolices()); - if (!jsonArray.isEmpty()) { - for (int i = 0; i < jsonArray.size(); i++) { - // [{"deptId":310,"empNo":"A00002","gender":null,"birthday":null,"name":"李四","mobile":null}] - JSONObject jsonObject = jsonArray.getJSONObject(i); - String empNo = jsonObject.getString("empNo"); - String name = jsonObject.getString("name"); - SupPolice police = supPoliceService.getOne(new LambdaUpdateWrapper().eq(SupPolice::getEmpNo, empNo).eq(SupPolice::getName, name)); - if (Objects.isNull(police)) { - log.error("没有该警员的数据! {}-{}", name, empNo); - continue; - } - NegativeBlame negativeBlame = new NegativeBlame(); - - negativeBlame - .setBlameId(IdUtil.getSnowflakeNextIdStr()) - .setNegativeId(negative.getId()) - .setType("personal") - .setBlameEmpNo(empNo) - .setBlameIdCode(police.getIdCode()) - .setBlameName(name) - .setUpdTime(LocalDateTime.now()) - .setCrtTime(LocalDateTime.now()); - blameService.save(negativeBlame); - - } - } - } - - // [{"filepath":"250102/_B5HQNhI.doc","orgiinFilename":"3、定级报告 .doc","type":"application/msword","size":95744,"docxFilepath":"250102/l-Tl5dux.docx"}] -// if (StrUtil.isNotBlank(item.getAttachments())) { -// JSONArray jsonArray = JSON.parseArray(item.getAttachments()); -// if (!jsonArray.isEmpty()) { -// for (int i = 0; i < jsonArray.size(); i++) { -// JSONObject jsonObject = jsonArray.getJSONObject(i); -// HttpResponse httpResponse = HttpUtil.createGet(mailboxUrl + "api/file/steam/" + jsonObject.getString("filepath")).execute(); -// InputStream is = httpResponse.bodyStream(); -// String fileName = jsonObject.getString("orgiinFilename"); -// String filePath = fileService.upload(is, 0L, FileUtil.extName(fileName)); -// NegativeThingFile negativeThingFile = new NegativeThingFile(); -// negativeThingFile.setFileName(fileName); -// negativeThingFile.setFilePath(filePath); -// negativeThingFile.setCreateTime(LocalDateTime.now()); -// negativeThingFile.setNegativeId(negative.getId()); -// thingFileService.save(negativeThingFile); -// } -// } -// } -// -// if (StrUtil.isNotBlank(item.getVerifyAttachments())) { -// JSONArray jsonArray = JSON.parseArray(item.getVerifyAttachments()); -// if (!jsonArray.isEmpty()) { -// for (int i = 0; i < jsonArray.size(); i++) { -// JSONObject jsonObject = jsonArray.getJSONObject(i); -// HttpResponse httpResponse = HttpUtil.createGet(mailboxUrl + "api/file/steam/" + jsonObject.getString("filepath")).execute(); -// InputStream is = httpResponse.bodyStream(); -// String fileName = jsonObject.getString("orgiinFilename"); -// String filePath = fileService.upload(is, 0L, FileUtil.extName(fileName)); -// NegativeFile file = new NegativeFile(); -// file.setFileName(fileName); -// file.setFilePath(filePath); -// file.setCrtTime(LocalDateTime.now()); -// file.setNegtiveId(negative.getId()); -// negativeThingFile.save(file); -// } -// } -// } - - } + mailService.saveMailbox(); } // 每小时一次 @@ -254,4 +134,13 @@ public class Job { }); } + + + // 每天一次 23:30:00 + //@Scheduled(cron = "0 30 23 * * ?") + public void rights() { + + + } + } diff --git a/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java b/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java index 47a1bc7..2f12858 100644 --- a/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java +++ b/src/main/java/com/biutag/supervision/mapper/DataPetition12337Mapper.java @@ -1,9 +1,15 @@ package com.biutag.supervision.mapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.pojo.entity.DataPetition12337; +import com.biutag.supervision.pojo.entity.DataPetitionComplaint; +import com.biutag.supervision.pojo.vo.DataPetition12337ExportVo; import com.biutag.supervision.pojo.vo.EchartsVo; import com.biutag.supervision.pojo.vo.RecentMailTrendByMonthVo; +import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.Date; @@ -51,6 +57,9 @@ public interface DataPetition12337Mapper extends BaseMapper { "where discover_time between #{beginTime} and #{endTime} " + "and third_depart_id=#{departId}") Long select12337PoliceMailBySourceCode(Date beginTime, Date endTime, Integer departId); + + Page queryPageExport(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + } diff --git a/src/main/java/com/biutag/supervision/mapper/DwdAsjZfbaAjjbxxMapper.java b/src/main/java/com/biutag/supervision/mapper/DwdAsjZfbaAjjbxxMapper.java new file mode 100644 index 0000000..0753402 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/DwdAsjZfbaAjjbxxMapper.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.DwdAsjZfbaAjjbxx; +import com.biutag.supervision.pojo.entity.DwdAsjZfbaShrxx2; +import org.apache.ibatis.annotations.Select; + +import java.util.Date; +import java.util.List; + +@DS("slave2") +public interface DwdAsjZfbaAjjbxxMapper extends BaseMapper { + + @Select("select * from dwd_asj_zfba_ajjbxx where ajbh = #{ajbh}") + DwdAsjZfbaAjjbxx selectByAjbh(String ajbh); + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/DwdAsjZfbaShrxx2Mapper.java b/src/main/java/com/biutag/supervision/mapper/DwdAsjZfbaShrxx2Mapper.java new file mode 100644 index 0000000..7ba406e --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/DwdAsjZfbaShrxx2Mapper.java @@ -0,0 +1,20 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.DwdAsjZfbaShrxx2; +import org.apache.ibatis.annotations.Select; + +import java.util.Date; +import java.util.List; + +@DS("slave2") +public interface DwdAsjZfbaShrxx2Mapper extends BaseMapper { + + @Select("select * from dwd_asj_zfba_shrxx2 where sfmfj in (1, 2) and sjzx_rksj between #{startTime} and #{endTime}") + List selectList(Date startTime, Date endTime); + + @Select("select * from dwd_asj_zfba_shrxx2 where sfmfj in (1, 2)") + List selectListAll(); + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/MailBlameMapper.java b/src/main/java/com/biutag/supervision/mapper/MailBlameMapper.java new file mode 100644 index 0000000..f5e6486 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/MailBlameMapper.java @@ -0,0 +1,15 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.mailbox.MailBlame; + +/** + * @author wxc + * @date 2025/3/26 + */ +@DS("mailbox") +public interface MailBlameMapper extends BaseMapper { + + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeCountersignMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeCountersignMapper.java index 199f1f1..bd72c84 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeCountersignMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeCountersignMapper.java @@ -1,8 +1,15 @@ package com.biutag.supervision.mapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.entity.Negative; import com.biutag.supervision.pojo.entity.NegativeCountersign; +import org.apache.ibatis.annotations.Param; public interface NegativeCountersignMapper extends BaseMapper { + Page queryNegativePage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeFileMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeFileMapper.java index a07870d..33145b1 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeFileMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeFileMapper.java @@ -11,5 +11,6 @@ public interface NegativeFileMapper extends BaseMapper { @Select("select f.*, c.class_title file_class_title from negative_file f left join file_class c on f.file_class_id = c.id where f.negtiveId = #{negativeId}") - List selectList(String negativeId); + List selectVoByNegativeId(String negativeId); + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index b0a679a..f98ab1f 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -204,7 +204,7 @@ public interface NegativeMapper extends BaseMapper { "AND ng.special_supervision=#{queryType} " + "AND sd.statistics_group_id=#{groupId} " + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime}; ") - DayTimeSuperviseVo getYellowBetOverview(Date beginTime, Date endTime, Integer groupId, Integer queryType); + DayTimeSuperviseVo getYellowBetOverview(Date beginTime, Date endTime, Integer groupId, String queryType); @Select("SELECT " + "sd.short_name AS label, " + @@ -217,14 +217,13 @@ public interface NegativeMapper extends BaseMapper { "AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " + "GROUP BY sd.short_name " + "ORDER BY `value` DESC;") - List getYellowBetRankList(Date beginTime, Date endTime, Integer groupId, Integer queryType); + List getYellowBetRankList(Date beginTime, Date endTime, Integer groupId, String queryType); // endregion // region 视频督察大屏 - @Select("SELECT " + - "COUNT(DISTINCT ng.id) AS discoverProblem, " + + @Select("SELECT COUNT(DISTINCT ng.id) AS discoverProblem, " + "COUNT(DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL)) AS changedProblem, " + "COUNT(DISTINCT ng.involveDepartId) AS relativeOrg, " + "COUNT(DISTINCT nb.blameName) AS relativePer, " + @@ -234,7 +233,7 @@ public interface NegativeMapper extends BaseMapper { "LEFT JOIN negative_blame nb ON ng.id = nb.negativeId " + "WHERE ng.checkStatus IN ('1','2') " + "AND problemSourcesCode = 16 " + - "AND discoveryTime BETWEEN #{beginTime} AND #{endTime};") + "AND discoveryTime BETWEEN #{beginTime} AND #{endTime}") VideoSuperviseCountVo getAllVideoSuperviseCount(Date beginTime, Date endTime); @Select("SELECT npr.threeLevelContent AS `name`, " + @@ -939,7 +938,7 @@ public interface NegativeMapper extends BaseMapper { @Select("SELECT problemSources AS name, count(ng.id) AS value " + "FROM negative ng " + - "WHERE problemSourcesCode IN (17, 18, 19, 20) " + + "WHERE problemSourcesCode IN (17, 18, 19, 20) AND discoveryTime BETWEEN #{beginTime} AND #{endTime} " + "GROUP BY problemSources") List getCaseSourceRate(Date beginTime, Date endTime); diff --git a/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java index 6f7d261..700f80f 100644 --- a/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java @@ -49,7 +49,7 @@ public interface RpcApplyMapper extends BaseMapper { "WHERE temp.apply_date BETWEEN #{beginTime} AND #{endTime} " + "AND temp.type=1 " + "GROUP BY sd1.short_name " + - "ORDER BY `value` DESC;") + "ORDER BY `value` DESC") List getRightsRank(Date beginTime, Date endTime, Integer groupId); @Select("SELECT " + diff --git a/src/main/java/com/biutag/supervision/mapper/RpcComfortPacksMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcComfortPacksMapper.java new file mode 100644 index 0000000..eec36df --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/RpcComfortPacksMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.RpcComfortPacks; + +public interface RpcComfortPacksMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/RpcPacksComfortMapper.java b/src/main/java/com/biutag/supervision/mapper/RpcPacksComfortMapper.java new file mode 100644 index 0000000..55b5b86 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/RpcPacksComfortMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.RpcPacksComfort; + +public interface RpcPacksComfortMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupDictHandleResultMapingMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDictHandleResultMapingMapper.java new file mode 100644 index 0000000..d7b90a4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupDictHandleResultMapingMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupDictHandleResultMaping; + +public interface SupDictHandleResultMapingMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/mapper/SupDictContentMapper.java b/src/main/java/com/biutag/supervision/mapper/SupDictProblemTypeMapper.java similarity index 87% rename from src/main/java/com/biutag/supervision/mapper/SupDictContentMapper.java rename to src/main/java/com/biutag/supervision/mapper/SupDictProblemTypeMapper.java index a976b9a..6df1162 100644 --- a/src/main/java/com/biutag/supervision/mapper/SupDictContentMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/SupDictProblemTypeMapper.java @@ -6,7 +6,7 @@ import org.apache.ibatis.annotations.Select; import java.util.List; -public interface SupDictContentMapper extends BaseMapper { +public interface SupDictProblemTypeMapper extends BaseMapper { @Select("select max(pt.score) from negative_problem_relation r left join sup_dict_problem_type pt on r.threeLevelCode = pt.code " + "where r.negativeId = #{negativeId} and r.blameId = #{blameId}") diff --git a/src/main/java/com/biutag/supervision/mapper/VideoConfigMapper.java b/src/main/java/com/biutag/supervision/mapper/VideoConfigMapper.java new file mode 100644 index 0000000..f98b95c --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/VideoConfigMapper.java @@ -0,0 +1,8 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.VideoConfig; + +public interface VideoConfigMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java b/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java index a1f3fb9..a6b248f 100644 --- a/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java +++ b/src/main/java/com/biutag/supervision/pojo/domain/NegativeVo.java @@ -2,7 +2,6 @@ package com.biutag.supervision.pojo.domain; import com.biutag.supervision.pojo.dto.flow.VerifyData; import com.biutag.supervision.pojo.entity.FileClass; -import com.biutag.supervision.pojo.entity.NegativeFile; import com.biutag.supervision.pojo.entity.NegativeScorePolice; import com.biutag.supervision.pojo.entity.NegativeThingFile; import com.biutag.supervision.pojo.vo.NegativeFileVo; @@ -94,9 +93,9 @@ public class NegativeVo { // 审核人身份证 private String checkIdCode; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") private LocalDateTime crtTime; - // 0 正常 1 禁用 private String status; @@ -150,6 +149,9 @@ public class NegativeVo { // 整改限制天数 private Integer rectifyRestrictionDays; + // 未整改原因 + private String unrectifyReason; + // 追责对象 private String accountabilityTarget; @@ -196,6 +198,9 @@ public class NegativeVo { // 当前处理对象 private String currentProcessingObject; + // 下发选择的问题类型 + private List problems = new ArrayList<>(); + // 涉及人员 private List blames = new ArrayList<>(); diff --git a/src/main/java/com/biutag/supervision/pojo/domain/PoliceAuth.java b/src/main/java/com/biutag/supervision/pojo/domain/PoliceAuth.java index 0357303..0bbff59 100644 --- a/src/main/java/com/biutag/supervision/pojo/domain/PoliceAuth.java +++ b/src/main/java/com/biutag/supervision/pojo/domain/PoliceAuth.java @@ -11,6 +11,8 @@ import java.util.List; @Getter public class PoliceAuth { + private List roleIds; + private List departs; private List sources; diff --git a/src/main/java/com/biutag/supervision/pojo/domain/RpcApplyDetail.java b/src/main/java/com/biutag/supervision/pojo/domain/RpcApplyDetail.java index ba09f09..4897edd 100644 --- a/src/main/java/com/biutag/supervision/pojo/domain/RpcApplyDetail.java +++ b/src/main/java/com/biutag/supervision/pojo/domain/RpcApplyDetail.java @@ -4,6 +4,7 @@ import com.biutag.supervision.pojo.entity.RpcApply; import com.biutag.supervision.pojo.entity.RpcApplyApprove; import com.biutag.supervision.pojo.entity.RpcApplyPerson; import com.biutag.supervision.pojo.entity.RpcPerson; +import com.biutag.supervision.pojo.vo.RpcApplyApproveVo; import lombok.Getter; import lombok.Setter; @@ -24,5 +25,5 @@ public class RpcApplyDetail { private RpcApplyPerson applyPerson; - private List approves = new ArrayList<>(); + private List approves = new ArrayList<>(); } diff --git a/src/main/java/com/biutag/supervision/pojo/dto/ComfortPacksDto.java b/src/main/java/com/biutag/supervision/pojo/dto/ComfortPacksDto.java new file mode 100644 index 0000000..9b99442 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/ComfortPacksDto.java @@ -0,0 +1,21 @@ +package com.biutag.supervision.pojo.dto; + +import com.biutag.supervision.pojo.vo.RpcApplyVo; +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author wxc + * @date 2025/3/14 + */ +@Setter +@Getter +public class ComfortPacksDto { + + private String reportTitle; + + private List comforts = new ArrayList<>(); +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java b/src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java index 11cffdd..1f8c42a 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/NegativeDto.java @@ -2,6 +2,7 @@ package com.biutag.supervision.pojo.dto; import com.biutag.supervision.common.validation.AddGroup; import com.biutag.supervision.common.validation.EditGroup; +import com.biutag.supervision.pojo.dto.flow.VerifyData; import com.biutag.supervision.pojo.vo.FileVo; import com.fasterxml.jackson.annotation.JsonFormat; import jakarta.validation.constraints.NotBlank; @@ -86,9 +87,6 @@ public class NegativeDto { @NotBlank(message = "指定具体办理单位不能为空", groups = {AddGroup.class}) private String departId; - @NotBlank(message = "指定具体办理单位不能为空", groups = {AddGroup.class}) - private String departName; - // 最大签收时长(天) private Integer maxSignDuration; @@ -109,4 +107,7 @@ public class NegativeDto { private String taskId; + // 下发问题 + private List problems; + } diff --git a/src/main/java/com/biutag/supervision/pojo/dto/NewsDto.java b/src/main/java/com/biutag/supervision/pojo/dto/NewsDto.java new file mode 100644 index 0000000..cc4179f --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/NewsDto.java @@ -0,0 +1,44 @@ +package com.biutag.supervision.pojo.dto; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.biutag.supervision.pojo.vo.FileVo; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * @author wxc + * @date 2025/3/7 + */ +@Setter +@Getter +public class NewsDto { + + private Integer id; + + // 动态来源 + private String source; + + // 动态分类 + private String workType; + + // 发布时间 + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime releaseTime; + + private LocalDateTime createTime; + + private LocalDateTime updateTime; + + private String contentTxt; + + private String departName; + + private String departId; + + private List files; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/PoliceDto.java b/src/main/java/com/biutag/supervision/pojo/dto/PoliceDto.java new file mode 100644 index 0000000..51ebc85 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/PoliceDto.java @@ -0,0 +1,53 @@ +package com.biutag.supervision.pojo.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import jakarta.validation.constraints.NotBlank; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDate; + +/** + * @author wxc + * @date 2025/2/20 + */ +@Setter +@Getter +public class PoliceDto { + + // 姓名 + @NotBlank(message = "姓名不能为空") + private String name; + + @NotBlank(message = "警号不能为空") + private String empNo; + + // 身份证 + @NotBlank(message = "身份证不能为空") + private String idCode; + + // 组织机构id + @NotBlank(message = "所属单位不能为空") + private String orgId; + + // 手机号 + private String mobile; + + // 人员属性 + private String personType; + + // 职位 正职 副职 + private String position; + + // 业务条线 + private String policeRole; + + // 入职日期 + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd") + private LocalDate employmentDate; + + private Boolean createUserFlag = false; + + private String password; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/dto/RpcApplyDto.java b/src/main/java/com/biutag/supervision/pojo/dto/RpcApplyDto.java index ad55626..04f20a9 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/RpcApplyDto.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/RpcApplyDto.java @@ -18,6 +18,8 @@ import java.util.List; @Getter public class RpcApplyDto { + private String rpcId; + @DateTimeFormat(pattern="yyyy-MM-dd") private Date applyDate; @@ -113,4 +115,7 @@ public class RpcApplyDto { private String approver; + // 代理人姓名 + private String agentName; + } diff --git a/src/main/java/com/biutag/supervision/pojo/dto/SjNegativeImportDto.java b/src/main/java/com/biutag/supervision/pojo/dto/SjNegativeImportDto.java new file mode 100644 index 0000000..c270ccf --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/SjNegativeImportDto.java @@ -0,0 +1,69 @@ +package com.biutag.supervision.pojo.dto; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2024/11/13 + */ +@Setter +@Getter +public class SjNegativeImportDto { + + @ExcelProperty("问题来源") + private String problemSources; + + // 业务类别 + @ExcelProperty("业务类别") + private String businessTypeName; + + @ExcelProperty("问题发现时间") + private String discoveryTime; + + @ExcelProperty("案件编号") + private String caseNumber; + + @ExcelProperty("事情简要描述") + private String thingDesc; + + // 问题整改情况 + @ExcelProperty("核查/整改情况描述\n" + + "(1030)") + private String rectifyDesc; + + @ExcelProperty("涉及单位id") + private String departId; + + @ExcelProperty("涉及单位") + private String departName; + + @ExcelProperty("办理单位id") + private String handleDepartId; + + @ExcelProperty("问题分类id") + private String proType; + + // 处理结果 + @ExcelProperty("处罚情况1") + private String handleResultName; + + // 处理结果 + @ExcelProperty("处罚情况2") + private String handleResultName2; + + @ExcelProperty("责任人员1") + private String blameName; + + @ExcelProperty("责任人员身份证1") + private String blameIdCode; + + @ExcelProperty("责任人员2") + private String blameName2; + + @ExcelProperty("责任人员身份证2") + private String blameIdCode2; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/VideoInspectionDistributeDto.java b/src/main/java/com/biutag/supervision/pojo/dto/VideoInspectionDistributeDto.java index ff1c6e9..918aadf 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/VideoInspectionDistributeDto.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/VideoInspectionDistributeDto.java @@ -40,6 +40,7 @@ public class VideoInspectionDistributeDto { @NotBlank private String approvalFlow; + // 指定办理单位 private String handleDepartId; // 业务类型 diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DataAlarmAlarmInfo.java b/src/main/java/com/biutag/supervision/pojo/entity/DataAlarmAlarmInfo.java index ba1dab5..e17ebb9 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/DataAlarmAlarmInfo.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/DataAlarmAlarmInfo.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId; import lombok.Getter; import lombok.Setter; +import java.time.LocalDateTime; import java.util.List; @Setter @@ -104,6 +105,12 @@ public class DataAlarmAlarmInfo { @TableField("Scence") private String Scence; + + private LocalDateTime updateTime; + + // 数据状态 + private String state; + // 下发状态 private String distributionState; diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DataPetition12337.java b/src/main/java/com/biutag/supervision/pojo/entity/DataPetition12337.java index bf3cd9f..be56333 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/DataPetition12337.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/DataPetition12337.java @@ -1,5 +1,6 @@ package com.biutag.supervision.pojo.entity; +import com.alibaba.excel.annotation.ExcelProperty; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; @@ -607,10 +608,8 @@ public class DataPetition12337 implements Serializable { private String distributionState; + @ExcelProperty("") @TableField(value="is_real") private Integer isReal; - - @TableField(exist = false) - private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaAjjbxx.java b/src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaAjjbxx.java new file mode 100644 index 0000000..382f4d4 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaAjjbxx.java @@ -0,0 +1,32 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Getter; +import lombok.Setter; + +// 案件基本信息 +@Setter +@Getter +public class DwdAsjZfbaAjjbxx { + + // 主键 + @TableField("zj") + private String zj; + + // 案件编号 + @TableField("ajbh") + private String ajbh; + + // 案件标志代码 + @TableField("ajbzdm") + private String ajbzdm; + + // 案件标准名称 + @TableField("ajbzmc") + private String ajbzmc; + + // 简要案情 + @TableField("jyaq") + private String jyaq; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaShrxx2.java b/src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaShrxx2.java new file mode 100644 index 0000000..ff87bb0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/DwdAsjZfbaShrxx2.java @@ -0,0 +1,512 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Getter; +import lombok.Setter; + +import java.util.Date; + +@Setter +@Getter +public class DwdAsjZfbaShrxx2 { + + // 主键 + @TableField("zj") + private String zj; + + // 操作标识 + @TableField("czbzdm") + private String czbzdm; + + // 操作标识_描述 + @TableField("czbzmc") + private String czbzmc; + + // 操作人 + @TableField("czr") + private String czr; + + // 案件编号 + @TableField("ajbh") + private String ajbh; + + // 公民身份号码 + @TableField("gmsfhm") + private String gmsfhm; + + // 人像ID + @TableField("rxid") + private String rxid; + + // 姓名 + @TableField("xm") + private String xm; + + // 性别 + @TableField("xbdm") + private String xbdm; + + // 性别_描述 + @TableField("xbmc") + private String xbmc; + + // 曾用名 + @TableField("cym") + private String cym; + + // 绰号 + @TableField("ch") + private String ch; + + // 民族 + @TableField("mzdm") + private String mzdm; + + // 民族_描述 + @TableField("mzmc") + private String mzmc; + + // 文化程度 + @TableField("whcddm") + private String whcddm; + + // 文化程度_描述 + @TableField("whcdmc") + private String whcdmc; + + // 工作单位 + @TableField("gzdw") + private String gzdw; + + // 职业 + @TableField("zy") + private String zy; + + // 住址地址 + @TableField("zzdzdm") + private String zzdzdm; + + // 住址地址_描述 + @TableField("zzdzmc") + private String zzdzmc; + + // 联系电话 + @TableField("lxdh") + private String lxdh; + + // 户籍地区划 + @TableField("hjdqhdm") + private String hjdqhdm; + + // 户籍地区划_描述 + @TableField("hjdqhmc") + private String hjdqhmc; + + // 户籍地地址 + @TableField("hjddz") + private String hjddz; + + // 籍贯区划 + @TableField("jgqhdm") + private String jgqhdm; + + // 籍贯区划_描述 + @TableField("jgqhmc") + private String jgqhmc; + + // 籍贯地址 + @TableField("jgdz") + private String jgdz; + + // 人员类别 + @TableField("rylbdm") + private String rylbdm; + + // 人员类别_描述 + @TableField("rylbmc") + private String rylbmc; + + // 人员属性 + @TableField("rysx") + private String rysx; + + // 身高 + @TableField("sg") + private String sg; + + // 血型 + @TableField("xx") + private String xx; + + // 身份 + @TableField("sfdm") + private String sfdm; + + // 身份_描述 + @TableField("sfmc") + private String sfmc; + + // 保密级别 + @TableField("bmjb") + private String bmjb; + + // 受害日期 + @TableField("shrq") + private Date shrq; + + // 受害地点 + @TableField("shdd") + private String shdd; + + // 受害程度 + @TableField("shcddm") + private String shcddm; + + // 受害程度_描述 + @TableField("shcdmc") + private String shcdmc; + + // 受害形式 + @TableField("shxsdm") + private String shxsdm; + + // 受害形式_描述 + @TableField("shxsmc") + private String shxsmc; + + // 是否聋哑 + @TableField("sflydm") + private String sflydm; + + // 是否聋哑_描述 + @TableField("sflymc") + private String sflymc; + + // 受害人类别 + @TableField("shrlbdm") + private String shrlbdm; + + // 受害人类别_描述 + @TableField("shrlbmc") + private String shrlbmc; + + // 致死原因 + @TableField("zsyydm") + private String zsyydm; + + // 致死原因_描述 + @TableField("zsyymc") + private String zsyymc; + + // 致死工具 + @TableField("zsgjdm") + private String zsgjdm; + + // 致死工具_描述 + @TableField("zsgjmc") + private String zsgjmc; + + // 受害经过 + @TableField("shjg") + private String shjg; + + // 国籍 + @TableField("gjdm") + private String gjdm; + + // 国籍_描述 + @TableField("gjmc") + private String gjmc; + + // 英文姓名 + @TableField("ywxm") + private String ywxm; + + // 证件类型 + @TableField("zjlxdm") + private String zjlxdm; + + // 证件类型_描述 + @TableField("zjlxmc") + private String zjlxmc; + + // 证件号码 + @TableField("zjhm") + private String zjhm; + + // 签证种类 + @TableField("qzzldm") + private String qzzldm; + + // 签证种类_描述 + @TableField("qzzlmc") + private String qzzlmc; + + + // 人员编号 + @TableField("rybh") + private String rybh; + + // 住址区划 + @TableField("zzqhdm") + private String zzqhdm; + + // 住址区划_描述 + @TableField("zzqhmc") + private String zzqhmc; + + // 拼音 + @TableField("py") + private String py; + + // 人员身份 + @TableField("rysfdm") + private String rysfdm; + + // 人员身份_描述 + @TableField("rysfmc") + private String rysfmc; + + // 总投资 + @TableField("ztz") + private String ztz; + + // 次数 + @TableField("cs") + private String cs; + + // 去处 + @TableField("qc") + private String qc; + + // 分红 + @TableField("fh") + private String fh; + + // 剩余 + @TableField("sy") + private String sy; + + // 投资平台名称 + @TableField("tzptmc") + private String tzptmc; + + // 作案公司名称 + @TableField("zagsmc") + private String zagsmc; + + // 投资渠道 + @TableField("tzqddm") + private String tzqddm; + + // 投资渠道_描述 + @TableField("tzqdmc") + private String tzqdmc; + + // 购买金额 + @TableField("gmje") + private String gmje; + + // 银行卡号 + @TableField("yhkh") + private String yhkh; + + + // 是否重点关注人员 + @TableField("sfzdgzrydm") + private String sfzdgzrydm; + + // 是否重点关注人员_描述 + @TableField("sfzdgzrymc") + private String sfzdgzrymc; + + // 是否本辖区居住 + @TableField("sfbxqjzdm") + private String sfbxqjzdm; + + // 是否本辖区居住_描述 + @TableField("sfbxqjzmc") + private String sfbxqjzmc; + + // 关注类型 + @TableField("gzlxdm") + private String gzlxdm; + + // 关注类型_描述 + @TableField("gzlxmc") + private String gzlxmc; + + // 是否上门问话 + @TableField("sfsmwhdm") + private String sfsmwhdm; + + // 是否上门问话_描述 + @TableField("sfsmwhmc") + private String sfsmwhmc; + + // 是否已经报案 + @TableField("sfyjbadm") + private String sfyjbadm; + + // 是否已经报案_描述 + @TableField("sfyjbamc") + private String sfyjbamc; + + // 稳控民警姓名 + @TableField("wkmjxm") + private String wkmjxm; + + // 稳控民警联系方式 + @TableField("wkmjlxfs") + private String wkmjlxfs; + + // 乡镇责任人姓名 + @TableField("xzzrrxm") + private String xzzrrxm; + + // 乡镇责任人联系方式 + @TableField("xzzrrlxfs") + private String xzzrrlxfs; + + // 报案单位名称 + @TableField("badwmc") + private String badwmc; + + // 是否已制作询问笔录 + @TableField("sfyzzxwbldm") + private String sfyzzxwbldm; + + // 是否已制作询问笔录_描述 + @TableField("sfyzzxwblmc") + private String sfyzzxwblmc; + + // 是否有出入境证件 + @TableField("sfycrjzjdm") + private String sfycrjzjdm; + + // 是否有出入境证件_描述 + @TableField("sfycrjzjmc") + private String sfycrjzjmc; + + // 理财师姓名 + @TableField("lcsxm") + private String lcsxm; + + // 是否专案受害人 + @TableField("sfzashrdm") + private String sfzashrdm; + + // 是否专案受害人_描述 + @TableField("sfzashrmc") + private String sfzashrmc; + + // 是否被侵犯民、辅警,1民警,2辅警 + @TableField("sfmfj") + private String sfmfj; + + // 被侵犯民、辅警警种,字典类别4110 + @TableField("mfjjingzhong") + private String mfjjingzhong; + + // 被侵犯民、辅警单位 + @TableField("mfjdanwei") + private String mfjdanwei; + + // 被侵犯民、辅警公安机关 + @TableField("mfjgonganjiguan") + private String mfjgonganjiguan; + + // 是否未成年 + @TableField("wcn") + private String wcn; + + // 录入时间 + @TableField("lurushijian") + private String lurushijian; + + // + @TableField("ifzfcs") + private String ifzfcs; + + // 无身份证原因 + @TableField("wsfzyy") + private String wsfzyy; + + // + @TableField("fddlrbh") + private String fddlrbh; + + // 法定代理人编号 + @TableField("fddlrxm") + private String fddlrxm; + + // 录入单位代码 + @TableField("lrdwdm") + private String lrdwdm; + + // 录入单位名称 + @TableField("lrdwmc") + private String lrdwmc; + + // 修改单位代码 + @TableField("xgdwdm") + private String xgdwdm; + + // 修改单位名称 + @TableField("xgdwmc") + private String xgdwmc; + + // 数据来源 + @TableField("sjly") + private String sjly; + + // 部级案件编码 + @TableField("bjajbm") + private String bjajbm; + + // 部级案事件相关人员编码 + @TableField("bjrybm") + private String bjrybm; + + // 问题数据编号 + @TableField("wtsjbh") + private String wtsjbh; + + // 年龄 + @TableField("nl") + private String nl; + + // 被侵害年龄 + @TableField("bqhsnl") + private String bqhsnl; + + // 侵害过程 + @TableField("qhgc") + private String qhgc; + + // 特殊群体 + @TableField("tsqt") + private String tsqt; + + // 监护情况 + @TableField("jhqk") + private String jhqk; + + + // + @TableField("sjzx_nbid") + private String sjzxNbid; + + // + @TableField("sjzx_yl1") + private String sjzxYl1; + + // + @TableField("sjzx_yl2") + private String sjzxYl2; + + // + @TableField("sjzx_yl3") + private String sjzxYl3; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/Negative.java b/src/main/java/com/biutag/supervision/pojo/entity/Negative.java index a0dff2c..21f7dba 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/Negative.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/Negative.java @@ -44,25 +44,6 @@ public class Negative { @TableField("problemSources") private String problemSources; - // 联系电话 - @TableField("contactPhone") - private String contactPhone; - - // 反映人姓名 - @TableField("responderName") - private String responderName; - - // 反映人部门id - @TableField("responderDepartId") - private String responderDepartId; - - // 反映人部门名称 - @TableField("responderDepartName") - private String responderDepartName; - - // 涉及人身份证 - @TableField("responderIdCard") - private String responderIdCard; // 业务类型 @TableField("businessTypeCode") @@ -92,6 +73,18 @@ public class Negative { @TableField("involveDepartId") private String involveDepartId; + // 联系电话 + @TableField("contactPhone") + private String contactPhone; + + // 反映人姓名 + @TableField("responderName") + private String responderName; + + // 涉及人身份证 + @TableField("responderIdCard") + private String responderIdCard; + // 简要描述 @TableField("thingDesc") private String thingDesc; @@ -305,4 +298,8 @@ public class Negative { @TableField("sample_id") private Integer sampleId; + + // 下发问题 + private String problems; + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeCountersignApply.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeCountersignApply.java index eeb0c10..14cb9d3 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/NegativeCountersignApply.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeCountersignApply.java @@ -42,4 +42,11 @@ public class NegativeCountersignApply { @TableField("create_depart_name") private String createDepartName; + + // 创建角色 + private String createRoleCode; + + // 创建单位 + private String createDepartId; + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/NegativeTask.java b/src/main/java/com/biutag/supervision/pojo/entity/NegativeTask.java index a3dea71..4fd64bc 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/NegativeTask.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/NegativeTask.java @@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Getter; import lombok.Setter; +import lombok.experimental.Accessors; import java.time.LocalDateTime; +@Accessors(chain = true) @Setter @Getter public class NegativeTask { @@ -82,4 +84,7 @@ public class NegativeTask { private String source; + // 创建用户名 + private String crtUsername; + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/News.java b/src/main/java/com/biutag/supervision/pojo/entity/News.java index 5e0e110..3b133af 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/News.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/News.java @@ -48,4 +48,6 @@ public class News { @TableField("depart_id") private String departId; + private String files; + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/RpcApply.java b/src/main/java/com/biutag/supervision/pojo/entity/RpcApply.java index 0f8744e..2fea765 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/RpcApply.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/RpcApply.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Getter; import lombok.Setter; +import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Date; @@ -20,8 +21,8 @@ public class RpcApply { // 申请时间 @TableField("apply_date") - @JsonFormat(pattern="yyyy-MM-dd HH:mm") - private Date applyDate; + @JsonFormat(pattern="yyyy-MM-dd") + private LocalDate applyDate; // 发生时间 @JsonFormat(pattern="yyyy-MM-dd HH:mm") @@ -71,6 +72,9 @@ public class RpcApply { private String relation; + // 代理人 + private String agentName; + // 主办单位 private String handleDepartId; @@ -92,4 +96,10 @@ public class RpcApply { private Integer step; + // 案件编号 + private String caseNumber; + + // 数据来源 + private String source; + } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/RpcApplyApprove.java b/src/main/java/com/biutag/supervision/pojo/entity/RpcApplyApprove.java index 0841454..b6a5e09 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/RpcApplyApprove.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/RpcApplyApprove.java @@ -3,6 +3,7 @@ package com.biutag.supervision.pojo.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Getter; import lombok.Setter; @@ -13,7 +14,7 @@ import java.time.LocalDateTime; public class RpcApplyApprove { // - @TableId(value = "id") + @TableId(type = IdType.AUTO) private Integer id; // @@ -30,6 +31,7 @@ public class RpcApplyApprove { // @TableField("create_time") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") private LocalDateTime createTime; // 操作人 diff --git a/src/main/java/com/biutag/supervision/pojo/entity/RpcComfortPacks.java b/src/main/java/com/biutag/supervision/pojo/entity/RpcComfortPacks.java new file mode 100644 index 0000000..3010c9b --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/RpcComfortPacks.java @@ -0,0 +1,56 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class RpcComfortPacks { + + // + @TableId(value = "id") + private String id; + + // + @TableField("report_title") + private String reportTitle; + + // 呈报时间 + @TableField("report_time") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime reportTime; + + // 呈报人 + @TableField("report_person") + private String reportPerson; + + // 呈报类型 2=抚慰 + @TableField("report_type") + private String reportType; + + // 呈报人数 + @TableField("report_num") + private Integer reportNum; + + // 呈报金额 + @TableField("report_money") + private Double reportMoney; + + // 状态 0 线上审批,1线下审批 + @TableField("report_status") + private String reportStatus; + + // 抚慰申请相关zip文件路径 + @TableField("report_zip") + private String reportZip; + + // 慰问信:0 未发送,1已发送 + @TableField("report_message") + private String reportMessage; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/RpcPacksComfort.java b/src/main/java/com/biutag/supervision/pojo/entity/RpcPacksComfort.java new file mode 100644 index 0000000..b797416 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/RpcPacksComfort.java @@ -0,0 +1,30 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class RpcPacksComfort { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // 打包id + private String packsId; + + // 抚慰id + @TableField("rpc_id") + private String rpcId; + + // 状态 + @TableField("status") + private String status; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/RpcPerson.java b/src/main/java/com/biutag/supervision/pojo/entity/RpcPerson.java index 467790f..1d55484 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/RpcPerson.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/RpcPerson.java @@ -1,13 +1,10 @@ package com.biutag.supervision.pojo.entity; -import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import lombok.Getter; import lombok.Setter; -import java.time.LocalDateTime; - @Setter @Getter public class RpcPerson { diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupDictHandleResultMaping.java b/src/main/java/com/biutag/supervision/pojo/entity/SupDictHandleResultMaping.java new file mode 100644 index 0000000..345f78d --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupDictHandleResultMaping.java @@ -0,0 +1,41 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class SupDictHandleResultMaping { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("external_name") + private String externalName; + + // + @TableField("internal_name") + private String internalName; + + // + @TableField("internal_id") + private String internalId; + + // + @TableField("create_time") + private LocalDateTime createTime; + + // + @TableField("update_time") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime updateTime; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/VideoConfig.java b/src/main/java/com/biutag/supervision/pojo/entity/VideoConfig.java new file mode 100644 index 0000000..9ce42a7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/VideoConfig.java @@ -0,0 +1,51 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Setter +@Getter +public class VideoConfig { + + // + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + // + @TableField("depart_id") + private Integer departId; + + // + @TableField("parent_id") + private String parentId; + + // + @TableField("device_id") + private String deviceId; + + private String videoUrl; + + private String imgUrl; + + private String deviceName; + + // + @TableField("create_time") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + // + @TableField("sort_id") + private Integer sortId; + + // + @TableField("depart_name") + private String departName; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/WvpDeviceChannel.java b/src/main/java/com/biutag/supervision/pojo/entity/WvpDeviceChannel.java index 14c4d97..a53f3a5 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/WvpDeviceChannel.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/WvpDeviceChannel.java @@ -17,11 +17,11 @@ public class WvpDeviceChannel { @TableId(value = "id", type = IdType.AUTO) private Long id; - // + // 当前单位/设备的id @TableField("device_id") private String deviceId; - // + // 当前设备名称 @TableField("name") private String name; @@ -49,7 +49,7 @@ public class WvpDeviceChannel { @TableField("address") private String address; - // + // 为1的是单位,为0的是摄像头设备 @TableField("parental") private Integer parental; @@ -97,7 +97,7 @@ public class WvpDeviceChannel { @TableField("password") private String password; - // + // ON为在线,OFF为离线 @TableField("status") private String status; @@ -335,5 +335,5 @@ public class WvpDeviceChannel { // 存储子设备的列表 @TableField(exist = false) - private List childList = new ArrayList<>(); + private List children = new ArrayList<>(); } \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/entity/mailbox/MailBlame.java b/src/main/java/com/biutag/supervision/pojo/entity/mailbox/MailBlame.java new file mode 100644 index 0000000..d276c84 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/mailbox/MailBlame.java @@ -0,0 +1,46 @@ +package com.biutag.supervision.pojo.entity.mailbox; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * @author wxc + * @date 2025/2/26 + */ +@Accessors(chain = true) +@Setter +@Getter +public class MailBlame { + + @TableId(type = IdType.AUTO) + private Integer id; + + private String mailId; + + private Integer deptId; + + private String blameName; + + private String blameEmpNo; + + private String blameIdCode; + + /** + * 核办-查证属实问题(json) + */ + private String verifyProblem; + /** + * 核办-责任追究(json) + */ + private String verifyPunish; + + /** + * 创建时间 + */ + private LocalDateTime createTime; +} diff --git a/src/main/java/com/biutag/supervision/pojo/model/PoliceModel.java b/src/main/java/com/biutag/supervision/pojo/model/PoliceModel.java index c19e5e0..9a316ad 100644 --- a/src/main/java/com/biutag/supervision/pojo/model/PoliceModel.java +++ b/src/main/java/com/biutag/supervision/pojo/model/PoliceModel.java @@ -111,4 +111,6 @@ public class PoliceModel { // 刪除原因 private String delReason; + private String userId; + } diff --git a/src/main/java/com/biutag/supervision/pojo/model/UserAuth.java b/src/main/java/com/biutag/supervision/pojo/model/UserAuth.java index 14a828c..19d4fb0 100644 --- a/src/main/java/com/biutag/supervision/pojo/model/UserAuth.java +++ b/src/main/java/com/biutag/supervision/pojo/model/UserAuth.java @@ -1,5 +1,7 @@ package com.biutag.supervision.pojo.model; +import com.baomidou.mybatisplus.annotation.TableField; +import jakarta.validation.constraints.NotBlank; import lombok.Getter; import lombok.Setter; import lombok.experimental.Accessors; @@ -24,6 +26,12 @@ public class UserAuth implements Serializable { private String departName; + // 警号 + private String empNo; + + // 手机号 + private String mobile; + // 角色编号 private List roleCodes; diff --git a/src/main/java/com/biutag/supervision/pojo/param/DataPetitionComplaintQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/DataPetitionComplaintQueryParam.java index b6cf5b3..7b9160b 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/DataPetitionComplaintQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/DataPetitionComplaintQueryParam.java @@ -1,5 +1,6 @@ package com.biutag.supervision.pojo.param; +import com.baomidou.mybatisplus.annotation.TableField; import lombok.Getter; import lombok.Setter; import org.springframework.format.annotation.DateTimeFormat; @@ -24,10 +25,19 @@ public class DataPetitionComplaintQueryParam extends BasePage { @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private List discoveryTime = new ArrayList<>(); + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List createTime = new ArrayList<>(); + private String checkStatus; // 是否属实 1属实 2部分属实 3不属实 private String thingDesc; private String distributionState; + // 被投诉机构 + private String departId; + + // 初重信访 + private String initialPetition; + } diff --git a/src/main/java/com/biutag/supervision/pojo/param/NegativeTaskQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/NegativeTaskQueryParam.java index 544071c..b449324 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/NegativeTaskQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/NegativeTaskQueryParam.java @@ -16,6 +16,8 @@ public class NegativeTaskQueryParam extends BasePage { private String source; + private String category; + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private List crtTime = new ArrayList<>(); diff --git a/src/main/java/com/biutag/supervision/pojo/param/RpcApplyQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/RpcApplyQueryParam.java index 1069ac3..ac34745 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/RpcApplyQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/RpcApplyQueryParam.java @@ -24,4 +24,6 @@ public class RpcApplyQueryParam extends BasePage { private String applicantEmpName; private String departId; + + private String rpcStatus; } diff --git a/src/main/java/com/biutag/supervision/pojo/param/RpcComfortPacksParam.java b/src/main/java/com/biutag/supervision/pojo/param/RpcComfortPacksParam.java new file mode 100644 index 0000000..d0903be --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/RpcComfortPacksParam.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; +import java.util.List; + +/** + * @author wxc + * @date 2025/2/6 + */ +@Setter +@Getter +public class RpcComfortPacksParam extends BasePage { + + private String reportTitle; + + @DateTimeFormat(pattern = "yyyy-MM-dd") + private List reportTime; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/VideoConfigQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/VideoConfigQueryParam.java new file mode 100644 index 0000000..ca5d101 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/VideoConfigQueryParam.java @@ -0,0 +1,16 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; + +/** + * @author wxc + * @date 2025/3/6 + */ +@Setter +@Getter +public class VideoConfigQueryParam extends BasePage { + + private String departId; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/VideoInspectionQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/VideoInspectionQueryParam.java index 37c9c8d..c84a83b 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/VideoInspectionQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/VideoInspectionQueryParam.java @@ -1,5 +1,6 @@ package com.biutag.supervision.pojo.param; +import com.biutag.supervision.constants.enums.StatusEnum; import lombok.Getter; import lombok.Setter; @@ -19,4 +20,8 @@ public class VideoInspectionQueryParam extends BasePage { private String departId; + private String distributionState; + + private String state = StatusEnum.ENABLE.getValue(); + } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/DataPetition12337ExportVo.java b/src/main/java/com/biutag/supervision/pojo/vo/DataPetition12337ExportVo.java new file mode 100644 index 0000000..c16ce3d --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/DataPetition12337ExportVo.java @@ -0,0 +1,588 @@ +package com.biutag.supervision.pojo.vo; + +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * + * @TableName data_petition_12337 + */ +@Data +public class DataPetition12337ExportVo implements Serializable { + + /** + * 外网线索编号 + */ + @ExcelProperty("外网线索编号") + private String externalId; + + /** + * 内网线索编号 + */ + @ExcelProperty("内网线索编号") + private String innerId; + + /** + * 单机版线索编号 + */ + @ExcelProperty("单机版线索编号") + private String standAlone; + + /** + * 信息受理登记时间 + */ + @ExcelProperty("信息受理登记时间") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") + private LocalDateTime discoverTime; + + /** + * 线索来源 + */ + @ExcelProperty("线索来源") + private String letterSource; + + /** + * 举报人姓名 + */ + @ExcelProperty("举报人姓名") + private String name; + + /** + * 手机号码 + */ + @ExcelProperty("手机号码") + private String phone; + + /** + * 身份证号 + */ + @ExcelProperty("身份证号") + private String idCode; + + /** + * 举报人(省) + */ + @ExcelProperty("举报人(省)") + private String reporterProvincial; + + /** + * 举报人(市) + */ + @ExcelProperty("举报人(市)") + private String reporterCity; + + /** + * 举报人(县) + */ + @ExcelProperty("举报人(县)") + private String reporterCounty; + + /** + * 现住地详址 + */ + @ExcelProperty("现住地详址") + private String address; + + /** + * 是否政法干警 + */ + @ExcelProperty("是否政法干警") + private String isLawPolice; + + /** + * 被举报人姓名 + */ + @ExcelProperty("被举报人姓名") + private String reportedName; + + /** + * 所属系统 + */ + @ExcelProperty("所属系统") + private String belongSystem; + + /** + * 人员类别 + */ + @ExcelProperty("人员类别") + private String personType; + + /** + * 被举报人所在地(省) + */ + @ExcelProperty("被举报人所在地(省)") + private String reportedProvincial; + + /** + * 被举报人所在地(市) + */ + @ExcelProperty("被举报人所在地(市)") + private String reportedCity; + + /** + * 被举报人所在地(县) + */ + @ExcelProperty("被举报人所在地(县)") + private String reportedCounty; + + /** + * 单位名称 + */ + @ExcelProperty("单位名称") + private String orgName; + + /** + * 单位所属层级 + */ + @ExcelProperty("单位所属层级") + private String orgLevel; + + /** + * 具体职务 + */ + @ExcelProperty("具体职务") + private String jobName; + + /** + * 职级 + */ + @ExcelProperty("职级") + private String jobLevel; + + /** + * 被举报单位名称 + */ + @ExcelProperty("被举报单位名称") + private String reportedOrgName; + + /** + * 被举报单位所属系统 + */ + @ExcelProperty("被举报单位所属系统") + private String reportedOrgBelong; + + /** + * 被举报单位所在地(省) + */ + @ExcelProperty("被举报单位所在地(省)") + private String reportedOrgProvincial; + + /** + * 被举报单位所在地(市) + */ + @ExcelProperty("被举报单位所在地(市)") + private String reportedOrgCity; + + /** + * 被举报单位所在地(县) + */ + @ExcelProperty("被举报单位所在地(县)") + private String reportedOrgCounty; + + /** + * 被举报单位单位所属层级 + */ + @ExcelProperty("单位所属层级") + private String reportedOrgLevel; + + /** + * 涉嫌违纪问题项目 + */ + @ExcelProperty("涉嫌违纪问题项目") + private String againstProProject; + + /** + * 涉嫌贪污贿赂类犯罪 + */ + @ExcelProperty("涉嫌贪污贿赂类犯罪") + private String corruptionGuilt; + + /** + * 涉嫌渎职类犯罪 + */ + @ExcelProperty("涉嫌渎职类犯罪") + private String omissionGuilt; + + /** + * 涉嫌侵犯公民人身权利类犯罪 + */ + @ExcelProperty("涉嫌侵犯公民人身权利类犯罪") + private String invadeEntitlementGuilt; + + /** + * 涉嫌侵犯财产类犯罪 + */ + @ExcelProperty("涉嫌侵犯财产类犯罪") + private String invadeFinanceGuilt; + + /** + * 其他 + */ + @ExcelProperty("其他") + private String otherGuilt; + + /** + * 顽瘴痼疾项目 + */ + @ExcelProperty("顽瘴痼疾项目") + private String hardProProject; + + /** + * 涉嫌违纪违法事项 + */ + @ExcelProperty("涉嫌违纪违法事项") + private String wjwfProject; + + /** + * 转办时间 + */ + @ExcelProperty("转办时间") + private String passTime; + + /** + * 转办单位 + */ + @ExcelProperty("转办单位") + private String passOrg; + + /** + * 核查时间 + */ + @ExcelProperty("核查时间") + private String reviewTime; + + /** + * 核查单位 + */ + @ExcelProperty("核查单位") + private String handleSecondDepartName; + + /** + * 核查人 + */ + @ExcelProperty("核查人") + private String reviewPersonName; + + /** + * 核查人联系方式 + */ + @ExcelProperty("核查人联系方式") + private String reviewPersonPhone; + + /** + * 被核查人类别 + */ + @ExcelProperty("被核查人类别") + private String reviewedPersonType; + + /** + * 被核查人是否属于领导班子成员 + */ + @ExcelProperty("被核查人是否属于领导班子成员") + private String reviewedPersonIsleader; + + /** + * 是否核查完结 + */ + @ExcelProperty("是否核查完结") + private String reviewedIsover; + + /** + * 核查简要情况 + */ + @ExcelProperty("核查简要情况") + private String checkStatusDesc; + + /** + * 办理结果 + */ + @ExcelProperty("办理结果") + private String processResult; + + /** + * 是否进行线索初核 + */ + @ExcelProperty("是否进行线索初核") + private String isFirstView; + + /** + * 核查组组长 + */ + @ExcelProperty("核查组组长") + private String reviewLeader; + + /** + * (核查组组长)联系方式 + */ + @ExcelProperty("(核查组组长)联系方式") + private String reviewLeaderPhone; + + /** + * 初核情况 + */ + @ExcelProperty("初核情况") + private String firstViewDes; + + /** + * 是否立案审查调查 + */ + @ExcelProperty("是否立案审查调查") + private String isRegisterCase; + + /** + * 立案审查调查情况 + */ + @ExcelProperty("立案审查调查情况") + private String registerCaseDes; + + /** + * 是否处分处理 + */ + @ExcelProperty("是否处分处理") + private String isPunish; + + /** + * 处理结论形态 + */ + @ExcelProperty("处理结论形态") + private String processResType; + + /** + * 处理结论结果 + */ + @ExcelProperty("处理结论结果") + private String processResDes; + + /** + * 处分处理情况 + */ + @ExcelProperty("处分处理情况") + private String punishDes; + + /** + * 是否适用自查从宽政策 + */ + @ExcelProperty("是否适用自查从宽政策") + private String isTolerant; + + /** + * 是否办结 + */ + @ExcelProperty("是否办结") + private String isOver; + + /** + * 联系时间 + */ + @ExcelProperty("联系时间") + private String contactTime; + + /** + * 联系单位 + */ + @ExcelProperty("联系单位") + private String contactOrg; + + /** + * 联系人 + */ + @ExcelProperty("联系人") + private String contactPersonName; + + /** + * 联系方式 + */ + @ExcelProperty("联系方式") + private String contactType; + + /** + * 与举报人联系沟通详情 + */ + @ExcelProperty("与举报人联系沟通详情") + private String contactReporterDes; + + /** + * 超期未反馈原因 + */ + @ExcelProperty("超期未反馈原因") + private String overtimeReason; + + /** + * 是否申请异议 + */ + @ExcelProperty("是否申请异议") + private String isDissent; + + /** + * 目标省份 + */ + @ExcelProperty("目标省份") + private String aimProvincial; + + /** + * 申请人 + */ + @ExcelProperty("申请人") + private String applyPersonName; + + /** + * 联系方式 + */ + @ExcelProperty("联系方式") + private String applyPersonPhone; + + /** + * 申请原因 + */ + @ExcelProperty("申请原因") + private String applyReason; + + /** + * 异议处理方式 + */ + @ExcelProperty("异议处理方式") + private String dissentHandle; + + /** + * 处理说明 + */ + @ExcelProperty("处理说明") + private String dissentHandleExplain; + + /** + * 是否存在附件 + */ + @ExcelProperty("是否存在附件") + private String isAnnex; + + /** + * 附件文件名 + */ + @ExcelProperty("附件文件名") + private String annexName; + + /** + * 线索举报时间 + */ + @ExcelProperty("线索举报时间") + private String reportTime; + + /** + * 导入时间 + */ + @ExcelProperty("导入时间") + private String enterTime; + + /** + * 分发时间 + */ + @ExcelProperty("分发时间") + private String distributeTime; + + /** + * 是否违纪违法线索 + */ + @ExcelProperty("是否违纪违法线索") + private String isAgainstClue; + + /** + * 是否涉法涉诉线索 + */ + @ExcelProperty("是否涉法涉诉线索") + private String isAppealClue; + + /** + * 是否范围外线索 + */ + @ExcelProperty("是否范围外线索") + private String isOverroundClue; + + /** + * 是否无效线索 + */ + @ExcelProperty("是否无效线索") + private String isInvalidClue; + + /** + * 是否重点线索 + */ + @ExcelProperty("是否重点线索") + private String isImportantClue; + + /** + * 线索是否重复 + */ + @ExcelProperty("线索是否重复") + private String isRepeatClue; + + /** + * 重复线索组别 + */ + @ExcelProperty("重复线索组别") + private String repeatClueType; + + /** + * 线索是否进行了机筛 + */ + @ExcelProperty("线索是否进行了机筛") + private String isMachine; + + /** + * 机筛线索时间 + */ + @ExcelProperty("机筛线索时间") + private String machineTme; + + /** + * 线索是否经过人工筛查 + */ + @ExcelProperty("线索是否经过人工筛查") + private String isPerson; + + /** + * 人工筛查线索时间 + */ + @ExcelProperty("人工筛查线索时间") + private String personTime; + + /** + * 是否关注线索 + */ + @ExcelProperty("是否关注线索") + private String isCare; + + /** + * 关注时间 + */ + @ExcelProperty("关注时间") + private String careTime; + + /** + * 操作时间 + */ + @ExcelProperty("操作时间") + private String handleTime; + + /** + * 唯一编号 + */ + @ExcelProperty("唯一编号") + private String onlyId; + + // 经办人 + @ExcelIgnore + private String handlePolices; + + // 核查情况 + @ExcelIgnore + private String checkStatusName; + + @ExcelIgnore + private String id; +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/vo/DataPetitionComplaintExportGabxfVo.java b/src/main/java/com/biutag/supervision/pojo/vo/DataPetitionComplaintExportGabxfVo.java index 9e80ff7..743e95f 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/DataPetitionComplaintExportGabxfVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/DataPetitionComplaintExportGabxfVo.java @@ -79,4 +79,5 @@ public class DataPetitionComplaintExportGabxfVo { @ExcelProperty({"", "初重信访"}) private String initialPetition; + } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeBlameVo.java b/src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeBlameVo.java index 231431a..85da4b7 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeBlameVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/ExportNegativeBlameVo.java @@ -1,7 +1,6 @@ package com.biutag.supervision.pojo.vo; import com.alibaba.excel.annotation.ExcelProperty; -import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Getter; import lombok.Setter; @@ -15,10 +14,35 @@ public class ExportNegativeBlameVo { @ExcelProperty({"问题编号"}) private String id; + // 通报期数 + @ExcelProperty({"通报期数"}) + private String reportNumber; + + // 问题发现时间 + @ExcelProperty({"问题发现时间"}) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime discoveryTime; + + // 业务类别名称 + @ExcelProperty({"问题来源"}) + private String problemSources; + + // 业务类别名称 + @ExcelProperty({"业务类别"}) + private String businessTypeName; + + // 涉嫌问题 JSON + @ExcelProperty({"涉嫌问题"}) + private String involveProblem; + // 简要描述 @ExcelProperty({"简要描述"}) private String thingDesc; + // 涉及单位名称 + @ExcelProperty({"涉及单位"}) + private String involveDepartName; + // 办理单位 二级 @ExcelProperty({"办理单位(二级)"}) private String handleSecondDepartName; @@ -57,6 +81,19 @@ public class ExportNegativeBlameVo { @ExcelProperty({"人员属性"}) private String ivPersonType; + // 责任领导 + @ExcelProperty({"责任领导姓名"}) + private String leadName; + + // 领导警号 + @ExcelProperty({"责任领导警号"}) + private String leadEmpNo; + + // 责任领导身份证 + @ExcelProperty({"责任领导身份证"}) + private String leadIdCode; + + @ExcelProperty({"责任追责"}) private String handleResultName; diff --git a/src/main/java/com/biutag/supervision/pojo/vo/NegativeAuditExportVo.java b/src/main/java/com/biutag/supervision/pojo/vo/NegativeAuditExportVo.java new file mode 100644 index 0000000..d20d665 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/NegativeAuditExportVo.java @@ -0,0 +1,59 @@ +package com.biutag.supervision.pojo.vo; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.metadata.data.ImageData; +import com.alibaba.excel.metadata.data.WriteCellData; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +/** + * + * @TableName data_petition_12337 + */ +@Data +public class NegativeAuditExportVo implements Serializable { + + // 业务类别名称 + @ExcelProperty("业务类别") + private String businessTypeName; + + // 问题来源 + @ExcelProperty("问题来源") + private String problemSources; + + // 问题发现时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + @ExcelProperty("问题发现时间") + private LocalDateTime discoveryTime; + + // 涉及案件/警情编号 + @ExcelProperty("案件/警情编号") + private String caseNumber; + + @ExcelProperty("问题种类") + private String problems; + + + // 简要描述 + @ExcelProperty("具体问题内容") + private String thingDesc; + + @ExcelProperty("整改情况") + private String rectifyDesc; + + @ExcelProperty("整改佐证材料") + @ColumnWidth(40) + private WriteCellData files; + + @ExcelProperty("涉及单位") + private String involveDepartName; + + @ExcelProperty("责任人员") + private String blames; + +} \ No newline at end of file diff --git a/src/main/java/com/biutag/supervision/pojo/vo/RpcApplyApproveVo.java b/src/main/java/com/biutag/supervision/pojo/vo/RpcApplyApproveVo.java new file mode 100644 index 0000000..aaeefd1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/RpcApplyApproveVo.java @@ -0,0 +1,30 @@ +package com.biutag.supervision.pojo.vo; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +/** + * @author wxc + * @date 2025/3/19 + */ +@Setter +@Getter +public class RpcApplyApproveVo { + + private Boolean returnFlag; + + private String actionName; + + private String handleName; + + private String commentLabel; + + private String comments; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime createTime; + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/RpcApplyVo.java b/src/main/java/com/biutag/supervision/pojo/vo/RpcApplyVo.java index a83fee3..63b600a 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/RpcApplyVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/RpcApplyVo.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Getter; import lombok.Setter; +import java.time.LocalDate; import java.time.LocalDateTime; /** @@ -19,11 +20,11 @@ public class RpcApplyVo { private String number; // 申请时间 - @JsonFormat(pattern="yyyy-MM-dd") - private LocalDateTime applyDate; + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd") + private LocalDate applyDate; // 发生时间 - @JsonFormat(pattern="yyyy-MM-dd HH:mm") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm") private LocalDateTime happenTime; // 部门id @@ -35,6 +36,8 @@ public class RpcApplyVo { private String applicantEmpName; + private String applicantEmpNo; + // 开户行 private String bankCard; @@ -45,4 +48,40 @@ public class RpcApplyVo { private String approver; + // 案件编号 + private String caseNumber; + + // 事实及理由 + private String factReason; + + // 主办单位 + private String handleDepartId; + + private String handleDepartName; + + // 受伤程度 + private String injurySeverity; + private String injurySeverityName; + + // 职位 + private String job; + + private Integer sex; + + private String sexName; + + private String birthday; + + // 文化程度 + private String levelEducation; + + // 政治面貌 + private String politicCountenance; + + // 警衔 + private String policeRank; + + // 联系方式 + private String mobile; + } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/RpcComfortPacksVo.java b/src/main/java/com/biutag/supervision/pojo/vo/RpcComfortPacksVo.java new file mode 100644 index 0000000..654a011 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/RpcComfortPacksVo.java @@ -0,0 +1,38 @@ +package com.biutag.supervision.pojo.vo; + +import com.biutag.supervision.pojo.entity.RpcApply; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +/** + * @author wxc + * @date 2025/3/17 + */ +@Setter +@Getter +public class RpcComfortPacksVo { + + private String reportTitle; + + // 呈报时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime reportTime; + + private String reportPerson; + + // 呈报类型 2=抚慰 + private String reportType; + + // 呈报人数 + private Integer reportNum; + + private Double reportMoney; + + private List comforts = new ArrayList<>(); + +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/VideoInspectionVo.java b/src/main/java/com/biutag/supervision/pojo/vo/VideoInspectionVo.java index c2849d3..4964d2c 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/VideoInspectionVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/VideoInspectionVo.java @@ -1,6 +1,5 @@ package com.biutag.supervision.pojo.vo; -import com.baomidou.mybatisplus.annotation.TableField; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/com/biutag/supervision/service/BaseUserService.java b/src/main/java/com/biutag/supervision/service/BaseUserService.java index 1cdfc48..f8e98b4 100644 --- a/src/main/java/com/biutag/supervision/service/BaseUserService.java +++ b/src/main/java/com/biutag/supervision/service/BaseUserService.java @@ -79,6 +79,12 @@ public class BaseUserService extends ServiceImpl { return getOne(new LambdaQueryWrapper().eq(BaseUser::getUserName, userName)); } + public List getRoleIds(String userName) { + BaseUser user = getByUserName(userName); + List roleUsers = roleUserService.list(new LambdaQueryWrapper() + .eq(BaseRoleUser::getUserId, user.getUserId())); + return roleUsers.stream().map(BaseRoleUser::getRoleId).distinct().toList(); + } @Transactional(rollbackFor = Exception.class) @DS("slave") public boolean save(UserDto userDto) { @@ -117,17 +123,7 @@ public class BaseUserService extends ServiceImpl { @DS("slave") public boolean update(UserDto userDto) { - roleUserService.remove(new LambdaQueryWrapper().eq(BaseRoleUser::getUserId, userDto.getUserId())); - if (!userDto.getRoleIds().isEmpty()) { - roleUserService.saveBatch(userDto.getRoleIds().stream().map(roleId -> { - BaseRoleUser baseRoleUser = new BaseRoleUser(); - baseRoleUser.setUserId(userDto.getUserId()); - baseRoleUser.setRoleId(roleId); - baseRoleUser.setCreateTime(LocalDateTime.now()); - baseRoleUser.setUpdateTime(LocalDateTime.now()); - return baseRoleUser; - }).toList()); - } + updateRoleCode(userDto.getUserId(), userDto.getRoleIds()); LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() .eq(BaseUser::getUserId, userDto.getUserId()) .set(BaseUser::getNickName, userDto.getNickName()) @@ -139,4 +135,26 @@ public class BaseUserService extends ServiceImpl { return update(updateWrapper); } + @DS("slave") + public boolean updateRoleCode(String userId, List roleIds) { + roleUserService.remove(new LambdaQueryWrapper().eq(BaseRoleUser::getUserId, userId)); + if (!roleIds.isEmpty()) { + roleUserService.saveBatch(roleIds.stream().map(roleId -> { + BaseRoleUser baseRoleUser = new BaseRoleUser(); + baseRoleUser.setUserId(userId); + baseRoleUser.setRoleId(roleId); + baseRoleUser.setCreateTime(LocalDateTime.now()); + baseRoleUser.setUpdateTime(LocalDateTime.now()); + return baseRoleUser; + }).toList()); + } + return true; + } + + @DS("slave") + public boolean updateRoleCodeByUserName(String userName, List roleIds) { + BaseUser user = getByUserName(userName); + return updateRoleCode(user.getUserId(), roleIds); + } + } diff --git a/src/main/java/com/biutag/supervision/service/DataAlarmYjzjService.java b/src/main/java/com/biutag/supervision/service/DataAlarmYjzjService.java index 77262a3..6fe415a 100644 --- a/src/main/java/com/biutag/supervision/service/DataAlarmYjzjService.java +++ b/src/main/java/com/biutag/supervision/service/DataAlarmYjzjService.java @@ -1,8 +1,10 @@ package com.biutag.supervision.service; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.biutag.supervision.mapper.DataAlarmYjzjMapper; import com.biutag.supervision.pojo.entity.DataAlarmYjzj; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -10,8 +12,19 @@ import java.util.List; @Service public class DataAlarmYjzjService extends ServiceImpl { + + @Value("${videoInspection.url}") + private String videoInspectionUrl; @Transactional public void saveAll(List entities) { this.saveBatch(entities); } + + public List list(String infoId) { + List list = list(new LambdaUpdateWrapper().eq(DataAlarmYjzj::getAlarm_info_id, infoId)); + list.forEach(item -> { + item.setDzwjwz(videoInspectionUrl + item.getDzwjwz()); + }); + return list; + } } diff --git a/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java b/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java index aa12925..a17b085 100644 --- a/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java +++ b/src/main/java/com/biutag/supervision/service/DataCaseVerifService.java @@ -1,10 +1,12 @@ package com.biutag.supervision.service; +import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.common.UserContextHolder; import com.biutag.supervision.constants.enums.*; import com.biutag.supervision.mapper.DataCaseVerifMapper; import com.biutag.supervision.pojo.dto.DataCaseVerifDistribute; @@ -12,11 +14,14 @@ import com.biutag.supervision.pojo.dto.DataCaseVerifImportDto; import com.biutag.supervision.pojo.dto.NegativeDto; import com.biutag.supervision.pojo.entity.DataCaseVerif; import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeTask; +import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.pojo.param.DataCaseVerifQueryParam; import com.biutag.supervision.pojo.param.NegativeQueryParam; import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; import java.util.List; @@ -27,7 +32,8 @@ import java.util.Objects; public class DataCaseVerifService extends ServiceImpl { private final NegativeService negativeService; - private final DataCaseVerifMapper dataCaseVerifMapper; + + private final NegativeTaskService negativeTaskService; public Page page(DataCaseVerifQueryParam queryParam) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); @@ -39,6 +45,7 @@ public class DataCaseVerifService extends ServiceImpl list, String dataUpdateMethod) { LocalDateTime now = LocalDateTime.now(); int index = 0; @@ -55,6 +62,17 @@ public class DataCaseVerifService extends ServiceImpl pageExportVo(NegativeQueryParam queryParam) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StrUtil.isNotBlank(queryParam.getResponderKey()) && StrUtil.isNotBlank(queryParam.getResponderValue())) { + switch (queryParam.getResponderKey()) { + case "name": + queryWrapper.like("p.name", queryParam.getResponderValue()); + break; + case "phone": + queryWrapper.like("p.phone", queryParam.getResponderValue()); + break; + } + } + if (queryParam.getDiscoveryTime().size() == 2) { + queryWrapper.between("p.discover_Time", queryParam.getDiscoveryTime().get(0), queryParam.getDiscoveryTime().get(1)); + } + queryWrapper.like(StrUtil.isNotBlank(queryParam.getThingDesc()), "p.review_des", queryParam.getThingDesc()) + .eq("p.distributionState", DistributionStateEnum.DISTRIBUTED.getValue()) + .orderByDesc("n.crtTime"); + return baseMapper.queryPageExport(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); + } + /** * 下发 * @param distributeData @@ -98,12 +123,14 @@ public class DataPetition12337Service extends ServiceImpl page(DataPetitionComplaintQueryParam queryParam) { QueryWrapper queryWrapper = new QueryWrapper<>(); + if (StrUtil.isNotBlank(queryParam.getDepartId())) { + SupDepart depart = departService.getById(queryParam.getDepartId()); + if (DepartLevelEnum.SECOND.getValue().equals(depart.getLevel())) { + queryWrapper.eq("pc.second_Depart_Id", queryParam.getDepartId()); + } else if(DepartLevelEnum.THREE.getValue().equals(depart.getLevel())) { + queryWrapper.eq("pc.third_Depart_Id", queryParam.getDepartId()); + } + } queryWrapper.eq("pc.problem_sources_code", queryParam.getProblemSourcesCode()) .like(StrUtil.isNotBlank(queryParam.getOriginId()), "pc.origin_Id", queryParam.getOriginId()) .like(StrUtil.isNotBlank(queryParam.getThingDesc()), "pc.thing_desc", queryParam.getThingDesc()) - .eq(StrUtil.isNotBlank(queryParam.getDistributionState()), "pc.distributionState", queryParam.getDistributionState()) - .orderByDesc("pc.create_time"); + .eq(StrUtil.isNotBlank(queryParam.getDistributionState()), "pc.distribution_state", queryParam.getDistributionState()) + .eq(StrUtil.isNotBlank(queryParam.getInitialPetition()), "pc.initial_petition", queryParam.getInitialPetition()) + .orderByDesc("pc.discovery_time"); if (queryParam.getDiscoveryTime().size() == 2) { queryWrapper.between("pc.discovery_time", queryParam.getDiscoveryTime().get(0), queryParam.getDiscoveryTime().get(1)); } + if (queryParam.getCreateTime().size() == 2) { + queryWrapper.between("pc.create_time", queryParam.getCreateTime().get(0), queryParam.getCreateTime().get(1)); + } if (StrUtil.isNotBlank(queryParam.getResponderKey()) && StrUtil.isNotBlank(queryParam.getResponderValue())) { switch (queryParam.getResponderKey()) { case "name": @@ -121,7 +136,6 @@ public class DataPetitionComplaintService extends ServiceImpl { + + public List list(Date startTime, Date endTime) { + return baseMapper.selectList(startTime, endTime); + } + + public List listAll() { + return baseMapper.selectListAll(); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/FileService.java b/src/main/java/com/biutag/supervision/service/FileService.java index e2ffe0e..e3ffbef 100644 --- a/src/main/java/com/biutag/supervision/service/FileService.java +++ b/src/main/java/com/biutag/supervision/service/FileService.java @@ -27,7 +27,6 @@ public class FileService { } public String upload(InputStream is, long size, String fileExtName) { - StorePath storePath = fastFileStorageClient.uploadFile("group1", is, size, fileExtName); return "/" + storePath.getFullPath(); } diff --git a/src/main/java/com/biutag/supervision/service/MailService.java b/src/main/java/com/biutag/supervision/service/MailService.java new file mode 100644 index 0000000..c9cb9d0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/MailService.java @@ -0,0 +1,144 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson2.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.constants.enums.*; +import com.biutag.supervision.mapper.MailBlameMapper; +import com.biutag.supervision.mapper.MailMapper; +import com.biutag.supervision.pojo.entity.*; +import com.biutag.supervision.pojo.entity.mailbox.Mail; +import com.biutag.supervision.pojo.entity.mailbox.MailBlame; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * @author wxc + * @date 2025/3/26 + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class MailService extends ServiceImpl { + + private final MailBlameMapper mailBlameMapper; + + private final NegativeService negativeService; + + private final NegativeBlameService blameService; + + private final SupPoliceService supPoliceService; + + private final SupDictHandleResultMapingService dictHandleResultMapingService; + + private final SupDictProblemTypeMapingService dictProblemTypeMapingService; + + private final SupDictProblemTypeService problemTypeService; + + private final NegativeProblemRelationService negativeProblemRelationService; + + public void saveMailbox() { + List mailList = list(new LambdaUpdateWrapper().eq(Mail::getMailState, "completion") + .in(Mail::getVerifyIsTrue, List.of("属实", "基本属实"))); + if (mailList.isEmpty()) { + return; + } + List mailBlames = mailBlameMapper.selectList(new LambdaUpdateWrapper().in(MailBlame::getMailId, mailList.stream().map(Mail::getId).toList())); + for (Mail item : mailList) { + if (negativeService.exists(new LambdaQueryWrapper().eq(Negative::getOriginId, item.getId()))) { + continue; + } + try { + Negative negative = new Negative(); + negative.setId(IdUtil.getSnowflakeNextIdStr()); + negative.setOriginId(item.getId()); + negative.setDiscoveryTime(item.getCreateTime()); + negative.setResponderName(item.getContactName()); + negative.setContactPhone(item.getContactPhone()); + negative.setThingDesc(item.getContent()); + + negative.setProblemSources(ProblemSourcesEnum.JZXX.getLabel()); + negative.setProblemSourcesCode(ProblemSourcesEnum.JZXX.getValue()); + negative.setBusinessTypeCode(BusinessTypeEnum.QT.getValue()); + negative.setBusinessTypeName(BusinessTypeEnum.QT.getLabel()); + if ("属实".equals(item.getVerifyIsTrue())) { + negative.setCheckStatus(InspectCaseEnum.TRUE.getValue()); + negative.setCheckStatusName(InspectCaseEnum.TRUE.getLabel()); + } + if ("基本属实".equals(item.getVerifyIsTrue())) { + negative.setCheckStatus(InspectCaseEnum.PARTIALLY_TRUE.getValue()); + negative.setCheckStatusName(InspectCaseEnum.PARTIALLY_TRUE.getLabel()); + } + // 核办情况 + negative.setCheckStatusDesc(item.getVerifyDetails()); + negative.setProcessingStatus(ProcessingStatusEnum.completed.name()); + // 涉及个人 + negative.setAccountabilityTarget(AccountabilityTargetEnum.PERSONAL.getValue()); + negative.setCrtTime(LocalDateTime.now()); + negativeService.save(negative); + + // 被举报人 + List blames = mailBlames.stream().filter(mailBlame -> item.getId().equals(mailBlame.getMailId())).toList(); + for (MailBlame blame : blames) { + SupPolice police = supPoliceService.getOne(new LambdaQueryWrapper().eq(SupPolice::getName, blame.getBlameName()).eq(SupPolice::getEmpNo, blame.getBlameEmpNo())); + if (Objects.isNull(police)) { + log.error("没有该警员的数据! {}-{}", blame.getBlameName(), blame.getBlameEmpNo()); + continue; + } + NegativeBlame negativeBlame = new NegativeBlame(); + negativeBlame + .setBlameId(IdUtil.getSnowflakeNextIdStr()) + .setNegativeId(negative.getId()) + .setType("personal") + .setBlameEmpNo(police.getEmpNo()) + .setBlameIdCode(police.getIdCode()) + .setBlameName(police.getName()) + .setUpdTime(LocalDateTime.now()) + .setCrtTime(LocalDateTime.now()); + // 责任追究 + if (StrUtil.isNotBlank(blame.getVerifyPunish())) { + List externalNames = JSON.parseArray(blame.getVerifyPunish(), String.class); + List dictHandleResultMapings = dictHandleResultMapingService.list(externalNames); + negativeBlame.setHandleResultCode(dictHandleResultMapings.stream().map(SupDictHandleResultMaping::getInternalId).collect(Collectors.joining(","))); + negativeBlame.setHandleResultName(dictHandleResultMapings.stream().map(SupDictHandleResultMaping::getInternalName).collect(Collectors.joining("、"))); + } + // 查证属实问题 + if (StrUtil.isNotBlank(blame.getVerifyProblem())) { + List externalNames = JSON.parseArray(blame.getVerifyProblem(), String.class); + List problemTypeMapings = dictProblemTypeMapingService.list(externalNames); + for (SupDictProblemTypeMaping problemTypeMaping : problemTypeMapings) { + SupDictProblemType threeProblem = problemTypeService.getById(problemTypeMaping.getInternalId()); + SupDictProblemType twoProblem = problemTypeService.getById(threeProblem.getParentCode()); + SupDictProblemType oneProblem = problemTypeService.getById(twoProblem.getParentCode()); + NegativeProblemRelation problemRelation = new NegativeProblemRelation(); + problemRelation.setBlameId(negativeBlame.getBlameId()); + problemRelation.setNegativeId(negative.getId()); + problemRelation.setOneLevelCode(oneProblem.getId()); + problemRelation.setOneLevelContent(oneProblem.getName()); + problemRelation.setTwoLevelCode(twoProblem.getId()); + problemRelation.setTwoLevelContent(twoProblem.getName()); + problemRelation.setThreeLevelCode(threeProblem.getId()); + problemRelation.setThreeLevelContent(threeProblem.getName()); + negativeProblemRelationService.save(problemRelation); + } + } + blameService.save(negativeBlame); + } + } catch (RuntimeException e) { + log.error(e.getMessage(), e); + log.error(item.getContent()); + } + // [{"filepath":"250102/_B5HQNhI.doc","orgiinFilename":"3、定级报告 .doc","type":"application/msword","size":95744,"docxFilepath":"250102/l-Tl5dux.docx"}] + + } + } +} diff --git a/src/main/java/com/biutag/supervision/service/ModelClueService.java b/src/main/java/com/biutag/supervision/service/ModelClueService.java index c554e28..41fcb74 100644 --- a/src/main/java/com/biutag/supervision/service/ModelClueService.java +++ b/src/main/java/com/biutag/supervision/service/ModelClueService.java @@ -114,7 +114,8 @@ public class ModelClueService extends ServiceImpl { return list(new LambdaQueryWrapper().eq(ModelClue::getModelId, modelId).eq(ModelClue::getDistributionState, DistributionStateEnum.UNDISTRIBUTED.getValue())); } - public boolean distribution(ModelClueTaskDistribute taskDistribute) { + // 手动下发 + public boolean distributionByManuel(ModelClueTaskDistribute taskDistribute) { List modelClues = taskDistribute.getModelClues(); Model model = modelMapper.selectById(modelClues.get(0).getModelId()); model.setTimeLimit(taskDistribute.getTimeLimit()); @@ -125,6 +126,9 @@ public class ModelClueService extends ServiceImpl { model.setDistributionFlow(taskDistribute.getDistributionFlow()); if (StrUtil.isNotBlank(taskDistribute.getHandleDepartId())) { model.setHandleDepartId(taskDistribute.getHandleDepartId()); + model.setHandleDepartType(ModelHandleDepartTypeEnum.ZDDW.getValue()); + } else { + model.setHandleDepartType(ModelHandleDepartTypeEnum.SJDW.getValue()); } model.setBusinessTypeCode(taskDistribute.getBusinessTypeCode()); model.setPoliceType(taskDistribute.getPoliceType()); @@ -133,7 +137,7 @@ public class ModelClueService extends ServiceImpl { } - public boolean distribution(Integer modelId) { + public boolean distributionByAuto(Integer modelId) { List modelClues = listByUnDistributed(modelId); Model model = modelMapper.selectById(modelId); String taskName = "自动下发"; @@ -151,9 +155,9 @@ public class ModelClueService extends ServiceImpl { // 下发方式 modelClueTask.setDistributionMethod(model.getDistributionMethod()); modelClueTaskService.save(modelClueTask); - modelClues.forEach(item -> { + for (ModelClue item : modelClues) { if (Objects.isNull(item.getInvolveDepartId())) { - throw new RuntimeException("涉及单位不能为空..."); + throw new RuntimeException("预警涉及单位为空"); } NegativeDto negative = new NegativeDto(); // 问题来源 @@ -181,27 +185,34 @@ public class ModelClueService extends ServiceImpl { // 事情简要描述 negative.setThingDesc(item.getThingDesc()); // 主办层级 - negative.setHostLevel(HostLevelEnums.THREE.getValue()); + negative.setHostLevel(Objects.equals(model.getDistributionFlow(), DistributionFlowEnum.SECOND.getValue()) ? HostLevelEnums.SECOND.getValue() : HostLevelEnums.THREE.getValue()); negative.setThingFiles(thingFiles); // 办理单位 SupDepart depart; - if (Objects.isNull(model.getHandleDepartId())) { + // 涉及单位 + if (Objects.isNull(model.getHandleDepartId()) || ModelHandleDepartTypeEnum.SJDW.getValue().equals(model.getHandleDepartType())) { depart = departService.getById(item.getInvolveDepartId()); - } else { + if (Objects.isNull(depart)) { + throw new RuntimeException(String.format("单位[%s]为空", item.getInvolveDepartId())); + } + } + // 指定办理单位 + else { depart = departService.getById(model.getHandleDepartId()); + if (Objects.isNull(depart)) { + throw new RuntimeException(String.format("单位[%s]为空", model.getHandleDepartId())); + } } + if (depart.getLevel().equals(DepartLevelEnum.SECOND.getValue())) { negative.setDepartId(depart.getId()); - negative.setDepartName(depart.getShortName()); } if (depart.getLevel().equals(DepartLevelEnum.THREE.getValue()) && Objects.equals(model.getDistributionFlow(), DistributionFlowEnum.SECOND.getValue())) { SupDepart parentDepart = departService.getParentDepart(depart.getId()); negative.setDepartId(parentDepart.getId()); - negative.setDepartName(parentDepart.getShortName()); } if (depart.getLevel().equals(DepartLevelEnum.THREE.getValue()) && Objects.equals(model.getDistributionFlow(), DistributionFlowEnum.THIRD.getValue())) { negative.setDepartId(depart.getId()); - negative.setDepartName(depart.getShortName()); } negative.setTimeLimit(model.getTimeLimit()); negative.setMaxSignDuration(model.getMaxSignDuration()); @@ -217,8 +228,7 @@ public class ModelClueService extends ServiceImpl { item.setNegativeId(negative.getId()); item.setTaskId(modelClueTask.getId()); updateById(item); - }); - + } return true; } diff --git a/src/main/java/com/biutag/supervision/service/ModelService.java b/src/main/java/com/biutag/supervision/service/ModelService.java index 5f9b4ee..11149b2 100644 --- a/src/main/java/com/biutag/supervision/service/ModelService.java +++ b/src/main/java/com/biutag/supervision/service/ModelService.java @@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.biutag.supervision.common.UserContextHolder; import com.biutag.supervision.constants.enums.DistributionCycleEnum; import com.biutag.supervision.constants.enums.DistributionMethodEnum; +import com.biutag.supervision.constants.enums.ModelDataTypeEnum; +import com.biutag.supervision.constants.enums.ModelTypeEnum; import com.biutag.supervision.mapper.ModelMapper; import com.biutag.supervision.pojo.dto.ModelClueMappingData; import com.biutag.supervision.pojo.dto.ModelClueMappingItem; @@ -35,7 +37,10 @@ public class ModelService extends ServiceImpl { private final ModelGenerationService modelGenerationService; public List listByDistributionMethodOfNegative() { - return list(new LambdaQueryWrapper().eq(Model::getDistributionMethod, DistributionMethodEnum.NEGATIVE_DISTRIBUTE.getValue())); + return list(new LambdaQueryWrapper() + .eq(Model::getModelType, ModelTypeEnum.NBJD.getValue()) + .eq(Model::getModelDataType, ModelDataTypeEnum.YJWT.getValue()) + .eq(Model::getDistributionMethod, DistributionMethodEnum.NEGATIVE_DISTRIBUTE.getValue())); } @Transactional(rollbackFor = Exception.class) diff --git a/src/main/java/com/biutag/supervision/service/NegativeBlameService.java b/src/main/java/com/biutag/supervision/service/NegativeBlameService.java index 616dc23..b658677 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeBlameService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeBlameService.java @@ -4,14 +4,15 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.NegativeBlameMapper; import com.biutag.supervision.pojo.domain.Blame; import com.biutag.supervision.pojo.entity.NegativeBlame; -import com.biutag.supervision.mapper.NegativeBlameMapper; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; @RequiredArgsConstructor @@ -37,6 +38,10 @@ public class NegativeBlameService extends ServiceImpl listByNegativeIds(Collection negativeIds) { + return list(new LambdaQueryWrapper().eq(NegativeBlame::getNegativeId, negativeIds)); + } + public boolean remove(String negativeId) { return remove(new LambdaQueryWrapper().eq(NegativeBlame::getNegativeId, negativeId)); } diff --git a/src/main/java/com/biutag/supervision/service/NegativeBookService.java b/src/main/java/com/biutag/supervision/service/NegativeBookService.java index a34a66a..9095bbf 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeBookService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeBookService.java @@ -1,12 +1,16 @@ package com.biutag.supervision.service; +import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.constants.enums.DepartLevelEnum; +import com.biutag.supervision.constants.enums.ProblemSourcesEnum; import com.biutag.supervision.mapper.DataPetitionComplaintMapper; +import com.biutag.supervision.pojo.Result; import com.biutag.supervision.pojo.entity.DataPetitionComplaint; +import com.biutag.supervision.pojo.entity.Negative; import com.biutag.supervision.pojo.entity.NegativeBlame; import com.biutag.supervision.pojo.param.NegativeQueryParam; import com.biutag.supervision.pojo.vo.DataPetitionComplaintNegativeVo; @@ -17,6 +21,7 @@ import org.springframework.web.bind.annotation.PathVariable; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; /** @@ -30,6 +35,7 @@ public class NegativeBookService { private final SupDepartService departService; private final NegativeBlameService blameService; private final DataPetitionComplaintMapper dataPetitionComplaintMapper; + private final NegativeService negativeService; public Page pageByXf(@PathVariable String problemSourcesCode, NegativeQueryParam param) { QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -75,4 +81,75 @@ public class NegativeBookService { } return dataPetitionComplaintMapper.queryBooks(Page.of(param.getCurrent(), param.getSize()), queryWrapper); } + + public Page auditPage(NegativeQueryParam param) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + if (param.getHappenTime().size() == 2) { + queryWrapper.between(Negative::getHappenTime, param.getHappenTime().get(0), param.getHappenTime().get(1)); + } + if (param.getDiscoveryTime().size() == 2) { + queryWrapper.between(Negative::getDiscoveryTime, param.getDiscoveryTime().get(0), param.getDiscoveryTime().get(1)); + } + if (param.getCrtTime().size() == 2) { + queryWrapper.between(Negative::getCrtTime, param.getCrtTime().get(0), param.getCrtTime().get(1)); + } + queryWrapper.in(Negative::getProblemSourcesCode, List.of(ProblemSourcesEnum.ZFTZSJ.getValue(), ProblemSourcesEnum.ZFSACFSS.getValue(), ProblemSourcesEnum.JJZRSJ.getValue(), ProblemSourcesEnum.ZXSJ.getValue())) + .and(StrUtil.isNotBlank(param.getOriginId()), (qw) -> { + qw.like(Negative::getOriginId, param.getOriginId()).or().like(Negative::getId, param.getOriginId()); + }) + .in(CollectionUtil.isNotEmpty(param.getProblemSourcesCode()), Negative::getProblemSourcesCode, param.getProblemSourcesCode()) + .eq(StrUtil.isNotBlank(param.getBusinessTypeCode()), Negative::getBusinessTypeCode, param.getBusinessTypeCode()) + .like(StrUtil.isNotBlank(param.getThingDesc()), Negative::getThingDesc, param.getThingDesc()) + .in(!param.getProcessingStatus().isEmpty(), Negative::getProcessingStatus, param.getProcessingStatus()) + .like(StrUtil.isNotBlank(param.getCheckStatusDesc()), Negative::getCheckStatusDesc, param.getCheckStatusDesc()) + .orderByDesc(Negative::getDiscoveryTime) + .orderByAsc(Negative::getReportNumber); + // 涉及单位 + if (StrUtil.isNotBlank(param.getInvolveDepartId())) { + List departIds = departService.getAllNodeIds(param.getInvolveDepartId()); + queryWrapper.in(Negative::getInvolveDepartId, departIds); + } + // 办理单位 + if (StrUtil.isNotBlank(param.getHandleDepartId())) { + List nodes = departService.getAllNode(List.of(param.getHandleDepartId())); + List secondIds = nodes.stream().filter(node -> DepartLevelEnum.SECOND.getValue().equals(node.getLevel())).map(DepartTree::getId).toList(); + if (!secondIds.isEmpty()) { + queryWrapper.in(Negative::getHandleSecondDepartId, secondIds); + } else { + queryWrapper.in(Negative::getHandleThreeDepartId, nodes.stream().filter(node -> DepartLevelEnum.THREE.getValue().equals(node.getLevel())).map(DepartTree::getId).toList()); + } + } + if (StrUtil.isNotBlank(param.getBlameKey()) && StrUtil.isNotBlank(param.getBlameValue())) { + LambdaQueryWrapper qw = new LambdaQueryWrapper<>(); + switch (param.getResponderKey()) { + case "name": + qw.like(NegativeBlame::getBlameName, param.getBlameValue()); + break; + case "empNo": + qw.like(NegativeBlame::getBlameEmpNo, param.getBlameValue()); + break; + case "idCode": + qw.like(NegativeBlame::getBlameIdCode, param.getBlameValue()); + break; + } + List blames = blameService.list(qw); + if (blames.isEmpty()) { + return new Page().setTotal(0).setRecords(new ArrayList<>()); + } + queryWrapper.in(Negative::getId, blames.stream().map(NegativeBlame::getNegativeId).collect(Collectors.toSet())); + } + // 是否延期 + if (Objects.nonNull(param.getExtensionFlag())) { + if (param.getExtensionFlag()) { + queryWrapper.and(query -> { + query.eq(Negative::getExtensionApplyFlag, false).or().gt(Negative::getExtensionDays, 0); + }); + } else { + queryWrapper.and(query -> { + query.eq(Negative::getExtensionApplyFlag, true).or().isNull(Negative::getExtensionDays); + }); + } + } + return negativeService.page(Page.of(param.getCurrent(), param.getSize()), queryWrapper); + } } diff --git a/src/main/java/com/biutag/supervision/service/NegativeCountersignService.java b/src/main/java/com/biutag/supervision/service/NegativeCountersignService.java index 3ac9776..4a6dcfa 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeCountersignService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeCountersignService.java @@ -1,19 +1,143 @@ package com.biutag.supervision.service; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.enums.DepartLevelEnum; +import com.biutag.supervision.constants.enums.OrderEnum; +import com.biutag.supervision.constants.enums.ProcessingStatusEnum; +import com.biutag.supervision.constants.enums.RoleCodeEnum; +import com.biutag.supervision.pojo.entity.Negative; +import com.biutag.supervision.pojo.entity.NegativeBlame; import com.biutag.supervision.pojo.entity.NegativeCountersign; import com.biutag.supervision.mapper.NegativeCountersignMapper; +import com.biutag.supervision.pojo.model.UserAuth; +import com.biutag.supervision.pojo.param.NegativeQueryParam; +import com.biutag.supervision.pojo.vo.DepartTree; +import com.biutag.supervision.pojo.vo.NegativeQueryVo; +import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +@RequiredArgsConstructor @Service public class NegativeCountersignService extends ServiceImpl { + private final NegativeBlameService blameService; + + private final SupDepartService departService; + public List list(Integer countersignApplyId) { return list(new LambdaQueryWrapper().eq(NegativeCountersign::getCountersignApplyId, countersignApplyId) .orderByAsc(NegativeCountersign::getState)); } + public Page myCountersignPage(NegativeQueryParam param) { + UserAuth user = UserContextHolder.getCurrentUser(); + if (user.getAuthDepartIds().isEmpty()) { + return new Page().setRecords(new ArrayList<>()).setTotal(0); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.and(query -> { + query.in("c.depart_id", user.getAuthDepartIds()).or(q -> { + if (user.getRoleCodes().contains(RoleCodeEnum.FIRST_ADMIN.getCode())) { + q.in("a.create_role_code", user.getRoleCodes()); + } else { + q.in("a.create_role_code", user.getRoleCodes()).in("a.create_depart_id", user.getAuthDepartIds()); + } + + }); + }); + queryWrapper.and(StrUtil.isNotBlank(param.getOriginId()), (qw) -> { + qw.like("n.originId", param.getOriginId()).or().like("n.id", param.getOriginId()); + }) + .in(!param.getProcessingStatus().isEmpty(), "n.processing_Status", param.getProcessingStatus()) + .eq(StrUtil.isNotBlank(param.getFlowKey()), "n.flow_Key", param.getFlowKey()) + .like(StrUtil.isNotBlank(param.getThingDesc()), "n.thingDesc", param.getThingDesc()) + .in(CollectionUtil.isNotEmpty(param.getProblemSourcesCode()), "n.problemSourcesCode", param.getProblemSourcesCode()) + .eq(StrUtil.isNotBlank(param.getBusinessTypeCode()), "n.businessTypeCode", param.getBusinessTypeCode()) + .eq(StrUtil.isNotBlank(param.getCheckStatus()), "n.checkStatus", param.getCheckStatus()) + .eq(StrUtil.isNotBlank(param.getIsRectifyCode()), "n.isRectifyCode", param.getIsRectifyCode()) + .eq(StrUtil.isNotBlank(param.getSpecialSupervision()), "n.special_Supervision", param.getSpecialSupervision()) + .like(StrUtil.isNotBlank(param.getReportNumber()), "n.report_Number", param.getReportNumber()) + .like(StrUtil.isNotBlank(param.getCaseNumber()), "n.case_Number", param.getCaseNumber()) + .eq(Objects.nonNull(param.getCrtDepartLevel()), "n.crt_Depart_Level", param.getCrtDepartLevel()); + if (param.getHappenTime().size() == 2) { + queryWrapper.between("n.happenTime", param.getHappenTime().get(0), param.getHappenTime().get(1)); + } + if (param.getDiscoveryTime().size() == 2) { + queryWrapper.between("n.discoveryTime", param.getDiscoveryTime().get(0), param.getDiscoveryTime().get(1)); + } + if (param.getCrtTime().size() == 2) { + queryWrapper.between("n.crtTime", param.getCrtTime().get(0), param.getCrtTime().get(1)); + } + if (StrUtil.isNotBlank(param.getResponderKey()) && StrUtil.isNotBlank(param.getResponderValue())) { + switch (param.getResponderKey()) { + case "name": + queryWrapper.like("n.responderName", param.getResponderValue()); + break; + case "phone": + queryWrapper.like("n.contactPhone", param.getResponderValue()); + break; + } + } + if (StrUtil.isNotBlank(param.getBlameKey()) && StrUtil.isNotBlank(param.getBlameValue())) { + LambdaQueryWrapper qw = new LambdaQueryWrapper<>(); + switch (param.getResponderKey()) { + case "name": + qw.like(NegativeBlame::getBlameName, param.getBlameValue()); + break; + case "empNo": + qw.like(NegativeBlame::getBlameEmpNo, param.getBlameValue()); + break; + case "idCode": + qw.like(NegativeBlame::getBlameIdCode, param.getBlameValue()); + break; + } + List blames = blameService.list(qw); + if (blames.isEmpty()) { + return new Page().setTotal(0).setRecords(new ArrayList<>()); + } + queryWrapper.in("n.id", blames.stream().map(NegativeBlame::getNegativeId).collect(Collectors.toSet())); + } + // 涉及单位 + if (StrUtil.isNotBlank(param.getInvolveDepartId())) { + List departIds = departService.getAllNodeIds(param.getInvolveDepartId()); + queryWrapper.in("n.involveDepartId", departIds); + } + // 办理单位 + if (StrUtil.isNotBlank(param.getHandleDepartId())) { + List nodes = departService.getAllNode(List.of(param.getHandleDepartId())); + List secondIds = nodes.stream().filter(node -> DepartLevelEnum.SECOND.getValue().equals(node.getLevel())).map(DepartTree::getId).toList(); + if (!secondIds.isEmpty()) { + queryWrapper.in("n.handle_Second_Depart_Id", secondIds); + } else { + queryWrapper.in("n.handle_Three_Depart_Id", nodes.stream().filter(node -> DepartLevelEnum.THREE.getValue().equals(node.getLevel())).map(DepartTree::getId).toList()); + } + } + // 是否延期 + if (Objects.nonNull(param.getExtensionFlag())) { + if (param.getExtensionFlag()) { + queryWrapper.and(query -> { + query.eq("n.extension_Apply_Flag", false).or().gt("n.extension_Days", 0); + }); + } else { + queryWrapper.and(query -> { + query.eq("n.extension_Apply_Flag", true).or().isNull("n.extension_Days"); + }); + } + } + // 最后更新时间 + queryWrapper.orderByDesc("n.updTime"); + return baseMapper.queryNegativePage(Page.of(param.getCurrent(), param.getSize()), queryWrapper); + } + } diff --git a/src/main/java/com/biutag/supervision/service/NegativeExtensionApplyService.java b/src/main/java/com/biutag/supervision/service/NegativeExtensionApplyService.java index 4b6a943..dd08781 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeExtensionApplyService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeExtensionApplyService.java @@ -2,6 +2,7 @@ package com.biutag.supervision.service; import cn.hutool.core.bean.BeanUtil; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.constants.enums.ApprovalFlowEnum; import com.biutag.supervision.constants.enums.ApproveStateEnum; import com.biutag.supervision.mapper.NegativeExtensionApplyMapper; import com.biutag.supervision.pojo.domain.ExtensionApply; @@ -41,8 +42,16 @@ public class NegativeExtensionApplyService extends ServiceImpl { public List list(String negativeId) { - return baseMapper.selectList(negativeId); + return baseMapper.selectVoByNegativeId(negativeId); + } + + public List listByNegativeIds(Collection negativeIds) { + return list(new LambdaQueryWrapper().in(NegativeFile::getNegtiveId, negativeIds)); } public boolean remove(String negativeId) { diff --git a/src/main/java/com/biutag/supervision/service/NegativeQueryService.java b/src/main/java/com/biutag/supervision/service/NegativeQueryService.java index 9df60b8..bca40cd 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeQueryService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeQueryService.java @@ -50,20 +50,6 @@ public class NegativeQueryService { queryWrapper.in(Negative::getHandleThreeDepartId, user.getAuthDepartIds()); } } - queryWrapper.and(StrUtil.isNotBlank(param.getOriginId()), (qw) -> { - qw.like(Negative::getOriginId, param.getOriginId()).or().like(Negative::getId, param.getOriginId()); - }) - .in(!param.getProcessingStatus().isEmpty(), Negative::getProcessingStatus, param.getProcessingStatus()) - .eq(StrUtil.isNotBlank(param.getFlowKey()), Negative::getFlowKey, param.getFlowKey()) - .like(StrUtil.isNotBlank(param.getThingDesc()), Negative::getThingDesc, param.getThingDesc()) - .in(CollectionUtil.isNotEmpty(param.getProblemSourcesCode()), Negative::getProblemSourcesCode, param.getProblemSourcesCode()) - .eq(StrUtil.isNotBlank(param.getBusinessTypeCode()), Negative::getBusinessTypeCode, param.getBusinessTypeCode()) - .eq(StrUtil.isNotBlank(param.getCheckStatus()), Negative::getCheckStatus, param.getCheckStatus()) - .eq(StrUtil.isNotBlank(param.getIsRectifyCode()), Negative::getIsRectifyCode, param.getIsRectifyCode()) - .eq(StrUtil.isNotBlank(param.getSpecialSupervision()), Negative::getSpecialSupervision, param.getSpecialSupervision()) - .like(StrUtil.isNotBlank(param.getReportNumber()), Negative::getReportNumber, param.getReportNumber()) - .like(StrUtil.isNotBlank(param.getCaseNumber()), Negative::getCaseNumber, param.getCaseNumber()) - .eq(Objects.nonNull(param.getCrtDepartLevel()), Negative::getCrtDepartLevel, param.getCrtDepartLevel()); if (param.getHappenTime().size() == 2) { queryWrapper.between(Negative::getHappenTime, param.getHappenTime().get(0), param.getHappenTime().get(1)); } @@ -73,16 +59,44 @@ public class NegativeQueryService { if (param.getCrtTime().size() == 2) { queryWrapper.between(Negative::getCrtTime, param.getCrtTime().get(0), param.getCrtTime().get(1)); } - if (StrUtil.isNotBlank(param.getResponderKey()) && StrUtil.isNotBlank(param.getResponderValue())) { - switch (param.getResponderKey()) { - case "name": - queryWrapper.like(Negative::getResponderName, param.getResponderValue()); - break; - case "phone": - queryWrapper.like(Negative::getContactPhone, param.getResponderValue()); - break; + queryWrapper + // 问题编号 + .and(StrUtil.isNotBlank(param.getOriginId()), (qw) -> { + qw.like(Negative::getOriginId, param.getOriginId()).or().like(Negative::getId, param.getOriginId()); + }) + // 案件编号 + .like(StrUtil.isNotBlank(param.getCaseNumber()), Negative::getCaseNumber, param.getCaseNumber()) + // 内容 + .like(StrUtil.isNotBlank(param.getThingDesc()), Negative::getThingDesc, param.getThingDesc()) + // 问题来源 + .in(CollectionUtil.isNotEmpty(param.getProblemSourcesCode()), Negative::getProblemSourcesCode, param.getProblemSourcesCode()) + // 业务类型 + .eq(StrUtil.isNotBlank(param.getBusinessTypeCode()), Negative::getBusinessTypeCode, param.getBusinessTypeCode()) + // 专项督察 + .eq(StrUtil.isNotBlank(param.getSpecialSupervision()), Negative::getSpecialSupervision, param.getSpecialSupervision()) + // 通报期数 + .like(StrUtil.isNotBlank(param.getReportNumber()), Negative::getReportNumber, param.getReportNumber()) + // 是否属实 + .eq(StrUtil.isNotBlank(param.getCheckStatus()), Negative::getCheckStatus, param.getCheckStatus()) + // 是否整改 + .eq(StrUtil.isNotBlank(param.getIsRectifyCode()), Negative::getIsRectifyCode, param.getIsRectifyCode()); + // 涉及单位 + if (StrUtil.isNotBlank(param.getInvolveDepartId())) { + List departIds = departService.getAllNodeIds(param.getInvolveDepartId()); + queryWrapper.in(Negative::getInvolveDepartId, departIds); + } + // 办理单位 + if (StrUtil.isNotBlank(param.getHandleDepartId())) { + List nodes = departService.getAllNode(List.of(param.getHandleDepartId())); + List secondIds = nodes.stream().filter(node -> DepartLevelEnum.SECOND.getValue().equals(node.getLevel())).map(DepartTree::getId).toList(); + if (!secondIds.isEmpty()) { + queryWrapper.in(Negative::getHandleSecondDepartId, secondIds); + } else { + queryWrapper.in(Negative::getHandleThreeDepartId, nodes.stream().filter(node -> DepartLevelEnum.THREE.getValue().equals(node.getLevel())).map(DepartTree::getId).toList()); } } + + // 涉及人员 if (StrUtil.isNotBlank(param.getBlameKey()) && StrUtil.isNotBlank(param.getBlameValue())) { LambdaQueryWrapper qw = new LambdaQueryWrapper<>(); switch (param.getResponderKey()) { @@ -102,16 +116,26 @@ public class NegativeQueryService { } queryWrapper.in(Negative::getId, blames.stream().map(NegativeBlame::getNegativeId).collect(Collectors.toSet())); } - if (Objects.nonNull(param.getTimeoutFlag())) { - if (param.getTimeoutFlag()) { - queryWrapper.eq(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()).gt(Negative::getHandleTimeout, 0); - } else { - queryWrapper - .and(query -> { - query.ne(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()).or().gt(Negative::getHandleTimeout, 0); - }); + + queryWrapper + // 流程节点 + .eq(StrUtil.isNotBlank(param.getFlowKey()), Negative::getFlowKey, param.getFlowKey()) + // 办理状态 + .in(!param.getProcessingStatus().isEmpty(), Negative::getProcessingStatus, param.getProcessingStatus()) + // 下发单位层级 + .eq(Objects.nonNull(param.getCrtDepartLevel()), Negative::getCrtDepartLevel, param.getCrtDepartLevel()); + // 投诉反应人 + if (StrUtil.isNotBlank(param.getResponderKey()) && StrUtil.isNotBlank(param.getResponderValue())) { + switch (param.getResponderKey()) { + case "name": + queryWrapper.like(Negative::getResponderName, param.getResponderValue()); + break; + case "phone": + queryWrapper.like(Negative::getContactPhone, param.getResponderValue()); + break; } } + // 办理中是否超时 if (Objects.nonNull(param.getHandleTimeoutFlag())) { if (param.getHandleTimeoutFlag()) { queryWrapper.ne(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()).lt(Negative::getHandleRemainingTime, 0); @@ -119,19 +143,15 @@ public class NegativeQueryService { queryWrapper.ne(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()).ge(Negative::getHandleRemainingTime, 0); } } - // 涉及单位 - if (StrUtil.isNotBlank(param.getInvolveDepartId())) { - List departIds = departService.getAllNodeIds(param.getInvolveDepartId()); - queryWrapper.in(Negative::getInvolveDepartId, departIds); - } - // 办理单位 - if (StrUtil.isNotBlank(param.getHandleDepartId())) { - List nodes = departService.getAllNode(List.of(param.getHandleDepartId())); - List secondIds = nodes.stream().filter(node -> DepartLevelEnum.SECOND.getValue().equals(node.getLevel())).map(DepartTree::getId).toList(); - if (!secondIds.isEmpty()) { - queryWrapper.in(Negative::getHandleSecondDepartId, secondIds); + // 办结是否超时 + if (Objects.nonNull(param.getTimeoutFlag())) { + if (param.getTimeoutFlag()) { + queryWrapper.eq(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()).gt(Negative::getHandleTimeout, 0); } else { - queryWrapper.in(Negative::getHandleThreeDepartId, nodes.stream().filter(node -> DepartLevelEnum.THREE.getValue().equals(node.getLevel())).map(DepartTree::getId).toList()); + queryWrapper + .and(query -> { + query.ne(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()).or().gt(Negative::getHandleTimeout, 0); + }); } } // 是否延期 @@ -141,7 +161,9 @@ public class NegativeQueryService { query.eq(Negative::getExtensionApplyFlag, false).or().gt(Negative::getExtensionDays, 0); }); } else { - queryWrapper.eq(Negative::getExtensionApplyFlag, true).or().isNull(Negative::getExtensionDays); + queryWrapper.and(query -> { + query.eq(Negative::getExtensionApplyFlag, true).or().isNull(Negative::getExtensionDays); + }); } } // 排序 diff --git a/src/main/java/com/biutag/supervision/service/NegativeScoreService.java b/src/main/java/com/biutag/supervision/service/NegativeScoreService.java index 4848b2e..9741111 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeScoreService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeScoreService.java @@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.biutag.supervision.constants.enums.BusinessTypeEnum; import com.biutag.supervision.constants.enums.NegativeLevelEnum; import com.biutag.supervision.mapper.NegativeBlameMapper; -import com.biutag.supervision.mapper.SupDictContentMapper; +import com.biutag.supervision.mapper.SupDictProblemTypeMapper; import com.biutag.supervision.pojo.entity.*; import com.biutag.supervision.util.ScoreRule; import lombok.RequiredArgsConstructor; @@ -40,7 +40,7 @@ public class NegativeScoreService { private final NegativeProblemRelationService problemRelationService; - private final SupDictContentMapper supDictContentMapper; + private final SupDictProblemTypeMapper supDictContentMapper; private AtomicBoolean flag = new AtomicBoolean(false); diff --git a/src/main/java/com/biutag/supervision/service/NegativeService.java b/src/main/java/com/biutag/supervision/service/NegativeService.java index a49e443..05827f4 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeService.java @@ -35,10 +35,12 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.StringUtils; import java.time.LocalDateTime; -import java.util.*; +import java.util.Date; +import java.util.List; +import java.util.Objects; +import java.util.Optional; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -94,6 +96,9 @@ public class NegativeService extends ServiceImpl { if (StrUtil.isNotBlank(negative.getHandlePolices())) { vo.setHandlePolices(JSON.parseArray(negative.getHandlePolices(), VerifyData.HandlePolice.class)); } + if (StrUtil.isNotBlank(negative.getProblems())) { + vo.setProblems(JSON.parseArray(negative.getProblems(), VerifyData.Problem.class)); + } List blameList = blameService.list(id); vo.setBlames(blameList); if (!blameList.isEmpty()) { @@ -152,7 +157,7 @@ public class NegativeService extends ServiceImpl { // 判断当前是否 是认定办结环节 if (Objects.nonNull(workId)) { Boolean confirmationCompletionFlag = (ApprovalFlowEnum.SECOND_APPROVAL.getValue().equals(negative.getApprovalFlow()) && FlowNodeEnum.SECOND_APPROVE.getKey().equals(negative.getFlowKey())) - || (ApprovalFlowEnum.THREE_APPROVAL.getValue().equals(negative.getApprovalFlow()) && FlowNodeEnum.FIRST_APPROVE.getKey().equals(negative.getFlowKey())); + || FlowNodeEnum.FIRST_APPROVE.getKey().equals(negative.getFlowKey()); detail.setConfirmationCompletionFlag(confirmationCompletionFlag); } if (ProcessingStatusEnum.completed.name().equals(negative.getProcessingStatus())) { @@ -199,6 +204,9 @@ public class NegativeService extends ServiceImpl { if (CollectionUtil.isNotEmpty(negativeDto.getInvolveProblem())) { negative.setInvolveProblem(String.join(",", negativeDto.getInvolveProblem())); } + if (CollectionUtil.isNotEmpty(negativeDto.getProblems())) { + negative.setProblems(JSON.toJSONString(negativeDto.getProblems())); + } save(negative); // 添加一条 negative 数据 negativeDto.setId(negative.getId()); if (!negativeDto.getThingFiles().isEmpty()) { @@ -229,7 +237,7 @@ public class NegativeService extends ServiceImpl { .setProblemSourcesCode(negative.getProblemSourcesCode()) .setUpdateTime(now) .setCreateTime(now); - workService.save(work); // 添加一条 negative_work 数据 工作状态 + workService.save(work); // 添加一条 negative_work 数据 工作状态 FirstDistributeData firstDistributeData = new FirstDistributeData(); BeanUtil.copyProperties(negativeDto, firstDistributeData); @@ -248,15 +256,20 @@ public class NegativeService extends ServiceImpl { @Transactional(rollbackFor = Exception.class) public boolean saveByJwpy(List list) { LocalDateTime now = LocalDateTime.now(); - list.forEach(item -> { + for (NegativeApiDto item : list) { if (exists(item.getOriginId())) { throw new RuntimeException("样本源头编号已存在请核实"); } + String businessTypeCode = NegativeApiDto.BusinessType.getCode(item.getBusinessTypeName()); +// if (!NegativeApiDto.BusinessType.JCJ_110.getCode().equals(businessTypeCode) && !NegativeApiDto.BusinessType.JCJ_122.getCode().equals(businessTypeCode)) { +// // 只针对110、122数据进行下发 +// continue; +// } SupDepart dept = departService.getByJwpyCode(item.getDepartCode()); Negative negative = new Negative(); BeanUtil.copyProperties(item, negative); negative - .setBusinessTypeCode(NegativeApiDto.BusinessType.getCode(item.getBusinessTypeName())) + .setBusinessTypeCode(businessTypeCode) .setPoliceType(NegativeApiDto.BusinessType.getPoliceType(item.getBusinessTypeName())) .setPoliceTypeName(NegativeApiDto.BusinessType.getPoliceTypeName(item.getBusinessTypeName())) // 导入的数据都是警务调查 @@ -276,22 +289,25 @@ public class NegativeService extends ServiceImpl { .setUpdTime(now); negative.setInvolveProblem(InvolveProblemEnum.ZDHFBMY.getValue()); - + negative.setFlowKey(FlowNodeEnum.FIRST_DISTRIBUTE.getKey()) + .setCurrentProcessingObject("市局专班"); if (Objects.nonNull(dept)) { negative.setInvolveDepartId(dept.getId()) - .setInvolveDepartName(dept.getShortName()) - .setFlowKey(FlowNodeEnum.THREE_SIGN.getKey()) - .setCurrentProcessingObject(String.format("%s专班", dept.getShortName())); + .setInvolveDepartName(dept.getShortName()); if (DepartLevelEnum.THREE.getValue().equals(dept.getLevel())) { SupDepart parentDepart = departService.getById(dept.getPid()); negative.setHandleThreeDepartId(dept.getId()) .setHandleThreeDepartName(dept.getShortName()) .setHandleSecondDepartId(parentDepart.getId()) - .setHandleSecondDepartName(parentDepart.getShortName()); + .setHandleSecondDepartName(parentDepart.getShortName()) + .setFlowKey(FlowNodeEnum.THREE_SIGN.getKey()) + .setCurrentProcessingObject(String.format("%s专班", dept.getShortName())); + } else if (DepartLevelEnum.SECOND.getValue().equals(dept.getLevel())) { + negative.setHandleSecondDepartId(dept.getId()) + .setHandleSecondDepartName(dept.getShortName()) + .setFlowKey(FlowNodeEnum.SECOND_SIGN.getKey()) + .setCurrentProcessingObject(String.format("%s专班", dept.getShortName())); } - } else { - negative.setFlowKey(FlowNodeEnum.FIRST_DISTRIBUTE.getKey()) - .setCurrentProcessingObject("市局专班"); } save(negative); // 新增work @@ -309,7 +325,6 @@ public class NegativeService extends ServiceImpl { } else if (DepartLevelEnum.THREE.getValue().equals(dept.getLevel())) { negative.setThreeInvolveDepartId(dept.getId()); negative.setSecondInvolveDepartId(dept.getPid()); - } } else { log.error("未匹配上单位:{}, code: {}", item.getDepartName(), item.getDepartCode()); @@ -317,6 +332,18 @@ public class NegativeService extends ServiceImpl { departName = AppConstants.ROOT_DEPART_NAME; roleCode = RoleCodeEnum.FIRST_ADMIN.getCode(); } + // 创建待办 + NegativeWork firstWork = new NegativeWork() + .setNegativeId(negative.getId()) + .setStatus(WorkStatusEnum.done.name()) + .setDepartId(AppConstants.ROOT_DEPART_ID) + .setDepartName(AppConstants.ROOT_DEPART_NAME) + .setRoleCode(RoleCodeEnum.FIRST_ADMIN.getCode()) + .setProblemSourcesCode(negative.getProblemSourcesCode()) + .setUpdateTime(now) + .setCreateTime(now); + workService.save(firstWork); + NegativeWork work = new NegativeWork() .setNegativeId(negative.getId()) .setDepartId(departId) @@ -327,7 +354,7 @@ public class NegativeService extends ServiceImpl { .setUpdateTime(now) .setCreateTime(now); workService.save(work); - }); + } return true; } diff --git a/src/main/java/com/biutag/supervision/service/NegativeTaskService.java b/src/main/java/com/biutag/supervision/service/NegativeTaskService.java index 3dd2293..a8f78e6 100644 --- a/src/main/java/com/biutag/supervision/service/NegativeTaskService.java +++ b/src/main/java/com/biutag/supervision/service/NegativeTaskService.java @@ -2,7 +2,6 @@ package com.biutag.supervision.service; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.ExcelWriter; @@ -44,28 +43,23 @@ import java.util.stream.Collectors; @Service public class NegativeTaskService extends ServiceImpl { + static { + System.setProperty("java.awt.headless", "true"); + } + private final FileService fileService; private final SupDepartService departService; private final NegativeService negativeService; - public Page page(NegativeTaskQueryParam param) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() - .eq(NegativeTask::getCategory, NegativeTaskCategoryEnum.EXPORT.getValue()) - .eq(StrUtil.isNotBlank(param.getSource()), NegativeTask::getSource, param.getSource()) - .like(StrUtil.isNotBlank(param.getTaskName()), NegativeTask::getTaskName, param.getTaskName()) - .orderByDesc(NegativeTask::getCrtTime); - if (param.getCrtTime().size() == 2) { - queryWrapper.between(NegativeTask::getCrtTime, param.getCrtTime().get(0), param.getCrtTime().get(1)); - } - return page(Page.of(param.getCurrent(), param.getSize()), queryWrapper); - } - public Page pageByImport(NegativeTaskQueryParam param) { + public Page page(NegativeTaskQueryParam param) { LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() - .eq(NegativeTask::getCategory, NegativeTaskCategoryEnum.IMPORT.getValue()) + .eq(NegativeTask::getCrtUsername, UserContextHolder.getCurrentUser().getUserName()) + .eq(NegativeTask::getCategory, param.getCategory()) + .eq(StrUtil.isNotBlank(param.getSource()), NegativeTask::getSource, param.getSource()) .like(StrUtil.isNotBlank(param.getTaskName()), NegativeTask::getTaskName, param.getTaskName()) .orderByDesc(NegativeTask::getCrtTime); if (param.getCrtTime().size() == 2) { @@ -82,7 +76,9 @@ public class NegativeTaskService extends ServiceImpl suspectProblem.stream().filter(problem -> val.equals(problem.getDictValue())).findFirst().map(SupDictData::getDictLabel).orElse("")) + .filter(StrUtil::isNotBlank) .collect(Collectors.joining("、")); vo.setInvolveProblem(involveProblem); } vo.setProcessingStatus(ProcessingStatusEnum.getLabel(item.getProcessingStatus())); // 问题类型 - String problemTypeList = negativeProblemRelations.stream().filter(problem -> item.getId().equals(problem.getNegativeId())).map(problem -> { + String problemTypeList = negativeProblemRelations.stream().filter(problem -> item.getId().equals(problem.getNegativeId()) && StrUtil.isNotBlank(problem.getOneLevelContent())).map(problem -> { if ("其他".equals(problem.getThreeLevelContent())) { return String.format("%s / %s / %s(%s)", problem.getOneLevelContent(), problem.getTwoLevelContent(), problem.getTwoLevelContent(), problem.getThreeLevelContentOther()); } @@ -138,19 +135,23 @@ public class NegativeTaskService extends ServiceImpl StrUtil.isNotBlank(blame.getBlameName())).toList()) { ExportNegativeBlameVo blameVo = new ExportNegativeBlameVo(); BeanUtils.copyProperties(vo, blameVo); BeanUtils.copyProperties(negativeBlame, blameVo); // 问题类型 - String problemType = negativeProblemRelations.stream().filter(problem -> negativeBlame.getBlameId().equals(problem.getBlameId()) && item.getId().equals(problem.getNegativeId())).map(problem -> { + String problemType = negativeProblemRelations.stream().filter(problem -> negativeBlame.getBlameId().equals(problem.getBlameId()) && item.getId().equals(problem.getNegativeId()) + && StrUtil.isNotBlank(problem.getOneLevelContent()) + ).map(problem -> { if ("其他".equals(problem.getThreeLevelContent())) { return String.format("%s / %s / %s(%s)", problem.getOneLevelContent(), problem.getTwoLevelContent(), problem.getTwoLevelContent(), problem.getThreeLevelContentOther()); } return String.format("%s / %s / %s", problem.getOneLevelContent(), problem.getTwoLevelContent(), problem.getTwoLevelContent()); }).collect(Collectors.joining("、")); blameVo.setProblemType(problemType); + // 人员属性 + blameVo.setIvPersonType(PersonTypeEnum.getLabel(negativeBlame.getIvPersonTypeCode())); blameVoList.add(blameVo); } return vo; @@ -210,6 +211,7 @@ public class NegativeTaskService extends ServiceImpl { NegativeDto negativeDto = new NegativeDto(); @@ -219,15 +221,12 @@ public class NegativeTaskService extends ServiceImpl { - - - public List getWorkDynamics(Date beginTime, Date endTime, String source, String departId) { + public List getWorkDynamics(Date beginTime, Date endTime, String source, String departId) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.select("source", "work_type", "release_time", "content_txt"); queryWrapper.eq("source", source); if ( departId != null && !departId.isEmpty() ) { queryWrapper.eq("depart_id", departId); @@ -25,14 +21,7 @@ public class NewsService extends ServiceImpl { queryWrapper.between("release_time", beginTime, endTime); queryWrapper.orderByDesc("release_time"); queryWrapper.last("limit 10"); - List newsList = this.list(queryWrapper); - List newsVos = newsList.stream().map(news -> new NewsVo( - news.getSource(), - news.getWorkType(), - news.getReleaseTime(), - news.getContentTxt() - )).toList(); - return newsVos; + return list(queryWrapper); } diff --git a/src/main/java/com/biutag/supervision/service/RpcApplyApproveService.java b/src/main/java/com/biutag/supervision/service/RpcApplyApproveService.java index 043d19a..abf4bf5 100644 --- a/src/main/java/com/biutag/supervision/service/RpcApplyApproveService.java +++ b/src/main/java/com/biutag/supervision/service/RpcApplyApproveService.java @@ -1,24 +1,44 @@ package com.biutag.supervision.service; -import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.biutag.supervision.pojo.entity.RpcApplyApprove; import com.biutag.supervision.mapper.RpcApplyApproveMapper; +import com.biutag.supervision.pojo.entity.RpcApply; +import com.biutag.supervision.pojo.entity.RpcApplyApprove; +import com.biutag.supervision.pojo.vo.RpcApplyApproveVo; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; -import java.util.ArrayList; import java.util.List; +import java.util.Objects; @Service public class RpcApplyApproveService extends ServiceImpl { - public List list(String rpcId) { - List list = list(new LambdaQueryWrapper().eq(RpcApplyApprove::getRpcId, rpcId).orderByDesc(RpcApplyApprove::getCreateTime)); - List result = new ArrayList<>(); - list.stream().filter(item -> 2 == item.getStep()).findFirst().ifPresent(result::add); - list.stream().filter(item -> 3 == item.getStep()).findFirst().ifPresent(result::add); - return result; + public List list(RpcApply rpcApply) { + RpcApplyApproveVo approveVo1 = new RpcApplyApproveVo(); + approveVo1.setActionName("申请抚慰"); + approveVo1.setReturnFlag(false); + approveVo1.setHandleName(rpcApply.getDepartName() + " " + rpcApply.getApplicantEmpName()); + approveVo1.setCreateTime(rpcApply.getCrtTime()); + List list = list(new LambdaQueryWrapper().eq(RpcApplyApprove::getRpcId, rpcApply.getRpcId()).orderByDesc(RpcApplyApprove::getCreateTime)); + RpcApplyApproveVo approveVo2 = new RpcApplyApproveVo(); + approveVo2.setActionName("待审批"); + approveVo2.setHandleName("二级机构维权专干"); + list.stream().filter(item -> 2 == item.getStep()).findFirst().ifPresent(item -> { + BeanUtils.copyProperties(item, approveVo2); + approveVo2.setActionName(item.getReturnFlag() ? "已退回" : "已审批"); + approveVo2.setCommentLabel(item.getReturnFlag() ? "退回意见" : "审批意见"); + }); + RpcApplyApproveVo approveVo3 = new RpcApplyApproveVo(); + approveVo3.setActionName("待审批"); + approveVo3.setHandleName("市局维权专干"); + list.stream().filter(item -> 3 == item.getStep()).findFirst().ifPresent(item -> { + BeanUtils.copyProperties(item, approveVo3); + approveVo3.setActionName(item.getReturnFlag() ? "已退回" : "已审批"); + approveVo3.setCommentLabel(item.getReturnFlag() ? "退回意见" : "审批意见"); + }); + return List.of(approveVo1, approveVo2, approveVo3); } } diff --git a/src/main/java/com/biutag/supervision/service/RpcApplyService.java b/src/main/java/com/biutag/supervision/service/RpcApplyService.java index 5f88f66..0ae10d6 100644 --- a/src/main/java/com/biutag/supervision/service/RpcApplyService.java +++ b/src/main/java/com/biutag/supervision/service/RpcApplyService.java @@ -1,27 +1,69 @@ package com.biutag.supervision.service; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.biutag.supervision.constants.enums.RpcApplyTypeEnum; +import com.biutag.supervision.common.UserContextHolder; +import com.biutag.supervision.constants.AppConstants; +import com.biutag.supervision.constants.enums.*; import com.biutag.supervision.mapper.RpcApplyMapper; -import com.biutag.supervision.pojo.entity.RpcApply; +import com.biutag.supervision.pojo.dto.RpcApplyDto; +import com.biutag.supervision.pojo.entity.*; +import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.pojo.param.RpcApplyQueryParam; +import com.biutag.supervision.pojo.vo.NegativeQueryVo; import com.biutag.supervision.pojo.vo.RpcApplyVo; +import com.biutag.supervision.util.JSON; import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestBody; + +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; @RequiredArgsConstructor @Service public class RpcApplyService extends ServiceImpl { + private final RpcRightPersonService rpcRightPersonService; + + private final RpcPersonService rpcPersonService; + + private final RpcApplyPersonService rpcApplyPersonService; + + private final RpcApplyWorkService rpcApplyWorkService; + + private final SupDepartService departService; + public Page page(RpcApplyQueryParam queryParam, String type) { + UserAuth user = UserContextHolder.getCurrentUser(); QueryWrapper queryWrapper = new QueryWrapper<>(); + if (!AppConstants.USER_TYPE_SUPER.equals(user.getUserType())) { + List rightPeoples = rpcRightPersonService.list(user.getUserName()); + if (rightPeoples.isEmpty()) { + return new Page().setTotal(0).setRecords(new ArrayList<>()); + } + // 是否是市局维权专干 + if (rightPeoples.stream().noneMatch(item -> "1".equals(item.getCouncil()))) { + queryWrapper.in("a.handle_depart_id", rightPeoples.stream().map(RpcRightPerson::getDepartId).collect(Collectors.toSet())); + } + } queryWrapper.like(StrUtil.isNotBlank(queryParam.getApplicantEmpName()), "a.applicant_emp_name", queryParam.getApplicantEmpName()) .eq(StrUtil.isNotBlank(queryParam.getDepartId()), "a.depart_id", queryParam.getDepartId()) .eq("a.type", type) + .eq(StrUtil.isNotBlank(queryParam.getRpcStatus()), "a.rpc_status", queryParam.getRpcStatus()) .orderByDesc("a.crt_time"); if (queryParam.getApplyDate() != null && queryParam.getApplyDate().size() == 2) { queryWrapper.between("a.apply_date", queryParam.getApplyDate().get(0), queryParam.getApplyDate().get(1)); @@ -36,4 +78,79 @@ public class RpcApplyService extends ServiceImpl { return NumberUtil.nullToZero(baseMapper.selectMaxNuberIndex(year)) + 1; } + public boolean updateRpcStatus(String rpcId, String rpcStatus) { + return update(new LambdaUpdateWrapper().eq(RpcApply::getRpcId, rpcId).set(RpcApply::getRpcStatus, rpcStatus).set(RpcApply::getUptTime, LocalDateTime.now())); + } + + @Transactional(rollbackFor = Exception.class) + public boolean save(@RequestBody RpcApplyDto applyDto) { + RpcApply rpcApply = new RpcApply(); + BeanUtils.copyProperties(applyDto, rpcApply); + rpcApply.setRpcId(IdUtil.fastSimpleUUID()); + rpcApply.setCrtTime(LocalDateTime.now()); + rpcApply.setUptTime(LocalDateTime.now()); + // 警号 + rpcApply.setApplicantEmpNo(applyDto.getEmpNo()); + rpcApply.setType(RpcApplyTypeEnum.COMFORT.getValue()); + rpcApply.setDepartName(departService.getById(applyDto.getDepartId()).getShortName()); + // 申请日期 + rpcApply.setApplyDate(applyDto.getApplyDate().toInstant().atZone(ZoneId.systemDefault()) + .toLocalDate()); + int year = DateUtil.year(applyDto.getApplyDate()); + rpcApply.setNumberIndex(getNewNumberIndex(year)); + rpcApply.setYear(year); + rpcApply.setNumber(String.format("长公抚申〔%s〕%s号", year, String.format("%03d", rpcApply.getNumberIndex()))); + if (CollectionUtil.isNotEmpty(applyDto.getDocumentFile())) { + rpcApply.setDocumentFile(JSON.toJSONString(applyDto.getDocumentFile())); + } + rpcApply.setRpcStatus(ComfortStatus.approval.name()); + rpcApply.setStep(2); + save(rpcApply); + // 已办 + RpcApplyWork done = new RpcApplyWork(); + done.setRpcId(rpcApply.getRpcId()); + done.setStatus(WorkStatusEnum.done.name()); + done.setHandleIdCode(UserContextHolder.getCurrentUser().getUserName()); + done.setCreateTime(LocalDateTime.now()); + done.setStep(1); + rpcApplyWorkService.save(done); + + // 待办 + RpcApplyWork todo = new RpcApplyWork(); + todo.setRpcId(rpcApply.getRpcId()); + todo.setStatus(WorkStatusEnum.todo.name()); + + SupDepart depart = departService.getById(applyDto.getHandleDepartId()); + if (DepartLevelEnum.SECOND.getValue().equals(depart.getLevel())) { + todo.setHandleDepartId(depart.getId()); + } else if (DepartLevelEnum.THREE.getValue().equals(depart.getLevel())) { + todo.setHandleDepartId(depart.getPid()); + } + todo.setStep(2); + todo.setCreateTime(LocalDateTime.now()); + + rpcApplyWorkService.save(todo); + + RpcApplyPerson rpcApplyPerson = new RpcApplyPerson(); + BeanUtils.copyProperties(applyDto, rpcApplyPerson); + rpcApplyPerson.setRpcId(rpcApply.getRpcId()); + rpcApplyPerson.setCreatTime(LocalDateTime.now()); + rpcApplyPerson.setUdpTime(LocalDateTime.now()); + rpcApplyPerson.setType(RpcApplyTypeEnum.COMFORT.getValue()); + rpcApplyPersonService.save(rpcApplyPerson); + + RpcPerson rpcPerson = new RpcPerson(); + BeanUtils.copyProperties(applyDto, rpcPerson); + rpcPerson.setRpcId(rpcApply.getRpcId()); + rpcPersonService.save(rpcPerson); + return true; + } + + @Transactional(rollbackFor = Exception.class) + public boolean remove(String rpcId) { + rpcPersonService.remove(new LambdaQueryWrapper().eq(RpcPerson::getRpcId, rpcId)); + rpcApplyPersonService.remove(new LambdaQueryWrapper().eq(RpcApplyPerson::getRpcId, rpcId)); + rpcApplyWorkService.remove(new LambdaQueryWrapper().eq(RpcApplyWork::getRpcId, rpcId)); + return removeById(rpcId); + } } diff --git a/src/main/java/com/biutag/supervision/service/RpcApplyWorkService.java b/src/main/java/com/biutag/supervision/service/RpcApplyWorkService.java index f67acd9..7fbf04c 100644 --- a/src/main/java/com/biutag/supervision/service/RpcApplyWorkService.java +++ b/src/main/java/com/biutag/supervision/service/RpcApplyWorkService.java @@ -30,18 +30,20 @@ public class RpcApplyWorkService extends ServiceImpl pageTodo(RpcApplyQueryParam queryParam) { UserAuth user = UserContextHolder.getCurrentUser(); - List rightPeoples = rpcRightPersonService.list(new LambdaUpdateWrapper().eq(RpcRightPerson::getIdCode, user.getUserName())); - if (rightPeoples.isEmpty()) { - return new Page().setTotal(0).setRecords(new ArrayList<>()); - } + List rightPeoples = rpcRightPersonService.list(user.getUserName()); QueryWrapper queryWrapper = new QueryWrapper<>(); - - if (rightPeoples.stream().anyMatch(item -> "1".equals(item.getCouncil()))) { + if (rightPeoples.isEmpty()) { queryWrapper - .eq("w.council", true); + .eq("w.handle_id_code", user.getUserName()); } else { - queryWrapper - .in("w.handle_depart_id", rightPeoples.stream().map(RpcRightPerson::getDepartId).collect(Collectors.toSet())); + if (rightPeoples.stream().anyMatch(item -> "1".equals(item.getCouncil()))) { + queryWrapper + .eq("w.council", true); + } else { + queryWrapper + .in("w.handle_depart_id", rightPeoples.stream().map(RpcRightPerson::getDepartId).collect(Collectors.toSet())); + + } } queryWrapper .eq("w.status", WorkStatusEnum.todo.name()) diff --git a/src/main/java/com/biutag/supervision/service/RpcComfortPacksService.java b/src/main/java/com/biutag/supervision/service/RpcComfortPacksService.java new file mode 100644 index 0000000..efe8762 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/RpcComfortPacksService.java @@ -0,0 +1,158 @@ +package com.biutag.supervision.service; + +import cn.hutool.core.convert.NumberChineseFormatter; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.io.IoUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.NumberUtil; +import cn.hutool.core.util.ZipUtil; +import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.constants.enums.ComfortStatus; +import com.biutag.supervision.mapper.RpcComfortPacksMapper; +import com.biutag.supervision.pojo.dto.ComfortPacksDto; +import com.biutag.supervision.pojo.entity.RpcComfortPacks; +import com.biutag.supervision.pojo.entity.RpcRightPerson; +import com.biutag.supervision.pojo.vo.RpcApplyVo; +import com.biutag.supervision.pojo.vo.RpcComfortPacksVo; +import com.biutag.supervision.util.Arrays; +import freemarker.template.Configuration; +import freemarker.template.Template; +import freemarker.template.TemplateException; +import freemarker.template.Version; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.time.LocalDateTime; +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class RpcComfortPacksService extends ServiceImpl { + + private final RpcApplyService rpcApplyService; + + private final RpcPacksComfortService rpcPacksComfortService; + + private final RpcRightPersonService rpcRightPersonService; + + private final FileService fileService; + + private final Template template1; + + private final Template template2; + + private final Template template3; + + private final Template template4; + + private final Template template5; + + public RpcComfortPacksService(RpcApplyService rpcApplyService, RpcPacksComfortService rpcPacksComfortService, RpcRightPersonService rpcRightPersonService, FileService fileService) throws IOException { + this.rpcApplyService = rpcApplyService; + this.rpcPacksComfortService = rpcPacksComfortService; + this.rpcRightPersonService = rpcRightPersonService; + this.fileService = fileService; + // + Configuration configuration = new Configuration(new Version("2.3.28")); + configuration.setDefaultEncoding("UTF-8"); + + // 设置FreeMarker生成Word文档所需要的模板的路径 + configuration.setClassLoaderForTemplateLoading(RpcComfortPacksService.class.getClassLoader(), ""); + this.template1 = configuration.getTemplate("static/templates/ftl/1、抚慰金审批签呈.xml", "UTF-8"); + this.template2 = configuration.getTemplate("static/templates/ftl/2、维权抚慰登记表.xml", "UTF-8"); + this.template3 = configuration.getTemplate("static/templates/ftl/3、抚慰金申报批处理表.xml", "UTF-8"); + this.template4 = configuration.getTemplate("static/templates/ftl/4、抚慰金申请发放明细表.xml", "UTF-8"); + this.template5 = configuration.getTemplate("static/templates/ftl/5、民警维权抚慰申请表.xml", "UTF-8"); + } + + + public RpcComfortPacksVo get(String id) { + RpcComfortPacksVo rpcComfortPacksVo = new RpcComfortPacksVo(); + RpcComfortPacks rpcComfortPacks = getById(id); + BeanUtils.copyProperties(rpcComfortPacks, rpcComfortPacksVo); + rpcComfortPacksVo.setComforts(rpcPacksComfortService.list(id)); + return rpcComfortPacksVo; + } + + @Transactional(rollbackFor = Exception.class) + public boolean save(ComfortPacksDto comfortPacksDto) throws TemplateException, IOException { + RpcComfortPacks rpcComfortPacks = new RpcComfortPacks(); + rpcComfortPacks.setId(IdUtil.getSnowflakeNextIdStr()); + rpcComfortPacks.setReportTitle(comfortPacksDto.getReportTitle()); + rpcComfortPacks.setReportTime(LocalDateTime.now()); + rpcComfortPacks.setReportNum(comfortPacksDto.getComforts().size()); + // 金额 + rpcComfortPacks.setReportMoney(comfortPacksDto.getComforts().stream().mapToDouble(item -> NumberUtil.nullToZero(Double.parseDouble(item.getInjurySeverity()))).sum()); + List rpcIds = comfortPacksDto.getComforts().stream().map(RpcApplyVo::getRpcId).toList(); + rpcIds.forEach(rpcId -> { + rpcApplyService.updateRpcStatus(rpcId, ComfortStatus.completed.name()); + }); + save(rpcComfortPacks); + rpcPacksComfortService.saveBatch(rpcComfortPacks.getId(), rpcIds); + // 生成呈报文件 + genReports(rpcComfortPacks, comfortPacksDto.getComforts()); + return true; + } + + + public void genReports(RpcComfortPacks rpcComfortPacks, List comforts) throws TemplateException, IOException { + comforts.forEach(item -> { + item.setSexName(item.getSex() == 0 ? "男" : item.getSex() == 1 ?"女" : ""); + }); + String rightsPersons = rpcRightPersonService.listByCouncil().stream().map(RpcRightPerson::getEmpName).collect(Collectors.joining(" ")); + // 1、抚慰金审批签呈 + JSONObject data1 = new JSONObject() + .fluentPut("monthDate", DateUtil.format(new Date(), "yyyy年MM月")) + .fluentPut("policeName", comforts.get(0).getApplicantEmpName()) + .fluentPut("reportNum", rpcComfortPacks.getReportNum()) + .fluentPut("reportMoney", rpcComfortPacks.getReportMoney()) + .fluentPut("reportMoneyChinese", NumberChineseFormatter.format(rpcComfortPacks.getReportMoney(), true)) + .fluentPut("rightsPersons", rightsPersons) + .fluentPut("date", DateUtil.format(new Date(), "yyyy年MM月dd日")); + ByteArrayOutputStream os1 = new ByteArrayOutputStream(); + template1.process(data1, new BufferedWriter(new OutputStreamWriter(os1, StandardCharsets.UTF_8))); + + // 2、维权抚慰登记表 + JSONObject data2 = new JSONObject() + .fluentPut("rpcApplys", comforts); + ByteArrayOutputStream os2 = new ByteArrayOutputStream(); + template2.process(data2, new BufferedWriter(new OutputStreamWriter(os2, StandardCharsets.UTF_8))); + + // 3、抚慰金申报批处理表 + JSONObject data3 = new JSONObject() + .fluentPut("rpcApplys", comforts) + .fluentPut("reportMoney", rpcComfortPacks.getReportMoney()) + .fluentPut("reportMoneyChinese", NumberChineseFormatter.format(rpcComfortPacks.getReportMoney(), true)); + ByteArrayOutputStream os3 = new ByteArrayOutputStream(); + template3.process(data3, new BufferedWriter(new OutputStreamWriter(os3, StandardCharsets.UTF_8))); + + // 4、抚慰金申请发放明细表.xml + JSONObject data4 = new JSONObject() + .fluentPut("rpcApplys", comforts) + .fluentPut("reportMoney", rpcComfortPacks.getReportMoney()); + ByteArrayOutputStream os4 = new ByteArrayOutputStream(); + template4.process(data4, new BufferedWriter(new OutputStreamWriter(os4, StandardCharsets.UTF_8))); + + // 5、民警维权抚慰申请表.xml + JSONObject data5 = new JSONObject() + .fluentPut("rpcApplys", comforts); + ByteArrayOutputStream os5 = new ByteArrayOutputStream(); + template5.process(data5, new BufferedWriter(new OutputStreamWriter(os5, StandardCharsets.UTF_8))); + + ByteArrayOutputStream zipOs = new ByteArrayOutputStream(); + ZipUtil.zip(zipOs, Arrays.array("1、抚慰金审批签呈.doc", "2、维权抚慰登记表.doc", "3、抚慰金申报批处理表.doc", "4、抚慰金申请发放明细表.doc", "5、民警维权抚慰申请表.doc"), + Arrays.array(IoUtil.toStream(os1), IoUtil.toStream(os2), IoUtil.toStream(os3), IoUtil.toStream(os4), IoUtil.toStream(os5))); + // 上传 + ByteArrayInputStream zipIs = IoUtil.toStream(zipOs); + String filepath = fileService.upload(zipIs, zipIs.available(), "zip"); + update(new LambdaUpdateWrapper().eq(RpcComfortPacks::getId, rpcComfortPacks.getId()).set(RpcComfortPacks::getReportZip, filepath)); + + } + +} diff --git a/src/main/java/com/biutag/supervision/service/RpcPacksComfortService.java b/src/main/java/com/biutag/supervision/service/RpcPacksComfortService.java new file mode 100644 index 0000000..f8eb425 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/RpcPacksComfortService.java @@ -0,0 +1,35 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.RpcPacksComfortMapper; +import com.biutag.supervision.pojo.entity.RpcApply; +import com.biutag.supervision.pojo.entity.RpcPacksComfort; +import com.biutag.supervision.pojo.vo.RpcApplyVo; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + +@RequiredArgsConstructor +@Service +public class RpcPacksComfortService extends ServiceImpl { + + private final RpcApplyService rpcApplyService; + + public boolean saveBatch(String packsId, List rpcIds) { + List list = rpcIds.stream().map(rpcId -> { + RpcPacksComfort rpcPacksComfort = new RpcPacksComfort(); + rpcPacksComfort.setPacksId(packsId); + rpcPacksComfort.setRpcId(rpcId); + return rpcPacksComfort; + }).toList(); + return saveBatch(list); + } + + public List list(String packsId) { + List list = list(new LambdaQueryWrapper().eq(RpcPacksComfort::getPacksId, packsId)); + return rpcApplyService.listByIds(list.stream().map(RpcPacksComfort::getRpcId).toList()); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/RpcRightPersonService.java b/src/main/java/com/biutag/supervision/service/RpcRightPersonService.java index a7a436d..5f107a9 100644 --- a/src/main/java/com/biutag/supervision/service/RpcRightPersonService.java +++ b/src/main/java/com/biutag/supervision/service/RpcRightPersonService.java @@ -1,11 +1,23 @@ package com.biutag.supervision.service; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.biutag.supervision.pojo.entity.RpcRightPerson; import com.biutag.supervision.mapper.RpcRightPersonMapper; import org.springframework.stereotype.Service; +import java.util.List; + @Service public class RpcRightPersonService extends ServiceImpl { + public List list(String idCode) { + return list(new LambdaUpdateWrapper().eq(RpcRightPerson::getIdCode, idCode)); + } + + // 市局维权专干 + public List listByCouncil() { + return list(new LambdaUpdateWrapper().eq(RpcRightPerson::getCouncil, true)); + } + } diff --git a/src/main/java/com/biutag/supervision/service/SupDictHandleResultMapingService.java b/src/main/java/com/biutag/supervision/service/SupDictHandleResultMapingService.java new file mode 100644 index 0000000..74361a0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupDictHandleResultMapingService.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.SupDictHandleResultMaping; +import com.biutag.supervision.mapper.SupDictHandleResultMapingMapper; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class SupDictHandleResultMapingService extends ServiceImpl { + + public List list(List externalNames) { + return list(new LambdaQueryWrapper().in(SupDictHandleResultMaping::getExternalName, externalNames)); + } + +} diff --git a/src/main/java/com/biutag/supervision/service/SupDictProblemTypeMapingService.java b/src/main/java/com/biutag/supervision/service/SupDictProblemTypeMapingService.java index cf0e581..dfda26c 100644 --- a/src/main/java/com/biutag/supervision/service/SupDictProblemTypeMapingService.java +++ b/src/main/java/com/biutag/supervision/service/SupDictProblemTypeMapingService.java @@ -1,11 +1,19 @@ package com.biutag.supervision.service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.SupDictHandleResultMaping; import com.biutag.supervision.pojo.entity.SupDictProblemTypeMaping; import com.biutag.supervision.mapper.SupDictProblemTypeMapingMapper; import org.springframework.stereotype.Service; +import java.util.List; + @Service public class SupDictProblemTypeMapingService extends ServiceImpl { + public List list(List externalNames) { + return list(new LambdaQueryWrapper().in(SupDictProblemTypeMaping::getExternalName, externalNames)); + } + } diff --git a/src/main/java/com/biutag/supervision/service/SupDictContentService.java b/src/main/java/com/biutag/supervision/service/SupDictProblemTypeService.java similarity index 91% rename from src/main/java/com/biutag/supervision/service/SupDictContentService.java rename to src/main/java/com/biutag/supervision/service/SupDictProblemTypeService.java index 634ea9d..19c0cf9 100644 --- a/src/main/java/com/biutag/supervision/service/SupDictContentService.java +++ b/src/main/java/com/biutag/supervision/service/SupDictProblemTypeService.java @@ -3,7 +3,7 @@ package com.biutag.supervision.service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.biutag.supervision.constants.AppConstants; -import com.biutag.supervision.mapper.SupDictContentMapper; +import com.biutag.supervision.mapper.SupDictProblemTypeMapper; import com.biutag.supervision.pojo.entity.SupDictProblemType; import com.biutag.supervision.pojo.vo.DictContentTree; import org.springframework.beans.BeanUtils; @@ -12,7 +12,7 @@ import org.springframework.stereotype.Service; import java.util.*; @Service -public class SupDictContentService extends ServiceImpl { +public class SupDictProblemTypeService extends ServiceImpl { public List list() { return list(new LambdaQueryWrapper().orderByAsc(SupDictProblemType::getSort)); diff --git a/src/main/java/com/biutag/supervision/service/UserLoginService.java b/src/main/java/com/biutag/supervision/service/UserLoginService.java index 73e0b9d..190fd97 100644 --- a/src/main/java/com/biutag/supervision/service/UserLoginService.java +++ b/src/main/java/com/biutag/supervision/service/UserLoginService.java @@ -49,7 +49,8 @@ public class UserLoginService { public UserAuth buildUserAuth(String account) { BaseUser user = userService.getByUserName(account); - SupDepart depart = Optional.ofNullable(policeService.getByIdCode(account)) + SupPolice police = policeService.getByIdCode(account); + SupDepart depart = Optional.ofNullable(police) .map(item -> departService.getById(item.getOrgId())).orElse(null); List roles = roleService.listByUserId(user.getUserId()); List departAuthorities = negDepartAuthorityService.list(user.getUserName()); @@ -59,6 +60,8 @@ public class UserLoginService { .setUserName(user.getUserName()) .setUserType(user.getUserType()) .setNickName(user.getNickName()) + .setEmpNo(Optional.ofNullable(police).map(SupPolice::getEmpNo).orElse(null)) + .setMobile(Optional.ofNullable(police).map(SupPolice::getMobile).orElse(null)) .setDepartId(Optional.ofNullable(depart).map(SupDepart::getId).orElse(null)) .setDepartName(Optional.ofNullable(depart).map(SupDepart::getShortName).orElse(null)) .setRoleCodes(roles.stream().map(BaseRole::getRoleCode).toList()) diff --git a/src/main/java/com/biutag/supervision/service/VideoConfigService.java b/src/main/java/com/biutag/supervision/service/VideoConfigService.java new file mode 100644 index 0000000..3403209 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/VideoConfigService.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.pojo.entity.VideoConfig; +import com.biutag.supervision.mapper.VideoConfigMapper; +import org.springframework.stereotype.Service; + +@Service +public class VideoConfigService extends ServiceImpl { + +} diff --git a/src/main/java/com/biutag/supervision/service/WvpDeviceChannelService.java b/src/main/java/com/biutag/supervision/service/WvpDeviceChannelService.java index 58b2d27..77d18ee 100644 --- a/src/main/java/com/biutag/supervision/service/WvpDeviceChannelService.java +++ b/src/main/java/com/biutag/supervision/service/WvpDeviceChannelService.java @@ -30,7 +30,7 @@ public class WvpDeviceChannelService extends ServiceImpl> { + @Override + public List convert(Object value, List defaultValue) throws IllegalArgumentException { + return null; + } +} diff --git a/src/main/java/com/biutag/supervision/support/ModelClueDistributionAware.java b/src/main/java/com/biutag/supervision/support/ModelClueDistributionAware.java index 719eb16..00139cb 100644 --- a/src/main/java/com/biutag/supervision/support/ModelClueDistributionAware.java +++ b/src/main/java/com/biutag/supervision/support/ModelClueDistributionAware.java @@ -59,7 +59,7 @@ public class ModelClueDistributionAware { Runnable task = () -> { log.info("开始执行任务-------------------------------------------"); // 线索下发 - modelClueService.distribution(model.getId()); + modelClueService.distributionByAuto(model.getId()); }; log.info("expression : {}", expression); ScheduledTask scheduledTask = taskRegistrar.scheduleTriggerTask(new CronTask(task, expression)); diff --git a/src/main/java/com/biutag/supervision/util/Arrays.java b/src/main/java/com/biutag/supervision/util/Arrays.java new file mode 100644 index 0000000..9c72f05 --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/Arrays.java @@ -0,0 +1,12 @@ +package com.biutag.supervision.util; + +/** + * @author wxc + * @date 2025/3/14 + */ +public class Arrays { + + public static T[] array(T... values) { + return values; + } +} diff --git a/src/main/java/com/biutag/supervision/util/ImgUtil.java b/src/main/java/com/biutag/supervision/util/ImgUtil.java new file mode 100644 index 0000000..c5f639e --- /dev/null +++ b/src/main/java/com/biutag/supervision/util/ImgUtil.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.util; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.StrUtil; + +import java.util.List; + +/** + * @author wxc + * @date 2025/3/27 + */ +public class ImgUtil { + + public final static List IMG_TYPES = List.of("jpg", "jpeg", "png", "gif", "ico", "svg", "webp"); + + public static boolean isImg(String fileName) { + if (StrUtil.isBlank(fileName)) { + return false; + } + return IMG_TYPES.contains(FileUtil.extName(fileName).toLowerCase()); + } + +} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 5ea6b3d..42ef8d3 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -90,5 +90,7 @@ springdoc: - '/**' videoInspection: url: http://65.47.26.33:8090/ + video-img-url: http://65.47.6.105:18080/ + video-ws: ws://65.47.6.105:80/ mailbox: - url: http://65.47.60.145/api/ \ No newline at end of file + url: http://65.47.60.145/api/ diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index 75ff540..5b41125 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -18,6 +18,12 @@ spring: url: jdbc:postgresql://58.51.152.18:10642/mailbox?currentSchema=mailbox username: alphay password: alphay@123 + wvp: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://172.31.217.20:31868/wvp2?serverTimezone=GMT%2B8 + username: root + password: ip12341234 data: redis: host: 127.0.0.1 @@ -42,4 +48,6 @@ springdoc: - '/login' videoInspection: - url: \ No newline at end of file + url: + video-img-url: http://65.47.6.105:18080/ + video-ws: ws://65.47.6.105:80/ \ No newline at end of file diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 7071024..5bf33ba 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -82,5 +82,8 @@ negative: v1-user-url: http://65.47.6.108:8765/admin/current/user videoInspection: url: http://65.47.26.33:8090/ + video-img-url: http://65.47.6.105:18080/ + video-ws: ws://65.47.6.105:80/ + mailbox: - url: http://65.47.60.145/api/ \ No newline at end of file + url: http://65.47.60.145/api/ diff --git a/src/main/resources/mapper/DataPetition12337Mapper.xml b/src/main/resources/mapper/DataPetition12337Mapper.xml index b347f45..f48a0cd 100644 --- a/src/main/resources/mapper/DataPetition12337Mapper.xml +++ b/src/main/resources/mapper/DataPetition12337Mapper.xml @@ -165,4 +165,12 @@ GROUP BY m.monthName ORDER BY m.month ASC; + + diff --git a/src/main/resources/mapper/NegativeCointersignMapper.xml b/src/main/resources/mapper/NegativeCointersignMapper.xml new file mode 100644 index 0000000..8d275fe --- /dev/null +++ b/src/main/resources/mapper/NegativeCointersignMapper.xml @@ -0,0 +1,18 @@ + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/RpcApplyMapper.xml b/src/main/resources/mapper/RpcApplyMapper.xml index d59d061..513face 100644 --- a/src/main/resources/mapper/RpcApplyMapper.xml +++ b/src/main/resources/mapper/RpcApplyMapper.xml @@ -6,12 +6,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - \ No newline at end of file diff --git a/src/main/resources/mapper/SupDictContentMapper.xml b/src/main/resources/mapper/SupDictContentMapper.xml index 561c4dc..5b3c984 100644 --- a/src/main/resources/mapper/SupDictContentMapper.xml +++ b/src/main/resources/mapper/SupDictContentMapper.xml @@ -2,7 +2,7 @@ - +