diff --git a/jero-boot/db/蔚来标准sql/dev_2nd_period.sql b/jero-boot/db/蔚来标准sql/dev_2nd_period.sql index ac06098eb..83bcbfc1f 100644 --- a/jero-boot/db/蔚来标准sql/dev_2nd_period.sql +++ b/jero-boot/db/蔚来标准sql/dev_2nd_period.sql @@ -507,102 +507,116 @@ INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `descrip INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `en_name`) VALUES ('1524311354002771970', '1524311122804346881', '实验通过', 'Test passed', '实验通过', 3, 1, 'admin', '2022-05-11 16:52:02', NULL, NULL, NULL, NULL, NULL, '0', 'Test passed'); --- 初始化生产环境,设计符合性流程状态为空的数据 处理成 清单待发布 2023-4-10 未同步生产环境 -UPDATE `project_laws_inventory` -SET `design_flow_status` = 'List to be released' -WHERE - `id` IN ( SELECT temp.id FROM ( SELECT id FROM project_laws_inventory WHERE design_flow_status IS NULL ) temp ); +# -- 初始化生产环境,设计符合性流程状态为空的数据 处理成 清单待发布 2023-4-10 未同步生产环境 +# UPDATE `project_laws_inventory` +# SET `design_flow_status` = 'List to be released' +# WHERE +# `id` IN ( SELECT temp.id FROM ( SELECT id FROM project_laws_inventory WHERE design_flow_status IS NULL ) temp ); +# +# +# -- 初始化生产环境,验证符合性流程状态为空的数据 处理成 清单待发布 2023-4-10 未同步生产环境 +# UPDATE `project_laws_inventory` +# SET `verify_flow_status` = 'List to be released' +# WHERE +# `id` IN (SELECT temp.id FROM (SELECT id FROM project_laws_inventory WHERE verify_flow_status IS NULL ) temp); +# +# +# -- *********************************************** 法规相关历史数据处理sql ********************************************************* +# -- 以下sql需要按照顺序执行,否则会出问题。 2023-04-11 未同步生产环境 +# -- 处理 法规清单确认 待确认状态的数据sql +# UPDATE `project_laws_inventory` SET +# `design_flow_status` = 'List to be checked', +# `verify_flow_status` = 'List to be checked' +# where id in ( +# SELECT temp.id FROM ( +# SELECT +# id +# FROM +# project_laws_inventory +# WHERE inventory_affirm_status = 'List to confirm' +# ) temp +# ); +# +# +# -- 处理待办中心-流程历史,之前的符合性流程数据sql。 +# -- 1.将之前符合性流程的 发起人审核节点, 处理结果为 符合、不涉及的数据,更新为通过(现在法规工程师审核的时候 处理结果是通过) +# update process_history set +# operator_result = 'Adopt' +# where id in ( +# SELECT temp.id FROM ( +# select +# id +# from +# process_history +# where task_definition_key = 'fqrsh' and operator_result in ('Compliance','NA') +# ) temp +# ); +# +# -- 2.将之前符合性流程的 发起人审核节点,修改为 法规工程师审核节点 +# update process_history set +# task_definition_key = 'fggcssh' +# where id in ( +# SELECT temp.id FROM ( +# select +# id +# from +# process_history +# where task_definition_key = 'fqrsh' +# ) temp +# ); +# +# -- 3.将之前符合性流程的 责任人处理任务 节点,修改为 符合性确认节点 +# update process_history set +# task_definition_key = 'zrrtjjfw' +# where id in ( +# SELECT temp.id FROM ( +# select +# id +# from +# process_history +# where task_definition_key = 'zrrclrw' +# ) temp +# ); +# +# -- 处理待办中心-流程节点明细,之前的符合性流程节点任务节点keysql +# -- 1.将之前符合性流程的 发起人审核节点,修改为 法规工程师审核节点 +# update process_info_detail set +# task_definition_key = 'fggcssh' +# where id in ( +# SELECT temp.id FROM ( +# select +# id +# from +# process_info_detail +# where task_definition_key = 'fqrsh' and `status` = 'haveDone' +# ) temp +# ); +# -- 2.将之前符合性流程的 责任人处理任务 节点,修改为 符合性确认节点 +# update process_info_detail set +# task_definition_key = 'zrrtjjfw' +# where id in ( +# SELECT temp.id FROM ( +# select +# id +# from +# process_info_detail +# where task_definition_key = 'zrrclrw' and `status` = 'haveDone' +# ) temp +# ); --- 初始化生产环境,验证符合性流程状态为空的数据 处理成 清单待发布 2023-4-10 未同步生产环境 -UPDATE `project_laws_inventory` -SET `verify_flow_status` = 'List to be released' -WHERE - `id` IN (SELECT temp.id FROM (SELECT id FROM project_laws_inventory WHERE verify_flow_status IS NULL ) temp); - - --- *********************************************** 法规相关历史数据处理sql ********************************************************* --- 以下sql需要按照顺序执行,否则会出问题。 2023-04-11 未同步生产环境 --- 处理 法规清单确认 待确认状态的数据sql -UPDATE `project_laws_inventory` SET - `design_flow_status` = 'List to be checked', - `verify_flow_status` = 'List to be checked' -where id in ( - SELECT temp.id FROM ( - SELECT - id - FROM - project_laws_inventory - WHERE inventory_affirm_status = 'List to confirm' - ) temp -); - - --- 处理待办中心-流程历史,之前的符合性流程数据sql。 --- 1.将之前符合性流程的 发起人审核节点, 处理结果为 符合、不涉及的数据,更新为通过(现在法规工程师审核的时候 处理结果是通过) -update process_history set - operator_result = 'Adopt' -where id in ( - SELECT temp.id FROM ( - select - id - from - process_history - where task_definition_key = 'fqrsh' and operator_result in ('Compliance','NA') - ) temp -); - --- 2.将之前符合性流程的 发起人审核节点,修改为 法规工程师审核节点 -update process_history set - task_definition_key = 'fggcssh' -where id in ( - SELECT temp.id FROM ( - select - id - from - process_history - where task_definition_key = 'fqrsh' - ) temp -); - --- 3.将之前符合性流程的 责任人处理任务 节点,修改为 符合性确认节点 -update process_history set - task_definition_key = 'zrrtjjfw' -where id in ( - SELECT temp.id FROM ( - select - id - from - process_history - where task_definition_key = 'zrrclrw' - ) temp -); - --- 处理待办中心-流程节点明细,之前的符合性流程节点任务节点keysql --- 1.将之前符合性流程的 发起人审核节点,修改为 法规工程师审核节点 -update process_info_detail set - task_definition_key = 'fggcssh' -where id in ( - SELECT temp.id FROM ( - select - id - from - process_info_detail - where task_definition_key = 'fqrsh' and `status` = 'haveDone' - ) temp -); --- 2.将之前符合性流程的 责任人处理任务 节点,修改为 符合性确认节点 -update process_info_detail set - task_definition_key = 'zrrtjjfw' -where id in ( - SELECT temp.id FROM ( - select - id - from - process_info_detail - where task_definition_key = 'zrrclrw' and `status` = 'haveDone' - ) temp -); - +-- 认证清单,增加字段 2023-04-17 未同步生产环境 +ALTER TABLE `project_certification_inventory` + ADD COLUMN `inventory_verify_end_time` datetime(0) NULL COMMENT '清单校核截止时间' AFTER `project_library_id`, + ADD COLUMN `task_confirm_end_time` datetime(0) NULL COMMENT '责任确认截止时间' AFTER `inventory_verify_end_time`; +-- 认证清单,增加字段 2023-04-17 未同步生产环境 +ALTER TABLE `project_certification_inventory` + ADD COLUMN `attestation_type` varchar(2000) NULL COMMENT '认证类型' AFTER `task_confirm_end_time`; +-- 数据字典 增加 认证清单-认证类别 2023-04-17 未同步生产环境 +INSERT INTO `sys_dict`(`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `type`, `dict_en_name`, `is_tag_dict`, `is_read_only`, `attribute_type`, `order_num`) VALUES ('1646032917672861697', '认证清单-认证类型', 'ren4_zheng4_qing1_dan1_-_ren4_zheng4_lei4_xing2', NULL, 0, 'admin', '2023-04-12 14:10:04', NULL, NULL, NULL, NULL, 1, 0, '1', 1); +INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `en_name`) VALUES ('1646033124468826113', '1646032917672861697', '公告', '12d45870339f47d59b95f0e9baabe404', NULL, 1, 1, 'admin', '2023-04-12 14:10:53', NULL, NULL, 1, NULL, NULL, '0', 'Announcement'); +INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `en_name`) VALUES ('1646033156706246657', '1646032917672861697', 'CCC', '6c7c21ec0dd24cdd87e10c4c40208a78', NULL, 2, 1, 'admin', '2023-04-12 14:11:01', NULL, NULL, 1, NULL, NULL, '0', 'CCC'); +INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `en_name`) VALUES ('1646033251040337922', '1646032917672861697', '地标', 'dfbc363b6e2d4d9c97664aeb6731767e', NULL, 3, 1, 'admin', '2023-04-12 14:11:24', NULL, NULL, 1, NULL, NULL, '0', 'Landmark'); +INSERT INTO `sys_dict_item`(`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `en_name`) VALUES ('1646033351942709250', '1646032917672861697', '其他', '17a3731e5a374d8ba3909cca2464a8eb', NULL, 4, 1, 'admin', '2023-04-12 14:11:48', NULL, NULL, 1, NULL, NULL, '0', 'Other'); diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysDictController.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysDictController.java index c0c478ecc..9e744b85d 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysDictController.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/SysDictController.java @@ -188,7 +188,7 @@ public class SysDictController { } // 将结果集进行排序 - if (CollectionUtils.isNotEmpty(ls)) { + /*if (CollectionUtils.isNotEmpty(ls)) { // 匿名比较器排序 Collections.sort(ls, new Comparator() { @Override @@ -196,7 +196,7 @@ public class SysDictController { return p1.getText().compareTo(p2.getText()); } }); - } + }*/ result.setSuccess(true); result.setResult(ls); @@ -790,4 +790,67 @@ public class SysDictController { } + /** + * 获取责任领域字典数据 + * @param dictCode 字典code + * @param dictCode 表名,文本字段,code字段 | 举例:sys_user,realname,id + * @return + */ + @ApiOperation(value = "字典控制器-获取责任领域字典数据", notes = "字典控制器-获取责任领域字典数据") + @RequestMapping(value = "/getDutyTerritoryDictItems/{dictCode}", method = RequestMethod.GET) + public Result> getDutyTerritoryDictItems(@PathVariable String dictCode, @RequestParam(value = "sign",required = false) String sign, HttpServletRequest request) { + log.info(" dictCode : "+ dictCode); + Result> result = new Result>(); + List ls = null; + try { + if(dictCode.indexOf(",")!=-1) { + //关联表字典(举例:sys_user,realname,id) + String[] params = dictCode.split(","); + + if(params.length<3) { + result.error500("字典Code格式不正确!"); + return result; + } + //SQL注入校验(只限制非法串改数据库) + final String[] sqlInjCheck = {params[0],params[1],params[2]}; + SqlInjectionUtil.filterContent(sqlInjCheck); + + if(params.length==4) { + //SQL注入校验(查询条件SQL 特殊check,此方法仅供此处使用) + SqlInjectionUtil.specialFilterContent(params[3]); + ls = sysDictService.queryTableDictItemsByCodeAndFilter(params[0],params[1],params[2],params[3]); + }else if (params.length==3) { + ls = sysDictService.queryTableDictItemsByCode(params[0],params[1],params[2]); + }else{ + result.error500("字典Code格式不正确!"); + return result; + } + }else { + //字典表 + ls = sysDictService.queryDictItemsByCode(dictCode); + } + + // 将结果集进行排序 + if (CollectionUtils.isNotEmpty(ls)) { + // 匿名比较器排序 + Collections.sort(ls, new Comparator() { + @Override + public int compare(DictModel p1, DictModel p2) { + return p1.getText().compareTo(p2.getText()); + } + }); + } + + result.setSuccess(true); + result.setResult(ls); + log.debug(result.toString()); + } catch (Exception e) { + log.error(e.getMessage(),e); + result.error500("操作失败"); + return result; + } + + return result; + } + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLawsInventoryEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLawsInventoryEOController.java index 5b9ab0880..44c2312ef 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLawsInventoryEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectLawsInventoryEOController.java @@ -272,9 +272,10 @@ public class ProjectLawsInventoryEOController extends JeroController copyInfoByIds(@RequestParam(name="ids",required=true) String ids, - @RequestParam(name="cut",required=true) String cut) { + @RequestParam(name="cut",required=true) String cut, + @RequestParam(name="operateType",required=true) String operateType) { try { - projectLawsInventoryEOService.copyInfoByIds(ids); + projectLawsInventoryEOService.copyInfoByIds(ids,operateType); } catch (Exception e) { if(CutEnum.CN.getValue().equals(cut)){ return Result.error("复制失败"); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java index e31fbc852..e17baecfb 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java @@ -230,4 +230,25 @@ public class ProjectCertificationInventoryEO implements Serializable { //排序字段 @TableField(exist = false) private String orderByField; + + /**清单校核截止时间*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "清单校核截止时间") + private Date inventoryVerifyEndTime; + + /**责任确认截止时间*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern="yyyy-MM-dd") + @ApiModelProperty(value = "责任确认截止时间") + private Date taskConfirmEndTime; + + /**认证类型*/ + @ApiModelProperty(value = "认证类型") + private String attestationType; + + /**认证类型名称**/ + @Excel(name = "认证类型", width = 20) + @TableField(exist = false) + private String attestationTypeName; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEOEn.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEOEn.java index f4a653976..2e46eece5 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEOEn.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEOEn.java @@ -218,4 +218,10 @@ public class ProjectCertificationInventoryEOEn implements Serializable { // @Excel(name = "截止日期", width = 20, format = "yyyy-MM-dd") @TableField(exist = false) private String endTimeStr; + + /**认证类型*/ + @Excel(name = "Certification Type", width = 20) + @ApiModelProperty(value = "认证类型") + @TableField(exist = false) + private String attestationTypeName; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationFlowNodeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationFlowNodeEnum.java index 9925ad9f6..34609c13c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationFlowNodeEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/CertificationFlowNodeEnum.java @@ -17,6 +17,18 @@ public enum CertificationFlowNodeEnum { RZGCSSC ("rzgcssc","认证工程师审查","Certified engineer review"), RZGCSSC_TG ("rzgcssc_tg","认证工程师审查-通过","Certified engineer review through"), RZGCSSC_TH ("rzgcssc_th","认证工程师审查-退回","Certified engineer review returned"), + + /** + * 待办中心,展示任务节点key + * 清单校核-> studio发给认证工程师处理 + * 任务责任确认 -> 认证工程师发给责任人 + * 任务办理 -> 责任人接受之后,等待提交交付物 + * 任务审查 -> 责任人提交交付物之后,认证工程师审查。 + */ + CHECKLIST_VERIFICATION ("Checklist verification","清单校核","Checklist verification"), + TASK_RESPONSIBILITY_CONFIRMATION ("Task responsibility confirmation","任务责任确认","Task responsibility confirmation"), + TASK_HANDLING ("Task handling","任务办理","Task handling"), + TASK_REVIEW ("Task Review","任务审查","Task Review"), ; String key; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java index f9dd65114..c440e0b3c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/OperatorTypeEnum.java @@ -83,6 +83,8 @@ public enum OperatorTypeEnum { LAWS_INVENTORY_VERIFY_UPDATE_FLOW_STATUS("法规清单-更新验证符合性流程状态","lawsInventoryVerifyUpdateFlowStatus"), LAWS_INVENTORY_DESIGN_CITE_DELIVERABLE("法规清单-设计-引用交付物","lawsInventoryDesignCiteDeliverable"), LAWS_INVENTORY_VERIFY_CITE_DELIVERABLE("法规清单-验证-引用交付物","lawsInventoryVerifyCiteDeliverable"), + LAWS_INVENTORY_STUDIO_COPY("法规清单-studio复制","lawsInventoryStudioCopy"), + LAWS_INVENTORY_REGULATION_OWNER_COPY("法规清单-法规工程师复制","lawsInventoryRegulationOwnerCopy"), /** * 待办中心-将法规工程师的法规清单确认待办任务转为已办 diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/CertificationInventoryJob.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/CertificationInventoryJob.java index 93f199d22..92fd32efe 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/CertificationInventoryJob.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/CertificationInventoryJob.java @@ -89,17 +89,14 @@ public class CertificationInventoryJob implements Job { * @param projectCertificationInventoryEOS */ private void remindCertificationEngineer( List projectCertificationInventoryEOS,ProjectLibraryBase projectLibraryBase) { - List certificationInventoryEOList = projectCertificationInventoryEOS.stream().filter(data -> { + List toBeReviewedCiEoList = projectCertificationInventoryEOS.stream().filter(data -> { boolean flag = ( - StringUtils.equals(data.getFlowStatus(), CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) - || StringUtils.equals(data.getFlowStatus(), CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue()) - || StringUtils.equals(data.getFlowStatus(), CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + StringUtils.equals(data.getFlowStatus(), CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) ); return flag; }).collect(Collectors.toList()); - - if(CollectionUtils.isNotEmpty(certificationInventoryEOList)){ - Map sendMsgDataListMap = this.disposeSendMsgDataList(certificationInventoryEOList); + if(CollectionUtils.isNotEmpty(toBeReviewedCiEoList)){ + Map sendMsgDataListMap = this.disposeSendMsgDataList(toBeReviewedCiEoList); List certificationEngineerIdList = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(",")); List certificationEngineerList = this.sysUserService.querySysUserListByIdList(certificationEngineerIdList); @@ -113,7 +110,8 @@ public class CertificationInventoryJob implements Job { certificationEngineerList, certificationEngineerId, threeDaysList, - TemplateInfoEnum2.CERTIFICATION_MESSAGE6.getValue() + TemplateInfoEnum2.CERTIFICATION_MESSAGE6.getValue(), + threeDaysList.get(0).getEndTime() ); } } @@ -126,7 +124,8 @@ public class CertificationInventoryJob implements Job { certificationEngineerList, certificationEngineerId, currentDaysList, - TemplateInfoEnum2.CERTIFICATION_MESSAGE7.getValue() + TemplateInfoEnum2.CERTIFICATION_MESSAGE7.getValue(), + currentDaysList.get(0).getEndTime() ); } } @@ -139,7 +138,66 @@ public class CertificationInventoryJob implements Job { certificationEngineerList, certificationEngineerId, overdueList, - TemplateInfoEnum2.CERTIFICATION_MESSAGE8.getValue() + TemplateInfoEnum2.CERTIFICATION_MESSAGE8.getValue(), + overdueList.get(0).getEndTime() + ); + } + } + } + + List toBeCheckedCiEoList = projectCertificationInventoryEOS.stream().filter(data -> { + boolean flag = ( + StringUtils.equals(data.getFlowStatus(), CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) + || StringUtils.equals(data.getFlowStatus(), CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue()) + ); + return flag; + }).collect(Collectors.toList()); + + if(CollectionUtils.isNotEmpty(toBeCheckedCiEoList)){ + Map sendMsgDataListMap = this.disposeSendMsgDataListByInventoryVerifyEndTime(toBeCheckedCiEoList); + + List certificationEngineerIdList = Arrays.asList(projectLibraryBase.getCertificationEngineer().split(",")); + List certificationEngineerList = this.sysUserService.querySysUserListByIdList(certificationEngineerIdList); + + // 三天后结束的 + List threeDaysList = (List) sendMsgDataListMap.get("threeDaysList"); + if(CollectionUtils.isNotEmpty(threeDaysList)){ + for (String certificationEngineerId : certificationEngineerIdList) { + this.sendLarkCardMsgByTemplate( + projectLibraryBase, + certificationEngineerList, + certificationEngineerId, + threeDaysList, + TemplateInfoEnum2.CERTIFICATION_MESSAGE6.getValue(), + threeDaysList.get(0).getInventoryVerifyEndTime() + ); + } + } + // 当天结束的 + List currentDaysList = (List) sendMsgDataListMap.get("currentDaysList"); + if(CollectionUtils.isNotEmpty(currentDaysList)){ + for (String certificationEngineerId : certificationEngineerIdList) { + this.sendLarkCardMsgByTemplate( + projectLibraryBase, + certificationEngineerList, + certificationEngineerId, + currentDaysList, + TemplateInfoEnum2.CERTIFICATION_MESSAGE7.getValue(), + currentDaysList.get(0).getInventoryVerifyEndTime() + ); + } + } + // 逾期的 + List overdueList = (List) sendMsgDataListMap.get("overdueList"); + if(CollectionUtils.isNotEmpty(overdueList)){ + for (String certificationEngineerId : certificationEngineerIdList) { + this.sendLarkCardMsgByTemplate( + projectLibraryBase, + certificationEngineerList, + certificationEngineerId, + overdueList, + TemplateInfoEnum2.CERTIFICATION_MESSAGE8.getValue(), + overdueList.get(0).getInventoryVerifyEndTime() ); } } @@ -193,7 +251,8 @@ public class CertificationInventoryJob implements Job { dutyPersonList, dutyPersonUserId, fourteenDaysList, - TemplateInfoEnum2.CERTIFICATION_MESSAGE19.getValue() + TemplateInfoEnum2.CERTIFICATION_MESSAGE19.getValue(), + fourteenDaysList.get(0).getEndTime() ); } @@ -205,7 +264,8 @@ public class CertificationInventoryJob implements Job { dutyPersonList, dutyPersonUserId, sevenDaysList, - TemplateInfoEnum2.CERTIFICATION_MESSAGE20.getValue() + TemplateInfoEnum2.CERTIFICATION_MESSAGE20.getValue(), + sevenDaysList.get(0).getEndTime() ); } @@ -217,7 +277,8 @@ public class CertificationInventoryJob implements Job { dutyPersonList, dutyPersonUserId, currentDaysList, - TemplateInfoEnum2.CERTIFICATION_MESSAGE21.getValue() + TemplateInfoEnum2.CERTIFICATION_MESSAGE21.getValue(), + currentDaysList.get(0).getEndTime() ); } // 逾期的 @@ -228,7 +289,8 @@ public class CertificationInventoryJob implements Job { dutyPersonList, dutyPersonUserId, overdueList, - TemplateInfoEnum2.CERTIFICATION_MESSAGE22.getValue() + TemplateInfoEnum2.CERTIFICATION_MESSAGE22.getValue(), + overdueList.get(0).getEndTime() ); } } @@ -351,6 +413,101 @@ public class CertificationInventoryJob implements Job { return result; } + /** + * 处理需要发送消息的数据 + * @param pciEoList + * @return + */ + private Map disposeSendMsgDataListByInventoryVerifyEndTime(List pciEoList) { + Map result = new HashMap<>(); + Date currentDate = new Date(); + + //获取后三天前的时间 + Calendar calendar=new GregorianCalendar(); + calendar.setTime(new Date()); + calendar.add(Calendar.DATE,3); + Date threeDays = calendar.getTime(); + + //获取后七天后的时间 + Calendar sevenCalendar=new GregorianCalendar(); + sevenCalendar.setTime(new Date()); + sevenCalendar.add(Calendar.DATE,7); + Date sevenDays = sevenCalendar.getTime(); + + //获取后十四天后的时间 + Calendar fourteenCalendar=new GregorianCalendar(); + fourteenCalendar.setTime(new Date()); + fourteenCalendar.add(Calendar.DATE,14); + Date fourteenDays = fourteenCalendar.getTime(); + + String threeDaysStr = sdf.format(threeDays); + String sevenDaysStr = sdf.format(sevenDays); + String fourteenDaysStr = sdf.format(fourteenDays); + String currentDateStr = sdf.format(currentDate); + + // 当天结束的 + List currentDaysList = pciEoList.stream().filter(data -> { + boolean flag = false; + //结束日期是当前日期 + if(data.getInventoryVerifyEndTime() != null){ + if (StringUtils.equals(currentDateStr, sdf.format(data.getInventoryVerifyEndTime()))) { + flag = true; + } + } + return flag; + }).collect(Collectors.toList()); + + // 三天后结束的 + List threeDaysList = pciEoList.stream().filter(data -> { + boolean flag = false; + if(data.getInventoryVerifyEndTime() != null){ + if (StringUtils.equals(threeDaysStr, sdf.format(data.getInventoryVerifyEndTime()))) { + flag = true; + } + } + return flag; + }).collect(Collectors.toList()); + + // 七天后结束的 + List sevenDaysList = pciEoList.stream().filter(data -> { + boolean flag = false; + if(data.getInventoryVerifyEndTime()!=null){ + if (StringUtils.equals(sevenDaysStr, sdf.format(data.getInventoryVerifyEndTime()))) { + flag = true; + } + } + return flag; + }).collect(Collectors.toList()); + + // 十四天后结束的 + List fourteenDaysList = pciEoList.stream().filter(data -> { + boolean flag = false; + if(data.getInventoryVerifyEndTime() != null){ + if (StringUtils.equals(fourteenDaysStr, sdf.format(data.getInventoryVerifyEndTime()))) { + flag = true; + } + } + return flag; + }).collect(Collectors.toList()); + + // 逾期的 + List overdueList = pciEoList.stream().filter(data -> { + // 只要早于当前日期都算逾期 + boolean flag = false; + if(data.getInventoryVerifyEndTime() != null){ + flag = (data.getInventoryVerifyEndTime().before(currentDate) && !StringUtils.equals(currentDateStr, sdf.format(data.getInventoryVerifyEndTime()))); + } + return flag; + }).collect(Collectors.toList()); + + result.put("currentDaysList",currentDaysList); + result.put("threeDaysList",threeDaysList); + result.put("overdueList",overdueList); + result.put("sevenDaysList",sevenDaysList); + result.put("fourteenDaysList",fourteenDaysList); + return result; + } + /** * 根据模板 发送飞书消息 * @param projectLibraryBase @@ -358,7 +515,11 @@ public class CertificationInventoryJob implements Job { * @param userId * @param list */ - private void sendLarkCardMsgByTemplate(ProjectLibraryBase projectLibraryBase, List userList,String userId,List list,String templateId) { + private void sendLarkCardMsgByTemplate(ProjectLibraryBase projectLibraryBase, + List userList,String userId, + List list, + String templateId, + Date endTime) { String thirdId = this.sysUserService.getUserThirdIdByUserId(userList,userId); if(StringUtils.isNotEmpty(thirdId)){ @@ -385,7 +546,7 @@ public class CertificationInventoryJob implements Job { templateVariableMap.put("standName",standName); templateVariableMap.put("itemName",itemName); templateVariableMap.put("Initiator", projectLibraryBase.getStudioEngineerName()); - templateVariableMap.put("endTime", DateUtils.formatDate(list.get(0).getEndTime())); + templateVariableMap.put("endTime", DateUtils.formatDate(endTime)); templateVariableMap.put("viewBtnUrlCn",hrefFeishu_CN); templateVariableMap.put("viewBtnUrlEn",hrefFeishu_EN); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java index 65d04bd5a..fc087b9d6 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java @@ -16,6 +16,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.util.Date; import java.util.List; import java.util.Map; @@ -225,7 +226,7 @@ public interface IProjectCertificationInventoryEOService extends IService projectCertificationInventoryEOS,String templeteId,List userIdList,List userInfoList); + void sendMessageByTemplateId(List projectCertificationInventoryEOS, String templeteId, List userIdList, List userInfoList, Date endTime); /** * 数据唯一校验。 @@ -248,4 +249,8 @@ public interface IProjectCertificationInventoryEOService extends IService addConfigByIds(JSONObject json); + + void certificationInventoryEOListSortByEndTimeAsc(List projectCertificationInventoryEOList); + void certificationInventoryEOListSortByInventoryVerifyEndTimeAsc(List projectCertificationInventoryEOList); + void certificationInventoryEOListSortByTaskConfirmEndTimeAsc(List projectCertificationInventoryEOList); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java index 95c2f28d9..bfc425ec0 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectLawsInventoryEOService.java @@ -104,7 +104,7 @@ public interface IProjectLawsInventoryEOService extends IService queryProjectLawsInventoryInfoById(Map params); - void copyInfoByIds(String ids); + void copyInfoByIds(String ids,String operateType); /** * 批量设置 diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index 69869e9d2..b2d97dc70 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -222,7 +222,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl projectCertificationInventoryEOS,String templeteId,List userIdList,List userInfoList){ + public void sendMessageByTemplateId(List projectCertificationInventoryEOS, + String templeteId, + List userIdList, + List userInfoList, + Date endTime){ LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectCertificationInventoryEOS.get(0).getProjectLibraryId()); @@ -686,8 +693,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl idList = Arrays.asList(ids.split(",")); @@ -1055,13 +1068,13 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl processInfoDetailEOList = new ArrayList<>(); List certificationEngineerList = Arrays.asList(certificationEngineer.split(",")); // 给认证工程师分配任务 @@ -2050,6 +2071,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl idList = Arrays.asList(ids.split(",")); @@ -2277,10 +2302,11 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl processInfoDetailEOList = new ArrayList<>(); for (ProjectCertificationInventoryEO projectCertificationInventoryEO : projectCertificationInventoryEOList) { projectCertificationInventoryEO.setFlowStatus(CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()); + projectCertificationInventoryEO.setTaskConfirmEndTime(taskConfirmEndTime); ProcessInfoDetailEO processInfoDetailEO = new ProcessInfoDetailEO(); processInfoDetailEO.setUserId(projectCertificationInventoryEO.getDutyPerson()); - processInfoDetailEO.setEndTime(projectCertificationInventoryEO.getEndTime()); + processInfoDetailEO.setEndTime(taskConfirmEndTime); processInfoDetailEO.setProjectLawsInventoryId(projectCertificationInventoryEO.getId()); processInfoDetailEOList.add(processInfoDetailEO); } @@ -2314,8 +2340,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl projectCertificationInventoryEOList) { + @Override + public void certificationInventoryEOListSortByEndTimeAsc(List projectCertificationInventoryEOList) { Collections.sort(projectCertificationInventoryEOList, new Comparator() { @Override public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) { @@ -2365,6 +2392,39 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl pciEoList) { + Collections.sort(pciEoList, new Comparator() { + @Override + public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) { + if(p1.getInventoryVerifyEndTime() != null && p2.getInventoryVerifyEndTime() != null){ + return p1.getInventoryVerifyEndTime().compareTo(p2.getInventoryVerifyEndTime()); + } + return 1; + } + }); + } + /** + * 认证清单数据排序,根据任务确认截至时间顺序排序 + * @param pciEoList + */ + @Override + public void certificationInventoryEOListSortByTaskConfirmEndTimeAsc(List pciEoList) { + Collections.sort(pciEoList, new Comparator() { + @Override + public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) { + if(p1.getTaskConfirmEndTime() != null && p2.getTaskConfirmEndTime() != null){ + return p1.getTaskConfirmEndTime().compareTo(p2.getTaskConfirmEndTime()); + } + return 1; + } + }); + } + @Override public Result saveBatch(JSONObject json) { Date now = new Date(); @@ -2633,7 +2693,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl certificationInventoryEOList = projectCertificationInventoryEOList.stream().filter(data -> { - return (StringUtils.equals(data.getFlowStatus(), CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) - || StringUtils.equals(data.getFlowStatus(), CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue()) - || StringUtils.equals(data.getFlowStatus(), CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())); + // 结果待审查 + List toBeReviewedCiEoList = projectCertificationInventoryEOList.stream().filter(data -> { + return (StringUtils.equals(data.getFlowStatus(), CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue())); }).collect(Collectors.toList()); - if(CollectionUtils.isNotEmpty(certificationInventoryEOList)){ + if(CollectionUtils.isNotEmpty(toBeReviewedCiEoList)){ String certificationEngineerIds = projectLibraryBase.getCertificationEngineer(); if(StringUtils.isNotEmpty(certificationEngineerIds)){ List certificationEngineerIdList = Arrays.asList(certificationEngineerIds.split(",")); @@ -2723,7 +2783,7 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl certificationEngineerList = this.sysUserService.querySysUserListByIdList(certificationEngineerIdList); // 根据结束时间进行排序,获取最近的时间,发消息时使用。 - Collections.sort(certificationInventoryEOList, new Comparator() { + Collections.sort(toBeReviewedCiEoList, new Comparator() { @Override public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) { if(p1.getEndTime() != null && p2.getEndTime() != null){ @@ -2732,9 +2792,9 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl standNameAndItemName = this.getStandNameAndItemName(certificationInventoryEOList); + Map standNameAndItemName = this.getStandNameAndItemName(toBeReviewedCiEoList); String standName = (String) standNameAndItemName.get("standName"); String itemName = (String) standNameAndItemName.get("itemName"); @@ -2768,6 +2828,65 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl toBeCheckedCiEoList = projectCertificationInventoryEOList.stream().filter(data -> { + return (StringUtils.equals(data.getFlowStatus(), CertificationInventoryFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) + || StringUtils.equals(data.getFlowStatus(), CertificationInventoryFlowStatusEnum.REFUSAL_OF_RESPONSIBLE_PERSON.getValue())); + }).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(toBeCheckedCiEoList)) { + String certificationEngineerIds = projectLibraryBase.getCertificationEngineer(); + if(StringUtils.isNotEmpty(certificationEngineerIds)){ + List certificationEngineerIdList = Arrays.asList(certificationEngineerIds.split(",")); + + List certificationEngineerList = this.sysUserService.querySysUserListByIdList(certificationEngineerIdList); + + // 根据结束时间进行排序,获取最近的时间,发消息时使用。 + Collections.sort(toBeCheckedCiEoList, new Comparator() { + @Override + public int compare(ProjectCertificationInventoryEO p1, ProjectCertificationInventoryEO p2) { + if(p1.getInventoryVerifyEndTime() != null && p2.getInventoryVerifyEndTime() != null){ + return p1.getInventoryVerifyEndTime().compareTo(p2.getInventoryVerifyEndTime()); + } + return 1; + } + }); + Date inventoryVerifyEndTime = toBeCheckedCiEoList.get(0).getInventoryVerifyEndTime(); + + Map standNameAndItemName = this.getStandNameAndItemName(toBeCheckedCiEoList); + String standName = (String) standNameAndItemName.get("standName"); + String itemName = (String) standNameAndItemName.get("itemName"); + + if(CollectionUtils.isNotEmpty(certificationEngineerList)){ + for (String certificationEngineerId : certificationEngineerIdList) { + String thirdId = this.sysUserService.getUserThirdIdByUserId(certificationEngineerList,certificationEngineerId); + + if(StringUtils.isNotEmpty(thirdId)){ + try { + JSONObject larkMesJson = new JSONObject(); + larkMesJson.put("template_id", TemplateInfoEnum2.CERTIFICATION_MESSAGE1.getValue()); + larkMesJson.put("userIds",thirdId); + + Map templateVariableMap = new HashMap<>(); + templateVariableMap.put("projectNameCn",PRN_CN); + templateVariableMap.put("projectNameEn",PRN_EN); + templateVariableMap.put("standName",standName); + templateVariableMap.put("itemName",itemName); + templateVariableMap.put("Initiator",projectLibraryBase.getStudioEngineerName()); + templateVariableMap.put("endTime",DateUtils.formatDate(inventoryVerifyEndTime)); + templateVariableMap.put("viewBtnUrlCn",hrefFeishu_CN); + templateVariableMap.put("viewBtnUrlEn",hrefFeishu_EN); + + larkMesJson.put("templateVariableMap",templateVariableMap); + this.feishuService.batchSendLarkCardMsgByTemplate2(larkMesJson); + } catch (Exception e) { + log.error("飞书消息推送失败"); + } + } + } + } + } + } } List dutyPersonIdList = projectCertificationInventoryEOList.stream().map(ProjectCertificationInventoryEO::getDutyPerson).distinct().collect(Collectors.toList()); @@ -2792,13 +2911,16 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.in(ProjectLawsInventoryEO::getId,Arrays.asList(ids.split(","))); @@ -4185,8 +4185,16 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl 对应现在的 任务待发起 + if(StringUtils.equals(operateType,OperatorTypeEnum.LAWS_INVENTORY_STUDIO_COPY.getValue())){ + projectLawsInventoryEO.setDesignFlowStatus(ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue()); + projectLawsInventoryEO.setVerifyFlowStatus(ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue()); + }else if(StringUtils.equals(operateType,OperatorTypeEnum.LAWS_INVENTORY_REGULATION_OWNER_COPY.getValue())){ + projectLawsInventoryEO.setDesignFlowStatus(ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()); + projectLawsInventoryEO.setVerifyFlowStatus(ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()); + } + ProjectTaskInventoryEO projectTaskInventoryEO = new ProjectTaskInventoryEO(); String projectTaskInventoryId = UUID.randomUUID().toString().replace("-", ""); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java index d876d9694..6a59f1992 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java @@ -437,12 +437,14 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl projectCertificationInventoryEOList = this.projectCertificationInventoryEOService.list(certificationInventoryEOQueryWrapper); if(CollectionUtils.isNotEmpty(projectCertificationInventoryEOList)){ + this.projectCertificationInventoryEOService.certificationInventoryEOListSortByEndTimeAsc(projectCertificationInventoryEOList); List userInfoList = this.sysUserService.querySysUserListByIdList(originalCertificationEngineerIdList); this.projectCertificationInventoryEOService.sendMessageByTemplateId( projectCertificationInventoryEOList, TemplateInfoEnum2.CERTIFICATION_MESSAGE13.getValue(), originalCertificationEngineerIdList, - userInfoList + userInfoList, + projectCertificationInventoryEOList.get(0).getEndTime() ); } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/mapper/xml/ProcessInfoEOMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/mapper/xml/ProcessInfoEOMapper.xml index 1081945ae..686c871a7 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/mapper/xml/ProcessInfoEOMapper.xml +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/mapper/xml/ProcessInfoEOMapper.xml @@ -245,7 +245,7 @@ pid.end_time from process_info_detail pid - where pid.process_info_id = pi.id and pid.STATUS = 'NotDone' order by pid.end_time asc limit 1 + where pid.process_info_id = pi.id and pid.STATUS = 'NotDone' and pid.end_time is not null order by pid.end_time asc limit 1 ) as end_time, -