diff --git a/jero-boot/db/蔚来标准sql/dev_2nd_period.sql b/jero-boot/db/蔚来标准sql/dev_2nd_period.sql index 02073653e..9a570c70a 100644 --- a/jero-boot/db/蔚来标准sql/dev_2nd_period.sql +++ b/jero-boot/db/蔚来标准sql/dev_2nd_period.sql @@ -414,11 +414,11 @@ CREATE TABLE `auth_dummy_log` ( PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- 参数配置数据表,增加排序号字段sql 2023-1-31 已同步生产环境 -ALTER TABLE `laws_weilai`.`params_config_data` +ALTER TABLE `params_config_data` ADD COLUMN `order_num` int(10) NULL COMMENT '排序号' AFTER `params_collect_manifest_id`; -- 上报库参数配置数据表,增加排序号字段sql 2023-2-1 已同步生产环境 -ALTER TABLE `laws_weilai`.`params_report_config_data` +ALTER TABLE `params_report_config_data` ADD COLUMN `order_num` int(10) NULL COMMENT '排序号' AFTER `params_collect_manifest_id`; -- 流程历史表,增加字段 附件id 2023-3-20 已同步生产环境 @@ -664,11 +664,11 @@ CREATE TABLE `recent_browse` ( INSERT INTO `sys_permission` (`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `menu_en`) VALUES ('1669532516277075970', '1552487412749369345', '一般导出', NULL, NULL, NULL, NULL, 2, 'report:detail:export:general', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'admin', '2023-06-16 10:29:05', NULL, NULL, 0, 0, '1', 0, 'General export'); --- 认证清单表 交付物字段扩大 2023-06-21 未同步生产环境 +-- 认证清单表 交付物字段扩大 2023-06-21 已同步生产环境 ALTER TABLE `project_certification_inventory` MODIFY COLUMN `deliverable` varchar(1500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '交付物' AFTER `duty_territory`; --- 法规清单 添加责任部门 2023-07-14 未同步生产环境 +-- 法规清单 添加责任部门 2023-07-14 已同步生产环境 ALTER TABLE `auth_dummy_inventory_info` ADD COLUMN `duty_depart` varchar(255) NULL AFTER `attestation_type`; diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysDepartService.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysDepartService.java index 4893c132c..a789280e4 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysDepartService.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysDepartService.java @@ -160,4 +160,6 @@ public interface ISysDepartService extends IService{ */ void updatePPDepart(SysDepart sysDepart, PPDepartment ppDepartment); + List querySysDepartListByIdList(List idList); + } diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java index 6d88c32c4..24314c70b 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/ISysUserService.java @@ -62,6 +62,7 @@ public interface ISysUserService extends IService { public boolean deleteBatchUsers(String userIds); public SysUser getUserByName(String username); + public SysUser getUserById(String id); /** * 添加用户和用户角色关系 diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDepartServiceImpl.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDepartServiceImpl.java index 8c5c3d639..1a3d3a250 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDepartServiceImpl.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysDepartServiceImpl.java @@ -3,6 +3,7 @@ package com.jero.modules.system.service.impl; import cn.hutool.core.collection.CollectionUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jero.common.constant.CacheConstant; import com.jero.common.constant.CommonConstant; @@ -18,6 +19,7 @@ import com.jero.modules.system.model.DepartIdModel; import com.jero.modules.system.service.ISysDepartService; import com.jero.modules.system.util.FindsDepartsChildrenUtil; import io.netty.util.internal.StringUtil; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.Cacheable; @@ -674,4 +676,17 @@ public class SysDepartServiceImpl extends ServiceImpl querySysDepartListByIdList(List idList){ + idList = idList.stream().distinct().collect(Collectors.toList()); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(SysDepart::getId,idList); + List list = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(idList)){ + list = this.baseMapper.selectList(queryWrapper); + } + return list; + } + } diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java index 5a145e722..cbd468806 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/service/impl/SysUserServiceImpl.java @@ -133,6 +133,10 @@ public class SysUserServiceImpl extends ServiceImpl impl return userMapper.getUserByName(username); } + @Override + public SysUser getUserById(String id) { + return userMapper.selectById(id); + } @Override @Transactional diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/controller/ParamsCollectManifestEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/controller/ParamsCollectManifestEOController.java index d983996b4..e7584e710 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/controller/ParamsCollectManifestEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/controller/ParamsCollectManifestEOController.java @@ -686,4 +686,16 @@ public class ParamsCollectManifestEOController extends JeroController batchEditDeadline(@RequestBody ParamsCollectManifestVO paramsCollectManifestVO) { return this.paramsCollectManifestEOService.batchEditDeadline(paramsCollectManifestVO); } + + + + /** + * 查询本清单所有责任领域 + */ + @AutoLog(value = "参数项收集清单-查询本清单所有责任领域") + @ApiOperation(value="参数项收集清单-查询本清单所有责任领域", notes="参数项收集清单-查询本清单所有责任领域") + @GetMapping(value = "/queryDutyTerritory") + public Result queryDutyTerritory(@RequestParam(name="id",required=true) String id) { + return this.paramsCollectManifestEOService.queryDutyTerritory(id); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/ParamsCollectManifestEOMapper.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/ParamsCollectManifestEOMapper.java index dfa97007a..cdcbc1cee 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/ParamsCollectManifestEOMapper.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/ParamsCollectManifestEOMapper.java @@ -38,4 +38,8 @@ public interface ParamsCollectManifestEOMapper extends BaseMapper queryByProjectId(@Param("projectId") String projectId); List getList(@Param("params") Map params); + + List queryDutyTerritory(@Param("paramsManifestId") String paramsManifestId); + + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestEOMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestEOMapper.xml index 35f81bc2f..04d385b79 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestEOMapper.xml +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestEOMapper.xml @@ -156,4 +156,8 @@ SELECT id,params_manifest_id,state,control_type FROM params_collect_manifest + + diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java index 5c11b45c7..b45dd037e 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java @@ -202,4 +202,6 @@ public interface IParamsCollectManifestEOService extends IService batchEditDeadline(ParamsCollectManifestVO paramsCollectManifestVO); List getList(Map params); + + Result queryDutyTerritory(String id); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java index c95fa3676..7b2336b1b 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java @@ -7404,4 +7404,18 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl result = this.baseMapper.getList(params); return result; } + + @Override + public Result queryDutyTerritory(String paramsManifestId) { + Map resMap = new HashMap<>(); + List dtList = paramsCollectManifestEOMapper.queryDutyTerritory(paramsManifestId); + List dtSdiList = sysDictItemService.selectItemsByDictCode("duty_territory"); + Map dictItemsMap = dtSdiList.stream().collect(Collectors.toMap(SysDictItem::getItemValue, SysDictItem::getEnName)); + if(ObjectUtils.isNotEmpty(dtList)){ + for (String dtId : dtList) { + resMap.put(dtId,dictItemsMap.get(dtId)); + } + } + return Result.OK(resMap); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/controller/OnlCgformCollectionController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/controller/OnlCgformCollectionController.java index d6affe4bb..8cba0b17c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/controller/OnlCgformCollectionController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/controller/OnlCgformCollectionController.java @@ -11,6 +11,7 @@ import com.jero.common.system.query.QueryGenerator; import com.jero.modules.collection.entity.OnlCgformCollection; import com.jero.modules.collection.service.IOnlCgformCollectionService; import com.jero.modules.document.controller.BussDocumentLibraryEOController; +import com.jero.modules.phone.service.ISearchCenterService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -39,6 +40,8 @@ public class OnlCgformCollectionController extends JeroController> list = onlCgformCollectionService.queryCondition(flag, cut); return Result.OK(list); } + + @AutoLog(value = "我的收藏-搜索-根据用户获取文档库订阅和收藏信息") + @ApiOperation(value = "我的收藏-搜索-根据用户获取文档库订阅和收藏信息", notes = "我的收藏-搜索-根据用户获取文档库订阅和收藏信息") + @GetMapping(value = "/getWdkCollectAndSubscribeInfoByUser") + public Result> getWdkCollectAndSubscribeInfoByUser(@RequestParam Map params) { + return this.searchCenterService.getWdkCollectAndSubscribeInfoByUser(params); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/service/impl/ToDoCenterServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/service/impl/ToDoCenterServiceImpl.java index 749c3d7ae..42264ad11 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/service/impl/ToDoCenterServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/phone/service/impl/ToDoCenterServiceImpl.java @@ -430,11 +430,11 @@ public class ToDoCenterServiceImpl implements IToDoCenterService { data.setTaskDefinitionKeyName(taskDefinitionKeyName); } } - // 如果是清单确认流程,将任务节点设置为 任务发起:Task initiation + // 如果是清单确认流程,将任务节点设置为 任务发起:Process initiation if (StringUtils.equals(data.getFlowType(), FlowTypeEnum.QDQR.getValue())) { String taskDefinitionKeyName = "任务发起"; if (StringUtils.equals(cut, CutEnum.EN.getValue())) { - taskDefinitionKeyName = "Task Initiation"; + taskDefinitionKeyName = "Process Initiation"; } data.setTaskDefinitionKeyName(taskDefinitionKeyName); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java index 65a8b074c..07455ea6d 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java @@ -635,6 +635,29 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl departIds = new ArrayList<>(); + for (ProblemKnowledgeBaseUserEO puser : permissionUserList) { + SysUser user = sysUserService.getUserById(puser.getUserId()); + //假设找不到人就是部门 + if(ObjectUtils.isEmpty(user)){ + List deptList = sysDepartService.getSubDepIdsByDepId(puser.getUserId()); + departIds.addAll(deptList); + departIds.add(puser.getUserId()); + } + } + for (String deptStr:departIds) { + ProblemKnowledgeBaseUserEO cup = new ProblemKnowledgeBaseUserEO(); + cup.setUserId(deptStr); + permissionUserList.add(cup); + } + List userList = sysUserService.getUserListByDepIds(departIds); + for (SysUser user : userList) { + ProblemKnowledgeBaseUserEO cup = new ProblemKnowledgeBaseUserEO(); + cup.setUserId(user.getId()); + permissionUserList.add(cup); + } + permissionUserList.forEach(permissionUser -> { permissionUser.setProblemKnowledgeBaseId(problemKnowledgeBaseEO.getId()); }); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseUserEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseUserEOServiceImpl.java index 4f3679dcf..fecf77f45 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseUserEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseUserEOServiceImpl.java @@ -1,9 +1,12 @@ package com.jero.modules.problemKnowledgeBase.service.impl; +import com.jero.common.constant.enums.CutEnum; import com.jero.modules.problemKnowledgeBase.entity.ProblemKnowledgeBaseUserEO; import com.jero.modules.problemKnowledgeBase.mapper.ProblemKnowledgeBaseUserEOMapper; import com.jero.modules.problemKnowledgeBase.service.IProblemKnowledgeBaseUserEOService; +import com.jero.modules.system.entity.SysDepart; import com.jero.modules.system.entity.SysUser; +import com.jero.modules.system.service.ISysDepartService; import com.jero.modules.system.service.ISysUserService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -29,6 +32,9 @@ public class ProblemKnowledgeBaseUserEOServiceImpl extends ServiceImpl userIdList = datas.stream().map(ProblemKnowledgeBaseUserEO::getUserId).distinct().collect(Collectors.toList()); List userList = sysUserService.querySysUserListByIdList(userIdList); + List deptList = sysDepartService.querySysDepartListByIdList(userIdList); datas.forEach(data -> { if(CollectionUtils.isNotEmpty(userList)){ @@ -117,6 +124,23 @@ public class ProblemKnowledgeBaseUserEOServiceImpl extends ServiceImpl 责任人提交交付物之后,认证工程师审查。 */ LIST_CONFIRMATION("List Release","清单校核","List Release"), - CHECKLIST_VERIFICATION ("Task initiation","任务发起","Task Initiation"), + CHECKLIST_VERIFICATION ("Task initiation","任务发起","Process Initiation"), TASK_RESPONSIBILITY_CONFIRMATION ("Task responsibility confirmation","任务责任确认","Responsibilty Confirmation"), TASK_HANDLING ("Task handling","任务办理","Task Handling"), TASK_REVIEW ("Task Review","任务审查","Task Review"), diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ProjectMessageEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ProjectMessageEnum.java new file mode 100644 index 000000000..594228b3b --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/enums/ProjectMessageEnum.java @@ -0,0 +1,53 @@ +package com.jero.modules.project.enums; + +import com.alibaba.druid.util.StringUtils; +import com.jero.common.constant.enums.CutEnum; + +/** + * 认证流程 节点枚举类 + */ +public enum ProjectMessageEnum { + + SJFHXLC("sjfhxlc","设计符合性流程","Design Compliance Process"), + YZFHXLC("yzfhxlc","验证符合性流程","Verify Compliance Process"), + RWBFQRCH("rwbfqrch","您好,您以下任务已被发起人撤回。","Hello! Your task has been withdrawn by the initiator."), + RWJZSJBXG("rwjzsjbxg","您好,以下符合性任务的截止时间已被发起人修改。","Hello! The due date of the compliance task has been modified by the initiator."), + RWJFWLXBXG("rwjfwlxbxg","您好,以下符合性任务的交付物类型已被发起人修改。","Hello! The type of deliverables of the compliance task has been modified by the initiator."), + RWJFWMBBXG("rwjfwmbbxg","您好,以下符合性任务的交付物模板已被发起人修改。","Hello! The deliverable template of the compliance task has been modified by the initiator."), + ; + + String key; + String cnName; + String enName; + + private ProjectMessageEnum(String key, String cnName, String enName) { + this.key = key; + this.cnName = cnName; + this.enName = enName; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getCnName() { + return cnName; + } + + public void setCnName(String cnName) { + this.cnName = cnName; + } + + public String getEnName() { + return enName; + } + + public void setEnName(String enName) { + this.enName = enName; + } + +} 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 f4e393ca5..d6280ef2a 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 @@ -166,7 +166,7 @@ public interface IProjectLawsInventoryEOService extends IService taskUrg(ProjectTaskUrgVo projectTaskUrgVo); Result updateFlowInfoByProjectLibraryIds(String projectLibraryIds); - + void updateFlowInfo(ProjectLawsInventoryEO projectLawsInventoryEO); /** * studio发布,启动清单确认流程 * @param json @@ -322,4 +322,5 @@ public interface IProjectLawsInventoryEOService extends IService oldPliEoList,List pidList) { + public void updateRegulationOwner(ProjectLawsInventoryEO newPliEo, List oldPliEoList, List pidList) { if (CollectionUtils.isNotEmpty(oldPliEoList)) { List oldPliEoIdList = oldPliEoList.stream().map(ProjectLawsInventoryEO::getId).distinct().collect(Collectors.toList()); // QueryWrapper pidEoQueryWrap = new QueryWrapper<>(); @@ -61,32 +113,32 @@ public class ProjectLawsInventoryEOEditServiceImpl { List pidEoList = pidList.stream().filter(pid -> { boolean flag = false; for (String oldPliEoId : oldPliEoIdList) { - if(StringUtils.equals(oldPliEoId,pid.getProjectLawsInventoryId())){ + if (StringUtils.equals(oldPliEoId, pid.getProjectLawsInventoryId())) { flag = true; break; } } return flag; }).distinct().collect(Collectors.toList()); - if(CollectionUtils.isNotEmpty(pidEoList)){ + if (CollectionUtils.isNotEmpty(pidEoList)) { List taskIdList = new ArrayList<>(); List updatePidEoList = new ArrayList<>(); for (ProjectLawsInventoryEO oldPliEo : oldPliEoList) { // 清单待校核 boolean toBeCheckedFlag = ( StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) - || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) + || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) ); // 结果待审查 boolean toBeReviewedFlag = ( StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) - || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) ); // 编辑前、编辑后的法规工程师都不为空。 boolean regulationOwnerIsNotNull = ( StringUtils.isNotEmpty(oldPliEo.getRegulationOwnerId()) - && StringUtils.isNotEmpty(newPliEo.getRegulationOwnerId()) + && StringUtils.isNotEmpty(newPliEo.getRegulationOwnerId()) ); if (regulationOwnerIsNotNull && (toBeCheckedFlag || toBeReviewedFlag)) { // 如果新的法规工程师不等于旧的法规工程师 将之前的法规工程师的待办任务,转给新的法规工程师办理 @@ -246,10 +298,11 @@ public class ProjectLawsInventoryEOEditServiceImpl { /** * 处理编辑了责任人的逻辑 - * @param newPliEo 新的法规清单对象 - * @param oldPliEoList 旧的法规清单数组 + * + * @param newPliEo 新的法规清单对象 + * @param oldPliEoList 旧的法规清单数组 */ - public void updateDutyPerson(ProjectLawsInventoryEO newPliEo, List oldPliEoList,List pidList) { + public void updateDutyPerson(ProjectLawsInventoryEO newPliEo, List oldPliEoList, List pidList) { if (CollectionUtils.isNotEmpty(oldPliEoList)) { List oldPliEoIdList = oldPliEoList.stream().map(ProjectLawsInventoryEO::getId).distinct().collect(Collectors.toList()); // QueryWrapper pidEoQueryWrap = new QueryWrapper<>(); @@ -258,24 +311,24 @@ public class ProjectLawsInventoryEOEditServiceImpl { List pidEoList = pidList.stream().filter(pid -> { boolean flag = false; for (String oldPliEoId : oldPliEoIdList) { - if(StringUtils.equals(oldPliEoId,pid.getProjectLawsInventoryId())){ + if (StringUtils.equals(oldPliEoId, pid.getProjectLawsInventoryId())) { flag = true; break; } } return flag; }).distinct().collect(Collectors.toList()); - if(CollectionUtils.isNotEmpty(pidEoList)){ + if (CollectionUtils.isNotEmpty(pidEoList)) { List designTaskIdList = new ArrayList<>(); List verifyTaskIdList = new ArrayList<>(); List updatePidEoList = new ArrayList<>(); for (ProjectLawsInventoryEO oldPliEo : oldPliEoList) { - if(StringUtils.isNotEmpty(newPliEo.getDesignDutyId())){ + if (StringUtils.isNotEmpty(newPliEo.getDesignDutyId())) { boolean designDutyTaskFlag = ( StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) - || StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) - || StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue()) - || StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue()) + || StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) ); // 如果旧符合性责任人不等于新的符合性责任人,并且设计符合性流程状态是 任务待确认、结果待提交、不符合、待追踪。则代表当前任务在责任人身上,需要将旧的责任人待办任务,转给新的责任人。 if (!StringUtils.equals(newPliEo.getDesignDutyId(), oldPliEo.getDesignDutyId()) && designDutyTaskFlag) { @@ -283,17 +336,17 @@ public class ProjectLawsInventoryEOEditServiceImpl { List designPidEoList = pidEoList.stream().filter(pidEo -> { boolean flag = ( StringUtils.equals(pidEo.getFlowType(), FlowTypeEnum.SJFHXSHLC.getValue()) - && ( - StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.ZRRQR.getValue()) - ||StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.DEZRRQR.getValue()) - ||StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.ZRRTJJFW.getValue()) - ||StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.DEZRRTJJFW.getValue()) + && ( + StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.ZRRQR.getValue()) + || StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.DEZRRQR.getValue()) + || StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.ZRRTJJFW.getValue()) + || StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.DEZRRTJJFW.getValue()) ) - && StringUtils.equals(pidEo.getStatus(), TaskStatusEnum.NOT_DONE.getValue()) + && StringUtils.equals(pidEo.getStatus(), TaskStatusEnum.NOT_DONE.getValue()) ); return flag; }).collect(Collectors.toList()); - if(CollectionUtils.isNotEmpty(designPidEoList)){ + if (CollectionUtils.isNotEmpty(designPidEoList)) { designPidEoList.forEach(designPidEo -> { designPidEo.setUserId(newPliEo.getDesignDutyId()); }); @@ -303,12 +356,12 @@ public class ProjectLawsInventoryEOEditServiceImpl { } } - if(StringUtils.isNotEmpty(newPliEo.getVerifyDutyId())){ + if (StringUtils.isNotEmpty(newPliEo.getVerifyDutyId())) { boolean verifyDutyTaskFlag = ( StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) - || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) - || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue()) - || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue()) + || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) ); // 如果验证符合性流程状态是 任务待确认、结果待提交、不符合、待追踪,则代表当前任务在责任人身上,需要将旧的责任人待办任务,转给新的责任人。 if (!StringUtils.equals(newPliEo.getVerifyDutyId(), oldPliEo.getVerifyDutyId()) && verifyDutyTaskFlag) { @@ -316,17 +369,17 @@ public class ProjectLawsInventoryEOEditServiceImpl { List verifyPidEoList = pidEoList.stream().filter(pidEo -> { boolean flag = ( StringUtils.equals(pidEo.getFlowType(), FlowTypeEnum.YZFHXSCLC.getValue()) - && ( - StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.ZRRQR.getValue()) - ||StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.DEZRRQR.getValue()) - ||StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.ZRRTJJFW.getValue()) - ||StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.DEZRRTJJFW.getValue()) + && ( + StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.ZRRQR.getValue()) + || StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.DEZRRQR.getValue()) + || StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.ZRRTJJFW.getValue()) + || StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.DEZRRTJJFW.getValue()) ) - && StringUtils.equals(pidEo.getStatus(), TaskStatusEnum.NOT_DONE.getValue()) + && StringUtils.equals(pidEo.getStatus(), TaskStatusEnum.NOT_DONE.getValue()) ); return flag; }).collect(Collectors.toList()); - if(CollectionUtils.isNotEmpty(verifyPidEoList)){ + if (CollectionUtils.isNotEmpty(verifyPidEoList)) { verifyPidEoList.forEach(verifyPidEo -> { verifyPidEo.setUserId(newPliEo.getVerifyDutyId()); }); @@ -356,8 +409,9 @@ public class ProjectLawsInventoryEOEditServiceImpl { /** * 处理修改设计或验证符合性截止日期的逻辑 - * @param newPliEo 新的法规清单对象 - * @param oldPliEoList 旧的法规清单数组 + * + * @param newPliEo 新的法规清单对象 + * @param oldPliEoList 旧的法规清单数组 */ public void updateDesignOrVerifyEndTime(ProjectLawsInventoryEO newPliEo, List oldPliEoList) { if (CollectionUtils.isNotEmpty(oldPliEoList)) { @@ -383,6 +437,7 @@ public class ProjectLawsInventoryEOEditServiceImpl { /** * 修改设计符合性流程明细表截止日期 + * * @param oldPliEoList * @param pidEoList * @param newDesignDueDate @@ -392,11 +447,11 @@ public class ProjectLawsInventoryEOEditServiceImpl { List designPliEOList = oldPliEoList.stream().filter(oldPliEo -> { boolean flag = ( !newDesignDueDate.equals(oldPliEo.getDesignDueDate()) - && ( - StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) - || StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) - || StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue()) - || StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + && ( + StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue()) + || StringUtils.equals(oldPliEo.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) ) ); return flag; @@ -406,19 +461,19 @@ public class ProjectLawsInventoryEOEditServiceImpl { List designPidEoList = pidEoList.stream().filter(pidEo -> { boolean flag = ( StringUtils.equals(pidEo.getFlowType(), FlowTypeEnum.SJFHXSHLC.getValue()) - && ( - StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.FGGCSSH.getValue()) - || StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.ZRRTJJFW.getValue()) - || StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.DEZRRTJJFW.getValue()) + && ( + StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.FGGCSSH.getValue()) + || StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.ZRRTJJFW.getValue()) + || StringUtils.equals(pidEo.getTaskDefinitionKey(), DesignComplianceFlowNodeKeyEnum.DEZRRTJJFW.getValue()) ) - && StringUtils.equals(pidEo.getStatus(), TaskStatusEnum.NOT_DONE.getValue()) + && StringUtils.equals(pidEo.getStatus(), TaskStatusEnum.NOT_DONE.getValue()) ); return flag; }).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(designPidEoList)) { String processInfoId = designPidEoList.get(0).getProcessInfoId(); ProcessInfoEO processInfoEO = this.processInfoEOService.queryById(processInfoId); - if(ObjectUtils.isNotEmpty(processInfoEO)){ + if (ObjectUtils.isNotEmpty(processInfoEO)) { processInfoEO.setEndTime(newDesignDueDate); this.processInfoEOService.updateById(processInfoEO); } @@ -428,6 +483,7 @@ public class ProjectLawsInventoryEOEditServiceImpl { /** * 修改验证符合性流程明细表截止日期 + * * @param oldPliEoList * @param pidEoList * @param newVerifyDueDate @@ -437,11 +493,11 @@ public class ProjectLawsInventoryEOEditServiceImpl { List verifyPliEOList = oldPliEoList.stream().filter(oldPliEo -> { boolean flag = ( !newVerifyDueDate.equals(oldPliEo.getVerifyDueDate()) - && ( - StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) - || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) - || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue()) - || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + && ( + StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue()) + || StringUtils.equals(oldPliEo.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) ) ); return flag; @@ -451,23 +507,3039 @@ public class ProjectLawsInventoryEOEditServiceImpl { List verifyPidEoList = pidEoList.stream().filter(pidEo -> { boolean flag = ( StringUtils.equals(pidEo.getFlowType(), FlowTypeEnum.YZFHXSCLC.getValue()) - && ( - StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.FGGCSSH.getValue()) - || StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.ZRRTJJFW.getValue()) - || StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.DEZRRTJJFW.getValue()) + && ( + StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.FGGCSSH.getValue()) + || StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.ZRRTJJFW.getValue()) + || StringUtils.equals(pidEo.getTaskDefinitionKey(), VerifyComplianceFlowNodeKeyEnum.DEZRRTJJFW.getValue()) ) - && StringUtils.equals(pidEo.getStatus(), TaskStatusEnum.NOT_DONE.getValue()) + && StringUtils.equals(pidEo.getStatus(), TaskStatusEnum.NOT_DONE.getValue()) ); return flag; }).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(verifyPidEoList)) { String processInfoId = verifyPidEoList.get(0).getProcessInfoId(); ProcessInfoEO processInfoEO = this.processInfoEOService.queryById(processInfoId); - if(ObjectUtils.isNotEmpty(processInfoEO)){ + if (ObjectUtils.isNotEmpty(processInfoEO)) { processInfoEO.setEndTime(newVerifyDueDate); this.processInfoEOService.updateById(processInfoEO); } } } } + + public void setBatch(ProjectLawsInventoryEO projectLawsInventoryEO) { + List idsList = Arrays.asList(projectLawsInventoryEO.getIds().split(",")); + List infoEOList = projectLawsInventoryEOService.listByIds(idsList); + String projectLibraryId = null; + if (CollectionUtils.isNotEmpty(infoEOList)) { + projectLibraryId = infoEOList.get(0).getProjectLibraryId(); + } + + if (org.apache.commons.lang3.StringUtils.isNotBlank(projectLawsInventoryEO.getIds())) { + //根据id查询数据库中完整信息,翻译 + List idList = Arrays.asList(projectLawsInventoryEO.getIds().split(",")); + QueryWrapper queryWrapper = new QueryWrapper<>(); + List infoList = projectLawsInventoryEOService.list(queryWrapper.in("id", idList)); + + for (String id : idList) { + projectLawsInventoryEO.setId(id); + // 发送消息 + this.updateProjectLawsInventorySendMessage(projectLawsInventoryEO); + } + // 根据法规清单id,获取该法规清单在待办中心的任务明细。 + List oldPliEoIdList = infoList.stream().map(ProjectLawsInventoryEO::getId).distinct().collect(Collectors.toList()); + QueryWrapper pidEoQueryWrap = new QueryWrapper<>(); + pidEoQueryWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId, oldPliEoIdList); + List pidEoList = this.processInfoDetailEOService.list(pidEoQueryWrap); + + // 处理编辑法规工程师的逻辑 + this.updateRegulationOwner(projectLawsInventoryEO, infoList, pidEoList); + // 处理编辑责任人的逻辑 + this.updateDutyPerson(projectLawsInventoryEO, infoList, pidEoList); + // 处理修改设计或验证符合性截止日期的逻辑 + this.updateDesignOrVerifyEndTime(projectLawsInventoryEO, infoList); + + List projectLawsInventoryEOList = new ArrayList<>(); + + List adds = new ArrayList<>(); + Date now = new Date(); + for (String id : projectLawsInventoryEO.getIds().split(",")) { + ProjectLawsInventoryEO projectLawsInventoryEOTemp = new ProjectLawsInventoryEO(); + projectLawsInventoryEOTemp.setId(id); + //实施类别 implementType + if (org.apache.commons.lang.StringUtils.isNotBlank(projectLawsInventoryEO.getImplementType())) { + projectLawsInventoryEOTemp.setImplementType(projectLawsInventoryEO.getImplementType()); + } + //认证类型 attestationType + if (org.apache.commons.lang.StringUtils.isNotBlank(projectLawsInventoryEO.getAttestationType())) { + projectLawsInventoryEOTemp.setAttestationType(projectLawsInventoryEO.getAttestationType()); + } + //认证级别 attestationRank + if (org.apache.commons.lang.StringUtils.isNotBlank(projectLawsInventoryEO.getAttestationRank())) { + projectLawsInventoryEOTemp.setAttestationRank(projectLawsInventoryEO.getAttestationRank()); + } + //责任领域 dutyTerritory + if (org.apache.commons.lang.StringUtils.isNotBlank(projectLawsInventoryEO.getDutyTerritory())) { + projectLawsInventoryEOTemp.setDutyTerritory(projectLawsInventoryEO.getDutyTerritory()); + } + //责任部门 DutyDepart + if (org.apache.commons.lang.StringUtils.isNotBlank(projectLawsInventoryEO.getDutyDepart())) { + projectLawsInventoryEOTemp.setDutyDepart(projectLawsInventoryEO.getDutyDepart()); + } + //适用地区region + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getRegion())) { + projectLawsInventoryEOTemp.setRegion(projectLawsInventoryEO.getRegion()); + } + //在产车实施日期implementTime + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getImplementTime())) { + projectLawsInventoryEOTemp.setImplementTime(projectLawsInventoryEO.getImplementTime()); + } + //新车型实施日期xin1Che1Xing2Shi2Shi1Ri4Qi1 + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1())) { + projectLawsInventoryEOTemp.setXin1Che1Xing2Shi2Shi1Ri4Qi1(projectLawsInventoryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1()); + } + //设计符合性确认截止时间 + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getDesignDueDate())) { + projectLawsInventoryEOTemp.setDesignDueDate(projectLawsInventoryEO.getDesignDueDate()); + } + //preHomo确认截止时间 + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getPrehomoDueDate())) { + projectLawsInventoryEOTemp.setPrehomoDueDate(projectLawsInventoryEO.getPrehomoDueDate()); + } + //验证符合性确认截止时间 + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDueDate())) { + projectLawsInventoryEOTemp.setVerifyDueDate(projectLawsInventoryEO.getVerifyDueDate()); + } + + //验证符合性确认-交付物类型 + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDeliverableType())) { + projectLawsInventoryEOTemp.setVerifyDeliverableType(projectLawsInventoryEO.getVerifyDeliverableType()); + } + //设计符合性确认-交付物类型 + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getDesignDeliverableType())) { + projectLawsInventoryEOTemp.setDesignDeliverableType(projectLawsInventoryEO.getDesignDeliverableType()); + } + //================================批量设置人员=================================================== + //法规工程师id + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId())) { + projectLawsInventoryEOTemp.setRegulationOwnerId(projectLawsInventoryEO.getRegulationOwnerId()); + setProjectLawsInventoryPermission(projectLawsInventoryEO.getRegulationOwnerId(), projectLibraryId, id, now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_REGULATION.getValue()); + } + //认证工程师id + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerId())) { + projectLawsInventoryEOTemp.setHomologationEngineerId(projectLawsInventoryEO.getHomologationEngineerId()); + setProjectLawsInventoryPermission(projectLawsInventoryEO.getHomologationEngineerId(), projectLibraryId, id, now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_HOMOLOGATION.getValue()); + } + //工程接口人id + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())) { + projectLawsInventoryEOTemp.setEngineeringInterfacePerson(projectLawsInventoryEO.getEngineeringInterfacePerson()); + setProjectLawsInventoryPermission(projectLawsInventoryEO.getEngineeringInterfacePerson(), projectLibraryId, id, now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_INTERFACE.getValue()); + } + //设计符合性流程发起人id + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getDesignInitiatorId())) { + projectLawsInventoryEOTemp.setDesignInitiatorId(projectLawsInventoryEO.getDesignInitiatorId()); + setProjectLawsInventoryPermission(projectLawsInventoryEO.getDesignInitiatorId(), projectLibraryId, id, now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_DESIGN_INITIATOR.getValue()); + } + //设计符合性流程责任人id + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getDesignDutyId())) { + projectLawsInventoryEOTemp.setDesignDutyId(projectLawsInventoryEO.getDesignDutyId()); + setProjectLawsInventoryPermission(projectLawsInventoryEO.getDesignDutyId(), projectLibraryId, id, now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_DESIGN_DUTY.getValue()); + } + //Pre-homo确认流程发起人id + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getPrehomoInitiatorId())) { + projectLawsInventoryEOTemp.setPrehomoInitiatorId(projectLawsInventoryEO.getPrehomoInitiatorId()); + setProjectLawsInventoryPermission(projectLawsInventoryEO.getPrehomoInitiatorId(), projectLibraryId, id, now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_PREHOMO_INITIATOR.getValue()); + } + //Pre-homo确认责任人id + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getPrehomoDutyId())) { + projectLawsInventoryEOTemp.setPrehomoDutyId(projectLawsInventoryEO.getPrehomoDutyId()); + setProjectLawsInventoryPermission(projectLawsInventoryEO.getPrehomoDutyId(), projectLibraryId, id, now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_PREHOMO_DUTY.getValue()); + } + //验证符合性流程发起人id + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getVerifyInitiatorId())) { + projectLawsInventoryEOTemp.setVerifyInitiatorId(projectLawsInventoryEO.getVerifyInitiatorId()); + setProjectLawsInventoryPermission(projectLawsInventoryEO.getVerifyInitiatorId(), projectLibraryId, id, now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_VERIFY_INITIATOR.getValue()); + } + //验证符合性流程责任人id + if (StringUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDutyId())) { + projectLawsInventoryEOTemp.setVerifyDutyId(projectLawsInventoryEO.getVerifyDutyId()); + setProjectLawsInventoryPermission(projectLawsInventoryEO.getVerifyDutyId(), projectLibraryId, id, now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_VERIFY_DUTY.getValue()); + } + projectLawsInventoryEOList.add(projectLawsInventoryEOTemp); + } + if (ObjectUtils.isNotEmpty(adds)) { + projectUserPermissionService.saveBatch(adds); + } + + projectLawsInventoryEOService.updateBatchById(projectLawsInventoryEOList); + + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + + + String desdutyId = projectLawsInventoryEO.getDesignDutyId(); + String verdutyId = projectLawsInventoryEO.getVerifyDutyId(); + + List dutyTerritoryList = new ArrayList<>(); + //获取批量设置中责任领域 + String dutyTerritory = projectLawsInventoryEO.getDutyTerritory(); + if (StringUtils.isNotEmpty(dutyTerritory)) { + for (ProjectLawsInventoryEO info : infoList) { + info.setDutyTerritory(dutyTerritory); + } + dutyTerritoryList = Arrays.asList(dutyTerritory.split(",")); + } else { + for (ProjectLawsInventoryEO info : infoList) { + if (StringUtils.isNotEmpty(info.getDutyTerritory())) { + dutyTerritoryList.addAll(Arrays.asList(info.getDutyTerritory().split(","))); + } + } + } + + dutyTerritoryList = dutyTerritoryList.stream().distinct().collect(Collectors.toList()); + + if (StringUtils.isNotEmpty(desdutyId)) { + for (ProjectLawsInventoryEO info : infoList) { + info.setDesignDutyId(desdutyId); + } + } + if (StringUtils.isNotEmpty(verdutyId)) { + for (ProjectLawsInventoryEO info : infoList) { + info.setVerifyDutyId(verdutyId); + } + } + +// 获取当前的projectLibrartId + String projectLibrartId = infoList.get(0).getProjectLibraryId(); + String cut = projectLawsInventoryEO.getCut(); + Map params = new HashMap<>(); + params.put("projectLibraryId", projectLibrartId); + params.put("userId", currentUser.getId()); + params.put("modelType", RoleRelModelTypeEnum.LAWS_INVENTORY.getValue()); + ProjectLibraryRoleRelEO projectLibraryRoleRelEO = projectLibraryRoleRelEOService.queryByProjectLibraryIdAndUserId(params); + + //获取当前项目库id的studio工程师和认证工程师 + List studionList = new ArrayList<>(); + List certificationEngineerList = new ArrayList<>(); + List projectLibraryBases = projectLibraryBaseService.queryById(projectLibrartId, cut); + + String roleCode1 = projectLibraryRoleRelEO.getRoleCode(); + if (CollectionUtils.isNotEmpty(dutyTerritoryList)) { + //获取相关责任领域下的和projectLibrartId的相关人员名单的信息 + List projectRelatedPersonnelList = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritoy(projectLibrartId, dutyTerritoryList); + if (CollectionUtils.isNotEmpty(projectRelatedPersonnelList)) { + List updatePrpEoList = new ArrayList<>(); + + for (ProjectLawsInventoryEO projectLawsInventoryEO1 : infoList) { + + //分别获取当前编辑中的设计符合性和认证符合性责任人 + List designDutyIdList = new ArrayList<>(); + if (StringUtils.isNotEmpty(projectLawsInventoryEO1.getDesignDutyId())) { + designDutyIdList = Arrays.asList(projectLawsInventoryEO1.getDesignDutyId().split(",")); + } + + List verifyDutyIdList = new ArrayList<>(); + if (StringUtils.isNotEmpty(projectLawsInventoryEO1.getVerifyDutyId())) { + verifyDutyIdList = Arrays.asList(projectLawsInventoryEO1.getVerifyDutyId().split(",")); + } + + //allDutyList 为法规工程师中验证符合性和确认符合中的责任人 + List allDutyList = new ArrayList<>(); + allDutyList.addAll(designDutyIdList); + allDutyList.addAll(verifyDutyIdList); + allDutyList = allDutyList.stream().distinct().collect(Collectors.toList()); + + List allList = new ArrayList<>(); + List enginnerList = new ArrayList<>(); + List lawEnginnerList = new ArrayList<>(); + List enginnerLawSetList = new ArrayList<>(); + List enginnerAttSetList = new ArrayList<>(); + + for (ProjectRelatedPersonnel relatedPersonnel : projectRelatedPersonnelList) { + // 工程接口人 + String enginneringInterfacePerson = relatedPersonnel.getEngineeringInterfacePerson(); + if (!StringUtils.isEmpty(enginneringInterfacePerson)) { + enginnerList = Arrays.stream(enginneringInterfacePerson.split(",")).collect(Collectors.toList()); + allList.addAll(enginnerList); + } + + // 法规工程师 + String lawEngineer = relatedPersonnel.getLawEngineer(); + if (!StringUtils.isEmpty(lawEngineer)) { + lawEnginnerList = Arrays.stream(lawEngineer.split(",")).collect(Collectors.toList()); + allList.addAll(lawEnginnerList); + } + + // 工程接口-法规工程师设置 + String engineerLawSet = relatedPersonnel.getEngineerLawSet(); + if (!StringUtils.isEmpty(engineerLawSet)) { + enginnerLawSetList = Arrays.stream(engineerLawSet.split(",")).collect(Collectors.toList()); + allList.addAll(enginnerLawSetList); + } + + // 工程接口-认证工程师设置 + String engineerAttSet = relatedPersonnel.getEngineerAttSet(); + if (!StringUtils.isEmpty(engineerAttSet)) { + enginnerAttSetList = Arrays.stream(engineerAttSet.split(",")).collect(Collectors.toList()); + allList.addAll(enginnerAttSetList); + } + } + + for (ProjectLibraryBase projectLibraryBase : projectLibraryBases) { + studionList.add(projectLibraryBase.getStudioEngineer()); + + String certificationEngineer = projectLibraryBase.getCertificationEngineer(); + if (!StringUtils.isEmpty(certificationEngineer)) { + certificationEngineerList = Arrays.stream(certificationEngineer.split(",")).collect(Collectors.toList()); + allList.addAll(certificationEngineerList); + } + } + allList = allList.stream().filter(all -> { + return StringUtils.isNotBlank(all); + }).distinct().collect(Collectors.toList()); + //遍历所有人alllist中是否包含责任人,如果包含,不用操作。 + //-------如果不包含,再去判断当前用户的角色是studio、法规还是认证 + for (ProjectRelatedPersonnel relatedPersonnel : projectRelatedPersonnelList) { + if (allList.size() > 0) { + for (String allDuty : allDutyList) { + String dutyPerson = allDuty; + if (StringUtils.isNotEmpty(dutyPerson) && !allList.contains(dutyPerson) && StringUtils.isNotEmpty(roleCode1)) { + if (roleCode1.equals(com.jero.modules.project.enums.ProjectRoleEnum.STUDIO_ENGINEER.getValue())) { + if (relatedPersonnel.getEngineeringInterfacePerson() != null) { + String engineeringInterfacePerson = dutyPerson + "," + relatedPersonnel.getEngineeringInterfacePerson(); + relatedPersonnel.setEngineeringInterfacePerson(engineeringInterfacePerson); + } else { + relatedPersonnel.setEngineeringInterfacePerson(dutyPerson); + } + } else if (roleCode1.equals(com.jero.modules.project.enums.ProjectRoleEnum.REGULATI_ENGINEER.getValue())) { + if (relatedPersonnel.getEngineerLawSet() != null) { + String engineerLawSet = dutyPerson + "," + relatedPersonnel.getEngineerLawSet(); + relatedPersonnel.setEngineerLawSet(engineerLawSet); + } else { + relatedPersonnel.setEngineerLawSet(dutyPerson); + } + } else if (roleCode1.equals(com.jero.modules.project.enums.ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue())) { + if (relatedPersonnel.getEngineerAttSet() != null) { + String engineerAttSet = dutyPerson + "," + relatedPersonnel.getEngineerAttSet(); + relatedPersonnel.setEngineerAttSet(engineerAttSet); + } else { + relatedPersonnel.setEngineerAttSet(dutyPerson); + } + } + } + } + } + } + + updatePrpEoList.addAll(projectRelatedPersonnelList); + } + this.projectRelatedPersonnelService.updateBatchById(updatePrpEoList); + } + } + projectLawsInventoryEOList.forEach(projectLawsInventory -> { + //更新三个符合性流程中的处理人。 + projectLawsInventoryEOService.updateFlowInfo(projectLawsInventory); + }); +// for (ProjectLawsInventoryEO lawsInventoryEO : projectLawsInventoryEOList) { +// LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); +// updateWrapper.in(ProjectLawsInventoryEO::getId,lawsInventoryEO.getId()); +// setDateNull(lawsInventoryEO, updateWrapper); +// //保存 +// this.update(lawsInventoryEO,updateWrapper); +// } + + //更新log + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + String username = sysUser.getUsername(); + String contentLog = username + "批量设置了: “"; + String enContentLog = username + " batch set : “"; + + List infoListCopy = DeepCopyListUtil.depCopy(infoList); + + translateData(infoList); + translateDataToEn(infoListCopy); + + //翻译传入的数据 + List inputList = new ArrayList<>(); + ProjectLawsInventoryEO projectLawsInventoryEONew = new ProjectLawsInventoryEO(); + BeanUtils.copyProperties(projectLawsInventoryEO, projectLawsInventoryEONew); + inputList.add(projectLawsInventoryEONew); + translateData(inputList); + ProjectLawsInventoryEO inputInfoEO = inputList.get(0); + + + for (String id : projectLawsInventoryEO.getIds().split(",")) { + List collect = infoList.stream().filter(e -> id.equals(e.getId())).collect(Collectors.toList()); + if (collect.size() != 0) { + ProjectLawsInventoryEO info = collect.get(0); + ProjectLawsInventoryEO infoCopy = infoListCopy.stream().filter(e -> id.equals(e.getId())).collect(Collectors.toList()).get(0); + StringBuilder contentLogBuilder = new StringBuilder(); + StringBuilder enContentLogBuilder = new StringBuilder(); + contentLogBuilder.append(info.getSerialNumber() + ":"); + enContentLogBuilder.append(infoCopy.getSerialNumber() + ":"); + ProjectLawsInventoryEO projectLawsInventoryEOTemp = new ProjectLawsInventoryEO(); + projectLawsInventoryEOTemp.setId(id); + //实施类别 implementType + if (StringUtils.isNotBlank(projectLawsInventoryEO.getImplementType())) { + if (!info.getImplementType().equals(inputInfoEO.getImplementType()) && !inputInfoEO.getImplementType().equals("空")) { + setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.IMPLEMENT_TYPE.getName(), info.getImplementType(), inputInfoEO.getImplementType()); + setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.IMPLEMENT_TYPE.getEnName(), infoCopy.getImplementType(), inputInfoEO.getImplementType()); + } + } + //认证类型 attestationType + if (StringUtils.isNotBlank(projectLawsInventoryEO.getAttestationType())) { + if (!info.getAttestationType().equals(inputInfoEO.getAttestationType()) && !inputInfoEO.getAttestationType().equals("空")) { + setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.ATTESTATION_TYPE.getName(), info.getAttestationType(), inputInfoEO.getAttestationType()); + setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.ATTESTATION_TYPE.getEnName(), infoCopy.getAttestationType(), inputInfoEO.getAttestationType()); + } + } + //认证级别 attestationRank + if (StringUtils.isNotBlank(projectLawsInventoryEO.getAttestationRank())) { + if (!info.getAttestationRank().equals(inputInfoEO.getAttestationRank()) && !inputInfoEO.getAttestationRank().equals("空")) { + setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.ATTESTATION_RANK.getName(), info.getAttestationRank(), inputInfoEO.getAttestationRank()); + setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.ATTESTATION_RANK.getEnName(), infoCopy.getAttestationRank(), inputInfoEO.getAttestationRank()); + } + } + //责任领域 dutyTerritory + if (StringUtils.isNotBlank(projectLawsInventoryEO.getDutyTerritory())) { + if (!info.getDutyTerritory().equals(inputInfoEO.getDutyTerritory())) { + setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.DUTY_TERRITORY.getName(), info.getDutyTerritory(), inputInfoEO.getDutyTerritory()); + setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.DUTY_TERRITORY.getEnName(), infoCopy.getDutyTerritory(), inputInfoEO.getDutyTerritory()); + } + } + //在产车实施日期implementTime + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getImplementTime())) { + if (info.getImplementTime() == null) { + setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.IMPLEMENT_TIME.getName(), "空", inputInfoEO.getImplementTimeString()); + setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.IMPLEMENT_TIME.getEnName(), "null", inputInfoEO.getImplementTimeString()); + } else { + if (!info.getImplementTimeString().equals(inputInfoEO.getImplementTimeString())) { + setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.IMPLEMENT_TIME.getName(), info.getImplementTimeString(), inputInfoEO.getImplementTimeString()); + setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.IMPLEMENT_TIME.getEnName(), infoCopy.getImplementTimeString(), inputInfoEO.getImplementTimeString()); + } + } + } + //新车型实施日期xin1Che1Xing2Shi2Shi1Ri4Qi1 + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1())) { + if (info.getXin1Che1Xing2Shi2Shi1Ri4Qi1() == null) { + setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.XIN1_CHE1_XING2_SHI2_SHI1_RI4_QI1.getName(), "空", inputInfoEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1String()); + setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.XIN1_CHE1_XING2_SHI2_SHI1_RI4_QI1.getEnName(), "null", inputInfoEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1String()); + } else { + if (!info.getXin1Che1Xing2Shi2Shi1Ri4Qi1String().equals(inputInfoEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1String())) { + setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.XIN1_CHE1_XING2_SHI2_SHI1_RI4_QI1.getName(), info.getXin1Che1Xing2Shi2Shi1Ri4Qi1String(), inputInfoEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1String()); + setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.XIN1_CHE1_XING2_SHI2_SHI1_RI4_QI1.getEnName(), infoCopy.getXin1Che1Xing2Shi2Shi1Ri4Qi1String(), inputInfoEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1String()); + } + } + } + //适用地区region + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getRegion())) { + if (!info.getRegion().equals(inputInfoEO.getRegion())) { + setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.REGION.getName(), info.getRegion(), inputInfoEO.getRegion()); + setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.REGION.getEnName(), infoCopy.getRegion(), inputInfoEO.getRegion()); + + } + } + //设计符合性确认截止时间 + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getDesignDueDate())) { + if (info.getDesignDueDate() == null) { + setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getName(), "空", inputInfoEO.getDesignDueDateString()); + setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getEnName(), "null", inputInfoEO.getDesignDueDateString()); + } else { + if (!info.getDesignDueDateString().equals(inputInfoEO.getDesignDueDateString())) { + setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getName(), info.getDesignDueDateString(), inputInfoEO.getDesignDueDateString()); + setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getEnName(), infoCopy.getDesignDueDateString(), inputInfoEO.getDesignDueDateString()); + } + } + } + //preHomo确认截止时间 + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getPrehomoDueDate())) { + if (info.getVerifyDueDate() == null) { + setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.PREHOMO_DUE_DATE.getName(), "空", inputInfoEO.getPrehomoDueDateString()); + setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.PREHOMO_DUE_DATE.getEnName(), "null", inputInfoEO.getPrehomoDueDateString()); + } else { + if (!info.getPrehomoDueDateString().equals(inputInfoEO.getPrehomoDueDateString())) { + setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.PREHOMO_DUE_DATE.getName(), info.getPrehomoDueDateString(), inputInfoEO.getPrehomoDueDateString()); + setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.PREHOMO_DUE_DATE.getEnName(), infoCopy.getPrehomoDueDateString(), inputInfoEO.getPrehomoDueDateString()); + } + } + } + //验证符合性确认截止时间 + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDueDate())) { + if (info.getVerifyDueDate() == null) { + setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.VERIFY_DUE_DATE.getName(), "空", inputInfoEO.getVerifyDueDateString()); + setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.VERIFY_DUE_DATE.getEnName(), "null", inputInfoEO.getVerifyDueDateString()); + } else { + if (!info.getVerifyDueDateString().equals(inputInfoEO.getVerifyDueDateString())) { + setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.VERIFY_DUE_DATE.getName(), info.getVerifyDueDateString(), inputInfoEO.getVerifyDueDateString()); + setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.VERIFY_DUE_DATE.getEnName(), infoCopy.getVerifyDueDateString(), inputInfoEO.getVerifyDueDateString()); + } + } + } + //处理具体变动消息为空的contentLog + String contentInfoIndexStart = contentLogBuilder.substring(0, contentLogBuilder.lastIndexOf(":")); + String contentInfo = contentLogBuilder.substring(contentInfoIndexStart.length() + 1, contentLogBuilder.length()); + + String enContentInfoIndexStart = enContentLogBuilder.substring(0, enContentLogBuilder.lastIndexOf(":")); + String enContentInfo = enContentLogBuilder.substring(enContentInfoIndexStart.length() + 1, enContentLogBuilder.length()); + + if (StringUtils.isNotBlank(contentInfo) && StringUtils.isNotBlank(enContentInfo)) { + contentLog += contentLogBuilder; + enContentLog += enContentLogBuilder; + } + } + + } + String contentIndexStart = contentLog.substring(0, contentLog.indexOf("“")); + String content = contentLog.substring(contentIndexStart.length() + 1, contentLog.length()); + + String enContentIndexStart = enContentLog.substring(0, enContentLog.indexOf("“")); + String enContent = enContentLog.substring(enContentIndexStart.length() + 1, enContentLog.length()); + + if (StringUtils.isNotBlank(content)) { + contentLog = contentLog.substring(0, contentLog.length() - 5) + "”"; + projectLawsInventoryLogEOService.updateLog(contentLog, projectLibraryId, CutEnum.CN.getValue()); + } + + if (StringUtils.isNotBlank(enContent)) { + enContentLog = enContentLog.substring(0, enContentLog.length() - 5) + "”"; + projectLawsInventoryLogEOService.updateLog(enContentLog, projectLibraryId, CutEnum.EN.getValue()); + } + } + } + + /** + * 更新 + * + * @param projectLawsInventoryEO + * @return + */ + public void editById(ProjectLawsInventoryEO projectLawsInventoryEO) { + Date now = new Date(); + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + boolean checkResult = checkData(projectLawsInventoryEO.getProjectLibraryId(), currentUser.getId(), projectLawsInventoryEO.getId()); + if (checkResult) { + QueryWrapper oldPliQueryWrap = new QueryWrapper<>(); + oldPliQueryWrap.lambda().eq(ProjectLawsInventoryEO::getId, projectLawsInventoryEO.getId()); + List oldPliEoList = projectLawsInventoryEOService.list(oldPliQueryWrap); + + this.updateProjectLawsInventorySendMessage(projectLawsInventoryEO); + + // 根据法规清单id,获取该法规清单在待办中心的任务明细。 + List oldPliEoIdList = oldPliEoList.stream().map(ProjectLawsInventoryEO::getId).distinct().collect(Collectors.toList()); + QueryWrapper pidEoQueryWrap = new QueryWrapper<>(); + pidEoQueryWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId, oldPliEoIdList); + List pidEoList = this.processInfoDetailEOService.list(pidEoQueryWrap); + if (CollectionUtils.isNotEmpty(pidEoList)) { + // 处理编辑法规工程师的逻辑 + this.updateRegulationOwner(projectLawsInventoryEO, oldPliEoList, pidEoList); + // 处理编辑责任人的逻辑 + this.updateDutyPerson(projectLawsInventoryEO, oldPliEoList, pidEoList); + } + // 处理修改设计或验证符合性截止日期的逻辑 + this.updateDesignOrVerifyEndTime(projectLawsInventoryEO, oldPliEoList); + + projectLawsInventoryEO.setUpdateTime(now); + ProjectLawsInventoryEO projectLawsInventoryEOCopy = SerializationUtils.clone(projectLawsInventoryEO);//复制 + + //更新log + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + String username = sysUser.getUsername(); + + String contentLog = username + "编辑了清单中的“" + projectLawsInventoryEO.getSerialNumber() + "”:
"; + String enContentLog = username + " edited the “" + projectLawsInventoryEO.getSerialNumber() + "” in the list:
"; + + List infoEOList = new ArrayList<>(); + infoEOList.add(projectLawsInventoryEO); + List infoEOListCopy = new ArrayList<>(); + infoEOListCopy.add(projectLawsInventoryEOCopy); + + //查询数据库里原来的数据 + QueryWrapper queryWrapper = new QueryWrapper<>(); + List dataList = projectLawsInventoryEOService.list(queryWrapper.eq("id", projectLawsInventoryEO.getId())); + List dataListCopy = DeepCopyListUtil.depCopy(dataList); + LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); + updateWrapper.in(ProjectLawsInventoryEO::getId, projectLawsInventoryEO.getId()); + setDateNull(projectLawsInventoryEO, updateWrapper); + //保存 + projectLawsInventoryEOService.update(projectLawsInventoryEO, updateWrapper); +// saveOrUpdate(projectLawsInventoryEO); + + //获取编辑中的责任领域 + List dutyTerritoryList = new ArrayList<>(); + dutyTerritoryList = Arrays.asList(projectLawsInventoryEO.getDutyTerritory().split(",")); + dutyTerritoryList = dutyTerritoryList.stream().distinct().collect(Collectors.toList()); + //获取当前的projectLibrartId + String projectLibrartId = projectLawsInventoryEO.getProjectLibraryId(); + String cut = projectLawsInventoryEO.getCut(); + + Map params = new HashMap<>(); + params.put("projectLibraryId", projectLibrartId); + params.put("userId", currentUser.getId()); + params.put("modelType", RoleRelModelTypeEnum.LAWS_INVENTORY.getValue()); + ProjectLibraryRoleRelEO projectLibraryRoleRelEO = projectLibraryRoleRelEOService.queryByProjectLibraryIdAndUserId(params); + String roleCode1 = projectLibraryRoleRelEO.getRoleCode(); + //分别获取当前编辑中的设计符合性和认证符合性责任人 + List designDutyIdList = new ArrayList<>(); + designDutyIdList = Arrays.asList(projectLawsInventoryEO.getDesignDutyId().split(",")); + List verifyDutyIdList = new ArrayList<>(); + verifyDutyIdList = Arrays.asList(projectLawsInventoryEO.getVerifyDutyId().split(",")); + + //allDutyList 为法规工程师中验证符合性和确认符合中的责任人 + List allDutyList = new ArrayList<>(); + allDutyList.addAll(designDutyIdList); + allDutyList.addAll(verifyDutyIdList); + allDutyList = allDutyList.stream().distinct().collect(Collectors.toList()); + + //获取相关责任领域下的和projectLibrartId的相关人员名单的信息 + List projectRelatedPersonnelList = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritoy(projectLibrartId, dutyTerritoryList); + + List allList = new ArrayList<>(); + List enginnerList = new ArrayList<>(); + List lawEnginnerList = new ArrayList<>(); + List enginnerLawSetList = new ArrayList<>(); + List enginnerAttSetList = new ArrayList<>(); + //根据相关人员名单获取的工程接口人 + for (ProjectRelatedPersonnel relatedPersonnel : projectRelatedPersonnelList) { + String enginneringInterfacePerson = relatedPersonnel.getEngineeringInterfacePerson(); + if (!StringUtils.isEmpty(enginneringInterfacePerson)) { + enginnerList = Arrays.stream(enginneringInterfacePerson.split(",")).collect(Collectors.toList()); + allList.addAll(enginnerList); + } + } + //获取相关人员名单中的法规工程师 + for (ProjectRelatedPersonnel relatedPersonnel : projectRelatedPersonnelList) { + String lawEngineer = relatedPersonnel.getLawEngineer(); + if (!StringUtils.isEmpty(lawEngineer)) { + lawEnginnerList = Arrays.stream(lawEngineer.split(",")).collect(Collectors.toList()); + allList.addAll(lawEnginnerList); + } + } + //获取相关人员名单中的工程接口-法规工程师设置 + for (ProjectRelatedPersonnel relatedPersonnel : projectRelatedPersonnelList) { + String engineerLawSet = relatedPersonnel.getEngineerLawSet(); + if (!StringUtils.isEmpty(engineerLawSet)) { + enginnerLawSetList = Arrays.stream(engineerLawSet.split(",")).collect(Collectors.toList()); + allList.addAll(enginnerLawSetList); + } + } + //获取相关人员名单中的工程接口-认证工程师设置 + for (ProjectRelatedPersonnel relatedPersonnel : projectRelatedPersonnelList) { + String engineerAttSet = relatedPersonnel.getEngineerAttSet(); + if (!StringUtils.isEmpty(engineerAttSet)) { + enginnerAttSetList = Arrays.stream(engineerAttSet.split(",")).collect(Collectors.toList()); + allList.addAll(enginnerAttSetList); + } + } + //获取当前项目库id的studio工程师和认证工程师 + List studionList = new ArrayList<>(); + List certificationEngineerList = new ArrayList<>(); + List projectLibraryBases = projectLibraryBaseService.queryById(projectLibrartId, cut); + for (ProjectLibraryBase projectLibraryBase : projectLibraryBases) { + studionList.add(projectLibraryBase.getStudioEngineer()); + + String certificationEngineer = projectLibraryBase.getCertificationEngineer(); + if (!StringUtils.isEmpty(certificationEngineer)) { + certificationEngineerList = Arrays.stream(certificationEngineer.split(",")).collect(Collectors.toList()); + allList.addAll(certificationEngineerList); + } + } + allList = allList.stream().filter(all -> { + return StringUtils.isNotBlank(all); + }).distinct().collect(Collectors.toList()); + /* + for(String all : allList){ + if(all.equals("")){ + allList.remove(all); + } + } + */ + //遍历所有人alllist中是否包含责任人,如果包含,不用操作。 + //-------如果不包含,再去判断当前用户的角色是studio、法规还是认证 + for (ProjectRelatedPersonnel relatedPersonnel : projectRelatedPersonnelList) { + if (allList.size() > 0) { + for (String allDuty : allDutyList) { + String dutyPerson = allDuty; + if (StringUtils.isNotEmpty(dutyPerson) && !allList.contains(dutyPerson) && StringUtils.isNotEmpty(roleCode1)) { + if (roleCode1.equals(com.jero.modules.project.enums.ProjectRoleEnum.STUDIO_ENGINEER.getValue())) { + if (relatedPersonnel.getEngineeringInterfacePerson() != null) { + String engineeringInterfacePerson = dutyPerson + "," + relatedPersonnel.getEngineeringInterfacePerson(); + relatedPersonnel.setEngineeringInterfacePerson(engineeringInterfacePerson); + } else { + relatedPersonnel.setEngineeringInterfacePerson(dutyPerson); + } + } else if (roleCode1.equals(com.jero.modules.project.enums.ProjectRoleEnum.REGULATI_ENGINEER.getValue())) { + if (relatedPersonnel.getEngineerLawSet() != null) { + String engineerLawSet = dutyPerson + "," + relatedPersonnel.getEngineerLawSet(); + relatedPersonnel.setEngineerLawSet(engineerLawSet); + } else { + relatedPersonnel.setEngineerLawSet(dutyPerson); + } + } else if (roleCode1.equals(com.jero.modules.project.enums.ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue())) { + if (relatedPersonnel.getEngineerAttSet() != null) { + String engineerAttSet = dutyPerson + "," + relatedPersonnel.getEngineerAttSet(); + relatedPersonnel.setEngineerAttSet(engineerAttSet); + } else { + relatedPersonnel.setEngineerAttSet(dutyPerson); + } + } + } + } + } + } + this.projectRelatedPersonnelService.updateBatchById(projectRelatedPersonnelList); + + + //翻译-中文 + translateData(infoEOList); + translateData(dataList); + //翻译-英文 + translateDataToEn(infoEOListCopy); + translateDataToEn(dataListCopy); + + //比对不同字段 + Map infoDiff = ListDiff.compareObject(dataList.get(0), projectLawsInventoryEO); + Map infoDiffEn = ListDiff.compareObject(dataListCopy.get(0), projectLawsInventoryEOCopy); + + //设置更新log + setContentLog(infoDiff, contentLog, infoDiffEn, enContentLog, projectLawsInventoryEO.getProjectLibraryId()); + + + //验证用户是否是该法规上级 项目库的studio, 如果是,则同步更新流程 + int roleCode = projectLawsInventoryEOService.checkUserRole(projectLawsInventoryEO.getProjectLibraryId(), currentUser.getId(), ""); + if (StringUtils.equals(String.valueOf(roleCode), ProjectRoleEnum.STUDIO_ENGINEER.getValue())) { + //更新流程信息 + projectLawsInventoryEOService.updateFlowInfo(projectLawsInventoryEO); + } + + //设置权限 先删后加 + List adds = new ArrayList<>(); + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId())) { + setProjectLawsInventoryPermission(projectLawsInventoryEO.getRegulationOwnerId(), projectLawsInventoryEO.getProjectLibraryId(), projectLawsInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_REGULATION.getValue()); + } + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerId())) { + setProjectLawsInventoryPermission(projectLawsInventoryEO.getHomologationEngineerId(), projectLawsInventoryEO.getProjectLibraryId(), projectLawsInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_HOMOLOGATION.getValue()); + } + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())) { + setProjectLawsInventoryPermission(projectLawsInventoryEO.getEngineeringInterfacePerson(), projectLawsInventoryEO.getProjectLibraryId(), projectLawsInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_INTERFACE.getValue()); + } + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getDesignInitiatorId())) { + setProjectLawsInventoryPermission(projectLawsInventoryEO.getDesignInitiatorId(), projectLawsInventoryEO.getProjectLibraryId(), projectLawsInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_DESIGN_INITIATOR.getValue()); + } + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getDesignDutyId())) { + setProjectLawsInventoryPermission(projectLawsInventoryEO.getDesignDutyId(), projectLawsInventoryEO.getProjectLibraryId(), projectLawsInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_DESIGN_DUTY.getValue()); + } + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getPrehomoInitiatorId())) { + setProjectLawsInventoryPermission(projectLawsInventoryEO.getPrehomoInitiatorId(), projectLawsInventoryEO.getProjectLibraryId(), projectLawsInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_PREHOMO_INITIATOR.getValue()); + } + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getPrehomoDutyId())) { + setProjectLawsInventoryPermission(projectLawsInventoryEO.getPrehomoDutyId(), projectLawsInventoryEO.getProjectLibraryId(), projectLawsInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_PREHOMO_DUTY.getValue()); + } + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getVerifyInitiatorId())) { + setProjectLawsInventoryPermission(projectLawsInventoryEO.getVerifyInitiatorId(), projectLawsInventoryEO.getProjectLibraryId(), projectLawsInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_VERIFY_INITIATOR.getValue()); + } + if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDutyId())) { + setProjectLawsInventoryPermission(projectLawsInventoryEO.getVerifyDutyId(), projectLawsInventoryEO.getProjectLibraryId(), projectLawsInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_VERIFY_DUTY.getValue()); + } + if (ObjectUtils.isNotEmpty(adds)) { + projectUserPermissionService.saveBatch(adds); + } + + + } else { + throw new JeroBootException("该用户没有权限操作该数据!"); + } + } + + /** + * 发送消息 + * + * @param userIdList 收消息的人 + * @param initiatorId 发起人 + * @param projectLawsInventoryEO 当前法规清单 + * @param contentCn 消息内容(中文) + * @param contentEn 消息内容(英文) + * @param flowTypeEnum 流程类型 + * @param templateEnum 消息模版 + * @param isTodoCenter 是否是链接到待办中心(false:拼接跳转到任务详情的链接) + */ + private void sendMessage(String userIdList, String initiatorId, ProjectLawsInventoryEO projectLawsInventoryEO, ProjectLibraryBase projectLibraryBase, + String contentCn, String contentEn, ProjectMessageEnum flowTypeEnum, TemplateInfoEnum2 templateEnum, boolean isTodoCenter) { + String endTime = ""; + if (projectLawsInventoryEO.getInventoryAffirmDueDate() != null) { + endTime = DateUtils.formatDate(projectLawsInventoryEO.getInventoryAffirmDueDate()); + } + Map params = new HashMap<>(); + params.put("contentCn", contentCn); + params.put("contentEn", contentEn); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime", endTime); + params.put("userIdList", userIdList); + params.put("serialNumbers", projectLawsInventoryEO.getSerialNumber()); + + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取待办中心 - 飞书跳转链接 + Map todoCenterParams = new HashMap<>(); + todoCenterParams.put("projectNameCn", PRN_CN); + todoCenterParams.put("projectNameEn", PRN_EN); + Map hrefFeishuMap = projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLawsInventoryEO.getId(), todoCenterParams); + params.put("hrefFeishu_CN", hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN", hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); + + if (StringUtils.isNotEmpty(initiatorId)) { + SysUser initiatorUser = this.sysUserService.getUserById(initiatorId); + params.put("Initiator", initiatorUser.getUsername()); + } + + params.put("flowTypeCn", flowTypeEnum.getCnName()); + params.put("flowTypeEn", flowTypeEnum.getEnName()); + if (!isTodoCenter) { + //处理手机端飞书消息跳转 + if (flowTypeEnum.equals(ProjectMessageEnum.SJFHXLC)) { + params.put("hrefFeishu_CN_P", this.handlePhoneDesignLink(projectLawsInventoryEO)); + } + if (flowTypeEnum.equals(ProjectMessageEnum.YZFHXLC)) { + params.put("hrefFeishu_CN_P", this.handlePhoneVerifyLink(projectLawsInventoryEO)); + } + } + projectLawsInventoryEOService.sendMessageByTemplateId(templateEnum.getValue(), params); + } + + /** + * 编辑法规清单,发送消息 + * + * @param projectLawsInventoryEO + */ + private void updateProjectLawsInventorySendMessage(ProjectLawsInventoryEO projectLawsInventoryEO) { + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); + if (ObjectUtils.isNotEmpty(projectLibraryBase)) { + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + //修改之前的法规数据 + ProjectLawsInventoryEO projectLawsInventoryOld = projectLawsInventoryEOService.queryById(projectLawsInventoryEO.getId()); + String contentCn = "您好," + currentUser.getUsername() + "向您分发了该任务,请及时查看处理。"; + String contentEn = "Hello! " + currentUser.getUsername() + " has assigned this task to you. Please check and address it in a timely manner."; + // 如果编辑了法规工程师 + if (StringUtils.isNotEmpty(projectLawsInventoryOld.getRegulationOwnerId()) + && StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId()) + && !StringUtils.equals(projectLawsInventoryOld.getRegulationOwnerId(), projectLawsInventoryEO.getRegulationOwnerId())) { + if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())) { + //发给旧法规工程师 + sendMessage(projectLawsInventoryOld.getRegulationOwnerId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, ProjectMessageEnum.RWBFQRCH.getCnName(), ProjectMessageEnum.RWBFQRCH.getEnName(), ProjectMessageEnum.SJFHXLC, TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4, false); + //发给新法规工程师 + sendMessage(projectLawsInventoryEO.getRegulationOwnerId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, contentCn, contentEn, ProjectMessageEnum.SJFHXLC, TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4, true); + } else if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue())) { + //发给旧法规工程师 + sendMessage(projectLawsInventoryOld.getRegulationOwnerId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, ProjectMessageEnum.RWBFQRCH.getCnName(), ProjectMessageEnum.RWBFQRCH.getEnName(), ProjectMessageEnum.SJFHXLC, TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1, false); + //发给新法规工程师 + sendMessage(projectLawsInventoryEO.getRegulationOwnerId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, contentCn, contentEn, ProjectMessageEnum.SJFHXLC, TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1, true); + } + if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())) { + //发给旧法规工程师 + sendMessage(projectLawsInventoryOld.getRegulationOwnerId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, ProjectMessageEnum.RWBFQRCH.getCnName(), ProjectMessageEnum.RWBFQRCH.getEnName(), ProjectMessageEnum.SJFHXLC, TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4, false); + //发给新法规工程师 + sendMessage(projectLawsInventoryEO.getRegulationOwnerId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, contentCn, contentEn, ProjectMessageEnum.SJFHXLC, TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4, true); + } else if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue())) { + //发给旧法规工程师 + sendMessage(projectLawsInventoryOld.getRegulationOwnerId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, ProjectMessageEnum.RWBFQRCH.getCnName(), ProjectMessageEnum.RWBFQRCH.getEnName(), ProjectMessageEnum.YZFHXLC, TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1, false); + //发给新法规工程师 + sendMessage(projectLawsInventoryEO.getRegulationOwnerId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, contentCn, contentEn, ProjectMessageEnum.YZFHXLC, TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1, true); + } + } + // 如果编辑了设计符合性截止时间 + if (projectLawsInventoryOld.getDesignDueDate() != null && projectLawsInventoryEO.getDesignDueDate() != null && !projectLawsInventoryOld.getDesignDueDate().equals(projectLawsInventoryEO.getDesignDueDate())) { + if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())) { + if(projectLibraryBase.getStudioEngineer().equals(currentUser.getId())){ + //studio改的发给法规工程师 + sendMessage(projectLawsInventoryEO.getRegulationOwnerId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, ProjectMessageEnum.RWJZSJBXG.getCnName(), ProjectMessageEnum.RWJZSJBXG.getEnName(), ProjectMessageEnum.SJFHXLC, TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4, true); + } + }else if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue())) { + if(projectLibraryBase.getStudioEngineer().equals(currentUser.getId())){ + //studio改的发给法规工程师 + sendMessage(projectLawsInventoryEO.getRegulationOwnerId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, ProjectMessageEnum.RWJZSJBXG.getCnName(), ProjectMessageEnum.RWJZSJBXG.getEnName(), ProjectMessageEnum.SJFHXLC, TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1, true); + } + //谁改的都得发给责任人 + sendMessage(projectLawsInventoryEO.getDesignDutyId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, ProjectMessageEnum.RWJZSJBXG.getCnName(), ProjectMessageEnum.RWJZSJBXG.getEnName(), ProjectMessageEnum.SJFHXLC, TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1, false); + } + } + // 如果编辑了验证符合性截止时间 + if ((projectLawsInventoryOld.getVerifyDueDate() != null && projectLawsInventoryEO.getVerifyDueDate() != null) && !projectLawsInventoryOld.getVerifyDueDate().equals(projectLawsInventoryEO.getVerifyDueDate())) { + if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())) { + if(projectLibraryBase.getStudioEngineer().equals(currentUser.getId())){ + //studio改的发给法规工程师 + sendMessage(projectLawsInventoryEO.getRegulationOwnerId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, ProjectMessageEnum.RWJZSJBXG.getCnName(), ProjectMessageEnum.RWJZSJBXG.getEnName(), ProjectMessageEnum.YZFHXLC, TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4, true); + } + }else if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue())) { + if(projectLibraryBase.getStudioEngineer().equals(currentUser.getId())){ + //studio改的发给法规工程师 + sendMessage(projectLawsInventoryEO.getRegulationOwnerId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, ProjectMessageEnum.RWJZSJBXG.getCnName(), ProjectMessageEnum.RWJZSJBXG.getEnName(), ProjectMessageEnum.YZFHXLC, TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1, true); + } + //谁改的都得发给责任人 + sendMessage(projectLawsInventoryEO.getVerifyDutyId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, ProjectMessageEnum.RWJZSJBXG.getCnName(), ProjectMessageEnum.RWJZSJBXG.getEnName(), ProjectMessageEnum.YZFHXLC, TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1, false); + } + } + + // 如果编辑了设计符合性责任人 + if (projectLawsInventoryOld.getDesignDutyId() != null && projectLawsInventoryEO.getDesignDutyId() != null && !projectLawsInventoryOld.getDesignDutyId().equals(projectLawsInventoryEO.getDesignDutyId())) { + if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())) { + //发给旧的责任人 + sendMessage(projectLawsInventoryOld.getDesignDutyId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, ProjectMessageEnum.RWBFQRCH.getCnName(), ProjectMessageEnum.RWBFQRCH.getEnName(), ProjectMessageEnum.SJFHXLC, TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4, true); + //发给新的责任人 + sendMessage(projectLawsInventoryEO.getDesignDutyId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, contentCn, contentEn, ProjectMessageEnum.SJFHXLC, TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4, false); + }else if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue())) { + //发给旧的责任人 + sendMessage(projectLawsInventoryOld.getDesignDutyId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, ProjectMessageEnum.RWBFQRCH.getCnName(), ProjectMessageEnum.RWBFQRCH.getEnName(), ProjectMessageEnum.SJFHXLC, TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1, true); + //发给新的责任人 + sendMessage(projectLawsInventoryEO.getDesignDutyId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, contentCn, contentEn, ProjectMessageEnum.SJFHXLC, TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1, false); + } + } + // 如果编辑了验证符合性责任人 + if (projectLawsInventoryOld.getVerifyDutyId() != null && projectLawsInventoryEO.getVerifyDutyId() != null && !projectLawsInventoryOld.getVerifyDutyId().equals(projectLawsInventoryEO.getVerifyDutyId())) { + if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue())) { + //发给旧的责任人 + sendMessage(projectLawsInventoryOld.getVerifyDutyId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, ProjectMessageEnum.RWBFQRCH.getCnName(), ProjectMessageEnum.RWBFQRCH.getEnName(), ProjectMessageEnum.YZFHXLC, TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4, true); + //发给新的责任人 + sendMessage(projectLawsInventoryEO.getVerifyDutyId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, contentCn, contentEn, ProjectMessageEnum.YZFHXLC, TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4, false); + }else if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue())) { + //发给旧的责任人 + sendMessage(projectLawsInventoryOld.getVerifyDutyId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, ProjectMessageEnum.RWBFQRCH.getCnName(), ProjectMessageEnum.RWBFQRCH.getEnName(), ProjectMessageEnum.YZFHXLC, TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1, true); + //发给新的责任人 + sendMessage(projectLawsInventoryEO.getVerifyDutyId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, contentCn, contentEn, ProjectMessageEnum.YZFHXLC, TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1, false); + } + } + + // 如果编辑了设计符合性交付物类型 + if (projectLawsInventoryOld.getDesignDeliverableType() != null && projectLawsInventoryEO.getDesignDeliverableType() != null && !projectLawsInventoryOld.getDesignDeliverableType().equals(projectLawsInventoryEO.getDesignDeliverableType())) { + if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue())) { + //发给责任人 + sendMessage(projectLawsInventoryEO.getDesignDutyId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, ProjectMessageEnum.RWJFWLXBXG.getCnName(), ProjectMessageEnum.RWJFWLXBXG.getEnName(), ProjectMessageEnum.SJFHXLC, TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1, false); + } + } + // 如果编辑了验证符合性交付物类型 + if (projectLawsInventoryOld.getVerifyDeliverableType() != null && projectLawsInventoryEO.getVerifyDeliverableType() != null && !projectLawsInventoryOld.getVerifyDeliverableType().equals(projectLawsInventoryEO.getVerifyDeliverableType())) { + if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue())) { + //发给新的责任人 + sendMessage(projectLawsInventoryEO.getVerifyDutyId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, ProjectMessageEnum.RWJFWLXBXG.getCnName(), ProjectMessageEnum.RWJFWLXBXG.getEnName(), ProjectMessageEnum.YZFHXLC, TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1, false); + } + } + + // 如果编辑了设计符合性交付物模板 + if (projectLawsInventoryOld.getDesignDeliverableTemplate() != null && projectLawsInventoryEO.getDesignDeliverableTemplate() != null && !projectLawsInventoryOld.getDesignDeliverableTemplate().equals(projectLawsInventoryEO.getDesignDeliverableTemplate())) { + if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue())) { + //发给责任人 + sendMessage(projectLawsInventoryEO.getDesignDutyId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, ProjectMessageEnum.RWJFWMBBXG.getCnName(), ProjectMessageEnum.RWJFWMBBXG.getEnName(), ProjectMessageEnum.SJFHXLC, TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1, false); + } + } + // 如果编辑了验证符合性交付物模板 + if (projectLawsInventoryOld.getVerifyDeliverableTemplate() != null && projectLawsInventoryEO.getVerifyDeliverableTemplate() != null && !projectLawsInventoryOld.getVerifyDeliverableTemplate().equals(projectLawsInventoryEO.getVerifyDeliverableTemplate())) { + if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue())) { + //发给新的责任人 + sendMessage(projectLawsInventoryEO.getVerifyDutyId(), currentUser.getId(), projectLawsInventoryEO, projectLibraryBase, ProjectMessageEnum.RWJFWMBBXG.getCnName(), ProjectMessageEnum.RWJFWMBBXG.getEnName(), ProjectMessageEnum.YZFHXLC, TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1, false); + } + } + } + /* + // 是否不在流程中 + boolean isNotInDesignProcess = ( + StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.CONFORMITY.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TERMINATION_OF_TASK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue()) + ); + boolean isNotInVerifyProcess = ( + StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.CONFORMITY.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TERMINATION_OF_TASK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue()) + ); + + // 清单待校核 + boolean toBeCheckedFlag = ( + StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) + ); + // 结果待审查 + boolean toBeReviewedFlag = ( + StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + ); + + // 编辑前、编辑后的法规工程师都不为空。 + boolean regulationOwnerIsNotNull = ( + StringUtils.isNotEmpty(projectLawsInventoryOld.getRegulationOwnerId()) + && StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId()) + ); + + if (regulationOwnerIsNotNull && !isNotInDesignProcess && !isNotInVerifyProcess) { + // 如果编辑了法规工程师,给之前的法规工程师发消息 + if (!StringUtils.equals(projectLawsInventoryOld.getRegulationOwnerId(), projectLawsInventoryEO.getRegulationOwnerId())) { + String endTime = ""; + if (projectLawsInventoryOld.getInventoryAffirmDueDate() != null) { + endTime = DateUtils.formatDate(projectLawsInventoryOld.getInventoryAffirmDueDate()); + } + + String regulationOwnerId = projectLawsInventoryOld.getRegulationOwnerId(); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn", "您好,您以下任务已被发起人撤回。"); + params.put("contentEn", "Hello! Your task has been withdrawn by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime", endTime); + params.put("userIdList", Arrays.asList(regulationOwnerId.split(","))); + params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber()); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); + if (ObjectUtils.isNotEmpty(projectLibraryBase)) { + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取待办中心 - 飞书跳转链接 + Map todoCenterParams = new HashMap<>(); + todoCenterParams.put("projectNameCn", PRN_CN); + todoCenterParams.put("projectNameEn", PRN_EN); + Map hrefFeishuMap = projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); + params.put("hrefFeishu_CN", hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN", hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); + + List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); + String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); + params.put("Initiator", regulationOwnerUserName); + + if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { + params.put("flowTypeCn", "设计符合性流程"); + params.put("flowTypeEn", "Design Compliance Process"); + //处理手机端飞书消息跳转 + String hrefFeishu_CN_P = this.handlePhoneDesignLink(projectLawsInventoryEO); + params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params); + } else if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { + params.put("flowTypeCn", "验证符合性流程"); + params.put("flowTypeEn", "Verify Compliance Process"); + //处理手机端飞书消息跳转 + String hrefFeishu_CN_P = this.handlePhoneVerifyLink(projectLawsInventoryEO); + params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params); + } else { + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params); + } + + } + } + } + if ((projectLawsInventoryOld.getDesignDueDate() != null && projectLawsInventoryEO.getDesignDueDate() != null) && !isNotInDesignProcess) { + if (!projectLawsInventoryOld.getDesignDueDate().equals(projectLawsInventoryEO.getDesignDueDate())) { + String endTime = ""; + if (projectLawsInventoryEO.getDesignDueDate() != null) { + endTime = DateUtils.formatDate(projectLawsInventoryEO.getDesignDueDate()); + } + + String regulationOwnerId = projectLawsInventoryEO.getRegulationOwnerId(); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn", "您好,以下符合性任务的截止时间已被发起人修改。"); + params.put("contentEn", "Hello! The due date of the compliance task has been modified by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime", endTime); + params.put("userIdList", Arrays.asList(regulationOwnerId.split(","))); + params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber()); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); + if (ObjectUtils.isNotEmpty(projectLibraryBase)) { + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取待办中心 - 飞书跳转链接 + Map todoCenterParams = new HashMap<>(); + todoCenterParams.put("projectNameCn", PRN_CN); + todoCenterParams.put("projectNameEn", PRN_EN); + Map hrefFeishuMap = projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); + params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); + List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); + String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); + params.put("Initiator", regulationOwnerUserName); + + if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { + params.put("flowTypeCn", "设计符合性流程"); + params.put("flowTypeEn", "Design Compliance Process"); + //处理手机端飞书消息跳转 + String hrefFeishu_CN_P = this.handlePhoneDesignLink(projectLawsInventoryEO); + params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params); + } else { + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params); + } + } + } + } + if ((projectLawsInventoryOld.getVerifyDueDate() != null && projectLawsInventoryEO.getVerifyDueDate() != null) && !isNotInVerifyProcess) { + if (!projectLawsInventoryOld.getVerifyDueDate().equals(projectLawsInventoryEO.getVerifyDueDate())) { + String endTime = ""; + if (projectLawsInventoryEO.getVerifyDueDate() != null) { + endTime = DateUtils.formatDate(projectLawsInventoryEO.getVerifyDueDate()); + } + + String regulationOwnerId = projectLawsInventoryEO.getRegulationOwnerId(); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn", "您好,以下符合性任务的截止时间已被发起人修改。"); + params.put("contentEn", "Hello! The due date of the compliance task has been modified by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime", endTime); + params.put("userIdList", Arrays.asList(regulationOwnerId.split(","))); + params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber()); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); + if (ObjectUtils.isNotEmpty(projectLibraryBase)) { + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取待办中心 - 飞书跳转链接 + Map todoCenterParams = new HashMap<>(); + todoCenterParams.put("projectNameCn", PRN_CN); + todoCenterParams.put("projectNameEn", PRN_EN); + Map hrefFeishuMap = projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); + params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); + List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); + String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); + params.put("Initiator", regulationOwnerUserName); + + if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { + params.put("flowTypeCn", "验证符合性流程"); + params.put("flowTypeEn", "Verify Compliance Process"); + //处理手机端飞书消息跳转 + String hrefFeishu_CN_P = this.handlePhoneVerifyLink(projectLawsInventoryEO); + params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params); + } else { + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params); + } + } + } + } + + // 设计符合性 任务待确认消息 标识 + boolean toBeConfirmedDesignFlag = ( + StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + ); + + if ((projectLawsInventoryOld.getDesignDutyId() != null && projectLawsInventoryEO.getDesignDutyId() != null) && toBeConfirmedDesignFlag) { + if (!projectLawsInventoryOld.getDesignDutyId().equals(projectLawsInventoryEO.getDesignDutyId())) { + String endTime = ""; + if (projectLawsInventoryOld.getDesignDueDate() != null) { + endTime = DateUtils.formatDate(projectLawsInventoryOld.getDesignDueDate()); + } + + String regulationOwnerId = projectLawsInventoryOld.getRegulationOwnerId(); + // 给设计符合性-责任人发消息 + Map params = new HashMap<>(); + params.put("contentCn", "您好,您以下任务已被发起人撤回。"); + params.put("contentEn", "Hello! Your task has been withdrawn by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime", endTime); + params.put("userIdList", Arrays.asList(projectLawsInventoryOld.getDesignDutyId().split(","))); + params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber()); + params.put("flowTypeCn", "设计符合性流程"); + params.put("flowTypeEn", "Design Compliance Process"); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); + if (ObjectUtils.isNotEmpty(projectLibraryBase)) { + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取待办中心 - 飞书跳转链接 + Map todoCenterParams = new HashMap<>(); + todoCenterParams.put("projectNameCn", PRN_CN); + todoCenterParams.put("projectNameEn", PRN_EN); + Map hrefFeishuMap = projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); + params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); + List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); + String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); + params.put("Initiator", regulationOwnerUserName); + if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())) { + //处理手机端飞书消息跳转 + String hrefFeishu_CN_P = this.handlePhoneDesignLink(projectLawsInventoryEO); + params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params); + } else { + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4.getValue(), params); + } + } + } + } + + // 验证符合性 任务待确认消息 标识 + boolean toBeConfirmedVerifyFlag = ( + StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + ); + if ((projectLawsInventoryOld.getVerifyDutyId() != null && projectLawsInventoryEO.getVerifyDutyId() != null) && toBeConfirmedVerifyFlag) { + if (!projectLawsInventoryOld.getVerifyDutyId().equals(projectLawsInventoryEO.getVerifyDutyId())) { + String endTime = ""; + if (projectLawsInventoryOld.getVerifyDueDate() != null) { + endTime = DateUtils.formatDate(projectLawsInventoryOld.getVerifyDueDate()); + } + + String regulationOwnerId = projectLawsInventoryOld.getRegulationOwnerId(); + // 给设计符合性-责任人发消息 + Map params = new HashMap<>(); + params.put("contentCn", "您好,您以下任务已被发起人撤回。"); + params.put("contentEn", "Hello! Your task has been withdrawn by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime", endTime); + params.put("userIdList", Arrays.asList(projectLawsInventoryOld.getDesignDutyId().split(","))); + params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber()); + params.put("flowTypeCn", "验证符合性流程"); + params.put("flowTypeEn", "Verify Compliance Process"); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); + if (ObjectUtils.isNotEmpty(projectLibraryBase)) { + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取待办中心 - 飞书跳转链接 + Map todoCenterParams = new HashMap<>(); + todoCenterParams.put("projectNameCn", PRN_CN); + todoCenterParams.put("projectNameEn", PRN_EN); + Map hrefFeishuMap = projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); + params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); + List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); + String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); + params.put("Initiator", regulationOwnerUserName); + if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())) { + //处理手机端飞书消息跳转 + String hrefFeishu_CN_P = this.handlePhoneVerifyLink(projectLawsInventoryEO); + params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params); + } else { + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4.getValue(), params); + } + + } + } + } + + // 如果编辑了法规工程师,给新的法规工程师发消息 + if ((StringUtils.isNotEmpty(projectLawsInventoryOld.getRegulationOwnerId()) && StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId()))) { + if (!StringUtils.equals(projectLawsInventoryOld.getRegulationOwnerId(), projectLawsInventoryEO.getRegulationOwnerId())) { + String endTime = ""; + String regulationOwnerId = ""; + + if (!isNotInDesignProcess) { + if (projectLawsInventoryEO.getDesignDueDate() != null) { + endTime = DateUtils.formatDate(projectLawsInventoryEO.getDesignDueDate()); + } + + regulationOwnerId = projectLawsInventoryEO.getRegulationOwnerId(); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn", "您好," + currentUser.getUsername() + "向您分发了该任务,请及时查看处理。"); + params.put("contentEn", "Hello! " + currentUser.getUsername() + " has assigned this task to you. Please check and address it in a timely manner."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime", endTime); + params.put("userIdList", Arrays.asList(regulationOwnerId.split(","))); + params.put("serialNumbers", projectLawsInventoryEO.getSerialNumber()); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); + if (ObjectUtils.isNotEmpty(projectLibraryBase)) { + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取待办中心 - 飞书跳转链接 + Map todoCenterParams = new HashMap<>(); + todoCenterParams.put("projectNameCn", PRN_CN); + todoCenterParams.put("projectNameEn", PRN_EN); + Map hrefFeishuMap = projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); + params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + //处理手机端飞书消息跳转 + String hrefFeishu_CN_P = this.handlePhoneDesignLink(projectLawsInventoryEO); + params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); + List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); + String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); + params.put("Initiator", regulationOwnerUserName); + + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params); + } + } + + if (!isNotInVerifyProcess) { + if (projectLawsInventoryEO.getVerifyDueDate() != null) { + endTime = DateUtils.formatDate(projectLawsInventoryEO.getVerifyDueDate()); + } + regulationOwnerId = projectLawsInventoryEO.getRegulationOwnerId(); + // 给法规工程师发消息 + Map params = new HashMap<>(); + params.put("contentCn", "您好," + currentUser.getUsername() + "向您分发了该任务,请及时查看处理。"); + params.put("contentEn", "Hello! " + currentUser.getUsername() + " has assigned this task to you. Please check and address it in a timely manner."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime", endTime); + params.put("userIdList", Arrays.asList(regulationOwnerId.split(","))); + params.put("serialNumbers", projectLawsInventoryEO.getSerialNumber()); + + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); + if (ObjectUtils.isNotEmpty(projectLibraryBase)) { + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取待办中心 - 飞书跳转链接 + Map todoCenterParams = new HashMap<>(); + todoCenterParams.put("projectNameCn", PRN_CN); + todoCenterParams.put("projectNameEn", PRN_EN); + Map hrefFeishuMap = projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); + params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + //处理手机端飞书消息跳转 + String hrefFeishu_CN_P = this.handlePhoneVerifyLink(projectLawsInventoryEO); + params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); + + List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); + String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); + params.put("Initiator", regulationOwnerUserName); + + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params); + } + } + } + } + //交付物类型修改 + if (StringUtils.equals(projectLawsInventoryEO.getDesignDeliverableType(), projectLawsInventoryOld.getDesignDeliverableType()) && !isNotInDesignProcess) { + String endTime = ""; + if (projectLawsInventoryOld.getDesignDueDate() != null) { + endTime = DateUtils.formatDate(projectLawsInventoryOld.getDesignDueDate()); + } + + String regulationOwnerId = projectLawsInventoryEO.getDesignDuty(); + // 给设计符合性-责任人发消息 + Map params = new HashMap<>(); + params.put("contentCn", "您好,以下符合性任务的交付物类型已被发起人修改。"); + params.put("contentEn", "Hello! The type of deliverables of the compliance task has been modified by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime", endTime); + params.put("userIdList", Arrays.asList(projectLawsInventoryOld.getDesignDutyId().split(","))); + params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber()); + params.put("flowTypeCn", "设计符合性流程"); + params.put("flowTypeEn", "Design Compliance Process"); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); + if (ObjectUtils.isNotEmpty(projectLibraryBase)) { + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取待办中心 - 飞书跳转链接 + Map todoCenterParams = new HashMap<>(); + todoCenterParams.put("projectNameCn", PRN_CN); + todoCenterParams.put("projectNameEn", PRN_EN); + Map hrefFeishuMap = projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); + params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); + List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); + String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); + params.put("Initiator", regulationOwnerUserName); + if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { + params.put("flowTypeCn", "设计符合性流程"); + params.put("flowTypeEn", "Design Compliance Process"); + //处理手机端飞书消息跳转 + String hrefFeishu_CN_P = this.handlePhoneDesignLink(projectLawsInventoryEO); + params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params); + } else if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { + params.put("flowTypeCn", "验证符合性流程"); + params.put("flowTypeEn", "Verify Compliance Process"); + //处理手机端飞书消息跳转 + String hrefFeishu_CN_P = this.handlePhoneVerifyLink(projectLawsInventoryEO); + params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params); + } else { + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params); + } + } + } + //交付物类型修改 + if (StringUtils.equals(projectLawsInventoryEO.getVerifyDeliverableType(), projectLawsInventoryOld.getVerifyDeliverableType()) && !isNotInVerifyProcess) { + String endTime = ""; + if (projectLawsInventoryOld.getVerifyDueDate() != null) { + endTime = DateUtils.formatDate(projectLawsInventoryOld.getVerifyDueDate()); + } + + String regulationOwnerId = projectLawsInventoryEO.getVerifyDuty(); + // 给设计符合性-责任人发消息 + Map params = new HashMap<>(); + params.put("contentCn", "您好,以下符合性任务的交付物类型已被发起人修改。"); + params.put("contentEn", "Hello! The type of deliverables of the compliance task has been modified by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime", endTime); + params.put("userIdList", Arrays.asList(projectLawsInventoryOld.getVerifyDutyId().split(","))); + params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber()); + params.put("flowTypeCn", "验证符合性流程"); + params.put("flowTypeEn", "Verify Compliance Process"); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); + if (ObjectUtils.isNotEmpty(projectLibraryBase)) { + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取待办中心 - 飞书跳转链接 + Map todoCenterParams = new HashMap<>(); + todoCenterParams.put("projectNameCn", PRN_CN); + todoCenterParams.put("projectNameEn", PRN_EN); + Map hrefFeishuMap = projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); + params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); + List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); + String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); + params.put("Initiator", regulationOwnerUserName); + if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { + params.put("flowTypeCn", "设计符合性流程"); + params.put("flowTypeEn", "Design Compliance Process"); + //处理手机端飞书消息跳转 + String hrefFeishu_CN_P = this.handlePhoneDesignLink(projectLawsInventoryEO); + params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params); + } else if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { + params.put("flowTypeCn", "验证符合性流程"); + params.put("flowTypeEn", "Verify Compliance Process"); + //处理手机端飞书消息跳转 + String hrefFeishu_CN_P = this.handlePhoneVerifyLink(projectLawsInventoryEO); + params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params); + } else { + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params); + } + } + } + //交付物模板修改 + if (StringUtils.equals(projectLawsInventoryEO.getDesignDeliverableTemplate(), projectLawsInventoryOld.getDesignDeliverableTemplate()) && !isNotInDesignProcess) { + String endTime = ""; + if (projectLawsInventoryOld.getDesignDueDate() != null) { + endTime = DateUtils.formatDate(projectLawsInventoryOld.getDesignDueDate()); + } + + String regulationOwnerId = projectLawsInventoryEO.getDesignDuty(); + // 给设计符合性-责任人发消息 + Map params = new HashMap<>(); + params.put("contentCn", "您好,以下符合性任务的交付物模板已被发起人修改。"); + params.put("contentEn", "Hello! The deliverable template of the compliance task has been modified by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime", endTime); + params.put("userIdList", Arrays.asList(projectLawsInventoryOld.getDesignDutyId().split(","))); + params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber()); + params.put("flowTypeCn", "设计符合性流程"); + params.put("flowTypeEn", "Design Compliance Process"); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); + if (ObjectUtils.isNotEmpty(projectLibraryBase)) { + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取待办中心 - 飞书跳转链接 + Map todoCenterParams = new HashMap<>(); + todoCenterParams.put("projectNameCn", PRN_CN); + todoCenterParams.put("projectNameEn", PRN_EN); + Map hrefFeishuMap = projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); + params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); + List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); + String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); + params.put("Initiator", regulationOwnerUserName); + if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { + params.put("flowTypeCn", "设计符合性流程"); + params.put("flowTypeEn", "Design Compliance Process"); + //处理手机端飞书消息跳转 + String hrefFeishu_CN_P = this.handlePhoneDesignLink(projectLawsInventoryEO); + params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params); + } else if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { + params.put("flowTypeCn", "验证符合性流程"); + params.put("flowTypeEn", "Verify Compliance Process"); + //处理手机端飞书消息跳转 + String hrefFeishu_CN_P = this.handlePhoneVerifyLink(projectLawsInventoryEO); + params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params); + } else { + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params); + } + } + } + if (StringUtils.equals(projectLawsInventoryEO.getVerifyDeliverableTemplate(), projectLawsInventoryOld.getVerifyDeliverableTemplate()) && !isNotInVerifyProcess) { + String endTime = ""; + if (projectLawsInventoryOld.getVerifyDueDate() != null) { + endTime = DateUtils.formatDate(projectLawsInventoryOld.getVerifyDueDate()); + } + + String regulationOwnerId = projectLawsInventoryEO.getVerifyDuty(); + // 给设计符合性-责任人发消息 + Map params = new HashMap<>(); + params.put("contentCn", "您好,以下符合性任务的交付物模板已被发起人修改。"); + params.put("contentEn", "Hello! The deliverable template of the compliance task has been modified by the initiator."); + params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); + params.put("endTime", endTime); + params.put("userIdList", Arrays.asList(projectLawsInventoryOld.getVerifyDutyId().split(","))); + params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber()); + params.put("flowTypeCn", "验证符合性流程"); + params.put("flowTypeEn", "Verify Compliance Process"); + + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); + if (ObjectUtils.isNotEmpty(projectLibraryBase)) { + String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 + String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 + // 获取待办中心 - 飞书跳转链接 + Map todoCenterParams = new HashMap<>(); + todoCenterParams.put("projectNameCn", PRN_CN); + todoCenterParams.put("projectNameEn", PRN_EN); + Map hrefFeishuMap = projectLawsInventoryEOService.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); + params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); + params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); + params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); + List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); + String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); + params.put("Initiator", regulationOwnerUserName); + if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { + params.put("flowTypeCn", "设计符合性流程"); + params.put("flowTypeEn", "Design Compliance Process"); + //处理手机端飞书消息跳转 + String hrefFeishu_CN_P = this.handlePhoneDesignLink(projectLawsInventoryEO); + params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params); + } else if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) + || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { + params.put("flowTypeCn", "验证符合性流程"); + params.put("flowTypeEn", "Verify Compliance Process"); + //处理手机端飞书消息跳转 + String hrefFeishu_CN_P = this.handlePhoneVerifyLink(projectLawsInventoryEO); + params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params); + } else { + projectLawsInventoryEOService.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params); + } + } + } + */ + } + + /** + * 验证数据 + * + * @param projectLibraryId 项目id + * @param lawsInventoryId 法规详情id + * @param currentUserId 当前登录人id + * @return + */ + public boolean checkData(String projectLibraryId, String currentUserId, String lawsInventoryId) { + boolean result = false; + try { + QueryWrapper queryWrapper = new QueryWrapper<>(); + + int isProjectRole = projectLawsInventoryEOService.checkUserRole(projectLibraryId, currentUserId, lawsInventoryId); + if (isProjectRole != Integer.parseInt(ProjectRoleEnum.STUDIO_ENGINEER.getValue())) { + queryWrapper.lambda().eq(ProjectLawsInventoryEO::getHomologationEngineerId, currentUserId); + queryWrapper.lambda().or().eq(ProjectLawsInventoryEO::getRegulationOwnerId, currentUserId); + } + queryWrapper.lambda().eq(ProjectLawsInventoryEO::getId, lawsInventoryId); + Integer projectLawsInventoryCount = projectLawsInventoryEOService.getBaseMapper().selectCount(queryWrapper); + if (projectLawsInventoryCount > 0) { + result = true; + } + } catch (Exception ex) { + log.error("验证项目库-法规清单表数据异常:" + ex.getMessage()); + throw new JeroBootException("验证项目库-法规清单表数据异常!"); + } + return result; + } + + private void setDateNull(ProjectLawsInventoryEO projectLawsInventoryEO, LambdaUpdateWrapper updateWrapper) { + if (ObjectUtils.isEmpty(projectLawsInventoryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1())) { + updateWrapper.set(ProjectLawsInventoryEO::getXin1Che1Xing2Shi2Shi1Ri4Qi1, null); + } + if (ObjectUtils.isEmpty(projectLawsInventoryEO.getImplementTime())) { + updateWrapper.set(ProjectLawsInventoryEO::getImplementTime, null); + } + if (ObjectUtils.isEmpty(projectLawsInventoryEO.getDesignDueDate())) { + updateWrapper.set(ProjectLawsInventoryEO::getDesignDueDate, null); + } + if (ObjectUtils.isEmpty(projectLawsInventoryEO.getPrehomoDueDate())) { + updateWrapper.set(ProjectLawsInventoryEO::getPrehomoDueDate, null); + } + if (ObjectUtils.isEmpty(projectLawsInventoryEO.getVerifyDueDate())) { + updateWrapper.set(ProjectLawsInventoryEO::getVerifyDueDate, null); + } + if (ObjectUtils.isEmpty(projectLawsInventoryEO.getImplementType())) { + updateWrapper.set(ProjectLawsInventoryEO::getImplementType, null); + } + } + + + public void setProjectLawsInventoryPermission(String userId, String projectId, String lawsInventoryId, Date now, List adds, String belong) { + QueryWrapper del = new QueryWrapper<>(); + del.eq("project_id", projectId) + .eq("belong", belong) + .eq("description", PermissionDescriptionEnum.PROJECT_LAWS_INVENTORY.getValue() + lawsInventoryId); + projectUserPermissionService.remove(del); + + ProjectUserPermission permission = new ProjectUserPermission(); + permission.setProjectId(projectId); + permission.setUserId(userId); + permission.setBelong(belong); + permission.setDescription(PermissionDescriptionEnum.PROJECT_LAWS_INVENTORY.getValue() + lawsInventoryId); + permission.setCreateTime(now); + permission.setUpdateTime(now); + adds.add(permission); + } + + + private void translateData(List infoList) { + for (ProjectLawsInventoryEO projectLawsInventoryEO : infoList) { + //子标题 + if (StringUtils.isBlank(projectLawsInventoryEO.getSubtitle())) { + projectLawsInventoryEO.setSubtitle("空"); + } + //WVTA ID + if (StringUtils.isBlank(projectLawsInventoryEO.getWvtaId())) { + projectLawsInventoryEO.setWvtaId("空"); + } + //备注 + if (StringUtils.isBlank(projectLawsInventoryEO.getRemark())) { + projectLawsInventoryEO.setRemark("空"); + } + //实施类别 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getImplementType())) { + List implementType = sysDictItemMapper.selectItemsByDictCode(ProjectInventoryFieldEnum.IMPLEMENT_TYPE.getValue()); + String implementTypeName = implementType.stream().filter(e -> e.getItemValue().equals(projectLawsInventoryEO.getImplementType())).map(f -> f.getItemText()).collect(Collectors.joining(",")); + projectLawsInventoryEO.setImplementType(implementTypeName); + } else { + projectLawsInventoryEO.setImplementType("空"); + } + + //在产车实施日期 + if (projectLawsInventoryEO.getImplementTime() != null) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String dateString = sdf.format(projectLawsInventoryEO.getImplementTime()); + projectLawsInventoryEO.setImplementTimeString(dateString); + } else { + projectLawsInventoryEO.setImplementTimeString("空"); + } + + //新车型实施日期 + if (projectLawsInventoryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1() != null) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String dateString = sdf.format(projectLawsInventoryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1()); + projectLawsInventoryEO.setXin1Che1Xing2Shi2Shi1Ri4Qi1String(dateString); + } else { + projectLawsInventoryEO.setXin1Che1Xing2Shi2Shi1Ri4Qi1String("空"); + } + + //认证类型 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getAttestationType())) { + List attestationType = sysDictItemMapper.selectItemsByDictCode(DummyInventoryBaseFieldEnum.ATTESTATION_TYPE.getValue()); + List attestationTypeList = Arrays.asList(projectLawsInventoryEO.getAttestationType().split(",")); + StringBuilder attestationTypeBuilder = new StringBuilder(); + for (String midAttestationType : attestationTypeList) { + String dutyTerritoryName = attestationType.stream().filter(e -> e.getItemValue().equals(midAttestationType)).map(f -> f.getItemText()).collect(Collectors.joining(",")); + attestationTypeBuilder.append(dutyTerritoryName).append(","); + } + projectLawsInventoryEO.setAttestationType(attestationTypeBuilder.substring(0, attestationTypeBuilder.toString().length() - 1)); + } else { + projectLawsInventoryEO.setAttestationType("空"); + } + + //认证级别 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getAttestationRank())) { + List attestationRank = sysDictItemMapper.selectItemsByDictCode(ProjectInventoryFieldEnum.ATTESTATION_RANK.getValue()); + List attestationRankList = Arrays.asList(projectLawsInventoryEO.getAttestationRank().split(",")); + StringBuilder attestationRankBuilder = new StringBuilder(); + for (String midAttestationRank : attestationRankList) { + String dutyTerritoryName = attestationRank.stream().filter(e -> e.getItemValue().equals(midAttestationRank)).map(f -> f.getItemText()).collect(Collectors.joining(",")); + attestationRankBuilder.append(dutyTerritoryName).append(","); + } + projectLawsInventoryEO.setAttestationRank(attestationRankBuilder.substring(0, attestationRankBuilder.toString().length() - 1)); + } else { + projectLawsInventoryEO.setAttestationRank("空"); + } + + //责任领域 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getDutyTerritory())) { + List dutyTerritory = sysDictItemMapper.selectItemsByDictCode(ProjectInventoryFieldEnum.DUTY_TERRITORY.getValue()); + List dutyTerritoryList = Arrays.asList(projectLawsInventoryEO.getDutyTerritory().split(",")); + StringBuilder dutyTerritoryBuilder = new StringBuilder(); + for (String midDutyTerritory : dutyTerritoryList) { + String dutyTerritoryName = dutyTerritory.stream().filter(e -> e.getItemValue().equals(midDutyTerritory)).map(f -> f.getItemText()).collect(Collectors.joining(",")); + dutyTerritoryBuilder.append(dutyTerritoryName).append(","); + } + projectLawsInventoryEO.setDutyTerritory(dutyTerritoryBuilder.substring(0, dutyTerritoryBuilder.toString().length() - 1)); + } else { + projectLawsInventoryEO.setDutyTerritory("空"); + } + + //适用地区 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getRegion())) { + List region = sysDictItemMapper.selectItemsByDictCode(DummyInventoryBaseFieldEnum.REGION.getValue()); + List regionList = Arrays.asList(projectLawsInventoryEO.getRegion().split(",")); + StringBuilder regionBuilder = new StringBuilder(); + for (String midRegion : regionList) { + String regionName = region.stream().filter(e -> e.getItemValue().equals(midRegion)).map(f -> f.getItemText()).collect(Collectors.joining(",")); + regionBuilder.append(regionName).append(","); + } + projectLawsInventoryEO.setRegion(regionBuilder.substring(0, regionBuilder.toString().length() - 1)); + } else { + projectLawsInventoryEO.setRegion("空"); + } + + //交付物类型 + //交付物类型 + Set deliverableTypeSet = new HashSet<>(); + List designDeliverableTypeIdList = new ArrayList<>(); + List prehomoDeliverableTypeIdList = new ArrayList<>(); + List verifyDeliverableTypeIdList = new ArrayList<>(); + if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableType())) { + designDeliverableTypeIdList = Arrays.asList(projectLawsInventoryEO.getDesignDeliverableType().split(",")); + deliverableTypeSet.addAll(designDeliverableTypeIdList); + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableType())) { + prehomoDeliverableTypeIdList = Arrays.asList(projectLawsInventoryEO.getPrehomoDeliverableType().split(",")); + deliverableTypeSet.addAll(prehomoDeliverableTypeIdList); + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableType())) { + verifyDeliverableTypeIdList = Arrays.asList(projectLawsInventoryEO.getVerifyDeliverableType().split(",")); + deliverableTypeSet.addAll(verifyDeliverableTypeIdList); + } + //树形结构 + List deliverableTypeList = new ArrayList<>(); + if (deliverableTypeSet.size() != 0) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(SysCategory::getId, deliverableTypeSet); + deliverableTypeList = sysCategoryService.list(wrapper); + } + + //设计符合性确认-交付物类型 + if (deliverableTypeList.size() != 0 && StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableType())) { + StringBuilder designBuilder = new StringBuilder(); + for (String id : designDeliverableTypeIdList) { + List designList = deliverableTypeList.stream().filter(e -> id.equals(e.getId())).collect(Collectors.toList()); + if (designList.size() != 0) { + designBuilder.append(designList.get(0).getName() + ","); + } + } + String designName = null; + if (StringUtils.isNotBlank(designBuilder)) { + designName = designBuilder.substring(0, designBuilder.length() - 1); + } + projectLawsInventoryEO.setDesignDeliverableTypeName(designName); + } else { + projectLawsInventoryEO.setDesignDeliverableTypeName("空"); + } + //prehomo确认-交付物类型 + if (deliverableTypeList.size() != 0 && StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableType())) { + StringBuilder prehomoBuilder = new StringBuilder(); + for (String id : prehomoDeliverableTypeIdList) { + List prehomoList = deliverableTypeList.stream().filter(e -> id.equals(e.getId())).collect(Collectors.toList()); + if (prehomoList.size() != 0) { + prehomoBuilder.append(prehomoList.get(0).getName() + ","); + } + } + String prehomoName = null; + if (StringUtils.isNotBlank(prehomoBuilder)) { + prehomoName = prehomoBuilder.substring(0, prehomoBuilder.length() - 1); + } + projectLawsInventoryEO.setPrehomoDeliverableTypeName(prehomoName); + + } else { + projectLawsInventoryEO.setPrehomoDeliverableTypeName("空"); + } + //验证符合性确认-交付物类型 + if (deliverableTypeList.size() != 0 && StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableType())) { + StringBuilder verifyBuilder = new StringBuilder(); + for (String id : verifyDeliverableTypeIdList) { + List verifyList = deliverableTypeList.stream().filter(e -> id.equals(e.getId())).collect(Collectors.toList()); + + if (verifyList.size() != 0) { + verifyBuilder.append(verifyList.get(0).getName() + ","); + } + } + String verifyName = null; + if (StringUtils.isNotBlank(verifyBuilder)) { + verifyName = verifyBuilder.substring(0, verifyBuilder.length() - 1); + } + projectLawsInventoryEO.setVerifyDeliverableTypeName(verifyName); + } else { + projectLawsInventoryEO.setVerifyDeliverableTypeName("空"); + } + + + List userIdList = new ArrayList<>(); + //法规工程师 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getRegulationOwnerId())) { + userIdList.add(projectLawsInventoryEO.getRegulationOwnerId()); + } else { + projectLawsInventoryEO.setRegulationOwnerName("空"); + } + + //认证工程师 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getHomologationEngineerId())) { + userIdList.add(projectLawsInventoryEO.getHomologationEngineerId()); + } else { + projectLawsInventoryEO.setHomologationEngineerName("空"); + } + + //工程接口人 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getEngineeringInterfacePerson())) { + userIdList.add(projectLawsInventoryEO.getEngineeringInterfacePerson()); + } else { + projectLawsInventoryEO.setEngineeringInterfacePersonName("空"); + } + + //发起人 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignInitiatorId())) { + userIdList.add(projectLawsInventoryEO.getDesignInitiatorId()); + } else { + projectLawsInventoryEO.setDesignInitiatorName("空"); + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoInitiatorId())) { + userIdList.add(projectLawsInventoryEO.getPrehomoInitiatorId()); + } else { + projectLawsInventoryEO.setPrehomoInitiatorName("空"); + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyInitiatorId())) { + userIdList.add(projectLawsInventoryEO.getVerifyInitiatorId()); + } else { + projectLawsInventoryEO.setVerifyInitiatorName("空"); + } + + //责任人 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDutyId())) { + userIdList.add(projectLawsInventoryEO.getDesignDutyId()); + } else { + projectLawsInventoryEO.setDesignDutyIdName("空"); + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDutyId())) { + userIdList.add(projectLawsInventoryEO.getPrehomoDutyId()); + } else { + projectLawsInventoryEO.setPrehomoDutyName("空"); + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDutyId())) { + userIdList.add(projectLawsInventoryEO.getVerifyDutyId()); + } else { + projectLawsInventoryEO.setVerifyDutyIdName("空"); + } + + userIdList = userIdList.stream().distinct().collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(userIdList)) { + QueryWrapper userqueryWrapper = new QueryWrapper<>(); + List userList = sysUserService.list(userqueryWrapper.in("id ", userIdList)); + + //法规工程师 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getRegulationOwnerId())) { + List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getRegulationOwnerId())).map(f -> f.getUsername()).collect(Collectors.toList()); + if (collect.size() != 0) { + String userName = collect.get(0); + projectLawsInventoryEO.setRegulationOwnerName(userName); + } + } + + //认证工程师 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getHomologationEngineerId())) { + List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getHomologationEngineerId())).map(f -> f.getUsername()).collect(Collectors.toList()); + if (collect.size() != 0) { + String userName = collect.get(0); + projectLawsInventoryEO.setHomologationEngineerName(userName); + } + } + + //工程接口人 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getEngineeringInterfacePerson())) { + List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getEngineeringInterfacePerson())).map(f -> f.getUsername()).collect(Collectors.toList()); + if (collect.size() != 0) { + String userName = collect.get(0); + projectLawsInventoryEO.setEngineeringInterfacePersonName(userName); + } + } + + + //发起人 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignInitiatorId())) { + List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getDesignInitiatorId())).map(f -> f.getUsername()).collect(Collectors.toList()); + if (collect.size() != 0) { + String userName = collect.get(0); + projectLawsInventoryEO.setDesignInitiatorName(userName); + } + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoInitiatorId())) { + List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getPrehomoInitiatorId())).map(f -> f.getUsername()).collect(Collectors.toList()); + if (collect.size() != 0) { + String userName = collect.get(0); + projectLawsInventoryEO.setPrehomoInitiatorName(userName); + } + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyInitiatorId())) { + List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getVerifyInitiatorId())).map(f -> f.getUsername()).collect(Collectors.toList()); + if (collect.size() != 0) { + String userName = collect.get(0); + projectLawsInventoryEO.setVerifyInitiatorName(userName); + } + } + + //责任人 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDutyId())) { + List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getDesignDutyId())).map(f -> f.getUsername()).collect(Collectors.toList()); + if (collect.size() != 0) { + String userName = collect.get(0); + projectLawsInventoryEO.setDesignDutyIdName(userName); + } + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDutyId())) { + List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getPrehomoDutyId())).map(f -> f.getUsername()).collect(Collectors.toList()); + if (collect.size() != 0) { + String userName = collect.get(0); + projectLawsInventoryEO.setPrehomoDutyName(userName); + } + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDutyId())) { + List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getVerifyDutyId())).map(f -> f.getUsername()).collect(Collectors.toList()); + if (collect.size() != 0) { + String userName = collect.get(0); + projectLawsInventoryEO.setVerifyDutyIdName(userName); + } + } + } + + + //截止时间 + //设计符合性确认-截止时间 designDueDate + if (projectLawsInventoryEO.getDesignDueDate() != null) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String dateString = sdf.format(projectLawsInventoryEO.getDesignDueDate()); + projectLawsInventoryEO.setDesignDueDateString(dateString); + } else { + projectLawsInventoryEO.setDesignDueDateString("空"); + } + //prehomo确认-截止时间 prehomoDueDate + if (projectLawsInventoryEO.getPrehomoDueDate() != null) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String dateString = sdf.format(projectLawsInventoryEO.getPrehomoDueDate()); + projectLawsInventoryEO.setPrehomoDueDateString(dateString); + } else { + projectLawsInventoryEO.setPrehomoDueDateString("空"); + } + //验证符合性确认-截止时间 verifyDueDate + if (projectLawsInventoryEO.getVerifyDueDate() != null) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String dateString = sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + projectLawsInventoryEO.setVerifyDueDateString(dateString); + } else { + projectLawsInventoryEO.setVerifyDueDateString("空"); + } + + + //文件 + List deliverableList = new ArrayList<>(); + //设计符合性确认交付物模板 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableTemplate())) { + deliverableList.addAll(Arrays.asList(projectLawsInventoryEO.getDesignDeliverableTemplate().split(","))); + } else { + projectLawsInventoryEO.setDesignDeliverableTemplateName("空"); + } + // Prehomo确认交付物模板 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableTemplate())) { + deliverableList.addAll(Arrays.asList(projectLawsInventoryEO.getPrehomoDeliverableTemplate().split(","))); + } else { + projectLawsInventoryEO.setPrehomoDeliverableTemplateName("空"); + } + // 验证符合性确认交付物模板 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableTemplate())) { + deliverableList.addAll(Arrays.asList(projectLawsInventoryEO.getVerifyDeliverableTemplate().split(","))); + } else { + projectLawsInventoryEO.setVerifyDeliverableTemplateName("空"); + } + List fileInfos = new ArrayList<>(); + if (deliverableList.size() != 0) { + fileInfos = iOSSFileService.getFileInfos(org.apache.commons.lang3.StringUtils.join(deliverableList, ",")); + } + //交付物类型模板 + if (fileInfos.size() != 0) { + if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableTemplate())) { + String fileName = getFileName(projectLawsInventoryEO, fileInfos, projectLawsInventoryEO.getDesignDeliverableTemplate()); + if (org.apache.commons.lang3.StringUtils.isNotBlank(fileName)) { + projectLawsInventoryEO.setDesignDeliverableTemplateName(fileName); + } + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableTemplate())) { + String fileName = getFileName(projectLawsInventoryEO, fileInfos, projectLawsInventoryEO.getPrehomoDeliverableTemplate()); + if (org.apache.commons.lang3.StringUtils.isNotBlank(fileName)) { + projectLawsInventoryEO.setPrehomoDeliverableTemplateName(fileName); + } + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableTemplate())) { + String fileName = getFileName(projectLawsInventoryEO, fileInfos, projectLawsInventoryEO.getVerifyDeliverableTemplate()); + if (org.apache.commons.lang3.StringUtils.isNotBlank(fileName)) { + projectLawsInventoryEO.setVerifyDeliverableTemplateName(fileName); + + } + } + } + } + } + + //翻译成英文 + private void translateDataToEn(List infoList) { + for (ProjectLawsInventoryEO projectLawsInventoryEO : infoList) { + //子标题 + if (StringUtils.isBlank(projectLawsInventoryEO.getSubtitle())) { + projectLawsInventoryEO.setSubtitle("null"); + } + //WVTA ID + if (StringUtils.isBlank(projectLawsInventoryEO.getWvtaId())) { + projectLawsInventoryEO.setWvtaId("null"); + } + //备注 + if (StringUtils.isBlank(projectLawsInventoryEO.getRemark())) { + projectLawsInventoryEO.setRemark("null"); + } + //实施类别 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getImplementType())) { + List implementType = sysDictItemMapper.selectItemsByDictCode(ProjectInventoryFieldEnum.IMPLEMENT_TYPE.getValue()); + String implementTypeName = implementType.stream().filter(e -> e.getItemValue().equals(projectLawsInventoryEO.getImplementType())).map(f -> f.getItemText()).collect(Collectors.joining(",")); + projectLawsInventoryEO.setImplementType(implementTypeName); + } else { + projectLawsInventoryEO.setImplementType("null"); + } + + //在产车实施日期 + if (projectLawsInventoryEO.getImplementTime() != null) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String dateString = sdf.format(projectLawsInventoryEO.getImplementTime()); + projectLawsInventoryEO.setImplementTimeString(dateString); + } else { + projectLawsInventoryEO.setImplementTimeString("null"); + } + + //新车型实施日期 + if (projectLawsInventoryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1() != null) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String dateString = sdf.format(projectLawsInventoryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1()); + projectLawsInventoryEO.setXin1Che1Xing2Shi2Shi1Ri4Qi1String(dateString); + } else { + projectLawsInventoryEO.setXin1Che1Xing2Shi2Shi1Ri4Qi1String("null"); + } + + //认证类型 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getAttestationType())) { + List attestationType = sysDictItemMapper.selectItemsByDictCode(ProjectInventoryFieldEnum.ATTESTATION_TYPE.getValue()); + List attestationTypeList = Arrays.asList(projectLawsInventoryEO.getAttestationType().split(",")); + StringBuilder attestationTypeBuilder = new StringBuilder(); + for (String midDutyTerritory : attestationTypeList) { + String attestationTypeName = attestationType.stream().filter(e -> e.getItemValue().equals(midDutyTerritory)).map(f -> f.getEnName()).collect(Collectors.joining(",")); + attestationTypeBuilder.append(attestationTypeName).append(","); + } + projectLawsInventoryEO.setAttestationType(attestationTypeBuilder.substring(0, attestationTypeBuilder.toString().length() - 1)); + + + } else { + projectLawsInventoryEO.setAttestationType("null"); + } + + //认证级别 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getAttestationRank())) { + List attestationRank = sysDictItemMapper.selectItemsByDictCode(ProjectInventoryFieldEnum.ATTESTATION_RANK.getValue()); + List attestationRankList = Arrays.asList(projectLawsInventoryEO.getAttestationRank().split(",")); + StringBuilder attestationRankBuilder = new StringBuilder(); + for (String midAttestationRank : attestationRankList) { + String dutyTerritoryName = attestationRank.stream().filter(e -> e.getItemValue().equals(midAttestationRank)).map(f -> f.getItemText()).collect(Collectors.joining(",")); + attestationRankBuilder.append(dutyTerritoryName).append(","); + } + projectLawsInventoryEO.setAttestationRank(attestationRankBuilder.substring(0, attestationRankBuilder.toString().length() - 1)); + } else { + projectLawsInventoryEO.setAttestationRank("null"); + } + + //责任领域 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getDutyTerritory())) { + List dutyTerritory = sysDictItemMapper.selectItemsByDictCode(ProjectInventoryFieldEnum.DUTY_TERRITORY.getValue()); + List dutyTerritoryList = Arrays.asList(projectLawsInventoryEO.getDutyTerritory().split(",")); + StringBuilder dutyTerritoryBuilder = new StringBuilder(); + for (String midDutyTerritory : dutyTerritoryList) { + String dutyTerritoryName = dutyTerritory.stream().filter(e -> e.getItemValue().equals(midDutyTerritory)).map(f -> f.getEnName()).collect(Collectors.joining(",")); + dutyTerritoryBuilder.append(dutyTerritoryName).append(","); + } + projectLawsInventoryEO.setDutyTerritory(dutyTerritoryBuilder.substring(0, dutyTerritoryBuilder.toString().length() - 1)); + } else { + projectLawsInventoryEO.setDutyTerritory("null"); + } + + //适用地区 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getRegion())) { + List region = sysDictItemMapper.selectItemsByDictCode(DummyInventoryBaseFieldEnum.REGION.getValue()); + List regionList = Arrays.asList(projectLawsInventoryEO.getRegion().split(",")); + StringBuilder regionBuilder = new StringBuilder(); + for (String midRegion : regionList) { + String regionName = region.stream().filter(e -> e.getItemValue().equals(midRegion)).map(f -> f.getEnName()).collect(Collectors.joining(",")); + regionBuilder.append(regionName).append(","); + } + projectLawsInventoryEO.setRegion(regionBuilder.substring(0, regionBuilder.toString().length() - 1)); + } else { + projectLawsInventoryEO.setRegion("null"); + } + + //交付物类型 + //交付物类型 + Set deliverableTypeSet = new HashSet<>(); + List designDeliverableTypeIdList = new ArrayList<>(); + List prehomoDeliverableTypeIdList = new ArrayList<>(); + List verifyDeliverableTypeIdList = new ArrayList<>(); + if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableType())) { + designDeliverableTypeIdList = Arrays.asList(projectLawsInventoryEO.getDesignDeliverableType().split(",")); + deliverableTypeSet.addAll(designDeliverableTypeIdList); + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableType())) { + prehomoDeliverableTypeIdList = Arrays.asList(projectLawsInventoryEO.getPrehomoDeliverableType().split(",")); + deliverableTypeSet.addAll(prehomoDeliverableTypeIdList); + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableType())) { + verifyDeliverableTypeIdList = Arrays.asList(projectLawsInventoryEO.getVerifyDeliverableType().split(",")); + deliverableTypeSet.addAll(verifyDeliverableTypeIdList); + } + //树形结构 + List deliverableTypeList = new ArrayList<>(); + if (deliverableTypeSet.size() != 0) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(SysCategory::getId, deliverableTypeSet); + deliverableTypeList = sysCategoryService.list(wrapper); + } + + //设计符合性确认-交付物类型 + if (deliverableTypeList.size() != 0 && StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableType())) { + StringBuilder designBuilder = new StringBuilder(); + for (String id : designDeliverableTypeIdList) { + List designList = deliverableTypeList.stream().filter(e -> id.equals(e.getId())).collect(Collectors.toList()); + if (designList.size() != 0) { + designBuilder.append(designList.get(0).getEnName() + ","); + } + } + String designEnName = null; + if (StringUtils.isNotBlank(designBuilder)) { + designEnName = designBuilder.substring(0, designBuilder.length() - 1); + } + projectLawsInventoryEO.setDesignDeliverableTypeName(designEnName); + } else { + projectLawsInventoryEO.setDesignDeliverableTypeName("null"); + } + //prehomo确认-交付物类型 + if (deliverableTypeList.size() != 0 && StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableType())) { + StringBuilder prehomoBuilder = new StringBuilder(); + for (String id : prehomoDeliverableTypeIdList) { + List prehomoList = deliverableTypeList.stream().filter(e -> id.equals(e.getId())).collect(Collectors.toList()); + if (prehomoList.size() != 0) { + prehomoBuilder.append(prehomoList.get(0).getEnName() + ","); + } + } + String prehomoEnName = null; + if (StringUtils.isNotBlank(prehomoBuilder)) { + prehomoEnName = prehomoBuilder.substring(0, prehomoBuilder.length() - 1); + } + projectLawsInventoryEO.setPrehomoDeliverableTypeName(prehomoEnName); + } else { + projectLawsInventoryEO.setPrehomoDeliverableTypeName("null"); + } + //验证符合性确认-交付物类型 + if (deliverableTypeList.size() != 0 && StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableType())) { + StringBuilder verifyBuilder = new StringBuilder(); + for (String id : verifyDeliverableTypeIdList) { + List verifyList = deliverableTypeList.stream().filter(e -> id.equals(e.getId())).collect(Collectors.toList()); + + if (verifyList.size() != 0) { + verifyBuilder.append(verifyList.get(0).getEnName() + ","); + } + } + String verifyEnName = null; + if (StringUtils.isNotBlank(verifyBuilder)) { + verifyEnName = verifyBuilder.substring(0, verifyBuilder.length() - 1); + } + projectLawsInventoryEO.setVerifyDeliverableTypeName(verifyEnName); + } else { + projectLawsInventoryEO.setVerifyDeliverableTypeName("null"); + } + + + List userIdList = new ArrayList<>(); + //法规工程师 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getRegulationOwnerId())) { + userIdList.add(projectLawsInventoryEO.getRegulationOwnerId()); + } else { + projectLawsInventoryEO.setRegulationOwnerName("null"); + } + + //认证工程师 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getHomologationEngineerId())) { + userIdList.add(projectLawsInventoryEO.getHomologationEngineerId()); + } else { + projectLawsInventoryEO.setHomologationEngineerName("null"); + } + + //工程接口人 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getEngineeringInterfacePerson())) { + userIdList.add(projectLawsInventoryEO.getEngineeringInterfacePerson()); + } else { + projectLawsInventoryEO.setEngineeringInterfacePersonName("null"); + } + + //发起人 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignInitiatorId())) { + userIdList.add(projectLawsInventoryEO.getDesignInitiatorId()); + } else { + projectLawsInventoryEO.setDesignInitiatorName("null"); + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoInitiatorId())) { + userIdList.add(projectLawsInventoryEO.getPrehomoInitiatorId()); + } else { + projectLawsInventoryEO.setPrehomoInitiatorName("null"); + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyInitiatorId())) { + userIdList.add(projectLawsInventoryEO.getVerifyInitiatorId()); + } else { + projectLawsInventoryEO.setVerifyInitiatorName("null"); + } + + //责任人 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDutyId())) { + userIdList.add(projectLawsInventoryEO.getDesignDutyId()); + } else { + projectLawsInventoryEO.setDesignDutyIdName("null"); + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDutyId())) { + userIdList.add(projectLawsInventoryEO.getPrehomoDutyId()); + } else { + projectLawsInventoryEO.setPrehomoDutyName("null"); + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDutyId())) { + userIdList.add(projectLawsInventoryEO.getVerifyDutyId()); + } else { + projectLawsInventoryEO.setVerifyDutyIdName("null"); + } + + userIdList = userIdList.stream().distinct().collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(userIdList)) { + QueryWrapper userqueryWrapper = new QueryWrapper<>(); + List userList = sysUserService.list(userqueryWrapper.in("id ", userIdList)); + + //法规工程师 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getRegulationOwnerId())) { + List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getRegulationOwnerId())).map(f -> f.getUsername()).collect(Collectors.toList()); + if (collect.size() != 0) { + String userName = collect.get(0); + projectLawsInventoryEO.setRegulationOwnerName(userName); + } + } + + //认证工程师 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getHomologationEngineerId())) { + List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getHomologationEngineerId())).map(f -> f.getUsername()).collect(Collectors.toList()); + if (collect.size() != 0) { + String userName = collect.get(0); + projectLawsInventoryEO.setHomologationEngineerName(userName); + } + } + + //工程接口人 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getEngineeringInterfacePerson())) { + List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getEngineeringInterfacePerson())).map(f -> f.getUsername()).collect(Collectors.toList()); + if (collect.size() != 0) { + String userName = collect.get(0); + projectLawsInventoryEO.setEngineeringInterfacePersonName(userName); + } + } + + + //发起人 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignInitiatorId())) { + List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getDesignInitiatorId())).map(f -> f.getUsername()).collect(Collectors.toList()); + if (collect.size() != 0) { + String userName = collect.get(0); + projectLawsInventoryEO.setDesignInitiatorName(userName); + } + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoInitiatorId())) { + List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getPrehomoInitiatorId())).map(f -> f.getUsername()).collect(Collectors.toList()); + if (collect.size() != 0) { + String userName = collect.get(0); + projectLawsInventoryEO.setPrehomoInitiatorName(userName); + } + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyInitiatorId())) { + List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getVerifyInitiatorId())).map(f -> f.getUsername()).collect(Collectors.toList()); + if (collect.size() != 0) { + String userName = collect.get(0); + projectLawsInventoryEO.setVerifyInitiatorName(userName); + } + } + + //责任人 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDutyId())) { + List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getDesignDutyId())).map(f -> f.getUsername()).collect(Collectors.toList()); + if (collect.size() != 0) { + String userName = collect.get(0); + projectLawsInventoryEO.setDesignDutyIdName(userName); + } + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDutyId())) { + List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getPrehomoDutyId())).map(f -> f.getUsername()).collect(Collectors.toList()); + if (collect.size() != 0) { + String userName = collect.get(0); + projectLawsInventoryEO.setPrehomoDutyName(userName); + } + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDutyId())) { + List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getVerifyDutyId())).map(f -> f.getUsername()).collect(Collectors.toList()); + if (collect.size() != 0) { + String userName = collect.get(0); + projectLawsInventoryEO.setVerifyDutyIdName(userName); + } + } + } + + + //截止时间 + //设计符合性确认-截止时间 designDueDate + if (projectLawsInventoryEO.getDesignDueDate() != null) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String dateString = sdf.format(projectLawsInventoryEO.getDesignDueDate()); + projectLawsInventoryEO.setDesignDueDateString(dateString); + } else { + projectLawsInventoryEO.setDesignDueDateString("null"); + } + //prehomo确认-截止时间 prehomoDueDate + if (projectLawsInventoryEO.getPrehomoDueDate() != null) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String dateString = sdf.format(projectLawsInventoryEO.getPrehomoDueDate()); + projectLawsInventoryEO.setPrehomoDueDateString(dateString); + } else { + projectLawsInventoryEO.setPrehomoDueDateString("null"); + } + //验证符合性确认-截止时间 verifyDueDate + if (projectLawsInventoryEO.getVerifyDueDate() != null) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String dateString = sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + projectLawsInventoryEO.setVerifyDueDateString(dateString); + } else { + projectLawsInventoryEO.setVerifyDueDateString("null"); + } + + //文件 + List deliverableList = new ArrayList<>(); + //设计符合性确认交付物模板 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableTemplate())) { + deliverableList.addAll(Arrays.asList(projectLawsInventoryEO.getDesignDeliverableTemplate().split(","))); + } + // Prehomo确认交付物模板 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableTemplate())) { + deliverableList.addAll(Arrays.asList(projectLawsInventoryEO.getPrehomoDeliverableTemplate().split(","))); + } + // 验证符合性确认交付物模板 + if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableTemplate())) { + deliverableList.addAll(Arrays.asList(projectLawsInventoryEO.getVerifyDeliverableTemplate().split(","))); + } + List fileInfos = new ArrayList<>(); + if (deliverableList.size() != 0) { + fileInfos = iOSSFileService.getFileInfos(org.apache.commons.lang3.StringUtils.join(deliverableList, ",")); + } + //交付物类型模板 + if (fileInfos.size() != 0) { + if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableTemplate())) { + String fileName = getFileName(projectLawsInventoryEO, fileInfos, projectLawsInventoryEO.getDesignDeliverableTemplate()); + if (org.apache.commons.lang3.StringUtils.isNotBlank(fileName)) { + projectLawsInventoryEO.setDesignDeliverableTemplateName(fileName); + } + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableTemplate())) { + String fileName = getFileName(projectLawsInventoryEO, fileInfos, projectLawsInventoryEO.getPrehomoDeliverableTemplate()); + if (org.apache.commons.lang3.StringUtils.isNotBlank(fileName)) { + projectLawsInventoryEO.setPrehomoDeliverableTemplateName(fileName); + } + } + if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableTemplate())) { + String fileName = getFileName(projectLawsInventoryEO, fileInfos, projectLawsInventoryEO.getVerifyDeliverableTemplate()); + if (org.apache.commons.lang3.StringUtils.isNotBlank(fileName)) { + projectLawsInventoryEO.setVerifyDeliverableTemplateName(fileName); + + } + } + } + } + } + + public StringBuilder setUpdateContentLog(StringBuilder contentLogBuilder, String fieldName, String oldValue, String newValue) { + return contentLogBuilder.append("\'" + fieldName + "\'由" + oldValue + "改为了" + newValue).append("
"); + } + + public StringBuilder setUpdateEnContentLog(StringBuilder contentLogBuilder, String fieldName, String oldValue, String newValue) { + return contentLogBuilder.append("\'" + fieldName + "\' changed from " + oldValue + " to " + newValue).append("
"); + } + + + //拼接维护清单的消息 + public void setContentLog(Map infoDiff, String contentLog, Map infoDiffEn, String enContentLog, String projectLibraryId) { + + //设置维护清单的修改消息 + if (MapUtils.isNotEmpty(infoDiff)) { + if (infoDiff.size() > 1) { + //子标题 + if (StringUtils.isNotBlank(infoDiff.get("subtitle"))) { + List list = Arrays.asList(infoDiff.get("subtitle").split(",")); + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.SUBTITLE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("subtitle"))) { + List listEn = Arrays.asList(infoDiffEn.get("subtitle").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.SUBTITLE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + //WVTA ID + if (StringUtils.isNotBlank(infoDiff.get("wvtaId"))) { + List list = Arrays.asList(infoDiff.get("wvtaId").split(",")); + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.WVTA_ID.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("wvtaId"))) { + List listEn = Arrays.asList(infoDiffEn.get("wvtaId").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.WVTA_ID.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + + //实施类别 + if (StringUtils.isNotBlank(infoDiff.get("implementType"))) { + List list = Arrays.asList(infoDiff.get("implementType").split(",")); + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.IMPLEMENT_TYPE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("implementType"))) { + List listEn = Arrays.asList(infoDiffEn.get("implementType").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.IMPLEMENT_TYPE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + + //在产车实施日期 + if (StringUtils.isNotBlank(infoDiff.get("implementTimeString"))) { + List list = Arrays.asList(infoDiff.get("implementTimeString").split(",")); + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.IMPLEMENT_TIME.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("implementTimeString"))) { + List listEn = Arrays.asList(infoDiffEn.get("implementTimeString").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.IMPLEMENT_TIME.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + + //新车型实施日期 + if (StringUtils.isNotBlank(infoDiff.get("xin1Che1Xing2Shi2Shi1Ri4Qi1String"))) { + List list = Arrays.asList(infoDiff.get("xin1Che1Xing2Shi2Shi1Ri4Qi1String").split(",")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.XIN1_CHE1_XING2_SHI2_SHI1_RI4_QI1.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("xin1Che1Xing2Shi2Shi1Ri4Qi1String"))) { + List listEn = Arrays.asList(infoDiffEn.get("xin1Che1Xing2Shi2Shi1Ri4Qi1String").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.XIN1_CHE1_XING2_SHI2_SHI1_RI4_QI1.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + + //认证类型 + if (StringUtils.isNotBlank(infoDiff.get("attestationType"))) { + List list = Arrays.asList(infoDiff.get("attestationType").split("\\|")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.ATTESTATION_TYPE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("attestationType"))) { + List listEn = Arrays.asList(infoDiffEn.get("attestationType").split("\\|")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.ATTESTATION_TYPE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + + //认证级别 + if (StringUtils.isNotBlank(infoDiff.get("attestationRank"))) { + List list = Arrays.asList(infoDiff.get("attestationRank").split(",")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.ATTESTATION_RANK.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("attestationRank"))) { + List listEn = Arrays.asList(infoDiffEn.get("attestationRank").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.ATTESTATION_RANK.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + + //责任领域 + if (StringUtils.isNotBlank(infoDiff.get("dutyTerritory"))) { + List list = Arrays.asList(infoDiff.get("dutyTerritory").split("\\|")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.DUTY_TERRITORY.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("dutyTerritory"))) { + List listEn = Arrays.asList(infoDiffEn.get("dutyTerritory").split("\\|")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.DUTY_TERRITORY.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + + //regulationOwnerName;//法规工程师名称 + if (StringUtils.isNotBlank(infoDiff.get("regulationOwnerName"))) { + List list = Arrays.asList(infoDiff.get("regulationOwnerName").split(",")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.REGULATION_OWNER_NAME.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("regulationOwnerName"))) { + List listEn = Arrays.asList(infoDiffEn.get("regulationOwnerName").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.REGULATION_OWNER_NAME.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + //homologationEngineerName;//认证工程师名称 + if (StringUtils.isNotBlank(infoDiff.get("homologationEngineerName"))) { + List list = Arrays.asList(infoDiff.get("homologationEngineerName").split(",")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.HOMOLOGATION_ENGINEER_NAME.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("homologationEngineerName"))) { + List listEn = Arrays.asList(infoDiffEn.get("homologationEngineerName").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.HOMOLOGATION_ENGINEER_NAME.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + //engineeringInterfacePersonName;//工程接口人名称 + if (StringUtils.isNotBlank(infoDiff.get("engineeringInterfacePersonName"))) { + List list = Arrays.asList(infoDiff.get("engineeringInterfacePersonName").split(",")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.ENGINEERING_INTERFACE_PERSON_NAME.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("engineeringInterfacePersonName"))) { + List listEn = Arrays.asList(infoDiffEn.get("engineeringInterfacePersonName").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.ENGINEERING_INTERFACE_PERSON_NAME.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + + //适用地区region 多选 + if (StringUtils.isNotBlank(infoDiff.get("region"))) { + List list = Arrays.asList(infoDiff.get("region").split("\\|")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.REGION.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("region"))) { + List listEn = Arrays.asList(infoDiffEn.get("region").split("\\|")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.REGION.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + + //备注 + if (StringUtils.isNotBlank(infoDiff.get("remark"))) { + List list = Arrays.asList(infoDiff.get("remark").split(",")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.REMARK.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("remark"))) { + List listEn = Arrays.asList(infoDiffEn.get("remark").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.REMARK.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + + //设计符合性确认-交付物类型 + if (StringUtils.isNotBlank(infoDiff.get("designDeliverableTypeName"))) { + List list = Arrays.asList(infoDiff.get("designDeliverableTypeName").split("\\|")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DELIVERABLE_TYPE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("designDeliverableTypeName"))) { + List listEn = Arrays.asList(infoDiffEn.get("designDeliverableTypeName").split("\\|")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DELIVERABLE_TYPE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + //设计符合性确认-交付物模板 + if (StringUtils.isNotBlank(infoDiff.get("designDeliverableTemplateName"))) { + List list = Arrays.asList(infoDiff.get("designDeliverableTemplateName").split("\\|")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DELIVERABLE_TEMPLATE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("designDeliverableTemplateName"))) { + List listEn = Arrays.asList(infoDiffEn.get("designDeliverableTemplateName").split("\\|")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DELIVERABLE_TEMPLATE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + //设计符合性确认-发起人 + if (StringUtils.isNotBlank(infoDiff.get("designInitiatorName"))) { + List list = Arrays.asList(infoDiff.get("designInitiatorName").split(",")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.DESIGN_INITIATOR.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("designInitiatorName"))) { + List listEn = Arrays.asList(infoDiffEn.get("designInitiatorName").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.DESIGN_INITIATOR.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + //设计符合性确认-责任人 + if (StringUtils.isNotBlank(infoDiff.get("designDutyName"))) { + List list = Arrays.asList(infoDiff.get("designDutyName").split(",")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DUTY.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("designDutyName"))) { + List listEn = Arrays.asList(infoDiffEn.get("designDutyName").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DUTY.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + //设计符合性确认-截止时间designDueDateString; + if (StringUtils.isNotBlank(infoDiff.get("designDueDateString"))) { + List list = Arrays.asList(infoDiff.get("designDueDateString").split(",")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("designDueDateString"))) { + List listEn = Arrays.asList(infoDiffEn.get("designDueDateString").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + //prehomo确认-交付物类型 + if (StringUtils.isNotBlank(infoDiff.get("prehomoDeliverableTypeName"))) { + List list = Arrays.asList(infoDiff.get("prehomoDeliverableTypeName").split("\\|")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.PREHOMO_DELIVERABLE_TYPE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("prehomoDeliverableTypeName"))) { + List listEn = Arrays.asList(infoDiffEn.get("prehomoDeliverableTypeName").split("\\|")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.PREHOMO_DELIVERABLE_TYPE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + //prehomo确认-交付物模板 + if (StringUtils.isNotBlank(infoDiff.get("prehomoDeliverableTemplateName"))) { + List list = Arrays.asList(infoDiff.get("prehomoDeliverableTemplateName").split("\\|")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.PREHOMO_DELIVERABLE_TEMPLATE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("prehomoDeliverableTemplateName"))) { + List listEn = Arrays.asList(infoDiffEn.get("prehomoDeliverableTemplateName").split("\\|")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.PREHOMO_DELIVERABLE_TEMPLATE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + //prehomo确认-发起人 + if (StringUtils.isNotBlank(infoDiff.get("prehomoInitiatorName"))) { + List list = Arrays.asList(infoDiff.get("prehomoInitiatorName").split(",")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.PREHOMO_INITIATOR.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("prehomoInitiatorName"))) { + List listEn = Arrays.asList(infoDiffEn.get("prehomoInitiatorName").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.PREHOMO_INITIATOR.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + //prehomo确认-责任人 + if (StringUtils.isNotBlank(infoDiff.get("prehomoDutyName"))) { + List list = Arrays.asList(infoDiff.get("prehomoDutyName").split(",")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.PREHOMO_DUTY.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("prehomoDutyName"))) { + List listEn = Arrays.asList(infoDiffEn.get("prehomoDutyName").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.PREHOMO_DUTY.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + //prehomo确认-截止时间prehomoDueDateString; + if (StringUtils.isNotBlank(infoDiff.get("prehomoDueDateString"))) { + List list = Arrays.asList(infoDiff.get("prehomoDueDateString").split(",")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("prehomoDueDateString"))) { + List listEn = Arrays.asList(infoDiffEn.get("prehomoDueDateString").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + + //验证符合性确认-交付物类型 + if (StringUtils.isNotBlank(infoDiff.get("verifyDeliverableTypeName"))) { + List list = Arrays.asList(infoDiff.get("verifyDeliverableTypeName").split("\\|")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.VERIFY_DELIVERABLE_TYPE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("verifyDeliverableTypeName"))) { + List listEn = Arrays.asList(infoDiffEn.get("verifyDeliverableTypeName").split("\\|")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.VERIFY_DELIVERABLE_TYPE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + //验证符合性确认-交付物模板 + if (StringUtils.isNotBlank(infoDiff.get("verifyDeliverableTemplateName"))) { + List list = Arrays.asList(infoDiff.get("verifyDeliverableTemplateName").split("\\|")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.VERIFY_DELIVERABLE_TEMPLATE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("verifyDeliverableTemplateName"))) { + List listEn = Arrays.asList(infoDiffEn.get("verifyDeliverableTemplateName").split("\\|")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.VERIFY_DELIVERABLE_TEMPLATE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + //验证符合性确认-发起人 + if (StringUtils.isNotBlank(infoDiff.get("verifyInitiatorName"))) { + List list = Arrays.asList(infoDiff.get("verifyInitiatorName").split(",")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.VERIFY_INITIATOR.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("verifyInitiatorName"))) { + List listEn = Arrays.asList(infoDiffEn.get("verifyInitiatorName").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.VERIFY_INITIATOR.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + //验证符合性确认-责任人 + if (StringUtils.isNotBlank(infoDiff.get("verifyDutyName"))) { + List list = Arrays.asList(infoDiff.get("verifyDutyName").split(",")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.VERIFY_DUTY.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("verifyDutyName"))) { + List listEn = Arrays.asList(infoDiffEn.get("verifyDutyName").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.VERIFY_DUTY.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + //验证符合性确认-截止时间verifyDueDateString + if (StringUtils.isNotBlank(infoDiff.get("verifyDueDateString"))) { + List list = Arrays.asList(infoDiff.get("verifyDueDateString").split(",")); + + if (list.size() > 1) { + String infoDiffOld = list.get(0); + String infoDiffNew = list.get(1); + contentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; + } + if (StringUtils.isNotBlank(infoDiffEn.get("verifyDueDateString"))) { + List listEn = Arrays.asList(infoDiffEn.get("verifyDueDateString").split(",")); + if (listEn.size() > 1) { + String infoDiffOldEn = listEn.get(0); + String infoDiffNewEn = listEn.get(1); + enContentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; + } + } + } + + contentLog = contentLog.substring(0, contentLog.length() - 1); + enContentLog = enContentLog.substring(0, enContentLog.length() - 1); + projectLawsInventoryLogEOService.updateLog(contentLog, projectLibraryId, CutEnum.CN.getValue()); + projectLawsInventoryLogEOService.updateLog(enContentLog, projectLibraryId, CutEnum.EN.getValue()); + } + } + } + + public String getFileName(ProjectLawsInventoryEO projectLawsInventoryEO, List fileInfos, String deliverableTemplate) { + StringBuilder sb = new StringBuilder(); + for (String s : deliverableTemplate.split(",")) { + List collect = fileInfos.stream().filter(e -> s.equals(e.getId())).collect(Collectors.toList()); + if (collect.size() != 0) { + sb.append(collect.get(0).getFileName() + ","); + } + } + String sbStr = ""; + if (org.apache.commons.lang3.StringUtils.isNotBlank(sb)) { + sbStr = sb.substring(0, sb.length() - 1); + } + return sbStr; + } + + + public String handlePhoneDesignLink(ProjectLawsInventoryEO projectLawsInventoryEO, String actiProcInstId, String taskDefinitionKey) { + String url = backUrlPhone + JumpLinkEnum.TO_DO_CENTER_PHONE.getLink(); + if (!DesignComplianceFlowNodeKeyEnum.TGSC.getValue().equals(taskDefinitionKey)) { + url = backUrlPhone + JumpLinkEnum.TASK_HANDING_PHONE.getLink() + "?actiProcInstId=" + actiProcInstId + "&projectTaskInventoryId=" + projectLawsInventoryEO.getId() + + "&projectLibraryId=" + projectLawsInventoryEO.getProjectLibraryId() + "&TaskKey=" + taskDefinitionKey + + "&TaskKeyName=" + DesignComplianceFlowNodeKeyEnum.getTextByValue(taskDefinitionKey, CutEnum.CN.getValue()) + + "&isDisplay=false&flowType=2&Sponsor=regulationOwnerName&personLiable=designDutyIdName&typeOfDeliverables=designDeliverableTypeName&deliverableTemplate=designDeliverableTemplate&DueDate=designDueDate&remarks=designRemark"; + } + return URLUtil.encode(url); + } + + public String handlePhoneVerifyLink(ProjectLawsInventoryEO projectLawsInventoryEO, String actiProcInstId, String taskDefinitionKey) { + String url = backUrlPhone + JumpLinkEnum.TO_DO_CENTER_PHONE.getLink(); + if (!VerifyComplianceFlowNodeKeyEnum.TGSC.getValue().equals(taskDefinitionKey)) { + url = backUrlPhone + JumpLinkEnum.TASK_HANDING_PHONE.getLink() + "?actiProcInstId=" + actiProcInstId + "&projectTaskInventoryId=" + projectLawsInventoryEO.getId() + + "&projectLibraryId=" + projectLawsInventoryEO.getProjectLibraryId() + "&TaskKey=" + taskDefinitionKey + + "&TaskKeyName=" + VerifyComplianceFlowNodeKeyEnum.getTextByValue(taskDefinitionKey, CutEnum.CN.getValue()) + + "&isDisplay=false&flowType=4&Sponsor=regulationOwnerName&personLiable=verifyDutyIdName&typeOfDeliverables=verifyDeliverableTypeName&deliverableTemplate=verifyDeliverableTemplate&DueDate=verifyDueDate&remarks=verifyRemark"; + } + return URLUtil.encode(url); + } + + + public String handlePhoneDesignLink(ProjectLawsInventoryEO projectLawsInventoryEO) { + String url = backUrlPhone + JumpLinkEnum.TO_DO_CENTER_PHONE.getLink(); + QueryWrapper processInfoDetailEOQueryWrapper = new QueryWrapper<>(); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getProjectLawsInventoryId, projectLawsInventoryEO.getId()); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getFlowType, FlowTypeEnum.SJFHXSHLC.getValue()); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getStatus, TaskStatusEnum.NOT_DONE.getValue()); + List processInfoDetailEOS = this.processInfoDetailEOService.list(processInfoDetailEOQueryWrapper); + if (CollectionUtils.isNotEmpty(processInfoDetailEOS)) { + String designPId = processInfoDetailEOS.get(0).getActiProcInstId(); + String taskId = processInfoDetailEOS.get(0).getTaskId(); + url = backUrlPhone + JumpLinkEnum.TASK_HANDING_PHONE.getLink() + "?taskIds="+taskId+"&actiProcInstId=" + designPId + "&projectTaskInventoryId=" + projectLawsInventoryEO.getId() + + "&projectLibraryId=" + projectLawsInventoryEO.getProjectLibraryId() + "&TaskKey=" + processInfoDetailEOS.get(0).getTaskDefinitionKey() + + "&TaskKeyName=" + DesignComplianceFlowNodeKeyEnum.getTextByValue(processInfoDetailEOS.get(0).getTaskDefinitionKey(), CutEnum.CN.getValue()) + + "&isDisplay=false&flowType=2&Sponsor=regulationOwnerName&personLiable=designDutyIdName&typeOfDeliverables=designDeliverableTypeName&deliverableTemplate=designDeliverableTemplate&DueDate=designDueDate&remarks=designRemark"; + } + return URLUtil.encode(url); + } + + public String handlePhoneVerifyLink(ProjectLawsInventoryEO projectLawsInventoryEO) { + String url = backUrlPhone + JumpLinkEnum.TO_DO_CENTER_PHONE.getLink(); + QueryWrapper processInfoDetailEOQueryWrapper = new QueryWrapper<>(); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getProjectLawsInventoryId, projectLawsInventoryEO.getId()); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getFlowType, FlowTypeEnum.YZFHXSCLC.getValue()); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getStatus, TaskStatusEnum.NOT_DONE.getValue()); + List processInfoDetailEOS = this.processInfoDetailEOService.list(processInfoDetailEOQueryWrapper); + if (CollectionUtils.isNotEmpty(processInfoDetailEOS)) { + String verifyPId = processInfoDetailEOS.get(0).getActiProcInstId(); + String taskId = processInfoDetailEOS.get(0).getTaskId(); + url = backUrlPhone + JumpLinkEnum.TASK_HANDING_PHONE.getLink() + "?taskIds="+taskId+"&actiProcInstId=" + verifyPId + "&projectTaskInventoryId=" + projectLawsInventoryEO.getId() + + "&projectLibraryId=" + projectLawsInventoryEO.getProjectLibraryId() + "&TaskKey=" + processInfoDetailEOS.get(0).getTaskDefinitionKey() + + "&TaskKeyName=" + VerifyComplianceFlowNodeKeyEnum.getTextByValue(processInfoDetailEOS.get(0).getTaskDefinitionKey(), CutEnum.CN.getValue()) + + "&isDisplay=false&flowType=4&Sponsor=regulationOwnerName&personLiable=verifyDutyIdName&typeOfDeliverables=verifyDeliverableTypeName&deliverableTemplate=verifyDeliverableTemplate&DueDate=verifyDueDate&remarks=verifyRemark"; + } + return URLUtil.encode(url); + } } 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 c7d109a83..bda52b6dd 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 @@ -2773,7 +2773,8 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl"; - String enContentLog = username + " edited the “" + projectLawsInventoryEO.getSerialNumber() + "” in the list:
"; - - List infoEOList = new ArrayList<>(); - infoEOList.add(projectLawsInventoryEO); - List infoEOListCopy = new ArrayList<>(); - infoEOListCopy.add(projectLawsInventoryEOCopy); - - //查询数据库里原来的数据 - QueryWrapper queryWrapper = new QueryWrapper<>(); - List dataList = list(queryWrapper.eq("id", projectLawsInventoryEO.getId())); - List dataListCopy = DeepCopyListUtil.depCopy(dataList); - LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); - updateWrapper.in(ProjectLawsInventoryEO::getId, projectLawsInventoryEO.getId()); - setDateNull(projectLawsInventoryEO, updateWrapper); - //保存 - this.update(projectLawsInventoryEO, updateWrapper); -// saveOrUpdate(projectLawsInventoryEO); - - //获取编辑中的责任领域 - List dutyTerritoryList = new ArrayList<>(); - dutyTerritoryList = Arrays.asList(projectLawsInventoryEO.getDutyTerritory().split(",")); - dutyTerritoryList = dutyTerritoryList.stream().distinct().collect(Collectors.toList()); - //获取当前的projectLibrartId - String projectLibrartId = projectLawsInventoryEO.getProjectLibraryId(); - String cut = projectLawsInventoryEO.getCut(); - - Map params = new HashMap<>(); - params.put("projectLibraryId", projectLibrartId); - params.put("userId", currentUser.getId()); - params.put("modelType", RoleRelModelTypeEnum.LAWS_INVENTORY.getValue()); - ProjectLibraryRoleRelEO projectLibraryRoleRelEO = projectLibraryRoleRelEOService.queryByProjectLibraryIdAndUserId(params); - String roleCode1 = projectLibraryRoleRelEO.getRoleCode(); - //分别获取当前编辑中的设计符合性和认证符合性责任人 - List designDutyIdList = new ArrayList<>(); - designDutyIdList = Arrays.asList(projectLawsInventoryEO.getDesignDutyId().split(",")); - List verifyDutyIdList = new ArrayList<>(); - verifyDutyIdList = Arrays.asList(projectLawsInventoryEO.getVerifyDutyId().split(",")); - - //allDutyList 为法规工程师中验证符合性和确认符合中的责任人 - List allDutyList = new ArrayList<>(); - allDutyList.addAll(designDutyIdList); - allDutyList.addAll(verifyDutyIdList); - allDutyList = allDutyList.stream().distinct().collect(Collectors.toList()); - - //获取相关责任领域下的和projectLibrartId的相关人员名单的信息 - List projectRelatedPersonnelList = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritoy(projectLibrartId, dutyTerritoryList); - - List allList = new ArrayList<>(); - List enginnerList = new ArrayList<>(); - List lawEnginnerList = new ArrayList<>(); - List enginnerLawSetList = new ArrayList<>(); - List enginnerAttSetList = new ArrayList<>(); - //根据相关人员名单获取的工程接口人 - for (ProjectRelatedPersonnel relatedPersonnel : projectRelatedPersonnelList) { - String enginneringInterfacePerson = relatedPersonnel.getEngineeringInterfacePerson(); - if (!StringUtils.isEmpty(enginneringInterfacePerson)) { - enginnerList = Arrays.stream(enginneringInterfacePerson.split(",")).collect(Collectors.toList()); - allList.addAll(enginnerList); - } - } - //获取相关人员名单中的法规工程师 - for (ProjectRelatedPersonnel relatedPersonnel : projectRelatedPersonnelList) { - String lawEngineer = relatedPersonnel.getLawEngineer(); - if (!StringUtils.isEmpty(lawEngineer)) { - lawEnginnerList = Arrays.stream(lawEngineer.split(",")).collect(Collectors.toList()); - allList.addAll(lawEnginnerList); - } - } - //获取相关人员名单中的工程接口-法规工程师设置 - for (ProjectRelatedPersonnel relatedPersonnel : projectRelatedPersonnelList) { - String engineerLawSet = relatedPersonnel.getEngineerLawSet(); - if (!StringUtils.isEmpty(engineerLawSet)) { - enginnerLawSetList = Arrays.stream(engineerLawSet.split(",")).collect(Collectors.toList()); - allList.addAll(enginnerLawSetList); - } - } - //获取相关人员名单中的工程接口-认证工程师设置 - for (ProjectRelatedPersonnel relatedPersonnel : projectRelatedPersonnelList) { - String engineerAttSet = relatedPersonnel.getEngineerAttSet(); - if (!StringUtils.isEmpty(engineerAttSet)) { - enginnerAttSetList = Arrays.stream(engineerAttSet.split(",")).collect(Collectors.toList()); - allList.addAll(enginnerAttSetList); - } - } - //获取当前项目库id的studio工程师和认证工程师 - List studionList = new ArrayList<>(); - List certificationEngineerList = new ArrayList<>(); - List projectLibraryBases = projectLibraryBaseService.queryById(projectLibrartId, cut); - for (ProjectLibraryBase projectLibraryBase : projectLibraryBases) { - studionList.add(projectLibraryBase.getStudioEngineer()); - - String certificationEngineer = projectLibraryBase.getCertificationEngineer(); - if (!StringUtils.isEmpty(certificationEngineer)) { - certificationEngineerList = Arrays.stream(certificationEngineer.split(",")).collect(Collectors.toList()); - allList.addAll(certificationEngineerList); - } - } - allList = allList.stream().filter(all -> { - return StringUtils.isNotBlank(all); - }).distinct().collect(Collectors.toList()); - /* - for(String all : allList){ - if(all.equals("")){ - allList.remove(all); - } - } - */ - //遍历所有人alllist中是否包含责任人,如果包含,不用操作。 - //-------如果不包含,再去判断当前用户的角色是studio、法规还是认证 - for (ProjectRelatedPersonnel relatedPersonnel : projectRelatedPersonnelList) { - if (allList.size() > 0) { - for (String allDuty : allDutyList) { - String dutyPerson = allDuty; - if (StringUtils.isNotEmpty(dutyPerson) && !allList.contains(dutyPerson) && StringUtils.isNotEmpty(roleCode1)) { - if (roleCode1.equals(com.jero.modules.project.enums.ProjectRoleEnum.STUDIO_ENGINEER.getValue())) { - if (relatedPersonnel.getEngineeringInterfacePerson() != null) { - String engineeringInterfacePerson = dutyPerson + "," + relatedPersonnel.getEngineeringInterfacePerson(); - relatedPersonnel.setEngineeringInterfacePerson(engineeringInterfacePerson); - } else { - relatedPersonnel.setEngineeringInterfacePerson(dutyPerson); - } - } else if (roleCode1.equals(com.jero.modules.project.enums.ProjectRoleEnum.REGULATI_ENGINEER.getValue())) { - if (relatedPersonnel.getEngineerLawSet() != null) { - String engineerLawSet = dutyPerson + "," + relatedPersonnel.getEngineerLawSet(); - relatedPersonnel.setEngineerLawSet(engineerLawSet); - } else { - relatedPersonnel.setEngineerLawSet(dutyPerson); - } - } else if (roleCode1.equals(com.jero.modules.project.enums.ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue())) { - if (relatedPersonnel.getEngineerAttSet() != null) { - String engineerAttSet = dutyPerson + "," + relatedPersonnel.getEngineerAttSet(); - relatedPersonnel.setEngineerAttSet(engineerAttSet); - } else { - relatedPersonnel.setEngineerAttSet(dutyPerson); - } - } - } - } - } - } - this.projectRelatedPersonnelService.updateBatchById(projectRelatedPersonnelList); - - - //翻译-中文 - translateData(infoEOList); - translateData(dataList); - //翻译-英文 - translateDataToEn(infoEOListCopy); - translateDataToEn(dataListCopy); - - //比对不同字段 - Map infoDiff = ListDiff.compareObject(dataList.get(0), projectLawsInventoryEO); - Map infoDiffEn = ListDiff.compareObject(dataListCopy.get(0), projectLawsInventoryEOCopy); - - //设置更新log - setContentLog(infoDiff, contentLog, infoDiffEn, enContentLog, projectLawsInventoryEO.getProjectLibraryId()); - - - //验证用户是否是该法规上级 项目库的studio, 如果是,则同步更新流程 - int roleCode = checkUserRole(projectLawsInventoryEO.getProjectLibraryId(), currentUser.getId(), ""); - if (StringUtils.equals(String.valueOf(roleCode), ProjectRoleEnum.STUDIO_ENGINEER.getValue())) { - //更新流程信息 - updateFlowInfo(projectLawsInventoryEO); - } - - //设置权限 先删后加 - List adds = new ArrayList<>(); - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId())) { - setProjectLawsInventoryPermission(projectLawsInventoryEO.getRegulationOwnerId(), projectLawsInventoryEO.getProjectLibraryId(), projectLawsInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_REGULATION.getValue()); - } - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerId())) { - setProjectLawsInventoryPermission(projectLawsInventoryEO.getHomologationEngineerId(), projectLawsInventoryEO.getProjectLibraryId(), projectLawsInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_HOMOLOGATION.getValue()); - } - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())) { - setProjectLawsInventoryPermission(projectLawsInventoryEO.getEngineeringInterfacePerson(), projectLawsInventoryEO.getProjectLibraryId(), projectLawsInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_INTERFACE.getValue()); - } - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getDesignInitiatorId())) { - setProjectLawsInventoryPermission(projectLawsInventoryEO.getDesignInitiatorId(), projectLawsInventoryEO.getProjectLibraryId(), projectLawsInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_DESIGN_INITIATOR.getValue()); - } - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getDesignDutyId())) { - setProjectLawsInventoryPermission(projectLawsInventoryEO.getDesignDutyId(), projectLawsInventoryEO.getProjectLibraryId(), projectLawsInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_DESIGN_DUTY.getValue()); - } - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getPrehomoInitiatorId())) { - setProjectLawsInventoryPermission(projectLawsInventoryEO.getPrehomoInitiatorId(), projectLawsInventoryEO.getProjectLibraryId(), projectLawsInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_PREHOMO_INITIATOR.getValue()); - } - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getPrehomoDutyId())) { - setProjectLawsInventoryPermission(projectLawsInventoryEO.getPrehomoDutyId(), projectLawsInventoryEO.getProjectLibraryId(), projectLawsInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_PREHOMO_DUTY.getValue()); - } - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getVerifyInitiatorId())) { - setProjectLawsInventoryPermission(projectLawsInventoryEO.getVerifyInitiatorId(), projectLawsInventoryEO.getProjectLibraryId(), projectLawsInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_VERIFY_INITIATOR.getValue()); - } - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDutyId())) { - setProjectLawsInventoryPermission(projectLawsInventoryEO.getVerifyDutyId(), projectLawsInventoryEO.getProjectLibraryId(), projectLawsInventoryEO.getId(), now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_VERIFY_DUTY.getValue()); - } - if (ObjectUtils.isNotEmpty(adds)) { - projectUserPermissionService.saveBatch(adds); - } - - - } else { - throw new JeroBootException("该用户没有权限操作该数据!"); - } - } - - /** - * 编辑法规清单,发送消息 - * - * @param projectLawsInventoryEO - */ - private void updateProjectLawsInventorySendMessage(ProjectLawsInventoryEO projectLawsInventoryEO) { - LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - - ProjectLawsInventoryEO projectLawsInventoryOld = this.queryById(projectLawsInventoryEO.getId()); - // 是否不在流程中 - boolean isNotInDesignProcess = ( - StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.CONFORMITY.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TERMINATION_OF_TASK.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue()) - ); - boolean isNotInVerifyProcess = ( - StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.CONFORMITY.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TERMINATION_OF_TASK.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.UNINVOLVED.getValue()) - ); - - // 清单待校核 - boolean toBeCheckedFlag = ( - StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.LIST_TO_BE_CHECKED.getValue()) - ); - // 结果待审查 - boolean toBeReviewedFlag = ( - StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) - ); - - // 编辑前、编辑后的法规工程师都不为空。 - boolean regulationOwnerIsNotNull = ( - StringUtils.isNotEmpty(projectLawsInventoryOld.getRegulationOwnerId()) - && StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId()) - ); - - if (regulationOwnerIsNotNull && !isNotInDesignProcess && !isNotInVerifyProcess) { - // 如果编辑了法规工程师,给之前的法规工程师发消息 - if (!StringUtils.equals(projectLawsInventoryOld.getRegulationOwnerId(), projectLawsInventoryEO.getRegulationOwnerId())) { - String endTime = ""; - if (projectLawsInventoryOld.getInventoryAffirmDueDate() != null) { - endTime = DateUtils.formatDate(projectLawsInventoryOld.getInventoryAffirmDueDate()); - } - - String regulationOwnerId = projectLawsInventoryOld.getRegulationOwnerId(); - // 给法规工程师发消息 - Map params = new HashMap<>(); - params.put("contentCn", "您好,您以下任务已被发起人撤回。"); - params.put("contentEn", "Hello! Your task has been withdrawn by the initiator."); - params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); - params.put("endTime", endTime); - params.put("userIdList", Arrays.asList(regulationOwnerId.split(","))); - params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber()); - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); - if (ObjectUtils.isNotEmpty(projectLibraryBase)) { - String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 - String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 - // 获取待办中心 - 飞书跳转链接 - Map todoCenterParams = new HashMap<>(); - todoCenterParams.put("projectNameCn", PRN_CN); - todoCenterParams.put("projectNameEn", PRN_EN); - Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); - params.put("hrefFeishu_CN", hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN", hrefFeishuMap.get("hrefFeishu_EN")); - params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); - - List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); - String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); - params.put("Initiator", regulationOwnerUserName); - - if(StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())){ - params.put("flowTypeCn","设计符合性流程"); - params.put("flowTypeEn","Design Compliance Process"); - //处理手机端飞书消息跳转 - String hrefFeishu_CN_P = this.handlePhoneDesignLink(projectLawsInventoryEO); - params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); - this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params); - }else if(StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())){ - params.put("flowTypeCn","验证符合性流程"); - params.put("flowTypeEn","Verify Compliance Process"); - //处理手机端飞书消息跳转 - String hrefFeishu_CN_P = this.handlePhoneVerifyLink(projectLawsInventoryEO); - params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); - this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params); - }else{ - this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params); - } - - } - } - } - if ((projectLawsInventoryOld.getDesignDueDate() != null && projectLawsInventoryEO.getDesignDueDate() != null) && !isNotInDesignProcess) { - if (!projectLawsInventoryOld.getDesignDueDate().equals(projectLawsInventoryEO.getDesignDueDate())) { - String endTime = ""; - if (projectLawsInventoryEO.getDesignDueDate() != null) { - endTime = DateUtils.formatDate(projectLawsInventoryEO.getDesignDueDate()); - } - - String regulationOwnerId = projectLawsInventoryEO.getRegulationOwnerId(); - // 给法规工程师发消息 - Map params = new HashMap<>(); - params.put("contentCn", "您好,以下符合性任务的截止时间已被发起人修改。"); - params.put("contentEn", "Hello! The due date of the compliance task has been modified by the initiator."); - params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); - params.put("endTime", endTime); - params.put("userIdList", Arrays.asList(regulationOwnerId.split(","))); - params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber()); - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); - if (ObjectUtils.isNotEmpty(projectLibraryBase)) { - String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 - String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 - // 获取待办中心 - 飞书跳转链接 - Map todoCenterParams = new HashMap<>(); - todoCenterParams.put("projectNameCn", PRN_CN); - todoCenterParams.put("projectNameEn", PRN_EN); - Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); - params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); - params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); - List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); - String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); - params.put("Initiator", regulationOwnerUserName); - - if(StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())){ - params.put("flowTypeCn","设计符合性流程"); - params.put("flowTypeEn","Design Compliance Process"); - //处理手机端飞书消息跳转 - String hrefFeishu_CN_P = this.handlePhoneDesignLink(projectLawsInventoryEO); - params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); - this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params); - }else{ - this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params); - } - } - } - } - if ((projectLawsInventoryOld.getVerifyDueDate() != null && projectLawsInventoryEO.getVerifyDueDate() != null) && !isNotInVerifyProcess) { - if (!projectLawsInventoryOld.getVerifyDueDate().equals(projectLawsInventoryEO.getVerifyDueDate())) { - String endTime = ""; - if (projectLawsInventoryEO.getVerifyDueDate() != null) { - endTime = DateUtils.formatDate(projectLawsInventoryEO.getVerifyDueDate()); - } - - String regulationOwnerId = projectLawsInventoryEO.getRegulationOwnerId(); - // 给法规工程师发消息 - Map params = new HashMap<>(); - params.put("contentCn", "您好,以下符合性任务的截止时间已被发起人修改。"); - params.put("contentEn", "Hello! The due date of the compliance task has been modified by the initiator."); - params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); - params.put("endTime", endTime); - params.put("userIdList", Arrays.asList(regulationOwnerId.split(","))); - params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber()); - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); - if (ObjectUtils.isNotEmpty(projectLibraryBase)) { - String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 - String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 - // 获取待办中心 - 飞书跳转链接 - Map todoCenterParams = new HashMap<>(); - todoCenterParams.put("projectNameCn", PRN_CN); - todoCenterParams.put("projectNameEn", PRN_EN); - Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); - params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); - params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); - List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); - String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); - params.put("Initiator", regulationOwnerUserName); - - if(StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) - ||StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())){ - params.put("flowTypeCn","验证符合性流程"); - params.put("flowTypeEn","Verify Compliance Process"); - //处理手机端飞书消息跳转 - String hrefFeishu_CN_P = this.handlePhoneVerifyLink(projectLawsInventoryEO); - params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); - this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params); - }else{ - this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params); - } - } - } - } - - // 设计符合性 任务待确认消息 标识 - boolean toBeConfirmedDesignFlag = ( - StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) - ); - - if ((projectLawsInventoryOld.getDesignDutyId() != null && projectLawsInventoryEO.getDesignDutyId() != null) && toBeConfirmedDesignFlag) { - if (!projectLawsInventoryOld.getDesignDutyId().equals(projectLawsInventoryEO.getDesignDutyId())) { - String endTime = ""; - if (projectLawsInventoryOld.getDesignDueDate() != null) { - endTime = DateUtils.formatDate(projectLawsInventoryOld.getDesignDueDate()); - } - - String regulationOwnerId = projectLawsInventoryOld.getRegulationOwnerId(); - // 给设计符合性-责任人发消息 - Map params = new HashMap<>(); - params.put("contentCn", "您好,您以下任务已被发起人撤回。"); - params.put("contentEn", "Hello! Your task has been withdrawn by the initiator."); - params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); - params.put("endTime", endTime); - params.put("userIdList", Arrays.asList(projectLawsInventoryOld.getDesignDutyId().split(","))); - params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber()); - params.put("flowTypeCn","设计符合性流程"); - params.put("flowTypeEn","Design Compliance Process"); - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); - if (ObjectUtils.isNotEmpty(projectLibraryBase)) { - String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 - String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 - // 获取待办中心 - 飞书跳转链接 - Map todoCenterParams = new HashMap<>(); - todoCenterParams.put("projectNameCn", PRN_CN); - todoCenterParams.put("projectNameEn", PRN_EN); - Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); - params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); - params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); - List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); - String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); - params.put("Initiator", regulationOwnerUserName); - if(StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())){ - //处理手机端飞书消息跳转 - String hrefFeishu_CN_P = this.handlePhoneDesignLink(projectLawsInventoryEO); - params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); - this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params); - }else{ - this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4.getValue(), params); - } - } - } - } - - // 验证符合性 任务待确认消息 标识 - boolean toBeConfirmedVerifyFlag = ( - StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) - ); - if ((projectLawsInventoryOld.getVerifyDutyId() != null && projectLawsInventoryEO.getVerifyDutyId() != null) && toBeConfirmedVerifyFlag) { - if (!projectLawsInventoryOld.getVerifyDutyId().equals(projectLawsInventoryEO.getVerifyDutyId())) { - String endTime = ""; - if (projectLawsInventoryOld.getVerifyDueDate() != null) { - endTime = DateUtils.formatDate(projectLawsInventoryOld.getVerifyDueDate()); - } - - String regulationOwnerId = projectLawsInventoryOld.getRegulationOwnerId(); - // 给设计符合性-责任人发消息 - Map params = new HashMap<>(); - params.put("contentCn", "您好,您以下任务已被发起人撤回。"); - params.put("contentEn", "Hello! Your task has been withdrawn by the initiator."); - params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); - params.put("endTime", endTime); - params.put("userIdList", Arrays.asList(projectLawsInventoryOld.getDesignDutyId().split(","))); - params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber()); - params.put("flowTypeCn","验证符合性流程"); - params.put("flowTypeEn","Verify Compliance Process"); - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); - if (ObjectUtils.isNotEmpty(projectLibraryBase)) { - String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 - String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 - // 获取待办中心 - 飞书跳转链接 - Map todoCenterParams = new HashMap<>(); - todoCenterParams.put("projectNameCn", PRN_CN); - todoCenterParams.put("projectNameEn", PRN_EN); - Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); - params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); - params.put("hrefFeishu_CN_P",(String)hrefFeishuMap.get("hrefFeishu_CN_P")); - List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); - String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); - params.put("Initiator", regulationOwnerUserName); - if(StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue())){ - //处理手机端飞书消息跳转 - String hrefFeishu_CN_P = this.handlePhoneVerifyLink(projectLawsInventoryEO); - params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); - this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params); - }else{ - this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION4.getValue(), params); - } - - } - } - } - - // 如果编辑了法规工程师,给新的法规工程师发消息 - if ((StringUtils.isNotEmpty(projectLawsInventoryOld.getRegulationOwnerId()) && StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId()))) { - if (!StringUtils.equals(projectLawsInventoryOld.getRegulationOwnerId(), projectLawsInventoryEO.getRegulationOwnerId())) { - String endTime = ""; - String regulationOwnerId = ""; - - if (!isNotInDesignProcess) { - if (projectLawsInventoryEO.getDesignDueDate() != null) { - endTime = DateUtils.formatDate(projectLawsInventoryEO.getDesignDueDate()); - } - - regulationOwnerId = projectLawsInventoryEO.getRegulationOwnerId(); - // 给法规工程师发消息 - Map params = new HashMap<>(); - params.put("contentCn", "您好," + currentUser.getUsername() + "向您分发了该任务,请及时查看处理。"); - params.put("contentEn", "Hello! " + currentUser.getUsername() + " has assigned this task to you. Please check and address it in a timely manner."); - params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); - params.put("endTime", endTime); - params.put("userIdList", Arrays.asList(regulationOwnerId.split(","))); - params.put("serialNumbers", projectLawsInventoryEO.getSerialNumber()); - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); - if (ObjectUtils.isNotEmpty(projectLibraryBase)) { - String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 - String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 - // 获取待办中心 - 飞书跳转链接 - Map todoCenterParams = new HashMap<>(); - todoCenterParams.put("projectNameCn", PRN_CN); - todoCenterParams.put("projectNameEn", PRN_EN); - Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); - params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); - //处理手机端飞书消息跳转 - String hrefFeishu_CN_P = this.handlePhoneDesignLink(projectLawsInventoryEO); - params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); - List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); - String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); - params.put("Initiator", regulationOwnerUserName); - - this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params); - } - } - - if (!isNotInVerifyProcess) { - if (projectLawsInventoryEO.getVerifyDueDate() != null) { - endTime = DateUtils.formatDate(projectLawsInventoryEO.getVerifyDueDate()); - } - regulationOwnerId = projectLawsInventoryEO.getRegulationOwnerId(); - // 给法规工程师发消息 - Map params = new HashMap<>(); - params.put("contentCn", "您好," + currentUser.getUsername() + "向您分发了该任务,请及时查看处理。"); - params.put("contentEn", "Hello! " + currentUser.getUsername() + " has assigned this task to you. Please check and address it in a timely manner."); - params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); - params.put("endTime", endTime); - params.put("userIdList", Arrays.asList(regulationOwnerId.split(","))); - params.put("serialNumbers", projectLawsInventoryEO.getSerialNumber()); - - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); - if (ObjectUtils.isNotEmpty(projectLibraryBase)) { - String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 - String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 - // 获取待办中心 - 飞书跳转链接 - Map todoCenterParams = new HashMap<>(); - todoCenterParams.put("projectNameCn", PRN_CN); - todoCenterParams.put("projectNameEn", PRN_EN); - Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); - params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); - //处理手机端飞书消息跳转 - String hrefFeishu_CN_P = this.handlePhoneVerifyLink(projectLawsInventoryEO); - params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); - - List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); - String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); - params.put("Initiator", regulationOwnerUserName); - - this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params); - } - } - } - } - //交付物类型修改 - if (StringUtils.equals(projectLawsInventoryEO.getDesignDeliverableType(), projectLawsInventoryOld.getDesignDeliverableType()) && !isNotInDesignProcess) { - String endTime = ""; - if (projectLawsInventoryOld.getDesignDueDate() != null) { - endTime = DateUtils.formatDate(projectLawsInventoryOld.getDesignDueDate()); - } - - String regulationOwnerId = projectLawsInventoryEO.getDesignDuty(); - // 给设计符合性-责任人发消息 - Map params = new HashMap<>(); - params.put("contentCn", "您好,以下符合性任务的交付物类型已被发起人修改。"); - params.put("contentEn", "Hello! The type of deliverables of the compliance task has been modified by the initiator."); - params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); - params.put("endTime", endTime); - params.put("userIdList", Arrays.asList(projectLawsInventoryOld.getDesignDutyId().split(","))); - params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber()); - params.put("flowTypeCn", "设计符合性流程"); - params.put("flowTypeEn", "Design Compliance Process"); - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); - if (ObjectUtils.isNotEmpty(projectLibraryBase)) { - String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 - String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 - // 获取待办中心 - 飞书跳转链接 - Map todoCenterParams = new HashMap<>(); - todoCenterParams.put("projectNameCn", PRN_CN); - todoCenterParams.put("projectNameEn", PRN_EN); - Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); - params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); - params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); - List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); - String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); - params.put("Initiator", regulationOwnerUserName); - if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { - params.put("flowTypeCn", "设计符合性流程"); - params.put("flowTypeEn", "Design Compliance Process"); - //处理手机端飞书消息跳转 - String hrefFeishu_CN_P = this.handlePhoneDesignLink(projectLawsInventoryEO); - params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); - this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params); - } else if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { - params.put("flowTypeCn", "验证符合性流程"); - params.put("flowTypeEn", "Verify Compliance Process"); - //处理手机端飞书消息跳转 - String hrefFeishu_CN_P = this.handlePhoneVerifyLink(projectLawsInventoryEO); - params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); - this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params); - } else { - this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params); - } - } - } - //交付物类型修改 - if (StringUtils.equals(projectLawsInventoryEO.getVerifyDeliverableType(), projectLawsInventoryOld.getVerifyDeliverableType()) && !isNotInVerifyProcess) { - String endTime = ""; - if (projectLawsInventoryOld.getVerifyDueDate() != null) { - endTime = DateUtils.formatDate(projectLawsInventoryOld.getVerifyDueDate()); - } - - String regulationOwnerId = projectLawsInventoryEO.getVerifyDuty(); - // 给设计符合性-责任人发消息 - Map params = new HashMap<>(); - params.put("contentCn", "您好,以下符合性任务的交付物类型已被发起人修改。"); - params.put("contentEn", "Hello! The type of deliverables of the compliance task has been modified by the initiator."); - params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); - params.put("endTime", endTime); - params.put("userIdList", Arrays.asList(projectLawsInventoryOld.getVerifyDutyId().split(","))); - params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber()); - params.put("flowTypeCn", "验证符合性流程"); - params.put("flowTypeEn", "Verify Compliance Process"); - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); - if (ObjectUtils.isNotEmpty(projectLibraryBase)) { - String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 - String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 - // 获取待办中心 - 飞书跳转链接 - Map todoCenterParams = new HashMap<>(); - todoCenterParams.put("projectNameCn", PRN_CN); - todoCenterParams.put("projectNameEn", PRN_EN); - Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); - params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); - params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); - List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); - String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); - params.put("Initiator", regulationOwnerUserName); - if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { - params.put("flowTypeCn", "设计符合性流程"); - params.put("flowTypeEn", "Design Compliance Process"); - //处理手机端飞书消息跳转 - String hrefFeishu_CN_P = this.handlePhoneDesignLink(projectLawsInventoryEO); - params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); - this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params); - } else if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { - params.put("flowTypeCn", "验证符合性流程"); - params.put("flowTypeEn", "Verify Compliance Process"); - //处理手机端飞书消息跳转 - String hrefFeishu_CN_P = this.handlePhoneVerifyLink(projectLawsInventoryEO); - params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); - this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params); - } else { - this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params); - } - } - } - //交付物模板修改 - if (StringUtils.equals(projectLawsInventoryEO.getDesignDeliverableTemplate(), projectLawsInventoryOld.getDesignDeliverableTemplate()) && !isNotInDesignProcess) { - String endTime = ""; - if (projectLawsInventoryOld.getDesignDueDate() != null) { - endTime = DateUtils.formatDate(projectLawsInventoryOld.getDesignDueDate()); - } - - String regulationOwnerId = projectLawsInventoryEO.getDesignDuty(); - // 给设计符合性-责任人发消息 - Map params = new HashMap<>(); - params.put("contentCn", "您好,以下符合性任务的交付物模板已被发起人修改。"); - params.put("contentEn", "Hello! The deliverable template of the compliance task has been modified by the initiator."); - params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); - params.put("endTime", endTime); - params.put("userIdList", Arrays.asList(projectLawsInventoryOld.getDesignDutyId().split(","))); - params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber()); - params.put("flowTypeCn", "设计符合性流程"); - params.put("flowTypeEn", "Design Compliance Process"); - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); - if (ObjectUtils.isNotEmpty(projectLibraryBase)) { - String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 - String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 - // 获取待办中心 - 飞书跳转链接 - Map todoCenterParams = new HashMap<>(); - todoCenterParams.put("projectNameCn", PRN_CN); - todoCenterParams.put("projectNameEn", PRN_EN); - Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); - params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); - params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); - List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); - String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); - params.put("Initiator", regulationOwnerUserName); - if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { - params.put("flowTypeCn", "设计符合性流程"); - params.put("flowTypeEn", "Design Compliance Process"); - //处理手机端飞书消息跳转 - String hrefFeishu_CN_P = this.handlePhoneDesignLink(projectLawsInventoryEO); - params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); - this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params); - } else if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { - params.put("flowTypeCn", "验证符合性流程"); - params.put("flowTypeEn", "Verify Compliance Process"); - //处理手机端飞书消息跳转 - String hrefFeishu_CN_P = this.handlePhoneVerifyLink(projectLawsInventoryEO); - params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); - this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params); - } else { - this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params); - } - } - } - if (StringUtils.equals(projectLawsInventoryEO.getVerifyDeliverableTemplate(), projectLawsInventoryOld.getVerifyDeliverableTemplate()) && !isNotInVerifyProcess) { - String endTime = ""; - if (projectLawsInventoryOld.getVerifyDueDate() != null) { - endTime = DateUtils.formatDate(projectLawsInventoryOld.getVerifyDueDate()); - } - - String regulationOwnerId = projectLawsInventoryEO.getVerifyDuty(); - // 给设计符合性-责任人发消息 - Map params = new HashMap<>(); - params.put("contentCn", "您好,以下符合性任务的交付物模板已被发起人修改。"); - params.put("contentEn", "Hello! The deliverable template of the compliance task has been modified by the initiator."); - params.put("projectLibraryId", projectLawsInventoryEO.getProjectLibraryId()); - params.put("endTime", endTime); - params.put("userIdList", Arrays.asList(projectLawsInventoryOld.getVerifyDutyId().split(","))); - params.put("serialNumbers", projectLawsInventoryOld.getSerialNumber()); - params.put("flowTypeCn", "验证符合性流程"); - params.put("flowTypeEn", "Verify Compliance Process"); - - ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.selectById(projectLawsInventoryEO.getProjectLibraryId()); - if (ObjectUtils.isNotEmpty(projectLibraryBase)) { - String PRN_EN = projectLibraryBase.getProjectNameEn();//项目名称 英文 - String PRN_CN = projectLibraryBase.getProjectNameCn();//项目名称 中文 - // 获取待办中心 - 飞书跳转链接 - Map todoCenterParams = new HashMap<>(); - todoCenterParams.put("projectNameCn", PRN_CN); - todoCenterParams.put("projectNameEn", PRN_EN); - Map hrefFeishuMap = this.getToDoCenterLinkHrefFeishu(projectLibraryBase.getId(), todoCenterParams); - params.put("hrefFeishu_CN", (String) hrefFeishuMap.get("hrefFeishu_CN")); - params.put("hrefFeishu_EN", (String) hrefFeishuMap.get("hrefFeishu_EN")); - params.put("hrefFeishu_CN_P", (String) hrefFeishuMap.get("hrefFeishu_CN_P")); - List regulationOwnerUserList = this.sysUserService.querySysUserListByIdList(Arrays.asList(regulationOwnerId.split(","))); - String regulationOwnerUserName = this.sysUserService.getUsernameByUserId(regulationOwnerUserList, regulationOwnerId); - params.put("Initiator", regulationOwnerUserName); - if (StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getDesignFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { - params.put("flowTypeCn", "设计符合性流程"); - params.put("flowTypeEn", "Design Compliance Process"); - //处理手机端飞书消息跳转 - String hrefFeishu_CN_P = this.handlePhoneDesignLink(projectLawsInventoryEO); - params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); - this.sendMessageByTemplateId(TemplateInfoEnum2.DESIGN_COMPLIANCE_CONFIRMATION1.getValue(), params); - } else if (StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.RESULTS_TO_BE_REVIEWED.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.TO_TRACK.getValue()) - || StringUtils.equals(projectLawsInventoryOld.getVerifyFlowStatus(), ComplianceFlowStatusEnum.INCONFORMITY.getValue())) { - params.put("flowTypeCn", "验证符合性流程"); - params.put("flowTypeEn", "Verify Compliance Process"); - //处理手机端飞书消息跳转 - String hrefFeishu_CN_P = this.handlePhoneVerifyLink(projectLawsInventoryEO); - params.put("hrefFeishu_CN_P", hrefFeishu_CN_P); - this.sendMessageByTemplateId(TemplateInfoEnum2.VALIDATION_COMPLIANCE_CONFIRMATION1.getValue(), params); - } else { - this.sendMessageByTemplateId(TemplateInfoEnum2.REGULATION_TASK_CONFIRMATION1.getValue(), params); - } - } - } - } - - private String handlePhoneDesignLink(ProjectLawsInventoryEO projectLawsInventoryEO,String actiProcInstId,String taskDefinitionKey) { - String url = backUrlPhone + JumpLinkEnum.TO_DO_CENTER_PHONE.getLink(); - if(!DesignComplianceFlowNodeKeyEnum.TGSC.getValue().equals(taskDefinitionKey)){ - url = backUrlPhone + JumpLinkEnum.TASK_HANDING_PHONE.getLink() + "?actiProcInstId=" + actiProcInstId + "&projectTaskInventoryId=" + projectLawsInventoryEO.getId() - + "&projectLibraryId=" + projectLawsInventoryEO.getProjectLibraryId() + "&TaskKey=" + taskDefinitionKey - + "&TaskKeyName=" + DesignComplianceFlowNodeKeyEnum.getTextByValue(taskDefinitionKey, CutEnum.CN.getValue()) - + "&isDisplay=false&flowType=2&Sponsor=regulationOwnerName&personLiable=designDutyIdName&typeOfDeliverables=designDeliverableTypeName&deliverableTemplate=designDeliverableTemplate&DueDate=designDueDate&remarks=designRemark"; - } - return URLUtil.encode(url); - } - - private String handlePhoneVerifyLink(ProjectLawsInventoryEO projectLawsInventoryEO,String actiProcInstId,String taskDefinitionKey) { - String url = backUrlPhone + JumpLinkEnum.TO_DO_CENTER_PHONE.getLink(); - if (!VerifyComplianceFlowNodeKeyEnum.TGSC.getValue().equals(taskDefinitionKey)) { - url = backUrlPhone + JumpLinkEnum.TASK_HANDING_PHONE.getLink() + "?actiProcInstId="+actiProcInstId+"&projectTaskInventoryId="+projectLawsInventoryEO.getId() - +"&projectLibraryId="+projectLawsInventoryEO.getProjectLibraryId()+"&TaskKey="+taskDefinitionKey - +"&TaskKeyName="+ VerifyComplianceFlowNodeKeyEnum.getTextByValue(taskDefinitionKey,CutEnum.CN.getValue()) - +"&isDisplay=false&flowType=4&Sponsor=regulationOwnerName&personLiable=verifyDutyIdName&typeOfDeliverables=verifyDeliverableTypeName&deliverableTemplate=verifyDeliverableTemplate&DueDate=verifyDueDate&remarks=verifyRemark"; - } - return URLUtil.encode(url); - } - - private String handlePhoneDesignLink(ProjectLawsInventoryEO projectLawsInventoryEO) { - String url = backUrlPhone + JumpLinkEnum.TO_DO_CENTER_PHONE.getLink(); - QueryWrapper processInfoDetailEOQueryWrapper = new QueryWrapper<>(); - processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getProjectLawsInventoryId, projectLawsInventoryEO.getId()); - processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getFlowType, FlowTypeEnum.SJFHXSHLC.getValue()); - processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getStatus, TaskStatusEnum.NOT_DONE.getValue()); - List processInfoDetailEOS = this.processInfoDetailEOService.list(processInfoDetailEOQueryWrapper); - if (CollectionUtils.isNotEmpty(processInfoDetailEOS)) { - String designPId = processInfoDetailEOS.get(0).getActiProcInstId(); - url = backUrlPhone + JumpLinkEnum.TASK_HANDING_PHONE.getLink() + "?actiProcInstId=" + designPId + "&projectTaskInventoryId=" + projectLawsInventoryEO.getId() - + "&projectLibraryId=" + projectLawsInventoryEO.getProjectLibraryId() + "&TaskKey=" + processInfoDetailEOS.get(0).getTaskDefinitionKey() - + "&TaskKeyName=" + DesignComplianceFlowNodeKeyEnum.getTextByValue(processInfoDetailEOS.get(0).getTaskDefinitionKey(), CutEnum.CN.getValue()) - + "&isDisplay=false&flowType=2&Sponsor=regulationOwnerName&personLiable=designDutyIdName&typeOfDeliverables=designDeliverableTypeName&deliverableTemplate=designDeliverableTemplate&DueDate=designDueDate&remarks=designRemark"; - } - return URLUtil.encode(url); - } - - private String handlePhoneVerifyLink(ProjectLawsInventoryEO projectLawsInventoryEO) { - String url = backUrlPhone + JumpLinkEnum.TO_DO_CENTER_PHONE.getLink(); - QueryWrapper processInfoDetailEOQueryWrapper = new QueryWrapper<>(); - processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getProjectLawsInventoryId, projectLawsInventoryEO.getId()); - processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getFlowType, FlowTypeEnum.YZFHXSCLC.getValue()); - processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getStatus, TaskStatusEnum.NOT_DONE.getValue()); - List processInfoDetailEOS = this.processInfoDetailEOService.list(processInfoDetailEOQueryWrapper); - if (CollectionUtils.isNotEmpty(processInfoDetailEOS)) { - String verifyPId = processInfoDetailEOS.get(0).getActiProcInstId(); - url = backUrlPhone + JumpLinkEnum.TASK_HANDING_PHONE.getLink() + "?actiProcInstId="+verifyPId+"&projectTaskInventoryId="+projectLawsInventoryEO.getId() - +"&projectLibraryId="+projectLawsInventoryEO.getProjectLibraryId()+"&TaskKey="+processInfoDetailEOS.get(0).getTaskDefinitionKey() - +"&TaskKeyName="+ VerifyComplianceFlowNodeKeyEnum.getTextByValue(processInfoDetailEOS.get(0).getTaskDefinitionKey(),CutEnum.CN.getValue()) - +"&isDisplay=false&flowType=4&Sponsor=regulationOwnerName&personLiable=verifyDutyIdName&typeOfDeliverables=verifyDeliverableTypeName&deliverableTemplate=verifyDeliverableTemplate&DueDate=verifyDueDate&remarks=verifyRemark"; - } - return URLUtil.encode(url); - } - - private void setProjectLawsInventoryPermission(String userId, String projectId, String lawsInventoryId, Date now, List adds, String belong) { - QueryWrapper del = new QueryWrapper<>(); - del.eq("project_id", projectId) - .eq("belong", belong) - .eq("description", PermissionDescriptionEnum.PROJECT_LAWS_INVENTORY.getValue() + lawsInventoryId); - projectUserPermissionService.remove(del); - - ProjectUserPermission permission = new ProjectUserPermission(); - permission.setProjectId(projectId); - permission.setUserId(userId); - permission.setBelong(belong); - permission.setDescription(PermissionDescriptionEnum.PROJECT_LAWS_INVENTORY.getValue() + lawsInventoryId); - permission.setCreateTime(now); - permission.setUpdateTime(now); - adds.add(permission); - } - - private void setDateNull(ProjectLawsInventoryEO projectLawsInventoryEO, LambdaUpdateWrapper updateWrapper) { - if (ObjectUtils.isEmpty(projectLawsInventoryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1())) { - updateWrapper.set(ProjectLawsInventoryEO::getXin1Che1Xing2Shi2Shi1Ri4Qi1, null); - } - if (ObjectUtils.isEmpty(projectLawsInventoryEO.getImplementTime())) { - updateWrapper.set(ProjectLawsInventoryEO::getImplementTime, null); - } - if (ObjectUtils.isEmpty(projectLawsInventoryEO.getDesignDueDate())) { - updateWrapper.set(ProjectLawsInventoryEO::getDesignDueDate, null); - } - if (ObjectUtils.isEmpty(projectLawsInventoryEO.getPrehomoDueDate())) { - updateWrapper.set(ProjectLawsInventoryEO::getPrehomoDueDate, null); - } - if (ObjectUtils.isEmpty(projectLawsInventoryEO.getVerifyDueDate())) { - updateWrapper.set(ProjectLawsInventoryEO::getVerifyDueDate, null); - } - if (ObjectUtils.isEmpty(projectLawsInventoryEO.getImplementType())) { - updateWrapper.set(ProjectLawsInventoryEO::getImplementType, null); - } + this.editService.editById(projectLawsInventoryEO); } /** @@ -1459,6 +500,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl fileInfos, String deliverableTemplate) { - StringBuilder sb = new StringBuilder(); - for (String s : deliverableTemplate.split(",")) { - List collect = fileInfos.stream().filter(e -> s.equals(e.getId())).collect(Collectors.toList()); - if (collect.size() != 0) { - sb.append(collect.get(0).getFileName() + ","); - } - } - String sbStr = ""; - if (org.apache.commons.lang3.StringUtils.isNotBlank(sb)) { - sbStr = sb.substring(0, sb.length() - 1); - } - return sbStr; - } - - /** - * 验证数据 - * - * @param projectLibraryId 项目id - * @param lawsInventoryId 法规详情id - * @param currentUserId 当前登录人id - * @return - */ - public boolean checkData(String projectLibraryId, String currentUserId, String lawsInventoryId) { - boolean result = false; - try { - QueryWrapper queryWrapper = new QueryWrapper<>(); - - int isProjectRole = checkUserRole(projectLibraryId, currentUserId, lawsInventoryId); - if (isProjectRole != Integer.parseInt(ProjectRoleEnum.STUDIO_ENGINEER.getValue())) { - queryWrapper.lambda().eq(ProjectLawsInventoryEO::getHomologationEngineerId, currentUserId); - queryWrapper.lambda().or().eq(ProjectLawsInventoryEO::getRegulationOwnerId, currentUserId); - } - queryWrapper.lambda().eq(ProjectLawsInventoryEO::getId, lawsInventoryId); - Integer projectLawsInventoryCount = super.baseMapper.selectCount(queryWrapper); - if (projectLawsInventoryCount > 0) { - result = true; - } - } catch (Exception ex) { - log.error("验证项目库-法规清单表数据异常:" + ex.getMessage()); - throw new JeroBootException("验证项目库-法规清单表数据异常!"); - } - return result; - } - - /** - * 验证用户在该项目中的角色 - * - * @param projectLibraryId 项目库id - * @param currentUserId 登录人id - * @param lawsInventoryId 法规清单id - * @return - */ - public int checkUserRole(String projectLibraryId, String currentUserId, String lawsInventoryId) { - int result = -1; - try { - QueryWrapper projectLibraryBaseQueryWrapper = new QueryWrapper<>(); - projectLibraryBaseQueryWrapper.lambda().eq(ProjectLibraryBase::getId, projectLibraryId); - projectLibraryBaseQueryWrapper.lambda().eq(ProjectLibraryBase::getStudioEngineer, currentUserId); - Integer projectLibrayBaseCount = projectLibraryBaseMapper.selectCount(projectLibraryBaseQueryWrapper); - if (projectLibrayBaseCount > 0) { - result = Integer.parseInt(ProjectRoleEnum.STUDIO_ENGINEER.getValue()); - } else { - if (StringUtils.isNotEmpty(lawsInventoryId)) { - //查询用户是否是法规工程师 - QueryWrapper queryWrapperFG = new QueryWrapper<>(); - queryWrapperFG.lambda().eq(ProjectLawsInventoryEO::getRegulationOwnerId, currentUserId); - queryWrapperFG.lambda().eq(ProjectLawsInventoryEO::getId, lawsInventoryId); - Integer lawsInventoryCountFG = super.baseMapper.selectCount(queryWrapperFG); - - QueryWrapper queryWrapperRZ = new QueryWrapper<>(); - queryWrapperRZ.lambda().eq(ProjectLawsInventoryEO::getHomologationEngineerId, currentUserId); - queryWrapperRZ.lambda().eq(ProjectLawsInventoryEO::getId, lawsInventoryId); - Integer lawsInventoryCountRZ = super.baseMapper.selectCount(queryWrapperRZ); - - //如果两个工程师都是这个用户 - if (lawsInventoryCountFG > 0 && lawsInventoryCountRZ > 0) { - result = Integer.parseInt(ProjectRoleEnum.REGULATI_AND_HOMOLOGATION_ENGINEER.getValue()); - } else if (lawsInventoryCountFG > 0) { - result = Integer.parseInt(ProjectRoleEnum.REGULATI_ENGINEER.getValue()); - } else if (lawsInventoryCountRZ > 0) { - result = Integer.parseInt(ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue()); - } - } - } - } catch (Exception ex) { - log.error("验证用户在该项目中的角色失败:" + ex.getMessage()); - throw new JeroBootException("验证用户在该项目中的角色失败!"); - } - return result; - } - /** * 批量更新状态 * @@ -3456,7 +2406,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl idsList = Arrays.asList(projectLawsInventoryEO.getIds().split(",")); - List infoEOList = listByIds(idsList); - String projectLibraryId = null; - if (CollectionUtils.isNotEmpty(infoEOList)) { - projectLibraryId = infoEOList.get(0).getProjectLibraryId(); - } - - if (org.apache.commons.lang3.StringUtils.isNotBlank(projectLawsInventoryEO.getIds())) { - //根据id查询数据库中完整信息,翻译 - List idList = Arrays.asList(projectLawsInventoryEO.getIds().split(",")); - QueryWrapper queryWrapper = new QueryWrapper<>(); - List infoList = list(queryWrapper.in("id", idList)); - - for (String id : idList) { - projectLawsInventoryEO.setId(id); - // 发送消息 - this.updateProjectLawsInventorySendMessage(projectLawsInventoryEO); - } - // 根据法规清单id,获取该法规清单在待办中心的任务明细。 - List oldPliEoIdList = infoList.stream().map(ProjectLawsInventoryEO::getId).distinct().collect(Collectors.toList()); - QueryWrapper pidEoQueryWrap = new QueryWrapper<>(); - pidEoQueryWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId, oldPliEoIdList); - List pidEoList = this.processInfoDetailEOService.list(pidEoQueryWrap); - - // 处理编辑法规工程师的逻辑 - this.editService.updateRegulationOwner(projectLawsInventoryEO,infoList,pidEoList); - // 处理编辑责任人的逻辑 - this.editService.updateDutyPerson(projectLawsInventoryEO,infoList,pidEoList); - // 处理修改设计或验证符合性截止日期的逻辑 - this.editService.updateDesignOrVerifyEndTime(projectLawsInventoryEO,infoList); - - List projectLawsInventoryEOList = new ArrayList<>(); - - List adds = new ArrayList<>(); - Date now = new Date(); - for (String id : projectLawsInventoryEO.getIds().split(",")) { - ProjectLawsInventoryEO projectLawsInventoryEOTemp = new ProjectLawsInventoryEO(); - projectLawsInventoryEOTemp.setId(id); - //实施类别 implementType - if (org.apache.commons.lang.StringUtils.isNotBlank(projectLawsInventoryEO.getImplementType())) { - projectLawsInventoryEOTemp.setImplementType(projectLawsInventoryEO.getImplementType()); - } - //认证类型 attestationType - if (org.apache.commons.lang.StringUtils.isNotBlank(projectLawsInventoryEO.getAttestationType())) { - projectLawsInventoryEOTemp.setAttestationType(projectLawsInventoryEO.getAttestationType()); - } - //认证级别 attestationRank - if (org.apache.commons.lang.StringUtils.isNotBlank(projectLawsInventoryEO.getAttestationRank())) { - projectLawsInventoryEOTemp.setAttestationRank(projectLawsInventoryEO.getAttestationRank()); - } - //责任领域 dutyTerritory - if (org.apache.commons.lang.StringUtils.isNotBlank(projectLawsInventoryEO.getDutyTerritory())) { - projectLawsInventoryEOTemp.setDutyTerritory(projectLawsInventoryEO.getDutyTerritory()); - } - //责任部门 DutyDepart - if (org.apache.commons.lang.StringUtils.isNotBlank(projectLawsInventoryEO.getDutyDepart())) { - projectLawsInventoryEOTemp.setDutyDepart(projectLawsInventoryEO.getDutyDepart()); - } - //适用地区region - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getRegion())) { - projectLawsInventoryEOTemp.setRegion(projectLawsInventoryEO.getRegion()); - } - //在产车实施日期implementTime - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getImplementTime())) { - projectLawsInventoryEOTemp.setImplementTime(projectLawsInventoryEO.getImplementTime()); - } - //新车型实施日期xin1Che1Xing2Shi2Shi1Ri4Qi1 - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1())) { - projectLawsInventoryEOTemp.setXin1Che1Xing2Shi2Shi1Ri4Qi1(projectLawsInventoryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1()); - } - //设计符合性确认截止时间 - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getDesignDueDate())) { - projectLawsInventoryEOTemp.setDesignDueDate(projectLawsInventoryEO.getDesignDueDate()); - } - //preHomo确认截止时间 - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getPrehomoDueDate())) { - projectLawsInventoryEOTemp.setPrehomoDueDate(projectLawsInventoryEO.getPrehomoDueDate()); - } - //验证符合性确认截止时间 - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDueDate())) { - projectLawsInventoryEOTemp.setVerifyDueDate(projectLawsInventoryEO.getVerifyDueDate()); - } - - //验证符合性确认-交付物类型 - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDeliverableType())) { - projectLawsInventoryEOTemp.setVerifyDeliverableType(projectLawsInventoryEO.getVerifyDeliverableType()); - } - //设计符合性确认-交付物类型 - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getDesignDeliverableType())) { - projectLawsInventoryEOTemp.setDesignDeliverableType(projectLawsInventoryEO.getDesignDeliverableType()); - } - //================================批量设置人员=================================================== - //法规工程师id - if (StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId())) { - projectLawsInventoryEOTemp.setRegulationOwnerId(projectLawsInventoryEO.getRegulationOwnerId()); - setProjectLawsInventoryPermission(projectLawsInventoryEO.getRegulationOwnerId(), projectLibraryId, id, now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_REGULATION.getValue()); - } - //认证工程师id - if (StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerId())) { - projectLawsInventoryEOTemp.setHomologationEngineerId(projectLawsInventoryEO.getHomologationEngineerId()); - setProjectLawsInventoryPermission(projectLawsInventoryEO.getHomologationEngineerId(), projectLibraryId, id, now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_HOMOLOGATION.getValue()); - } - //工程接口人id - if (StringUtils.isNotEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())) { - projectLawsInventoryEOTemp.setEngineeringInterfacePerson(projectLawsInventoryEO.getEngineeringInterfacePerson()); - setProjectLawsInventoryPermission(projectLawsInventoryEO.getEngineeringInterfacePerson(), projectLibraryId, id, now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_INTERFACE.getValue()); - } - //设计符合性流程发起人id - if (StringUtils.isNotEmpty(projectLawsInventoryEO.getDesignInitiatorId())) { - projectLawsInventoryEOTemp.setDesignInitiatorId(projectLawsInventoryEO.getDesignInitiatorId()); - setProjectLawsInventoryPermission(projectLawsInventoryEO.getDesignInitiatorId(), projectLibraryId, id, now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_DESIGN_INITIATOR.getValue()); - } - //设计符合性流程责任人id - if (StringUtils.isNotEmpty(projectLawsInventoryEO.getDesignDutyId())) { - projectLawsInventoryEOTemp.setDesignDutyId(projectLawsInventoryEO.getDesignDutyId()); - setProjectLawsInventoryPermission(projectLawsInventoryEO.getDesignDutyId(), projectLibraryId, id, now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_DESIGN_DUTY.getValue()); - } - //Pre-homo确认流程发起人id - if (StringUtils.isNotEmpty(projectLawsInventoryEO.getPrehomoInitiatorId())) { - projectLawsInventoryEOTemp.setPrehomoInitiatorId(projectLawsInventoryEO.getPrehomoInitiatorId()); - setProjectLawsInventoryPermission(projectLawsInventoryEO.getPrehomoInitiatorId(), projectLibraryId, id, now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_PREHOMO_INITIATOR.getValue()); - } - //Pre-homo确认责任人id - if (StringUtils.isNotEmpty(projectLawsInventoryEO.getPrehomoDutyId())) { - projectLawsInventoryEOTemp.setPrehomoDutyId(projectLawsInventoryEO.getPrehomoDutyId()); - setProjectLawsInventoryPermission(projectLawsInventoryEO.getPrehomoDutyId(), projectLibraryId, id, now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_PREHOMO_DUTY.getValue()); - } - //验证符合性流程发起人id - if (StringUtils.isNotEmpty(projectLawsInventoryEO.getVerifyInitiatorId())) { - projectLawsInventoryEOTemp.setVerifyInitiatorId(projectLawsInventoryEO.getVerifyInitiatorId()); - setProjectLawsInventoryPermission(projectLawsInventoryEO.getVerifyInitiatorId(), projectLibraryId, id, now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_VERIFY_INITIATOR.getValue()); - } - //验证符合性流程责任人id - if (StringUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDutyId())) { - projectLawsInventoryEOTemp.setVerifyDutyId(projectLawsInventoryEO.getVerifyDutyId()); - setProjectLawsInventoryPermission(projectLawsInventoryEO.getVerifyDutyId(), projectLibraryId, id, now, adds, ProjectUserLocationEnum.PROJECT_LAWS_INVENTORY_VERIFY_DUTY.getValue()); - } - projectLawsInventoryEOList.add(projectLawsInventoryEOTemp); - } - if (ObjectUtils.isNotEmpty(adds)) { - projectUserPermissionService.saveBatch(adds); - } - - this.updateBatchById(projectLawsInventoryEOList); - - LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - - - String desdutyId = projectLawsInventoryEO.getDesignDutyId(); - String verdutyId = projectLawsInventoryEO.getVerifyDutyId(); - - List dutyTerritoryList = new ArrayList<>(); - //获取批量设置中责任领域 - String dutyTerritory = projectLawsInventoryEO.getDutyTerritory(); - if (StringUtils.isNotEmpty(dutyTerritory)) { - for (ProjectLawsInventoryEO info : infoList) { - info.setDutyTerritory(dutyTerritory); - } - dutyTerritoryList = Arrays.asList(dutyTerritory.split(",")); - } else { - for (ProjectLawsInventoryEO info : infoList) { - if (StringUtils.isNotEmpty(info.getDutyTerritory())) { - dutyTerritoryList.addAll(Arrays.asList(info.getDutyTerritory().split(","))); - } - } - } - - dutyTerritoryList = dutyTerritoryList.stream().distinct().collect(Collectors.toList()); - - if (StringUtils.isNotEmpty(desdutyId)) { - for (ProjectLawsInventoryEO info : infoList) { - info.setDesignDutyId(desdutyId); - } - } - if (StringUtils.isNotEmpty(verdutyId)) { - for (ProjectLawsInventoryEO info : infoList) { - info.setVerifyDutyId(verdutyId); - } - } - -// 获取当前的projectLibrartId - String projectLibrartId = infoList.get(0).getProjectLibraryId(); - String cut = projectLawsInventoryEO.getCut(); - Map params = new HashMap<>(); - params.put("projectLibraryId", projectLibrartId); - params.put("userId", currentUser.getId()); - params.put("modelType", RoleRelModelTypeEnum.LAWS_INVENTORY.getValue()); - ProjectLibraryRoleRelEO projectLibraryRoleRelEO = projectLibraryRoleRelEOService.queryByProjectLibraryIdAndUserId(params); - - //获取当前项目库id的studio工程师和认证工程师 - List studionList = new ArrayList<>(); - List certificationEngineerList = new ArrayList<>(); - List projectLibraryBases = projectLibraryBaseService.queryById(projectLibrartId, cut); - - String roleCode1 = projectLibraryRoleRelEO.getRoleCode(); - if(CollectionUtils.isNotEmpty(dutyTerritoryList)){ - //获取相关责任领域下的和projectLibrartId的相关人员名单的信息 - List projectRelatedPersonnelList = projectRelatedPersonnelService.queryByProjectIdAndDutyTerritoy(projectLibrartId, dutyTerritoryList); - if(CollectionUtils.isNotEmpty(projectRelatedPersonnelList)){ - List updatePrpEoList = new ArrayList<>(); - - for (ProjectLawsInventoryEO projectLawsInventoryEO1 : infoList) { - - //分别获取当前编辑中的设计符合性和认证符合性责任人 - List designDutyIdList = new ArrayList<>(); - if (StringUtils.isNotEmpty(projectLawsInventoryEO1.getDesignDutyId())) { - designDutyIdList = Arrays.asList(projectLawsInventoryEO1.getDesignDutyId().split(",")); - } - - List verifyDutyIdList = new ArrayList<>(); - if (StringUtils.isNotEmpty(projectLawsInventoryEO1.getVerifyDutyId())) { - verifyDutyIdList = Arrays.asList(projectLawsInventoryEO1.getVerifyDutyId().split(",")); - } - - //allDutyList 为法规工程师中验证符合性和确认符合中的责任人 - List allDutyList = new ArrayList<>(); - allDutyList.addAll(designDutyIdList); - allDutyList.addAll(verifyDutyIdList); - allDutyList = allDutyList.stream().distinct().collect(Collectors.toList()); - - List allList = new ArrayList<>(); - List enginnerList = new ArrayList<>(); - List lawEnginnerList = new ArrayList<>(); - List enginnerLawSetList = new ArrayList<>(); - List enginnerAttSetList = new ArrayList<>(); - - for (ProjectRelatedPersonnel relatedPersonnel : projectRelatedPersonnelList) { - // 工程接口人 - String enginneringInterfacePerson = relatedPersonnel.getEngineeringInterfacePerson(); - if (!StringUtils.isEmpty(enginneringInterfacePerson)) { - enginnerList = Arrays.stream(enginneringInterfacePerson.split(",")).collect(Collectors.toList()); - allList.addAll(enginnerList); - } - - // 法规工程师 - String lawEngineer = relatedPersonnel.getLawEngineer(); - if (!StringUtils.isEmpty(lawEngineer)) { - lawEnginnerList = Arrays.stream(lawEngineer.split(",")).collect(Collectors.toList()); - allList.addAll(lawEnginnerList); - } - - // 工程接口-法规工程师设置 - String engineerLawSet = relatedPersonnel.getEngineerLawSet(); - if (!StringUtils.isEmpty(engineerLawSet)) { - enginnerLawSetList = Arrays.stream(engineerLawSet.split(",")).collect(Collectors.toList()); - allList.addAll(enginnerLawSetList); - } - - // 工程接口-认证工程师设置 - String engineerAttSet = relatedPersonnel.getEngineerAttSet(); - if (!StringUtils.isEmpty(engineerAttSet)) { - enginnerAttSetList = Arrays.stream(engineerAttSet.split(",")).collect(Collectors.toList()); - allList.addAll(enginnerAttSetList); - } - } - - for (ProjectLibraryBase projectLibraryBase : projectLibraryBases) { - studionList.add(projectLibraryBase.getStudioEngineer()); - - String certificationEngineer = projectLibraryBase.getCertificationEngineer(); - if (!StringUtils.isEmpty(certificationEngineer)) { - certificationEngineerList = Arrays.stream(certificationEngineer.split(",")).collect(Collectors.toList()); - allList.addAll(certificationEngineerList); - } - } - allList = allList.stream().filter(all -> { - return StringUtils.isNotBlank(all); - }).distinct().collect(Collectors.toList()); - //遍历所有人alllist中是否包含责任人,如果包含,不用操作。 - //-------如果不包含,再去判断当前用户的角色是studio、法规还是认证 - for (ProjectRelatedPersonnel relatedPersonnel : projectRelatedPersonnelList) { - if (allList.size() > 0) { - for (String allDuty : allDutyList) { - String dutyPerson = allDuty; - if (StringUtils.isNotEmpty(dutyPerson) && !allList.contains(dutyPerson) && StringUtils.isNotEmpty(roleCode1)) { - if (roleCode1.equals(com.jero.modules.project.enums.ProjectRoleEnum.STUDIO_ENGINEER.getValue())) { - if (relatedPersonnel.getEngineeringInterfacePerson() != null) { - String engineeringInterfacePerson = dutyPerson + "," + relatedPersonnel.getEngineeringInterfacePerson(); - relatedPersonnel.setEngineeringInterfacePerson(engineeringInterfacePerson); - } else { - relatedPersonnel.setEngineeringInterfacePerson(dutyPerson); - } - } else if (roleCode1.equals(com.jero.modules.project.enums.ProjectRoleEnum.REGULATI_ENGINEER.getValue())) { - if (relatedPersonnel.getEngineerLawSet() != null) { - String engineerLawSet = dutyPerson + "," + relatedPersonnel.getEngineerLawSet(); - relatedPersonnel.setEngineerLawSet(engineerLawSet); - } else { - relatedPersonnel.setEngineerLawSet(dutyPerson); - } - } else if (roleCode1.equals(com.jero.modules.project.enums.ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue())) { - if (relatedPersonnel.getEngineerAttSet() != null) { - String engineerAttSet = dutyPerson + "," + relatedPersonnel.getEngineerAttSet(); - relatedPersonnel.setEngineerAttSet(engineerAttSet); - } else { - relatedPersonnel.setEngineerAttSet(dutyPerson); - } - } - } - } - } - } - - updatePrpEoList.addAll(projectRelatedPersonnelList); - } - this.projectRelatedPersonnelService.updateBatchById(updatePrpEoList); - } - } - projectLawsInventoryEOList.forEach(projectLawsInventory -> { - //更新三个符合性流程中的处理人。 - this.updateFlowInfo(projectLawsInventory); - }); -// for (ProjectLawsInventoryEO lawsInventoryEO : projectLawsInventoryEOList) { -// LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper<>(); -// updateWrapper.in(ProjectLawsInventoryEO::getId,lawsInventoryEO.getId()); -// setDateNull(lawsInventoryEO, updateWrapper); -// //保存 -// this.update(lawsInventoryEO,updateWrapper); -// } - - //更新log - LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - String username = sysUser.getUsername(); - String contentLog = username + "批量设置了: “"; - String enContentLog = username + " batch set : “"; - - List infoListCopy = DeepCopyListUtil.depCopy(infoList); - - translateData(infoList); - translateDataToEn(infoListCopy); - - //翻译传入的数据 - List inputList = new ArrayList<>(); - ProjectLawsInventoryEO projectLawsInventoryEONew = new ProjectLawsInventoryEO(); - BeanUtils.copyProperties(projectLawsInventoryEO, projectLawsInventoryEONew); - inputList.add(projectLawsInventoryEONew); - translateData(inputList); - ProjectLawsInventoryEO inputInfoEO = inputList.get(0); - - - for (String id : projectLawsInventoryEO.getIds().split(",")) { - List collect = infoList.stream().filter(e -> id.equals(e.getId())).collect(Collectors.toList()); - if (collect.size() != 0) { - ProjectLawsInventoryEO info = collect.get(0); - ProjectLawsInventoryEO infoCopy = infoListCopy.stream().filter(e -> id.equals(e.getId())).collect(Collectors.toList()).get(0); - StringBuilder contentLogBuilder = new StringBuilder(); - StringBuilder enContentLogBuilder = new StringBuilder(); - contentLogBuilder.append(info.getSerialNumber() + ":"); - enContentLogBuilder.append(infoCopy.getSerialNumber() + ":"); - ProjectLawsInventoryEO projectLawsInventoryEOTemp = new ProjectLawsInventoryEO(); - projectLawsInventoryEOTemp.setId(id); - //实施类别 implementType - if (StringUtils.isNotBlank(projectLawsInventoryEO.getImplementType())) { - if (!info.getImplementType().equals(inputInfoEO.getImplementType()) && !inputInfoEO.getImplementType().equals("空")) { - setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.IMPLEMENT_TYPE.getName(), info.getImplementType(), inputInfoEO.getImplementType()); - setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.IMPLEMENT_TYPE.getEnName(), infoCopy.getImplementType(), inputInfoEO.getImplementType()); - } - } - //认证类型 attestationType - if (StringUtils.isNotBlank(projectLawsInventoryEO.getAttestationType())) { - if (!info.getAttestationType().equals(inputInfoEO.getAttestationType()) && !inputInfoEO.getAttestationType().equals("空")) { - setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.ATTESTATION_TYPE.getName(), info.getAttestationType(), inputInfoEO.getAttestationType()); - setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.ATTESTATION_TYPE.getEnName(), infoCopy.getAttestationType(), inputInfoEO.getAttestationType()); - } - } - //认证级别 attestationRank - if (StringUtils.isNotBlank(projectLawsInventoryEO.getAttestationRank())) { - if (!info.getAttestationRank().equals(inputInfoEO.getAttestationRank()) && !inputInfoEO.getAttestationRank().equals("空")) { - setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.ATTESTATION_RANK.getName(), info.getAttestationRank(), inputInfoEO.getAttestationRank()); - setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.ATTESTATION_RANK.getEnName(), infoCopy.getAttestationRank(), inputInfoEO.getAttestationRank()); - } - } - //责任领域 dutyTerritory - if (StringUtils.isNotBlank(projectLawsInventoryEO.getDutyTerritory())) { - if (!info.getDutyTerritory().equals(inputInfoEO.getDutyTerritory())) { - setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.DUTY_TERRITORY.getName(), info.getDutyTerritory(), inputInfoEO.getDutyTerritory()); - setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.DUTY_TERRITORY.getEnName(), infoCopy.getDutyTerritory(), inputInfoEO.getDutyTerritory()); - } - } - //在产车实施日期implementTime - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getImplementTime())) { - if (info.getImplementTime() == null) { - setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.IMPLEMENT_TIME.getName(), "空", inputInfoEO.getImplementTimeString()); - setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.IMPLEMENT_TIME.getEnName(), "null", inputInfoEO.getImplementTimeString()); - } else { - if (!info.getImplementTimeString().equals(inputInfoEO.getImplementTimeString())) { - setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.IMPLEMENT_TIME.getName(), info.getImplementTimeString(), inputInfoEO.getImplementTimeString()); - setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.IMPLEMENT_TIME.getEnName(), infoCopy.getImplementTimeString(), inputInfoEO.getImplementTimeString()); - } - } - } - //新车型实施日期xin1Che1Xing2Shi2Shi1Ri4Qi1 - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1())) { - if (info.getXin1Che1Xing2Shi2Shi1Ri4Qi1() == null) { - setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.XIN1_CHE1_XING2_SHI2_SHI1_RI4_QI1.getName(), "空", inputInfoEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1String()); - setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.XIN1_CHE1_XING2_SHI2_SHI1_RI4_QI1.getEnName(), "null", inputInfoEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1String()); - } else { - if (!info.getXin1Che1Xing2Shi2Shi1Ri4Qi1String().equals(inputInfoEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1String())) { - setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.XIN1_CHE1_XING2_SHI2_SHI1_RI4_QI1.getName(), info.getXin1Che1Xing2Shi2Shi1Ri4Qi1String(), inputInfoEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1String()); - setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.XIN1_CHE1_XING2_SHI2_SHI1_RI4_QI1.getEnName(), infoCopy.getXin1Che1Xing2Shi2Shi1Ri4Qi1String(), inputInfoEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1String()); - } - } - } - //适用地区region - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getRegion())) { - if (!info.getRegion().equals(inputInfoEO.getRegion())) { - setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.REGION.getName(), info.getRegion(), inputInfoEO.getRegion()); - setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.REGION.getEnName(), infoCopy.getRegion(), inputInfoEO.getRegion()); - - } - } - //设计符合性确认截止时间 - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getDesignDueDate())) { - if (info.getDesignDueDate() == null) { - setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getName(), "空", inputInfoEO.getDesignDueDateString()); - setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getEnName(), "null", inputInfoEO.getDesignDueDateString()); - } else { - if (!info.getDesignDueDateString().equals(inputInfoEO.getDesignDueDateString())) { - setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getName(), info.getDesignDueDateString(), inputInfoEO.getDesignDueDateString()); - setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getEnName(), infoCopy.getDesignDueDateString(), inputInfoEO.getDesignDueDateString()); - } - } - } - //preHomo确认截止时间 - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getPrehomoDueDate())) { - if (info.getVerifyDueDate() == null) { - setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.PREHOMO_DUE_DATE.getName(), "空", inputInfoEO.getPrehomoDueDateString()); - setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.PREHOMO_DUE_DATE.getEnName(), "null", inputInfoEO.getPrehomoDueDateString()); - } else { - if (!info.getPrehomoDueDateString().equals(inputInfoEO.getPrehomoDueDateString())) { - setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.PREHOMO_DUE_DATE.getName(), info.getPrehomoDueDateString(), inputInfoEO.getPrehomoDueDateString()); - setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.PREHOMO_DUE_DATE.getEnName(), infoCopy.getPrehomoDueDateString(), inputInfoEO.getPrehomoDueDateString()); - } - } - } - //验证符合性确认截止时间 - if (ObjectUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDueDate())) { - if (info.getVerifyDueDate() == null) { - setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.VERIFY_DUE_DATE.getName(), "空", inputInfoEO.getVerifyDueDateString()); - setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.VERIFY_DUE_DATE.getEnName(), "null", inputInfoEO.getVerifyDueDateString()); - } else { - if (!info.getVerifyDueDateString().equals(inputInfoEO.getVerifyDueDateString())) { - setUpdateContentLog(contentLogBuilder, ProjectInventoryFieldEnum.VERIFY_DUE_DATE.getName(), info.getVerifyDueDateString(), inputInfoEO.getVerifyDueDateString()); - setUpdateEnContentLog(enContentLogBuilder, ProjectInventoryFieldEnum.VERIFY_DUE_DATE.getEnName(), infoCopy.getVerifyDueDateString(), inputInfoEO.getVerifyDueDateString()); - } - } - } - //处理具体变动消息为空的contentLog - String contentInfoIndexStart = contentLogBuilder.substring(0, contentLogBuilder.lastIndexOf(":")); - String contentInfo = contentLogBuilder.substring(contentInfoIndexStart.length() + 1, contentLogBuilder.length()); - - String enContentInfoIndexStart = enContentLogBuilder.substring(0, enContentLogBuilder.lastIndexOf(":")); - String enContentInfo = enContentLogBuilder.substring(enContentInfoIndexStart.length() + 1, enContentLogBuilder.length()); - - if (StringUtils.isNotBlank(contentInfo) && StringUtils.isNotBlank(enContentInfo)) { - contentLog += contentLogBuilder; - enContentLog += enContentLogBuilder; - } - } - - } - String contentIndexStart = contentLog.substring(0, contentLog.indexOf("“")); - String content = contentLog.substring(contentIndexStart.length() + 1, contentLog.length()); - - String enContentIndexStart = enContentLog.substring(0, enContentLog.indexOf("“")); - String enContent = enContentLog.substring(enContentIndexStart.length() + 1, enContentLog.length()); - - if (StringUtils.isNotBlank(content)) { - contentLog = contentLog.substring(0, contentLog.length() - 5) + "”"; - projectLawsInventoryLogEOService.updateLog(contentLog, projectLibraryId, CutEnum.CN.getValue()); - } - - if (StringUtils.isNotBlank(enContent)) { - enContentLog = enContentLog.substring(0, enContentLog.length() - 5) + "”"; - projectLawsInventoryLogEOService.updateLog(enContentLog, projectLibraryId, CutEnum.EN.getValue()); - } - } + public void setBatch(ProjectLawsInventoryEO projectLawsInventoryEO) { + this.editService.setBatch(projectLawsInventoryEO); } - public StringBuilder setUpdateContentLog(StringBuilder contentLogBuilder, String fieldName, String oldValue, String newValue) { - return contentLogBuilder.append("\'" + fieldName + "\'由" + oldValue + "改为了" + newValue).append("
"); - } - - public StringBuilder setUpdateEnContentLog(StringBuilder contentLogBuilder, String fieldName, String oldValue, String newValue) { - return contentLogBuilder.append("\'" + fieldName + "\' changed from " + oldValue + " to " + newValue).append("
"); - } - - private void translateData(List infoList) { - for (ProjectLawsInventoryEO projectLawsInventoryEO : infoList) { - //子标题 - if (StringUtils.isBlank(projectLawsInventoryEO.getSubtitle())) { - projectLawsInventoryEO.setSubtitle("空"); - } - //WVTA ID - if (StringUtils.isBlank(projectLawsInventoryEO.getWvtaId())) { - projectLawsInventoryEO.setWvtaId("空"); - } - //备注 - if (StringUtils.isBlank(projectLawsInventoryEO.getRemark())) { - projectLawsInventoryEO.setRemark("空"); - } - //实施类别 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getImplementType())) { - List implementType = sysDictItemMapper.selectItemsByDictCode(ProjectInventoryFieldEnum.IMPLEMENT_TYPE.getValue()); - String implementTypeName = implementType.stream().filter(e -> e.getItemValue().equals(projectLawsInventoryEO.getImplementType())).map(f -> f.getItemText()).collect(Collectors.joining(",")); - projectLawsInventoryEO.setImplementType(implementTypeName); - } else { - projectLawsInventoryEO.setImplementType("空"); - } - - //在产车实施日期 - if (projectLawsInventoryEO.getImplementTime() != null) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String dateString = sdf.format(projectLawsInventoryEO.getImplementTime()); - projectLawsInventoryEO.setImplementTimeString(dateString); - } else { - projectLawsInventoryEO.setImplementTimeString("空"); - } - - //新车型实施日期 - if (projectLawsInventoryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1() != null) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String dateString = sdf.format(projectLawsInventoryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1()); - projectLawsInventoryEO.setXin1Che1Xing2Shi2Shi1Ri4Qi1String(dateString); - } else { - projectLawsInventoryEO.setXin1Che1Xing2Shi2Shi1Ri4Qi1String("空"); - } - - //认证类型 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getAttestationType())) { - List attestationType = sysDictItemMapper.selectItemsByDictCode(DummyInventoryBaseFieldEnum.ATTESTATION_TYPE.getValue()); - List attestationTypeList = Arrays.asList(projectLawsInventoryEO.getAttestationType().split(",")); - StringBuilder attestationTypeBuilder = new StringBuilder(); - for (String midAttestationType : attestationTypeList) { - String dutyTerritoryName = attestationType.stream().filter(e -> e.getItemValue().equals(midAttestationType)).map(f -> f.getItemText()).collect(Collectors.joining(",")); - attestationTypeBuilder.append(dutyTerritoryName).append(","); - } - projectLawsInventoryEO.setAttestationType(attestationTypeBuilder.substring(0, attestationTypeBuilder.toString().length() - 1)); - } else { - projectLawsInventoryEO.setAttestationType("空"); - } - - //认证级别 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getAttestationRank())) { - List attestationRank = sysDictItemMapper.selectItemsByDictCode(ProjectInventoryFieldEnum.ATTESTATION_RANK.getValue()); - List attestationRankList = Arrays.asList(projectLawsInventoryEO.getAttestationRank().split(",")); - StringBuilder attestationRankBuilder = new StringBuilder(); - for (String midAttestationRank : attestationRankList) { - String dutyTerritoryName = attestationRank.stream().filter(e -> e.getItemValue().equals(midAttestationRank)).map(f -> f.getItemText()).collect(Collectors.joining(",")); - attestationRankBuilder.append(dutyTerritoryName).append(","); - } - projectLawsInventoryEO.setAttestationRank(attestationRankBuilder.substring(0, attestationRankBuilder.toString().length() - 1)); - } else { - projectLawsInventoryEO.setAttestationRank("空"); - } - - //责任领域 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getDutyTerritory())) { - List dutyTerritory = sysDictItemMapper.selectItemsByDictCode(ProjectInventoryFieldEnum.DUTY_TERRITORY.getValue()); - List dutyTerritoryList = Arrays.asList(projectLawsInventoryEO.getDutyTerritory().split(",")); - StringBuilder dutyTerritoryBuilder = new StringBuilder(); - for (String midDutyTerritory : dutyTerritoryList) { - String dutyTerritoryName = dutyTerritory.stream().filter(e -> e.getItemValue().equals(midDutyTerritory)).map(f -> f.getItemText()).collect(Collectors.joining(",")); - dutyTerritoryBuilder.append(dutyTerritoryName).append(","); - } - projectLawsInventoryEO.setDutyTerritory(dutyTerritoryBuilder.substring(0, dutyTerritoryBuilder.toString().length() - 1)); - } else { - projectLawsInventoryEO.setDutyTerritory("空"); - } - - //适用地区 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getRegion())) { - List region = sysDictItemMapper.selectItemsByDictCode(DummyInventoryBaseFieldEnum.REGION.getValue()); - List regionList = Arrays.asList(projectLawsInventoryEO.getRegion().split(",")); - StringBuilder regionBuilder = new StringBuilder(); - for (String midRegion : regionList) { - String regionName = region.stream().filter(e -> e.getItemValue().equals(midRegion)).map(f -> f.getItemText()).collect(Collectors.joining(",")); - regionBuilder.append(regionName).append(","); - } - projectLawsInventoryEO.setRegion(regionBuilder.substring(0, regionBuilder.toString().length() - 1)); - } else { - projectLawsInventoryEO.setRegion("空"); - } - - //交付物类型 - //交付物类型 - Set deliverableTypeSet = new HashSet<>(); - List designDeliverableTypeIdList = new ArrayList<>(); - List prehomoDeliverableTypeIdList = new ArrayList<>(); - List verifyDeliverableTypeIdList = new ArrayList<>(); - if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableType())) { - designDeliverableTypeIdList = Arrays.asList(projectLawsInventoryEO.getDesignDeliverableType().split(",")); - deliverableTypeSet.addAll(designDeliverableTypeIdList); - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableType())) { - prehomoDeliverableTypeIdList = Arrays.asList(projectLawsInventoryEO.getPrehomoDeliverableType().split(",")); - deliverableTypeSet.addAll(prehomoDeliverableTypeIdList); - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableType())) { - verifyDeliverableTypeIdList = Arrays.asList(projectLawsInventoryEO.getVerifyDeliverableType().split(",")); - deliverableTypeSet.addAll(verifyDeliverableTypeIdList); - } - //树形结构 - List deliverableTypeList = new ArrayList<>(); - if (deliverableTypeSet.size() != 0) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.in(SysCategory::getId, deliverableTypeSet); - deliverableTypeList = sysCategoryService.list(wrapper); - } - - //设计符合性确认-交付物类型 - if (deliverableTypeList.size() != 0 && StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableType())) { - StringBuilder designBuilder = new StringBuilder(); - for (String id : designDeliverableTypeIdList) { - List designList = deliverableTypeList.stream().filter(e -> id.equals(e.getId())).collect(Collectors.toList()); - if (designList.size() != 0) { - designBuilder.append(designList.get(0).getName() + ","); - } - } - String designName = null; - if (StringUtils.isNotBlank(designBuilder)) { - designName = designBuilder.substring(0, designBuilder.length() - 1); - } - projectLawsInventoryEO.setDesignDeliverableTypeName(designName); - } else { - projectLawsInventoryEO.setDesignDeliverableTypeName("空"); - } - //prehomo确认-交付物类型 - if (deliverableTypeList.size() != 0 && StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableType())) { - StringBuilder prehomoBuilder = new StringBuilder(); - for (String id : prehomoDeliverableTypeIdList) { - List prehomoList = deliverableTypeList.stream().filter(e -> id.equals(e.getId())).collect(Collectors.toList()); - if (prehomoList.size() != 0) { - prehomoBuilder.append(prehomoList.get(0).getName() + ","); - } - } - String prehomoName = null; - if (StringUtils.isNotBlank(prehomoBuilder)) { - prehomoName = prehomoBuilder.substring(0, prehomoBuilder.length() - 1); - } - projectLawsInventoryEO.setPrehomoDeliverableTypeName(prehomoName); - - } else { - projectLawsInventoryEO.setPrehomoDeliverableTypeName("空"); - } - //验证符合性确认-交付物类型 - if (deliverableTypeList.size() != 0 && StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableType())) { - StringBuilder verifyBuilder = new StringBuilder(); - for (String id : verifyDeliverableTypeIdList) { - List verifyList = deliverableTypeList.stream().filter(e -> id.equals(e.getId())).collect(Collectors.toList()); - - if (verifyList.size() != 0) { - verifyBuilder.append(verifyList.get(0).getName() + ","); - } - } - String verifyName = null; - if (StringUtils.isNotBlank(verifyBuilder)) { - verifyName = verifyBuilder.substring(0, verifyBuilder.length() - 1); - } - projectLawsInventoryEO.setVerifyDeliverableTypeName(verifyName); - } else { - projectLawsInventoryEO.setVerifyDeliverableTypeName("空"); - } - - - List userIdList = new ArrayList<>(); - //法规工程师 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getRegulationOwnerId())) { - userIdList.add(projectLawsInventoryEO.getRegulationOwnerId()); - } else { - projectLawsInventoryEO.setRegulationOwnerName("空"); - } - - //认证工程师 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getHomologationEngineerId())) { - userIdList.add(projectLawsInventoryEO.getHomologationEngineerId()); - } else { - projectLawsInventoryEO.setHomologationEngineerName("空"); - } - - //工程接口人 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getEngineeringInterfacePerson())) { - userIdList.add(projectLawsInventoryEO.getEngineeringInterfacePerson()); - } else { - projectLawsInventoryEO.setEngineeringInterfacePersonName("空"); - } - - //发起人 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignInitiatorId())) { - userIdList.add(projectLawsInventoryEO.getDesignInitiatorId()); - } else { - projectLawsInventoryEO.setDesignInitiatorName("空"); - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoInitiatorId())) { - userIdList.add(projectLawsInventoryEO.getPrehomoInitiatorId()); - } else { - projectLawsInventoryEO.setPrehomoInitiatorName("空"); - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyInitiatorId())) { - userIdList.add(projectLawsInventoryEO.getVerifyInitiatorId()); - } else { - projectLawsInventoryEO.setVerifyInitiatorName("空"); - } - - //责任人 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDutyId())) { - userIdList.add(projectLawsInventoryEO.getDesignDutyId()); - } else { - projectLawsInventoryEO.setDesignDutyIdName("空"); - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDutyId())) { - userIdList.add(projectLawsInventoryEO.getPrehomoDutyId()); - } else { - projectLawsInventoryEO.setPrehomoDutyName("空"); - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDutyId())) { - userIdList.add(projectLawsInventoryEO.getVerifyDutyId()); - } else { - projectLawsInventoryEO.setVerifyDutyIdName("空"); - } - - userIdList = userIdList.stream().distinct().collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(userIdList)) { - QueryWrapper userqueryWrapper = new QueryWrapper<>(); - List userList = sysUserService.list(userqueryWrapper.in("id ", userIdList)); - - //法规工程师 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getRegulationOwnerId())) { - List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getRegulationOwnerId())).map(f -> f.getUsername()).collect(Collectors.toList()); - if (collect.size() != 0) { - String userName = collect.get(0); - projectLawsInventoryEO.setRegulationOwnerName(userName); - } - } - - //认证工程师 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getHomologationEngineerId())) { - List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getHomologationEngineerId())).map(f -> f.getUsername()).collect(Collectors.toList()); - if (collect.size() != 0) { - String userName = collect.get(0); - projectLawsInventoryEO.setHomologationEngineerName(userName); - } - } - - //工程接口人 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getEngineeringInterfacePerson())) { - List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getEngineeringInterfacePerson())).map(f -> f.getUsername()).collect(Collectors.toList()); - if (collect.size() != 0) { - String userName = collect.get(0); - projectLawsInventoryEO.setEngineeringInterfacePersonName(userName); - } - } - - - //发起人 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignInitiatorId())) { - List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getDesignInitiatorId())).map(f -> f.getUsername()).collect(Collectors.toList()); - if (collect.size() != 0) { - String userName = collect.get(0); - projectLawsInventoryEO.setDesignInitiatorName(userName); - } - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoInitiatorId())) { - List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getPrehomoInitiatorId())).map(f -> f.getUsername()).collect(Collectors.toList()); - if (collect.size() != 0) { - String userName = collect.get(0); - projectLawsInventoryEO.setPrehomoInitiatorName(userName); - } - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyInitiatorId())) { - List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getVerifyInitiatorId())).map(f -> f.getUsername()).collect(Collectors.toList()); - if (collect.size() != 0) { - String userName = collect.get(0); - projectLawsInventoryEO.setVerifyInitiatorName(userName); - } - } - - //责任人 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDutyId())) { - List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getDesignDutyId())).map(f -> f.getUsername()).collect(Collectors.toList()); - if (collect.size() != 0) { - String userName = collect.get(0); - projectLawsInventoryEO.setDesignDutyIdName(userName); - } - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDutyId())) { - List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getPrehomoDutyId())).map(f -> f.getUsername()).collect(Collectors.toList()); - if (collect.size() != 0) { - String userName = collect.get(0); - projectLawsInventoryEO.setPrehomoDutyName(userName); - } - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDutyId())) { - List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getVerifyDutyId())).map(f -> f.getUsername()).collect(Collectors.toList()); - if (collect.size() != 0) { - String userName = collect.get(0); - projectLawsInventoryEO.setVerifyDutyIdName(userName); - } - } - } - - - //截止时间 - //设计符合性确认-截止时间 designDueDate - if (projectLawsInventoryEO.getDesignDueDate() != null) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String dateString = sdf.format(projectLawsInventoryEO.getDesignDueDate()); - projectLawsInventoryEO.setDesignDueDateString(dateString); - } else { - projectLawsInventoryEO.setDesignDueDateString("空"); - } - //prehomo确认-截止时间 prehomoDueDate - if (projectLawsInventoryEO.getPrehomoDueDate() != null) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String dateString = sdf.format(projectLawsInventoryEO.getPrehomoDueDate()); - projectLawsInventoryEO.setPrehomoDueDateString(dateString); - } else { - projectLawsInventoryEO.setPrehomoDueDateString("空"); - } - //验证符合性确认-截止时间 verifyDueDate - if (projectLawsInventoryEO.getVerifyDueDate() != null) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String dateString = sdf.format(projectLawsInventoryEO.getVerifyDueDate()); - projectLawsInventoryEO.setVerifyDueDateString(dateString); - } else { - projectLawsInventoryEO.setVerifyDueDateString("空"); - } - - - //文件 - List deliverableList = new ArrayList<>(); - //设计符合性确认交付物模板 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableTemplate())) { - deliverableList.addAll(Arrays.asList(projectLawsInventoryEO.getDesignDeliverableTemplate().split(","))); - } else { - projectLawsInventoryEO.setDesignDeliverableTemplateName("空"); - } - // Prehomo确认交付物模板 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableTemplate())) { - deliverableList.addAll(Arrays.asList(projectLawsInventoryEO.getPrehomoDeliverableTemplate().split(","))); - } else { - projectLawsInventoryEO.setPrehomoDeliverableTemplateName("空"); - } - // 验证符合性确认交付物模板 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableTemplate())) { - deliverableList.addAll(Arrays.asList(projectLawsInventoryEO.getVerifyDeliverableTemplate().split(","))); - } else { - projectLawsInventoryEO.setVerifyDeliverableTemplateName("空"); - } - List fileInfos = new ArrayList<>(); - if (deliverableList.size() != 0) { - fileInfos = iOSSFileService.getFileInfos(org.apache.commons.lang3.StringUtils.join(deliverableList, ",")); - } - //交付物类型模板 - if (fileInfos.size() != 0) { - if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableTemplate())) { - String fileName = getFileName(projectLawsInventoryEO, fileInfos, projectLawsInventoryEO.getDesignDeliverableTemplate()); - if (org.apache.commons.lang3.StringUtils.isNotBlank(fileName)) { - projectLawsInventoryEO.setDesignDeliverableTemplateName(fileName); - } - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableTemplate())) { - String fileName = getFileName(projectLawsInventoryEO, fileInfos, projectLawsInventoryEO.getPrehomoDeliverableTemplate()); - if (org.apache.commons.lang3.StringUtils.isNotBlank(fileName)) { - projectLawsInventoryEO.setPrehomoDeliverableTemplateName(fileName); - } - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableTemplate())) { - String fileName = getFileName(projectLawsInventoryEO, fileInfos, projectLawsInventoryEO.getVerifyDeliverableTemplate()); - if (org.apache.commons.lang3.StringUtils.isNotBlank(fileName)) { - projectLawsInventoryEO.setVerifyDeliverableTemplateName(fileName); - - } - } - } - } - } - - //翻译成英文 - private void translateDataToEn(List infoList) { - for (ProjectLawsInventoryEO projectLawsInventoryEO : infoList) { - //子标题 - if (StringUtils.isBlank(projectLawsInventoryEO.getSubtitle())) { - projectLawsInventoryEO.setSubtitle("null"); - } - //WVTA ID - if (StringUtils.isBlank(projectLawsInventoryEO.getWvtaId())) { - projectLawsInventoryEO.setWvtaId("null"); - } - //备注 - if (StringUtils.isBlank(projectLawsInventoryEO.getRemark())) { - projectLawsInventoryEO.setRemark("null"); - } - //实施类别 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getImplementType())) { - List implementType = sysDictItemMapper.selectItemsByDictCode(ProjectInventoryFieldEnum.IMPLEMENT_TYPE.getValue()); - String implementTypeName = implementType.stream().filter(e -> e.getItemValue().equals(projectLawsInventoryEO.getImplementType())).map(f -> f.getItemText()).collect(Collectors.joining(",")); - projectLawsInventoryEO.setImplementType(implementTypeName); - } else { - projectLawsInventoryEO.setImplementType("null"); - } - - //在产车实施日期 - if (projectLawsInventoryEO.getImplementTime() != null) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String dateString = sdf.format(projectLawsInventoryEO.getImplementTime()); - projectLawsInventoryEO.setImplementTimeString(dateString); - } else { - projectLawsInventoryEO.setImplementTimeString("null"); - } - - //新车型实施日期 - if (projectLawsInventoryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1() != null) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String dateString = sdf.format(projectLawsInventoryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1()); - projectLawsInventoryEO.setXin1Che1Xing2Shi2Shi1Ri4Qi1String(dateString); - } else { - projectLawsInventoryEO.setXin1Che1Xing2Shi2Shi1Ri4Qi1String("null"); - } - - //认证类型 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getAttestationType())) { - List attestationType = sysDictItemMapper.selectItemsByDictCode(ProjectInventoryFieldEnum.ATTESTATION_TYPE.getValue()); - List attestationTypeList = Arrays.asList(projectLawsInventoryEO.getAttestationType().split(",")); - StringBuilder attestationTypeBuilder = new StringBuilder(); - for (String midDutyTerritory : attestationTypeList) { - String attestationTypeName = attestationType.stream().filter(e -> e.getItemValue().equals(midDutyTerritory)).map(f -> f.getEnName()).collect(Collectors.joining(",")); - attestationTypeBuilder.append(attestationTypeName).append(","); - } - projectLawsInventoryEO.setAttestationType(attestationTypeBuilder.substring(0, attestationTypeBuilder.toString().length() - 1)); - - - } else { - projectLawsInventoryEO.setAttestationType("null"); - } - - //认证级别 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getAttestationRank())) { - List attestationRank = sysDictItemMapper.selectItemsByDictCode(ProjectInventoryFieldEnum.ATTESTATION_RANK.getValue()); - List attestationRankList = Arrays.asList(projectLawsInventoryEO.getAttestationRank().split(",")); - StringBuilder attestationRankBuilder = new StringBuilder(); - for (String midAttestationRank : attestationRankList) { - String dutyTerritoryName = attestationRank.stream().filter(e -> e.getItemValue().equals(midAttestationRank)).map(f -> f.getItemText()).collect(Collectors.joining(",")); - attestationRankBuilder.append(dutyTerritoryName).append(","); - } - projectLawsInventoryEO.setAttestationRank(attestationRankBuilder.substring(0, attestationRankBuilder.toString().length() - 1)); - } else { - projectLawsInventoryEO.setAttestationRank("null"); - } - - //责任领域 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getDutyTerritory())) { - List dutyTerritory = sysDictItemMapper.selectItemsByDictCode(ProjectInventoryFieldEnum.DUTY_TERRITORY.getValue()); - List dutyTerritoryList = Arrays.asList(projectLawsInventoryEO.getDutyTerritory().split(",")); - StringBuilder dutyTerritoryBuilder = new StringBuilder(); - for (String midDutyTerritory : dutyTerritoryList) { - String dutyTerritoryName = dutyTerritory.stream().filter(e -> e.getItemValue().equals(midDutyTerritory)).map(f -> f.getEnName()).collect(Collectors.joining(",")); - dutyTerritoryBuilder.append(dutyTerritoryName).append(","); - } - projectLawsInventoryEO.setDutyTerritory(dutyTerritoryBuilder.substring(0, dutyTerritoryBuilder.toString().length() - 1)); - } else { - projectLawsInventoryEO.setDutyTerritory("null"); - } - - //适用地区 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getRegion())) { - List region = sysDictItemMapper.selectItemsByDictCode(DummyInventoryBaseFieldEnum.REGION.getValue()); - List regionList = Arrays.asList(projectLawsInventoryEO.getRegion().split(",")); - StringBuilder regionBuilder = new StringBuilder(); - for (String midRegion : regionList) { - String regionName = region.stream().filter(e -> e.getItemValue().equals(midRegion)).map(f -> f.getEnName()).collect(Collectors.joining(",")); - regionBuilder.append(regionName).append(","); - } - projectLawsInventoryEO.setRegion(regionBuilder.substring(0, regionBuilder.toString().length() - 1)); - } else { - projectLawsInventoryEO.setRegion("null"); - } - - //交付物类型 - //交付物类型 - Set deliverableTypeSet = new HashSet<>(); - List designDeliverableTypeIdList = new ArrayList<>(); - List prehomoDeliverableTypeIdList = new ArrayList<>(); - List verifyDeliverableTypeIdList = new ArrayList<>(); - if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableType())) { - designDeliverableTypeIdList = Arrays.asList(projectLawsInventoryEO.getDesignDeliverableType().split(",")); - deliverableTypeSet.addAll(designDeliverableTypeIdList); - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableType())) { - prehomoDeliverableTypeIdList = Arrays.asList(projectLawsInventoryEO.getPrehomoDeliverableType().split(",")); - deliverableTypeSet.addAll(prehomoDeliverableTypeIdList); - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableType())) { - verifyDeliverableTypeIdList = Arrays.asList(projectLawsInventoryEO.getVerifyDeliverableType().split(",")); - deliverableTypeSet.addAll(verifyDeliverableTypeIdList); - } - //树形结构 - List deliverableTypeList = new ArrayList<>(); - if (deliverableTypeSet.size() != 0) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.in(SysCategory::getId, deliverableTypeSet); - deliverableTypeList = sysCategoryService.list(wrapper); - } - - //设计符合性确认-交付物类型 - if (deliverableTypeList.size() != 0 && StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableType())) { - StringBuilder designBuilder = new StringBuilder(); - for (String id : designDeliverableTypeIdList) { - List designList = deliverableTypeList.stream().filter(e -> id.equals(e.getId())).collect(Collectors.toList()); - if (designList.size() != 0) { - designBuilder.append(designList.get(0).getEnName() + ","); - } - } - String designEnName = null; - if (StringUtils.isNotBlank(designBuilder)) { - designEnName = designBuilder.substring(0, designBuilder.length() - 1); - } - projectLawsInventoryEO.setDesignDeliverableTypeName(designEnName); - } else { - projectLawsInventoryEO.setDesignDeliverableTypeName("null"); - } - //prehomo确认-交付物类型 - if (deliverableTypeList.size() != 0 && StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableType())) { - StringBuilder prehomoBuilder = new StringBuilder(); - for (String id : prehomoDeliverableTypeIdList) { - List prehomoList = deliverableTypeList.stream().filter(e -> id.equals(e.getId())).collect(Collectors.toList()); - if (prehomoList.size() != 0) { - prehomoBuilder.append(prehomoList.get(0).getEnName() + ","); - } - } - String prehomoEnName = null; - if (StringUtils.isNotBlank(prehomoBuilder)) { - prehomoEnName = prehomoBuilder.substring(0, prehomoBuilder.length() - 1); - } - projectLawsInventoryEO.setPrehomoDeliverableTypeName(prehomoEnName); - } else { - projectLawsInventoryEO.setPrehomoDeliverableTypeName("null"); - } - //验证符合性确认-交付物类型 - if (deliverableTypeList.size() != 0 && StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableType())) { - StringBuilder verifyBuilder = new StringBuilder(); - for (String id : verifyDeliverableTypeIdList) { - List verifyList = deliverableTypeList.stream().filter(e -> id.equals(e.getId())).collect(Collectors.toList()); - - if (verifyList.size() != 0) { - verifyBuilder.append(verifyList.get(0).getEnName() + ","); - } - } - String verifyEnName = null; - if (StringUtils.isNotBlank(verifyBuilder)) { - verifyEnName = verifyBuilder.substring(0, verifyBuilder.length() - 1); - } - projectLawsInventoryEO.setVerifyDeliverableTypeName(verifyEnName); - } else { - projectLawsInventoryEO.setVerifyDeliverableTypeName("null"); - } - - - List userIdList = new ArrayList<>(); - //法规工程师 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getRegulationOwnerId())) { - userIdList.add(projectLawsInventoryEO.getRegulationOwnerId()); - } else { - projectLawsInventoryEO.setRegulationOwnerName("null"); - } - - //认证工程师 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getHomologationEngineerId())) { - userIdList.add(projectLawsInventoryEO.getHomologationEngineerId()); - } else { - projectLawsInventoryEO.setHomologationEngineerName("null"); - } - - //工程接口人 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getEngineeringInterfacePerson())) { - userIdList.add(projectLawsInventoryEO.getEngineeringInterfacePerson()); - } else { - projectLawsInventoryEO.setEngineeringInterfacePersonName("null"); - } - - //发起人 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignInitiatorId())) { - userIdList.add(projectLawsInventoryEO.getDesignInitiatorId()); - } else { - projectLawsInventoryEO.setDesignInitiatorName("null"); - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoInitiatorId())) { - userIdList.add(projectLawsInventoryEO.getPrehomoInitiatorId()); - } else { - projectLawsInventoryEO.setPrehomoInitiatorName("null"); - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyInitiatorId())) { - userIdList.add(projectLawsInventoryEO.getVerifyInitiatorId()); - } else { - projectLawsInventoryEO.setVerifyInitiatorName("null"); - } - - //责任人 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDutyId())) { - userIdList.add(projectLawsInventoryEO.getDesignDutyId()); - } else { - projectLawsInventoryEO.setDesignDutyIdName("null"); - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDutyId())) { - userIdList.add(projectLawsInventoryEO.getPrehomoDutyId()); - } else { - projectLawsInventoryEO.setPrehomoDutyName("null"); - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDutyId())) { - userIdList.add(projectLawsInventoryEO.getVerifyDutyId()); - } else { - projectLawsInventoryEO.setVerifyDutyIdName("null"); - } - - userIdList = userIdList.stream().distinct().collect(Collectors.toList()); - if (CollectionUtils.isNotEmpty(userIdList)) { - QueryWrapper userqueryWrapper = new QueryWrapper<>(); - List userList = sysUserService.list(userqueryWrapper.in("id ", userIdList)); - - //法规工程师 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getRegulationOwnerId())) { - List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getRegulationOwnerId())).map(f -> f.getUsername()).collect(Collectors.toList()); - if (collect.size() != 0) { - String userName = collect.get(0); - projectLawsInventoryEO.setRegulationOwnerName(userName); - } - } - - //认证工程师 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getHomologationEngineerId())) { - List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getHomologationEngineerId())).map(f -> f.getUsername()).collect(Collectors.toList()); - if (collect.size() != 0) { - String userName = collect.get(0); - projectLawsInventoryEO.setHomologationEngineerName(userName); - } - } - - //工程接口人 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getEngineeringInterfacePerson())) { - List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getEngineeringInterfacePerson())).map(f -> f.getUsername()).collect(Collectors.toList()); - if (collect.size() != 0) { - String userName = collect.get(0); - projectLawsInventoryEO.setEngineeringInterfacePersonName(userName); - } - } - - - //发起人 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignInitiatorId())) { - List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getDesignInitiatorId())).map(f -> f.getUsername()).collect(Collectors.toList()); - if (collect.size() != 0) { - String userName = collect.get(0); - projectLawsInventoryEO.setDesignInitiatorName(userName); - } - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoInitiatorId())) { - List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getPrehomoInitiatorId())).map(f -> f.getUsername()).collect(Collectors.toList()); - if (collect.size() != 0) { - String userName = collect.get(0); - projectLawsInventoryEO.setPrehomoInitiatorName(userName); - } - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyInitiatorId())) { - List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getVerifyInitiatorId())).map(f -> f.getUsername()).collect(Collectors.toList()); - if (collect.size() != 0) { - String userName = collect.get(0); - projectLawsInventoryEO.setVerifyInitiatorName(userName); - } - } - - //责任人 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDutyId())) { - List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getDesignDutyId())).map(f -> f.getUsername()).collect(Collectors.toList()); - if (collect.size() != 0) { - String userName = collect.get(0); - projectLawsInventoryEO.setDesignDutyIdName(userName); - } - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDutyId())) { - List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getPrehomoDutyId())).map(f -> f.getUsername()).collect(Collectors.toList()); - if (collect.size() != 0) { - String userName = collect.get(0); - projectLawsInventoryEO.setPrehomoDutyName(userName); - } - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDutyId())) { - List collect = userList.stream().filter(e -> e.getId().equals(projectLawsInventoryEO.getVerifyDutyId())).map(f -> f.getUsername()).collect(Collectors.toList()); - if (collect.size() != 0) { - String userName = collect.get(0); - projectLawsInventoryEO.setVerifyDutyIdName(userName); - } - } - } - - - //截止时间 - //设计符合性确认-截止时间 designDueDate - if (projectLawsInventoryEO.getDesignDueDate() != null) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String dateString = sdf.format(projectLawsInventoryEO.getDesignDueDate()); - projectLawsInventoryEO.setDesignDueDateString(dateString); - } else { - projectLawsInventoryEO.setDesignDueDateString("null"); - } - //prehomo确认-截止时间 prehomoDueDate - if (projectLawsInventoryEO.getPrehomoDueDate() != null) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String dateString = sdf.format(projectLawsInventoryEO.getPrehomoDueDate()); - projectLawsInventoryEO.setPrehomoDueDateString(dateString); - } else { - projectLawsInventoryEO.setPrehomoDueDateString("null"); - } - //验证符合性确认-截止时间 verifyDueDate - if (projectLawsInventoryEO.getVerifyDueDate() != null) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String dateString = sdf.format(projectLawsInventoryEO.getVerifyDueDate()); - projectLawsInventoryEO.setVerifyDueDateString(dateString); - } else { - projectLawsInventoryEO.setVerifyDueDateString("null"); - } - - //文件 - List deliverableList = new ArrayList<>(); - //设计符合性确认交付物模板 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableTemplate())) { - deliverableList.addAll(Arrays.asList(projectLawsInventoryEO.getDesignDeliverableTemplate().split(","))); - } - // Prehomo确认交付物模板 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableTemplate())) { - deliverableList.addAll(Arrays.asList(projectLawsInventoryEO.getPrehomoDeliverableTemplate().split(","))); - } - // 验证符合性确认交付物模板 - if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableTemplate())) { - deliverableList.addAll(Arrays.asList(projectLawsInventoryEO.getVerifyDeliverableTemplate().split(","))); - } - List fileInfos = new ArrayList<>(); - if (deliverableList.size() != 0) { - fileInfos = iOSSFileService.getFileInfos(org.apache.commons.lang3.StringUtils.join(deliverableList, ",")); - } - //交付物类型模板 - if (fileInfos.size() != 0) { - if (StringUtils.isNotBlank(projectLawsInventoryEO.getDesignDeliverableTemplate())) { - String fileName = getFileName(projectLawsInventoryEO, fileInfos, projectLawsInventoryEO.getDesignDeliverableTemplate()); - if (org.apache.commons.lang3.StringUtils.isNotBlank(fileName)) { - projectLawsInventoryEO.setDesignDeliverableTemplateName(fileName); - } - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getPrehomoDeliverableTemplate())) { - String fileName = getFileName(projectLawsInventoryEO, fileInfos, projectLawsInventoryEO.getPrehomoDeliverableTemplate()); - if (org.apache.commons.lang3.StringUtils.isNotBlank(fileName)) { - projectLawsInventoryEO.setPrehomoDeliverableTemplateName(fileName); - } - } - if (StringUtils.isNotBlank(projectLawsInventoryEO.getVerifyDeliverableTemplate())) { - String fileName = getFileName(projectLawsInventoryEO, fileInfos, projectLawsInventoryEO.getVerifyDeliverableTemplate()); - if (org.apache.commons.lang3.StringUtils.isNotBlank(fileName)) { - projectLawsInventoryEO.setVerifyDeliverableTemplateName(fileName); - - } - } - } - } - } private ProjectLawsInventoryEO dataCompare(ProjectLawsInventoryEO projectLawsInventoryEO, DummyInventoryInfoEO dummyInventoryInfoEO) { //编号 @@ -7294,31 +4985,31 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl infoDiff, String contentLog, Map infoDiffEn, String enContentLog, String projectLibraryId) { - - //设置维护清单的修改消息 - if (MapUtils.isNotEmpty(infoDiff)) { - if (infoDiff.size() > 1) { - //子标题 - if (StringUtils.isNotBlank(infoDiff.get("subtitle"))) { - List list = Arrays.asList(infoDiff.get("subtitle").split(",")); - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.SUBTITLE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("subtitle"))) { - List listEn = Arrays.asList(infoDiffEn.get("subtitle").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.SUBTITLE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - //WVTA ID - if (StringUtils.isNotBlank(infoDiff.get("wvtaId"))) { - List list = Arrays.asList(infoDiff.get("wvtaId").split(",")); - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.WVTA_ID.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("wvtaId"))) { - List listEn = Arrays.asList(infoDiffEn.get("wvtaId").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.WVTA_ID.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - - //实施类别 - if (StringUtils.isNotBlank(infoDiff.get("implementType"))) { - List list = Arrays.asList(infoDiff.get("implementType").split(",")); - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.IMPLEMENT_TYPE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("implementType"))) { - List listEn = Arrays.asList(infoDiffEn.get("implementType").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.IMPLEMENT_TYPE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - - //在产车实施日期 - if (StringUtils.isNotBlank(infoDiff.get("implementTimeString"))) { - List list = Arrays.asList(infoDiff.get("implementTimeString").split(",")); - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.IMPLEMENT_TIME.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("implementTimeString"))) { - List listEn = Arrays.asList(infoDiffEn.get("implementTimeString").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.IMPLEMENT_TIME.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - - //新车型实施日期 - if (StringUtils.isNotBlank(infoDiff.get("xin1Che1Xing2Shi2Shi1Ri4Qi1String"))) { - List list = Arrays.asList(infoDiff.get("xin1Che1Xing2Shi2Shi1Ri4Qi1String").split(",")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.XIN1_CHE1_XING2_SHI2_SHI1_RI4_QI1.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("xin1Che1Xing2Shi2Shi1Ri4Qi1String"))) { - List listEn = Arrays.asList(infoDiffEn.get("xin1Che1Xing2Shi2Shi1Ri4Qi1String").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.XIN1_CHE1_XING2_SHI2_SHI1_RI4_QI1.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - - //认证类型 - if (StringUtils.isNotBlank(infoDiff.get("attestationType"))) { - List list = Arrays.asList(infoDiff.get("attestationType").split("\\|")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.ATTESTATION_TYPE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("attestationType"))) { - List listEn = Arrays.asList(infoDiffEn.get("attestationType").split("\\|")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.ATTESTATION_TYPE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - - //认证级别 - if (StringUtils.isNotBlank(infoDiff.get("attestationRank"))) { - List list = Arrays.asList(infoDiff.get("attestationRank").split(",")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.ATTESTATION_RANK.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("attestationRank"))) { - List listEn = Arrays.asList(infoDiffEn.get("attestationRank").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.ATTESTATION_RANK.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - - //责任领域 - if (StringUtils.isNotBlank(infoDiff.get("dutyTerritory"))) { - List list = Arrays.asList(infoDiff.get("dutyTerritory").split("\\|")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.DUTY_TERRITORY.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("dutyTerritory"))) { - List listEn = Arrays.asList(infoDiffEn.get("dutyTerritory").split("\\|")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.DUTY_TERRITORY.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - - //regulationOwnerName;//法规工程师名称 - if (StringUtils.isNotBlank(infoDiff.get("regulationOwnerName"))) { - List list = Arrays.asList(infoDiff.get("regulationOwnerName").split(",")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.REGULATION_OWNER_NAME.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("regulationOwnerName"))) { - List listEn = Arrays.asList(infoDiffEn.get("regulationOwnerName").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.REGULATION_OWNER_NAME.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - //homologationEngineerName;//认证工程师名称 - if (StringUtils.isNotBlank(infoDiff.get("homologationEngineerName"))) { - List list = Arrays.asList(infoDiff.get("homologationEngineerName").split(",")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.HOMOLOGATION_ENGINEER_NAME.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("homologationEngineerName"))) { - List listEn = Arrays.asList(infoDiffEn.get("homologationEngineerName").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.HOMOLOGATION_ENGINEER_NAME.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - //engineeringInterfacePersonName;//工程接口人名称 - if (StringUtils.isNotBlank(infoDiff.get("engineeringInterfacePersonName"))) { - List list = Arrays.asList(infoDiff.get("engineeringInterfacePersonName").split(",")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.ENGINEERING_INTERFACE_PERSON_NAME.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("engineeringInterfacePersonName"))) { - List listEn = Arrays.asList(infoDiffEn.get("engineeringInterfacePersonName").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.ENGINEERING_INTERFACE_PERSON_NAME.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - - //适用地区region 多选 - if (StringUtils.isNotBlank(infoDiff.get("region"))) { - List list = Arrays.asList(infoDiff.get("region").split("\\|")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.REGION.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("region"))) { - List listEn = Arrays.asList(infoDiffEn.get("region").split("\\|")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.REGION.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - - //备注 - if (StringUtils.isNotBlank(infoDiff.get("remark"))) { - List list = Arrays.asList(infoDiff.get("remark").split(",")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.REMARK.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("remark"))) { - List listEn = Arrays.asList(infoDiffEn.get("remark").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.REMARK.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - - //设计符合性确认-交付物类型 - if (StringUtils.isNotBlank(infoDiff.get("designDeliverableTypeName"))) { - List list = Arrays.asList(infoDiff.get("designDeliverableTypeName").split("\\|")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DELIVERABLE_TYPE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("designDeliverableTypeName"))) { - List listEn = Arrays.asList(infoDiffEn.get("designDeliverableTypeName").split("\\|")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DELIVERABLE_TYPE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - //设计符合性确认-交付物模板 - if (StringUtils.isNotBlank(infoDiff.get("designDeliverableTemplateName"))) { - List list = Arrays.asList(infoDiff.get("designDeliverableTemplateName").split("\\|")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DELIVERABLE_TEMPLATE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("designDeliverableTemplateName"))) { - List listEn = Arrays.asList(infoDiffEn.get("designDeliverableTemplateName").split("\\|")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DELIVERABLE_TEMPLATE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - //设计符合性确认-发起人 - if (StringUtils.isNotBlank(infoDiff.get("designInitiatorName"))) { - List list = Arrays.asList(infoDiff.get("designInitiatorName").split(",")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.DESIGN_INITIATOR.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("designInitiatorName"))) { - List listEn = Arrays.asList(infoDiffEn.get("designInitiatorName").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.DESIGN_INITIATOR.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - //设计符合性确认-责任人 - if (StringUtils.isNotBlank(infoDiff.get("designDutyName"))) { - List list = Arrays.asList(infoDiff.get("designDutyName").split(",")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DUTY.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("designDutyName"))) { - List listEn = Arrays.asList(infoDiffEn.get("designDutyName").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DUTY.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - //设计符合性确认-截止时间designDueDateString; - if (StringUtils.isNotBlank(infoDiff.get("designDueDateString"))) { - List list = Arrays.asList(infoDiff.get("designDueDateString").split(",")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("designDueDateString"))) { - List listEn = Arrays.asList(infoDiffEn.get("designDueDateString").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - //prehomo确认-交付物类型 - if (StringUtils.isNotBlank(infoDiff.get("prehomoDeliverableTypeName"))) { - List list = Arrays.asList(infoDiff.get("prehomoDeliverableTypeName").split("\\|")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.PREHOMO_DELIVERABLE_TYPE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("prehomoDeliverableTypeName"))) { - List listEn = Arrays.asList(infoDiffEn.get("prehomoDeliverableTypeName").split("\\|")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.PREHOMO_DELIVERABLE_TYPE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - //prehomo确认-交付物模板 - if (StringUtils.isNotBlank(infoDiff.get("prehomoDeliverableTemplateName"))) { - List list = Arrays.asList(infoDiff.get("prehomoDeliverableTemplateName").split("\\|")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.PREHOMO_DELIVERABLE_TEMPLATE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("prehomoDeliverableTemplateName"))) { - List listEn = Arrays.asList(infoDiffEn.get("prehomoDeliverableTemplateName").split("\\|")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.PREHOMO_DELIVERABLE_TEMPLATE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - //prehomo确认-发起人 - if (StringUtils.isNotBlank(infoDiff.get("prehomoInitiatorName"))) { - List list = Arrays.asList(infoDiff.get("prehomoInitiatorName").split(",")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.PREHOMO_INITIATOR.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("prehomoInitiatorName"))) { - List listEn = Arrays.asList(infoDiffEn.get("prehomoInitiatorName").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.PREHOMO_INITIATOR.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - //prehomo确认-责任人 - if (StringUtils.isNotBlank(infoDiff.get("prehomoDutyName"))) { - List list = Arrays.asList(infoDiff.get("prehomoDutyName").split(",")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.PREHOMO_DUTY.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("prehomoDutyName"))) { - List listEn = Arrays.asList(infoDiffEn.get("prehomoDutyName").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.PREHOMO_DUTY.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - //prehomo确认-截止时间prehomoDueDateString; - if (StringUtils.isNotBlank(infoDiff.get("prehomoDueDateString"))) { - List list = Arrays.asList(infoDiff.get("prehomoDueDateString").split(",")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("prehomoDueDateString"))) { - List listEn = Arrays.asList(infoDiffEn.get("prehomoDueDateString").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - - //验证符合性确认-交付物类型 - if (StringUtils.isNotBlank(infoDiff.get("verifyDeliverableTypeName"))) { - List list = Arrays.asList(infoDiff.get("verifyDeliverableTypeName").split("\\|")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.VERIFY_DELIVERABLE_TYPE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("verifyDeliverableTypeName"))) { - List listEn = Arrays.asList(infoDiffEn.get("verifyDeliverableTypeName").split("\\|")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.VERIFY_DELIVERABLE_TYPE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - //验证符合性确认-交付物模板 - if (StringUtils.isNotBlank(infoDiff.get("verifyDeliverableTemplateName"))) { - List list = Arrays.asList(infoDiff.get("verifyDeliverableTemplateName").split("\\|")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.VERIFY_DELIVERABLE_TEMPLATE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("verifyDeliverableTemplateName"))) { - List listEn = Arrays.asList(infoDiffEn.get("verifyDeliverableTemplateName").split("\\|")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.VERIFY_DELIVERABLE_TEMPLATE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - //验证符合性确认-发起人 - if (StringUtils.isNotBlank(infoDiff.get("verifyInitiatorName"))) { - List list = Arrays.asList(infoDiff.get("verifyInitiatorName").split(",")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.VERIFY_INITIATOR.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("verifyInitiatorName"))) { - List listEn = Arrays.asList(infoDiffEn.get("verifyInitiatorName").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.VERIFY_INITIATOR.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - //验证符合性确认-责任人 - if (StringUtils.isNotBlank(infoDiff.get("verifyDutyName"))) { - List list = Arrays.asList(infoDiff.get("verifyDutyName").split(",")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.VERIFY_DUTY.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("verifyDutyName"))) { - List listEn = Arrays.asList(infoDiffEn.get("verifyDutyName").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.VERIFY_DUTY.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - //验证符合性确认-截止时间verifyDueDateString - if (StringUtils.isNotBlank(infoDiff.get("verifyDueDateString"))) { - List list = Arrays.asList(infoDiff.get("verifyDueDateString").split(",")); - - if (list.size() > 1) { - String infoDiffOld = list.get(0); - String infoDiffNew = list.get(1); - contentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getName() + "'由" + infoDiffOld + "改为了" + infoDiffNew + "
"; - } - if (StringUtils.isNotBlank(infoDiffEn.get("verifyDueDateString"))) { - List listEn = Arrays.asList(infoDiffEn.get("verifyDueDateString").split(",")); - if (listEn.size() > 1) { - String infoDiffOldEn = listEn.get(0); - String infoDiffNewEn = listEn.get(1); - enContentLog += "'" + ProjectInventoryFieldEnum.DESIGN_DUE_DATE.getEnName() + "' has been changed from " + infoDiffOldEn + " to " + infoDiffNewEn + "
"; - } - } - } - - contentLog = contentLog.substring(0, contentLog.length() - 1); - enContentLog = enContentLog.substring(0, enContentLog.length() - 1); - projectLawsInventoryLogEOService.updateLog(contentLog, projectLibraryId, CutEnum.CN.getValue()); - projectLawsInventoryLogEOService.updateLog(enContentLog, projectLibraryId, CutEnum.EN.getValue()); - } - } - } - //表格高度 private static int high = 25; //表格宽度 @@ -14136,4 +11301,54 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl projectLibraryBaseQueryWrapper = new QueryWrapper<>(); + projectLibraryBaseQueryWrapper.lambda().eq(ProjectLibraryBase::getId, projectLibraryId); + projectLibraryBaseQueryWrapper.lambda().eq(ProjectLibraryBase::getStudioEngineer, currentUserId); + Integer projectLibrayBaseCount = projectLibraryBaseMapper.selectCount(projectLibraryBaseQueryWrapper); + if (projectLibrayBaseCount > 0) { + result = Integer.parseInt(ProjectRoleEnum.STUDIO_ENGINEER.getValue()); + } else { + if (StringUtils.isNotEmpty(lawsInventoryId)) { + //查询用户是否是法规工程师 + QueryWrapper queryWrapperFG = new QueryWrapper<>(); + queryWrapperFG.lambda().eq(ProjectLawsInventoryEO::getRegulationOwnerId, currentUserId); + queryWrapperFG.lambda().eq(ProjectLawsInventoryEO::getId, lawsInventoryId); + Integer lawsInventoryCountFG = super.baseMapper.selectCount(queryWrapperFG); + + QueryWrapper queryWrapperRZ = new QueryWrapper<>(); + queryWrapperRZ.lambda().eq(ProjectLawsInventoryEO::getHomologationEngineerId, currentUserId); + queryWrapperRZ.lambda().eq(ProjectLawsInventoryEO::getId, lawsInventoryId); + Integer lawsInventoryCountRZ = super.baseMapper.selectCount(queryWrapperRZ); + + //如果两个工程师都是这个用户 + if (lawsInventoryCountFG > 0 && lawsInventoryCountRZ > 0) { + result = Integer.parseInt(ProjectRoleEnum.REGULATI_AND_HOMOLOGATION_ENGINEER.getValue()); + } else if (lawsInventoryCountFG > 0) { + result = Integer.parseInt(ProjectRoleEnum.REGULATI_ENGINEER.getValue()); + } else if (lawsInventoryCountRZ > 0) { + result = Integer.parseInt(ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue()); + } + } + } + } catch (Exception ex) { + log.error("验证用户在该项目中的角色失败:" + ex.getMessage()); + throw new JeroBootException("验证用户在该项目中的角色失败!"); + } + return result; + } + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/controller/PhoneProjectProcessTodoCenterController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/controller/PhoneProjectProcessTodoCenterController.java index 029c5717a..8904fbc5e 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/controller/PhoneProjectProcessTodoCenterController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/controller/PhoneProjectProcessTodoCenterController.java @@ -61,4 +61,11 @@ public class PhoneProjectProcessTodoCenterController { public Result complianceDataMigration(@RequestParam Map params) { return this.processInfoEOService.complianceDataMigration(params); } + + @AutoLog(value = "待办中心-查询任务TASKID") + @ApiOperation(value="待办中心-查询任务TASKID", notes="待办中心-查询任务TASKID") + @GetMapping(value = "/queryTaskId") + public Result queryTaskId(@RequestParam Map params) { + return this.processInfoEOService.queryTaskId(params); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/controller/ProjectProcessTodoCenterController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/controller/ProjectProcessTodoCenterController.java index 2471cc59e..cd3ce4c51 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/controller/ProjectProcessTodoCenterController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/controller/ProjectProcessTodoCenterController.java @@ -61,4 +61,12 @@ public class ProjectProcessTodoCenterController { public Result complianceDataMigration(@RequestParam Map params) { return this.processInfoEOService.complianceDataMigration(params); } + + @AutoLog(value = "待办中心-查询任务TASKID") + @ApiOperation(value="待办中心-查询任务TASKID", notes="待办中心-查询任务TASKID") + @GetMapping(value = "/queryTaskId") + public Result queryTaskId(@RequestParam Map params) { + return this.processInfoEOService.queryTaskId(params); + } + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/enums/DesignComplianceFlowNodeKeyEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/enums/DesignComplianceFlowNodeKeyEnum.java index 4c7146efc..e8a6aea0a 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/enums/DesignComplianceFlowNodeKeyEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/enums/DesignComplianceFlowNodeKeyEnum.java @@ -7,7 +7,7 @@ import org.apache.commons.lang3.StringUtils; * 待办中心-设计符合性流程节点key枚举类 */ public enum DesignComplianceFlowNodeKeyEnum { - FQLC("发起流程","Task Initiation","fqlc"), + FQLC("发起流程","Process Initiation","fqlc"), ZRRQR("任务责任确认","Responsibilty Confirmation","zrrqr"), // 责任人确认 DEZRRQR("任务责任确认","Responsibilty Confirmation","dezrrqr"),// 第二责任人确认 ZRRTJJFW("符合性确认","Compliance Confirmation","zrrtjjfw"),// "责任人提交交付物" diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/enums/VerifyComplianceFlowNodeKeyEnum.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/enums/VerifyComplianceFlowNodeKeyEnum.java index 587fe1f73..32b33f72e 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/enums/VerifyComplianceFlowNodeKeyEnum.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/enums/VerifyComplianceFlowNodeKeyEnum.java @@ -7,7 +7,7 @@ import org.apache.commons.lang3.StringUtils; * 待办中心-验证符合性流程节点key枚举类 */ public enum VerifyComplianceFlowNodeKeyEnum { - FQLC("发起流程","Task Initiation","fqlc"), + FQLC("发起流程","Process Initiation","fqlc"), ZRRQR("任务责任确认","Responsibilty Confirmation","zrrqr"), // 责任人确认 DEZRRQR("任务责任确认","Responsibilty Confirmation","dezrrqr"),// 第二责任人确认 ZRRTJJFW("符合性确认","Compliance Confirmation","zrrtjjfw"),// "责任人提交交付物" diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/service/IProcessInfoEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/service/IProcessInfoEOService.java index c0c5d82da..839debca5 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/service/IProcessInfoEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/service/IProcessInfoEOService.java @@ -132,4 +132,6 @@ public interface IProcessInfoEOService extends IService { void disposeData(List datas, String cut, String taskStatus); public void setPersonChargeFeedback(List datas); + + Result queryTaskId(Map params); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/service/impl/ProcessInfoEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/service/impl/ProcessInfoEOServiceImpl.java index 9403ec827..9992978c4 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/service/impl/ProcessInfoEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/service/impl/ProcessInfoEOServiceImpl.java @@ -778,11 +778,11 @@ public class ProcessInfoEOServiceImpl extends ServiceImpl queryTaskId(Map params) { + String taskId = ""; + String projectLawsInventoryId = (String) params.get("projectLawsInventoryId"); + String flowType = (String) params.get("flowType"); + QueryWrapper processInfoDetailEOQueryWrapper = new QueryWrapper<>(); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getProjectLawsInventoryId, projectLawsInventoryId); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getFlowType, flowType); + processInfoDetailEOQueryWrapper.lambda().eq(ProcessInfoDetailEO::getStatus, TaskStatusEnum.NOT_DONE.getValue()); + List processInfoDetailEOS = this.processInfoDetailEOService.list(processInfoDetailEOQueryWrapper); + if (CollectionUtils.isNotEmpty(processInfoDetailEOS)) { + taskId = processInfoDetailEOS.get(0).getTaskId(); + } + return Result.OK(taskId); + } }