From 9593973ec5b877e8f8de6e4d443403f90cece704 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Fri, 14 Apr 2023 11:36:26 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E9=A3=9E=E4=B9=A6=E6=B6=88=E6=81=AF-?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=8F=82=E6=95=B0=E6=94=B6=E9=9B=86=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constant/enums/MessageTypeEnum.java | 2 +- .../ParamsCollectManifestEOServiceImpl.java | 162 +++++++++++++----- .../feishu/service/IFeishuService.java | 4 +- .../service/impl/FeishuServiceImpl.java | 14 +- 4 files changed, 129 insertions(+), 53 deletions(-) diff --git a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/enums/MessageTypeEnum.java b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/enums/MessageTypeEnum.java index f9d101325..d38ad0346 100644 --- a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/enums/MessageTypeEnum.java +++ b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/enums/MessageTypeEnum.java @@ -21,7 +21,7 @@ public enum MessageTypeEnum { //DESIGN_COMPLIANCE_NOTIFICATION("Design Compliance Notification", "12"), // 设计符合性通知 //PRE_HOMO_NOTIFICATION("Pre-Homo Notification", "13"), // Pre-Homo通知 //VALIDATION_COMPLIANCE_NOTIFICATION("Validation Compliance Notification", "14"), // 验证符合性通知 - SYSTEMATIC_NOTIFICATION("Systematic Notification","", "15"), // 系统通知 + SYSTEMATIC_NOTIFICATION("Systematic Notification","系统通知", "15"), // 系统通知 LIST_CONFIRMATION("List Confirmation", "","17"), // 清单确认 TASK_CONFIRMATION("Task Confirmation", "","18"), // 任务确认 COMPLIANCE_CONFIRMATION("Compliance Confirmation","", "19"), // 符合性确认 diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java index 8d5551523..39af28dae 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java @@ -2312,7 +2312,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.eq("state", ManifestStateEnum.COLLECTING.getValue()); +// queryWrapper.eq("id","391e08fd7ed54740a20924f174aa83a2");//测试使用 List manifestEOS = paramsManifestEOService.list(queryWrapper); for (ParamsManifestEO manifestEO : manifestEOS) { //项目名称 ParamsManifestVO projectInfo = paramsManifestEOService.getProjectById(manifestEO.getProjectId(), manifestEO.getProjectVersion(), null); if (ObjectUtils.isNotEmpty(projectInfo)) { + manifestEO.setProjectName(projectInfo.getProjectName()); //url - String urlParamsStr = parseUrlParams(manifestEO,null,null); + String urlParamsStr = parseUrlParams(manifestEO,null,projectInfo.getProjectNameEn()); String hrefFeishu = backUrl + "/ParameterItemCollection" + urlParamsStr; + + String urlParamsStrCn = parseUrlParams(manifestEO,CutEnum.CN.getValue(),projectInfo.getProjectNameEn()); + String urlParamsStrEn = parseUrlParams(manifestEO,CutEnum.EN.getValue(),projectInfo.getProjectNameEn()); + String hrefFeishuCn = backUrl + "/ParameterItemCollection" + urlParamsStrCn; + String hrefFeishuEn = backUrl + "/ParameterItemCollection" + urlParamsStrEn; //查出对应清单 List collectManifestEOS = paramsCollectManifestEOMapper.queryByParamManifestId(manifestEO.getId()); Map> seven = new HashMap<>(); Map> three = new HashMap<>(); Map> today = new HashMap<>(); + List userIdList7 = new ArrayList<>(); + List userIdList3 = new ArrayList<>(); + List userIdList0 = new ArrayList<>(); + String dueDate = ""; for (ParamsCollectManifestEO collectManifestEO : collectManifestEOS) { String thirdId = null; if (CollectManifestStateEnum.WAIT_SDT.getValue().equals(collectManifestEO.getState()) @@ -6271,6 +6282,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl stringList = seven.get(key); String join = StringUtils.join(stringList, ","); try { - FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); - feishuMsgVo.setTitle(title); - feishuMsgVo.setCnContentUpper("您参与填写的参数" + join + ",还有7天到期,请及时查看处理"); - feishuMsgVo.setCnContentLower(cnContentLower); - feishuMsgVo.setEnContentUpper("The parameter " + join + " you filled in will expire in 7 days. Please check and address it in a timely manner"); - feishuMsgVo.setEnContentLower(enContentLower); - feishuMsgVo.setUrl(hrefFeishu); - feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色 - feishuService.sendCard(thirds, feishuMsgVo); - } catch (IOException e) { +// FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); +// feishuMsgVo.setTitle(title); +// feishuMsgVo.setCnContentUpper("您参与填写的参数" + join + ",还有7天到期,请及时查看处理"); +// feishuMsgVo.setCnContentLower(cnContentLower); +// feishuMsgVo.setEnContentUpper("The parameter " + join + " you filled in will expire in 7 days. Please check and address it in a timely manner"); +// feishuMsgVo.setEnContentLower(enContentLower); +// feishuMsgVo.setUrl(hrefFeishu); +// feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色 +// feishuService.sendCard(thirds, feishuMsgVo); +// + String contentInfoFeiCn = "您参与填写的参数" + join + ",还有7天到期,请及时查看处理。"; + String contentInfoFeiEn = "The parameter " + join + " you filled in will expire in 7 days. Please check and address it in a timely manner."; + userIdList7 = userIdList7.stream().distinct().collect(Collectors.toList()); + //飞书消息(模板-20230410) + Map params = new HashMap<>(); + params.put("contentInfoFeiCn",contentInfoFeiCn); + params.put("contentInfoFeiEn",contentInfoFeiEn); + params.put("userIdList",userIdList7); + params.put("projectCn",projectInfo.getProjectName()); + params.put("projectEn",projectInfo.getProjectNameEn()); + params.put("initiatorCn",MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getNameCn()); + params.put("initiatorEn",MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); + params.put("dueDate",dueDate); + params.put("back_url_cn",hrefFeishuCn); + params.put("back_url_en",hrefFeishuEn); + feishuService.sendMessageHomoParameterCollection(TemplateInfoEnum2.HOMO_PARAMETER_COLLECTION_GREEN.getValue(),params,flag); + } catch (Exception e) { log.error("飞书消息推送失败"); } } @@ -6339,16 +6375,34 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl stringList = three.get(key); String join = StringUtils.join(stringList, ","); try { - FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); - feishuMsgVo.setTitle(title); - feishuMsgVo.setCnContentUpper("您参与填写的参数" + join + ",还有3天到期,请及时查看处理"); - feishuMsgVo.setCnContentLower(cnContentLower); - feishuMsgVo.setEnContentUpper("The parameter " + join + " you filled in will expire in 3 days. Please check and address it in a timely manner"); - feishuMsgVo.setEnContentLower(enContentLower); - feishuMsgVo.setUrl(hrefFeishu); - feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色 - feishuService.sendCard(thirds, feishuMsgVo); - } catch (IOException e) { +// FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); +// feishuMsgVo.setTitle(title); +// feishuMsgVo.setCnContentUpper("您参与填写的参数" + join + ",还有3天到期,请及时查看处理"); +// feishuMsgVo.setCnContentLower(cnContentLower); +// feishuMsgVo.setEnContentUpper("The parameter " + join + " you filled in will expire in 3 days. Please check and address it in a timely manner"); +// feishuMsgVo.setEnContentLower(enContentLower); +// feishuMsgVo.setUrl(hrefFeishu); +// feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色 +// feishuService.sendCard(thirds, feishuMsgVo); + + String contentInfoFeiCn = "您参与填写的参数" + join + ",还有3天到期,请及时查看处理。"; + String contentInfoFeiEn = "The parameter " + join + " you filled in will expire in 3 days. Please check and address it in a timely manner."; + userIdList3 = userIdList3.stream().distinct().collect(Collectors.toList()); + //飞书消息(模板-20230410) + Map params = new HashMap<>(); + params.put("contentInfoFeiCn",contentInfoFeiCn); + params.put("contentInfoFeiEn",contentInfoFeiEn); + params.put("userIdList",userIdList3); + params.put("projectCn",projectInfo.getProjectName()); + params.put("projectEn",projectInfo.getProjectNameEn()); + params.put("initiatorCn",MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getNameCn()); + params.put("initiatorEn",MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); + params.put("dueDate",dueDate); + params.put("back_url_cn",hrefFeishuCn); + params.put("back_url_en",hrefFeishuEn); + feishuService.sendMessageHomoParameterCollection(TemplateInfoEnum2.HOMO_PARAMETER_COLLECTION_GREEN.getValue(),params,flag); + + } catch (Exception e) { log.error("飞书消息推送失败"); } } @@ -6360,16 +6414,34 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl stringList = today.get(key); String join = StringUtils.join(stringList, ","); try { - FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); - feishuMsgVo.setTitle(title); - feishuMsgVo.setCnContentUpper("您参与填写的参数" + join + ",将于今天到期,请及时查看处理"); - feishuMsgVo.setCnContentLower(cnContentLower); - feishuMsgVo.setEnContentUpper("The parameter " + join + " you filled in will expire today. Please check and address it in a timely manner"); - feishuMsgVo.setEnContentLower(enContentLower); - feishuMsgVo.setUrl(hrefFeishu); - feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色 - feishuService.sendCard(thirds, feishuMsgVo); - } catch (IOException e) { +// FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); +// feishuMsgVo.setTitle(title); +// feishuMsgVo.setCnContentUpper("您参与填写的参数" + join + ",将于今天到期,请及时查看处理"); +// feishuMsgVo.setCnContentLower(cnContentLower); +// feishuMsgVo.setEnContentUpper("The parameter " + join + " you filled in will expire today. Please check and address it in a timely manner"); +// feishuMsgVo.setEnContentLower(enContentLower); +// feishuMsgVo.setUrl(hrefFeishu); +// feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色 +// feishuService.sendCard(thirds, feishuMsgVo); + + String contentInfoFeiCn = "您参与填写的参数" + join + ",将于今天到期,请及时查看处理。"; + String contentInfoFeiEn = "The parameter " + join + " you filled in will expire today. Please check and address it in a timely manner."; + userIdList0 = userIdList0.stream().distinct().collect(Collectors.toList()); + //飞书消息(模板-20230410) + Map params = new HashMap<>(); + params.put("contentInfoFeiCn",contentInfoFeiCn); + params.put("contentInfoFeiEn",contentInfoFeiEn); + params.put("userIdList",userIdList0); + params.put("projectCn",projectInfo.getProjectName()); + params.put("projectEn",projectInfo.getProjectNameEn()); + params.put("initiatorCn",MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getNameCn()); + params.put("initiatorEn",MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()); + params.put("dueDate",dueDate); + params.put("back_url_cn",hrefFeishuCn); + params.put("back_url_en",hrefFeishuEn); + feishuService.sendMessageHomoParameterCollection(TemplateInfoEnum2.HOMO_PARAMETER_COLLECTION_GREEN.getValue(),params,flag); + + } catch (Exception e) { log.error("飞书消息推送失败"); } } @@ -6732,7 +6804,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl stringList = today.get(thirdId); if (ObjectUtils.isEmpty(stringList)) { stringList = new ArrayList<>(); - stringList.add("NIO-" + collectManifestEO.getNioNumber()); + stringList.add(collectManifestEO.getNioNumber()); today.put(thirdId, stringList); } else { - stringList.add("NIO-" + collectManifestEO.getNioNumber()); + stringList.add(collectManifestEO.getNioNumber()); } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/service/IFeishuService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/service/IFeishuService.java index 53494a3a1..32b293848 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/service/IFeishuService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/service/IFeishuService.java @@ -153,10 +153,10 @@ public interface IFeishuService { void sendMessageRegulationOpinionCollection(String templeteId,Map params); /** - * 飞书消息模板--认证参数收集(主题颜色为红色或绿色) + * 飞书消息模板--认证参数收集(主题颜色为绿色) * @param templeteId * @param params */ - void sendMessageHomoParameterCollection(String templeteId,Map params); + void sendMessageHomoParameterCollection(String templeteId,Map params,String flag); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/service/impl/FeishuServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/service/impl/FeishuServiceImpl.java index 6b0261dc1..e7c33753f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/service/impl/FeishuServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/service/impl/FeishuServiceImpl.java @@ -1581,7 +1581,7 @@ public class FeishuServiceImpl implements IFeishuService { * @param params */ @Override - public void sendMessageHomoParameterCollection(String templeteId, Map params) { + public void sendMessageHomoParameterCollection(String templeteId, Map params,String flag) { List userIdList = (List) params.get("userIdList"); if (CollectionUtils.isNotEmpty(userIdList)) { List userInfoList = this.sysUserService.querySysUserListByIdList(userIdList); @@ -1592,8 +1592,8 @@ public class FeishuServiceImpl implements IFeishuService { String back_url_en = (String) params.get("back_url_en"); String projectCn = (String) params.get("projectCn"); String projectEn = (String) params.get("projectEn"); - String initiator = (String) params.get("initiator"); -// String initiatorEn = (String) params.get("initiatorEn"); + String initiatorCn = (String) params.get("initiatorCn"); + String initiatorEn = (String) params.get("initiatorEn"); String dueDate = (String) params.get("dueDate"); try { for (String userId : userIdList) { @@ -1610,8 +1610,12 @@ public class FeishuServiceImpl implements IFeishuService { templateVariableMap.put("view_url_en",back_url_en); templateVariableMap.put("projectCn"," " + projectCn); templateVariableMap.put("projectEn"," " + projectEn); - templateVariableMap.put("initiator"," " + initiator); -// templateVariableMap.put("initiatorEn",initiatorEn); + templateVariableMap.put("initiatorCn"," " + initiatorCn); + if(StringUtils.isNotBlank(flag)){ + templateVariableMap.put("initiatorEn"," " + initiatorEn); + }else{ + templateVariableMap.put("initiatorEn"," " + initiatorCn); + } templateVariableMap.put("dueDate"," " + dueDate); larkMesJson.put("templateVariableMap",templateVariableMap); From df14341d24723013a22894f4f83ea5051cfc3a0e Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Fri, 14 Apr 2023 11:38:30 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=94=B6=E9=9B=86=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=EF=BC=88?= =?UTF-8?q?=E9=A3=9E=E4=B9=A6=E6=B6=88=E6=81=AF=EF=BC=89--=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cert/collect/task/ScheduledTask.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/task/ScheduledTask.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/task/ScheduledTask.java index 91fb719d8..c09f78e04 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/task/ScheduledTask.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/task/ScheduledTask.java @@ -2,6 +2,9 @@ package com.jero.modules.cert.collect.task; import com.jero.modules.cert.collect.service.IParamsCollectManifestEOService; import lombok.extern.slf4j.Slf4j; +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @@ -28,3 +31,31 @@ public class ScheduledTask { } + +//测试定时任务使用 +//@Component +//@Slf4j +//public class ScheduledTask implements Job { +// +// @Autowired +// private IParamsCollectManifestEOService paramsCollectManifestEOServicea; +// +// /** +// * 监控参数收集任务的截止时间,并根据时间段发送飞书 +// */ +// //@Scheduled(cron = "0 30 14 * * ?") +//// @Scheduled(cron = "0 0 0 */1 * ?") +//// public void checkTime() { +//// log.info("-----checkDeadline-----begin-----------"); +//// +//// paramsCollectManifestEOServicea.checkDeadline(); +//// +//// log.info("-----checkDeadline------end-----------"); +//// } +// +// +// @Override +// public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { +// paramsCollectManifestEOServicea.checkDeadline(); +// } +//} From 6950f2b18f198c56e4f4116244b2b1b8e200b419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E5=BC=BA=E5=BC=BA?= <787203167> Date: Fri, 14 Apr 2023 13:46:58 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/views/projectManagement/components/batSetting.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jero-web/src/views/projectManagement/components/batSetting.vue b/jero-web/src/views/projectManagement/components/batSetting.vue index 2519d5201..d55ab9c88 100644 --- a/jero-web/src/views/projectManagement/components/batSetting.vue +++ b/jero-web/src/views/projectManagement/components/batSetting.vue @@ -405,7 +405,7 @@ this.$nextTick(() => { this.ids = data || [] this.formInline = {} - if (content) { + if (content && code == '0') { this.formInline.dutyTerritory = content.dutyTerritory this.queryPersonByProject(content) } From 728aa1cabbe2bc5f0664565a37f6eea90e75b7b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E5=BC=BA=E5=BC=BA?= <787203167> Date: Fri, 14 Apr 2023 13:53:20 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/common/lang/en-us.js | 1 + jero-web/src/common/lang/zh-cn.js | 1 + .../projectManagement/components/batSetting.vue | 16 ++++++++-------- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index 15f2fa326..712f06b0b 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -1785,4 +1785,5 @@ module.exports = { onlyDesignComplianceConfirmationSelected:'Only data with a design compliance confirmation process status of task to be confirmed, result to be submitted, or verification compliance confirmation process status of task to be confirmed, result to be submitted can be selected', oneThePersonnelMustBeSelected:'One of the personnel must be selected', pleaseSelectRegulatoryCurrentLogin:'Please select Regulatory Engineer as the data for the current login', + cannotSetResponsibilityAreas:'Cannot set an interface person due to different responsibility areas', } \ 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 227b81d1a..0dd332c63 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -1887,4 +1887,5 @@ module.exports = { onlyDesignComplianceConfirmationSelected:'只能选择设计符合性确认流程状态为任务待确认、结果待提交或验证符合性确认流程状态为任务待确认、结果待提交的数据', oneThePersonnelMustBeSelected:'必须选择其中一个人员', pleaseSelectRegulatoryCurrentLogin:'请选择法规工程师为当前登录人的数据', + cannotSetResponsibilityAreas:'所属不同责任领域,不能设置接口人', } \ No newline at end of file diff --git a/jero-web/src/views/projectManagement/components/batSetting.vue b/jero-web/src/views/projectManagement/components/batSetting.vue index d55ab9c88..216718257 100644 --- a/jero-web/src/views/projectManagement/components/batSetting.vue +++ b/jero-web/src/views/projectManagement/components/batSetting.vue @@ -100,7 +100,7 @@ :title="$t('engineeringInterfacePerson')">{{$t('engineeringInterfacePerson')}} - Date: Fri, 14 Apr 2023 14:02:17 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E9=A3=9E=E4=B9=A6=E6=B6=88=E6=81=AF-?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=8F=82=E6=95=B0=E6=B8=85=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ParamsCollectManifestEOServiceImpl.java | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java index 39af28dae..fbc885a74 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/impl/ParamsCollectManifestEOServiceImpl.java @@ -2309,7 +2309,8 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl Date: Fri, 14 Apr 2023 14:12:04 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=B8=85=E5=8D=95-?= =?UTF-8?q?=E8=A1=A8=E5=A4=B4=E6=8E=92=E5=BA=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectCertificationInventoryEO.java | 8 ++ ...ctCertificationInventoryEOServiceImpl.java | 119 ++++++++++++++++++ 2 files changed, 127 insertions(+) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java index cb656f9c6..e31fbc852 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/ProjectCertificationInventoryEO.java @@ -222,4 +222,12 @@ public class ProjectCertificationInventoryEO implements Serializable { @TableField(exist = false) private String reasonForReturn; + + //排序(1->正序, 2->倒序) + @TableField(exist = false) + private String orderBy; + + //排序字段 + @TableField(exist = false) + private String orderByField; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index a2580f34e..59bffd7d0 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -29,6 +29,7 @@ import com.jero.modules.document.controller.BussDocumentLibraryEOController; import com.jero.modules.document.entity.BussDocumentLibraryEO; import com.jero.modules.document.mapper.BussDocumentLibraryEOMapper; import com.jero.modules.document.service.IBussDocumentLibraryEOService; +import com.jero.modules.dummy.enums.OrderEnum; import com.jero.modules.feishu.enums.TemplateInfoEnum2; import com.jero.modules.feishu.service.IFeishuService; import com.jero.modules.oss.entity.OSSFile; @@ -83,6 +84,7 @@ import org.springframework.mock.web.MockMultipartFile; import org.springframework.stereotype.Service; import java.io.*; +import java.text.Collator; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -1374,9 +1376,126 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl pageList = this.page(page, queryWrapper); this.disposeData(pageList.getRecords(),cut); + List records = this.hearSort(projectCertificationInventoryEO, pageList.getRecords()); + pageList.setRecords(records); return pageList; } + /** + * 表头排序 + * @param pciEo + * @param datas + * @return + */ + private List hearSort(ProjectCertificationInventoryEO pciEo, List datas) { + String orderBy = pciEo.getOrderBy(); + String orderByField = pciEo.getOrderByField(); + if(ObjectUtils.isNotEmpty(orderByField)){ + Collator comparator = Collator.getInstance(Locale.CHINESE); + // 类别 category + if(StringUtils.equals("category",orderByField)){ + if(OrderEnum.POSITIVE.getValue().equals(orderBy)){ + Collections.sort(datas,(e1, e2)->{ + String e1Category = (StringUtils.isNotEmpty(e1.getCategory()) ? e1.getCategory() : ""); + String e2Category = (StringUtils.isNotEmpty(e2.getCategory()) ? e2.getCategory() : ""); + return comparator.compare(e1Category,e2Category); + }); + }else if(OrderEnum.REVERSE.getValue().equals(orderBy)){ + Collections.sort(datas,(e1,e2)->{ + String e1Category = (StringUtils.isNotEmpty(e1.getCategory()) ? e1.getCategory() : ""); + String e2Category = (StringUtils.isNotEmpty(e2.getCategory()) ? e2.getCategory() : ""); + return comparator.compare(e2Category,e1Category); + }); + } + } + + // 检验项目 inspectionItem + if(StringUtils.equals("inspectionItem",orderByField)){ + if(OrderEnum.POSITIVE.getValue().equals(orderBy)){ + Collections.sort(datas,(e1, e2)->{ + String e1InspectionItem = (StringUtils.isNotEmpty(e1.getInspectionItem()) ? e1.getInspectionItem() : ""); + String e2InspectionItem = (StringUtils.isNotEmpty(e2.getInspectionItem()) ? e2.getInspectionItem() : ""); + return comparator.compare(e1InspectionItem,e2InspectionItem); + }); + }else if(OrderEnum.REVERSE.getValue().equals(orderBy)){ + Collections.sort(datas,(e1,e2)->{ + String e1InspectionItem = (StringUtils.isNotEmpty(e1.getInspectionItem()) ? e1.getInspectionItem() : ""); + String e2InspectionItem = (StringUtils.isNotEmpty(e2.getInspectionItem()) ? e2.getInspectionItem() : ""); + return comparator.compare(e2InspectionItem,e1InspectionItem); + }); + } + } + // 标准编号 serialNumber + if(StringUtils.equals("serialNumber",orderByField)){ + if(OrderEnum.POSITIVE.getValue().equals(orderBy)){ + Collections.sort(datas,(e1, e2)->{ + String e1SerialNumber = (StringUtils.isNotEmpty(e1.getSerialNumber()) ? e1.getSerialNumber() : ""); + String e2SerialNumber = (StringUtils.isNotEmpty(e2.getSerialNumber()) ? e2.getSerialNumber() : ""); + return comparator.compare(e1SerialNumber,e2SerialNumber); + }); + }else if(OrderEnum.REVERSE.getValue().equals(orderBy)){ + Collections.sort(datas,(e1,e2)->{ + String e1SerialNumber = (StringUtils.isNotEmpty(e1.getSerialNumber()) ? e1.getSerialNumber() : ""); + String e2SerialNumber = (StringUtils.isNotEmpty(e2.getSerialNumber()) ? e2.getSerialNumber() : ""); + return comparator.compare(e2SerialNumber,e1SerialNumber); + }); + } + } + + // 交付物类型 deliverableTypeName + if(StringUtils.equals("deliverableTypeName",orderByField)){ + if(OrderEnum.POSITIVE.getValue().equals(orderBy)){ + Collections.sort(datas,(e1, e2)->{ + String e1DeliverableTypeName = (StringUtils.isNotEmpty(e1.getDeliverableTypeName()) ? e1.getDeliverableTypeName() : ""); + String e2DeliverableTypeName = (StringUtils.isNotEmpty(e2.getDeliverableTypeName()) ? e2.getDeliverableTypeName() : ""); + return comparator.compare(e1DeliverableTypeName,e2DeliverableTypeName); + }); + }else if(OrderEnum.REVERSE.getValue().equals(orderBy)){ + Collections.sort(datas,(e1,e2)->{ + String e1DeliverableTypeName = (StringUtils.isNotEmpty(e1.getDeliverableTypeName()) ? e1.getDeliverableTypeName() : ""); + String e2DeliverableTypeName = (StringUtils.isNotEmpty(e2.getDeliverableTypeName()) ? e2.getDeliverableTypeName() : ""); + return comparator.compare(e2DeliverableTypeName,e1DeliverableTypeName); + }); + } + } + + // 截止日期 endTime + if(StringUtils.equals("endTime",orderByField)){ + if(OrderEnum.POSITIVE.getValue().equals(orderBy)){ + Collections.sort(datas,(e1, e2)->{ + String e1EndTime = (e1.getEndTime() != null ? DateUtils.formatDate(e1.getEndTime()) : ""); + String e2EndTime = (e2.getEndTime() != null ? DateUtils.formatDate(e2.getEndTime()) : ""); + return comparator.compare(e1EndTime,e2EndTime); + }); + }else if(OrderEnum.REVERSE.getValue().equals(orderBy)){ + Collections.sort(datas,(e1,e2)->{ + String e1EndTime = (e1.getEndTime() != null ? DateUtils.formatDate(e1.getEndTime()) : ""); + String e2EndTime = (e2.getEndTime() != null ? DateUtils.formatDate(e2.getEndTime()) : ""); + return comparator.compare(e2EndTime,e1EndTime); + }); + } + } + + // 流程状态 flowStatusName + if(StringUtils.equals("flowStatusName",orderByField)){ + if(OrderEnum.POSITIVE.getValue().equals(orderBy)){ + Collections.sort(datas,(e1, e2)->{ + String e1FlowStatusName = (StringUtils.isNotEmpty(e1.getFlowStatusName()) ? e1.getFlowStatusName() : ""); + String e2FlowStatusName = (StringUtils.isNotEmpty(e2.getFlowStatusName()) ? e2.getFlowStatusName() : ""); + return comparator.compare(e1FlowStatusName,e2FlowStatusName); + }); + }else if(OrderEnum.REVERSE.getValue().equals(orderBy)){ + Collections.sort(datas,(e1,e2)->{ + String e1FlowStatusName = (StringUtils.isNotEmpty(e1.getFlowStatusName()) ? e1.getFlowStatusName() : ""); + String e2FlowStatusName = (StringUtils.isNotEmpty(e2.getFlowStatusName()) ? e2.getFlowStatusName() : ""); + return comparator.compare(e2FlowStatusName,e1FlowStatusName); + }); + } + } + } + return datas; + } + @Override public void createQueryPermission(QueryWrapper queryWrapper, String roleCode) { /**