Merge remote-tracking branch 'origin/fix_bug_first_stage' into fix_bug_first_stage

This commit is contained in:
wangzhijiang
2022-07-01 14:02:58 +08:00
35 changed files with 653 additions and 148 deletions
@@ -6,10 +6,11 @@ package com.jero.common.constant.enums;
* @auth zhn * @auth zhn
*/ */
public enum MessageTypeEnum { public enum MessageTypeEnum {
READ("订阅通知","1"), READ("Subscription Notification","1"),
WARN("预警信息","2"), WARN("Early Warning","2"),
PUSH("转发推送","3"), PUSH("Share / Forward","3"),
COLLECT("认证消息","4"); HOMO_TASK("Homo Parameter Task","4"),
TASK("Regulation Compliance Task", "5");
String name; String name;
String value; String value;
@@ -486,6 +486,9 @@ public class QueryGenerator {
} }
name = oConvertUtils.camelToUnderline(name); name = oConvertUtils.camelToUnderline(name);
log.info("--查询规则-->"+name+" "+rule.getValue()+" "+value); log.info("--查询规则-->"+name+" "+rule.getValue()+" "+value);
if(" is null ".equals(value)){
queryWrapper.isNull(name);
}else{
switch (rule) { switch (rule) {
case GT: case GT:
queryWrapper.gt(name, value); queryWrapper.gt(name, value);
@@ -534,6 +537,8 @@ public class QueryGenerator {
break; break;
} }
} }
}
/** /**
* *
* @param name * @param name
@@ -1061,7 +1061,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
sysAnnouncement.setDelFlag("0"); sysAnnouncement.setDelFlag("0");
sysAnnouncement.setSendStatus("0"); sysAnnouncement.setSendStatus("0");
sysAnnouncement.setSendTime(new Date()); sysAnnouncement.setSendTime(new Date());
sysAnnouncement.setMsgCategory(MessageTypeEnum.COLLECT.getValue());//消息类型 sysAnnouncement.setMsgCategory(MessageTypeEnum.HOMO_TASK.getValue());//消息类型
sysAnnouncement.setMsgType(CommonConstant.MSG_TYPE_UESR);//指定用户 sysAnnouncement.setMsgType(CommonConstant.MSG_TYPE_UESR);//指定用户
sysAnnouncement.setMsgContent(content); sysAnnouncement.setMsgContent(content);
sysAnnouncement.setMsgContentInfo(contentInfo); sysAnnouncement.setMsgContentInfo(contentInfo);
@@ -1070,7 +1070,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
// 发送飞书消息 // 发送飞书消息
try { try {
feishuService.batchSendMessage(thirdIds, content, MessageTypeEnum.COLLECT.getName(), hrefFeishu); feishuService.batchSendMessage(thirdIds, content, MessageTypeEnum.HOMO_TASK.getName(), hrefFeishu);
} catch (IOException e) { } catch (IOException e) {
log.error("飞书消息推送失败"); log.error("飞书消息推送失败");
} }
@@ -1126,7 +1126,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
sysAnnouncement.setDelFlag("0"); sysAnnouncement.setDelFlag("0");
sysAnnouncement.setSendStatus("0"); sysAnnouncement.setSendStatus("0");
sysAnnouncement.setSendTime(new Date()); sysAnnouncement.setSendTime(new Date());
sysAnnouncement.setMsgCategory(MessageTypeEnum.COLLECT.getValue());//消息类型 sysAnnouncement.setMsgCategory(MessageTypeEnum.HOMO_TASK.getValue());//消息类型
sysAnnouncement.setMsgType(CommonConstant.MSG_TYPE_UESR);//指定用户 sysAnnouncement.setMsgType(CommonConstant.MSG_TYPE_UESR);//指定用户
sysAnnouncement.setMsgContent(content); sysAnnouncement.setMsgContent(content);
sysAnnouncement.setMsgContentInfo(contentInfo); sysAnnouncement.setMsgContentInfo(contentInfo);
@@ -1135,7 +1135,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
// 发送飞书消息 // 发送飞书消息
try { try {
feishuService.batchSendMessage(thirdIds, content, MessageTypeEnum.COLLECT.getName(), hrefFeishu); feishuService.batchSendMessage(thirdIds, content, MessageTypeEnum.HOMO_TASK.getName(), hrefFeishu);
} catch (IOException e) { } catch (IOException e) {
log.error("飞书消息推送失败"); log.error("飞书消息推送失败");
} }
@@ -1,5 +1,7 @@
package com.jero.modules.feishu.service; package com.jero.modules.feishu.service;
import com.jero.modules.feishu.vo.FeishuMsgVo;
import java.io.IOException; import java.io.IOException;
/** /**
@@ -26,4 +28,11 @@ public interface IFeishuService {
* @throws IOException * @throws IOException
*/ */
String batchSendMessage(String[] userIds, String message, String title, String backUrl) throws IOException; String batchSendMessage(String[] userIds, String message, String title, String backUrl) throws IOException;
/**
* 发送卡片消息
* @param feishuMsgVo
* @return
*/
String sendCardMsg(String[] userIds, FeishuMsgVo feishuMsgVo) throws IOException;
} }
@@ -1,8 +1,11 @@
package com.jero.modules.feishu.service.impl; package com.jero.modules.feishu.service.impl;
import cn.hutool.core.util.StrUtil;
import com.alibaba.druid.support.json.JSONUtils;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.jero.modules.feishu.service.IFeishuService; import com.jero.modules.feishu.service.IFeishuService;
import com.jero.modules.feishu.vo.FeishuMsgVo;
import com.jero.modules.system.util.HttpRequestUtil; import com.jero.modules.system.util.HttpRequestUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@@ -111,4 +114,128 @@ public class FeishuServiceImpl implements IFeishuService {
} }
return tokenJson.get("msg").toString(); return tokenJson.get("msg").toString();
} }
/**
* 发送卡片消息
* @param feishuMsgVo
* @return
*/
public String sendCardMsg(String[] userIds, FeishuMsgVo feishuMsgVo) throws IOException {
String token = getTenantAccessToken();
// 设置请求头
Map<String, String> 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("},");
};
// 补充tasktype、project、Initiator等的外层
contentSb.append("{");
contentSb.append("\"fields\": [");
contentSb.append("{");
contentSb.append("\"is_short\": false,");
contentSb.append("\"text\": {");
contentSb.append("\"content\": \"**Task Type:** " + feishuMsgVo.getTaskType() + "\",");
contentSb.append("\"tag\": \"lark_md\"");
contentSb.append("}");
contentSb.append("}");
if (StrUtil.isNotEmpty(feishuMsgVo.getRegulationNo())){
contentSb.append(",");
contentSb.append("{");
contentSb.append("\"is_short\": false,");
contentSb.append("\"text\": {");
contentSb.append("\"content\": \"**Regulation No:** " + feishuMsgVo.getRegulationNo() + "\",");
contentSb.append("\"tag\": \"lark_md\"");
contentSb.append("}");
contentSb.append("}");
}
if (StrUtil.isNotEmpty(feishuMsgVo.getProject())){
contentSb.append(",");
contentSb.append("{");
contentSb.append("\"is_short\": false,");
contentSb.append("\"text\": {");
contentSb.append("\"content\": \"**Project:** " + feishuMsgVo.getProject() + "\",");
contentSb.append("\"tag\": \"lark_md\"");
contentSb.append("}");
contentSb.append("}");
}
if (StrUtil.isNotEmpty(feishuMsgVo.getInitiator())){
contentSb.append(",");
contentSb.append("{");
contentSb.append("\"is_short\": false,");
contentSb.append("\"text\": {");
contentSb.append("\"content\": \"**Initiator:** " + feishuMsgVo.getInitiator() + "\",");
contentSb.append("\"tag\": \"lark_md\"");
contentSb.append("}");
contentSb.append("}");
}
if (StrUtil.isNotEmpty(feishuMsgVo.getDueDate())){
contentSb.append(",");
contentSb.append("{");
contentSb.append("\"is_short\": false,");
contentSb.append("\"text\": {");
contentSb.append("\"content\": \"**Due Date:** " + feishuMsgVo.getDueDate() + "\",");
contentSb.append("\"tag\": \"lark_md\"");
contentSb.append("}");
contentSb.append("}");
}
contentSb.append("],");
contentSb.append("\"tag\": \"div\"");
contentSb.append("},");
contentSb.append("{\"tag\": \"hr\"},");
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();
}
} }
@@ -0,0 +1,28 @@
package com.jero.modules.feishu.vo;
import lombok.Data;
/**
* 飞书消息的VO
*/
@Data
public class FeishuMsgVo {
private String title; //标题
private String content; //内容
private String taskType; //任务类型
private String regulationNo; //法规编号
private String project; //项目名称
private String initiator; //发起人
private String dueDate; //截止时间
private String url; //回调的网址
}
@@ -1,6 +1,8 @@
package com.jero.modules.project.job; package com.jero.modules.project.job;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jero.common.constant.enums.MessageTypeEnum;
import com.jero.modules.feishu.vo.FeishuMsgVo;
import com.jero.modules.project.entity.ProjectLawsInventoryEO; import com.jero.modules.project.entity.ProjectLawsInventoryEO;
import com.jero.modules.project.entity.ProjectLibraryBase; import com.jero.modules.project.entity.ProjectLibraryBase;
import com.jero.modules.project.entity.ProjectNameInfoEO; import com.jero.modules.project.entity.ProjectNameInfoEO;
@@ -140,6 +142,11 @@ public class InventoryAffirmJob implements Job {
+ projectLibraryBase.getTargetMarket() + projectLibraryBase.getTargetMarket()
+ " are 3 days. Please check and handle it in time."; + " are 3 days. Please check and handle it in time.";
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setContent("Hello! The remaining processing time for the task are 3 days. Please check and address it in a timely manner.");
feishuMsgVo.setTaskType("Regulation List Confirmation");
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
//飞书跳转链接 //飞书跳转链接
String hrefFeishu = backUrl String hrefFeishu = backUrl
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink() + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink()
@@ -159,17 +166,22 @@ public class InventoryAffirmJob implements Job {
sendMessageMap.put("contentInfo",contentInfo); sendMessageMap.put("contentInfo",contentInfo);
//发送消息 //发送消息
projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLibraryBase.getId(),sendMessageMap); projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLibraryBase.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
} }
if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){ if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){
currentDaysUserIdList = currentDaysUserIdList.stream().distinct().collect(Collectors.toList()); currentDaysUserIdList = currentDaysUserIdList.stream().distinct().collect(Collectors.toList());
/*String msgContentCN = "您" + projectLibraryBase.getProjectName() + "(项目名称)法规清单的任务今天即将结束,请及时查看处理*/ /*String msgContentCN = "您" + projectLibraryBase.getProjectName() + "(项目名称)法规清单的任务今天即将结束,请及时查看处理*/
String msgContentEN = "The the regulation list confirmation for " String msgContentEN = "The regulation list confirmation for "
+ projectNameInfoEO.getProjectName() + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ " will expire today. Please check and address it in a timely manner."; + " will expire today. Please check and address it in a timely manner.";
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setContent("Hello! The task will expire today. Please check and address it in a timely manner.");
feishuMsgVo.setTaskType("Regulation List Confirmation");
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
//飞书跳转链接 //飞书跳转链接
String hrefFeishu = backUrl String hrefFeishu = backUrl
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink() + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink()
@@ -188,7 +200,7 @@ public class InventoryAffirmJob implements Job {
sendMessageMap.put("hrefFeishu",hrefFeishu); sendMessageMap.put("hrefFeishu",hrefFeishu);
sendMessageMap.put("contentInfo",contentInfo); sendMessageMap.put("contentInfo",contentInfo);
//发送消息 //发送消息
projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLibraryBase.getId(),sendMessageMap); projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLibraryBase.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
} }
} }
} }
@@ -1,9 +1,12 @@
package com.jero.modules.project.job; package com.jero.modules.project.job;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jero.common.constant.enums.MessageTypeEnum;
import com.jero.modules.feishu.vo.FeishuMsgVo;
import com.jero.modules.project.entity.*; import com.jero.modules.project.entity.*;
import com.jero.modules.project.enums.DesignComplianceStatusEnum; import com.jero.modules.project.enums.DesignComplianceStatusEnum;
import com.jero.modules.project.enums.JumpLinkEnum; import com.jero.modules.project.enums.JumpLinkEnum;
import com.jero.modules.project.enums.MsgTypeEnum;
import com.jero.modules.project.enums.SendMsgFlagEnum; import com.jero.modules.project.enums.SendMsgFlagEnum;
import com.jero.modules.project.mapper.ProjectLawsInventoryEOMapper; import com.jero.modules.project.mapper.ProjectLawsInventoryEOMapper;
import com.jero.modules.project.mapper.ProjectLibraryBaseMapper; import com.jero.modules.project.mapper.ProjectLibraryBaseMapper;
@@ -142,6 +145,12 @@ public class PrehomoJob implements Job {
+ projectLibraryBase.getTargetMarket() + projectLibraryBase.getTargetMarket()
+ " are 3 days. Please check and handle it in time."; + " are 3 days. Please check and handle it in time.";
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setContent("Hello! The remaining processing time for the task are 3 days. Please check and address it in a timely manner.");
feishuMsgVo.setTaskType("Pre-Homo Confirmation");
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
//飞书跳转链接 //飞书跳转链接
String hrefFeishu = backUrl String hrefFeishu = backUrl
+ JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink() + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink()
@@ -161,7 +170,7 @@ public class PrehomoJob implements Job {
sendMessageMap.put("contentInfo",contentInfo); sendMessageMap.put("contentInfo",contentInfo);
//发送消息 //发送消息
projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap); projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
} }
if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){ if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){
@@ -170,9 +179,15 @@ public class PrehomoJob implements Job {
//您XXX(项目名称)中GB 7258的Pre-Homo确认任务今天即将结束,请及时查看处理 //您XXX(项目名称)中GB 7258的Pre-Homo确认任务今天即将结束,请及时查看处理
//The the Pre-Homo confirmation of GB 7258 in XXX (project name) is coming to an end today. Please check and deal with it in time //The the Pre-Homo confirmation of GB 7258 in XXX (project name) is coming to an end today. Please check and deal with it in time
String msgContentEN = "The the Pre-Homo confirmation of " String msgContentEN = "The the Pre-Homo confirmation of "
+ projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName() + projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ " will expire today. Please check and address it in time."; + " will expire today. Please check and address it in time.";
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setContent("Hello! The task will expire today. Please check and address it in a timely manner.");
feishuMsgVo.setTaskType("Pre-Homo Confirmation");
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
//飞书跳转链接 //飞书跳转链接
String hrefFeishu = backUrl String hrefFeishu = backUrl
+ JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink() + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink()
@@ -192,7 +207,7 @@ public class PrehomoJob implements Job {
sendMessageMap.put("contentInfo",contentInfo); sendMessageMap.put("contentInfo",contentInfo);
//发送消息 //发送消息
projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap); projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
} }
} }
} }
@@ -1,6 +1,8 @@
package com.jero.modules.project.job; package com.jero.modules.project.job;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jero.common.constant.enums.MessageTypeEnum;
import com.jero.modules.feishu.vo.FeishuMsgVo;
import com.jero.modules.project.entity.*; import com.jero.modules.project.entity.*;
import com.jero.modules.project.enums.DesignComplianceStatusEnum; import com.jero.modules.project.enums.DesignComplianceStatusEnum;
import com.jero.modules.project.enums.JumpLinkEnum; import com.jero.modules.project.enums.JumpLinkEnum;
@@ -140,6 +142,12 @@ public class VerifyComplianceJob implements Job {
+ projectLibraryBase.getTargetMarket() + projectLibraryBase.getTargetMarket()
+ " are 3 days. Please check and handle it in time."; + " are 3 days. Please check and handle it in time.";
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setContent("Hello! The remaining processing time for the task are 3 days. Please check and address it in a timely manner.");
feishuMsgVo.setTaskType("Validation Compliance Confirmation");
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
//飞书跳转链接 //飞书跳转链接
String hrefFeishu = backUrl String hrefFeishu = backUrl
+ JumpLinkEnum.VERIFY_AFFIRM_LINK.getLink() + JumpLinkEnum.VERIFY_AFFIRM_LINK.getLink()
@@ -159,7 +167,7 @@ public class VerifyComplianceJob implements Job {
sendMessageMap.put("contentInfo",contentInfo); sendMessageMap.put("contentInfo",contentInfo);
//发送消息 //发送消息
projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap); projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
} }
if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){ if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){
@@ -168,9 +176,15 @@ public class VerifyComplianceJob implements Job {
//您XXX(项目名称)中GB 7258的验证符合性确认任务今天即将结束,请及时查看处理 //您XXX(项目名称)中GB 7258的验证符合性确认任务今天即将结束,请及时查看处理
//The the Verify compliance confirmation of GB 7258 in XXX (project name) is coming to an end today. Please check and deal with it in time //The the Verify compliance confirmation of GB 7258 in XXX (project name) is coming to an end today. Please check and deal with it in time
String msgContentEN = "The the validation compliance confirmation of " String msgContentEN = "The the validation compliance confirmation of "
+ projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName() + projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ " will expire today. Please check and address it in time."; + " will expire today. Please check and address it in time.";
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setContent("Hello! The task will expire today. Please check and address it in a timely manner.");
feishuMsgVo.setTaskType("Validation Compliance Confirmation");
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
//飞书跳转链接 //飞书跳转链接
String hrefFeishu = backUrl String hrefFeishu = backUrl
+ JumpLinkEnum.VERIFY_AFFIRM_LINK.getLink() + JumpLinkEnum.VERIFY_AFFIRM_LINK.getLink()
@@ -190,7 +204,7 @@ public class VerifyComplianceJob implements Job {
sendMessageMap.put("contentInfo",contentInfo); sendMessageMap.put("contentInfo",contentInfo);
//发送消息 //发送消息
projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap); projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
} }
} }
} }
@@ -1,6 +1,8 @@
package com.jero.modules.project.job; package com.jero.modules.project.job;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jero.common.constant.enums.MessageTypeEnum;
import com.jero.modules.feishu.vo.FeishuMsgVo;
import com.jero.modules.project.entity.*; import com.jero.modules.project.entity.*;
import com.jero.modules.project.enums.DesignComplianceStatusEnum; import com.jero.modules.project.enums.DesignComplianceStatusEnum;
import com.jero.modules.project.enums.JumpLinkEnum; import com.jero.modules.project.enums.JumpLinkEnum;
@@ -141,6 +143,12 @@ public class designComplianceJob implements Job {
+ projectLibraryBase.getTargetMarket() + projectLibraryBase.getTargetMarket()
+ " are 3 days. Please check and address it in a timely manner."; + " are 3 days. Please check and address it in a timely manner.";
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setContent("Hello! The remaining processing time for the task are 3 days. Please check and address it in a timely manner.");
feishuMsgVo.setTaskType("Design Compliance Confirmation");
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
//飞书跳转链接 //飞书跳转链接
String hrefFeishu = backUrl String hrefFeishu = backUrl
+ JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink() + JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink()
@@ -160,17 +168,23 @@ public class designComplianceJob implements Job {
sendMessageMap.put("contentInfo",contentInfo); sendMessageMap.put("contentInfo",contentInfo);
//发送消息 //发送消息
projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap); projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
} }
if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){ if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){
currentDaysUserIdList = currentDaysUserIdList.stream().distinct().collect(Collectors.toList()); currentDaysUserIdList = currentDaysUserIdList.stream().distinct().collect(Collectors.toList());
//您XXX(项目名称)中GB 7258的设计符合性确认任务今天即将结束,请及时查看处理 //您XXX(项目名称)中GB 7258的设计符合性确认任务今天即将结束,请及时查看处理
String msgContentEN = "The the design compliance confirmation for " String msgContentEN = "The design compliance confirmation of "
+ projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName() + projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName()
+ " will expire today. Please check and address it in time."; + " will expire today. Please check and address it in time.";
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setContent("Hello! The task will expire today. Please check and address it in a timely manner.");
feishuMsgVo.setTaskType("Design Compliance Confirmation");
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
//飞书跳转链接 //飞书跳转链接
String hrefFeishu = backUrl String hrefFeishu = backUrl
+ JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink() + JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink()
@@ -190,7 +204,7 @@ public class designComplianceJob implements Job {
sendMessageMap.put("contentInfo",contentInfo); sendMessageMap.put("contentInfo",contentInfo);
//发送消息 //发送消息
projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap); projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
} }
} }
} }
@@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.itextpdf.text.DocumentException; import com.itextpdf.text.DocumentException;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.constant.enums.MessageTypeEnum;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.modules.feishu.vo.FeishuMsgVo;
import com.jero.modules.project.entity.ProjectLawsInventoryEO; import com.jero.modules.project.entity.ProjectLawsInventoryEO;
import com.jero.modules.system.entity.SysRole; import com.jero.modules.system.entity.SysRole;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@@ -76,7 +78,7 @@ public interface IProjectLawsInventoryEOService extends IService<ProjectLawsInve
*/ */
Result<?> updateStatusBatch(JSONObject json); Result<?> updateStatusBatch(JSONObject json);
void sendMessage(String msgContent, List<String> userIdList,String projectLibraryId,Map<String,Object> params); void sendMessage(String msgContent, List<String> userIdList, String projectLibraryId, Map<String,Object> params, FeishuMsgVo feishuMsgVo, MessageTypeEnum messageType);
/** /**
* 匹配相关人员 * 匹配相关人员
@@ -35,6 +35,7 @@ import com.jero.modules.dummy.service.impl.DummyInventoryBaseEOServiceImpl;
import com.jero.modules.dummy.util.DeepCopyListUtil; import com.jero.modules.dummy.util.DeepCopyListUtil;
import com.jero.modules.dummy.util.ListDiff; import com.jero.modules.dummy.util.ListDiff;
import com.jero.modules.feishu.service.IFeishuService; 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.message.websocket.WebSocket;
import com.jero.modules.oss.entity.OSSFile; import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService; import com.jero.modules.oss.service.IOSSFileService;
@@ -1262,9 +1263,18 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper); ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper);
//消息内容 //消息内容
String msgContentEN = currentUser.getUsername() + " initiated the regulation list confirmation for " + projectNameInfoEO.getProjectName() String msgContentEN = currentUser.getUsername() + " initiated the regulation list confirmation for "
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ ". The due date is:" +inventoryAffirmDueDate+ " .Please check and address it in a timely manner."; + ". The due date is:" +inventoryAffirmDueDate+ " .Please check and address it in a timely manner.";
// 飞书消息封装
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setContent("Hello! Please check and address this task in a timely manner.");
feishuMsgVo.setTaskType("Regulation List Confirmation");
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
feishuMsgVo.setInitiator(currentUser.getUsername());
feishuMsgVo.setDueDate(inventoryAffirmDueDate);
//飞书跳转链接 //飞书跳转链接
String hrefFeishu = backUrl String hrefFeishu = backUrl
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink() + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink()
@@ -1283,7 +1293,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
sendMessageMap.put("contentInfo",contentInfo); sendMessageMap.put("contentInfo",contentInfo);
//发送消息 //发送消息
sendMessage(msgContentEN,userIdList,projectLibraryId,sendMessageMap); sendMessage(msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
} }
result = "发起清单确认"; result = "发起清单确认";
@@ -1397,7 +1407,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
* @param projectLibraryId * @param projectLibraryId
*/ */
@Override @Override
public void sendMessage(String msgContent, List<String> userIdList,String projectLibraryId,Map<String,Object> sendMessageMap){ public void sendMessage(String msgContent, List<String> userIdList,String projectLibraryId,Map<String,Object> sendMessageMap, FeishuMsgVo feishuMsgVo, MessageTypeEnum messageType){
String idTemp = projectLibraryId; String idTemp = projectLibraryId;
List<SysUser> sysUsers = sysUserService.listByIds(userIdList); List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
@@ -1405,7 +1415,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
if(CollectionUtils.isNotEmpty(sysUsers)){ if(CollectionUtils.isNotEmpty(sysUsers)){
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList()); thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
} }
//飞书跳转链接 // //飞书跳转链接
String hrefFeishu = (String) sendMessageMap.get("hrefFeishu"); String hrefFeishu = (String) sendMessageMap.get("hrefFeishu");
//消息内容 //消息内容
String contentInfo = (String) sendMessageMap.get("contentInfo"); String contentInfo = (String) sendMessageMap.get("contentInfo");
@@ -1415,9 +1425,16 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
sysAnnouncementService.saveAnnouncement(sysAnnouncement); sysAnnouncementService.saveAnnouncement(sysAnnouncement);
sendWebsocket(idTemp, idTemp); sendWebsocket(idTemp, idTemp);
//飞书消息 // //飞书消息
try { try {
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), msgContent, MessageTypeEnum.PUSH.getName(), hrefFeishu); if (feishuMsgVo != null){
// 补充飞书跳转链接
feishuMsgVo.setUrl(hrefFeishu);
feishuMsgVo.setTitle(messageType.getName());
iFeishuService.sendCardMsg(thirdIdList.toArray(new String[]{}), feishuMsgVo);
} else {
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), msgContent, messageType.getName(), hrefFeishu);
}
} catch (IOException e) { } catch (IOException e) {
log.error("飞书消息推送失败"); log.error("飞书消息推送失败");
} }
@@ -1767,32 +1784,56 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectNameId()); projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectNameId());
ProjectNameInfoEO projectNameInfoEO = projectNameInfoEOMapper.selectOne(projectNameInfoEOQueryWrapper); ProjectNameInfoEO projectNameInfoEO = projectNameInfoEOMapper.selectOne(projectNameInfoEOQueryWrapper);
QueryWrapper<ProjectYearNameInfoEO> projectYearInfoEOQueryWrapper = new QueryWrapper<>();
projectYearInfoEOQueryWrapper.lambda().eq(ProjectYearNameInfoEO::getId,projectLibraryBase.getYearNameId());
ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper);
SysUser sysUser = sysUserMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, currentUserId)); SysUser sysUser = sysUserMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, currentUserId));
String msgContentEN = ""; String msgContentEN = "";
List<String> userIdList = new ArrayList<>(); List<String> userIdList = new ArrayList<>();
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_START_MSG.getValue())) { if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_START_MSG.getValue())) {
userIdList.add(engineeringInterfacePerson); userIdList.add(engineeringInterfacePerson);
msgContentEN = sysUser.getUsername() + " assigned the regulation task confirmation of " + projectNameInfoEO.getProjectName() msgContentEN = sysUser.getUsername() + " assigned the regulation task confirmation of " + projectNameInfoEO.getProjectName()
+ ".The due date is:" +taskAffirmDueDate+ " Please check and address it in a timely manner."; + ".The due date is:" +taskAffirmDueDate+ " Please check and address it in a timely manner.";
feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has assigned the task to you. Please check and and handle it in time.");
} else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_ISSUE_DRE_MSG.getValue())) { } else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_ISSUE_DRE_MSG.getValue())) {
String dreUserId = jsonObject.getString("dreUserId"); //dre用户id String dreUserId = jsonObject.getString("dreUserId"); //dre用户id
userIdList.add(dreUserId); userIdList.add(dreUserId);
msgContentEN = sysUser.getUsername() + " has rejected the regulation task confirmation of " + serialNumber + " in "+ projectNameInfoEO.getProjectName() msgContentEN = sysUser.getUsername() + " has rejected the regulation task confirmation of " + serialNumber + " in "+ projectNameInfoEO.getProjectName()
+ ".to you. the due date is " +taskAffirmDueDate+ " Please check and handle it in time."; + ".to you. the due date is " +taskAffirmDueDate+ " Please check and handle it in time.";
feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has rejected the task. Please check and and handle it in time.");
} else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_DRE_REJECTED.getValue())) { } else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_DRE_REJECTED.getValue())) {
userIdList.add(engineeringInterfacePerson); userIdList.add(engineeringInterfacePerson);
msgContentEN = sysUser.getUsername() + " has returned the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() msgContentEN = sysUser.getUsername() + " has returned the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName()
+ ".The due date is " +taskAffirmDueDate+ " Please check and handle it in time."; + ".The due date is " +taskAffirmDueDate+ " Please check and handle it in time.";
feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has returned the task. Please check and and handle it in time.");
} else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_DRE_ACCEPTED.getValue())) { } else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_DRE_ACCEPTED.getValue())) {
userIdList.add(engineeringInterfacePerson); userIdList.add(engineeringInterfacePerson);
msgContentEN = sysUser.getUsername() + " has submitted the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName() msgContentEN = sysUser.getUsername() + " has submitted the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName()
+ ".The due date is " +taskAffirmDueDate+ " Please check and handle it in time."; + ".The due date is " +taskAffirmDueDate+ " Please check and handle it in time.";
feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has submitted the task. Please check and and handle it in time.");
} }
if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgContentEN)){ if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgContentEN)){
feishuMsgVo.setTaskType("Regulation Task Confirmation");
feishuMsgVo.setRegulationNo(serialNumber);
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
feishuMsgVo.setInitiator(sysUser.getUsername());
feishuMsgVo.setDueDate(taskAffirmDueDate);
//飞书跳转链接 //飞书跳转链接
String hrefFeishu = backUrl + JumpLinkEnum.TASK_AFFIRM_LINK.getLink(); String hrefFeishu = backUrl + JumpLinkEnum.TASK_AFFIRM_LINK.getLink();
//系统内部跳转链接 //系统内部跳转链接
@@ -1803,7 +1844,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
sendMessageMap.put("contentInfo",contentInfo); sendMessageMap.put("contentInfo",contentInfo);
//发送消息 //发送消息
sendMessage(msgContentEN,userIdList,id,sendMessageMap); sendMessage(msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
} }
} }
@@ -5982,6 +6023,11 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
//消息内容 //消息内容
String msgContentEN = "Please address the regulation list confirmation process for "+ projectNameInfoEO.getProjectName() +" ASAP. "; String msgContentEN = "Please address the regulation list confirmation process for "+ projectNameInfoEO.getProjectName() +" ASAP. ";
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setContent("Hello! Please address the regulation list confirmation process ASAP. ");
feishuMsgVo.setTaskType("Regulation List Confirmation");
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
//飞书跳转链接 //飞书跳转链接
String hrefFeishu = backUrl String hrefFeishu = backUrl
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink() + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink()
@@ -6001,7 +6047,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
sendMessageMap.put("contentInfo",contentInfo); sendMessageMap.put("contentInfo",contentInfo);
//发送消息 //发送消息
sendMessage(msgContentEN,inventoryAffirmUserIdList,projectLibraryId,sendMessageMap); sendMessage(msgContentEN,inventoryAffirmUserIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
} }
} }
@@ -6032,9 +6078,18 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectNameId()); projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectNameId());
ProjectNameInfoEO projectNameInfoEO = projectNameInfoEOMapper.selectOne(projectNameInfoEOQueryWrapper); ProjectNameInfoEO projectNameInfoEO = projectNameInfoEOMapper.selectOne(projectNameInfoEOQueryWrapper);
QueryWrapper<ProjectYearNameInfoEO> projectYearInfoEOQueryWrapper = new QueryWrapper<>();
projectYearInfoEOQueryWrapper.lambda().eq(ProjectYearNameInfoEO::getId,projectLibraryBase.getYearNameId());
ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper);
//消息内容 //消息内容
String msgContentEN = "Please address the regulation task confirmation process for "+ projectNameInfoEO.getProjectName() +" ASAP. "; String msgContentEN = "Please address the regulation task confirmation process for "+ projectNameInfoEO.getProjectName() +" ASAP. ";
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
feishuMsgVo.setTaskType("Regulation List Confirmation");
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
//飞书跳转链接 //飞书跳转链接
String hrefFeishu = backUrl + JumpLinkEnum.TASK_AFFIRM_LINK.getLink(); String hrefFeishu = backUrl + JumpLinkEnum.TASK_AFFIRM_LINK.getLink();
//系统内部跳转链接 //系统内部跳转链接
@@ -6046,7 +6101,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
sendMessageMap.put("contentInfo",contentInfo); sendMessageMap.put("contentInfo",contentInfo);
//发送消息 //发送消息
sendMessage(msgContentEN,taskAffirmUserIdList,projectLibraryId,sendMessageMap); sendMessage(msgContentEN,taskAffirmUserIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
} }
} }
}); });
@@ -111,8 +111,9 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
} }
} }
} }
List<SysDictItem> dictItemList = sysDictItemServiceImpl.selectItemsByDictCode("region");
for (ProjectLibraryBase libraryBase : projectLibraryBaseList) { for (ProjectLibraryBase libraryBase : projectLibraryBaseList) {
targetMarket(projectLibraryBase, dictItemList, libraryBase);
Map<String,Object> mapList = new HashMap<>(); Map<String,Object> mapList = new HashMap<>();
List<List<TimeNodeVO>> collect = new ArrayList<>(); List<List<TimeNodeVO>> collect = new ArrayList<>();
if(ObjectUtils.isNotEmpty(startTime) && ObjectUtils.isNotEmpty(endTime)){ if(ObjectUtils.isNotEmpty(startTime) && ObjectUtils.isNotEmpty(endTime)){
@@ -124,7 +125,7 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
if(collect.size() != 0){ if(collect.size() != 0){
index ++; index ++;
mapList.put("index",index); mapList.put("index",index);
mapList.put("projectName",libraryBase.getProjectName()); mapList.put("projectName",libraryBase.getProjectName()+" "+libraryBase.getYearName()+"-"+libraryBase.getTargetMarket());
mapList.put("data",collect); mapList.put("data",collect);
result.add(mapList); result.add(mapList);
} }
@@ -5,7 +5,9 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.constant.enums.MessageTypeEnum;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.modules.feishu.vo.FeishuMsgVo;
import com.jero.modules.project.entity.*; import com.jero.modules.project.entity.*;
import com.jero.modules.project.enums.JumpLinkEnum; import com.jero.modules.project.enums.JumpLinkEnum;
import com.jero.modules.project.enums.MsgTypeEnum; import com.jero.modules.project.enums.MsgTypeEnum;
@@ -260,22 +262,44 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper); ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper);
String id = UUID.randomUUID().toString().replace("-", ""); String id = UUID.randomUUID().toString().replace("-", "");
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
//给工程师下发消息 //给工程师下发消息
if(org.apache.commons.lang3.StringUtils.equals(projectTaskInventoryDetailEO.getMsgType(), MsgTypeEnum.DESIGN_ISSUE_DRE_MSG.getValue())){ if(org.apache.commons.lang3.StringUtils.equals(projectTaskInventoryDetailEO.getMsgType(), MsgTypeEnum.DESIGN_ISSUE_DRE_MSG.getValue())){
//XXX has distributed the design compliance confirmation process of GB 7258 in XXX (project name) to you. Please check and handle it in time. //XXX has distributed the design compliance confirmation process of GB 7258 in XXX (project name) to you. Please check and handle it in time.
msgContentEN = currentUser.getUsername() + " has distributed the design compliance confirmation process of " msgContentEN = currentUser.getUsername() + " has assigned the design compliance confirmation process of "
+ projectLawsInventoryEO.getSerialNumber() + " in "+ projectNameInfoEO.getProjectName() + projectLawsInventoryEO.getSerialNumber() + " in "
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ " to you. Please check and handle it in time."; + " to you. Please check and handle it in time.";
feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has assigned the task to you. Please check and handle it in time.");
feishuMsgVo.setTaskType("Design Compliance Confirmation");
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
}else if(org.apache.commons.lang3.StringUtils.equals(projectTaskInventoryDetailEO.getMsgType(), MsgTypeEnum.PREHOMO_ISSUE_DRE_MSG.getValue())){ }else if(org.apache.commons.lang3.StringUtils.equals(projectTaskInventoryDetailEO.getMsgType(), MsgTypeEnum.PREHOMO_ISSUE_DRE_MSG.getValue())){
//XXX has distributed the Pre-Homo confirmation process of GB 7258 in XXX (project name) to you. Please check and handle it in time. //XXX has distributed the Pre-Homo confirmation process of GB 7258 in XXX (project name) to you. Please check and handle it in time.
msgContentEN = currentUser.getUsername() + " has assigned the Pre-Homo confirmation process of " msgContentEN = currentUser.getUsername() + " has assigned the Pre-Homo confirmation process of "
+ projectLawsInventoryEO.getSerialNumber() + " in "+ projectNameInfoEO.getProjectName() + projectLawsInventoryEO.getSerialNumber() + " in "
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ " to you. Please check and handle it in time."; + " to you. Please check and handle it in time.";
feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has assigned the task to you. Please check and handle it in time.");
feishuMsgVo.setTaskType("Pre-Homo Confirmation");
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
}else if(org.apache.commons.lang3.StringUtils.equals(projectTaskInventoryDetailEO.getMsgType(), MsgTypeEnum.VERIFY_ISSUE_DRE_MSG.getValue())){ }else if(org.apache.commons.lang3.StringUtils.equals(projectTaskInventoryDetailEO.getMsgType(), MsgTypeEnum.VERIFY_ISSUE_DRE_MSG.getValue())){
//XXX has distributed the Verify compliance confirmation process of GB 7258 in XXX (project name) to you. Please check and handle it in time. //XXX has distributed the Verify compliance confirmation process of GB 7258 in XXX (project name) to you. Please check and handle it in time.
msgContentEN = currentUser.getUsername() + " has assigned the validation compliance confirmation process of " msgContentEN = currentUser.getUsername() + " has assigned the validation compliance confirmation process of "
+ projectLawsInventoryEO.getSerialNumber() + " in "+ projectNameInfoEO.getProjectName() + projectLawsInventoryEO.getSerialNumber() + " in "
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ " to you. Please check and handle it in time."; + " to you. Please check and handle it in time.";
feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has assigned the task to you. Please check and handle it in time.");
feishuMsgVo.setTaskType("Validation Compliance Confirmation");
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
} }
if(CollectionUtils.isNotEmpty(userIdList) && org.apache.commons.lang3.StringUtils.isNotEmpty(msgContentEN)){ if(CollectionUtils.isNotEmpty(userIdList) && org.apache.commons.lang3.StringUtils.isNotEmpty(msgContentEN)){
//飞书跳转链接 //飞书跳转链接
@@ -297,7 +321,7 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
sendMessageMap.put("contentInfo",contentInfo); sendMessageMap.put("contentInfo",contentInfo);
//发送消息 //发送消息
SendMessageUtils.sendMessage(msgContentEN,userIdList,id,sendMessageMap); SendMessageUtils.sendMessage(msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
} }
} }
} }
@@ -6,9 +6,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.CutEnum;
import com.jero.common.constant.enums.MessageTypeEnum;
import com.jero.common.exception.JeroBootException; import com.jero.common.exception.JeroBootException;
import com.jero.common.system.query.QueryGenerator; import com.jero.common.system.query.QueryGenerator;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.modules.feishu.vo.FeishuMsgVo;
import com.jero.modules.project.entity.*; import com.jero.modules.project.entity.*;
import com.jero.modules.project.enums.*; import com.jero.modules.project.enums.*;
import com.jero.modules.project.mapper.*; import com.jero.modules.project.mapper.*;
@@ -315,21 +317,42 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
String dreUserIds = jsonObject.getString("dreUserIds"); //dre用户id String dreUserIds = jsonObject.getString("dreUserIds"); //dre用户id
userIdList.addAll(Arrays.asList(dreUserIds.split(","))); userIdList.addAll(Arrays.asList(dreUserIds.split(",")));
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
if(StringUtils.equals(msgType,MsgTypeEnum.DESIGN_REMIND_MSG.getValue())){ if(StringUtils.equals(msgType,MsgTypeEnum.DESIGN_REMIND_MSG.getValue())){
//Please check and deal with the design compliance confirmation process of GB 7258 in XXX (project name) in time. //Please check and deal with the design compliance confirmation process of GB 7258 in XXX (project name) in time.
msgContentEN = "Please check and deal with the design compliance confirmation process of " msgContentEN = "Please check and deal with the design compliance confirmation process of "
+ serialNumber + " in "+ projectNameInfoEO.getProjectName() + serialNumber + " in "
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ " in time."; + " in time.";
feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
feishuMsgVo.setTaskType("Design Compliance Confirmation");
feishuMsgVo.setRegulationNo(serialNumber);
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
}else if(StringUtils.equals(msgType,MsgTypeEnum.PREHOMO_REMIND_MSG.getValue())){ }else if(StringUtils.equals(msgType,MsgTypeEnum.PREHOMO_REMIND_MSG.getValue())){
//Please check and deal with the Pre-Homo confirmation process of GB 7258 in XXX (project name) in time. //Please check and deal with the Pre-Homo confirmation process of GB 7258 in XXX (project name) in time.
msgContentEN = "Please check and address the Pre-Homo confirmation process of " msgContentEN = "Please check and address the Pre-Homo confirmation process of "
+ serialNumber + " in "+ projectNameInfoEO.getProjectName() + serialNumber + " in "+ projectNameInfoEO.getProjectName()
+ " in time."; + " in time.";
feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
feishuMsgVo.setTaskType("Pre-Homo Confirmation");
feishuMsgVo.setRegulationNo(serialNumber);
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
}else if(StringUtils.equals(msgType,MsgTypeEnum.VERIFY_REMIND_MSG.getValue())){ }else if(StringUtils.equals(msgType,MsgTypeEnum.VERIFY_REMIND_MSG.getValue())){
//Please check and deal with the Verify compliance confirmation process of GB 7258 in XXX (project name) in time. //Please check and deal with the Verify compliance confirmation process of GB 7258 in XXX (project name) in time.
msgContentEN = "Please check and address the Verify compliance confirmation process of " msgContentEN = "Please check and address the validation compliance confirmation process of "
+ serialNumber + " in "+ projectNameInfoEO.getProjectName() + serialNumber + " in "+ projectNameInfoEO.getProjectName()
+ " in time."; + " in time.";
feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
feishuMsgVo.setTaskType("Validation Compliance Confirmation");
feishuMsgVo.setRegulationNo(serialNumber);
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
} }
if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgContentEN)){ if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgContentEN)){
@@ -353,7 +376,7 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
sendMessageMap.put("contentInfo",contentInfo); sendMessageMap.put("contentInfo",contentInfo);
//发送消息 //发送消息
SendMessageUtils.sendMessage(msgContentEN,userIdList,projectLibraryId,sendMessageMap); SendMessageUtils.sendMessage(msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
} }
return new Result<>().success("提醒办理成功!"); return new Result<>().success("提醒办理成功!");
} }
@@ -622,10 +645,17 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
userIdList.addAll(Arrays.asList(dreUserIds.split(","))); userIdList.addAll(Arrays.asList(dreUserIds.split(",")));
if (StringUtils.equals(msgType, MsgTypeEnum.DESIGN_ISSUE_DRE_MSG.getValue())) { if (StringUtils.equals(msgType, MsgTypeEnum.DESIGN_ISSUE_DRE_MSG.getValue())) {
msgContentEN = sysUser.getUsername() + "has assigned the design compliance confirmation process of " + serialNumber + " in "+ projectNameInfoEO.getProjectName() msgContentEN = sysUser.getUsername() + "has assigned the design compliance confirmation process of " + serialNumber + " in "
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ " to you. Please check and handle it in time."; + " to you. Please check and handle it in time.";
} }
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has assigned the task to you. Please check and handle it in time.");
feishuMsgVo.setTaskType("Design Compliance Confirmation");
feishuMsgVo.setRegulationNo(serialNumber);
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgContentEN)){ if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgContentEN)){
//飞书跳转链接 //飞书跳转链接
@@ -647,7 +677,7 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
sendMessageMap.put("contentInfo",contentInfo); sendMessageMap.put("contentInfo",contentInfo);
//发送消息 //发送消息
SendMessageUtils.sendMessage(msgContentEN,userIdList,id,sendMessageMap); SendMessageUtils.sendMessage(msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, MessageTypeEnum.TASK);
} }
} }
@@ -5,6 +5,7 @@ import com.jero.common.constant.CommonConstant;
import com.jero.common.constant.WebsocketConst; import com.jero.common.constant.WebsocketConst;
import com.jero.common.constant.enums.MessageTypeEnum; import com.jero.common.constant.enums.MessageTypeEnum;
import com.jero.modules.feishu.service.IFeishuService; 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.message.websocket.WebSocket;
import com.jero.modules.system.entity.SysAnnouncement; import com.jero.modules.system.entity.SysAnnouncement;
import com.jero.modules.system.entity.SysUser; import com.jero.modules.system.entity.SysUser;
@@ -53,7 +54,7 @@ public class SendMessageUtils {
SendMessageUtils.webSocket = webSocket; SendMessageUtils.webSocket = webSocket;
} }
public static void sendMessage(String msgContent, List<String> userIdList, String projectLibraryId, Map<String,Object> sendMessageMap) { public static void sendMessage(String msgContent, List<String> userIdList, String projectLibraryId, Map<String,Object> sendMessageMap, FeishuMsgVo feishuMsgVo, MessageTypeEnum messageType) {
String idTemp = projectLibraryId; String idTemp = projectLibraryId;
List<SysUser> sysUsers = sysUserService.listByIds(userIdList); List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
@@ -74,7 +75,14 @@ public class SendMessageUtils {
//飞书消息 //飞书消息
try { try {
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), msgContent, MessageTypeEnum.PUSH.getName(), hrefFeishu); if (feishuMsgVo != null){
// 补充飞书跳转链接
feishuMsgVo.setUrl(hrefFeishu);
feishuMsgVo.setTitle(messageType.getName());
iFeishuService.sendCardMsg(thirdIdList.toArray(new String[]{}), feishuMsgVo);
} else {
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), msgContent, messageType.getName(), hrefFeishu);
}
} catch (IOException e) { } catch (IOException e) {
logger.error("飞书消息推送失败"); logger.error("飞书消息推送失败");
} }
+5 -4
View File
@@ -404,9 +404,9 @@ module.exports = {
NodeQuickLookup: 'Node quick lookup', NodeQuickLookup: 'Node quick lookup',
AreAllLabelsRead: 'Are all labels read', AreAllLabelsRead: 'Are all labels read',
AllLabelsRead: 'Labels Read', AllLabelsRead: 'Labels Read',
SubscriptionNotification: 'Subscription notification', SubscriptionNotification: 'Subscription Notification',
warningInformation: 'Warning Information', warningInformation: 'Early Warning',
ForwardPush: 'Forward push', ForwardPush: 'Share / Forward',
PleaseSelectData: 'Please select data first', PleaseSelectData: 'Please select data first',
MessageContent: 'Message Content', MessageContent: 'Message Content',
MessageType: 'Message Type', MessageType: 'Message Type',
@@ -856,7 +856,8 @@ module.exports = {
yellowSchedule: 'Yellow: non conformance / to be tracked, with acceptable scheme and schedule', yellowSchedule: 'Yellow: non conformance / to be tracked, with acceptable scheme and schedule',
greenRequirements: 'Green: confirm that it meets or meets the current requirements', greenRequirements: 'Green: confirm that it meets or meets the current requirements',
blueUndeterminedState: 'Blue: undetermined state', blueUndeterminedState: 'Blue: undetermined state',
authenticationMessage: 'Authentication Message', authenticationMessage: 'Homo Parameter Task',
taskRegulationComplianceTask: 'Regulation Compliance Task',
accept: 'Accept', accept: 'Accept',
notLaunch: 'Not start', notLaunch: 'Not start',
refuse: 'Reject', refuse: 'Reject',
+2 -1
View File
@@ -864,7 +864,8 @@ module.exports = {
yellowSchedule: '黄:不符合/待追踪,有可接受的方案和时间表', yellowSchedule: '黄:不符合/待追踪,有可接受的方案和时间表',
greenRequirements: '绿:确认符合或满足当前要求', greenRequirements: '绿:确认符合或满足当前要求',
blueUndeterminedState: '蓝:未判断状态', blueUndeterminedState: '蓝:未判断状态',
authenticationMessage: '认证消息', authenticationMessage: '参数收集',
taskRegulationComplianceTask: '法规符合性任务',
accept: '接受', accept: '接受',
refuse: '拒绝', refuse: '拒绝',
taskTermination: '任务终止', taskTermination: '任务终止',
@@ -387,7 +387,7 @@
return str return str
}, },
handleOk() { handleOk() {
if (!this.isNullArray(this.queryParamsModel)) { // if (!this.isNullArray(this.queryParamsModel)) {
let event = { let event = {
matchType: this.matchType, matchType: this.matchType,
params: this.removeEmptyObject(this.queryParamsModel) params: this.removeEmptyObject(this.queryParamsModel)
@@ -397,9 +397,9 @@
this.visible = false this.visible = false
} }
this.emitCallback(event) this.emitCallback(event)
} else { // } else {
this.$message.warn(this.$t('CannotQueryEmpty')) // this.$message.warn(this.$t('CannotQueryEmpty'))
} // }
}, },
emitCallback(event = {}) { emitCallback(event = {}) {
let { params = [], matchType = this.matchType } = event let { params = [], matchType = this.matchType } = event
@@ -408,6 +408,9 @@
if (Array.isArray(param.val)) { if (Array.isArray(param.val)) {
param.val = param.val.join(',') param.val = param.val.join(',')
} }
if (param.type == "Personnel" && !param.val){
param.val = ' is null '
}
} }
console.debug('---高级查询参数--->', { params, matchType }) console.debug('---高级查询参数--->', { params, matchType })
this.$emit(this.callback, params, matchType) this.$emit(this.callback, params, matchType)
@@ -614,7 +617,6 @@
item.val = values[item.popup['destFields']] item.val = values[item.popup['destFields']]
}, },
PersonnelSelectionChange(value, id,index){ PersonnelSelectionChange(value, id,index){
console.log(index)
this.queryParamsModel[index].val = id this.queryParamsModel[index].val = id
this.queryParamsModel[index].valueId = id this.queryParamsModel[index].valueId = id
console.log(this.queryParamsModel) console.log(this.queryParamsModel)
+3 -1
View File
@@ -30,6 +30,7 @@
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getAction, postAction, downFile, downloadFile } from '@/api/manage' import { getAction, postAction, downFile, downloadFile } from '@/api/manage'
import { Base64 } from 'js-base64' import { Base64 } from 'js-base64'
import { mapGetters } from 'vuex'
export default { export default {
name: 'file', name: 'file',
@@ -65,6 +66,7 @@
// console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl); // console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl);
}, },
methods: { methods: {
...mapGetters(['userInfo']),
perentHandleFunc(data) { perentHandleFunc(data) {
this.myfileList = data this.myfileList = data
if (data && data.length > 0) { if (data && data.length > 0) {
@@ -182,7 +184,7 @@
let index2 = fileName.length let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2) let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix === '.pdf') { if (fileSuffix === '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id)) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id+'&userName='+this.userInfo().username))
} else if (fileSuffix === '.docx') { } else if (fileSuffix === '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank') window.open(url, '_blank')
@@ -30,6 +30,7 @@ import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getAction, postAction, downFile, downloadFile } from '@/api/manage' import { getAction, postAction, downFile, downloadFile } from '@/api/manage'
import { Base64 } from 'js-base64' import { Base64 } from 'js-base64'
import { mapGetters } from 'vuex'
export default { export default {
name: 'file', name: 'file',
@@ -66,6 +67,7 @@ export default {
// console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl); // console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl);
}, },
methods: { methods: {
...mapGetters(['userInfo']),
perentHandleFunc(data) { perentHandleFunc(data) {
this.myfileList = data this.myfileList = data
if (data && data.length > 0) { if (data && data.length > 0) {
@@ -187,7 +189,7 @@ export default {
let index2 = fileName.length let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2) let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix === '.pdf') { if (fileSuffix === '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id)) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id+'&userName='+this.userInfo().username))
} else if (fileSuffix === '.docx') { } else if (fileSuffix === '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank') window.open(url, '_blank')
@@ -38,6 +38,7 @@ import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getAction, postAction, downFile, downloadFile } from '@/api/manage' import { getAction, postAction, downFile, downloadFile } from '@/api/manage'
import { Base64 } from 'js-base64' import { Base64 } from 'js-base64'
import { mapGetters } from 'vuex'
export default { export default {
name: 'file', name: 'file',
@@ -87,6 +88,7 @@ export default {
// console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl); // console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl);
}, },
methods: { methods: {
...mapGetters(['userInfo']),
download() { download() {
downloadFile('/sys/common/downLoadFile', this.template.templateName, { id: this.template.templateId }) downloadFile('/sys/common/downLoadFile', this.template.templateName, { id: this.template.templateId })
}, },
@@ -209,7 +211,7 @@ export default {
let index2 = fileName.length let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2) let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix === '.pdf') { if (fileSuffix === '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id)) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id+'&userName='+this.userInfo().username))
} else if (fileSuffix === '.docx') { } else if (fileSuffix === '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank') window.open(url, '_blank')
@@ -36,6 +36,7 @@
<script> <script>
import { Base64 } from 'js-base64' import { Base64 } from 'js-base64'
import { getAction, postAction, downloadFile, putAction } from '@/api/manage' import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
import { mapGetters } from 'vuex'
export default { export default {
name: 'viewFileModel', name: 'viewFileModel',
@@ -64,13 +65,14 @@
} }
}, },
methods: { methods: {
...mapGetters(['userInfo']),
pdfPreview(fileQuery) { pdfPreview(fileQuery) {
let fileName = fileQuery.fileName let fileName = fileQuery.fileName
let index1 = fileName.lastIndexOf('.') let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2) let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') { if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id)) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id+'&userName='+this.userInfo().username))
} else if (fileSuffix == '.docx') { } else if (fileSuffix == '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank') window.open(url, '_blank')
@@ -82,7 +84,7 @@
} }
}, },
download(item) { download(item) {
downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id }) downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id ,userName:this.userInfo().username})
}, },
clickButtonToUpload(item) { clickButtonToUpload(item) {
this.loading = true this.loading = true
@@ -264,6 +264,7 @@
import { getAction, postAction, downFile, downloadFile } from '@/api/manage' import { getAction, postAction, downFile, downloadFile } from '@/api/manage'
import { Base64 } from 'js-base64' import { Base64 } from 'js-base64'
import uploadFile from '@/components/uploadFile/file' import uploadFile from '@/components/uploadFile/file'
import { mapGetters } from 'vuex'
export default { export default {
name: 'docIndex', name: 'docIndex',
@@ -351,6 +352,7 @@
}) })
}, },
methods: { methods: {
...mapGetters(['userInfo']),
getTitle(callback) { getTitle(callback) {
let _id = this.$route.query.documentId === undefined ? this.$route.query.id : this.$route.query.documentId let _id = this.$route.query.documentId === undefined ? this.$route.query.id : this.$route.query.documentId
getAction(this.url.getTitle, { id: _id }).then((res) => { getAction(this.url.getTitle, { id: _id }).then((res) => {
@@ -399,7 +401,7 @@
let index2 = fileName.length let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2) let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') { if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id)) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id+'&userName='+this.userInfo().username))
} else if (fileSuffix == '.docx') { } else if (fileSuffix == '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank') window.open(url, '_blank')
@@ -411,7 +413,7 @@
} }
}, },
download(item) { download(item) {
downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id }) downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id ,userName:this.userInfo().username})
}, },
UpdateLog() { UpdateLog() {
this.visible = true this.visible = true
@@ -96,6 +96,7 @@
import Vue from 'vue' import Vue from 'vue'
import eventBUs from '../../../common/event' import eventBUs from '../../../common/event'
import axios from 'axios' import axios from 'axios'
import { mapGetters } from 'vuex'
export default { export default {
name: 'ocr', name: 'ocr',
@@ -177,6 +178,7 @@
}, },
methods:{ methods:{
...mapGetters(['userInfo']),
initWebSocket: function () { initWebSocket: function () {
let token = Vue.ls.get(ACCESS_TOKEN) let token = Vue.ls.get(ACCESS_TOKEN)
// console.log("------------WebSocket连接成功"); // console.log("------------WebSocket连接成功");
@@ -443,7 +445,7 @@
}, },
//文件详情跳转 //文件详情跳转
detailClick(val){ detailClick(val){
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + val.attId)) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + val.attId+'&userName='+this.userInfo().username))
}, },
exportVisible(val){ exportVisible(val){
// this.fileVisible=val // this.fileVisible=val
@@ -230,6 +230,7 @@
import libraryPush from '@/components/libraryPush/index' import libraryPush from '@/components/libraryPush/index'
import moment from 'moment' import moment from 'moment'
import { Base64 } from 'js-base64' import { Base64 } from 'js-base64'
import { mapGetters } from 'vuex'
export default { export default {
name: 'DocumentLibrary', name: 'DocumentLibrary',
@@ -376,6 +377,7 @@
}, },
methods: { methods: {
...mapGetters(['userInfo']),
handleChange() { handleChange() {
}, },
@@ -677,7 +679,7 @@
let index2 = fileName.length let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2) let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') { if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id)) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id+'&userName='+this.userInfo().username))
} else if (fileSuffix == '.docx') { } else if (fileSuffix == '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank') window.open(url, '_blank')
@@ -90,6 +90,7 @@
<script> <script>
import { getAction, postAction, downloadFile } from '@/api/manage' import { getAction, postAction, downloadFile } from '@/api/manage'
import { Base64 } from 'js-base64' import { Base64 } from 'js-base64'
import { mapGetters } from 'vuex'
export default { export default {
name: 'whole', name: 'whole',
@@ -130,6 +131,7 @@
// } // }
}, },
methods: { methods: {
...mapGetters(['userInfo']),
checkedClick(item) { checkedClick(item) {
if (item.checked) { if (item.checked) {
this.checkboxText = this.checkboxText.filter(res => { this.checkboxText = this.checkboxText.filter(res => {
@@ -151,7 +153,7 @@
let index2 = fileName.length let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2) let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') { if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id.slice(0, 32))) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id.slice(0, 32)+'&userName='+this.userInfo().username))
} else if (fileSuffix == '.docx') { } else if (fileSuffix == '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id.slice(0, 32) + fileSuffix) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id.slice(0, 32) + fileSuffix)
window.open(url, '_blank') window.open(url, '_blank')
@@ -247,6 +247,7 @@
import globalAdvancedQuery from '@/components/globalAdvancedQuery/index' import globalAdvancedQuery from '@/components/globalAdvancedQuery/index'
import { getAction, postAction, downloadFile } from '@/api/manage' import { getAction, postAction, downloadFile } from '@/api/manage'
import { Base64 } from 'js-base64' import { Base64 } from 'js-base64'
import { mapGetters } from 'vuex'
export default { export default {
name: 'virtualListDetails', name: 'virtualListDetails',
@@ -629,6 +630,7 @@
} }
}, },
methods: { methods: {
...mapGetters(['userInfo']),
handleSuperQuery(params, matchType) { handleSuperQuery(params, matchType) {
let sqp = {} let sqp = {}
if (!params || (params && params.length == 0)) { if (!params || (params && params.length == 0)) {
@@ -788,7 +790,7 @@
let index2 = fileName.length let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2) let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') { if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id)) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id+'&userName='+this.userInfo().username))
} else if (fileSuffix == '.docx') { } else if (fileSuffix == '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank') window.open(url, '_blank')
@@ -805,7 +807,7 @@
let index2 = fileName.length let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2) let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') { if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + id)) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + id+'&userName='+this.userInfo().username))
} else if (fileSuffix == '.docx') { } else if (fileSuffix == '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix)
window.open(url, '_blank') window.open(url, '_blank')
@@ -817,7 +819,7 @@
} }
}, },
download(item) { download(item) {
downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id }) downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id ,userName:this.userInfo().username})
}, },
clickButtonToUpload(item) { clickButtonToUpload(item) {
this.loading = true this.loading = true
@@ -56,6 +56,7 @@
<script> <script>
import { Base64 } from 'js-base64' import { Base64 } from 'js-base64'
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage' import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
import { mapGetters } from 'vuex'
export default { export default {
name: 'standardContentList', name: 'standardContentList',
@@ -168,13 +169,14 @@
}) })
}, },
methods: { methods: {
...mapGetters(['userInfo']),
pdfPreview(fileQuery) { pdfPreview(fileQuery) {
let fileName = fileQuery.fileName let fileName = fileQuery.fileName
let index1 = fileName.lastIndexOf('.') let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2) let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') { if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id)) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id+'&userName='+this.userInfo().username))
} else if (fileSuffix == '.docx') { } else if (fileSuffix == '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank') window.open(url, '_blank')
@@ -191,7 +193,7 @@
let index2 = fileName.length let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2) let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') { if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + id)) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + id+'&userName='+this.userInfo().username))
} else if (fileSuffix == '.docx') { } else if (fileSuffix == '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix)
window.open(url, '_blank') window.open(url, '_blank')
@@ -203,7 +205,7 @@
} }
}, },
download(item) { download(item) {
downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id }) downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id ,userName:this.userInfo().username})
}, },
clickButtonToUpload(item) { clickButtonToUpload(item) {
this.loading = true this.loading = true
@@ -1596,7 +1596,7 @@
let index2 = fileName.length let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2) let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') { if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id)) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id+'&userName='+this.userInfo().username))
} else if (fileSuffix == '.docx') { } else if (fileSuffix == '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank') window.open(url, '_blank')
@@ -1614,7 +1614,7 @@
let index2 = fileName.length let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2) let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') { if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + id)) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + id+'&userName='+this.userInfo().username))
} else if (fileSuffix == '.docx') { } else if (fileSuffix == '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix)
window.open(url, '_blank') window.open(url, '_blank')
@@ -1622,12 +1622,12 @@
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix)
window.open(url, '_blank') window.open(url, '_blank')
} else { } else {
downloadFile('/sys/common/downLoadFile', name, { id: id }) downloadFile('/sys/common/downLoadFile', name, { id: id ,userName:this.userInfo().username})
} }
}, },
download(item) { download(item) {
downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id }) downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id ,userName:this.userInfo().username})
}, },
clickButtonToUpload(item, num) { clickButtonToUpload(item, num) {
@@ -35,6 +35,7 @@
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getAction, postAction, downFile, downloadFile, putAction } from '@/api/manage' import { getAction, postAction, downFile, downloadFile, putAction } from '@/api/manage'
import { Base64 } from 'js-base64' import { Base64 } from 'js-base64'
import { mapGetters } from 'vuex'
export default { export default {
name: 'resultReportedUpload', name: 'resultReportedUpload',
@@ -74,6 +75,7 @@
} }
}, },
methods: { methods: {
...mapGetters(['userInfo']),
clickButtonToUploadFile(item) { clickButtonToUploadFile(item) {
this.uploadQuery = item this.uploadQuery = item
this.myfileList = [] this.myfileList = []
@@ -208,7 +210,7 @@
let index2 = fileName.length let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2) let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix === '.pdf') { if (fileSuffix === '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id)) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id+'&userName='+this.userInfo().username))
} else if (fileSuffix === '.docx') { } else if (fileSuffix === '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank') window.open(url, '_blank')
@@ -216,7 +218,7 @@
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank') window.open(url, '_blank')
} else { } else {
downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id }) downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id,userName:this.userInfo().username })
} }
} }
} }
@@ -463,7 +463,7 @@
let index2 = fileName.length let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2) let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') { if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id)) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id+'&userName='+this.userInfo().username))
} else if (fileSuffix == '.docx') { } else if (fileSuffix == '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank') window.open(url, '_blank')
@@ -480,7 +480,7 @@
let index2 = fileName.length let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2) let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') { if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + id)) window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + id+'&userName='+this.userInfo().username))
} else if (fileSuffix == '.docx') { } else if (fileSuffix == '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix) let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix)
window.open(url, '_blank') window.open(url, '_blank')
@@ -492,7 +492,7 @@
} }
}, },
download(item) { download(item) {
downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id }) downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id ,userName:this.userInfo().username})
}, },
clickButtonToUpload(item) { clickButtonToUpload(item) {
this.loading = true this.loading = true
@@ -45,11 +45,12 @@
<div class="process-content-right-xian"></div> <div class="process-content-right-xian"></div>
<div class="process-content-content" :style="val.left" <div class="process-content-content" :style="val.left"
v-for="(val,indexOne) in item.data[0]" :key="indexOne"> v-for="(val,indexOne) in item.data[0]" :key="indexOne">
<div class="process-content-right-top" :title="val.name">{{val.name}}</div>
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template slot="title"> <template slot="title">
<span>{{val.time.slice(0,11)}}</span> <span>{{val.time.slice(0,11)}}</span>
</template> </template>
<div class="process-content-right-top">{{val.name}}</div>
<img v-if="val.status == 1" src="../../../../assets/done.svg" class="process-content-left" alt=""> <img v-if="val.status == 1" src="../../../../assets/done.svg" class="process-content-left" alt="">
<img v-else-if="val.status == 2" src="../../../../assets/open.svg" <img v-else-if="val.status == 2" src="../../../../assets/open.svg"
class="process-content-left" class="process-content-left"
@@ -109,10 +110,73 @@
this.handlingTime = moment(new Date()).format('YYYY-MM-DD') this.handlingTime = moment(new Date()).format('YYYY-MM-DD')
}, },
methods: { methods: {
getNewDate(flag, many) {
const thirtyDays = [4, 6, 9, 11] // 30天的月份
const thirtyOneDays = [1, 3, 5, 7, 8, 10, 12] // 31天的月份
const currDate = new Date() // 今天日期
const year = currDate.getFullYear()
let month = currDate.getMonth() + 1
let targetDateMilli = 0
let GMTDate = '' // 中国标准时间
let targetYear = '' // 年
let targetMonth = '' // 月
let targetDate = '' // 日
let dealTargetDays = '' // 目标日期
const isLeapYear = !!((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) // 是否是闰年
let countDays = 0 // 累计天数
for (let i = 0; i < many; i++) {
if (flag === 'before') {
month = month - 1 <= 0 ? 12 : month - 1
} else {
month = month + 1 > 12 ? 1 : month + 1
}
thirtyDays.includes(month) ? (countDays += 30) : thirtyOneDays.includes(month) ? (countDays += 31) : isLeapYear ? (countDays += 29) : (countDays += 28)
}
targetDateMilli = currDate.setDate(
currDate.getDate() - (flag === 'before' ? countDays : countDays * -1)
)
GMTDate = new Date(targetDateMilli)
targetYear = GMTDate.getFullYear()
targetMonth = GMTDate.getMonth() + 1
targetDate = GMTDate.getDate()
targetMonth = targetMonth.toString().padStart(2, '0')
targetDate = targetDate.toString().padStart(2, '0')
dealTargetDays = `${targetYear}-${targetMonth}`
return dealTargetDays
},
getTimeline() { getTimeline() {
let query = { let query = {
startTime: this.startTime, startTime: this.startTime || this.getNewDate('before', 6),
endTime: this.endTime endTime: this.endTime || this.getNewDate('after', 5)
} }
this.loadingMain = true this.loadingMain = true
getAction(this.url.timeline, query).then((res) => { getAction(this.url.timeline, query).then((res) => {
@@ -143,8 +207,8 @@
}, },
getTimelineList(time) { getTimelineList(time) {
let query = { let query = {
startTime: this.startTime, startTime: this.startTime || this.getNewDate('before', 6),
endTime: this.endTime endTime: this.endTime || this.getNewDate('after', 5)
} }
getAction(this.url.timelineList, query).then((res) => { getAction(this.url.timelineList, query).then((res) => {
if (res.success) { if (res.success) {
@@ -355,7 +419,7 @@
} }
.box-top-content-left { .box-top-content-left {
width: 160px; width: 140px;
float: left; float: left;
padding-top: 100px; padding-top: 100px;
margin-right: 20px; margin-right: 20px;
@@ -364,8 +428,8 @@
.box-top-content-left-text { .box-top-content-left-text {
color: #191E29; color: #191E29;
font-weight: bold; font-weight: bold;
font-size: 14px; font-size: 12px;
height: 104px; height: 84px;
letter-spacing: 0px; letter-spacing: 0px;
text-align: left; text-align: left;
text-overflow: ellipsis; text-overflow: ellipsis;
@@ -374,7 +438,7 @@
} }
.box-top-content-right { .box-top-content-right {
width: calc(100% - 180px); width: calc(100% - 160px);
float: left; float: left;
} }
@@ -392,7 +456,7 @@
height: 36px; height: 36px;
color: #54565A; color: #54565A;
font-weight: bold; font-weight: bold;
font-size: 14px; font-size: 13px;
line-height: 36px; line-height: 36px;
letter-spacing: 0px; letter-spacing: 0px;
text-align: center; text-align: center;
@@ -409,7 +473,7 @@
.process-content { .process-content {
position: relative; position: relative;
height: 104px; height: 84px;
.process-content-content { .process-content-content {
background: #fff; background: #fff;
@@ -430,15 +494,22 @@
} }
.process-content-right-top { .process-content-right-top {
font-size: 14px; font-size: 12px;
color: #040B29; color: #040B29;
max-width: 155px; width: 50px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden; overflow: hidden;
position: absolute; position: absolute;
top: -8px; top: -14px;
left: 50%; left: 50%;
line-height: 1.2;
display: -webkit-box;
text-overflow: ellipsis;
/*! autoprefixer: off */
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
/*! autoprefixer: on;*/
text-justify: inter-ideograph;
word-break: break-all;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
@@ -242,11 +242,73 @@
this.handlingTime = moment(new Date()).format('YYYY-MM-DD') this.handlingTime = moment(new Date()).format('YYYY-MM-DD')
}, },
methods: { methods: {
getNewDate(flag, many) {
const thirtyDays = [4, 6, 9, 11] // 30天的月份
const thirtyOneDays = [1, 3, 5, 7, 8, 10, 12] // 31天的月份
const currDate = new Date() // 今天日期
const year = currDate.getFullYear()
let month = currDate.getMonth() + 1
let targetDateMilli = 0
let GMTDate = '' // 中国标准时间
let targetYear = '' // 年
let targetMonth = '' // 月
let targetDate = '' // 日
let dealTargetDays = '' // 目标日期
const isLeapYear = !!((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) // 是否是闰年
let countDays = 0 // 累计天数
for (let i = 0; i < many; i++) {
if (flag === 'before') {
month = month - 1 <= 0 ? 12 : month - 1
} else {
month = month + 1 > 12 ? 1 : month + 1
}
thirtyDays.includes(month) ? (countDays += 30) : thirtyOneDays.includes(month) ? (countDays += 31) : isLeapYear ? (countDays += 29) : (countDays += 28)
}
targetDateMilli = currDate.setDate(
currDate.getDate() - (flag === 'before' ? countDays : countDays * -1)
)
GMTDate = new Date(targetDateMilli)
targetYear = GMTDate.getFullYear()
targetMonth = GMTDate.getMonth() + 1
targetDate = GMTDate.getDate()
targetMonth = targetMonth.toString().padStart(2, '0')
targetDate = targetDate.toString().padStart(2, '0')
dealTargetDays = `${targetYear}-${targetMonth}`
return dealTargetDays
},
getTimeline() { getTimeline() {
let query = { let query = {
startTime: this.startTime, startTime: this.startTime || this.getNewDate('before',6),
endTime: this.endTime, endTime: this.endTime || this.getNewDate('after',5),
...this.queryParam ...this.queryParam
} }
this.loadingMain = true this.loadingMain = true
@@ -278,8 +340,8 @@
}, },
getTimelineList(time) { getTimelineList(time) {
let query = { let query = {
startTime: this.startTime, startTime: this.startTime || this.getNewDate('before',6),
endTime: this.endTime, endTime: this.endTime || this.getNewDate('after',5),
...this.queryParam ...this.queryParam
} }
getAction(this.url.timelineList, query).then((res) => { getAction(this.url.timelineList, query).then((res) => {
@@ -104,7 +104,8 @@
'1': this.$t('SubscriptionNotification'), '1': this.$t('SubscriptionNotification'),
'2': this.$t('warningInformation'), '2': this.$t('warningInformation'),
'3': this.$t('ForwardPush'), '3': this.$t('ForwardPush'),
'4': this.$t('authenticationMessage') '4': this.$t('authenticationMessage'),
'5': this.$t('taskRegulationComplianceTask')
}, },
columns: [ columns: [
{ {