diff --git a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/enums/MsgColorEnum.java b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/enums/MsgColorEnum.java index ba74f1908..f8064cc7e 100644 --- a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/enums/MsgColorEnum.java +++ b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/enums/MsgColorEnum.java @@ -4,7 +4,7 @@ public enum MsgColorEnum { GREEN("其他","green"), RED("任务被拒绝","red"), - YELLOW("任务预期","yellow"); + YELLOW("任务逾期","yellow"); String label; String value; diff --git a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/shiro/ShiroConfig.java b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/shiro/ShiroConfig.java index f94670b2d..6a49669a8 100644 --- a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/shiro/ShiroConfig.java +++ b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/config/shiro/ShiroConfig.java @@ -161,6 +161,8 @@ public class ShiroConfig { filterChainDefinitionMap.put("/lark/larkCardMessageConfig", "anon"); //飞书调用接口,卡片消息配置。 filterChainDefinitionMap.put("/sys/user/querySysUserListByIdList", "anon"); // 工作流根据用户idList获取用户信息接口 filterChainDefinitionMap.put("/project/projectTaskInventoryConditionAssessmentEO/initConditionAssessment", "anon"); // 初始化项目当前状态数据接口 + filterChainDefinitionMap.put("/todoCenter/projectProcess/initHistoryData", "anon"); // 待办中心-初始化历史数据接口排除 + filterChainDefinitionMap.put("/project/projectTaskInventoryEO/disposeHistoryData", "anon"); // 项目库-任务清单 处理历史数据接口 // 添加自己的过滤器并且取名为jwt Map filterMap = new HashMap(1); diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/CommonController.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/CommonController.java index d95b68abb..87b28ce42 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/CommonController.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/CommonController.java @@ -158,11 +158,11 @@ public class CommonController { // bizPath = ""; // } } - if(file.getOriginalFilename().length()>70){ + if(file.getOriginalFilename().length()>100){ if(StringUtils.equals(cut,CutEnum.CN.getValue())){ - throw new JeroBootException("文件名长度不能超过70位,请检查!"); + throw new JeroBootException("文件名长度不能超过100位,请检查!"); }else if(StringUtils.equals(cut,CutEnum.EN.getValue())){ - throw new JeroBootException("File name length cannot exceed 70 characters, please check!"); + throw new JeroBootException("File name length cannot exceed 100 characters, please check!"); } } // OSSFile oSSFile = ossFileService.uploadLocal(file, bizPath,state,cut); diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/entity/SysAnnouncement.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/entity/SysAnnouncement.java index 4da6a9046..fac7280f7 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/entity/SysAnnouncement.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/entity/SysAnnouncement.java @@ -157,4 +157,8 @@ public class SysAnnouncement implements Serializable { * 发起人 */ private java.lang.String initiator; + + private java.lang.String msgContentCn;//消息的中文(不带标签) + + private java.lang.String msgContentInfoCn;//消息的中文(带标签) } diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/enums/RoleEnum.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/enums/RoleEnum.java index 5e344c977..0b743f160 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/enums/RoleEnum.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/enums/RoleEnum.java @@ -4,6 +4,8 @@ public enum RoleEnum { ADMIN_ID("R&H Manager","R&H Manager","manager","1534020391015444481",2), MANAGER_ID("系统管理员","Administrator","admin","f6817f48af4fb3af11b9e8bf182f618b",3), COUNTRU_CARD_MANAGE("countryCard管理员","countryCardManage","countryCardManage","1564916346120916993",4), + ENGINEERING_INTERFACE_PERSON("工程接口人","engineeringInterfacePerson","engineeringInterfacePerson","1534020084667674626",5), + ENGINEER("工程师","engineer","engineer","1534020318437208065",6), ; String name; diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/mapper/xml/SysAnnouncementSendMapper.xml b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/mapper/xml/SysAnnouncementSendMapper.xml index eeaf3e484..e8572c2ad 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/mapper/xml/SysAnnouncementSendMapper.xml +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/mapper/xml/SysAnnouncementSendMapper.xml @@ -18,6 +18,8 @@ + + @@ -96,16 +153,57 @@ LEFT JOIN project_laws_inventory pli ON ( pli.stand_id = bdl.id ) LEFT JOIN project_task_inventory pti ON ( pli.id = pti.project_laws_inventory_id ) WHERE + ( - bdl.id IN ( SELECT DISTINCT stand_id FROM laws_opinion_gather) - OR bdl.id IN ( SELECT DISTINCT stand_id FROM laws_technology_evaluation) - or pti.design_p_id IS NOT NULL - OR pti.prehomo_p_id IS NOT NULL - OR pti.verify_p_id IS NOT NULL + bdl.id IN ( + SELECT + DISTINCT stand_id + FROM laws_opinion_gather + where gather_result = #{params.gatherResult} ) - - ${params.condition} - + OR bdl.id IN ( + SELECT + DISTINCT stand_id + FROM laws_technology_evaluation + where flow_status = #{params.flowStatus} + ) + OR pti.design_p_id IS NOT NULL + OR pti.prehomo_p_id IS NOT NULL + OR pti.verify_p_id IS NOT NULL + ) + + + + ( + bdl.id IN ( + SELECT + DISTINCT stand_id + FROM + laws_opinion_gather + where gather_result = #{params.gatherResult} and evaluator_ids like CONCAT(CONCAT('%',#{params.currentUserId}),'%') + ) + OR bdl.id IN ( + SELECT + DISTINCT stand_id + FROM + laws_technology_evaluation + where flow_status = #{params.flowStatus} + and id in ( + select + laws_technology_evaluation_id + from + laws_technology_evaluation_flow_detail + where evaluator_id = #{params.currentUserId} + ) + ) + OR (pti.design_p_id IS NOT NULL and (pli.design_initiator_id = #{params.currentUserId} or pli.design_duty_id = #{params.currentUserId})) + OR (pti.prehomo_p_id IS NOT NULL and (pli.prehomo_initiator_id = #{params.currentUserId} or pli.prehomo_duty_id = #{params.currentUserId})) + OR (pti.verify_p_id IS NOT NULL and (pli.verify_initiator_id = #{params.currentUserId} or pli.verify_duty_id = #{params.currentUserId})) + ) + + + ${params.condition} + GROUP BY bdl.id order by bdl.create_time desc diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/xml/NcrTrackMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/xml/NcrTrackMapper.xml index cd15845a4..df5398987 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/xml/NcrTrackMapper.xml +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/mapper/xml/NcrTrackMapper.xml @@ -80,12 +80,15 @@ or prehomo_flow_task_status =#{ncrTrackVO.inconformity} or prehomo_flow_task_status =#{ncrTrackVO.track} or verify_flow_task_status =#{ncrTrackVO.inconformity} or verify_flow_task_status =#{ncrTrackVO.track} ) - - and (pli.regulation_owner_id =#{ncrTrackVO.userId} - or pli.homologation_engineer_id =#{ncrTrackVO.userId} - or pli.engineering_interface_person =#{ncrTrackVO.userId} - or ptid.user_id =#{ncrTrackVO.userId} - ) + + + + and (pli.regulation_owner_id =#{ncrTrackVO.userId} + or pli.homologation_engineer_id =#{ncrTrackVO.userId} + or pli.engineering_interface_person =#{ncrTrackVO.userId} + or ptid.user_id =#{ncrTrackVO.userId} + ) + order by pli.create_time desc 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 7554c278d..6a97580f9 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 @@ -8,6 +8,7 @@ import com.jero.common.constant.enums.MessageTypeEnum; import com.jero.common.system.vo.LoginUser; import com.jero.modules.feishu.vo.FeishuMsgVo; import com.jero.modules.project.entity.ProjectLawsInventoryEO; +import com.jero.modules.project.vo.ProjectTaskUrgVo; import com.jero.modules.system.entity.SysRole; import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO; import com.jero.modules.todoCenter.entity.ProcessInfoEO; @@ -156,4 +157,7 @@ public interface IProjectLawsInventoryEOService extends IService processInfoDetailEOList, Date endTime); + + Result taskUrg(ProjectTaskUrgVo projectTaskUrgVo); + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectTaskInventoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectTaskInventoryEOService.java index 0ade9b8a2..1331b79cc 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectTaskInventoryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectTaskInventoryEOService.java @@ -9,6 +9,7 @@ import com.jero.modules.project.vo.ProjectTaskInventoryVO; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.List; +import java.util.Map; /** * @Description: 项目库-任务清单表 @@ -102,4 +103,11 @@ public interface IProjectTaskInventoryEOService extends IService verifyRoleCode(ProjectTaskInventoryVO projectTaskInventoryVO); void exportXls(HttpServletResponse response, HttpServletRequest request, ProjectTaskInventoryEO projectTaskInventoryEO); + + /** + * 处理历史数据 + * @param params + * @return + */ + Result disposeHistoryData(Map params); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/LawsComplianceBoardServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/LawsComplianceBoardServiceImpl.java index e1742535b..be69a99c0 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/LawsComplianceBoardServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/LawsComplianceBoardServiceImpl.java @@ -25,6 +25,7 @@ import com.jero.modules.project.service.ILawsComplianceBoardService; import com.jero.modules.system.entity.SysCategory; import com.jero.modules.system.entity.SysDictItem; import com.jero.modules.system.service.ISysDictItemService; +import com.jero.modules.system.service.ISysUserService; import com.jero.modules.system.service.impl.SysCategoryServiceImpl; import com.jero.modules.system.service.impl.SysDictItemServiceImpl; import com.jero.modules.system.util.StringUtils; @@ -68,6 +69,8 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi private ISysDictItemService sysDictItemService; @Autowired private ProjectTaskInventoryDetailEOMapper projectTaskInventoryDetailEOMapper; + @Autowired + private ISysUserService sysUserService; @Override public IPage queryPageList(Map params) { @@ -81,6 +84,18 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi //只查询 法规技术评估流程状态、法规意见收集 收集结果 为已完成的数据 params.put("flowStatus", GatherResultEnum.COMPLETED.getValue()); params.put("gatherResult", GatherResultEnum.COMPLETED.getValue()); + + /** + * 2022-11-01 增加数据权限:如果当前登录用户,是工程师、工程接口人角色,只能查看到跟自己相关的数据。其余角色保留之前的查询结果。 + */ + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + boolean isEngineer = this.sysUserService.isEngineer(currentUser); + boolean isEngineeringInterfacePerson = this.sysUserService.isEngineeringInterfacePerson(currentUser); + if(isEngineer || isEngineeringInterfacePerson){ + params.put("currentUserId",currentUser.getId()); + params.put("isEngineerOrEngineeringInterfacePerson",true); + } + IPage page = new Page(pageNo, pageSize); IPage infoPage = this.lawsComplianceBoardMapper.queryPageList(page, params); List records = infoPage.getRecords(); @@ -142,18 +157,28 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi @Override public JSONObject queryComplianceResultList(Map params) { + /** + * 2022-11-01 增加数据权限:如果当前登录用户,是工程师、工程接口人角色,只能查看到跟自己相关的数据。其余角色保留之前的查询结果。 + */ + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + boolean isEngineer = this.sysUserService.isEngineer(currentUser); + boolean isEngineeringInterfacePerson = this.sysUserService.isEngineeringInterfacePerson(currentUser); + if(isEngineer || isEngineeringInterfacePerson){ + params.put("currentUserId",currentUser.getId()); + params.put("isEngineerOrEngineeringInterfacePerson",true); + } + JSONObject result = new JSONObject(); String id = (String) params.get("id"); String cut = (String) params.get("cut"); List> complianceResultList = this.lawsComplianceBoardMapper.queryComplianceResultList(params); if(CollectionUtils.isNotEmpty(complianceResultList)){ - LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); List projectLawsInventoryIdList = complianceResultList.stream().map(map-> (String) map.get("id")).collect(Collectors.toList()); QueryWrapper taskDetailQueryWrapper = new QueryWrapper<>(); taskDetailQueryWrapper.lambda().in(ProjectTaskInventoryDetailEO::getProjectTaskInventoryId,projectLawsInventoryIdList); List projectTaskInventoryDetailEOList = this.projectTaskInventoryDetailEOMapper.selectList(taskDetailQueryWrapper); - this.createTaskInventoryEOList(complianceResultList,projectTaskInventoryDetailEOList,currentUser); - this.disposeComplianceResult(complianceResultList,cut); + this.createTaskInventoryEOList(complianceResultList,projectTaskInventoryDetailEOList,currentUser,isEngineer,isEngineeringInterfacePerson); + this.disposeComplianceResult(complianceResultList,cut,isEngineer,isEngineeringInterfacePerson); } result.put("complianceResultList",complianceResultList); @@ -161,6 +186,10 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi QueryWrapper opinionGatherEOQueryWrapper = new QueryWrapper<>(); opinionGatherEOQueryWrapper.lambda().eq(LawsOpinionGatherEO::getStandId,id); opinionGatherEOQueryWrapper.lambda().eq(LawsOpinionGatherEO::getGatherResult,GatherResultEnum.COMPLETED.getValue()); + //如果当前登录用户是工程师或工程接口人,只查询自己为评估人的法规意见收集数据。 + if(isEngineer || isEngineeringInterfacePerson){ + opinionGatherEOQueryWrapper.lambda().like(LawsOpinionGatherEO::getEvaluatorIds,currentUser.getId()); + } int opinionGatherCount = this.lawsOpinionGatherEOService.count(opinionGatherEOQueryWrapper); result.put("opinionGather",opinionGatherCount); @@ -168,6 +197,10 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi QueryWrapper evaluationEOQueryWrapper = new QueryWrapper<>(); evaluationEOQueryWrapper.lambda().eq(LawsTechnologyEvaluationEO::getStandId,id); evaluationEOQueryWrapper.lambda().eq(LawsTechnologyEvaluationEO::getFlowStatus,GatherResultEnum.COMPLETED.getValue()); + //如果当前登录用户是工程师或工程接口人,只查询自己为评估人的法规技术评估数据。 + if(isEngineer || isEngineeringInterfacePerson){ + this.lawsTechnologyEvaluationEOService.createQueryPermission(evaluationEOQueryWrapper,null,false); + } int evaluationCount = this.lawsTechnologyEvaluationEOService.count(evaluationEOQueryWrapper); result.put("technologyEvaluation",evaluationCount); return result; @@ -178,8 +211,14 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi * @param complianceResultList * @param projectTaskInventoryDetailEOList * @param currentUser + * @param isEngineer 是否是工程师角色 + * @param isEngineeringInterfacePerson 是否是工程接口人角色 */ - private void createTaskInventoryEOList(List> complianceResultList, List projectTaskInventoryDetailEOList, LoginUser currentUser) { + private void createTaskInventoryEOList(List> complianceResultList, + List projectTaskInventoryDetailEOList, + LoginUser currentUser, + boolean isEngineer, + boolean isEngineeringInterfacePerson) { if(CollectionUtils.isNotEmpty(complianceResultList) && CollectionUtils.isNotEmpty(projectTaskInventoryDetailEOList)){ for (Map complianceResult : complianceResultList) { String designPid = ""; @@ -199,44 +238,97 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi String verifyTaskStatus = ""; String verifyTaskDefinitionKey = ""; String verifyTaskDetailId = ""; - - for (ProjectTaskInventoryDetailEO projectTaskInventoryDetail : projectTaskInventoryDetailEOList) { - if(StringUtils.equals(complianceResult.get("id").toString(),projectTaskInventoryDetail.getProjectTaskInventoryId())){ - /** - * 查询数据权限,所有用户都是,自己的待办,可以跳转到处理任务详情页进行处理。 - * 不是自己的待办,只能跳转到处理任务的详情页。 - */ - if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(), FlowTypeEnum.SJFHXSHLC.getValue())){ - designPid = projectTaskInventoryDetail.getActiProcInstId(); - designTaskId = projectTaskInventoryDetail.getTaskId(); - designTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey(); - designTaskDetailId = projectTaskInventoryDetail.getId(); - if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){ - designTaskStatus = projectTaskInventoryDetail.getStatus(); - }else { - designTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue(); + //2022-11-01 增加数据权限:如果当前登录用户,是工程师、工程接口人角色,只能查看到跟自己相关的数据。其余角色保留之前的查询结果。 + if((isEngineer || isEngineeringInterfacePerson)){ + for (ProjectTaskInventoryDetailEO projectTaskInventoryDetail : projectTaskInventoryDetailEOList) { + if(StringUtils.equals(complianceResult.get("id").toString(),projectTaskInventoryDetail.getProjectTaskInventoryId())){ + /** + * 查询数据权限,所有用户都是,自己的待办,可以跳转到处理任务详情页进行处理。 + * 不是自己的待办,只能跳转到处理任务的详情页。 + */ + if(StringUtils.equals(complianceResult.get("designInitiatorId").toString(),currentUser.getId()) + || StringUtils.equals(complianceResult.get("designDutyId").toString(),currentUser.getId())){ + if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(), FlowTypeEnum.SJFHXSHLC.getValue())){ + designPid = projectTaskInventoryDetail.getActiProcInstId(); + designTaskId = projectTaskInventoryDetail.getTaskId(); + designTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey(); + designTaskDetailId = projectTaskInventoryDetail.getId(); + if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){ + designTaskStatus = projectTaskInventoryDetail.getStatus(); + }else { + designTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue(); + } + } + } + if(StringUtils.equals(complianceResult.get("prehomoInitiatorId").toString(),currentUser.getId()) + || StringUtils.equals(complianceResult.get("prehomoDutyId").toString(),currentUser.getId())){ + if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(),FlowTypeEnum.PREHOMOQRLC.getValue())){ + prehomoPid = projectTaskInventoryDetail.getActiProcInstId(); + prehomoTaskId = projectTaskInventoryDetail.getTaskId(); + prehomoTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey(); + prehomoTaskDetailId = projectTaskInventoryDetail.getId(); + if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){ + prehomoTaskStatus = projectTaskInventoryDetail.getStatus(); + }else { + prehomoTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue(); + } + } + } + if(StringUtils.equals(complianceResult.get("verifyInitiatorId").toString(),currentUser.getId()) + || StringUtils.equals(complianceResult.get("verifyDutyId").toString(),currentUser.getId())){ + if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(),FlowTypeEnum.YZFHXSCLC.getValue())){ + verifyPid = projectTaskInventoryDetail.getActiProcInstId(); + verifyTaskId = projectTaskInventoryDetail.getTaskId(); + verifyTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey(); + verifyTaskDetailId = projectTaskInventoryDetail.getId(); + if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){ + verifyTaskStatus = projectTaskInventoryDetail.getStatus(); + }else { + verifyTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue(); + } + } } } - if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(),FlowTypeEnum.PREHOMOQRLC.getValue())){ - prehomoPid = projectTaskInventoryDetail.getActiProcInstId(); - prehomoTaskId = projectTaskInventoryDetail.getTaskId(); - prehomoTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey(); - prehomoTaskDetailId = projectTaskInventoryDetail.getId(); - if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){ - prehomoTaskStatus = projectTaskInventoryDetail.getStatus(); - }else { - prehomoTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue(); + } + }else { + for (ProjectTaskInventoryDetailEO projectTaskInventoryDetail : projectTaskInventoryDetailEOList) { + if(StringUtils.equals(complianceResult.get("id").toString(),projectTaskInventoryDetail.getProjectTaskInventoryId())){ + /** + * 查询数据权限,所有用户都是,自己的待办,可以跳转到处理任务详情页进行处理。 + * 不是自己的待办,只能跳转到处理任务的详情页。 + */ + if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(), FlowTypeEnum.SJFHXSHLC.getValue())){ + designPid = projectTaskInventoryDetail.getActiProcInstId(); + designTaskId = projectTaskInventoryDetail.getTaskId(); + designTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey(); + designTaskDetailId = projectTaskInventoryDetail.getId(); + if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){ + designTaskStatus = projectTaskInventoryDetail.getStatus(); + }else { + designTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue(); + } } - } - if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(),FlowTypeEnum.YZFHXSCLC.getValue())){ - verifyPid = projectTaskInventoryDetail.getActiProcInstId(); - verifyTaskId = projectTaskInventoryDetail.getTaskId(); - verifyTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey(); - verifyTaskDetailId = projectTaskInventoryDetail.getId(); - if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){ - verifyTaskStatus = projectTaskInventoryDetail.getStatus(); - }else { - verifyTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue(); + if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(),FlowTypeEnum.PREHOMOQRLC.getValue())){ + prehomoPid = projectTaskInventoryDetail.getActiProcInstId(); + prehomoTaskId = projectTaskInventoryDetail.getTaskId(); + prehomoTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey(); + prehomoTaskDetailId = projectTaskInventoryDetail.getId(); + if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){ + prehomoTaskStatus = projectTaskInventoryDetail.getStatus(); + }else { + prehomoTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue(); + } + } + if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(),FlowTypeEnum.YZFHXSCLC.getValue())){ + verifyPid = projectTaskInventoryDetail.getActiProcInstId(); + verifyTaskId = projectTaskInventoryDetail.getTaskId(); + verifyTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey(); + verifyTaskDetailId = projectTaskInventoryDetail.getId(); + if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){ + verifyTaskStatus = projectTaskInventoryDetail.getStatus(); + }else { + verifyTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue(); + } } } } @@ -267,10 +359,35 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi } } - public void disposeComplianceResult(List> complianceResultList,String cut){ + public void disposeComplianceResult(List> complianceResultList,String cut,boolean isEngineer,boolean isEngineeringInterfacePerson){ if(CollectionUtils.isNotEmpty(complianceResultList)){ + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); List dutyTerritoryDictItemList = sysDictItemService.selectItemsByDictCode("duty_territory"); for (Map complianceResult : complianceResultList) { + if(isEngineer || isEngineeringInterfacePerson){ + if(!StringUtils.equals(complianceResult.get("designInitiatorId").toString(),currentUser.getId()) + || !StringUtils.equals(complianceResult.get("designDutyId").toString(),currentUser.getId())){ + complianceResult.put("designStatus",""); + complianceResult.put("designFlowTaskStatus",""); + complianceResult.put("designPId",""); + complianceResult.put("designPersonChargeFeedback",""); + } + if(!StringUtils.equals(complianceResult.get("prehomoInitiatorId").toString(),currentUser.getId()) + && !StringUtils.equals(complianceResult.get("prehomoDutyId").toString(),currentUser.getId())){ + complianceResult.put("prehomoStatus",""); + complianceResult.put("prehomoFlowTaskStatus",""); + complianceResult.put("prehomoPId",""); + complianceResult.put("prehomoPersonChargeFeedback",""); + } + if(!StringUtils.equals(complianceResult.get("verifyInitiatorId").toString(),currentUser.getId()) + && !StringUtils.equals(complianceResult.get("verifyDutyId").toString(),currentUser.getId())){ + complianceResult.put("verifyStatus",""); + complianceResult.put("verifyFlowTaskStatus",""); + complianceResult.put("verifyPId",""); + complianceResult.put("verifyPersonChargeFeedback",""); + } + } + if (complianceResult.get("designStatus") != null) { String textByValue = DesignComplianceStatusEnum.getTextByValue(complianceResult.get("designStatus").toString(), cut); complianceResult.put("designStatus_dicText",textByValue); @@ -342,6 +459,15 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi String condition = this.getConditionStr(params); params.put("condition",StringUtils.isNotEmpty(condition) ? condition : ""); List> exportData = new ArrayList<>(); + + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + boolean isEngineer = this.sysUserService.isEngineer(currentUser); + boolean isEngineeringInterfacePerson = this.sysUserService.isEngineeringInterfacePerson(currentUser); + if(isEngineer || isEngineeringInterfacePerson){ + params.put("currentUserId",currentUser.getId()); + params.put("isEngineerOrEngineeringInterfacePerson",true); + } + if(StringUtils.equals(exportAll,"no")){ IPage page = this.queryPageList(params); exportData = page.getRecords(); @@ -358,7 +484,7 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi List> complianceResultList = new ArrayList<>(); if(CollectionUtils.isNotEmpty(idList)){ complianceResultList = this.lawsComplianceBoardMapper.queryComplianceResultList(params); - this.disposeComplianceResult(complianceResultList,cut); + this.disposeComplianceResult(complianceResultList,cut,isEngineer,isEngineeringInterfacePerson); } String title = ""; @@ -468,8 +594,18 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi @Override public void exportComplianceResultDetail(HttpServletResponse response, HttpServletRequest request, Map params) { String cut = (String) params.get("cut"); + /** + * 2022-11-01 增加数据权限:如果当前登录用户,是工程师、工程接口人角色,只能查看到跟自己相关的数据。其余角色保留之前的查询结果。 + */ + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + boolean isEngineer = this.sysUserService.isEngineer(currentUser); + boolean isEngineeringInterfacePerson = this.sysUserService.isEngineeringInterfacePerson(currentUser); + if(isEngineer || isEngineeringInterfacePerson){ + params.put("currentUserId",currentUser.getId()); + params.put("isEngineerOrEngineeringInterfacePerson",true); + } List> exportData = this.lawsComplianceBoardMapper.queryComplianceResultList(params); - this.disposeComplianceResult(exportData,cut); + this.disposeComplianceResult(exportData,cut,isEngineer,isEngineeringInterfacePerson); String title = ""; String fileName = ""; if(StringUtils.equals(cut, CutEnum.CN.getValue())){ diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/NcrTrackServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/NcrTrackServiceImpl.java index aea3c5c7e..8abfc2f32 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/NcrTrackServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/NcrTrackServiceImpl.java @@ -80,6 +80,11 @@ public class NcrTrackServiceImpl extends ServiceImpl ncrTrackVO.setInconformity(ReviewResultEnum.INCONFORMITY.getValue()); ncrTrackVO.setTrack(ReviewResultEnum.TO_TRACK.getValue()); + + //如果当前登录用户是系统管理员角色,可以查看所有的数据 + boolean administrator = this.sysUserService.isAdministrator(); + ncrTrackVO.setAdministrator(administrator ? "true":"false"); + List infoList = ncrTrackMapper.getInfoList(ncrTrackVO); infoList = infoList.stream().distinct().collect(Collectors.toList()); List trackVOList = new ArrayList<>(); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java index bbff2d4c0..658151bf5 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java @@ -19,7 +19,9 @@ import com.jero.common.api.vo.Result; import com.jero.common.constant.CommonConstant; import com.jero.common.constant.WebsocketConst; import com.jero.common.constant.enums.CutEnum; +import com.jero.common.constant.enums.MessageType2Enum; import com.jero.common.constant.enums.MessageTypeEnum; +import com.jero.common.constant.enums.MsgColorEnum; import com.jero.common.exception.JeroBootException; import com.jero.common.system.query.QueryGenerator; import com.jero.common.system.vo.LoginUser; @@ -35,6 +37,7 @@ import com.jero.modules.dummy.service.impl.DummyInventoryBaseEOServiceImpl; import com.jero.modules.dummy.util.DeepCopyListUtil; import com.jero.modules.dummy.util.ListDiff; import com.jero.modules.feishu.service.IFeishuService; +import com.jero.modules.feishu.vo.FeishuMsg2Vo; import com.jero.modules.feishu.vo.FeishuMsgVo; import com.jero.modules.message.websocket.WebSocket; import com.jero.modules.oss.entity.OSSFile; @@ -44,6 +47,7 @@ import com.jero.modules.project.enums.*; import com.jero.modules.project.mapper.*; import com.jero.modules.project.service.*; import com.jero.modules.project.util.WordUtil; +import com.jero.modules.project.vo.ProjectTaskUrgVo; import com.jero.modules.split.common.FileUnZip; import com.jero.modules.system.entity.SysAnnouncement; import com.jero.modules.system.entity.SysCategory; @@ -229,6 +233,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl projectYearInfoEOQueryWrapper = new QueryWrapper<>(); projectYearInfoEOQueryWrapper.lambda().eq(ProjectYearNameInfoEO::getId,projectLibraryBase.getYearNameId()); ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper); + + //项目名称 + String projectVersion = (com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getParentId()) && com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getProjectVersion())) ? "00" : projectLibraryBase.getProjectVersion(); + String projectName = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" + projectLibraryBase.getTargetMarket() + "-" + projectVersion; //TODO 切换成枚举,不要在代码里出现魔数 if(StringUtils.equals(operatorType, OperatorTypeEnum.INVENTORY_AFFIRM.getValue())){ String ids = json.getString("ids"); @@ -1495,21 +1509,25 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl sysUsers = sysUserService.listByIds(userIdList); + List thirdIdList = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(sysUsers)){ + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } //消息内容 - String msgContentEN = currentUser.getUsername() + " initiated the regulation list confirmation for " - + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ". The due date is " + inventoryAffirmDueDate+ ". Please check and address it in a timely manner."; - String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a regulation list confirmation task to complete"; + //String msgContentEN = currentUser.getUsername() + " initiated the regulation list confirmation for " + // + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ". The due date is " + inventoryAffirmDueDate+ ". Please check and address it in a timely manner."; + //String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a regulation list confirmation task to complete"; // 飞书消息封装 - FeishuMsgVo feishuMsgVo = new FeishuMsgVo(); - feishuMsgVo.setContent("Hello! Please check and address this task in a timely manner."); - feishuMsgVo.setTaskType("Regulation List Confirmation"); - feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); - feishuMsgVo.setInitiator(studioUserInfo.getUsername()); - feishuMsgVo.setDueDate(inventoryAffirmDueDate); + //FeishuMsgVo feishuMsgVo = new FeishuMsgVo(); + //feishuMsgVo.setContent("Hello! Please check and address this task in a timely manner."); + //feishuMsgVo.setTaskType("Regulation List Confirmation"); + //feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); + //feishuMsgVo.setInitiator(studioUserInfo.getUsername()); + //feishuMsgVo.setDueDate(inventoryAffirmDueDate); //飞书跳转链接 String hrefFeishu = backUrl @@ -1518,20 +1536,39 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl" + " View details" + ""; - String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); + //String href = "" + " View details" + ""; + //String contentInfo = msgContentEN + " " + href; + //Map sendMessageMap = new HashMap<>(); + //sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); //发送消息 - sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,currentUser.getUsername()); + //sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,currentUser.getUsername()); //往待办中心添加数据。 ProcessInfoEO processInfoEO = new ProcessInfoEO(); @@ -1599,6 +1636,9 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl" + " View details" + ""; - String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); + //String href = "" + " View details" + ""; + //String contentInfo = msgContentEN + " " + href; + //Map sendMessageMap = new HashMap<>(); + //sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); //发送消息 List userIdList = new ArrayList<>(); userIdList.add(projectLibraryBase.getStudioEngineer()); - sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,studioUserInfo.getUsername()); - + List sysUsers = sysUserService.listByIds(userIdList); + List thirdIdList = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(sysUsers)){ + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } + //sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,studioUserInfo.getUsername()); + String dueDate = sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate()); + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(MessageType2Enum.REGULATION_LIST_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_LIST_CONFIRMATION.getEn()); + feishuMsgVo.setCnContentUpper("您好,该任务被"+ currentUser.getUsername() +"拒绝,请及时查看处理"); + feishuMsgVo.setCnContentLower("项目: " + projectName + + "\n法规: " + projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle() + + "\n发起人: " + currentUser.getUsername() + + "\n截止时间: " + dueDate); + feishuMsgVo.setEnContentUpper("Hello! This task is rejected by "+ currentUser.getUsername() +". Please check and address it in a timely manner"); + feishuMsgVo.setEnContentLower("Project: " + projectName + + "\nRegulation No: " + projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn() + + "\nInitiator: " + currentUser.getUsername() + + "\nDue Date: "+ dueDate); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.RED.getValue()); // 颜色 + feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } } if(isProjectRole == Integer.parseInt(ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue()) || isProjectRole == Integer.parseInt(ProjectRoleEnum.REGULATI_AND_HOMOLOGATION_ENGINEER.getValue())){ - msgContentEN = "The regulation list confirmation of "+projectLawsInventoryEO.getSerialNumber() + " for " - + projectNameInfoEO.getProjectName() +" is rejected by " + currentUser.getUsername() +". Please check and address it in a timely manner."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + - ": You have a regulation list confirmation task to complete"; + //msgContentEN = "The regulation list confirmation of "+projectLawsInventoryEO.getSerialNumber() + " for " + // + projectNameInfoEO.getProjectName() +" is rejected by " + currentUser.getUsername() +". Please check and address it in a timely manner."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + + // ": You have a regulation list confirmation task to complete"; // 飞书消息封装 - FeishuMsgVo feishuMsgVo = new FeishuMsgVo(); - feishuMsgVo.setContent("Hello! This task is rejected by "+currentUser.getUsername()+". Please check and address it in a timely manner."); - feishuMsgVo.setTaskType("Regulation List Confirmation"); - feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber()); - feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); - feishuMsgVo.setInitiator(studioUserInfo.getUsername()); - feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate())); + //FeishuMsgVo feishuMsgVo = new FeishuMsgVo(); + //feishuMsgVo.setContent("Hello! This task is rejected by "+currentUser.getUsername()+". Please check and address it in a timely manner."); + //feishuMsgVo.setTaskType("Regulation List Confirmation"); + //feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber()); + //feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); + //feishuMsgVo.setInitiator(studioUserInfo.getUsername()); + //feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate())); //飞书跳转链接 String hrefFeishu = backUrl @@ -1700,21 +1764,46 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl" + " View details" + ""; - String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); + //String href = "" + " View details" + ""; + //String contentInfo = msgContentEN + " " + href; + //Map sendMessageMap = new HashMap<>(); + //sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); //发送消息 List userIdList = new ArrayList<>(); userIdList.add(projectLibraryBase.getStudioEngineer()); - sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,studioUserInfo.getUsername()); + List sysUsers = sysUserService.listByIds(userIdList); + List thirdIdList = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(sysUsers)){ + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } + //sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,studioUserInfo.getUsername()); + String dueDate = sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate()); + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(MessageType2Enum.REGULATION_LIST_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_LIST_CONFIRMATION.getEn()); + feishuMsgVo.setCnContentUpper("您好,该任务被"+ currentUser.getUsername() +"拒绝,请及时查看处理"); + feishuMsgVo.setCnContentLower("项目: " + projectName + + "\n法规: " + projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle() + + "\n发起人: " + currentUser.getUsername() + + "\n截止时间: " + dueDate); + feishuMsgVo.setEnContentUpper("Hello! This task is rejected by "+ currentUser.getUsername() +". Please check and address it in a timely manner"); + feishuMsgVo.setEnContentLower("Project: " + projectName + + "\nRegulation No: " + projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn() + + "\nInitiator: " + currentUser.getUsername() + + "\nDue Date: " + dueDate); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.RED.getValue()); // 颜色 + feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } } } @@ -1725,7 +1814,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl userIdList = new ArrayList<>(); userIdList.add(projectLibraryBase.getStudioEngineer()); sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,studioUserInfo.getUsername()); - } + }*/ } } }else { @@ -2345,7 +2434,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl().lambda().eq(SysUser::getId, currentUserId)); - String msgContentEN = ""; + //String msgContentEN = ""; String msgTitle = ""; List userIdList = new ArrayList<>(); - FeishuMsgVo feishuMsgVo = new FeishuMsgVo(); + //FeishuMsgVo feishuMsgVo = new FeishuMsgVo(); - MessageTypeEnum messageTypeEnum = null; - String taskType = ""; + //MessageTypeEnum messageTypeEnum = null; + //String taskType = ""; String initiator = ""; String initiatorLark = ""; + String cnContentUpper = "";//中文上部分 + String cnContentLower = "";//中文下部分 + String enContentUpper = "";//英文上部分 + String enContentLower = "";//英文下部分 + String color = "";//颜色 + + ProjectLibraryBase LibraryBase = projectLibraryBaseService.queryById(projectLibraryId, CutEnum.EN.getValue()).get(0); + String PRN = LibraryBase.getProjectName();//项目名称 + String LAW_CN = projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle();//法规 + BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId()); + String LAW_EN = projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn();//法规 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_START_MSG.getValue())) { userIdList.add(engineeringInterfacePerson); - msgContentEN = sysUser.getUsername() + " initiated the regulation task confirmation of " + projectNameInfoEO.getProjectName() - + ". The due date is " + taskAffirmDueDate + ". Please check and address it in a timely manner."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a regulation task confirmation to complete"; + //msgContentEN = sysUser.getUsername() + " initiated the regulation task confirmation of " + projectNameInfoEO.getProjectName() + // + ". The due date is " + taskAffirmDueDate + ". Please check and address it in a timely manner."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a regulation task confirmation to complete"; - feishuMsgVo.setContent("Hello! Please check and address this task in a timely manner."); + //feishuMsgVo.setContent("Hello! Please check and address this task in a timely manner."); + + //messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; + //taskType = "Regulation Task Confirmation"; + + //initiator = studioUserInfo.getUsername(); + //initiatorLark = studioUserInfo.getUsername(); + + msgTitle = MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn(); + cnContentUpper = "您好,请及时查看处理此项任务,谢谢!"; + cnContentLower = "项目: " + PRN + + "\n法规: " + LAW_CN + + "\n发起人: " + sysUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()); + enContentUpper = "Hello! Please check and address the task in a timely manner. Thank you!"; + enContentLower = "Project: " + PRN + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + sysUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()); + color = MsgColorEnum.GREEN.getValue(); - messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; - taskType = "Regulation Task Confirmation"; - initiator = studioUserInfo.getUsername(); - initiatorLark = studioUserInfo.getUsername(); } else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_ISSUE_DRE_MSG.getValue())) { String dreUserId = jsonObject.getString("dreUserId"); //dre用户id userIdList.add(dreUserId); - msgContentEN = sysUser.getUsername() + " has assigned the regulation task confirmation of " + serialNumber + " in "+ projectNameInfoEO.getProjectName() - + " to you. The due date is " +taskAffirmDueDate+ ". Please check and handle it in time."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a regulation task confirmation to complete"; + //msgContentEN = sysUser.getUsername() + " has assigned the regulation task confirmation of " + serialNumber + " in "+ projectNameInfoEO.getProjectName() + // + " to you. The due date is " +taskAffirmDueDate+ ". Please check and handle it in time."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a regulation task confirmation to complete"; - feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has assigned the task. Please check and and handle it in time."); + //feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has assigned the task. Please check and and handle it in time."); - messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; - taskType = "Regulation Task Confirmation"; + //messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; + //taskType = "Regulation Task Confirmation"; + + //initiator = studioUserInfo.getUsername(); + //initiatorLark = studioUserInfo.getUsername(); + + + msgTitle = MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn(); + cnContentUpper = "您好,"+ sysUser.getUsername() +"向您询问意见,请及时查看处理"; + cnContentLower = "项目: " + PRN + + "\n法规: " + LAW_CN + + "\n发起人: " + sysUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()); + enContentUpper = "Hello! "+ sysUser.getUsername() +" asked you for opinion. Please check and address it in a timely manner"; + enContentLower = "Project: " + PRN + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + sysUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()); + color = MsgColorEnum.GREEN.getValue(); - initiator = studioUserInfo.getUsername(); - initiatorLark = studioUserInfo.getUsername(); } else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_DRE_REJECTED.getValue())) { userIdList.add(engineeringInterfacePerson); - msgContentEN = sysUser.getUsername() + " has rejected the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() - + ". The due date is " +taskAffirmDueDate+ ". Please check and handle it in time."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a regulation task confirmation to complete"; + //msgContentEN = sysUser.getUsername() + " has rejected the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() + // + ". The due date is " +taskAffirmDueDate+ ". Please check and handle it in time."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a regulation task confirmation to complete"; - feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has rejected the task. Please check and and handle it in time."); + //feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has rejected the task. Please check and and handle it in time."); - messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; - taskType = "Regulation Task Confirmation"; + //messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; + //taskType = "Regulation Task Confirmation"; + + //initiator = studioUserInfo.getUsername(); + //initiatorLark = studioUserInfo.getUsername(); + + msgTitle = MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn(); + cnContentUpper = "您好,该任务被"+ sysUser.getUsername() +"退回,请及时查看处理"; + cnContentLower = "项目: " + PRN + + "\n法规: " + LAW_CN + + "\n发起人: " + sysUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()); + enContentUpper = "Hello! This task is rejected by "+ sysUser.getUsername() +". Please check and address it in a timely manner"; + enContentLower = "Project: " + PRN + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + sysUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()); + color = MsgColorEnum.GREEN.getValue(); - initiator = studioUserInfo.getUsername(); - initiatorLark = studioUserInfo.getUsername(); } else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_DRE_ACCEPTED.getValue())) { userIdList.add(engineeringInterfacePerson); - msgContentEN = sysUser.getUsername() + " has submitted the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() - + ". The due date is " +taskAffirmDueDate+ ". Please check and handle it in time."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a regulation task confirmation to complete"; + //msgContentEN = sysUser.getUsername() + " has submitted the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() + // + ". The due date is " +taskAffirmDueDate+ ". Please check and handle it in time."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a regulation task confirmation to complete"; - feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has submitted the task. Please check and and handle it in time."); + //feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has submitted the task. Please check and and handle it in time."); + + //messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; + //taskType = "Regulation Task Confirmation"; + + //initiator = studioUserInfo.getUsername(); + //initiatorLark = studioUserInfo.getUsername(); + + msgTitle = MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn(); + cnContentUpper = "您好,"+ sysUser.getUsername() +"已向您提交回复,请及时查看处理"; + cnContentLower = "项目: " + PRN + + "\n法规: " + LAW_CN + + "\n发起人: " + sysUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()); + enContentUpper = "Hello! "+ sysUser.getUsername() +" has replied to you. Please check and address it in a timely manner"; + enContentLower = "Project: " + PRN + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + sysUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()); + color = MsgColorEnum.GREEN.getValue(); - messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; - taskType = "Regulation Task Confirmation"; - initiator = studioUserInfo.getUsername(); - initiatorLark = studioUserInfo.getUsername(); } else if(StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_REJECTED_MSG.getValue())){ userIdList.add(projectLibraryBase.getStudioEngineer()); - msgContentEN = sysUser.getUsername() + " has rejected the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() - + ". Please check and handle it in time."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a regulation task confirmation to complete"; + //msgContentEN = sysUser.getUsername() + " has rejected the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() + // + ". Please check and handle it in time."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a regulation task confirmation to complete"; - feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has rejected the task. Please check and and handle it in time."); + //feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has rejected the task. Please check and and handle it in time."); - messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; - taskType = "Regulation Task Confirmation"; + //messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; + //taskType = "Regulation Task Confirmation"; - initiator = studioUserInfo.getUsername(); - initiatorLark = studioUserInfo.getUsername(); - } else if(StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_ACCEPTED_MSG.getValue())){ + //initiator = studioUserInfo.getUsername(); + //initiatorLark = studioUserInfo.getUsername(); + + msgTitle = MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn(); + cnContentUpper = "您好,该任务被"+ sysUser.getUsername() +"拒绝,请及时查看处理"; + cnContentLower = "项目: " + PRN + + "\n法规: " + LAW_CN + + "\n发起人: " + sysUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()); + enContentUpper = "Hello! This task is rejected by "+ sysUser.getUsername() +". Please check and address it in a timely manner"; + enContentLower = "Project: " + PRN + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + sysUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()); + color = MsgColorEnum.RED.getValue(); + + + } /*else if(StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_ACCEPTED_MSG.getValue())){ userIdList.add(projectLibraryBase.getStudioEngineer()); - msgContentEN = sysUser.getUsername() + " has accepted the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() - + ". Please check and handle it in time."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a regulation task confirmation notification to check"; + //msgContentEN = sysUser.getUsername() + " has accepted the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() + // + ". Please check and handle it in time."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a regulation task confirmation notification to check"; - feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has accepted the task. Please check and and handle it in time."); + //feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has accepted the task. Please check and and handle it in time."); - messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; - taskType = "Regulation Task Confirmation"; + //messageTypeEnum = MessageTypeEnum.TASK_CONFIRMATION; + //taskType = "Regulation Task Confirmation"; initiator = studioUserInfo.getUsername(); initiatorLark = studioUserInfo.getUsername(); - } else if(StringUtils.equals(msgType, MsgTypeEnum.DESIGN_START_MSG.getValue())){ + } */else if(StringUtils.equals(msgType, MsgTypeEnum.DESIGN_START_MSG.getValue())){ String designDutyId = jsonObject.getString("designDutyId"); //设计符合性责任人id userIdList.add(designDutyId); - msgContentEN = "You recieved the design compliance task of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() - + ". The due date is " + sdf.format(projectLawsInventoryEO.getDesignDueDate()) + ". Please check and address it in a timely manner."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a design compliance task to complete"; + //msgContentEN = "You recieved the design compliance task of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() + // + ". The due date is " + sdf.format(projectLawsInventoryEO.getDesignDueDate()) + ". Please check and address it in a timely manner."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a design compliance task to complete"; - feishuMsgVo.setContent("Hello! Please address the task in a timely manner."); + //feishuMsgVo.setContent("Hello! Please address the task in a timely manner."); - messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; - taskType = "Design Compliance Confirmation"; + //messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; + //taskType = "Design Compliance Confirmation"; + + //initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); + //SysUser initiatorLarkInfo = this.sysUserMapper.selectOne( + // new QueryWrapper().lambda().eq(SysUser::getId, projectLawsInventoryEO.getDesignInitiatorId()) + //); + //initiatorLark = initiatorLarkInfo.getUsername(); + + msgTitle = MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getEn(); + cnContentUpper = "您好,请及时查看处理此项任务,谢谢!"; + cnContentLower = "项目: " + PRN + + "\n法规: " + LAW_CN + + "\n发起人: " + sysUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getDesignDueDate()); + enContentUpper = "Hello! Please check and address the task in a timely manner. Thank you!"; + enContentLower = "Project: " + PRN + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + sysUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getDesignDueDate()); + color = MsgColorEnum.GREEN.getValue(); - initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); - SysUser initiatorLarkInfo = this.sysUserMapper.selectOne( - new QueryWrapper().lambda().eq(SysUser::getId, projectLawsInventoryEO.getDesignInitiatorId()) - ); - initiatorLark = initiatorLarkInfo.getUsername(); } else if(StringUtils.equals(msgType, MsgTypeEnum.PREHOMO_START_MSG.getValue())){ String prehomoDutyId = jsonObject.getString("prehomoDutyId"); //pre-Home责任人id userIdList.add(prehomoDutyId); - msgContentEN = "You recieved the Pre-Homo task of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() - + ". The due date is " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate()) + ". Please check and address it in a timely manner."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a Pre-Homo task to complete"; + //msgContentEN = "You recieved the Pre-Homo task of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() + // + ". The due date is " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate()) + ". Please check and address it in a timely manner."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a Pre-Homo task to complete"; - feishuMsgVo.setContent("Hello! Please address the task in a timely manner."); + //feishuMsgVo.setContent("Hello! Please address the task in a timely manner."); - messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; - taskType = "Pre-Homo Confirmation"; + //messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; + //taskType = "Pre-Homo Confirmation"; - initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); + //initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); + + //SysUser initiatorLarkInfo = this.sysUserMapper.selectOne( + // new QueryWrapper().lambda().eq(SysUser::getId, projectLawsInventoryEO.getPrehomoInitiatorId()) + //); + //initiatorLark = initiatorLarkInfo.getUsername(); + msgTitle = MessageType2Enum.PRE_HOMO_CONFIRMATION.getCn() + "/" + MessageType2Enum.PRE_HOMO_CONFIRMATION.getEn(); + cnContentUpper = "您好,请及时查看处理此项任务,谢谢!"; + cnContentLower = "项目: " + PRN + + "\n法规: " + LAW_CN + + "\n发起人: " + sysUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate()); + enContentUpper = "Hello! Please check and address the task in a timely manner. Thank you!"; + enContentLower = "Project: " + PRN + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + sysUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate()); + color = MsgColorEnum.GREEN.getValue(); - SysUser initiatorLarkInfo = this.sysUserMapper.selectOne( - new QueryWrapper().lambda().eq(SysUser::getId, projectLawsInventoryEO.getPrehomoInitiatorId()) - ); - initiatorLark = initiatorLarkInfo.getUsername(); } else if(StringUtils.equals(msgType, MsgTypeEnum.VERIFY_START_MSG.getValue())){ String verifyDutyId = jsonObject.getString("verifyDutyId"); //验证符合性责任人id userIdList.add(verifyDutyId); - msgContentEN = "You recieved the validation compliance task of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() - + ". The due date is " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()) + ". Please check and address it in a timely manner."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a validation compliance task to complete"; + //msgContentEN = "You recieved the validation compliance task of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() + // + ". The due date is " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()) + ". Please check and address it in a timely manner."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a validation compliance task to complete"; - feishuMsgVo.setContent("Hello! Please address the task in a timely manner."); + //feishuMsgVo.setContent("Hello! Please address the task in a timely manner."); - messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; - taskType = "Validation Compliance Confirmation"; + //messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; + //taskType = "Validation Compliance Confirmation"; + + //initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); + //SysUser initiatorLarkInfo = this.sysUserMapper.selectOne( + // new QueryWrapper().lambda().eq(SysUser::getId, projectLawsInventoryEO.getVerifyInitiatorId()) + //); + //initiatorLark = initiatorLarkInfo.getUsername(); + + msgTitle = MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getEn(); + cnContentUpper = "您好,请及时查看处理此项任务,谢谢!"; + cnContentLower = "项目: " + PRN + + "\n法规: " + LAW_CN + + "\n发起人: " + sysUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + enContentUpper = "Hello! Please check and address the task in a timely manner. Thank you!"; + enContentLower = "Project: " + PRN + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + sysUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + color = MsgColorEnum.GREEN.getValue(); - initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); - SysUser initiatorLarkInfo = this.sysUserMapper.selectOne( - new QueryWrapper().lambda().eq(SysUser::getId, projectLawsInventoryEO.getVerifyInitiatorId()) - ); - initiatorLark = initiatorLarkInfo.getUsername(); } else if(StringUtils.equals(msgType, MsgTypeEnum.DESIGN_CHARGE_PERSON_SUBMIT_MSG.getValue())){ String designInitiatorId = jsonObject.getString("designInitiatorId"); //设计符合性发起人id userIdList.add(designInitiatorId); - msgContentEN = sysUser.getUsername() + " has submitted the design compliance confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() - + ". Please check and review it in time."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a design compliance task to complete"; + //msgContentEN = sysUser.getUsername() + " has submitted the design compliance confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() + // + ". Please check and review it in time."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a design compliance task to complete"; - feishuMsgVo.setContent("Hello! The compliance confirmation has been submitted. Please check and review it in a timely manner."); + //feishuMsgVo.setContent("Hello! The compliance confirmation has been submitted. Please check and review it in a timely manner."); - messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; - taskType = "Design Compliance Confirmation"; + //messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; + //taskType = "Design Compliance Confirmation"; - initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); - feishuMsgVo.setAssignee(sysUser.getUsername()); + //initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); + + msgTitle = MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getEn(); + cnContentUpper = "您好,"+ sysUser.getUsername() +"已完成任务,请审查"; + cnContentLower = "项目: " + PRN + + "\n法规: " + LAW_CN + + "\n发起人: " + sysUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + enContentUpper = "Hello! "+ sysUser.getUsername() +" has completed the task. Please check and review it"; + enContentLower = "Project: " + PRN + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + sysUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + color = MsgColorEnum.GREEN.getValue(); + + //feishuMsgVo.setAssignee(sysUser.getUsername()); // SysUser initiatorLarkInfo = this.sysUserMapper.selectOne( // new QueryWrapper().lambda().eq(SysUser::getId, projectLawsInventoryEO.getDesignInitiatorId()) // ); @@ -2544,18 +2774,32 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl().lambda().eq(SysUser::getId, projectLawsInventoryEO.getPrehomoInitiatorId()) // ); @@ -2563,18 +2807,32 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl().lambda().eq(SysUser::getId, projectLawsInventoryEO.getVerifyInitiatorId()) // ); @@ -2582,71 +2840,111 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl().lambda().eq(SysUser::getId, projectLawsInventoryEO.getDesignInitiatorId()) + //); + //initiatorLark = initiatorLarkInfo.getUsername(); + + msgTitle = MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getEn(); + cnContentUpper = "您好,该任务被发起人审查通过"; + cnContentLower = "项目: " + PRN + + "\n法规: " + LAW_CN + + "\n发起人: " +sysUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()); + enContentUpper = "Hello! The task has been approved by initiator"; + enContentLower = "Project: " + PRN + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " +sysUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()); + color = MsgColorEnum.GREEN.getValue(); - initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); - SysUser initiatorLarkInfo = this.sysUserMapper.selectOne( - new QueryWrapper().lambda().eq(SysUser::getId, projectLawsInventoryEO.getDesignInitiatorId()) - ); - initiatorLark = initiatorLarkInfo.getUsername(); } else if(StringUtils.equals(msgType, MsgTypeEnum.PREHOMO_INITIATOR_ACCEPTED_MSG.getValue())){ String prehomoDutyId = jsonObject.getString("prehomoDutyId"); //pre-Home责任人id userIdList.add(prehomoDutyId); - msgContentEN = "The Pre-Homo confirmation information of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() - + " you submitted has been approved."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a Pre-Homo task to complete"; + //msgContentEN = "The Pre-Homo confirmation information of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() + // + " you submitted has been approved."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a Pre-Homo task to complete"; - feishuMsgVo.setContent("Hello! The compliance information you submitted has been approved."); + //feishuMsgVo.setContent("Hello! The compliance information you submitted has been approved."); - messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; - taskType = "Pre-Homo Confirmation"; + //messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; + //taskType = "Pre-Homo Confirmation"; + + //initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); + //SysUser initiatorLarkInfo = this.sysUserMapper.selectOne( + // new QueryWrapper().lambda().eq(SysUser::getId, projectLawsInventoryEO.getPrehomoInitiatorId()) + //); + //initiatorLark = initiatorLarkInfo.getUsername(); + msgTitle = MessageType2Enum.PRE_HOMO_CONFIRMATION.getCn() + "/" + MessageType2Enum.PRE_HOMO_CONFIRMATION.getEn(); + cnContentUpper = "您好,该任务被发起人审查通过"; + cnContentLower = "项目: " + PRN + + "\n法规: " + LAW_CN + + "\n发起人: " +sysUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()); + enContentUpper = "Hello! The task has been approved by initiator"; + enContentLower = "Project: " + PRN + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " +sysUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()); + color = MsgColorEnum.GREEN.getValue(); - initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); - SysUser initiatorLarkInfo = this.sysUserMapper.selectOne( - new QueryWrapper().lambda().eq(SysUser::getId, projectLawsInventoryEO.getPrehomoInitiatorId()) - ); - initiatorLark = initiatorLarkInfo.getUsername(); } else if(StringUtils.equals(msgType, MsgTypeEnum.VERIFY_INITIATOR_ACCEPTED_MSG.getValue())){ String verifyDutyId = jsonObject.getString("verifyDutyId"); //验证符合性责任人id userIdList.add(verifyDutyId); - msgContentEN = "The validation compliance information of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() - + " you submitted has been approved."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a validation compliance task to complete"; + //msgContentEN = "The validation compliance information of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() + // + " you submitted has been approved."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a validation compliance task to complete"; - feishuMsgVo.setContent("Hello! The compliance information you submitted has been approved."); + //feishuMsgVo.setContent("Hello! The compliance information you submitted has been approved."); - messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; - taskType = "Validation Compliance Confirmation"; + //messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; + //taskType = "Validation Compliance Confirmation"; - initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); - SysUser initiatorLarkInfo = this.sysUserMapper.selectOne( - new QueryWrapper().lambda().eq(SysUser::getId, projectLawsInventoryEO.getVerifyInitiatorId()) - ); - initiatorLark = initiatorLarkInfo.getUsername(); + //initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); + //SysUser initiatorLarkInfo = this.sysUserMapper.selectOne( + // new QueryWrapper().lambda().eq(SysUser::getId, projectLawsInventoryEO.getVerifyInitiatorId()) + //); + //initiatorLark = initiatorLarkInfo.getUsername(); + + msgTitle = MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getEn(); + cnContentUpper = "您好,该任务被发起人审查通过"; + cnContentLower = "项目: " + PRN + + "\n法规: " + LAW_CN + + "\n发起人: " +sysUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()); + enContentUpper = "Hello! The task has been approved by initiator"; + enContentLower = "Project: " + PRN + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " +sysUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()); + color = MsgColorEnum.GREEN.getValue(); } - if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgContentEN)){ + if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgTitle)){ - feishuMsgVo.setTaskType(taskType); - feishuMsgVo.setRegulationNo(serialNumber); - feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); - feishuMsgVo.setInitiator(initiatorLark); - feishuMsgVo.setDueDate(taskAffirmDueDate); + //feishuMsgVo.setTaskType(taskType); + //feishuMsgVo.setRegulationNo(serialNumber); + //feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); + //feishuMsgVo.setInitiator(initiatorLark); + //feishuMsgVo.setDueDate(taskAffirmDueDate); //飞书跳转链接 String hrefFeishu = ""; //系统内部跳转链接 - String href = ""; + //String href = ""; if(StringUtils.equals(msgType,MsgTypeEnum.TASK_AFFIRM_START_MSG.getValue()) ||StringUtils.equals(msgType,MsgTypeEnum.TASK_AFFIRM_ISSUE_DRE_MSG.getValue()) ||StringUtils.equals(msgType,MsgTypeEnum.TASK_AFFIRM_DRE_REJECTED.getValue()) @@ -2656,7 +2954,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl" + " View details" + ""; + //href = "" + " View details" + ""; }else if(StringUtils.equals(msgType,MsgTypeEnum.DESIGN_START_MSG.getValue()) ||StringUtils.equals(msgType,MsgTypeEnum.PREHOMO_START_MSG.getValue()) ||StringUtils.equals(msgType,MsgTypeEnum.VERIFY_START_MSG.getValue()) @@ -2674,21 +2972,40 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl" + " View details" + ""; + //href = "" + " View details" + ""; } - String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); + //String contentInfo = msgContentEN + " " + href; + //Map sendMessageMap = new HashMap<>(); + //sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); //发送消息 - sendMessage(msgTitle, msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, messageTypeEnum,initiator); + //sendMessage(msgTitle, msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, messageTypeEnum,initiator); + + List sysUsers = sysUserService.listByIds(userIdList); + List thirdIdList = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(sysUsers)){ + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(msgTitle); + feishuMsgVo.setCnContentUpper(cnContentUpper); + feishuMsgVo.setCnContentLower(cnContentLower); + feishuMsgVo.setEnContentUpper(enContentUpper); + feishuMsgVo.setEnContentLower(enContentLower); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(color); // 颜色 + feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } } } @@ -8358,6 +8675,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl().lambda().eq(SysUser::getId, projectLibraryBase.getStudioEngineer()) ); + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); projectLawsInventoryEOList.forEach(projectLawsInventoryEO -> { //如果清单确认状态为待确认的,进行催办 @@ -8389,14 +8707,14 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl" + " View details" + ""; - String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); + //String href = "" + " View details" + ""; + //String contentInfo = msgContentEN + " " + href; + //Map sendMessageMap = new HashMap<>(); + //sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); //发送消息 - sendMessage(msgTitle, msgContentEN,inventoryAffirmUserIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,studioUserInfo.getUsername()); + //sendMessage(msgTitle, msgContentEN,inventoryAffirmUserIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,studioUserInfo.getUsername()); + + String projectVersion = (com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getParentId()) && com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getProjectVersion())) ? "00" : projectLibraryBase.getProjectVersion(); + String PRN = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" + projectLibraryBase.getTargetMarket() + "-" + projectVersion; + + String dueDate = new SimpleDateFormat("yyyy-MM-dd").format(projectLawsInventoryEO.getInventoryAffirmDueDate()); + + List thirdIdList = new ArrayList<>(); + List sysUsers = sysUserService.listByIds(inventoryAffirmUserIdList); + if (ObjectUtils.isNotEmpty(sysUsers)) { + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(MessageType2Enum.REGULATION_LIST_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_LIST_CONFIRMATION.getEn()); + feishuMsgVo.setCnContentUpper("您好,请尽快查看处理此项任务,谢谢!"); + feishuMsgVo.setCnContentLower("项目: " + PRN + + "\n发起人: " + currentUser.getUsername() + + "\n截止时间: " + dueDate); + feishuMsgVo.setEnContentUpper("Please check and address the task in a timely manner. Thank you!"); + feishuMsgVo.setEnContentLower("Project: " + PRN + + "\nInitiator: " + currentUser.getUsername() + + "\nDue Date: "+ dueDate); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色 + feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } } } @@ -8455,27 +8801,60 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl" + " View details" + ""; + //String href = "" + " View details" + ""; - String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); + //String contentInfo = msgContentEN + " " + href; + //Map sendMessageMap = new HashMap<>(); + //sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); //发送消息 - sendMessage(msgTitle, msgContentEN,taskAffirmUserIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK_CONFIRMATION,studioUserInfo.getUsername()); + //sendMessage(msgTitle, msgContentEN,taskAffirmUserIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK_CONFIRMATION,studioUserInfo.getUsername()); + + String projectVersion = (com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getParentId()) && com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getProjectVersion())) ? "00" : projectLibraryBase.getProjectVersion(); + String PRN = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" + projectLibraryBase.getTargetMarket() + "-" + projectVersion; + + String dueDate = new SimpleDateFormat("yyyy-MM-dd").format(projectLawsInventoryEO.getTaskAffirmDueDate()); + //法规中英文 + BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId()); + + List thirdIdList = new ArrayList<>(); + List sysUsers = sysUserService.listByIds(taskAffirmUserIdList); + if (ObjectUtils.isNotEmpty(sysUsers)) { + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn()); + feishuMsgVo.setCnContentUpper("您好,请尽快查看处理此项任务,谢谢!"); + feishuMsgVo.setCnContentLower("项目: " + PRN + + "\n法规: " + projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle() + + "\n发起人: " + currentUser.getUsername() + + "\n截止时间: " + dueDate); + feishuMsgVo.setEnContentUpper("Hello! Please check and address the task ASAP. Thank you!"); + feishuMsgVo.setEnContentLower("Project: " + PRN + + "\nRegulation No: " + projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn() + + "\nInitiator: " + currentUser.getUsername() + + "\nDue Date: "+ dueDate); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色 + feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } + } } }); @@ -8758,4 +9137,179 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl taskUrg(ProjectTaskUrgVo projectTaskUrgVo) { + if (ObjectUtils.isEmpty(projectTaskUrgVo.getProjectLawsInventoryIds())) { + if (CutEnum.CN.getValue().equals(projectTaskUrgVo.getCut())) { + throw new JeroBootException("请选择至少一条数据"); + } else { + throw new JeroBootException("Please select at least one piece of data"); + } + + } + if (ObjectUtils.isEmpty(projectTaskUrgVo.getType())) { + if (CutEnum.CN.getValue().equals(projectTaskUrgVo.getCut())) { + throw new JeroBootException("请选择催办类型"); + } else { + throw new JeroBootException("Please select the type of reminder"); + } + } + + String title = ""; + + if (FlowTypeEnum.SJFHXSHLC.getValue().equals(projectTaskUrgVo.getType())) { + title = MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getEn(); + } else if (FlowTypeEnum.PREHOMOQRLC.getValue().equals(projectTaskUrgVo.getType())) { + title = MessageType2Enum.PRE_HOMO_CONFIRMATION.getCn() + "/" + MessageType2Enum.PRE_HOMO_CONFIRMATION.getEn(); + } else if (FlowTypeEnum.YZFHXSCLC.getValue().equals(projectTaskUrgVo.getType())) { + title = MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getEn(); + } else { + if (CutEnum.CN.getValue().equals(projectTaskUrgVo.getCut())) { + throw new JeroBootException("请选择正确的催办类型"); + } else { + throw new JeroBootException("Please select the correct type of reminder"); + } + } + String[] ProjectLawsInventoryIds = projectTaskUrgVo.getProjectLawsInventoryIds().split(","); + ProjectLawsInventoryEO projectLawsInventoryEO = baseMapper.selectById(ProjectLawsInventoryIds[0]); + if (ObjectUtils.isEmpty(projectLawsInventoryEO)) { + if (CutEnum.CN.getValue().equals(projectTaskUrgVo.getCut())) { + throw new JeroBootException("程序异常,请刷新页面并重新操作"); + } else { + throw new JeroBootException("The program is abnormal, please refresh the page and operate again"); + } + } + + ProjectLibraryBase projectLibraryBase = projectLibraryBaseMapper.selectOne(new QueryWrapper() + .lambda().eq(ProjectLibraryBase::getId, projectLawsInventoryEO.getProjectLibraryId())); + + QueryWrapper projectNameInfoEOQueryWrapper = new QueryWrapper<>(); + projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectNameId()); + ProjectNameInfoEO projectNameInfoEO = projectNameInfoEOMapper.selectOne(projectNameInfoEOQueryWrapper); + + QueryWrapper projectYearInfoEOQueryWrapper = new QueryWrapper<>(); + projectYearInfoEOQueryWrapper.lambda().eq(ProjectYearNameInfoEO::getId,projectLibraryBase.getYearNameId()); + ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper); + + //项目名称 + String projectVersion = (com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getParentId()) && com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getProjectVersion())) ? "00" : projectLibraryBase.getProjectVersion(); + String projectName = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" + projectLibraryBase.getTargetMarket() + "-" + projectVersion; + + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + + //飞书跳转链接 + String hrefFeishu = backUrl + + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink() + + projectLibraryBase.getId() + + JumpLinkEnum.DESIGN_AFFIRM_LINK.getType() + + "&projectName=" + projectNameInfoEO.getProjectName() + "-" + + projectYearNameInfoEO.getYearName() + + "&targetMarket=" + projectLibraryBase.getTargetMarket(); + + for (String projectLawsInventoryId : ProjectLawsInventoryIds) { + ProjectLawsInventoryEO lawsInventoryEO = baseMapper.selectById(projectLawsInventoryId); + if (ObjectUtils.isEmpty(lawsInventoryEO)) { + if (CutEnum.CN.getValue().equals(projectTaskUrgVo.getCut())) { + throw new JeroBootException("程序异常,请刷新页面并重新操作"); + } else { + throw new JeroBootException("The program is abnormal, please refresh the page and operate again"); + } + } + String LAW_CN = lawsInventoryEO.getSerialNumber() + " " + lawsInventoryEO.getTitle();//法规 + BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(lawsInventoryEO.getStandId()); + String LAW_EN = lawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn();//法规 + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + + String userId = ""; + String dueDate = null; + + QueryWrapper queryProjectTaskInventoryWrapper = new QueryWrapper<>(); + queryProjectTaskInventoryWrapper.isNotNull("design_p_id"); + queryProjectTaskInventoryWrapper.lambda().eq(ProjectTaskInventoryEO::getProjectLawsInventoryId, projectLawsInventoryId); + List list = projectTaskInventoryEOService.list(queryProjectTaskInventoryWrapper); + + if (FlowTypeEnum.SJFHXSHLC.getValue().equals(projectTaskUrgVo.getType())) { + dueDate = sdf.format(lawsInventoryEO.getDesignDueDate()); + if (DesignComplianceStatusEnum.TO_REVIEW.getValue().equals(list.get(0).getDesignStatus()) + ||DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue().equals(list.get(0).getDesignStatus())) { + if (CutEnum.CN.getValue().equals(projectTaskUrgVo.getCut())) { + throw new JeroBootException(LAW_CN + "已经被确认,无法催办"); + } else { + throw new JeroBootException(LAW_EN + "has been confirmed,can't be urged"); + } + } + if (ObjectUtils.isNotEmpty(lawsInventoryEO.getDesignDutyId())) { + userId = lawsInventoryEO.getDesignDutyId(); + } + } else if (FlowTypeEnum.PREHOMOQRLC.getValue().equals(projectTaskUrgVo.getType())) { + dueDate = sdf.format(lawsInventoryEO.getPrehomoDueDate()); + if (DesignComplianceStatusEnum.TO_REVIEW.getValue().equals(list.get(0).getDesignStatus()) + ||DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue().equals(list.get(0).getDesignStatus())) { + if (CutEnum.CN.getValue().equals(projectTaskUrgVo.getCut())) { + throw new JeroBootException(LAW_CN + "已经被确认,无法催办"); + } else { + throw new JeroBootException(LAW_EN + "has been confirmed,can't be urged"); + } + } + if (ObjectUtils.isNotEmpty(lawsInventoryEO.getPrehomoDutyId())) { + userId = lawsInventoryEO.getPrehomoDutyId(); + } + } else if (FlowTypeEnum.YZFHXSCLC.getValue().equals(projectTaskUrgVo.getType())) { + dueDate = sdf.format(lawsInventoryEO.getVerifyDueDate()); + if (DesignComplianceStatusEnum.TO_REVIEW.getValue().equals(list.get(0).getDesignStatus()) + ||DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue().equals(list.get(0).getDesignStatus())) { + if (CutEnum.CN.getValue().equals(projectTaskUrgVo.getCut())) { + throw new JeroBootException(LAW_CN + "已经被确认,无法催办"); + } else { + throw new JeroBootException(LAW_EN + "has been confirmed,can't be urged"); + } + } + if (ObjectUtils.isNotEmpty(lawsInventoryEO.getVerifyDutyId())) { + userId = lawsInventoryEO.getVerifyDutyId(); + } + } + + String[] thirdId = new String[1]; + if (ObjectUtils.isNotEmpty(userId)) { + SysUser user = sysUserMapper.selectById(userId); + if (ObjectUtils.isNotEmpty(user)) { + thirdId[0] = user.getThirdId(); + } + } + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(title); + feishuMsgVo.setCnContentUpper("您好,请尽快查看处理此项任务,谢谢!"); + feishuMsgVo.setCnContentLower("项目: " + projectName + + "\n法规: " + LAW_CN + + "\n发起人: " + currentUser.getUsername() + + "\n截止时间: " + dueDate); + feishuMsgVo.setEnContentUpper("Hello! Please check and address the task ASAP. Thank you!"); + feishuMsgVo.setEnContentLower("Project: " + projectName + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + currentUser.getUsername() + + "\nDue Date: " + dueDate); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色 + feishuService.sendCard(thirdId, feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } + } + if (CutEnum.CN.getValue().equals(projectTaskUrgVo.getCut())) { + return new Result<>().success("催办成功!"); + } else { + return new Result<>().success("Success of the urging!"); + } + + } + + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryDetailEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryDetailEOServiceImpl.java index 144f559e2..150a250eb 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryDetailEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryDetailEOServiceImpl.java @@ -7,9 +7,15 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jero.common.api.vo.Result; import com.jero.common.constant.enums.CutEnum; +import com.jero.common.constant.enums.MessageType2Enum; import com.jero.common.constant.enums.MessageTypeEnum; +import com.jero.common.constant.enums.MsgColorEnum; import com.jero.common.exception.JeroBootException; import com.jero.common.system.vo.LoginUser; +import com.jero.modules.document.entity.BussDocumentLibraryEO; +import com.jero.modules.document.service.IBussDocumentLibraryEOService; +import com.jero.modules.feishu.service.IFeishuService; +import com.jero.modules.feishu.vo.FeishuMsg2Vo; import com.jero.modules.feishu.vo.FeishuMsgVo; import com.jero.modules.project.entity.*; import com.jero.modules.project.enums.JumpLinkEnum; @@ -32,6 +38,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import java.io.IOException; +import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -71,6 +79,11 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl" + " View details" + ""; - String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); + //String href = "" + " View details" + ""; + //String contentInfo = msgContentEN + " " + href; + //Map sendMessageMap = new HashMap<>(); + //sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); //发送消息 - SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); + //SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); + userIdList = userIdList.stream().distinct().collect(Collectors.toList()); + List sysUsers = sysUserService.listByIds(userIdList); + List thirdIdList = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(sysUsers)){ + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(msgTitle); + feishuMsgVo.setCnContentUpper(cnContentUpper); + feishuMsgVo.setCnContentLower(cnContentLower); + feishuMsgVo.setEnContentUpper(enContentUpper); + feishuMsgVo.setEnContentLower(enContentLower); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色 + feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } } } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryEOServiceImpl.java index 062a0d5f1..07223eb90 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryEOServiceImpl.java @@ -6,10 +6,16 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jero.common.api.vo.Result; import com.jero.common.constant.enums.CutEnum; +import com.jero.common.constant.enums.MessageType2Enum; import com.jero.common.constant.enums.MessageTypeEnum; +import com.jero.common.constant.enums.MsgColorEnum; import com.jero.common.exception.JeroBootException; import com.jero.common.system.query.QueryGenerator; import com.jero.common.system.vo.LoginUser; +import com.jero.modules.document.entity.BussDocumentLibraryEO; +import com.jero.modules.document.service.IBussDocumentLibraryEOService; +import com.jero.modules.feishu.service.IFeishuService; +import com.jero.modules.feishu.vo.FeishuMsg2Vo; import com.jero.modules.feishu.vo.FeishuMsgVo; import com.jero.modules.project.entity.*; import com.jero.modules.project.enums.*; @@ -24,6 +30,7 @@ import com.jero.modules.system.entity.SysUser; import com.jero.modules.system.entity.SysUserRole; import com.jero.modules.system.mapper.SysUserMapper; import com.jero.modules.system.service.ISysUserRoleService; +import com.jero.modules.system.service.ISysUserService; import com.jero.modules.system.service.impl.SysDictItemServiceImpl; import com.jero.modules.wkflow.enums.DesignComplianceNodeEnum; import com.jero.modules.wkflow.enums.FlowTypeEnum; @@ -91,6 +98,12 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl projectLawsInventoryEOQueryWrapper = new QueryWrapper<>(); + projectLawsInventoryEOQueryWrapper.eq("project_library_id", projectLibraryId).eq("serial_number", serialNumber); + ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryEOMapper.selectOne(projectLawsInventoryEOQueryWrapper); + String LAW_CN = projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle();//法规 + BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId()); + String LAW_EN = projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn();//法规 + + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); if(StringUtils.equals(msgType,MsgTypeEnum.DESIGN_REMIND_MSG.getValue())){ //Please check and deal with the design compliance confirmation process of GB 7258 in XXX (project name) in time. - msgContentEN = "Please check and deal with the design compliance confirmation process of " - + serialNumber + " in " - + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + " in time."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a design compliance task to complete"; + //msgContentEN = "Please check and deal with the design compliance confirmation process of " + // + serialNumber + " in " + // + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + " in time."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a design compliance task to complete"; - feishuMsgVo.setContent("Hello! Please address the task ASAP. "); - feishuMsgVo.setTaskType("Design Compliance Confirmation"); - feishuMsgVo.setRegulationNo(serialNumber); - feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); + //feishuMsgVo.setContent("Hello! Please address the task ASAP. "); + //feishuMsgVo.setTaskType("Design Compliance Confirmation"); + //feishuMsgVo.setRegulationNo(serialNumber); + //feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); + + //messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; + + msgTitle = MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getEn(); + cnContentUpper = "您好,"+ currentUser.getUsername() +"向您分发了该任务,请尽快查看处理"; + cnContentLower = "项目: " + projectName + + "\n法规: " + LAW_CN + + "\n发起人: " + currentUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getDesignDueDate()); + enContentUpper = "Hello! "+ currentUser.getUsername() +" has assigned the task to you. Please check and address the task ASAP"; + enContentLower = "Project: " + projectName + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + currentUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getDesignDueDate()); - messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; }else if(StringUtils.equals(msgType,MsgTypeEnum.PREHOMO_REMIND_MSG.getValue())){ //Please check and deal with the Pre-Homo confirmation process of GB 7258 in XXX (project name) in time. - msgContentEN = "Please check and address the Pre-Homo confirmation process of " - + serialNumber + " in "+ projectNameInfoEO.getProjectName() - + " in time."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a Pre-Homo task to complete"; + //msgContentEN = "Please check and address the Pre-Homo confirmation process of " + // + serialNumber + " in "+ projectNameInfoEO.getProjectName() + // + " in time."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a Pre-Homo task to complete"; - feishuMsgVo.setContent("Hello! Please address the task ASAP. "); - feishuMsgVo.setTaskType("Pre-Homo Confirmation"); - feishuMsgVo.setRegulationNo(serialNumber); - feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); + //feishuMsgVo.setContent("Hello! Please address the task ASAP. "); + //feishuMsgVo.setTaskType("Pre-Homo Confirmation"); + //feishuMsgVo.setRegulationNo(serialNumber); + //feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); + + //messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; + + msgTitle = MessageType2Enum.PRE_HOMO_CONFIRMATION.getCn() + "/" + MessageType2Enum.PRE_HOMO_CONFIRMATION.getEn(); + cnContentUpper = "您好,"+ currentUser.getUsername() +"向您分发了该任务,请尽快查看处理"; + cnContentLower = "项目: " + projectName + + "\n法规: " + LAW_CN + + "\n发起人: " + currentUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate()); + enContentUpper = "Hello! "+ currentUser.getUsername() +" has assigned the task to you. Please check and address the task ASAP"; + enContentLower = "Project: " + projectName + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + currentUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate()); - messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; }else if(StringUtils.equals(msgType,MsgTypeEnum.VERIFY_REMIND_MSG.getValue())){ //Please check and deal with the Verify compliance confirmation process of GB 7258 in XXX (project name) in time. - msgContentEN = "Please check and address the validation compliance confirmation process of " - + serialNumber + " in "+ projectNameInfoEO.getProjectName() - + " in time."; - msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() - + ": You have a validation compliance task to complete"; + //msgContentEN = "Please check and address the validation compliance confirmation process of " + // + serialNumber + " in "+ projectNameInfoEO.getProjectName() + // + " in time."; + //msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() + // + ": You have a validation compliance task to complete"; - feishuMsgVo.setContent("Hello! Please address the task ASAP. "); - feishuMsgVo.setTaskType("Validation Compliance Confirmation"); - feishuMsgVo.setRegulationNo(serialNumber); - feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); + //feishuMsgVo.setContent("Hello! Please address the task ASAP. "); + //feishuMsgVo.setTaskType("Validation Compliance Confirmation"); + //feishuMsgVo.setRegulationNo(serialNumber); + //feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()); - messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; + //messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION; + + msgTitle = MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getEn(); + cnContentUpper = "您好,"+ currentUser.getUsername() +"向您分发了该任务,请尽快查看处理"; + cnContentLower = "项目: " + projectName + + "\n法规: " + LAW_CN + + "\n发起人: " + currentUser.getUsername() + + "\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()); + enContentUpper = "Hello! "+ currentUser.getUsername() +" has assigned the task to you. Please check and address the task ASAP"; + enContentLower = "Project: " + projectName + + "\nRegulation No: " + LAW_EN + + "\nInitiator: " + currentUser.getUsername() + + "\nDue Date: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate()); } - if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgContentEN)){ + if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgTitle)){ //飞书跳转链接 String hrefFeishu = backUrl @@ -441,20 +512,40 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl" + " View details" + ""; - String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); + //String href = "" + " View details" + ""; + //String contentInfo = msgContentEN + " " + href; + //Map sendMessageMap = new HashMap<>(); + //sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); //发送消息 - SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); + //SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); } return new Result<>().success("提醒办理成功!"); } @@ -918,7 +1009,7 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl sysUsers = sysUserService.listByIds(userIdList); + List thirdIdList = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(sysUsers)){ + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(msgTitle); + feishuMsgVo.setCnContentUpper(cnContentUpper); + feishuMsgVo.setCnContentLower(cnContentLower); + feishuMsgVo.setEnContentUpper(enContentUpper); + feishuMsgVo.setEnContentLower(enContentLower); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色 + feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } //系统内部跳转链接 - String href = "" + " View details" + ""; + //String href = "" + " View details" + ""; //飞书跳转链接 拼接跳转至任务详情页参数 /*String hrefFeishu = backUrl @@ -1133,13 +1291,13 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl" + " View details" + "";*/ - String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); + //String contentInfo = msgContentEN + " " + href; + //Map sendMessageMap = new HashMap<>(); + //sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); //发送消息 - SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); + //SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); } } @@ -1301,6 +1459,73 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl disposeHistoryData(Map params) { + List projectTaskInventoryEOList = this.projectTaskInventoryEOService.list(); + + //获取没有任务清单数据的法规清单数据 + List projectLawsInventoryIdList = projectTaskInventoryEOList.stream().map(ProjectTaskInventoryEO::getProjectLawsInventoryId).distinct().collect(Collectors.toList()); + QueryWrapper lawsInventoryQueryWrap = new QueryWrapper<>(); + lawsInventoryQueryWrap.lambda().notIn(ProjectLawsInventoryEO::getId,projectLawsInventoryIdList); + List projectLawsInventoryEOList = this.projectLawsInventoryEOService.list(lawsInventoryQueryWrap); + + //如果有(没有任务清单数据的法规清单数据),进行历史数据处理 + if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){ + + List projectLawsInventoryIds = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getId).distinct().collect(Collectors.toList()); + + QueryWrapper taskInventoryDetailQueryWrap = new QueryWrapper<>(); + taskInventoryDetailQueryWrap.lambda().in(ProjectTaskInventoryDetailEO::getProjectTaskInventoryId,projectLawsInventoryIds); + List projectTaskInventoryDetailEOS = this.projectTaskInventoryDetailEOMapper.selectList(taskInventoryDetailQueryWrap); + + List projectTaskInventoryEOAddList = new ArrayList<>(); + projectLawsInventoryEOList.forEach(lawsInventoryEO -> { + ProjectTaskInventoryEO projectTaskInventoryEO = new ProjectTaskInventoryEO(); + String projectTaskInventoryId = UUID.randomUUID().toString().replace("-", ""); + projectTaskInventoryEO.setId(projectTaskInventoryId); + projectTaskInventoryEO.setProjectLawsInventoryId(lawsInventoryEO.getId()); + projectTaskInventoryEO.setStandId(lawsInventoryEO.getStandId()); + projectTaskInventoryEO.setCreateBy("admin"); + projectTaskInventoryEO.setSysOrgCode("A01"); + + if(CollectionUtils.isNotEmpty(projectTaskInventoryDetailEOS)){ + //获取当前法规清单数据 启动的符合性流程数据 + List projectTaskInventoryDetailListTemp = projectTaskInventoryDetailEOS.stream().filter(taskInventoryDetail -> { + boolean flag = false; + if (StringUtils.equals(taskInventoryDetail.getProjectTaskInventoryId(), projectTaskInventoryEO.getProjectLawsInventoryId())) { + flag = true; + } + return flag; + }).collect(Collectors.toList()); + + if(CollectionUtils.isNotEmpty(projectTaskInventoryDetailListTemp)){ + for (ProjectTaskInventoryDetailEO projectTaskInventoryDetailEO : projectTaskInventoryDetailListTemp) { + //流程实例id + String actiProcInstId = projectTaskInventoryDetailEO.getActiProcInstId(); + if(StringUtils.equals(projectTaskInventoryDetailEO.getFlowType(),FlowTypeEnum.SJFHXSHLC.getValue())){ + projectTaskInventoryEO.setDesignPId(actiProcInstId); + projectTaskInventoryEO.setDesignFlowTaskStatus(ReviewResultEnum.TO_BE_CONFIRMED.getValue()); + projectTaskInventoryEO.setDesignStatus(DesignComplianceStatusEnum.TO_SUBMIT.getValue()); + }else if(StringUtils.equals(projectTaskInventoryDetailEO.getFlowType(),FlowTypeEnum.PREHOMOQRLC.getValue())){ + projectTaskInventoryEO.setPrehomoPId(actiProcInstId); + projectTaskInventoryEO.setPrehomoFlowTaskStatus(ReviewResultEnum.TO_BE_CONFIRMED.getValue()); + projectTaskInventoryEO.setPrehomoStatus(DesignComplianceStatusEnum.TO_SUBMIT.getValue()); + }else if(StringUtils.equals(projectTaskInventoryDetailEO.getFlowType(),FlowTypeEnum.YZFHXSCLC.getValue())){ + projectTaskInventoryEO.setVerifyPId(actiProcInstId); + projectTaskInventoryEO.setVerifyFlowTaskStatus(ReviewResultEnum.TO_BE_CONFIRMED.getValue()); + projectTaskInventoryEO.setVerifyStatus(DesignComplianceStatusEnum.TO_SUBMIT.getValue()); + } + } + } + } + + projectTaskInventoryEOAddList.add(projectTaskInventoryEO); + }); + this.projectTaskInventoryEOService.saveBatch(projectTaskInventoryEOAddList); + } + return new Result<>().success("处理任务清单历史数据成功!"); + } + public void setSheetStyle(HSSFSheet sheet){ for (int i = 0; i <= 19; i++){ sheet.setColumnWidth(i,4000); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryFeedbackEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryFeedbackEOServiceImpl.java index a7e556d3e..5d96f809a 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryFeedbackEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryFeedbackEOServiceImpl.java @@ -1,8 +1,14 @@ package com.jero.modules.project.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.jero.common.constant.enums.MessageType2Enum; import com.jero.common.constant.enums.MessageTypeEnum; +import com.jero.common.constant.enums.MsgColorEnum; import com.jero.common.system.vo.LoginUser; +import com.jero.modules.document.entity.BussDocumentLibraryEO; +import com.jero.modules.document.service.IBussDocumentLibraryEOService; +import com.jero.modules.feishu.service.IFeishuService; +import com.jero.modules.feishu.vo.FeishuMsg2Vo; import com.jero.modules.feishu.vo.FeishuMsgVo; import com.jero.modules.project.entity.*; import com.jero.modules.project.enums.FeedBackHistoryDataStatusEnum; @@ -24,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import java.io.IOException; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -63,6 +70,12 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl" + " View details" + ""; - String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); - String initiator = ""; - if(StringUtils.isNotEmpty(initiatorId)){ - QueryWrapper queryOneWrapper = new QueryWrapper<>(); - queryOneWrapper.lambda().eq(SysUser::getId,initiatorId); - SysUser sysUser = this.sysUserService.getBaseMapper().selectOne(queryOneWrapper); - initiator = sysUser.getUsername(); + List sysUsers = sysUserService.listByIds(userIdList); + List thirdIdList = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(sysUsers)){ + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); } - feishuMsgVo.setInitiator(initiator); + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(msgTitle); + feishuMsgVo.setCnContentUpper(cnContentUpper); + feishuMsgVo.setCnContentLower(cnContentLower); + feishuMsgVo.setEnContentUpper(enContentUpper); + feishuMsgVo.setEnContentLower(enContentLower); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色 + feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } + //系统内部跳转链接 + //String href = "" + " View details" + ""; + //String contentInfo = msgContentEN + " " + href; + //Map sendMessageMap = new HashMap<>(); + //sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); + + //String initiator = ""; + //if(StringUtils.isNotEmpty(initiatorId)){ + // QueryWrapper queryOneWrapper = new QueryWrapper<>(); + // queryOneWrapper.lambda().eq(SysUser::getId,initiatorId); + // SysUser sysUser = this.sysUserService.getBaseMapper().selectOne(queryOneWrapper); + // initiator = sysUser.getUsername(); + //} + //feishuMsgVo.setInitiator(initiator); //发送消息 - SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryBaseInfo.getId(),sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); + //SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryBaseInfo.getId(),sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); } } } @@ -286,6 +370,9 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl projectTaskInventoryFeedbackEOS = this.baseMapper.selectList(queryWrapper); if(CollectionUtils.isNotEmpty(projectTaskInventoryFeedbackEOS)){ List idList = projectTaskInventoryFeedbackEOS.stream().distinct().map(ProjectTaskInventoryFeedbackEO::getProjectTaskInventoryId).collect(Collectors.toList()); + List userNameList = projectTaskInventoryFeedbackEOS.stream().distinct().map(ProjectTaskInventoryFeedbackEO::getCreateBy).collect(Collectors.toList()); + List userList = this.sysUserService.queryUserIdListByNameList(userNameList); + QueryWrapper inventoryDetailEOQueryWrapper = new QueryWrapper<>(); inventoryDetailEOQueryWrapper.lambda().in(ProjectTaskInventoryDetailEO::getId,idList); List projectTaskInventoryDetailEOList = projectTaskInventoryDetailEOMapper.selectList(inventoryDetailEOQueryWrapper); @@ -302,6 +389,18 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl userListTemp = userList.stream().filter(user -> { + boolean flag = false; + if(StringUtils.equals(projectTaskInventoryFeedbackEO.getCreateBy(),user.getUsername())){ + flag = true; + } + return flag; + }).collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(userListTemp)){ + projectTaskInventoryFeedbackEO.setUserId(userListTemp.get(0).getId()); + } + } } } return projectTaskInventoryFeedbackEOS; @@ -372,11 +471,11 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl" + " View details" + ""; - String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); + //String href = "" + " View details" + ""; + //String contentInfo = msgContentEN + " " + href; + //Map sendMessageMap = new HashMap<>(); + //sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); //发送消息 - SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryBaseInfo.getId(),sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); + //SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryBaseInfo.getId(),sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); } } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/vo/NcrTrackVO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/vo/NcrTrackVO.java index 231f16f4c..5a6b0fd5c 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/vo/NcrTrackVO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/vo/NcrTrackVO.java @@ -137,8 +137,8 @@ public class NcrTrackVO implements Serializable { private String projectTaskInventoryDetailId; //任务节点定义key private String taskDefinitionKey; - - + //是否是系统管理员角色 + private String administrator; diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/vo/ProjectTaskUrgVo.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/vo/ProjectTaskUrgVo.java new file mode 100644 index 000000000..571268627 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/vo/ProjectTaskUrgVo.java @@ -0,0 +1,15 @@ +package com.jero.modules.project.vo; + +import lombok.Data; + + +@Data +public class ProjectTaskUrgVo { + + private String cut; + + private String projectLawsInventoryIds; + + private String type; + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/mapper/xml/ProcessInfoEOMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/mapper/xml/ProcessInfoEOMapper.xml index 546b830d8..94edf9561 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/mapper/xml/ProcessInfoEOMapper.xml +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/mapper/xml/ProcessInfoEOMapper.xml @@ -257,7 +257,7 @@ from process_info_detail detail where detail.process_info_id = pi.id and detail.user_id = #{params.currentUserId} - + and detail.`status` = #{params.taskStatus} order by detail.submit_time desc @@ -269,7 +269,7 @@ from process_info_detail detail where detail.process_info_id = pi.id and detail.user_id = #{params.currentUserId} - + and detail.`status` = #{params.taskStatus} order by detail.submit_time desc @@ -287,20 +287,22 @@ #{item} + and ( + pi.id IN ( + SELECT + pid.process_info_id + FROM + process_info_detail pid + where pid.user_id = #{params.currentUserId} + + and pid.status = #{params.taskStatus} + + ) + ) and pi.create_by = #{params.createBy} - - and ( - pi.id IN ( - SELECT - pid.process_info_id - FROM - process_info_detail pid - where pid.user_id = #{params.currentUserId} and pid.status = #{params.taskStatus} - ) - ) - + ) temp diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/service/impl/ParamsManifestTodoCenterServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/service/impl/ParamsManifestTodoCenterServiceImpl.java index 680615106..5566e8fb5 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/service/impl/ParamsManifestTodoCenterServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/todoCenter/service/impl/ParamsManifestTodoCenterServiceImpl.java @@ -152,7 +152,8 @@ public class ParamsManifestTodoCenterServiceImpl implements IParamsManifestTodoC List pcmList = paramsManifestEOListMap.get(paramsManifestTodoCenterEO.getId()); int count = 0; - if (ObjectUtil.isNotEmpty(paramsManifestTodoCenterEO.getId()) && manifestUserTypeOfHomo.get(paramsManifestTodoCenterEO.getId())) { + if (ObjectUtil.isNotEmpty(paramsManifestTodoCenterEO.getId()) + && ObjectUtil.isNotEmpty(manifestUserTypeOfHomo.get(paramsManifestTodoCenterEO.getId()))) { // 统计待发起数量 包括状态:待发起收集,变更,工程接口人退回 count = (int) pcmList.stream().filter(e-> CollectManifestStateEnum.WAIT_COLLECT.getValue().equals(e.getState()) || CollectManifestStateEnum.SDT_BACK.getValue().equals(e.getState()) @@ -172,7 +173,8 @@ public class ParamsManifestTodoCenterServiceImpl implements IParamsManifestTodoC if (count > 0) { paramsManifestTodoCenterEO.setWaitFillNum(count); } - } else if (ObjectUtil.isNotEmpty(paramsManifestTodoCenterEO.getId()) && manifestUserTypeOfSdt.get(paramsManifestTodoCenterEO.getId())) { + } else if (ObjectUtil.isNotEmpty(paramsManifestTodoCenterEO.getId()) + && ObjectUtil.isNotEmpty(manifestUserTypeOfSdt.get(paramsManifestTodoCenterEO.getId()))) { // 统计待分配数量 包括状态:待工程接口人处理,填写人退回 count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_SDT.getValue().equals(e.getState()) || CollectManifestStateEnum.DRE_BACK.getValue().equals(e.getState())) @@ -187,7 +189,8 @@ public class ParamsManifestTodoCenterServiceImpl implements IParamsManifestTodoC paramsManifestTodoCenterEO.setWaitFillNum(count); } - } else if (ObjectUtil.isNotEmpty(paramsManifestTodoCenterEO.getId()) && manifestUserTypeOfDre.get(paramsManifestTodoCenterEO.getId())) { + } else if (ObjectUtil.isNotEmpty(paramsManifestTodoCenterEO.getId()) + && ObjectUtil.isNotEmpty(manifestUserTypeOfDre.get(paramsManifestTodoCenterEO.getId()))) { // 统计待填写数量 包括状态:待填写,认证工程师退回 count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_FILL.getValue().equals(e.getState()) || CollectManifestStateEnum.CERT_BACK.getValue().equals(e.getState())) 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 5122b30ec..e6c4d9d0c 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 @@ -375,6 +375,7 @@ public class ProcessInfoEOServiceImpl extends ServiceImpl result = this.baseMapper.queryLawsAssessPageList(page,params); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/LawsWarnService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/LawsWarnService.java index 881946767..527eb8527 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/LawsWarnService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/LawsWarnService.java @@ -373,7 +373,7 @@ public class LawsWarnService { thirdIdList.addAll(thirdId); } } - + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); //查询文档 List> mapList = bussDocumentLibraryEOMapper.selectMapsAll(documentIds); List serialNumberList = new ArrayList<>(); @@ -409,21 +409,52 @@ public class LawsWarnService { "&serial_number=" + map.get("serial_number") + "'" + " target='_blank'>" + map.get("serial_number") + ""; urlList.add(url); hrefList.add(href+timeContent); + + //推送多条时, 每条单独发消息 + //编号, 标题, 新车型实施日期, 在产车实施日期 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String serialNumber = StringUtils.valueOf(map.get("serial_number")); + String titleCn = StringUtils.valueOf(map.get("title")); + String titleEn = StringUtils.valueOf(map.get("title_en")); + String newType = ""; + if(ObjectUtils.isNotEmpty(map.get("xin1_che1_xing2_shi2_shi1_ri4_qi1"))){ + newType = sdf.format(map.get("xin1_che1_xing2_shi2_shi1_ri4_qi1")); + } + String newVehicle = ""; + if(ObjectUtils.isNotEmpty(map.get("implement_time"))){ + newVehicle = sdf.format(map.get("implement_time")); + } + //消息-英文 + String contentNo = sysUser.getUsername() +" shared Regulation Early Warning infomation with you, " + +"Regulation No: "+serialNumber+",Title: "+titleEn+",New Type Execution Date: "+newType+",New Vehicle Execution Date: "+newVehicle; + String contentInfoYes = sysUser.getUsername() +" shared Regulation Early Warning infomation with you, "+"
" + +"Regulation No: "+href+"
" + +"Title: "+titleEn+"
" + +"New Type Execution Date: "+newType+"
" + +"New Vehicle Execution Date: "+newVehicle; + + + //消息中文 + String contentCnNo = sysUser.getUsername() +"向您分享了法规预警信息, "+"编号: "+serialNumber+",标题: "+titleCn+",新车型实施日期: "+newType+",在产车实施日期: "+newVehicle; + String contentInfoCnYes = sysUser.getUsername() +"向您分享了法规预警信息,"+"
" + +"编号: "+href+"
" + +"标题: "+titleCn+"
" + +"新车型实施日期: "+newType+"
" + +"在产车实施日期: "+newVehicle; + + //封装消息的实体类 + SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, + null, + contentNo, + contentInfoYes, + MessageTypeEnum.PUSH.getValue(), + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(), + contentCnNo,contentInfoCnYes); + sysAnnouncementService.saveAnnouncement(sysAnnouncement); + bussDocumentLibraryEOService.sendWebsocket(StringUtils.join(thirdIdList, ","), contentInfoCnYes); } - LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - String content = StringUtils.join(serialNumberList, ",") + " has been shared with you, please check."; - //消息详情模板 - // XXX has pushed GB 7258 to you as the implementation date of vehicle production is XXXX-XX-XX, - // GB 7258 to you as the implementation date of vehicle production is XXXX-XX-XX, Please be reminded to check it out. - String contentInfo = sysUser.getUsername() + " has pushed " + StringUtils.join(hrefList, ",") + ", Please be reminded to check it out."; - String title = content; - - //封装消息的实体类 - SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, title, content, contentInfo,MessageTypeEnum.PUSH.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); - sysAnnouncementService.saveAnnouncement(sysAnnouncement); - bussDocumentLibraryEOService.sendWebsocket(StringUtils.join(thirdIdList, ","), contentInfo); //飞书 try { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); @@ -467,7 +498,7 @@ public class LawsWarnService { } catch (IOException e) { e.printStackTrace(); } - bussDocumentLibraryEOService.sendWebsocket(documentIds, contentInfo); + bussDocumentLibraryEOService.sendWebsocket(documentIds, documentIds); return "推送成功"; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/TimedTaskWarn.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/TimedTaskWarn.java index 86300e2b0..397ac8803 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/TimedTaskWarn.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/warn/service/TimedTaskWarn.java @@ -4,6 +4,7 @@ import com.jero.common.constant.enums.MessageTypeEnum; import com.jero.modules.document.entity.BussDocumentLibraryEO; import com.jero.modules.document.service.impl.BussDocumentLibraryEOServiceImpl; import com.jero.modules.feishu.service.IFeishuService; +import com.jero.modules.feishu.vo.FeishuMsgVo; import com.jero.modules.subscribe.entity.OnlCgformSubscribe; import com.jero.modules.subscribe.service.IOnlCgformSubscribeService; import com.jero.modules.system.entity.SysAnnouncement; @@ -123,15 +124,33 @@ public class TimedTaskWarn implements Job { //当前时间的前12个月 String beforeTimeSixTen = beforeTime(12,xin1Che1Xing2Shi2Shi1Ri4Qi1); - if(currentTime.equals(beforeTimeSix) || currentTime.equals(beforeTimeSixTen) || currentTime.equals(xin1Che1Xing2Shi2Shi1Ri4Qi1Str)){ - //发送站内消息和飞书消息 - String format = sdf.format(xin1Che1Xing2Shi2Shi1Ri4Qi1); - String content = "The implementation date of the " + category +" "+ serialNumber - + " new model you subscribed to is "+format+",please pay attention to check"; - String contentInfo = "The implementation date of the " + category +" "+ href - + " new model you subscribed to is "+format+",please pay attention to check"; - String msgTitle = content; - sendMessage(msgTitle, content,contentInfo,content, url, userIdList, thirdIdList); +// if(currentTime.equals(beforeTimeSix) || currentTime.equals(beforeTimeSixTen) || currentTime.equals(xin1Che1Xing2Shi2Shi1Ri4Qi1Str)){ +// //发送站内消息和飞书消息 +// String format = sdf.format(xin1Che1Xing2Shi2Shi1Ri4Qi1); +// String content = "The implementation date of the " + category +" "+ serialNumber +// + " new model you subscribed to is "+format+",please pay attention to check"; +// String contentInfo = "The implementation date of the " + category +" "+ href +// + " new model you subscribed to is "+format+",please pay attention to check"; +// String msgTitle = content; +// sendMessage(msgTitle, content,contentInfo,content, url, userIdList, thirdIdList); +// } + if(currentTime.equals(beforeTimeSixTen)){ + //发送飞书消息(提前一年) + sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"1"); + //站内消息 + sendMessage(bussDocumentLibraryEO, userIdList,"1",sdf,href); + } + if(currentTime.equals(beforeTimeSix)){ + //发送飞书消息(提前6个月) + sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"6"); + //站内消息 + sendMessage(bussDocumentLibraryEO, userIdList,"6",sdf,href); + } + if(currentTime.equals(xin1Che1Xing2Shi2Shi1Ri4Qi1Str)){ + //发送飞书消息(当天) + sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"0"); + //站内消息 + sendMessage(bussDocumentLibraryEO, userIdList,"0",sdf,href); } } @@ -152,27 +171,165 @@ public class TimedTaskWarn implements Job { String contentInfo = "The implementation date of the " + category +" "+ href + " production vehicle you subscribed to is "+format+",please pay attention to check"; String msgTitle = content; - sendMessage(msgTitle, content,contentInfo,content, url, userIdList, thirdIdList); +// sendMessage(msgTitle, content,contentInfo,content, url, userIdList, thirdIdList); + } + if(currentTime.equals(beforeTimeSixTen)){ + //发送飞书消息(提前一年) + sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"1"); + //站内消息 + sendMessage(bussDocumentLibraryEO, userIdList,"1",sdf,href); + } + if(currentTime.equals(beforeTimeSix)){ + //发送飞书消息(提前6个月) + sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"6"); + //站内消息 + sendMessage(bussDocumentLibraryEO, userIdList,"6",sdf,href); + } + if(currentTime.equals(implementTimeStr)){ + //发送飞书消息(当天) + sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"0"); + //站内消息 + sendMessage(bussDocumentLibraryEO, userIdList,"0",sdf,href); } } } } - private void sendMessage(String title, String content,String contentInfo,String contentFeiShu, String url, List userIdList, List thirdIdList) { - //站内消息 - //封装消息的实体类 - SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, title, content, contentInfo,MessageTypeEnum.WARN.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); - sysAnnouncementService.saveAnnouncement(sysAnnouncement); - bussDocumentLibraryEOService.sendWebsocket(StringUtils.join(userIdList, ","), content); + private void sendFeishu(SimpleDateFormat sdf, + BussDocumentLibraryEO bussDocumentLibraryEO, + String url, + List thirdIdList, + String flag) { + FeishuMsgVo feishuMsgVo = new FeishuMsgVo(); + feishuMsgVo.setTitle(MessageTypeEnum.WARN.getNameCn()+"/"+MessageTypeEnum.WARN.getName()); + feishuMsgVo.setUrl(url); + String contentCn = ""; + String contentEn = ""; + if("1".equals(flag)){ + contentCn = "您所订阅的法规将于1年后实施."; + contentEn = "The regulation you subscribed to will be implemented in one year."; + } + if("6".equals(flag)){ + contentCn = "您所订阅的法规将于6个月后实施."; + contentEn = "The regulation you subscribed to will be implemented in six months."; + } + if("0".equals(flag)){ + contentCn = "您所订阅的法规已实施."; + contentEn = "The regulation you subscribed to is implemented."; + } + feishuMsgVo.setContent(contentCn); + feishuMsgVo.setContentEn(contentEn); + feishuMsgVo.setRegulationNo(bussDocumentLibraryEO.getSerialNumber()); + feishuMsgVo.setDocumentTitleCn(bussDocumentLibraryEO.getTitle()); + feishuMsgVo.setDocumentTitleEn(bussDocumentLibraryEO.getTitleEn()); + if(ObjectUtils.isNotEmpty(bussDocumentLibraryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1())){ + feishuMsgVo.setNewTypeExecutionDate(sdf.format(bussDocumentLibraryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1())); + } + if(ObjectUtils.isNotEmpty(bussDocumentLibraryEO.getImplementTime())){ + feishuMsgVo.setNewVehicleExecutionDate(sdf.format(bussDocumentLibraryEO.getImplementTime())); + } - //飞书消息 try { - iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentFeiShu, MessageTypeEnum.WARN.getName(), url); + iFeishuService.sendCardMsgWarn(thirdIdList.toArray(new String[]{}),feishuMsgVo); } catch (IOException e) { e.printStackTrace(); } } +// private void sendMessage(String title, String content,String contentInfo,String contentFeiShu, String url, List userIdList, List thirdIdList) { +// //站内消息 +// //封装消息的实体类 +// SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, +// title, +// content, +// contentInfo, +// MessageTypeEnum.WARN.getValue(), +// MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(), +// null,null); +// sysAnnouncementService.saveAnnouncement(sysAnnouncement); +// bussDocumentLibraryEOService.sendWebsocket(StringUtils.join(userIdList, ","), content); +// +//// //飞书消息 +//// try { +//// iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentFeiShu, MessageTypeEnum.WARN.getName(), url); +//// } catch (IOException e) { +//// e.printStackTrace(); +//// } +// } + private void sendMessage(BussDocumentLibraryEO bussDocumentLibraryEO, + List userIdList, + String flag, + SimpleDateFormat sdf, + String href) { + String number = bussDocumentLibraryEO.getSerialNumber(); + String title = bussDocumentLibraryEO.getTitle(); + String titleEn = bussDocumentLibraryEO.getTitleEn(); + Date xin1Che1Xing2Shi2Shi1Ri4Qi1 = bussDocumentLibraryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1(); + Date implementTime = bussDocumentLibraryEO.getImplementTime(); + String newType = ""; + String newVehicle = ""; + if(ObjectUtils.isNotEmpty(xin1Che1Xing2Shi2Shi1Ri4Qi1)){ + newType = sdf.format(xin1Che1Xing2Shi2Shi1Ri4Qi1); + } + if(ObjectUtils.isNotEmpty(implementTime)){ + newVehicle = sdf.format(implementTime); + } + String contentCn = ""; + String contentInfoCn = ""; + String contentEn = ""; + String contentInfoEn = ""; + //"
" + + contentCn = ",编号: "+number + +",标题: "+title + +",新车型实施日期: "+newType + +",在产车实施日期: "+newVehicle; + contentInfoCn = "编号: "+href+"
" + +"标题: "+title+"
" + +"新车型实施日期: "+newType+"
" + +"在产车实施日期: "+newVehicle; + + contentEn = ",Regulation No: "+number + +",Title: "+titleEn + +",New Type Execution Date: "+newType + +",New Vehicle Execution Date: "+newVehicle; + + contentInfoEn = "Regulation No: "+href+"
" + +"Title: "+titleEn+"
" + +"New Type Execution Date: "+newType+"
" + +"New Vehicle Execution Date: "+newVehicle; + + if("1".equals(flag)){ + contentCn = "您所订阅的法规将于1年后实施"+contentCn; + contentInfoCn = "您所订阅的法规将于1年后实施"+"
"+contentInfoCn; + contentEn = "The regulation you subscribed to will be implemented in one year"+contentEn; + contentInfoEn = "The regulation you subscribed to will be implemented in one year"+"
"+contentInfoEn; + } + if("6".equals(flag)){ + contentCn = "您所订阅的法规将于6个月后实施"+contentCn; + contentInfoCn = "您所订阅的法规将于6个月后实施"+"
"+contentInfoCn; + contentEn = "The regulation you subscribed to will be implemented in six months"+contentEn; + contentInfoEn = "The regulation you subscribed to will be implemented in six months"+"
"+contentInfoEn; + } + if("0".equals(flag)){ + contentCn = "您所订阅的法规已实施"+contentCn; + contentInfoCn = "您所订阅的法规已实施"+"
"+contentInfoCn; + contentEn = "The regulation you subscribed to is implemented"+contentEn; + contentInfoEn = "The regulation you subscribed to is implemented"+"
"+contentInfoEn; + } + + //封装消息的实体类 + SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, + title, + contentEn, + contentInfoEn, + MessageTypeEnum.WARN.getValue(), + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(), + contentCn,contentInfoCn); + sysAnnouncementService.saveAnnouncement(sysAnnouncement); + bussDocumentLibraryEOService.sendWebsocket(StringUtils.join(userIdList, ","), contentInfoEn); + } + private String beforeTime (int month,Date date){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Calendar calendarBefore = Calendar.getInstance(); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/BusMes.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/BusMes.java index c60926925..4e9585919 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/BusMes.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/wkflow/entity/BusMes.java @@ -35,6 +35,7 @@ public class BusMes { private String handlingTime; // 待办流程-批量办理专用 private String projectLawsInventoryIds; // 待办流程-批量办理专用 private String taskDefinitionKey; // 待办流程-批量办理专用 + private String cut;//中英文切换标识 public String getUserId() { @@ -193,4 +194,12 @@ public class BusMes { public void setTaskDefinitionKey(String taskDefinitionKey) { this.taskDefinitionKey = taskDefinitionKey; } + + public String getCut() { + return cut; + } + + public void setCut(String cut) { + this.cut = cut; + } } diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index 21cd990a2..08529934a 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -1360,4 +1360,5 @@ module.exports = { cancelTopping:'Cancel Topping', relatedProjectVersion:'Related project version', Importfailure:'Import failure', + CuiBan:'CuiBan', } \ No newline at end of file diff --git a/jero-web/src/common/lang/zh-cn.js b/jero-web/src/common/lang/zh-cn.js index 0f950c1f5..63891c8d9 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -1461,4 +1461,5 @@ module.exports = { cancelTopping:'取消置顶', relatedProjectVersion:'相关项目版本', Importfailure:'导入失败', + CuiBan:'催办', } \ No newline at end of file diff --git a/jero-web/src/components/OcrTable/index.vue b/jero-web/src/components/OcrTable/index.vue index ab2772555..cbab09ff6 100644 --- a/jero-web/src/components/OcrTable/index.vue +++ b/jero-web/src/components/OcrTable/index.vue @@ -21,11 +21,11 @@ - {{record.resultContent=='转换成功'?ol.text:''}} - + {{ol.text}} @@ -105,7 +105,8 @@ searchParmes: {}, loading: false, orderBy: '1', - orderByField: '' + orderByField: '', + administrators:false } }, mounted() { @@ -131,6 +132,14 @@ this.getData() this.getTableList() this.userData = this.userInfo() + this.administrators = false + if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) { + this.userInfo().userRoleList.forEach(res => { + if (res.roleCode == 'admin') { + this.administrators = true + } + }) + } }, beforeDestroy(){ eventBUs.$off('searchQuery') diff --git a/jero-web/src/components/SplitTable/index.vue b/jero-web/src/components/SplitTable/index.vue index baf0b1142..434f7052a 100644 --- a/jero-web/src/components/SplitTable/index.vue +++ b/jero-web/src/components/SplitTable/index.vue @@ -18,7 +18,7 @@ - {{ol.text}} @@ -27,7 +27,7 @@ v-has="'split:sarFileSplitItems:page'"> {{ol.text}} - {{ol.text}} @@ -109,7 +109,8 @@ loading: false, orderBy: '1', userData: {}, - orderByField: '' + orderByField: '', + administrators:false, } }, mounted() { @@ -141,6 +142,14 @@ this.getData() this.getTableList() this.userData = this.userInfo() + this.administrators = false + if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) { + this.userInfo().userRoleList.forEach(res => { + if (res.roleCode == 'admin') { + this.administrators = true + } + }) + } }, beforeDestroy() { eventBUs.$off('searchQuery') diff --git a/jero-web/src/components/tableCollection/index.vue b/jero-web/src/components/tableCollection/index.vue index 0f1cd2343..0ee777753 100644 --- a/jero-web/src/components/tableCollection/index.vue +++ b/jero-web/src/components/tableCollection/index.vue @@ -639,8 +639,7 @@ } let params = { paramsManifestId: paramsManifestid, - flag: '7', - userType: userType + flag: '7' } getAction(url, params).then((res) => { if (res.success) { diff --git a/jero-web/src/components/tools/HeaderNotice.vue b/jero-web/src/components/tools/HeaderNotice.vue index e3ea56c27..0233fec30 100644 --- a/jero-web/src/components/tools/HeaderNotice.vue +++ b/jero-web/src/components/tools/HeaderNotice.vue @@ -15,7 +15,10 @@ @@ -50,6 +53,7 @@ data() { return { loadding: false, + language: '', url: { listCementByUser: '/sys/sysAnnouncementSend/getMessageUnreadList', editCementSend: '/sys/sysAnnouncementSend/editByAnntIdAndUserId', @@ -91,6 +95,7 @@ }, created() { this.loadData() + this.language = localStorage.getItem('language') || '' // this.initWebSocket() if (store.getters.userInfo) { this.$socketPublic.dispatch('webSocketInit')//初始化ws @@ -139,7 +144,11 @@ showAnnouncement(record) { getAction(this.url.readAllMsg, { ids: record.id }).then((res) => { }) - localStorage.setItem('msgContent', record.msgContent) + if (this.language == 'zh-cn') { + localStorage.setItem('msgContent', record.msgContentCn) + } else { + localStorage.setItem('msgContent', record.msgContent) + } this.$router.push({ path: '/isps/userAnnouncement', query: { diff --git a/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseAdd.vue b/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseAdd.vue index 16acba02c..3e26365cf 100644 --- a/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseAdd.vue +++ b/jero-web/src/views/businessSupport/problemKnowledgeBase/components/problemKnowledgeBaseAdd.vue @@ -32,10 +32,10 @@
* {{$t('problemClassification')}} + :title="$t('classification')">{{$t('classification')}}
- @@ -125,14 +125,16 @@
- - {{$t('addStandardInformation')}} - + + + {{$t('addStandardInformation')}} + + @@ -799,8 +801,9 @@ width: 120px; overflow: hidden; padding: 0 0; - float: right; + /*float: right;*/ text-align: center; + margin-top: 2px; } ::v-deep .box-button-index span { @@ -843,8 +846,9 @@ } .box-input-index { - width: calc(100% - 130px); + /*width: calc(100% - 130px);*/ display: inline-block; + width: 100%; height: 48px; margin-right: 10px; } diff --git a/jero-web/src/views/dashboard/components/myNews.vue b/jero-web/src/views/dashboard/components/myNews.vue index 719748291..3d693062a 100644 --- a/jero-web/src/views/dashboard/components/myNews.vue +++ b/jero-web/src/views/dashboard/components/myNews.vue @@ -11,8 +11,8 @@
-
- {{item.msgContent}} +
+ {{language == 'zh-cn'?item.msgContentCn:item.msgContent}}
{{item.sendTime}} @@ -44,11 +44,13 @@ loading: false, pageNo: 1, pageSize: 4, - dataSource: [] + dataSource: [], + language: '' } }, mounted() { this.getList() + this.language = localStorage.getItem('language') || '' }, methods: { getList() { @@ -69,7 +71,11 @@ magClick(row) { getAction(this.url.readAllMsg, { ids: row.id }).then((res) => { }) - localStorage.setItem('msgContent', row.msgContent) + if (this.language == 'zh-cn'){ + localStorage.setItem('msgContent', row.msgContentCn) + }else{ + localStorage.setItem('msgContent', row.msgContent) + } this.$router.push({ path: '/isps/userAnnouncement', query: { diff --git a/jero-web/src/views/documentTools/virtualList/index.vue b/jero-web/src/views/documentTools/virtualList/index.vue index 3c4cbfda3..d329acfc3 100644 --- a/jero-web/src/views/documentTools/virtualList/index.vue +++ b/jero-web/src/views/documentTools/virtualList/index.vue @@ -65,16 +65,16 @@ {{$t('edit')}} {{record.state == 2 ? $t('release') : $t('withdraw')}} {{$t('maintenanceList')}} {{$t('deleteLib')}} @@ -244,13 +244,21 @@ scopedSlots: { customRender: 'operation' } } ], - queryParam: {} - + queryParam: {}, + administrators:false, } }, mounted() { this.getList() this.userData = this.userInfo() + this.administrators = false + if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) { + this.userInfo().userRoleList.forEach(res => { + if (res.roleCode == 'admin') { + this.administrators = true + } + }) + } }, methods: { ...mapGetters(['userInfo']), diff --git a/jero-web/src/views/processCenter/components/circulationHistory.vue b/jero-web/src/views/processCenter/components/circulationHistory.vue index 9066f1762..c05bcabbd 100644 --- a/jero-web/src/views/processCenter/components/circulationHistory.vue +++ b/jero-web/src/views/processCenter/components/circulationHistory.vue @@ -107,7 +107,7 @@ line-height: 40px; .header-text { - font-size: 16px; + font-size: 18px; font-weight: 400; color: #000F16; } diff --git a/jero-web/src/views/processCenter/components/engineeringConfirmation.vue b/jero-web/src/views/processCenter/components/engineeringConfirmation.vue index 3028d1b80..34ffd4e5d 100644 --- a/jero-web/src/views/processCenter/components/engineeringConfirmation.vue +++ b/jero-web/src/views/processCenter/components/engineeringConfirmation.vue @@ -8,24 +8,24 @@
-
- - {{ $t('distributionEngineer') }} -
-
- - {{ $t('reminderHandling') }} -
-
- - {{ $t('addFeedback') }} -
+ + {{$t('distributionEngineer')}} + + + {{$t('addFeedback')}} + + + + + + +
{{$t('deleteLib')}} + + {{ $t('reminderHandling') }} + {{$t('dataLoading')}} - - - - - {{$t('reminder')}} - - - + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -436,7 +441,7 @@ { title: this.$t('operation'), align: 'left', - width: 160, + width: 190, scopedSlots: { customRender: 'operation' } } ], @@ -722,7 +727,7 @@ _this.formInline.userId.splice(num, 1) _this.formInline.userId = _this.formInline.userId.join(',') _this.formInline = { ..._this.formInline } - if (id){ + if (id) { deleteAction('/project/projectTaskInventoryDetailEO/delete', { id: id }).then((res) => { if (res.success) { _this.$message.success(_this.$t('OperationSuccessful')) @@ -829,7 +834,7 @@ line-height: 80px; .header-text { - font-size: 16px; + font-size: 18px; font-weight: 400; color: #000F16; } @@ -960,4 +965,9 @@ line-height: 200px; text-align: center; } + + .header-btn { + height: 38px; + margin-left: 16px; + } \ No newline at end of file diff --git a/jero-web/src/views/processCenter/components/evaluatorFeedback.vue b/jero-web/src/views/processCenter/components/evaluatorFeedback.vue index 85420a896..31501554b 100644 --- a/jero-web/src/views/processCenter/components/evaluatorFeedback.vue +++ b/jero-web/src/views/processCenter/components/evaluatorFeedback.vue @@ -384,7 +384,7 @@ line-height: 40px; .header-text { - font-size: 16px; + font-size: 18px; font-weight: 400; color: #000F16; } diff --git a/jero-web/src/views/processCenter/components/evaluatorFeedbackList.vue b/jero-web/src/views/processCenter/components/evaluatorFeedbackList.vue index f611b6cbc..07c74ec95 100644 --- a/jero-web/src/views/processCenter/components/evaluatorFeedbackList.vue +++ b/jero-web/src/views/processCenter/components/evaluatorFeedbackList.vue @@ -478,7 +478,7 @@ line-height: 40px; .header-text { - font-size: 16px; + font-size: 18px; font-weight: 400; color: #000F16; } diff --git a/jero-web/src/views/processCenter/components/examineInformation.vue b/jero-web/src/views/processCenter/components/examineInformation.vue index 385c860df..f95b8c6a1 100644 --- a/jero-web/src/views/processCenter/components/examineInformation.vue +++ b/jero-web/src/views/processCenter/components/examineInformation.vue @@ -223,7 +223,7 @@ line-height: 40px; .header-text { - font-size: 16px; + font-size: 18px; font-weight: 400; color: #000F16; } diff --git a/jero-web/src/views/processCenter/components/feedbackInformation.vue b/jero-web/src/views/processCenter/components/feedbackInformation.vue index 5b427777a..def1f809c 100644 --- a/jero-web/src/views/processCenter/components/feedbackInformation.vue +++ b/jero-web/src/views/processCenter/components/feedbackInformation.vue @@ -238,7 +238,7 @@ line-height: 40px; .header-text { - font-size: 16px; + font-size: 18px; font-weight: 400; color: #000F16; } diff --git a/jero-web/src/views/processCenter/components/projectInformation.vue b/jero-web/src/views/processCenter/components/projectInformation.vue index 8c0e6669a..c32129ffe 100644 --- a/jero-web/src/views/processCenter/components/projectInformation.vue +++ b/jero-web/src/views/processCenter/components/projectInformation.vue @@ -111,7 +111,7 @@ line-height: 80px; .header-text { - font-size: 16px; + font-size: 18px; font-weight: 400; color: #000F16; } diff --git a/jero-web/src/views/processCenter/components/regulatoryCirculationHistory.vue b/jero-web/src/views/processCenter/components/regulatoryCirculationHistory.vue index 48adc3d86..4fa35d3fa 100644 --- a/jero-web/src/views/processCenter/components/regulatoryCirculationHistory.vue +++ b/jero-web/src/views/processCenter/components/regulatoryCirculationHistory.vue @@ -127,7 +127,7 @@ line-height: 40px; .header-text { - font-size: 16px; + font-size: 18px; font-weight: 400; color: #000F16; } diff --git a/jero-web/src/views/processCenter/components/reviewedByThePersonInCharge.vue b/jero-web/src/views/processCenter/components/reviewedByThePersonInCharge.vue index 4a32cd3bb..17ca2a498 100644 --- a/jero-web/src/views/processCenter/components/reviewedByThePersonInCharge.vue +++ b/jero-web/src/views/processCenter/components/reviewedByThePersonInCharge.vue @@ -325,7 +325,7 @@ line-height: 40px; .header-text { - font-size: 16px; + font-size: 18px; font-weight: 400; color: #000F16; } diff --git a/jero-web/src/views/processCenter/components/standardContent.vue b/jero-web/src/views/processCenter/components/standardContent.vue index 846990863..be337f0b4 100644 --- a/jero-web/src/views/processCenter/components/standardContent.vue +++ b/jero-web/src/views/processCenter/components/standardContent.vue @@ -116,7 +116,7 @@ line-height: 40px; .header-text { - font-size: 16px; + font-size: 18px; font-weight: 400; color: #000F16; } diff --git a/jero-web/src/views/processCenter/components/taskCirculationHistory.vue b/jero-web/src/views/processCenter/components/taskCirculationHistory.vue index 145539870..c474671e7 100644 --- a/jero-web/src/views/processCenter/components/taskCirculationHistory.vue +++ b/jero-web/src/views/processCenter/components/taskCirculationHistory.vue @@ -110,7 +110,7 @@ line-height: 40px; .header-text { - font-size: 16px; + font-size: 18px; font-weight: 400; color: #000F16; } diff --git a/jero-web/src/views/processCenter/processForm/evaluationProcess/index.vue b/jero-web/src/views/processCenter/processForm/evaluationProcess/index.vue index caf22adff..6aac8943e 100644 --- a/jero-web/src/views/processCenter/processForm/evaluationProcess/index.vue +++ b/jero-web/src/views/processCenter/processForm/evaluationProcess/index.vue @@ -339,7 +339,7 @@ }) } else { this.loading = false - this.$message.warning(this.$t('operationFailed')) + this.$message.warning(res.message) } }) } diff --git a/jero-web/src/views/processCenter/processForm/handshakeProcess/index.vue b/jero-web/src/views/processCenter/processForm/handshakeProcess/index.vue index 387cf0d84..e24b572ec 100644 --- a/jero-web/src/views/processCenter/processForm/handshakeProcess/index.vue +++ b/jero-web/src/views/processCenter/processForm/handshakeProcess/index.vue @@ -268,7 +268,7 @@ } } else { this.loading = false - this.$message.warning(this.$t('operationFailed')) + this.$message.warning(res.message) } }) }, diff --git a/jero-web/src/views/processCenter/processForm/regulatoryProcess/index.vue b/jero-web/src/views/processCenter/processForm/regulatoryProcess/index.vue index 181c1f247..a49f48aa3 100644 --- a/jero-web/src/views/processCenter/processForm/regulatoryProcess/index.vue +++ b/jero-web/src/views/processCenter/processForm/regulatoryProcess/index.vue @@ -209,7 +209,7 @@ }) } else { this.loading = false - this.$message.warning(this.$t('operationFailed')) + this.$message.warning(res.message) } }) } diff --git a/jero-web/src/views/processCenter/processForm/taskListProcess/index.vue b/jero-web/src/views/processCenter/processForm/taskListProcess/index.vue index 891cd4aea..82d122de4 100644 --- a/jero-web/src/views/processCenter/processForm/taskListProcess/index.vue +++ b/jero-web/src/views/processCenter/processForm/taskListProcess/index.vue @@ -367,7 +367,7 @@ this.edit() } else { this.loading = false - this.$message.warning(this.$t('operationFailed')) + this.$message.warning(res.message) } }) }, diff --git a/jero-web/src/views/projectManagement/components/ProjectDetails.vue b/jero-web/src/views/projectManagement/components/ProjectDetails.vue index 167691eb0..f4e32f59c 100644 --- a/jero-web/src/views/projectManagement/components/ProjectDetails.vue +++ b/jero-web/src/views/projectManagement/components/ProjectDetails.vue @@ -5,7 +5,7 @@ {{$t('basicInformationOfParameters')}}
- {{$t('edit')}} @@ -115,7 +115,8 @@ {{$t('regulatoryCertificationTaskPlan')}}
- {{$t('setting')}} @@ -183,6 +184,7 @@ data() { return { queryForm: {}, + administrators:false, activeKey: this.$t('CurrentStatusOfTheProject'), url: { queryById: 'project/projectLibraryBase/queryById', @@ -199,6 +201,14 @@ mounted() { this.getForm() this.getSetting() + this.administrators = false + if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) { + this.userInfo().userRoleList.forEach(res => { + if (res.roleCode == 'admin') { + this.administrators = true + } + }) + } }, methods: { ...mapGetters(['userInfo']), diff --git a/jero-web/src/views/projectManagement/components/TaskList.vue b/jero-web/src/views/projectManagement/components/TaskList.vue index 5e0142614..f5162293b 100644 --- a/jero-web/src/views/projectManagement/components/TaskList.vue +++ b/jero-web/src/views/projectManagement/components/TaskList.vue @@ -76,10 +76,10 @@
- - - - +
+ + {{ $t('CuiBan') }} +
{{$t('BatchMaintenanceProgress')}} @@ -190,6 +190,7 @@ + + + + + + \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/components/listOfRegulations.vue b/jero-web/src/views/projectManagement/components/listOfRegulations.vue index c09c6e5c9..0e0329c86 100644 --- a/jero-web/src/views/projectManagement/components/listOfRegulations.vue +++ b/jero-web/src/views/projectManagement/components/listOfRegulations.vue @@ -173,7 +173,8 @@
-
{{ $t('export') }} diff --git a/jero-web/src/views/projectManagement/components/listOfRelevantPersonnel.vue b/jero-web/src/views/projectManagement/components/listOfRelevantPersonnel.vue index 8de753c3c..a885f10b4 100644 --- a/jero-web/src/views/projectManagement/components/listOfRelevantPersonnel.vue +++ b/jero-web/src/views/projectManagement/components/listOfRelevantPersonnel.vue @@ -83,14 +83,14 @@
+ v-if="this.$route.query.studioEngineer == this.userInfo().id || administrators">
+ v-if="this.$route.query.studioEngineer == this.userInfo().id || administrators"> {{$t('batSetting')}}
@@ -388,13 +388,15 @@ queryCertificationEngineer: '/project/projectRelatedPersonnel/queryCertificationEngineer' }, selectedRowKeys: [], - dictOptionsValue: [] + dictOptionsValue: [], + administrators: false } }, computed: { columns() { let columnResult = JSON.parse(JSON.stringify(this.columnsAll)) - if (this.$route.query.studioEngineer != this.userInfo().id) { + if (this.$route.query.studioEngineer == this.userInfo().id || this.administrators) { + } else { for (var i = 0; i < columnResult.length; i++) { if (columnResult[i].title === this.$t('operation')) { columnResult.splice(i, 1) @@ -441,6 +443,14 @@ getData() { this.visible = true this.queryParam = {} + this.administrators = false + if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) { + this.userInfo().userRoleList.forEach(res => { + if (res.roleCode == 'admin') { + this.administrators = true + } + }) + } this.getList() this.queryCertificationEngineer() }, diff --git a/jero-web/src/views/projectManagement/projectLibrary/index.vue b/jero-web/src/views/projectManagement/projectLibrary/index.vue index 453719575..2d1d6d2e8 100644 --- a/jero-web/src/views/projectManagement/projectLibrary/index.vue +++ b/jero-web/src/views/projectManagement/projectLibrary/index.vue @@ -139,7 +139,7 @@ {{$t('deleteLib')}} @@ -264,12 +264,21 @@ } ], userInfoQuery: {}, - queryParam: {} + queryParam: {}, + administrators: false } }, mounted() { this.getList() this.userInfoQuery = this.userInfo() + this.administrators = false + if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) { + this.userInfo().userRoleList.forEach(res => { + if (res.roleCode == 'admin') { + this.administrators = true + } + }) + } }, methods: { ...mapGetters(['userInfo']), diff --git a/jero-web/src/views/system/QuartzJobList.vue b/jero-web/src/views/system/QuartzJobList.vue index cd54b0701..db0d65e90 100644 --- a/jero-web/src/views/system/QuartzJobList.vue +++ b/jero-web/src/views/system/QuartzJobList.vue @@ -126,6 +126,13 @@ description: '定时任务在线管理', // 查询条件 queryParam: {}, + ipagination: { + total: 0, + pageSize: 20,//每页中显示10条数据 + showSizeChanger: true, + pageSizeOptions: ["10", "20", "50", "100"],//每页中显示的数据 + showTotal: total => `共有 ${total} 条数据`, //分页中显示总的数据 + }, // 表头 columns: [ { diff --git a/jero-web/src/views/system/UserAnnouncementList.vue b/jero-web/src/views/system/UserAnnouncementList.vue index fbb96c3d5..1c0262c0b 100644 --- a/jero-web/src/views/system/UserAnnouncementList.vue +++ b/jero-web/src/views/system/UserAnnouncementList.vue @@ -71,8 +71,9 @@ @change="handleTableChange"> - - {{text}} + + {{language == 'zh-cn' ? scope.msgContentCn : scope.msgContent}} @@ -82,7 +83,7 @@

- +

@@ -163,10 +164,10 @@ dataIndex: 'sendTime' }, { - title:'', + title: '', align: 'left', ellipsis: true, - width: 50, + width: 50 } ], url: { @@ -177,7 +178,8 @@ }, loading: false, openPath: '', - formData: '' + formData: '', + language: '' } }, watch: { @@ -186,16 +188,25 @@ this.loadData() } }, + mounted() { + this.language = localStorage.getItem('language') || '' + }, methods: { expandIcon(props) { if (props.expanded) { - return { - props.onExpand(props.record, e); - }}/>; + return + { + props.onExpand(props.record, e) + } + } + />; } else { - return { - props.onExpand(props.record, e); - }}/>; + return + { + props.onExpand(props.record, e) + } + } + />; } }, getQueryParams() { @@ -359,8 +370,9 @@ height: 38px; /*margin-top: 2px;*/ } - ::v-deep .ant-table .ant-table-row-indent + .ant-table-row-expand-icon{ - margin-right: 0; + + ::v-deep .ant-table .ant-table-row-indent + .ant-table-row-expand-icon { + margin-right: 0; } \ No newline at end of file diff --git a/jero-web/src/views/toDoCenter/taskConfirmation/index.vue b/jero-web/src/views/toDoCenter/taskConfirmation/index.vue index be713ee56..254cb1a9e 100644 --- a/jero-web/src/views/toDoCenter/taskConfirmation/index.vue +++ b/jero-web/src/views/toDoCenter/taskConfirmation/index.vue @@ -18,7 +18,7 @@ {{$t('standardInformation')}}
+ v-model="queryParam.standardInfo">
@@ -104,7 +104,7 @@ { title: this.$t('standardInformation'), align: 'center', - dataIndex: 'serialNumber', + dataIndex: 'standardInfo', ellipsis: true, scopedSlots: { customRender: 'standardInformation' }, width: 170