diff --git a/jero-boot/db/蔚来标准sql/dev_third_record.sql b/jero-boot/db/蔚来标准sql/dev_third_record.sql index 706a8ec55..aa02d7fe1 100644 --- a/jero-boot/db/蔚来标准sql/dev_third_record.sql +++ b/jero-boot/db/蔚来标准sql/dev_third_record.sql @@ -1203,6 +1203,3 @@ MODIFY COLUMN `content_en` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ALTER TABLE `laws_weilai`.`laws_monthly_report_write` MODIFY COLUMN `work_progress_cn` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'NIO工作进展中文' AFTER `content_en`, MODIFY COLUMN `work_progress_en` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'NIO工作进展英文' AFTER `work_progress_cn`; - ---文档拆分条款 条款号取消必填 2022-10-25 未同步生产环境 -UPDATE `laws_weilai`.`onl_cgform_field` SET `field_must_input` = '0' WHERE `id` = '0a455895498552bc709dff250b3364b1' \ No newline at end of file diff --git a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/enums/MessageType2Enum.java b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/enums/MessageType2Enum.java new file mode 100644 index 000000000..bf4544532 --- /dev/null +++ b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/enums/MessageType2Enum.java @@ -0,0 +1,41 @@ +package com.jero.common.constant.enums; + +public enum MessageType2Enum { + + + SUBSCRIPTION_NOTIFICATION("Subscription Notification","订阅通知"), + SHARE_FORWARD("Share Forward","转发推送"), + REGULATION_EARLY_WARNING("Regulation Early Warning","法规预警"), + REGULATION_LIST_CONFIRMATION("Regulation List Confirmation","法规清单确认"), + REGULATION_TASK_CONFIRMATION("Regulation Task Confirmation","法规任务确认"), + DESIGN_COMPLIANCE_CONFIRMATION("Design Compliance Confirmation","设计符合性确认"), + PRE_HOMO_CONFIRMATION("Pre-Homo Confirmation","Pre-Homo确认"), + VALIDATION_COMPLIANCE_CONFIRMATION("Validation Compliance Confirmation","验证符合性确认"), + REGULATION_OPINION_COLLECTION("Regulation Opinion Collection","法规意见收集"), + REGULATION_TECHNICAL_ASSESSMENT("Regulation Technical Assessment","法规技术评估"), + HOMO_PARAMETER_COLLECTION("Homo Parameter Collection","认证参数收集"); + + String en; + String cn; + + MessageType2Enum(String en, String cn) { + this.en = en; + this.cn = cn; + } + + public String getEn() { + return en; + } + + public void setEn(String en) { + this.en = en; + } + + public String getCn() { + return cn; + } + + public void setCn(String cn) { + this.cn = cn; + } +} 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 3181758a0..f9d101325 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 @@ -6,11 +6,11 @@ package com.jero.common.constant.enums; * @auth zhn */ public enum MessageTypeEnum { - READ("Subscription Notification","1"), - WARN("Early Warning","2"), - PUSH("Share / Forward","3"), - HOMO_TASK("Homo Parameter Task","4"), - TASK("Regulation Compliance Task", "5"), + READ("Subscription Notification","订阅通知","1"), + WARN("Regulation Early Warning","法规预警","2"), + PUSH("Share / Forward","转发推送","3"), + HOMO_TASK("Homo Parameter Task","","4"), + TASK("Regulation Compliance Task","", "5"), //REGULATION_LIST_CONFIRMATION_TASK("Regulation List Confirmation Task", "6"), // 清单确认任务 //REGULATION_LIST_CONFIRMATION_NOTIFICATION("Regulation List Confirmation Notification", "7"), // 清单确认通知 //REGULATION_TASK_CONFIRMATION_TASK("Regulation Task Confirmation", "8"), // 任务确认任务 @@ -21,19 +21,21 @@ 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"), // 系统通知 - LIST_CONFIRMATION("List Confirmation", "17"), // 清单确认 - TASK_CONFIRMATION("Task Confirmation", "18"), // 任务确认 - COMPLIANCE_CONFIRMATION("Compliance Confirmation", "19"), // 符合性确认 - COLLECTION_OF_LEGISLATIVE_COMMENTS("Collection of Legislative Comments", "20"), // 法规意见收集 - REGULATORY_AND_TECHNICAL_ASSESSMENT("Regulatory and technical assessment", "21"), // 法规技术评估 + SYSTEMATIC_NOTIFICATION("Systematic Notification","", "15"), // 系统通知 + LIST_CONFIRMATION("List Confirmation", "","17"), // 清单确认 + TASK_CONFIRMATION("Task Confirmation", "","18"), // 任务确认 + COMPLIANCE_CONFIRMATION("Compliance Confirmation","", "19"), // 符合性确认 + COLLECTION_OF_LEGISLATIVE_COMMENTS("Collection of Legislative Comments","", "20"), // 法规意见收集 + REGULATORY_AND_TECHNICAL_ASSESSMENT("Regulatory and technical assessment", "","21"), // 法规技术评估 ; String name; + String nameCn; String value; - private MessageTypeEnum(String name, String value) { + private MessageTypeEnum(String name,String nameCn, String value) { this.name = name; + this.nameCn = nameCn; this.value = value; } @@ -52,4 +54,12 @@ public enum MessageTypeEnum { public void setValue(String value) { this.value = value; } + + public String getNameCn() { + return nameCn; + } + + public void setNameCn(String nameCn) { + this.nameCn = nameCn; + } } 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 new file mode 100644 index 000000000..ba74f1908 --- /dev/null +++ b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/constant/enums/MsgColorEnum.java @@ -0,0 +1,32 @@ +package com.jero.common.constant.enums; + +public enum MsgColorEnum { + + GREEN("其他","green"), + RED("任务被拒绝","red"), + YELLOW("任务预期","yellow"); + + String label; + String value; + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + MsgColorEnum(String label, String value) { + this.label = label; + this.value = value; + } +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/ParamsCollectManifestEOMapper.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/ParamsCollectManifestEOMapper.java index 76eedb79c..140f9c0c8 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/ParamsCollectManifestEOMapper.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/ParamsCollectManifestEOMapper.java @@ -26,4 +26,6 @@ public interface ParamsCollectManifestEOMapper extends BaseMapper listInfoOfTitle(@Param("paramsManifestId") String paramsManifestId); IPage pageInfo(@Param("page") IPage page, @Param("paramsCollectManifestEO") ParamsCollectManifestEO paramsCollectManifestEO); - } + + List queryByParamManifestId(@Param("paramsManifestId") String paramsManifestIdString); +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestEOMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestEOMapper.xml index 0b45b9351..8c30b86c8 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestEOMapper.xml +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsCollectManifestEOMapper.xml @@ -108,4 +108,8 @@ order by del_flag desc, add_flag desc, change_flag desc, nio_number asc - \ No newline at end of file + + + diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsManifestEOMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsManifestEOMapper.xml index 17aad26e9..bc90c0103 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsManifestEOMapper.xml +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/mapper/xml/ParamsManifestEOMapper.xml @@ -147,7 +147,7 @@ select tmp_tb.* from( select plb.id as project_id, - concat(pni.project_name,'-',pyni.year_name,' ',target_market) as project_name + concat(pni.project_name,'-',pyni.year_name,'-',target_market,'-',project_version) as project_name from project_library_base plb left join project_name_info as pni on plb.project_name_id = pni.id left join project_year_name_info as pyni on plb.year_name_id = pyni.id diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java index 16249bc07..0266ae8dc 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/service/IParamsCollectManifestEOService.java @@ -164,4 +164,8 @@ public interface IParamsCollectManifestEOService extends IService updateBatchDutyTerritory(ParamsCollectManifestVO paramsCollectManifestVO); + + //监控参数收集任务的截止时间,并根据时间段发送飞书 + void checkDeadline(); + } 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 34349bfc1..3a03f22b5 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 @@ -11,10 +11,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.google.common.collect.Lists; 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.MessageTypeEnum; -import com.jero.common.constant.enums.ModuleEnum; -import com.jero.common.constant.enums.YesOrNoEnum; +import com.jero.common.constant.enums.*; import com.jero.common.exception.JeroBootException; import com.jero.common.system.query.QueryGenerator; import com.jero.common.system.vo.LoginUser; @@ -40,6 +37,7 @@ import com.jero.modules.cert.template.enums.ParamsIsMustEnum; import com.jero.modules.cert.template.service.ICertCategoryParamsInfoPublishEOService; import com.jero.modules.cert.template.service.IParamsInfoPublishEOService; 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.ocr.service.WebSocketServer; @@ -1282,13 +1280,103 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl projectLibraryBases = projectLibraryBaseMapper.queryById(paramsManifestEO.getProjectId()); + if (ObjectUtils.isNotEmpty(projectLibraryBases)) { + SysUser engineer = sysUserService.getById(projectLibraryBases.get(0).getCertificationEngineer()); + if (ObjectUtils.isNotEmpty(engineer)) { + engThirdIds[0] = engineer.getThirdId(); + } + + } + if (CollectManifestStateEnum.SDT_BACK.getValue().equals(paramsCollectManifestEO.getState())) { + //通知认证工程师 + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(MessageType2Enum.HOMO_PARAMETER_COLLECTION.getCn() + "/" + MessageType2Enum.HOMO_PARAMETER_COLLECTION.getEn()); + feishuMsgVo.setCnContentUpper("您好,"+ currentUser.getUsername() +"退回了参数NIO-"+ paramsCollectManifestEO.getNioNumber() +",请及时处理"); + feishuMsgVo.setCnContentLower("项目: " + projectInfo.getProjectName() + + "\n发起人: " + currentUser.getUsername() + + "\n截止时间: " + deadline); + feishuMsgVo.setEnContentUpper("Hello! "+ currentUser.getUsername() +" has returned the Parameter NIO-"+ paramsCollectManifestEO.getNioNumber() +". Please address it in a timely manner"); + feishuMsgVo.setEnContentLower("Project: " + projectInfo.getProjectName() + + "\nInitiator: " + currentUser.getUsername() + + "\nDue Date: " + deadline); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.RED.getValue()); // 颜色 + feishuService.sendCard(engThirdIds, feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } + } else if (CollectManifestStateEnum.DRE_BACK.getValue().equals(paramsCollectManifestEO.getState())) { + + //通知认证工程师 + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(MessageType2Enum.HOMO_PARAMETER_COLLECTION.getCn() + "/" + MessageType2Enum.HOMO_PARAMETER_COLLECTION.getEn()); + feishuMsgVo.setCnContentUpper("您好,"+ currentUser.getUsername() +"申请撤回参数NIO-"+ paramsCollectManifestEO.getNioNumber() +",请及时处理"); + feishuMsgVo.setCnContentLower("项目: " + projectInfo.getProjectName() + + "\n发起人: " + currentUser.getUsername() + + "\n截止时间: " + deadline); + feishuMsgVo.setEnContentUpper("Hello! "+ currentUser.getUsername() +" requested for withdrawing Parameter NIO-"+ paramsCollectManifestEO.getNioNumber() +". Please address it in a timely manner"); + feishuMsgVo.setEnContentLower("Project: " + projectInfo.getProjectName() + + "\nInitiator: " + currentUser.getUsername() + + "\nDue Date: " + deadline); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.RED.getValue()); // 颜色 + feishuService.sendCard(engThirdIds, feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } + //通知工程接口人 + SysUser sdtUser = sysUserService.getUserByName(paramsCollectManifestEO.getSdt()); + String[] SdtThirdIds = new String[1]; + if (ObjectUtils.isNotEmpty(sdtUser)) { + SdtThirdIds[0] = sdtUser.getThirdId(); + } + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(MessageType2Enum.HOMO_PARAMETER_COLLECTION.getCn() + "/" + MessageType2Enum.HOMO_PARAMETER_COLLECTION.getEn()); + feishuMsgVo.setCnContentUpper("您好,"+ currentUser.getUsername() +"退回了参数NIO-"+ paramsManifestEO.getTitle() +",请及时处理"); + feishuMsgVo.setCnContentLower("项目: " + projectInfo.getProjectName() + + "\n发起人: " + currentUser.getUsername() + + "\n截止时间: " + deadline); + feishuMsgVo.setEnContentUpper("Hello! "+ currentUser.getUsername() +" has returned the Parameter NIO-"+ paramsManifestEO.getTitle() +". Please address it in a timely manner"); + feishuMsgVo.setEnContentLower("Project: " + projectInfo.getProjectName() + + "\nInitiator: " + currentUser.getUsername() + + "\nDue Date: " + deadline); + feishuMsgVo.setUrl(hrefFeishu); + feishuMsgVo.setColor(MsgColorEnum.RED.getValue()); // 颜色 + feishuService.sendCard(engThirdIds, feishuMsgVo); + } catch (IOException e) { + log.error("飞书消息推送失败"); + } + + } + + } + } + return update; } @Override @@ -1441,13 +1529,13 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImplthe link,"; - String content = connectBuilder.substring(0, connectBuilder.toString().length()-1) + " and other parameter items, please enter the link to handle it."; - String contentInfo = connectBuilder.substring(0, connectBuilder.toString().length()-1) + " and other parameter items, please enter " + href + " and fill in the relevant information."; - String msgTitle = projectInfo.getProjectName() + ": You have a homo parameter task to complete"; + //String href = "the link,"; + //String content = connectBuilder.substring(0, connectBuilder.toString().length()-1) + " and other parameter items, please enter the link to handle it."; + //String contentInfo = connectBuilder.substring(0, connectBuilder.toString().length()-1) + " and other parameter items, please enter " + href + " and fill in the relevant information."; + //String msgTitle = projectInfo.getProjectName() + ": You have a homo parameter task to complete"; // 发送系统消息 - SysAnnouncement sysAnnouncement = new SysAnnouncement(); + /*SysAnnouncement sysAnnouncement = new SysAnnouncement(); sysAnnouncement.setDelFlag("0"); sysAnnouncement.setSendStatus("0"); sysAnnouncement.setSendTime(new Date()); @@ -1464,10 +1552,10 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl paramsCollectManifestEOList = listByIds(Arrays.asList(paramsCollectManifestIdStr)); paramsCollectManifestEOList = paramsCollectManifestEOList.stream().sorted(Comparator.comparing(ParamsCollectManifestBaseEO::getNioNumber)).collect(Collectors.toList()); // 按NIO编号升序 - for (ParamsCollectManifestEO paramsCollectManifestEO : paramsCollectManifestEOList) { + for (ParamsCollectManifestEO paramsCollectManifestEO : paramsCollectManifestEOList) { // 判断参数项状态 if (CollectManifestStateEnum.WAIT_COLLECT.getValue().equals(paramsCollectManifestEO.getState()) || CollectManifestStateEnum.SDT_BACK.getValue().equals(paramsCollectManifestEO.getState()) @@ -1543,19 +1648,19 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl afterUpdateEOList = listByIds(updateEOIdList); - List sdtList = afterUpdateEOList.stream() - .map(ParamsCollectManifestEO::getSdt) - .distinct() - .collect(Collectors.toList()); - if (CollectionUtil.isEmpty(sdtList)) { - throw new JeroBootException("没有可下发的工程接口人!"); - } - for (String sdt : sdtList) { + if (isSuccess) { + // 消息内容 + List afterUpdateEOList = listByIds(updateEOIdList); + List sdtList = afterUpdateEOList.stream() + .map(ParamsCollectManifestEO::getSdt) + .distinct() + .collect(Collectors.toList()); + if (CollectionUtil.isEmpty(sdtList)) { + throw new JeroBootException("没有可下发的工程接口人!"); + } + for (String sdt : sdtList) { - StringBuilder connectBuilder = new StringBuilder(); + /* StringBuilder connectBuilder = new StringBuilder(); connectBuilder.append("You are required to fill in "); for (int i = 0; i < afterUpdateEOList.size(); i++) { ParamsCollectManifestEO paramsCollectManifestEO = afterUpdateEOList.get(i); @@ -1563,19 +1668,19 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImplthe link,"; - String contentInfo = connectBuilder.substring(0, connectBuilder.toString().length() - 1) + " and other parameter items, please enter " + href + " and fill in the relevant information."; - String msgTitle = projectInfo.getProjectName() + ": You have a homo parameter task to complete"; + SysUser sysUser = sysUserService.getUserByName(sdt); + String[] thirdIds = new String[1]; + thirdIds[0] = sysUser.getThirdId(); + String urlParamsStr = parseUrlParams(paramsManifestEO); + String hrefFeishu = backUrl + "/ParameterItemCollection" + urlParamsStr; + //String href = "the link,"; + //String contentInfo = connectBuilder.substring(0, connectBuilder.toString().length() - 1) + " and other parameter items, please enter " + href + " and fill in the relevant information."; + //String msgTitle = projectInfo.getProjectName() + ": You have a homo parameter task to complete"; - // 发送系统消息 - SysAnnouncement sysAnnouncement = new SysAnnouncement(); + // 发送系统消息 + /* SysAnnouncement sysAnnouncement = new SysAnnouncement(); sysAnnouncement.setDelFlag("0"); sysAnnouncement.setSendStatus("0"); sysAnnouncement.setSendTime(new Date()); @@ -1592,24 +1697,28 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImplthe link,"; - String contentInfo = connectBuilder.substring(0, connectBuilder.toString().length() - 1) + " and other parameter items, please enter " + href + " and fill in the relevant information."; - String msgTitle = projectInfo.getProjectName() + ": You have a homo parameter task to complete"; + //String href = "the link,"; + //String contentInfo = connectBuilder.substring(0, connectBuilder.toString().length() - 1) + " and other parameter items, please enter " + href + " and fill in the relevant information."; + //String msgTitle = projectInfo.getProjectName() + ": You have a homo parameter task to complete"; // 发送系统消息 - SysAnnouncement sysAnnouncement = new SysAnnouncement(); + /*SysAnnouncement sysAnnouncement = new SysAnnouncement(); sysAnnouncement.setDelFlag("0"); sysAnnouncement.setSendStatus("0"); sysAnnouncement.setSendTime(new Date()); @@ -1726,19 +1834,23 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl getMsgOfIssueCollection(List> msgMapList, String cut, String operation) { List msgList = new ArrayList<>(); Map collectManifestStateEnumMap = CollectManifestStateEnum.toMap(cut); @@ -2758,4 +2871,153 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("state", ManifestStateEnum.COLLECTING.getValue()); + List manifestEOS = paramsManifestEOService.list(queryWrapper); + for (ParamsManifestEO manifestEO : manifestEOS) { + //项目名称 + ParamsManifestVO projectInfo = paramsManifestEOService.getProjectById(manifestEO.getProjectId()); + if (ObjectUtils.isNotEmpty(projectInfo)) { + //url + String urlParamsStr = parseUrlParams(manifestEO); + String hrefFeishu = backUrl + "/ParameterItemCollection" + urlParamsStr; + //查出对应清单 + List collectManifestEOS = paramsCollectManifestEOMapper.queryByParamManifestId(manifestEO.getId()); + Map> seven = new HashMap<>(); + Map> three = new HashMap<>(); + Map> today = new HashMap<>(); + for (ParamsCollectManifestEO collectManifestEO : collectManifestEOS) { + String thirdId = null; + if (CollectManifestStateEnum.WAIT_SDT.getValue().equals(collectManifestEO.getState()) + ||CollectManifestStateEnum.DRE_BACK.getValue().equals(collectManifestEO.getState())) { + //工程接口人 + if (ObjectUtils.isNotEmpty(collectManifestEO.getSdt())) { + SysUser sdt = sysUserService.getUserByName(collectManifestEO.getSdt()); + if (ObjectUtils.isNotEmpty(sdt)) { + thirdId = sdt.getThirdId(); + } + } + + } else if (CollectManifestStateEnum.WAIT_FILL.getValue().equals(collectManifestEO.getState()) + ||CollectManifestStateEnum.CERT_BACK.getValue().equals(collectManifestEO.getState())) { + //填写人 + if (ObjectUtils.isNotEmpty(collectManifestEO.getDre())) { + SysUser dre = sysUserService.getUserByName(collectManifestEO.getDre()); + if (ObjectUtils.isNotEmpty(dre)) { + thirdId = dre.getThirdId(); + } + } + } + //截止时间 + if (ObjectUtils.isNotEmpty(thirdId) && ObjectUtils.isNotEmpty(collectManifestEO.getDeadline())) { + String deadline =sdf.format(collectManifestEO.getDeadline()); + //判断日期 + int days = 0; + try { + days = (int) (sdf.parse(deadline).getTime() - sdf.parse(now).getTime()) / (24 * 60 * 60 * 1000); + } catch (Exception e) { + e.printStackTrace(); + throw new JeroBootException("时间获取失败"); + } + if (days == 7) { + deadlineDateMap(seven, collectManifestEO, thirdId); + } else if (days == 3) { + deadlineDateMap(three, collectManifestEO, thirdId); + } else if (now.equals(deadline)) { + deadlineDateMap(today, collectManifestEO, thirdId); + } + + } + } + + String title = MessageType2Enum.HOMO_PARAMETER_COLLECTION.getCn() + "/" + MessageType2Enum.HOMO_PARAMETER_COLLECTION.getEn(); + String cnContentLower = "项目: " + projectInfo.getProjectName() + + "\n发起人: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); + String enContentLower = "Project: " + projectInfo.getProjectName() + + "\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); + if (!seven.isEmpty()) { + for (String key : seven.keySet()) { + String[] thirds = new String[1]; + thirds[0] = key; + List 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) { + log.error("飞书消息推送失败"); + } + } + } + if (!three.isEmpty()) { + for (String key : three.keySet()) { + String[] thirds = new String[1]; + thirds[0] = key; + List 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) { + log.error("飞书消息推送失败"); + } + } + } + if (!today.isEmpty()) { + for (String key : today.keySet()) { + String[] thirds = new String[1]; + thirds[0] = key; + List 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) { + log.error("飞书消息推送失败"); + } + } + } + } + } + + } + + private void deadlineDateMap(Map> today, ParamsCollectManifestEO collectManifestEO, String thirdId) { + List stringList = today.get(thirdId); + if (ObjectUtils.isEmpty(stringList)) { + stringList = new ArrayList<>(); + stringList.add("NIO-" + collectManifestEO.getNioNumber()); + today.put(thirdId, stringList); + } else { + stringList.add("NIO-" + collectManifestEO.getNioNumber()); + } + } } 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 new file mode 100644 index 000000000..91fb719d8 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/cert/collect/task/ScheduledTask.java @@ -0,0 +1,30 @@ +package com.jero.modules.cert.collect.task; + +import com.jero.modules.cert.collect.service.IParamsCollectManifestEOService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +@Component +@Slf4j +public class ScheduledTask { + + @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-----------"); + } + + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java index e53b0e1b1..4353c9894 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/document/service/impl/BussDocumentLibraryEOServiceImpl.java @@ -2208,9 +2208,18 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl map, List> dataList, + List fieldList, List fieldDateList, + List fieldFileList, List fieldPullList, + String cut,String flagTemp) { + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + //调整dataList中map中字段顺序与表单中的一致 + Map mapNew = new LinkedHashMap<>(); + for (OnlCgformField onlCgformField : fieldList) { + for (Map.Entry entry : dataList.get(0).entrySet()) { + if (onlCgformField.getDbFieldName().equals(entry.getKey())) { + mapNew.put(entry.getKey(), entry.getValue()); + break; + } + } + } + dataList.remove(0); + dataList.add(mapNew); + Map mapTemp = new HashMap<>(); + mapCopy(map, mapTemp); + //时间类型的字段 + List fieldDate = fieldDateList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList()); + //文件类型的字段 + List fieldFile = fieldFileList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList()); + //下拉类型的字段 + //过滤出树形字段 + List treeFieldList = fieldList.stream() + .filter(e -> FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType())) + .collect(Collectors.toList()); + + //数据字典 + List sysDictItems = sysDictItemServiceImpl.selectItemsAll(); + //树形数据字典 + List categoryList = sysCategoryService.list(); + //下拉选处理数据字典 + for (Map.Entry entry : dataList.get(0).entrySet()) { + //下拉选处理数据字典 + dictItemCn(sysDictItems, entry, cut, fieldList,flagTemp); + treeDictItemCn(categoryList, entry, treeFieldList, cut,flagTemp); + } + for (Map.Entry entry : mapTemp.entrySet()) { + //下拉选处理数据字典 + dictItemCn(sysDictItems, entry, cut, fieldList,flagTemp); + treeDictItemCn(categoryList, entry, treeFieldList, cut,flagTemp); + } + + StringBuilder sb = new StringBuilder(); + dataList.get(0).entrySet().forEach(entry -> { + String key = entry.getKey(); + Object value = entry.getValue(); + //字段中文名 + List fields = fieldList.stream().filter(e -> e.getDbFieldName().equals(key)).collect(Collectors.toList()); + + if (fields.size() != 0) { + String dbFieldTxt = fields.get(0).getDbFieldTxt(); + if("2".equals(flagTemp)){ + dbFieldTxt = fields.get(0).getDbFieldTxt(); + }else{ + dbFieldTxt = fields.get(0).getDbFieldTxt(); + } + dbFieldTxt = "" + dbFieldTxt + ""; + if (value == null) { + value = ""; + } + for (Map.Entry entryTemp : mapTemp.entrySet()) { + String keyTemp = entryTemp.getKey(); + Object valueTemp = entryTemp.getValue(); + if (valueTemp == null) { + valueTemp = ""; + } + if (!"create_time".equals(key) && !"update_time".equals(key)) { + if (key.equals(keyTemp)) { + if (fieldDate.contains(key)) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + if (ObjectUtils.isNotEmpty(value)) { + value = sdf.format(value); + } + if (ObjectUtils.isNotEmpty(valueTemp)) { + try { + valueTemp = sdf.format(sdf.parse((String) valueTemp)); + } catch (ParseException e) { + } + } + //处理时间类型字段 + if (ObjectUtils.isNotEmpty(value)) { + if (ObjectUtils.isNotEmpty(valueTemp) && !value.equals(valueTemp)) { + if("2".equals(flagTemp)){ + sb.append(dbFieldTxt + "由\"" + value + "\"改为\"“" + valueTemp + "\","); + }else{ + sb.append(dbFieldTxt + "由\"" + value + "\"改为\"“" + valueTemp + "\","); + } + } else if (ObjectUtils.isEmpty(valueTemp)) { + if("2".equals(flagTemp)){ + sb.append(dbFieldTxt + "由\"" + value + "\"改为空" + ","); + }else{ + sb.append(dbFieldTxt + "由\"" + value + "\"改为空" + ","); + } + } + } else { + if (ObjectUtils.isNotEmpty(valueTemp)) { + if("2".equals(flagTemp)){ + sb.append(dbFieldTxt + "由空改为\"" + valueTemp + "\","); + }else{ + sb.append(dbFieldTxt + "由空改为\"" + valueTemp + "\","); + } + + } + } + + } else if (fieldFile.contains(key)) { + //处理文件类型字段 + List fileNameList = new ArrayList<>(); + List fileNameListTemp = new ArrayList<>(); + //之前的文件 + if (ObjectUtils.isNotEmpty(value)) { + List fileInfos = iOSSFileService.getFileInfosByConnectId((String) value); + fileNameList = fileInfos.stream().map(OSSFile::getFileName).collect(Collectors.toList()); + } + //修改的文件 + if (ObjectUtils.isNotEmpty(valueTemp)) { + List fileInfosTemp = iOSSFileService.getFileInfos((String) valueTemp); + fileNameListTemp = fileInfosTemp.stream().map(OSSFile::getFileName).collect(Collectors.toList()); + } + + if (ObjectUtils.isNotEmpty(value)) { + boolean checkDiffrent = checkDiffrent(fileNameList, fileNameListTemp); + + if (fileNameListTemp.size() != 0 && !checkDiffrent) { + if("2".equals(flagTemp)){ + //sysUser + sb.append(dbFieldTxt + "由\"" + StringUtils.join(fileNameList, ",") + "\"改为\"" + StringUtils.join(fileNameListTemp, ",") + "\","); + }else{ + sb.append(dbFieldTxt + "由\"" + StringUtils.join(fileNameList, ",") + "\"改为\"" + StringUtils.join(fileNameListTemp, ",") + "\","); + } + } else if (fileNameListTemp.size() == 0) { + if("2".equals(flagTemp)){ + sb.append(dbFieldTxt + "由\"" + StringUtils.join(fileNameList, ",") + "\"改为空" + ","); + }else{ + sb.append(dbFieldTxt + "由\"" + StringUtils.join(fileNameList, ",") + "\"改为空" + ","); + } + + } + } else { + if (fileNameListTemp.size() != 0) { + if("2".equals(flagTemp)){ + sb.append(dbFieldTxt + "由空改为\"" + StringUtils.join(fileNameListTemp, ",") + "\","); + }else{ + sb.append(dbFieldTxt + "由空改为\"" + StringUtils.join(fileNameListTemp, ",") + "\","); + } + + } + } + } else { +// if ("replace_standard".equals(key) || "corresponding_standard".equals(key)) { +// if (ObjectUtils.isNotEmpty(value)) { +// value = getReplaceStandardName(value); +// } +// if (ObjectUtils.isNotEmpty(valueTemp)) { +// valueTemp = getReplaceStandardName(valueTemp); +// } +// } + //其他类型(被代替标准不处理) + if (!"replaced_standard".equals(key)) { + if (ObjectUtils.isNotEmpty(value)) { + if (ObjectUtils.isNotEmpty(valueTemp) && !value.equals(valueTemp)) { + if("2".equals(flagTemp)){ + sb.append(dbFieldTxt + "由\"" + value + "\"改为\"" + valueTemp + "\","); + }else{ + sb.append(dbFieldTxt + "由\"" + value + "\"改为\"" + valueTemp + "\","); + } + } else if (ObjectUtils.isEmpty(valueTemp)) { + if("2".equals(flagTemp)){ + sb.append(dbFieldTxt + "由\"" + value + "\"改为空" + ","); + }else{ + sb.append(dbFieldTxt + "由\"" + value + "\"改为空" + ","); + } + } + } else { + if (ObjectUtils.isNotEmpty(valueTemp)) { + if("2".equals(flagTemp)){ + sb.append(dbFieldTxt + "由空改为\"" + valueTemp + "\","); }else{ sb.append(dbFieldTxt + "由空改为\"" + valueTemp + "\","); } @@ -3114,20 +3319,34 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl fieldFileList, List fieldPullList, String cut) { + List> dataListTemp = new ArrayList<>(); + for (Map stringObjectMap : dataList) { + Map mapT = new HashMap<>(); + mapCopy(stringObjectMap, mapT); + dataListTemp.add(mapT); + } + String technologyTerritoryNew = (String) dataList.get(0).get("technology_territory"); //1. 处理订阅的发送消息 //修改的内容 String flag ="1";//消息的标识(英文) StringBuilder sb = getUpdateInfo(map, dataList, fieldList, fieldDateList, fieldFileList, fieldPullList, null,flag); + String flagTemp ="2";//消息的标识(中文--消息采用卡片型式发送, 消息内容包含中英文, 所以此处需要获取消息的中文) + StringBuilder sbCn = getUpdateInfoCn(map, dataListTemp, fieldList, fieldDateList, fieldFileList, fieldPullList, null,flagTemp); //树形数据字典 List categoryList = sysCategoryService.list(); String sbStr = ""; if (ObjectUtils.isNotEmpty(sb)) { sbStr = sb.substring(0, sb.length() - 1); } + String sbStrCn = ""; + if (ObjectUtils.isNotEmpty(sbCn)) { + sbStrCn = sbCn.substring(0, sbCn.length() - 1); + } LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); String serialNumber = (String) dataList.get(0).get("serial_number"); String category = (String)map.get("lei4_bie2"); + String categoryCn = (String)map.get("lei4_bie2"); String technologyTerritory = (String) map.get("technology_territory"); if(StringUtils.isNotBlank(category)){ List dictItemList = sysDictItemServiceImpl.selectItemsAll(); @@ -3137,12 +3356,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImplXXX对“GB 7258 进行了修改请及时查看”) //向订阅领域管理中订阅了该技术领域的人和文档库中订阅了该条文档的人发送消息 + // 只有技术领域变更为订阅的技术领域这一种情况发消息, 假如订阅了技术领域A,编辑的文档的技术领域也是A,这时编辑的是其他的字段,这种情况不发消息 Map mapTemp = new HashMap<>(); mapTemp.put("domainId", map.get("technology_territory")); mapTemp.put("documentId", map.get("id")); @@ -3223,10 +3444,18 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl", "") + .replaceAll("","").replaceAll("\"", "<"); + feishuMsgVo.setContent(replaceAllCn); +// + iFeishuService.sendCardMsgDocument(userIdListUpdateFeishu.toArray(new String[]{}), feishuMsgVo); + +// String contentInfoFei = "In the "+category + " " + serialNumber +" you subscribed to, "+sysUser.getUsername()+" changed the " + sbStr.toString();; +// //跳转文档详情 +// String url = backUrl + "/docManage/library/detail?id=" + id; +// iFeishuService.batchSendMessage(userIdListUpdateFeishu.toArray(new String[]{}), contentInfoFei, MessageTypeEnum.READ.getName(), url); } catch (IOException e) { log.error("文档新增飞书消息推送失败"); } @@ -3932,6 +4176,64 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl sysDictItems, Map.Entry entry, String cut, List fieldList,String flagTemp) { + //通过dictField判断字段是否为下拉选(不为空则为下拉选) + List onlCgformFieldList = fieldList.stream().filter(e -> entry.getKey().equals(e.getDbFieldName())).collect(Collectors.toList()); + //数据字典中文 + List dictItemsCh = new ArrayList<>(); + List dictItemsEn = new ArrayList<>(); + for (OnlCgformField onlCgformField : onlCgformFieldList) { + if (FieldTypeEnum.PULL_SINGLE.getValue().equals(onlCgformField.getFieldShowType()) + || FieldTypeEnum.PULL_MORE.getValue().equals(onlCgformField.getFieldShowType())) { + String value = (String) entry.getValue(); + if (StringUtils.isNotBlank(value) && onlCgformFieldList.size() != 0 && StringUtils.isNotBlank(onlCgformFieldList.get(0).getDictField())) { + for (String itemValue : value.split(",")) { + //字段的数据字典 + List dictItemList = sysDictItems.stream() + .filter(e -> StringUtils.isNotBlank(e.getDictCode()) && e.getDictCode().equals(onlCgformFieldList.get(0).getDictField())) + .collect(Collectors.toList()); + if (dictItemList.size() != 0) { + List dictItems = dictItemList.stream() + .filter(e -> itemValue.equals(e.getItemValue())) + .collect(Collectors.toList()); + if (dictItems.size() != 0) { + List itemText = new ArrayList<>(); + if (CutEnum.CN.getValue().equals(cut)) { + itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList()); + } else if(CutEnum.EN.getValue().equals(cut)) { + itemText = dictItems.stream().map(SysDictItem::getEnName).collect(Collectors.toList()); + }else if("2".equals(flagTemp)){ + itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList()); + } + dictItemsCh.addAll(itemText); + dictItemsEn.addAll(itemText); + } + } + } + } + } + } + + + if (onlCgformFieldList.size() != 0 && StringUtils.isNotBlank(onlCgformFieldList.get(0).getDictField())) { + if(FieldTypeEnum.PULL_SINGLE.getValue().equals(onlCgformFieldList.get(0).getFieldShowType()) + || FieldTypeEnum.PULL_MORE.getValue().equals(onlCgformFieldList.get(0).getFieldShowType())){ + if (CutEnum.CN.getValue().equals(cut)) { + entry.setValue(StringUtils.join(dictItemsCh, ",")); + } else if(CutEnum.EN.getValue().equals(cut)){ + entry.setValue(StringUtils.join(dictItemsEn, ",")); + }else if("2".equals(flagTemp)){ + entry.setValue(StringUtils.join(dictItemsEn, ",")); + } + } + } + } @Override @@ -4906,10 +5208,15 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl categoryList, Map.Entry entry, List treeFieldList, String cut,String flagTemp) { + List treeFields = treeFieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList()); + String key = entry.getKey(); + if (treeFields.contains(entry.getKey())) { + String value = StringUtils.valueOf(entry.getValue()); + if (StringUtils.isNotBlank(value)) { + List idList = Arrays.asList(value.split(",")); + List sysCategoryList = categoryList.stream().filter(e -> idList.contains(e.getId())).collect(Collectors.toList()); + List nameList = sysCategoryList.stream().map(SysCategory::getName).collect(Collectors.toList()); + List nameEnList = sysCategoryList.stream().map(SysCategory::getEnName).collect(Collectors.toList()); + if (CutEnum.CN.getValue().equals(cut)) { + entry.setValue(StringUtils.join(nameList, ",")); + } else if(CutEnum.EN.getValue().equals(cut)){ + entry.setValue(StringUtils.join(nameEnList, ",")); + }else if("2".equals(flagTemp)){ + entry.setValue(StringUtils.join(nameList, ",")); + } + } + } + } @SneakyThrows diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyInventoryBaseEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyInventoryBaseEOServiceImpl.java index 6af72e8d9..69cd72ba6 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyInventoryBaseEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/dummy/service/impl/DummyInventoryBaseEOServiceImpl.java @@ -29,6 +29,7 @@ import com.jero.modules.dummy.service.IDummyInventoryInfoEOService; import com.jero.modules.dummy.service.IDummyReadEOService; import com.jero.modules.dummy.vo.VirtualCreaterVo; import com.jero.modules.feishu.service.IFeishuService; +import com.jero.modules.feishu.vo.FeishuMsgVo; import com.jero.modules.oss.entity.OSSFile; import com.jero.modules.oss.service.IOSSFileService; import com.jero.modules.system.entity.SysAnnouncement; @@ -366,6 +367,7 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl dummyInventoryInfoEOList = iDummyInventoryInfoEOService.list(lambdaQueryWrapper); String contentLog = "The "+ baseEO.getName()+" virtual list you subscribed to has been updated as follows:" + "
"; String contentLogFeishu = "The "+ baseEO.getName()+" virtual list you subscribed to has been updated as follows:" + " "; + String contentLogFeishuTemp = "The "+ baseEO.getName()+" virtual list you subscribed to has been updated as follows:" + " "; if(dummyContentChangeEOList.size() == 0){ //没有添加过需要进行第一次添加 @@ -449,7 +451,15 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl serialNumberAddList,List serialNumberDeleteList) throws IOException; + /** * 翻译文本 * @param params @@ -62,4 +91,7 @@ public interface IFeishuService { * @param split */ void sendKnowledgeBaseTypeChargePersonCard(String[] split); + + void sendCard(String[] thirdIds, FeishuMsg2Vo feishuMsgVo) throws IOException; + } 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 b3367fda2..0092c6858 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 @@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.problemKnowledgeBase.entity.ProblemKnowledgeBaseClassifyEO; import com.jero.modules.problemKnowledgeBase.entity.ProblemKnowledgeBaseEO; @@ -24,6 +25,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; +import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @@ -280,6 +282,349 @@ public class FeishuServiceImpl implements IFeishuService { return tokenJson.get("msg").toString(); } + /** + * 文档库卡片消息 + * @param userIds + * @param feishuMsgVo + * @return + * @throws IOException + */ + public String sendCardMsgDocument(String[] userIds, FeishuMsgVo feishuMsgVo) throws IOException { + String token = getTenantAccessToken(); + // 设置请求头 + Map headerMap = new HashMap<>(); + headerMap.put("Authorization", "Bearer " + token); + headerMap.put("Content-Type", "application/json; charset=utf-8"); + + // 示例 + StringBuilder contentSb = new StringBuilder(); + contentSb.append("{"); + contentSb.append("\"elements\": ["); + // 内容中文 + if (StrUtil.isNotEmpty(feishuMsgVo.getContent())){ + contentSb.append("{"); + contentSb.append("\"tag\": \"div\","); + contentSb.append("\"text\": {"); + contentSb.append("\"content\": \"" + feishuMsgVo.getContent() + "\","); + contentSb.append("\"tag\": \"lark_md\""); + contentSb.append("}"); + contentSb.append("},"); + }; + contentSb.append("{\"tag\": \"hr\"},"); + + //内容英文 + if (StrUtil.isNotEmpty(feishuMsgVo.getContentEn())){ + contentSb.append("{"); + contentSb.append("\"tag\": \"div\","); + contentSb.append("\"text\": {"); + contentSb.append("\"content\": \"" + feishuMsgVo.getContentEn() + "\","); + contentSb.append("\"tag\": \"lark_md\""); + contentSb.append("}"); + contentSb.append("},"); + }; + + + + contentSb.append("{"); + contentSb.append("\"actions\": ["); + contentSb.append("{"); + contentSb.append("\"tag\": \"button\","); + contentSb.append("\"text\": {"); + contentSb.append("\"content\": \"view\","); + contentSb.append("\"tag\": \"plain_text\""); + contentSb.append("},"); + contentSb.append("\"type\": \"primary\","); + contentSb.append("\"url\": \" "+ feishuMsgVo.getUrl() +" \""); + contentSb.append("}"); + contentSb.append("],"); + contentSb.append("\"tag\": \"action\""); + contentSb.append("}"); + contentSb.append("],"); + + + + contentSb.append("\"header\": {"); + contentSb.append("\"template\": \"green\","); + contentSb.append("\"title\": {"); + contentSb.append("\"content\": \" " + feishuMsgVo.getTitle() + " \","); + contentSb.append("\"tag\": \"plain_text\""); + contentSb.append("}"); + contentSb.append("}"); + contentSb.append("}"); + + JSONObject jsonObject = JSONObject.parseObject(contentSb.toString()); + + String content = JSONObject.parseObject( + JSONObject.parseObject(JSONArray.parseArray(jsonObject.get("elements").toString()).get(0).toString()).get("text").toString()) + .get("content").toString(); + String contentEn = JSONObject.parseObject( + JSONObject.parseObject(JSONArray.parseArray(jsonObject.get("elements").toString()).get(2).toString()).get("text").toString()) + .get("content").toString(); + + JSONObject elementTwo = + JSONObject.parseObject(JSONArray.parseArray(jsonObject.get("elements").toString()).get(1).toString()); + JSONObject elementFour = + JSONObject.parseObject(JSONArray.parseArray(jsonObject.get("elements").toString()).get(3).toString()); + + //处理内容中的双引号(将尖括号替换成双引号) + JSONObject elementOne = getJsonObject(jsonObject, content); + JSONObject elementThree = getJsonObject(jsonObject, contentEn); + + JSONArray jsonArray = new JSONArray(); + jsonArray.add(elementOne); + jsonArray.add(elementTwo); + jsonArray.add(elementThree); + jsonArray.add(elementFour); + jsonObject.put("elements",jsonArray); + + // 设置请求参数 + JSONObject paramsMap = new JSONObject(); + paramsMap.put("user_ids", userIds); + paramsMap.put("msg_type", "interactive"); + paramsMap.put("card", jsonObject); + + // 发送请求给飞书 + String response = HttpRequestUtil.getResponseOfPOST(batchSendMessageUrl, headerMap, paramsMap.toJSONString()); + // 获取返回结果 + JSONObject tokenJson = JSONObject.parseObject(response); + if(!tokenJson.get("code").toString().equals("0")) { + log.error("请求出现异常:" + tokenJson.get("msg") + " " + tokenJson); + } + return tokenJson.get("msg").toString(); + } + + + /** + * 订阅领域(飞书消息) + * @param userIds + * @param feishuMsgVo + * @return + * @throws IOException + */ + public String sendCardMsgTerritory(String[] userIds, FeishuMsgVo feishuMsgVo) throws IOException { + String token = getTenantAccessToken(); + // 设置请求头 + Map headerMap = new HashMap<>(); + headerMap.put("Authorization", "Bearer " + token); + headerMap.put("Content-Type", "application/json; charset=utf-8"); + + // 示例 + StringBuilder contentSb = new StringBuilder(); + contentSb.append("{"); + contentSb.append("\"elements\": ["); + // 内容中文 + if (StrUtil.isNotEmpty(feishuMsgVo.getContent())){ + contentSb.append("{"); + contentSb.append("\"tag\": \"div\","); + contentSb.append("\"text\": {"); + contentSb.append("\"content\": \"" + feishuMsgVo.getContent() + "\","); + contentSb.append("\"tag\": \"lark_md\""); + contentSb.append("}"); + contentSb.append("},"); + }; + contentSb.append("{\"tag\": \"hr\"},"); + + //内容英文 + if (StrUtil.isNotEmpty(feishuMsgVo.getContentEn())){ + contentSb.append("{"); + contentSb.append("\"tag\": \"div\","); + contentSb.append("\"text\": {"); + contentSb.append("\"content\": \"" + feishuMsgVo.getContentEn() + "\","); + contentSb.append("\"tag\": \"lark_md\""); + contentSb.append("}"); + contentSb.append("},"); + }; + + contentSb.append("{"); + contentSb.append("\"actions\": ["); + contentSb.append("{"); + contentSb.append("\"tag\": \"button\","); + contentSb.append("\"text\": {"); + contentSb.append("\"content\": \"view\","); + contentSb.append("\"tag\": \"plain_text\""); + contentSb.append("},"); + contentSb.append("\"type\": \"primary\","); + contentSb.append("\"url\": \" "+ feishuMsgVo.getUrl() +" \""); + contentSb.append("}"); + contentSb.append("],"); + contentSb.append("\"tag\": \"action\""); + contentSb.append("}"); + contentSb.append("],"); + + + + contentSb.append("\"header\": {"); + contentSb.append("\"template\": \"green\","); + contentSb.append("\"title\": {"); + contentSb.append("\"content\": \" " + feishuMsgVo.getTitle() + " \","); + contentSb.append("\"tag\": \"plain_text\""); + contentSb.append("}"); + contentSb.append("}"); + contentSb.append("}"); + + JSONObject jsonObject = JSONObject.parseObject(contentSb.toString()); + + // 设置请求参数 + JSONObject paramsMap = new JSONObject(); + paramsMap.put("user_ids", userIds); + paramsMap.put("msg_type", "interactive"); + paramsMap.put("card", jsonObject); + + // 发送请求给飞书 + String response = HttpRequestUtil.getResponseOfPOST(batchSendMessageUrl, headerMap, paramsMap.toJSONString()); + // 获取返回结果 + JSONObject tokenJson = JSONObject.parseObject(response); + if(!tokenJson.get("code").toString().equals("0")) { + log.error("请求出现异常:" + tokenJson.get("msg") + " " + tokenJson); + } + return tokenJson.get("msg").toString(); + } + /** + * 虚拟清单发布(飞书消息) + * @param userIds + * @param feishuMsgVo + * @return + * @throws IOException + */ + public String sendCardMsgVirtua(String[] userIds, FeishuMsgVo feishuMsgVo, + List serialNumberAddList,List serialNumberDeleteList) throws IOException { + String token = getTenantAccessToken(); + // 设置请求头 + Map headerMap = new HashMap<>(); + headerMap.put("Authorization", "Bearer " + token); + headerMap.put("Content-Type", "application/json; charset=utf-8"); + + // 示例 + StringBuilder contentSb = new StringBuilder(); + contentSb.append("{"); + contentSb.append("\"elements\": ["); + // 内容中文 + if (StrUtil.isNotEmpty(feishuMsgVo.getContent())){ + contentSb.append("{"); + contentSb.append("\"tag\": \"div\","); + contentSb.append("\"text\": {"); + contentSb.append("\"content\": \"" + feishuMsgVo.getContent() + "\"\n,"); + contentSb.append("\"tag\": \"lark_md\""); + contentSb.append("}"); + contentSb.append("},"); + }; + if(ObjectUtils.isNotEmpty(serialNumberAddList)){ + int count = 1; + contentSb.append("{"); + contentSb.append("\"tag\": \"div\","); + contentSb.append("\"text\": {"); + contentSb.append("\"content\": \"" + count + ". 新增文档: " + StringUtils.join(serialNumberAddList,",") + "\"\n,"); + contentSb.append("\"tag\": \"lark_md\""); + contentSb.append("}"); + contentSb.append("},"); + } + if(ObjectUtils.isNotEmpty(serialNumberDeleteList)){ + int count = 2; + contentSb.append("{"); + contentSb.append("\"tag\": \"div\","); + contentSb.append("\"text\": {"); + contentSb.append("\"content\": \"" + count + ". 删除文档: " + StringUtils.join(serialNumberDeleteList,",") + "\"\n,"); + contentSb.append("\"tag\": \"lark_md\""); + contentSb.append("}"); + contentSb.append("},"); + } + contentSb.append("{\"tag\": \"hr\"},"); + + //内容英文 + if (StrUtil.isNotEmpty(feishuMsgVo.getContentEn())){ + contentSb.append("{"); + contentSb.append("\"tag\": \"div\","); + contentSb.append("\"text\": {"); + contentSb.append("\"content\": \"" + feishuMsgVo.getContentEn() + "\"\n,"); + contentSb.append("\"tag\": \"lark_md\""); + contentSb.append("}"); + contentSb.append("},"); + }; + + if (ObjectUtils.isNotEmpty(serialNumberAddList)) { + int count = 1; + contentSb.append("{"); + contentSb.append("\"tag\": \"div\","); + contentSb.append("\"text\": {"); + contentSb.append("\"content\": \"" + count + ". New regulations: " + StringUtils.join(serialNumberAddList,",") + "\"\n,"); + contentSb.append("\"tag\": \"lark_md\""); + contentSb.append("}"); + contentSb.append("},"); + } + if (ObjectUtils.isNotEmpty(serialNumberDeleteList)) { + int count = 2; + contentSb.append("{"); + contentSb.append("\"tag\": \"div\","); + contentSb.append("\"text\": {"); + contentSb.append("\"content\": \"" + count + ". Remove regulations: " + StringUtils.join(serialNumberDeleteList,",") + "\"\n,"); + contentSb.append("\"tag\": \"lark_md\""); + contentSb.append("}"); + contentSb.append("},"); + } + + contentSb.append("{"); + contentSb.append("\"actions\": ["); + contentSb.append("{"); + contentSb.append("\"tag\": \"button\","); + contentSb.append("\"text\": {"); + contentSb.append("\"content\": \"view\","); + contentSb.append("\"tag\": \"plain_text\""); + contentSb.append("},"); + contentSb.append("\"type\": \"primary\","); + contentSb.append("\"url\": \" "+ feishuMsgVo.getUrl() +" \""); + contentSb.append("}"); + contentSb.append("],"); + contentSb.append("\"tag\": \"action\""); + contentSb.append("}"); + contentSb.append("],"); + + + + contentSb.append("\"header\": {"); + contentSb.append("\"template\": \"green\","); + contentSb.append("\"title\": {"); + contentSb.append("\"content\": \" " + feishuMsgVo.getTitle() + " \","); + contentSb.append("\"tag\": \"plain_text\""); + contentSb.append("}"); + contentSb.append("}"); + contentSb.append("}"); + + JSONObject jsonObject = JSONObject.parseObject(contentSb.toString()); + + // 设置请求参数 + JSONObject paramsMap = new JSONObject(); + paramsMap.put("user_ids", userIds); + paramsMap.put("msg_type", "interactive"); + paramsMap.put("card", jsonObject); + + // 发送请求给飞书 + String response = HttpRequestUtil.getResponseOfPOST(batchSendMessageUrl, headerMap, paramsMap.toJSONString()); + // 获取返回结果 + JSONObject tokenJson = JSONObject.parseObject(response); + if(!tokenJson.get("code").toString().equals("0")) { + log.error("请求出现异常:" + tokenJson.get("msg") + " " + tokenJson); + } + return tokenJson.get("msg").toString(); + } + + @NotNull + private JSONObject getJsonObject(JSONObject jsonObject, String content) { + String contentReplaceAll = content.replaceAll("<", "\""); + + JSONObject jsonObject1 = JSONObject.parseObject( + JSONObject.parseObject( + JSONArray.parseArray(jsonObject.get("elements").toString()).get(0).toString()) + .get("text").toString()); + jsonObject1.put("content",contentReplaceAll); + + + JSONObject elementOne = + JSONObject.parseObject(JSONArray.parseArray(jsonObject.get("elements").toString()).get(0).toString()); + + elementOne.put("text",jsonObject1); + return elementOne; + } + /** * 翻译文本 * 参数: @@ -674,4 +1019,86 @@ public class FeishuServiceImpl implements IFeishuService { } } + /** + * 发送消息 + * @param thirdIds + * @param feishuMsgVo + */ + @Override + public void sendCard(String[] thirdIds, FeishuMsg2Vo feishuMsgVo) throws IOException { + String token = getTenantAccessToken(); + // 设置请求头 + Map headerMap = new HashMap<>(); + headerMap.put("Authorization", "Bearer " + token); + headerMap.put("Content-Type", "application/json; charset=utf-8"); + + + String sendJson = "{\n" + + " \"config\": {\n" + + " \"wide_screen_mode\": true\n" + + " },\n" + + " \"elements\": [\n" + + " {\n" + + " \"tag\": \"markdown\",\n" + + " \"content\": \"" + feishuMsgVo.getCnContentUpper() + "\"\n" + + " },\n" + + " {\n" + + " \"tag\": \"markdown\",\n" + + " \"content\": \"" + feishuMsgVo.getCnContentLower() + "\"\n" + + " },\n" + + " {\n" + + " \"tag\": \"hr\"\n" + + " },\n" + + " {\n" + + " \"tag\": \"markdown\",\n" + + " \"content\": \"" + feishuMsgVo.getEnContentUpper() + "\"\n" + + " },\n" + + " {\n" + + " \"tag\": \"markdown\",\n" + + " \"content\": \"" + feishuMsgVo.getEnContentLower() + "\"\n" + + " },\n" + + " {\n" + + " \"actions\": [\n" + + " {\n" + + " \"tag\": \"button\",\n" + + " \"text\": {\n" + + " \"content\": \"View\",\n" + + " \"tag\": \"plain_text\"\n" + + " },\n" + + " \"type\": \"primary\",\n" + + " \"url\": \"" + feishuMsgVo.getUrl() + "\"\n" + + " }\n" + + " ],\n" + + " \"tag\": \"action\"\n" + + " }\n" + + " ],\n" + + " \"header\": {\n" + + " \"template\": \"" + feishuMsgVo.getColor() + "\",\n" + + " \"title\": {\n" + + " \"content\": \"" + feishuMsgVo.getTitle() + "\",\n" + + " \"tag\": \"plain_text\"\n" + + " }\n" + + " }\n" + + "}"; + + JSONObject jsonObject = JSONObject.parseObject(sendJson.toString()); + + // 设置请求参数 + JSONObject paramsMap = new JSONObject(); + + paramsMap.put("user_ids", thirdIds); + + paramsMap.put("msg_type", "interactive"); + paramsMap.put("card", jsonObject); + + // 发送请求给飞书 + String response = HttpRequestUtil.getResponseOfPOST(batchSendMessageUrl, headerMap, paramsMap.toJSONString()); + // 获取返回结果 + JSONObject tokenJson = JSONObject.parseObject(response); + if (!tokenJson.get("code").toString().equals("0")) { + log.error("请求出现异常:" + tokenJson.get("msg") + " " + tokenJson); + } + + } + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/vo/FeishuMsg2Vo.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/vo/FeishuMsg2Vo.java new file mode 100644 index 000000000..11d701482 --- /dev/null +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/vo/FeishuMsg2Vo.java @@ -0,0 +1,20 @@ +package com.jero.modules.feishu.vo; + +import lombok.Data; + +@Data +public class FeishuMsg2Vo { + + private String title; //标题 + + private String color; //颜色 + + private String enContentUpper; //英文内容上部 + private String enContentLower; //英文内容下部 + + private String cnContentUpper; //中文内容上部 + private String cnContentLower; //中文内容下部 + + private String url; //回调的网址 + +} diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/vo/FeishuMsgVo.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/vo/FeishuMsgVo.java index 0aee3596c..3544db025 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/vo/FeishuMsgVo.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/feishu/vo/FeishuMsgVo.java @@ -12,6 +12,8 @@ public class FeishuMsgVo { private String content; //内容 + private String contentEn; //内容英文 + private String taskType; //任务类型 private String regulationNo; //法规编号 @@ -26,5 +28,14 @@ public class FeishuMsgVo { private String assignee; //评估人 适用范围:责任人提交通知发起人(设计符合性,pre-homo符合性,验证符合性) + private String RegulationNo; //编号 + + private String documentTitle; //文档标题 + + private String NewTypeExecutionDate; //新车型实施日期 + + private String NewVehicleExecutionDate; //在产车实施日期 + + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/job/LawsTechnologyEvaluationRemindJob.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/job/LawsTechnologyEvaluationRemindJob.java index 66cc0531d..e2cdfab4b 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/job/LawsTechnologyEvaluationRemindJob.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/job/LawsTechnologyEvaluationRemindJob.java @@ -2,6 +2,7 @@ package com.jero.modules.lawsTechnologyEvaluation.job; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.jero.common.exception.JeroBootException; import com.jero.modules.lawsOpinionGather.enums.GatherResultEnum; import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO; import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationFlowDetailEO; @@ -52,14 +53,16 @@ public class LawsTechnologyEvaluationRemindJob implements Job { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); //获取后一天的时间 - Calendar calendar=new GregorianCalendar(); - calendar.setTime(new Date()); - calendar.add(Calendar.DATE,1); - Date nextDay = calendar.getTime(); + //Calendar calendar=new GregorianCalendar(); + //calendar.setTime(new Date()); + //calendar.add(Calendar.DATE,1); + //Date nextDay = calendar.getTime(); - String nextDayStr = sdf.format(nextDay); + //String nextDayStr = sdf.format(nextDay); + + String now = sdf.format(new Date()); LawsTechnologyEvaluationEOList.forEach(lawsTechnologyEvaluationEO -> { - if(StringUtils.equals(nextDayStr,sdf.format(lawsTechnologyEvaluationEO.getEndTime()))){ + /*if(StringUtils.equals(nextDayStr,sdf.format(lawsTechnologyEvaluationEO.getEndTime()))){ String actiProcInstIds = flowDetailList.stream().filter(flowDetail -> { boolean flag = false; @@ -80,6 +83,56 @@ public class LawsTechnologyEvaluationRemindJob implements Job { this.lawsTechnologyEvaluationEOService.workFlowSendMsg(sendJsonObject); } } + }*/ + String endTime = sdf.format(lawsTechnologyEvaluationEO.getEndTime()); + int days = 0; + try { + days = (int) (sdf.parse(endTime).getTime() - sdf.parse(now).getTime()) / (24 * 60 * 60 * 1000); + } catch (Exception e) { + e.printStackTrace(); + throw new JeroBootException("日期转换错误"); + } + + if (days == 3) { + //到期前3天 + String actiProcInstIds = flowDetailList.stream().filter(flowDetail -> { + boolean flag = false; + if (StringUtils.equals(lawsTechnologyEvaluationEO.getId(), flowDetail.getLawsTechnologyEvaluationId())) { + flag = true; + } + return flag; + }).map(LawsTechnologyEvaluationFlowDetailEO::getActiProcInstId).distinct().collect(Collectors.joining(",")); + + if(StringUtils.isNotEmpty(actiProcInstIds)){ + List userIdList = this.workFlowFeignClient.getTaskAssigneeListByPrcIds(actiProcInstIds); + if(CollectionUtils.isNotEmpty(userIdList)){ + JSONObject sendJsonObject = new JSONObject(); + sendJsonObject.put("msgType", MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_EXPIRE_REMIND_THREE_DAYS_BEFORE_MSG.getValue()); + sendJsonObject.put("lawsTechnologyEvaluationId",lawsTechnologyEvaluationEO.getId()); + sendJsonObject.put("userIdList",userIdList); + this.lawsTechnologyEvaluationEOService.workFlowSendMsg(sendJsonObject); + } + } + } else if (endTime.equals(now)){ + //当天 + String actiProcInstIds = flowDetailList.stream().filter(flowDetail -> { + boolean flag = false; + if (StringUtils.equals(lawsTechnologyEvaluationEO.getId(), flowDetail.getLawsTechnologyEvaluationId())) { + flag = true; + } + return flag; + }).map(LawsTechnologyEvaluationFlowDetailEO::getActiProcInstId).distinct().collect(Collectors.joining(",")); + + if(StringUtils.isNotEmpty(actiProcInstIds)){ + List userIdList = this.workFlowFeignClient.getTaskAssigneeListByPrcIds(actiProcInstIds); + if(CollectionUtils.isNotEmpty(userIdList)){ + JSONObject sendJsonObject = new JSONObject(); + sendJsonObject.put("msgType", MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_EXPIRE_REMIND_TODAY_MSG.getValue()); + sendJsonObject.put("lawsTechnologyEvaluationId",lawsTechnologyEvaluationEO.getId()); + sendJsonObject.put("userIdList",userIdList); + this.lawsTechnologyEvaluationEOService.workFlowSendMsg(sendJsonObject); + } + } } }); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/mapper/LawsTechnologyEvaluationFlowDetailEOMapper.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/mapper/LawsTechnologyEvaluationFlowDetailEOMapper.java index da6be153c..f2c103e1f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/mapper/LawsTechnologyEvaluationFlowDetailEOMapper.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/mapper/LawsTechnologyEvaluationFlowDetailEOMapper.java @@ -14,4 +14,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; */ public interface LawsTechnologyEvaluationFlowDetailEOMapper extends BaseMapper { + LawsTechnologyEvaluationFlowDetailEO queryByEvaluationId(@Param("lawsTechnologyEvaluationId") String lawsTechnologyEvaluationId); + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/mapper/xml/LawsTechnologyEvaluationFlowDetailEOMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/mapper/xml/LawsTechnologyEvaluationFlowDetailEOMapper.xml index 72cc2a9f6..c1fdf969b 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/mapper/xml/LawsTechnologyEvaluationFlowDetailEOMapper.xml +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/mapper/xml/LawsTechnologyEvaluationFlowDetailEOMapper.xml @@ -14,4 +14,11 @@ - \ No newline at end of file + + + + diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationEOServiceImpl.java index 66b04a4b5..d9c254103 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsTechnologyEvaluation/service/impl/LawsTechnologyEvaluationEOServiceImpl.java @@ -6,9 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.jero.common.api.vo.Result; -import com.jero.common.constant.enums.CutEnum; -import com.jero.common.constant.enums.MessageTypeEnum; -import com.jero.common.constant.enums.ModuleEnum; +import com.jero.common.constant.enums.*; import com.jero.common.exception.JeroBootException; import com.jero.common.system.vo.LoginUser; import com.jero.generater.modules.online.cgform.entity.OnlCgformField; @@ -16,10 +14,13 @@ import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServi import com.jero.modules.document.enums.FieldTypeEnum; import com.jero.modules.document.mapper.BussDocumentLibraryEOMapper; import com.jero.modules.document.service.impl.BussDocumentLibraryEOServiceImpl; +import com.jero.modules.feishu.service.IFeishuService; +import com.jero.modules.feishu.vo.FeishuMsg2Vo; import com.jero.modules.lawsOpinionGather.enums.GatherResultEnum; import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO; import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationFlowDetailEO; import com.jero.modules.lawsTechnologyEvaluation.mapper.LawsTechnologyEvaluationEOMapper; +import com.jero.modules.lawsTechnologyEvaluation.mapper.LawsTechnologyEvaluationFlowDetailEOMapper; import com.jero.modules.lawsTechnologyEvaluation.service.*; import com.jero.modules.project.enums.JumpLinkEnum; import com.jero.modules.project.enums.MsgTypeEnum; @@ -41,6 +42,7 @@ import com.jero.modules.wkflow.enums.FlowTypeEnum; import com.jero.modules.wkflow.feginClient.WorkFlowFeignClient; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; @@ -52,7 +54,9 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import java.io.File; +import java.io.IOException; import java.io.OutputStream; +import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -105,6 +109,11 @@ public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl userIdList = new ArrayList<>(); - String msgContentEN = ""; - String msgTitle = ""; + //String msgContentEN = ""; + //String msgTitle = ""; String initiator = ""; + String lawsTechnologyEvaluationId = jsonObject.getString("lawsTechnologyEvaluationId"); + LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO = queryById(lawsTechnologyEvaluationId); + LawsTechnologyEvaluationFlowDetailEO flowDetailEO = flowDetailEOMapper.queryByEvaluationId(lawsTechnologyEvaluationId); + String number = flowDetailEO.getPrcNum(); + String name = flowDetailEO.getPrcName(); + String endTime = new SimpleDateFormat("yyyy-MM-dd").format(lawsTechnologyEvaluationEO.getEndTime()); + + String title = MessageType2Enum.REGULATION_TECHNICAL_ASSESSMENT.getCn() + "/" + MessageType2Enum.REGULATION_TECHNICAL_ASSESSMENT.getEn(); + String cnContentUpper = ""; + String cnContentLower = ""; + String enContentUpper = ""; + String enContentLower = ""; if(StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_START_MSG.getValue())){ userIdList.add(jsonObject.getString("evaluationId")); - String endTime = jsonObject.getString("endTime"); //截止日期 + //String endTime = jsonObject.getString("endTime"); //截止日期 //您收到GB 7258 的法规技术评估流程任务,请及时查看处理。 - msgContentEN = "You recieved the Regulatory and technical assessment of "+serialNumber+" . The due date is "+endTime+". Please check and address it in a timely manner."; - msgTitle = "You have a Regulatory and technical assessment task to complete"; + //msgContentEN = "You recieved the Regulatory and technical assessment of "+serialNumber+" . The due date is "+endTime+". Please check and address it in a timely manner."; + //msgTitle = "You have a Regulatory and technical assessment task to complete"; String currentUserId = jsonObject.getString("currentUserId"); //当前操作用户id SysUser currentUser = sysUserService.getBaseMapper().selectOne(new QueryWrapper().lambda().eq(SysUser::getId, currentUserId)); initiator = currentUser.getUsername(); + cnContentUpper = "您好,请及时查看处理此项任务,谢谢!"; + cnContentLower = "编号:" + number + + "\n标题: " + name + + "\n发起人: " + initiator + + "\n截止时间: " + endTime; + enContentUpper = "Hello! Please check and address the task in a timely manner. Thank you!"; + enContentLower = "Regulation No :" + number + + "\nTitle: " + name + + "\nInitiator: " + initiator + + "\nDue Date: " + endTime; }else if(StringUtils.equals(msgType,MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_ENALUATOR_SUBMIT_MSG.getValue())){ String currentUserId = jsonObject.getString("currentUserId"); //当前操作用户id SysUser currentUser = this.sysUserService.getBaseMapper().selectOne(new QueryWrapper().lambda().eq(SysUser::getId, currentUserId)); userIdList.add(jsonObject.getString("initiatorUserId")); //XXX(人员账号)已提交GB 7258 的法规意见收集流程,请及时查看审核。 - msgContentEN = currentUser.getUsername() + " has submitted the collection process of Regulatory and technical assessment of "+serialNumber+", Please check and address it in time."; - msgTitle = "You have a Regulatory and technical assessment task to complete"; + //msgContentEN = currentUser.getUsername() + " has submitted the collection process of Regulatory and technical assessment of "+serialNumber+", Please check and address it in time."; + //msgTitle = "You have a Regulatory and technical assessment task to complete"; initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); + cnContentUpper = "您好,"+ currentUser.getUsername() +"已提交评估结果,请审核"; + cnContentLower = "编号:" + number + + "\n标题: " + name + + "\n发起人: " + initiator + + "\n截止时间: " + endTime; + enContentUpper = "Hello! "+ currentUser.getUsername() +" has submitted the assessment result. Please review it"; + enContentLower = "Regulation No :" + number + + "\nTitle: " + name + + "\nInitiator: " + initiator + + "\nDue Date: " + endTime; }else if(StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_AUDIT_ACCEPTED_MSG.getValue())){ userIdList.add(jsonObject.getString("evaluationId")); //您提交的GB 7258 的法规技术评估流程已通过。 - msgContentEN = "The regulatory and technical assessment process for "+serialNumber+" you submitted has passed."; - msgTitle = "You have a Regulatory and technical assessment task completed"; + //msgContentEN = "The regulatory and technical assessment process for "+serialNumber+" you submitted has passed."; + //msgTitle = "You have a Regulatory and technical assessment task completed"; initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); + cnContentUpper = "您好,您提交的评估结果已通过"; + cnContentLower = "编号:" + number + + "\n标题: " + name + + "\n发起人: " + initiator + + "\n截止时间: " + endTime; + enContentUpper = "Hello! The assessment result you submitted has passed"; + enContentLower = "Regulation No :" + number + + "\nTitle: " + name + + "\nInitiator: " + initiator + + "\nDue Date: " + endTime; }else if(StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_AUDIT_REJECTED_MSG.getValue())){ userIdList.add(jsonObject.getString("evaluationId")); //您提交的GB 7258 的法规技术评估流程已被退回,请及时查看处理。 - msgContentEN = "The regulatory and technical assessment process of "+serialNumber+" you submitted has been returned, Please check and address it in time."; - msgTitle = "You have a Regulatory and technical assessment task to complete"; + //msgContentEN = "The regulatory and technical assessment process of "+serialNumber+" you submitted has been returned, Please check and address it in time."; + //msgTitle = "You have a Regulatory and technical assessment task to complete"; initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); - }else if(StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_EXPIRE_REMIND_MSG.getValue())){ + cnContentUpper = "您好,您提交的评估结果被退回,请及时查看处理"; + cnContentLower = "编号:" + number + + "\n标题: " + name + + "\n发起人: " + initiator + + "\n截止时间: " + endTime; + enContentUpper = "Hello! The assessment result you submitted has been rejected. Please check and address it in a timely manner"; + enContentLower = "Regulation No :" + number + + "\nTitle: " + name + + "\nInitiator: " + initiator + + "\nDue Date: " + endTime; + } else if (StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_EXPIRE_REMIND_THREE_DAYS_BEFORE_MSG.getValue())) { + initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); + cnContentUpper = "您好,该任务将于3天后到期,请及时查看处理,谢谢!"; + cnContentLower = "编号:" + number + + "\n标题: " + name + + "\n发起人: " + initiator; + enContentUpper = "Hello! This task will expire in 3 days. Please check and address the task in a timely manner. Thank you!"; + enContentLower = "Regulation No :" + number + + "\nTitle: " + name + + "\nInitiator: " + initiator; + userIdList = (List) jsonObject.get("userIdList"); + + } else if (StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_EXPIRE_REMIND_TODAY_MSG.getValue())) { + initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); + cnContentUpper = "您好,该任务将于今天到期,请尽快查看处理,谢谢!"; + cnContentLower = "编号:" + number + + "\n标题: " + name + + "\n发起人: " + initiator; + enContentUpper = "Hello! This task will expire today. Please check and address the task ASAP. Thank you!"; + enContentLower = "Regulation No :" + number + + "\nTitle: " + name + + "\nInitiator: " + initiator; + userIdList = (List) jsonObject.get("userIdList"); + + } /*else if (StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_EXPIRE_REMIND_MSG.getValue())) { userIdList = (List) jsonObject.get("userIdList"); //您GB 7258的法规技术评估流程将于明天结束,请及时查看处理 - msgContentEN = "The the Regulatory and technical assessment of "+serialNumber+" will expire tomorrow. Please check and address it in time."; - msgTitle = "You have a Regulatory and technical assessment task to complete"; + //msgContentEN = "The the Regulatory and technical assessment of "+serialNumber+" will expire tomorrow. Please check and address it in time."; + //msgTitle = "You have a Regulatory and technical assessment task to complete"; initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(); - } + } */ + List thirdIdList = new ArrayList<>(); + List sysUsers = sysUserService.listByIds(userIdList); + if (ObjectUtils.isNotEmpty(sysUsers)) { + thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); + } //飞书跳转链接 String hrefFeishu = backUrl + JumpLinkEnum.TASK_AFFIRM_LINK.getLink(); + try { + FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo(); + feishuMsgVo.setTitle(title); + 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; + //String href = "" + " View details" + ""; + //String contentInfo = msgContentEN + " " + href; - Map sendMessageMap = new HashMap<>(); - sendMessageMap.put("hrefFeishu",hrefFeishu); - sendMessageMap.put("contentInfo",contentInfo); + //Map sendMessageMap = new HashMap<>(); + //sendMessageMap.put("hrefFeishu",hrefFeishu); + //sendMessageMap.put("contentInfo",contentInfo); - SendMessageUtils.sendMessage(msgTitle,msgContentEN,userIdList,lawsTechnologyEvaluationId,sendMessageMap,null, MessageTypeEnum.REGULATORY_AND_TECHNICAL_ASSESSMENT,initiator); + //SendMessageUtils.sendMessage(msgTitle,msgContentEN,userIdList,lawsTechnologyEvaluationId,sendMessageMap,null, MessageTypeEnum.REGULATORY_AND_TECHNICAL_ASSESSMENT,initiator); } @Override diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java index 9ab7619ea..79bbdb54d 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/problemKnowledgeBase/service/impl/ProblemKnowledgeBaseEOServiceImpl.java @@ -18,6 +18,7 @@ import com.jero.modules.document.enums.SearchEnum; import com.jero.modules.document.utils.ReadPdfUtil; import com.jero.modules.document.utils.ReadWordUtil; import com.jero.modules.feishu.service.IFeishuService; +import com.jero.modules.feishu.vo.FeishuMsgVo; import com.jero.modules.message.websocket.WebSocket; import com.jero.modules.oss.entity.OSSFile; import com.jero.modules.oss.service.IOSSFileService; @@ -886,7 +887,20 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl @@ -110,6 +110,11 @@ // clearInterval(this.timer) // }, methods: { + getText(str) { + let words = str.replace(/<[^<>]+>/g, '').replace(/ /gi, '') //这里是去除标签 + //.replace(/\s/g, '') //这里是去除空格 + return words + }, loadData() { getAction(this.url.listCementByUser).then((res) => { if (res.success) { @@ -134,9 +139,12 @@ showAnnouncement(record) { getAction(this.url.readAllMsg, { ids: record.id }).then((res) => { }) + localStorage.setItem('msgContent', record.msgContent) this.$router.push({ - path: '/system/MessageDetails', - query: record + path: '/isps/userAnnouncement', + query: { + Date: Date.now() + } }) }, toMyAnnouncement() { diff --git a/jero-web/src/views/dashboard/components/myNews.vue b/jero-web/src/views/dashboard/components/myNews.vue index f1d76361c..719748291 100644 --- a/jero-web/src/views/dashboard/components/myNews.vue +++ b/jero-web/src/views/dashboard/components/myNews.vue @@ -11,8 +11,8 @@
-
- {{item.titile}} +
+ {{item.msgContent}}
{{item.sendTime}} @@ -69,9 +69,12 @@ magClick(row) { getAction(this.url.readAllMsg, { ids: row.id }).then((res) => { }) + localStorage.setItem('msgContent', row.msgContent) this.$router.push({ - path: '/system/MessageDetails', - query: row + path: '/isps/userAnnouncement', + query: { + Date: Date.now() + } }) }, moreClick() { diff --git a/jero-web/src/views/system/UserAnnouncementList.vue b/jero-web/src/views/system/UserAnnouncementList.vue index cd35b34c8..fbb96c3d5 100644 --- a/jero-web/src/views/system/UserAnnouncementList.vue +++ b/jero-web/src/views/system/UserAnnouncementList.vue @@ -6,12 +6,12 @@
-
- {{this.$t('MessageTitle')}} +
+ {{this.$t('MessageContent')}}
+ :placeholder="$t('pleaseEnter')+$t('MessageContent')" + v-model="queryParam.msgContent">
@@ -63,18 +63,28 @@ :dataSource="dataSource" :scroll="{x: '100%'}" :pagination="ipagination" + :expandIconAsCell='false' + :expandIconColumnIndex="5" + :expandIcon="expandIcon" :loading="loading" + @expand="expandChange" @change="handleTableChange"> - + + {{text}} - + + {{msgCategoryQuery[text]}} - + +

+ + +

@@ -104,8 +114,8 @@ msgCategoryQuery: { '1': this.$t('SubscriptionNotification'), '2': this.$t('warningInformation'), - '3': this.$t('ForwardPush'), - '4': this.$t('CollectinguthenticationParameters'), + '3': this.$t('ForwardPush') + // '4': this.$t('CollectinguthenticationParameters'), // '6':this.$t('RegulationListConfirmationTask'), // '7':this.$t('RegulationListConfirmationNotification'), // '8':this.$t('RegulationTaskConfirmation'), @@ -115,39 +125,48 @@ // '12':this.$t('DesignComplianceNotification'), // '13':this.$t('PreHomoNotification'), // '14':this.$t('ValidationComplianceNotification'), - '15':this.$t('RegulationTaskConfirmationNotification'), - '17':this.$t('listConfirmation'), - '18':this.$t('taskAffirm'), - '19':this.$t('complianceConfirmation'), - '20':this.$t('collectionLegislativeComments'), - '21':this.$t('regulatoryAndTechnicalAssessment'), + // '15':this.$t('RegulationTaskConfirmationNotification'), + // '17':this.$t('listConfirmation'), + // '18':this.$t('taskAffirm'), + // '19':this.$t('complianceConfirmation'), + // '20':this.$t('collectionLegislativeComments'), + // '21':this.$t('regulatoryAndTechnicalAssessment'), }, columns: [ { - title: this.$t('MessageTitle'), - align: 'center', - dataIndex: 'titile', + title: this.$t('MessageContent'), + align: 'left', + dataIndex: 'msgContent', ellipsis: true, scopedSlots: { customRender: 'msgTitile' } }, { title: this.$t('Sponsor'), - align: 'center', + align: 'left', + ellipsis: true, dataIndex: 'initiator', - width: 200, + width: 200 }, { title: this.$t('MessageType'), - align: 'center', + align: 'left', + ellipsis: true, dataIndex: 'msgCategory', width: 200, scopedSlots: { customRender: 'msgCategory' } }, { title: this.$t('NotificationTime'), - align: 'center', + align: 'left', + ellipsis: true, width: 200, dataIndex: 'sendTime' + }, + { + title:'', + align: 'left', + ellipsis: true, + width: 50, } ], url: { @@ -161,7 +180,42 @@ formData: '' } }, + watch: { + $route: function(res) { + console.log(res) + this.loadData() + } + }, methods: { + expandIcon(props) { + if (props.expanded) { + return { + props.onExpand(props.record, e); + }}/>; + } else { + return { + props.onExpand(props.record, e); + }}/>; + } + }, + getQueryParams() { + //获取查询条件 + let sqp = {} + if (this.superQueryParams) { + sqp['superQueryParams'] = encodeURI(this.superQueryParams) + sqp['superQueryMatchType'] = this.superQueryMatchType + } + if (localStorage.getItem('msgContent')) { + this.queryParam.msgContent = localStorage.getItem('msgContent') + this.queryParam = { ...this.queryParam } + localStorage.removeItem('msgContent') + } + var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters) + param.field = this.getQueryField() + param.pageNo = this.ipagination.current + param.pageSize = this.ipagination.pageSize + return filterObj(param) + }, showAnnouncement(record) { putAction(this.url.editCementSend, { anntId: record.anntId }).then((res) => { if (res.success) { @@ -177,6 +231,13 @@ this.$refs.ShowAnnouncement.detail(record) } }, + expandChange(isTrue, val) { + if (isTrue) { + if (val.readFlag == '0') { + this.msgContentClick(val) + } + } + }, readAll() { var that = this if (this.selectedRowKeys.length > 0) { @@ -204,11 +265,12 @@ }, msgContentClick(row) { getAction(this.url.readAllMsg, { ids: row.id }).then((res) => { + // this.loadData() }) - this.$router.push({ - path: '/system/MessageDetails', - query: row - }) + // this.$router.push({ + // path: '/system/MessageDetails', + // query: row + // }) }, handleDel() { var that = this @@ -297,6 +359,9 @@ height: 38px; /*margin-top: 2px;*/ } + ::v-deep .ant-table .ant-table-row-indent + .ant-table-row-expand-icon{ + margin-right: 0; + }