合并分支 'dev_2nd_period_test' 到 'master'
Dev 2nd period test 查看合并请求 laws-nio/laws-weilai!236
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
-- 二期一阶段的表变更,必须添加的固定数据以sql形式放到此处
|
||||
|
||||
|
||||
-- 项目库添加字段(项目版本,软件版本,说明)---------2022-10-18 未同步生产环境
|
||||
ALTER TABLE `laws_weilai`.`project_library_base`
|
||||
ADD COLUMN `parent_id` varchar(255) NULL COMMENT '主项目id' AFTER `update_by`,
|
||||
ADD COLUMN `project_version` varchar(255) NULL COMMENT '项目版本' AFTER `parent_id`,
|
||||
ADD COLUMN `explanation` varchar(2000) NULL COMMENT '说明' AFTER `project_version`,
|
||||
ADD COLUMN `software_version` varchar(255) NULL COMMENT '软件版本' AFTER `explanation`;
|
||||
|
||||
-- 项目库添加字段(排序)---------2022-10-18 未同步生产环境
|
||||
ALTER TABLE `laws_weilai`.`project_library_base`
|
||||
ADD COLUMN `sort` varchar(255) NULL COMMENT '排序(用于置顶功能)' AFTER `software_version`,
|
||||
ADD COLUMN `flag` varchar(255) NULL COMMENT '置顶(flag为空的时候为置顶, flag为1的时候取消置顶)' AFTER `sort`;
|
||||
|
||||
-- 认证参数列表添加字段--------2022-10-20 未同步生产环境
|
||||
ALTER TABLE `laws_weilai`.`params_manifest`
|
||||
ADD COLUMN `project_version` varchar(255) NULL COMMENT '相关项目版本' AFTER `params_template_name`,
|
||||
ADD COLUMN `explanation` varchar(2000) NULL COMMENT '说明' AFTER `project_version`;
|
||||
|
||||
-- 项目库修改认证软件版本字段长度---------2022-11-01 未同步生产环境
|
||||
ALTER TABLE `laws_weilai`.`project_library_base`
|
||||
MODIFY COLUMN `software_version` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '软件版本' AFTER `explanation`;
|
||||
|
||||
-- 认证参数历史列表添加字段--------2022-11-02 未同步生产环境
|
||||
ALTER TABLE `laws_weilai`.`params_manifest_history`
|
||||
ADD COLUMN `project_version` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '相关项目版本' AFTER `params_template_name`,
|
||||
ADD COLUMN `explanation` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '说明' AFTER `project_version`;
|
||||
|
||||
@@ -1204,5 +1204,8 @@ ALTER TABLE `laws_weilai`.`laws_monthly_report_write`
|
||||
MODIFY COLUMN `work_progress_cn` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'NIO工作进展中文' AFTER `content_en`,
|
||||
MODIFY COLUMN `work_progress_en` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'NIO工作进展英文' AFTER `work_progress_cn`;
|
||||
|
||||
--文档拆分条款 条款号取消必填 2022-10-25 未同步生产环境
|
||||
UPDATE `laws_weilai`.`onl_cgform_field` SET `field_must_input` = '0' WHERE `id` = '0a455895498552bc709dff250b3364b1'
|
||||
|
||||
--参数收集清单 添加英文
|
||||
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Control Component' WHERE `id` = '84fec4a260dc646dc570cbf7cb581dab';
|
||||
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Component Value' WHERE `id` = '5d468613746f413a53fa0b485089839b';
|
||||
UPDATE `laws_weilai`.`onl_cgform_field` SET `db_field_en_name` = 'Validate Component' WHERE `id` = '608274a6a6dfed0e183093d9ea357436';
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.jero.common.constant.enums;
|
||||
|
||||
public enum MessageType2Enum {
|
||||
|
||||
|
||||
SUBSCRIPTION_NOTIFICATION("Subscription Notification","订阅通知"),
|
||||
SHARE_FORWARD("Share Forward","转发推送"),
|
||||
REGULATION_EARLY_WARNING("Regulation Early Warning","法规预警"),
|
||||
REGULATION_LIST_CONFIRMATION("Regulation List Confirmation","法规清单确认"),
|
||||
REGULATION_TASK_CONFIRMATION("Regulation Task Confirmation","法规任务确认"),
|
||||
DESIGN_COMPLIANCE_CONFIRMATION("Design Compliance Confirmation","设计符合性确认"),
|
||||
PRE_HOMO_CONFIRMATION("Pre-Homo Confirmation","Pre-Homo确认"),
|
||||
VALIDATION_COMPLIANCE_CONFIRMATION("Validation Compliance Confirmation","验证符合性确认"),
|
||||
REGULATION_OPINION_COLLECTION("Regulation Opinion Collection","法规意见收集"),
|
||||
REGULATION_TECHNICAL_ASSESSMENT("Regulation Technical Assessment","法规技术评估"),
|
||||
HOMO_PARAMETER_COLLECTION("Homo Parameter Collection","认证参数收集");
|
||||
|
||||
String en;
|
||||
String cn;
|
||||
|
||||
MessageType2Enum(String en, String cn) {
|
||||
this.en = en;
|
||||
this.cn = cn;
|
||||
}
|
||||
|
||||
public String getEn() {
|
||||
return en;
|
||||
}
|
||||
|
||||
public void setEn(String en) {
|
||||
this.en = en;
|
||||
}
|
||||
|
||||
public String getCn() {
|
||||
return cn;
|
||||
}
|
||||
|
||||
public void setCn(String cn) {
|
||||
this.cn = cn;
|
||||
}
|
||||
}
|
||||
+22
-12
@@ -6,11 +6,11 @@ package com.jero.common.constant.enums;
|
||||
* @auth zhn
|
||||
*/
|
||||
public enum MessageTypeEnum {
|
||||
READ("Subscription Notification","1"),
|
||||
WARN("Early Warning","2"),
|
||||
PUSH("Share / Forward","3"),
|
||||
HOMO_TASK("Homo Parameter Task","4"),
|
||||
TASK("Regulation Compliance Task", "5"),
|
||||
READ("Subscription Notification","订阅通知","1"),
|
||||
WARN("Regulation Early Warning","法规预警","2"),
|
||||
PUSH("Share / Forward","转发推送","3"),
|
||||
HOMO_TASK("Homo Parameter Task","","4"),
|
||||
TASK("Regulation Compliance Task","", "5"),
|
||||
//REGULATION_LIST_CONFIRMATION_TASK("Regulation List Confirmation Task", "6"), // 清单确认任务
|
||||
//REGULATION_LIST_CONFIRMATION_NOTIFICATION("Regulation List Confirmation Notification", "7"), // 清单确认通知
|
||||
//REGULATION_TASK_CONFIRMATION_TASK("Regulation Task Confirmation", "8"), // 任务确认任务
|
||||
@@ -21,19 +21,21 @@ public enum MessageTypeEnum {
|
||||
//DESIGN_COMPLIANCE_NOTIFICATION("Design Compliance Notification", "12"), // 设计符合性通知
|
||||
//PRE_HOMO_NOTIFICATION("Pre-Homo Notification", "13"), // Pre-Homo通知
|
||||
//VALIDATION_COMPLIANCE_NOTIFICATION("Validation Compliance Notification", "14"), // 验证符合性通知
|
||||
SYSTEMATIC_NOTIFICATION("Systematic Notification", "15"), // 系统通知
|
||||
LIST_CONFIRMATION("List Confirmation", "17"), // 清单确认
|
||||
TASK_CONFIRMATION("Task Confirmation", "18"), // 任务确认
|
||||
COMPLIANCE_CONFIRMATION("Compliance Confirmation", "19"), // 符合性确认
|
||||
COLLECTION_OF_LEGISLATIVE_COMMENTS("Collection of Legislative Comments", "20"), // 法规意见收集
|
||||
REGULATORY_AND_TECHNICAL_ASSESSMENT("Regulatory and technical assessment", "21"), // 法规技术评估
|
||||
SYSTEMATIC_NOTIFICATION("Systematic Notification","", "15"), // 系统通知
|
||||
LIST_CONFIRMATION("List Confirmation", "","17"), // 清单确认
|
||||
TASK_CONFIRMATION("Task Confirmation", "","18"), // 任务确认
|
||||
COMPLIANCE_CONFIRMATION("Compliance Confirmation","", "19"), // 符合性确认
|
||||
COLLECTION_OF_LEGISLATIVE_COMMENTS("Collection of Legislative Comments","", "20"), // 法规意见收集
|
||||
REGULATORY_AND_TECHNICAL_ASSESSMENT("Regulatory and technical assessment", "","21"), // 法规技术评估
|
||||
;
|
||||
|
||||
String name;
|
||||
String nameCn;
|
||||
String value;
|
||||
|
||||
private MessageTypeEnum(String name, String value) {
|
||||
private MessageTypeEnum(String name,String nameCn, String value) {
|
||||
this.name = name;
|
||||
this.nameCn = nameCn;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@@ -52,4 +54,12 @@ public enum MessageTypeEnum {
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getNameCn() {
|
||||
return nameCn;
|
||||
}
|
||||
|
||||
public void setNameCn(String nameCn) {
|
||||
this.nameCn = nameCn;
|
||||
}
|
||||
}
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.jero.common.constant.enums;
|
||||
|
||||
public enum MsgColorEnum {
|
||||
|
||||
GREEN("其他","green"),
|
||||
RED("任务被拒绝","red"),
|
||||
YELLOW("任务逾期","yellow");
|
||||
|
||||
String label;
|
||||
String value;
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
MsgColorEnum(String label, String value) {
|
||||
this.label = label;
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
+6
@@ -152,11 +152,17 @@ public class ShiroConfig {
|
||||
filterChainDefinitionMap.put("/lawsTechnologyEvaluation/lawsTechnologyEvaluationEO/processCall", "anon");
|
||||
// 法规技术评估-条款信息评估结果表 工作流处理数据接口排除
|
||||
filterChainDefinitionMap.put("/lawsTechnologyEvaluation/lawsTechnologyEvaluationItemResultEO/processCall", "anon");
|
||||
// 流程信息表 工作流处理数据接口排除
|
||||
filterChainDefinitionMap.put("/todoCenter/processInfoEO/processCall", "anon");
|
||||
// 流程信息明细表 工作流处理数据接口排除
|
||||
filterChainDefinitionMap.put("/todoCenter/processInfoDetailEO/processCall", "anon");
|
||||
|
||||
filterChainDefinitionMap.put("/lark/larkEventSubscriptionConfig", "anon"); //飞书调用接口,事件订阅配置。
|
||||
filterChainDefinitionMap.put("/lark/larkCardMessageConfig", "anon"); //飞书调用接口,卡片消息配置。
|
||||
filterChainDefinitionMap.put("/sys/user/querySysUserListByIdList", "anon"); // 工作流根据用户idList获取用户信息接口
|
||||
filterChainDefinitionMap.put("/project/projectTaskInventoryConditionAssessmentEO/initConditionAssessment", "anon"); // 初始化项目当前状态数据接口
|
||||
filterChainDefinitionMap.put("/todoCenter/projectProcess/initHistoryData", "anon"); // 待办中心-初始化历史数据接口排除
|
||||
filterChainDefinitionMap.put("/project/projectTaskInventoryEO/disposeHistoryData", "anon"); // 项目库-任务清单 处理历史数据接口
|
||||
|
||||
// 添加自己的过滤器并且取名为jwt
|
||||
Map<String, Filter> filterMap = new HashMap<String, Filter>(1);
|
||||
|
||||
+3
-3
@@ -158,11 +158,11 @@ public class CommonController {
|
||||
// bizPath = "";
|
||||
// }
|
||||
}
|
||||
if(file.getOriginalFilename().length()>70){
|
||||
if(file.getOriginalFilename().length()>100){
|
||||
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
|
||||
throw new JeroBootException("文件名长度不能超过70位,请检查!");
|
||||
throw new JeroBootException("文件名长度不能超过100位,请检查!");
|
||||
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
throw new JeroBootException("File name length cannot exceed 70 characters, please check!");
|
||||
throw new JeroBootException("File name length cannot exceed 100 characters, please check!");
|
||||
}
|
||||
}
|
||||
// OSSFile oSSFile = ossFileService.uploadLocal(file, bizPath,state,cut);
|
||||
|
||||
+48
-2
@@ -5,13 +5,14 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.modules.system.enums.SysPermissionEnum;
|
||||
import com.jero.modules.system.mapper.TodoCenterMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.system.util.JwtUtil;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.MD5Util;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
@@ -54,6 +55,9 @@ public class SysPermissionController {
|
||||
@Autowired
|
||||
private ISysDepartPermissionService sysDepartPermissionService;
|
||||
|
||||
@Autowired
|
||||
private TodoCenterMapper todoCenterMapper;
|
||||
|
||||
/**
|
||||
* 加载数据节点
|
||||
*
|
||||
@@ -641,6 +645,48 @@ public class SysPermissionController {
|
||||
if (isWWWHttpUrl(permission.getUrl())) {
|
||||
meta.put("url", permission.getUrl());
|
||||
}
|
||||
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
Map<String,Object> params = new HashMap<>();
|
||||
params.put("currentUserId",currentUser.getId());
|
||||
|
||||
List<String> flowTypeList = new ArrayList<>();
|
||||
//项目法规任务
|
||||
if(StringUtils.equals(permission.getId(), SysPermissionEnum.PROJECT_REGULATION_TASKS.getId())){
|
||||
flowTypeList.add("1");
|
||||
flowTypeList.add("2");
|
||||
flowTypeList.add("3");
|
||||
flowTypeList.add("4");
|
||||
flowTypeList.add("10");
|
||||
params.put("flowTypeList",flowTypeList);
|
||||
//存在待办任务标识,true为有
|
||||
boolean existTaskFlag = false;
|
||||
int result = todoCenterMapper.todoCenterTaskCount(params);
|
||||
if(result > 0){
|
||||
existTaskFlag = true;
|
||||
}
|
||||
//查询当前登录用户是否有项目法规任务
|
||||
meta.put("existTask",existTaskFlag);
|
||||
}
|
||||
//法规评估任务
|
||||
if(StringUtils.equals(permission.getId(), SysPermissionEnum.REGULATORY_ASSESSMENT_TASKS.getId())){
|
||||
flowTypeList.add("5");
|
||||
flowTypeList.add("6");
|
||||
params.put("flowTypeList",flowTypeList);
|
||||
int result = todoCenterMapper.todoCenterTaskCount(params);
|
||||
boolean existTaskFlag = false;
|
||||
if(result > 0){
|
||||
existTaskFlag = true;
|
||||
}
|
||||
meta.put("existTask",existTaskFlag);
|
||||
}
|
||||
//项目参数任务
|
||||
if(StringUtils.equals(permission.getId(), SysPermissionEnum.PROJECT_PARAMETER_TASKS.getId())){
|
||||
boolean existTaskFlag = false;
|
||||
existTaskFlag = sysPermissionService.judgeToDo();
|
||||
meta.put("existTask",existTaskFlag);
|
||||
}
|
||||
json.put("meta", meta);
|
||||
}
|
||||
|
||||
|
||||
+4
@@ -157,4 +157,8 @@ public class SysAnnouncement implements Serializable {
|
||||
* 发起人
|
||||
*/
|
||||
private java.lang.String initiator;
|
||||
|
||||
private java.lang.String msgContentCn;//消息的中文(不带标签)
|
||||
|
||||
private java.lang.String msgContentInfoCn;//消息的中文(带标签)
|
||||
}
|
||||
|
||||
+2
@@ -4,6 +4,8 @@ public enum RoleEnum {
|
||||
ADMIN_ID("R&H Manager","R&H Manager","manager","1534020391015444481",2),
|
||||
MANAGER_ID("系统管理员","Administrator","admin","f6817f48af4fb3af11b9e8bf182f618b",3),
|
||||
COUNTRU_CARD_MANAGE("countryCard管理员","countryCardManage","countryCardManage","1564916346120916993",4),
|
||||
ENGINEERING_INTERFACE_PERSON("工程接口人","engineeringInterfacePerson","engineeringInterfacePerson","1534020084667674626",5),
|
||||
ENGINEER("工程师","engineer","engineer","1534020318437208065",6),
|
||||
;
|
||||
|
||||
String name;
|
||||
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.jero.modules.system.enums;
|
||||
|
||||
/**
|
||||
* 菜单权限枚举类
|
||||
* @Author: wzj
|
||||
* @Date: 2022/10/26 16:14
|
||||
**/
|
||||
public enum SysPermissionEnum {
|
||||
|
||||
PROJECT_REGULATION_TASKS("项目法规任务","1580735287309119489",""),
|
||||
REGULATORY_ASSESSMENT_TASKS("法规评估任务","1580735611793059842",""),
|
||||
PROJECT_PARAMETER_TASKS("项目参数任务","1580735965892980738","");
|
||||
|
||||
private String name;
|
||||
private String id;
|
||||
private String value;
|
||||
|
||||
private SysPermissionEnum(String name,String id, String value) {
|
||||
this.name = name;
|
||||
this.id = id;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.jero.modules.system.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 待办中心mapper层
|
||||
* @Author: wzj
|
||||
* @Date: 2022/10/26 16:41
|
||||
**/
|
||||
public interface TodoCenterMapper {
|
||||
int todoCenterTaskCount(@Param("params") Map<String, Object> params);
|
||||
|
||||
List<String> listInfoHomo(@Param("userId") String userId, @Param("state") String state);
|
||||
|
||||
Integer countSdtDre(@Param("userName") String userName);
|
||||
|
||||
Integer countState(@Param("manifestId") String manifestId);
|
||||
}
|
||||
+8
-2
@@ -18,6 +18,8 @@
|
||||
<result column="open_page" property="openPage" jdbcType="VARCHAR"/>
|
||||
<result column="document_id" property="documentId" jdbcType="VARCHAR"/>
|
||||
<result column="initiator" property="initiator" jdbcType="VARCHAR"/>
|
||||
<result column="msg_content_cn" property="msgContentCn" jdbcType="VARCHAR"/>
|
||||
<result column="msg_content_info_cn" property="msgContentInfoCn" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="queryByUserId" parameterType="String" resultType="String">
|
||||
@@ -43,7 +45,9 @@
|
||||
sa.open_page as open_page,
|
||||
sa.msg_abstract,
|
||||
sa.document_id as document_id,
|
||||
sa.initiator as initiator
|
||||
sa.initiator as initiator,
|
||||
sa.msg_content_cn as msg_content_cn,
|
||||
sa.msg_content_info_cn as msg_content_info_cn
|
||||
from sys_announcement_send sas
|
||||
left join sys_announcement sa ON sas.annt_id = sa.id
|
||||
where sa.del_flag = '0'
|
||||
@@ -88,7 +92,9 @@
|
||||
sa.open_type as open_type,
|
||||
sa.open_page as open_page,
|
||||
sa.msg_abstract,
|
||||
sa.document_id as document_id
|
||||
sa.document_id as document_id,
|
||||
sa.msg_content_cn as msg_content_cn,
|
||||
sa.msg_content_info_cn as msg_content_info_cn
|
||||
from sys_announcement_send sas
|
||||
left join sys_announcement sa ON sas.annt_id = sa.id
|
||||
where sa.del_flag = '0'
|
||||
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.system.mapper.TodoCenterMapper">
|
||||
|
||||
<select id="todoCenterTaskCount" resultType="java.lang.Integer">
|
||||
select
|
||||
count(1)
|
||||
from
|
||||
process_info pi
|
||||
where
|
||||
pi.id in (
|
||||
select detail.process_info_id from process_info_detail detail where detail.status = 'NotDone' and detail.user_id = #{params.currentUserId}
|
||||
)
|
||||
<if test="params.flowTypeList != null ">
|
||||
and pi.flow_type in
|
||||
<foreach collection="params.flowTypeList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="listInfoHomo" resultType="java.lang.String">
|
||||
SELECT pm.id
|
||||
FROM params_manifest pm
|
||||
JOIN ( SELECT id FROM
|
||||
( SELECT id,substring_index( substring_index( a.certification_engineer, ',', b.help_topic_id + 1 ), ',',- 1 ) user_id
|
||||
FROM
|
||||
project_library_base a
|
||||
JOIN mysql.help_topic b ON b.help_topic_id < ( length( a.certification_engineer ) - length( REPLACE ( a.certification_engineer, ',', '' ) ) + 1 )) temp
|
||||
WHERE user_id = #{userId}) a ON pm.project_id = a.id
|
||||
where pm.state = #{state}
|
||||
</select>
|
||||
|
||||
<select id="countSdtDre" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from (
|
||||
SELECT DISTINCT pcm.params_manifest_id AS pm
|
||||
FROM params_collect_manifest pcm
|
||||
WHERE sdt = #{userName}
|
||||
and state in ('2', '5')
|
||||
|
||||
UNION
|
||||
SELECT DISTINCT pcm.params_manifest_id AS pm
|
||||
FROM params_collect_manifest pcm
|
||||
WHERE dre = #{userName}
|
||||
and state in ('4', '7')
|
||||
) temp
|
||||
</select>
|
||||
|
||||
<select id="countState" resultType="java.lang.Integer">
|
||||
select count(1) from params_collect_manifest
|
||||
where params_manifest_id = #{manifestId} and id not in(
|
||||
select id from params_collect_manifest where params_manifest_id = #{manifestId} and state in('7','8')
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
||||
+4
@@ -87,4 +87,8 @@ public class AnnouncementSendModel implements Serializable {
|
||||
*/
|
||||
private java.lang.String initiator;
|
||||
|
||||
private java.lang.String msgContentCn;//消息的中文(不带标签)
|
||||
|
||||
private java.lang.String msgContentInfoCn;//消息的中文(带标签)
|
||||
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,13 +1,11 @@
|
||||
package com.jero.modules.system.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.system.entity.SysPermission;
|
||||
import com.jero.modules.system.model.TreeModel;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -61,4 +59,6 @@ public interface ISysPermissionService extends IService<SysPermission> {
|
||||
* @return
|
||||
*/
|
||||
public boolean hasPermission(String username, String url);
|
||||
|
||||
boolean judgeToDo();
|
||||
}
|
||||
|
||||
+13
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.system.vo.SysUserCacheInfo;
|
||||
import com.jero.modules.system.entity.PPEmployee;
|
||||
import com.jero.modules.system.entity.SysRole;
|
||||
@@ -276,4 +277,16 @@ public interface ISysUserService extends IService<SysUser> {
|
||||
* @return
|
||||
*/
|
||||
boolean isAdministrator();
|
||||
|
||||
/**
|
||||
* 验证当前登录用户是否是工程接口人角色
|
||||
* @return
|
||||
*/
|
||||
boolean isEngineeringInterfacePerson(LoginUser currentUser);
|
||||
|
||||
/**
|
||||
* 验证当前登录用户是否是工程师角色
|
||||
* @return
|
||||
*/
|
||||
boolean isEngineer(LoginUser currentUser);
|
||||
}
|
||||
|
||||
+37
-14
@@ -1,33 +1,32 @@
|
||||
package com.jero.modules.system.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.CacheConstant;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.system.entity.SysPermission;
|
||||
import com.jero.modules.system.entity.SysPermissionDataRule;
|
||||
import com.jero.modules.system.mapper.SysDepartPermissionMapper;
|
||||
import com.jero.modules.system.mapper.SysDepartRolePermissionMapper;
|
||||
import com.jero.modules.system.mapper.SysPermissionMapper;
|
||||
import com.jero.modules.system.mapper.SysRolePermissionMapper;
|
||||
import com.jero.modules.system.mapper.*;
|
||||
import com.jero.modules.system.model.TreeModel;
|
||||
import com.jero.modules.system.service.ISysPermissionDataRuleService;
|
||||
import com.jero.modules.system.service.ISysPermissionService;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -55,6 +54,9 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
||||
@Resource
|
||||
private SysDepartRolePermissionMapper sysDepartRolePermissionMapper;
|
||||
|
||||
@Autowired
|
||||
private TodoCenterMapper todoCenterMapper;
|
||||
|
||||
@Override
|
||||
public List<TreeModel> queryListByParentId(String parentId) {
|
||||
return sysPermissionMapper.queryListByParentId(parentId);
|
||||
@@ -263,4 +265,25 @@ public class SysPermissionServiceImpl extends ServiceImpl<SysPermissionMapper, S
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean judgeToDo() {
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
|
||||
int count = todoCenterMapper.countSdtDre(loginUser.getUsername());
|
||||
if (count > 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
List<String> manifestIdList = todoCenterMapper.listInfoHomo(loginUser.getId(),"收集中");
|
||||
if(CollectionUtil.isNotEmpty(manifestIdList)) {
|
||||
for (int i = 0; i < manifestIdList.size(); i++) {
|
||||
int coutState = todoCenterMapper.countState(manifestIdList.get(i));
|
||||
if (coutState > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+42
@@ -614,4 +614,46 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEngineeringInterfacePerson(LoginUser currentUser) {
|
||||
boolean result = false;
|
||||
RoleEnum engineeringInterfacePerson = RoleEnum.ENGINEERING_INTERFACE_PERSON;
|
||||
List<SysUserRole> userRoleList = this.sysUserRoleMapper.selectList(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, currentUser.getId()));
|
||||
if(CollectionUtils.isNotEmpty(userRoleList)){
|
||||
List<SysUserRole> userRoles = userRoleList.stream().filter(userRole -> {
|
||||
boolean flag = false;
|
||||
if(StringUtils.equals(userRole.getRoleId(),engineeringInterfacePerson.getId())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
if(CollectionUtils.isNotEmpty(userRoles)){
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEngineer(LoginUser currentUser) {
|
||||
boolean result = false;
|
||||
RoleEnum engineer = RoleEnum.ENGINEER;
|
||||
List<SysUserRole> userRoleList = this.sysUserRoleMapper.selectList(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, currentUser.getId()));
|
||||
if(CollectionUtils.isNotEmpty(userRoleList)){
|
||||
List<SysUserRole> userRoles = userRoleList.stream().filter(userRole -> {
|
||||
boolean flag = false;
|
||||
if(StringUtils.equals(userRole.getRoleId(),engineer.getId())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
if(CollectionUtils.isNotEmpty(userRoles)){
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
+21
-2
@@ -19,6 +19,7 @@ import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -56,9 +57,8 @@ public class ParamsCollectManifestEOController extends JeroController<ParamsColl
|
||||
// @RequiresPermissions("params:collectManifest:list")
|
||||
public Result<List<Map<String, Object>>> getHeader(@RequestParam(name = "paramsManifestId") String paramsManifestId,
|
||||
@RequestParam(name = "flag") String flag,
|
||||
@RequestParam(name = "userType", required = false) String userType,
|
||||
@RequestParam(name = "cut") String cut) {
|
||||
List<Map<String, Object>> list = paramsCollectManifestEOService.getHeader(paramsManifestId, flag, userType, cut);
|
||||
List<Map<String, Object>> list = paramsCollectManifestEOService.getHeader(paramsManifestId, flag, cut);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
@@ -531,6 +531,25 @@ public class ParamsCollectManifestEOController extends JeroController<ParamsColl
|
||||
paramsCollectManifestEOService.exportAll(paramsCollectManifestVO, response, request);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "参数项收集清单-填写人角色下导出")
|
||||
@GetMapping(value = "/exportDre")
|
||||
// @RequiresPermissions("report:detail:export:normal")
|
||||
public void exportDre(ParamsCollectManifestVO paramsCollectManifestVO,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
paramsCollectManifestEOService.exportDre(paramsCollectManifestVO, response, request);
|
||||
}
|
||||
|
||||
@AutoLog(value = "参数项收集清单-填写人角色下导入")
|
||||
@ApiOperation(value = "参数项收集清单-填写人角色下导入")
|
||||
@PostMapping(value = "/importDre")
|
||||
// @RequiresPermissions("report:detail:export:normal")
|
||||
public Result<?> importParamsInfo( MultipartFile file,
|
||||
@RequestParam(value = "cut") String cut,
|
||||
@RequestParam(value = "paramsManifestId") String paramsManifestId) throws Exception {
|
||||
return paramsCollectManifestEOService.importDre(file, cut, paramsManifestId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 调整责任领域
|
||||
*
|
||||
|
||||
+6
@@ -103,4 +103,10 @@ public class ParamsManifestEO implements Serializable {
|
||||
@TableField(exist = false)
|
||||
private String projectName;
|
||||
|
||||
//相关项目版本
|
||||
private String projectVersion;
|
||||
|
||||
//说明
|
||||
private String explanation;
|
||||
|
||||
}
|
||||
|
||||
+6
-2
@@ -18,10 +18,14 @@ public interface ParamsCollectManifestEOMapper extends BaseMapper<ParamsCollectM
|
||||
|
||||
List<ParamsCollectManifestEO> listInfo(@Param("paramsCollectManifestEO") ParamsCollectManifestEO paramsCollectManifestEO);
|
||||
|
||||
List<Map<String, Object>> listInfoForExport(@Param("paramsCollectManifestEO") ParamsCollectManifestEO paramsCollectManifestEO);
|
||||
List<ParamsCollectManifestEO> listInfoOfTodoCenter(@Param("manifestIdList") List<String> manifestIdList);
|
||||
List<Map<String, Object>> listInfoForExport(@Param("paramsCollectManifestEO") ParamsCollectManifestEO paramsCollectManifestEO, @Param("ids") String ids);
|
||||
List<ParamsCollectManifestEO> listInfoOfTodoCenter();
|
||||
|
||||
// 查询控件类型为 标题的 参数项
|
||||
List<ParamsCollectManifestEO> listInfoOfTitle(@Param("paramsManifestId") String paramsManifestId);
|
||||
|
||||
IPage pageInfo(@Param("page") IPage page, @Param("paramsCollectManifestEO") ParamsCollectManifestEO paramsCollectManifestEO);
|
||||
}
|
||||
|
||||
List<ParamsCollectManifestEO> queryByParamManifestId(@Param("paramsManifestId") String paramsManifestIdString);
|
||||
}
|
||||
|
||||
+7
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.modules.cert.collect.entity.ParamsManifestEO;
|
||||
import com.jero.modules.cert.collect.vo.ParamsManifestVO;
|
||||
import com.jero.modules.todoCenter.entity.ParamsManifestTodoCenterEO;
|
||||
import com.jero.modules.todoCenter.vo.ParamsManifestTodoCenterEOPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@@ -24,7 +26,12 @@ public interface ParamsManifestEOMapper extends BaseMapper<ParamsManifestEO> {
|
||||
|
||||
List<ParamsManifestVO> listInfoAll(@Param("idList") List<String> idList);
|
||||
|
||||
List<ParamsManifestTodoCenterEO> listForTodoCenter(ParamsManifestTodoCenterEOPage paramsManifestTodoCenterEOPage);
|
||||
|
||||
ParamsManifestVO getProjectById(@Param("projectId") String projectId);
|
||||
|
||||
List<Map<String, String>> labelListForProjectDetails(@Param("projectId") String projectId);
|
||||
|
||||
List<String> listInfoHomo(@Param("userId") String userId, @Param("state") String state);
|
||||
|
||||
}
|
||||
|
||||
+23
-2
@@ -51,7 +51,10 @@
|
||||
AND duty_territory = #{paramsCollectManifestEO.dutyTerritory}
|
||||
</if>
|
||||
<if test="paramsCollectManifestEO.state !=null and paramsCollectManifestEO.state !=''">
|
||||
AND state = #{paramsCollectManifestEO.state}
|
||||
AND state in
|
||||
<foreach collection="paramsCollectManifestEO.state.split(',')" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramsCollectManifestEO.paramsManifestId !=null and paramsCollectManifestEO.paramsManifestId !=''">
|
||||
AND params_manifest_id = #{paramsCollectManifestEO.paramsManifestId}
|
||||
@@ -81,10 +84,24 @@
|
||||
order by del_flag desc, add_flag desc, change_flag desc, nio_number asc
|
||||
</select>
|
||||
|
||||
<select id="listInfoOfTodoCenter" resultMap="ParamsCollectManifestEOResultMap">
|
||||
select id,nio_number,state,sdt,dre,params_manifest_id from params_collect_manifest
|
||||
where params_manifest_id in
|
||||
<foreach collection="manifestIdList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="listInfoForExport" resultType="java.util.LinkedHashMap">
|
||||
select *
|
||||
from params_collect_manifest
|
||||
<include refid="BaseQuerySql"/>
|
||||
<if test="ids !=null and ids !=''">
|
||||
AND id in
|
||||
<foreach collection="ids.split(',')" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
and control_type != '11'
|
||||
order by del_flag desc, add_flag desc, change_flag desc, nio_number asc
|
||||
</select>
|
||||
@@ -104,4 +121,8 @@
|
||||
order by del_flag desc, add_flag desc, change_flag desc, nio_number asc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
<select id="queryByParamManifestId" resultMap="ParamsCollectManifestEOResultMap">
|
||||
select * from params_collect_manifest where params_manifest_id = #{paramsManifestId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
+59
-1
@@ -16,6 +16,8 @@
|
||||
<result column="params_template_id" property="paramsTemplateId" />
|
||||
<result column="params_template_publish_version" property="paramsTemplatePublishVersion" />
|
||||
<result column="params_template_name" property="paramsTemplateName" />
|
||||
<result column="project_version" property="projectVersion" />
|
||||
<result column="explanation" property="explanation" />
|
||||
</resultMap>
|
||||
<resultMap id="ParamsManifestEOResultMapForCopy" type="com.jero.modules.cert.collect.vo.ParamsManifestVO">
|
||||
<id column="id" property="id" />
|
||||
@@ -27,6 +29,8 @@
|
||||
<result column="params_template_name" property="paramsTemplateName" />
|
||||
<result column="params_template_id" property="paramsTemplateId" />
|
||||
<result column="params_template_publish_version" property="paramsTemplatePublishVersion" />
|
||||
<result column="project_version" property="projectVersion" />
|
||||
<result column="explanation" property="explanation" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="BaseColumnList">
|
||||
@@ -43,6 +47,8 @@
|
||||
pm.project_id as project_id,
|
||||
pm.params_template_id as params_template_id,
|
||||
pm.params_template_publish_version as params_template_publish_version,
|
||||
pm.project_version as project_version,
|
||||
pm.explanation as explanation,
|
||||
if (pt.params_template_name is not null, pt.params_template_name, pm.params_template_name) as params_template_name
|
||||
</sql>
|
||||
|
||||
@@ -114,11 +120,51 @@
|
||||
|
||||
</select>
|
||||
|
||||
<select id="listForTodoCenter" resultType="com.jero.modules.todoCenter.entity.ParamsManifestTodoCenterEO" parameterType="com.jero.modules.todoCenter.vo.ParamsManifestTodoCenterEOPage">
|
||||
select tmp_tb.* from(
|
||||
select
|
||||
pm.id as id,
|
||||
pm.title as title,
|
||||
pm.state as state,
|
||||
pm.project_id as project_id,
|
||||
pm.create_time as create_time,
|
||||
pm.project_version as project_version,
|
||||
concat(pni.project_name,'-',pyni.year_name,'-',plb.target_market,'-',pm.version) as project_name
|
||||
from params_manifest pm
|
||||
left join project_library_base as plb on plb.id = pm.project_id
|
||||
left join project_name_info as pni on plb.project_name_id = pni.id
|
||||
left join project_year_name_info as pyni on plb.year_name_id=pyni.id
|
||||
) tmp_tb
|
||||
where 1=1 and state = #{state}
|
||||
and id in(
|
||||
SELECT pm.id AS pm FROM params_manifest pm
|
||||
JOIN ( SELECT id FROM
|
||||
( SELECT id,substring_index( substring_index( a.certification_engineer, ',', b.help_topic_id + 1 ), ',',- 1 ) user_id
|
||||
FROM
|
||||
project_library_base a
|
||||
JOIN mysql.help_topic b ON b.help_topic_id < ( length( a.certification_engineer ) - length( REPLACE ( a.certification_engineer, ',', '' ) ) + 1 )) temp
|
||||
WHERE user_id = #{userId}) a ON pm.project_id = a.id
|
||||
|
||||
UNION
|
||||
SELECT DISTINCT pcm.params_manifest_id AS pm FROM params_collect_manifest pcm WHERE sdt = #{userName} and state in('2','5')
|
||||
|
||||
UNION
|
||||
SELECT DISTINCT pcm.params_manifest_id AS pm FROM params_collect_manifest pcm WHERE dre = #{userName} and state in('4','7')
|
||||
)
|
||||
<if test="projectName !=null and projectName !=''">
|
||||
AND project_name LIKE CONCAT(CONCAT('%',#{projectName}),'%')
|
||||
</if>
|
||||
<if test="title !=null and title !=''">
|
||||
AND title LIKE CONCAT(CONCAT('%',#{title}),'%')
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getProjectById" resultMap="ParamsManifestEOResultMapForCopy">
|
||||
select tmp_tb.* from(
|
||||
select
|
||||
plb.id as project_id,
|
||||
concat(pni.project_name,'-',pyni.year_name,' ',target_market) as project_name
|
||||
concat(pni.project_name,'-',pyni.year_name,'-',target_market,'-',project_version) as project_name
|
||||
from project_library_base plb
|
||||
left join project_name_info as pni on plb.project_name_id = pni.id
|
||||
left join project_year_name_info as pyni on plb.year_name_id = pyni.id
|
||||
@@ -134,4 +180,16 @@
|
||||
where project_id = #{projectId}
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="listInfoHomo" resultType="java.lang.String">
|
||||
SELECT pm.id
|
||||
FROM params_manifest pm
|
||||
JOIN ( SELECT id FROM
|
||||
( SELECT id,substring_index( substring_index( a.certification_engineer, ',', b.help_topic_id + 1 ), ',',- 1 ) user_id
|
||||
FROM
|
||||
project_library_base a
|
||||
JOIN mysql.help_topic b ON b.help_topic_id < ( length( a.certification_engineer ) - length( REPLACE ( a.certification_engineer, ',', '' ) ) + 1 )) temp
|
||||
WHERE user_id = #{userId}) a ON pm.project_id = a.id
|
||||
where pm.state = #{state}
|
||||
</select>
|
||||
</mapper>
|
||||
+19
-1
@@ -2,11 +2,14 @@ package com.jero.modules.cert.collect.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
|
||||
import com.jero.modules.cert.collect.vo.ParamsCollectManifestVO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -83,7 +86,7 @@ public interface IParamsCollectManifestEOService extends IService<ParamsCollectM
|
||||
* @param cut
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> getHeader(String paramsManifestId, String flag, String userType, String cut);
|
||||
List<Map<String, Object>> getHeader(String paramsManifestId, String flag, String cut);
|
||||
|
||||
/**
|
||||
* 提交
|
||||
@@ -162,6 +165,21 @@ public interface IParamsCollectManifestEOService extends IService<ParamsCollectM
|
||||
// 全部导出
|
||||
void exportAll(ParamsCollectManifestVO paramsCollectManifestVO, HttpServletResponse response, HttpServletRequest request);
|
||||
|
||||
// 填写人角色下的导出
|
||||
void exportDre(ParamsCollectManifestVO paramsCollectManifestVO, HttpServletResponse response, HttpServletRequest request);
|
||||
|
||||
// 填写人角色下导入
|
||||
Result<?> importDre(MultipartFile file, String cut, String paramsManifestId);
|
||||
|
||||
Result<?> importData(List<Map<String, Object>> dataList,
|
||||
String unzipfilepath,
|
||||
String cut,
|
||||
String paramsManifestId) throws IOException;
|
||||
|
||||
// 调整责任领域
|
||||
List<String> updateBatchDutyTerritory(ParamsCollectManifestVO paramsCollectManifestVO);
|
||||
|
||||
//监控参数收集任务的截止时间,并根据时间段发送飞书
|
||||
void checkDeadline();
|
||||
|
||||
}
|
||||
|
||||
+1911
-78
File diff suppressed because it is too large
Load Diff
+3
-1
@@ -187,6 +187,8 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
|
||||
ParamsManifestEO updateEO = new ParamsManifestEO();
|
||||
updateEO.setId(paramsManifestEO.getId());
|
||||
updateEO.setTitle(paramsManifestEO.getTitle());
|
||||
updateEO.setProjectVersion(paramsManifestEO.getProjectVersion());
|
||||
updateEO.setExplanation(paramsManifestEO.getExplanation());
|
||||
Date now = new Date();
|
||||
updateEO.setUpdateTime(now);
|
||||
return updateById(updateEO);
|
||||
@@ -691,7 +693,7 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
|
||||
// 统计清单参数
|
||||
ParamsCollectManifestEO paramsCollectManifestEO = new ParamsCollectManifestEO();
|
||||
paramsCollectManifestEO.setParamsManifestId(paramsManifestId);
|
||||
List<Map<String, Object>> listAll = paramsCollectManifestEOMapper.listInfoForExport(paramsCollectManifestEO);
|
||||
List<Map<String, Object>> listAll = paramsCollectManifestEOMapper.listInfoForExport(paramsCollectManifestEO, null);
|
||||
|
||||
// 循环责任领域,计算每个责任领域中的四种状态数据
|
||||
for (DictModel item : dutyTerritoryDictList) {
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.jero.modules.cert.collect.task;
|
||||
|
||||
import com.jero.modules.cert.collect.service.IParamsCollectManifestEOService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class ScheduledTask {
|
||||
|
||||
@Autowired
|
||||
private IParamsCollectManifestEOService paramsCollectManifestEOServicea;
|
||||
|
||||
/**
|
||||
* 监控参数收集任务的截止时间,并根据时间段发送飞书
|
||||
*/
|
||||
//@Scheduled(cron = "0 30 14 * * ?")
|
||||
@Scheduled(cron = "0 0 0 */1 * ?")
|
||||
public void checkTime() {
|
||||
log.info("-----checkDeadline-----begin-----------");
|
||||
|
||||
paramsCollectManifestEOServicea.checkDeadline();
|
||||
|
||||
log.info("-----checkDeadline------end-----------");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+6
@@ -24,4 +24,10 @@ public class ParamsManifestVO {
|
||||
private String ids;
|
||||
private String cut;
|
||||
private String sourceManifestId;
|
||||
|
||||
//相关项目版本
|
||||
private String projectVersion;
|
||||
|
||||
//说明
|
||||
private String explanation;
|
||||
}
|
||||
|
||||
+14
@@ -70,4 +70,18 @@ public enum ControlTypeEnum {
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static Map<String,String> toMapForExport(String cut){
|
||||
Map<String,String> map = new HashMap<>();
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
for (ControlTypeEnum controlTypeEnum : ControlTypeEnum.values()) {
|
||||
map.put(controlTypeEnum.getValue(), controlTypeEnum.getName());
|
||||
}
|
||||
} else if (CutEnum.EN.getValue().equals(cut)) {
|
||||
for (ControlTypeEnum controlTypeEnum : ControlTypeEnum.values()) {
|
||||
map.put(controlTypeEnum.getValue(), controlTypeEnum.getEnName());
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
+14
@@ -68,4 +68,18 @@ public enum ControlVerifyEnum {
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static Map<String,String> toMapForExport(String cut){
|
||||
Map<String,String> map = new HashMap<>();
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
for (ControlVerifyEnum controlVerifyEnum : ControlVerifyEnum.values()) {
|
||||
map.put(controlVerifyEnum.getValue(), controlVerifyEnum.getName());
|
||||
}
|
||||
} else if (CutEnum.EN.getValue().equals(cut)) {
|
||||
for (ControlVerifyEnum controlVerifyEnum : ControlVerifyEnum.values()) {
|
||||
map.put(controlVerifyEnum.getValue(), controlVerifyEnum.getEnName());
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
+14
@@ -62,4 +62,18 @@ public enum ParamsIsMustEnum {
|
||||
return map;
|
||||
}
|
||||
|
||||
public static Map<String,String> toMapForExport(String cut){
|
||||
Map<String,String> map = new HashMap<>();
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
for (ParamsIsMustEnum paramsIsMustEnum : ParamsIsMustEnum.values()) {
|
||||
map.put(paramsIsMustEnum.getValue(), paramsIsMustEnum.getName());
|
||||
}
|
||||
} else if (CutEnum.EN.getValue().equals(cut)) {
|
||||
for (ParamsIsMustEnum paramsIsMustEnum : ParamsIsMustEnum.values()) {
|
||||
map.put(paramsIsMustEnum.getValue(), paramsIsMustEnum.getEnName());
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+11
@@ -1348,7 +1348,18 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
|
||||
|| ControlTypeEnum.TEXT_PULL_MORE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.TEXT_PULL_SINGLE.getValue().equals(controlType)
|
||||
|| ControlTypeEnum.TEXT_PULL_SINGLE_FILE.getValue().equals(controlType)) {
|
||||
String controlValuesRegex = "^[^##!!]*$";
|
||||
if (StringUtils.isNotEmpty(controlValues) && !controlValues.matches(controlValuesRegex)) {
|
||||
if(CutEnum.CN.getValue().equals(cut)) {
|
||||
errorMsg += "控件备选值格式错误,不能包含中英文感叹号和井号;";
|
||||
} else {
|
||||
errorMsg += "Component Value formatting errors, can not chinese and English exclamation points and pound signs; ";
|
||||
}
|
||||
countError++;
|
||||
}
|
||||
|
||||
resultMap = validateMustAndLength(controlValues, "控件备选值", "Component Value", IsMustEnum.YES.getValue(), "500", false, cut);
|
||||
|
||||
} else {
|
||||
resultMap = validateMustAndLength(controlValues, "控件备选值", "Component Value", IsMustEnum.NO.getValue(), "500", false, cut);
|
||||
dto.setControlValues(null);
|
||||
|
||||
+15
@@ -90,6 +90,21 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
return Result.OK(infoPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文档翻译调取已入库文件
|
||||
* @param parameter
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档翻译调取已入库文件")
|
||||
@ApiOperation(value="文档翻译调取已入库文件", notes="文档翻译调取已入库文件")
|
||||
@PostMapping(value = "/transPageInfo")
|
||||
@ResponseBody
|
||||
@RequiresPermissions("documentTranslation:retrieval")
|
||||
public Result<?> transPageInfo(@RequestBody Map<String,Object> parameter) {
|
||||
IPage infoPage = bussDocumentLibraryEOService.ocrPageInfo(parameter);
|
||||
return Result.OK(infoPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
|
||||
+468
-48
@@ -316,7 +316,14 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
String contentInfo =content;
|
||||
String title = content;
|
||||
//封装消息的实体类
|
||||
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, title, content, contentInfo,MessageTypeEnum.READ.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList,
|
||||
title,
|
||||
content,
|
||||
contentInfo,
|
||||
MessageTypeEnum.READ.getValue(),
|
||||
MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
|
||||
null,
|
||||
null);
|
||||
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||
sendWebsocket(StringUtils.join(serialNumberList, ","), contentInfo);
|
||||
}
|
||||
@@ -2201,16 +2208,56 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
+ " technical field you subscribed to, the "
|
||||
+ href +" has been updated.";
|
||||
String msgTitle = "The " + technologyTerritoryName + " technical field you subscribed to has been updated";
|
||||
|
||||
|
||||
String hrefYes = category + " " + "<a href='/docManage/library/detail?id=" + idTemp +
|
||||
"&title=" + title +
|
||||
"&serial_number=" + serialNumber + "'" + " target='_blank'>" + serialNumber + "</a>";
|
||||
|
||||
//消息英文--不带标签
|
||||
String contentNo = "In the "+ technologyTerritoryName
|
||||
+ " technical field you subscribed to, the "+
|
||||
category + " " + serialNumber +" has been updated.";;
|
||||
|
||||
//消息英文--带标签
|
||||
String contentYes = "In the "+ technologyTerritoryName
|
||||
+ " technical field you subscribed to, the "+
|
||||
category + " " + hrefYes +" has been updated.";;
|
||||
|
||||
//消息中文--不带标签
|
||||
String contentInfoNo = "您所订阅的" + technologyTerritoryName + "技术领域中更新了" + category + " " + serialNumber;;
|
||||
|
||||
//消息中文--带标签
|
||||
|
||||
String contentInfoYes = "您所订阅的" + technologyTerritoryName + "技术领域中更新了" + category + " " + hrefYes;;
|
||||
|
||||
|
||||
//封装消息的实体类
|
||||
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, msgTitle, content, contentInfo,MessageTypeEnum.READ.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList,
|
||||
msgTitle,
|
||||
contentNo,
|
||||
contentYes,
|
||||
MessageTypeEnum.READ.getValue(),
|
||||
MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
|
||||
contentInfoNo,
|
||||
contentInfoYes);
|
||||
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||
sendWebsocket(idTemp, contentInfo);
|
||||
//飞书
|
||||
try {
|
||||
String contentInfoFeiShu = "In the "+ technologyTerritoryName
|
||||
+ " technical field you subscribed to, the "
|
||||
+ serialNumber +" has been updated.";
|
||||
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentInfoFeiShu, MessageTypeEnum.PUSH.getName(), hrefTemp);
|
||||
+ " technical field you subscribed to, the "+
|
||||
category + " " + serialNumber +" has been updated.";
|
||||
String contentInfoFeiShuCn = "您所订阅的" + technologyTerritoryName + "技术领域中更新了" + category + " " + serialNumber;
|
||||
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setTitle(MessageTypeEnum.READ.getNameCn()+"/"+MessageTypeEnum.READ.getName());
|
||||
feishuMsgVo.setUrl(hrefTemp);
|
||||
feishuMsgVo.setContentEn(contentInfoFeiShu);
|
||||
feishuMsgVo.setContent(contentInfoFeiShuCn);
|
||||
|
||||
iFeishuService.sendCardMsgTerritory(thirdIdList.toArray(new String[]{}), feishuMsgVo);
|
||||
// iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentInfoFeiShu, MessageTypeEnum.PUSH.getName(), hrefTemp);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
@@ -2980,13 +3027,13 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
if (ObjectUtils.isNotEmpty(value)) {
|
||||
if (ObjectUtils.isNotEmpty(valueTemp) && !value.equals(valueTemp)) {
|
||||
if("1".equals(flag)){
|
||||
sb.append(dbFieldTxt +" from \""+ value + "\" to \"" + valueTemp + "\",");
|
||||
sb.append(dbFieldTxt +" was changed from \""+ value + "\" to \"" + valueTemp + "\",");
|
||||
}else{
|
||||
sb.append(dbFieldTxt + "由\"" + value + "\"改为\"“" + valueTemp + "\",");
|
||||
}
|
||||
} else if (ObjectUtils.isEmpty(valueTemp)) {
|
||||
if("1".equals(flag)){
|
||||
sb.append(dbFieldTxt + " from \""+value + "\" to null " + ",");
|
||||
sb.append(dbFieldTxt + " was changed from \""+value + "\" to null " + ",");
|
||||
}else{
|
||||
sb.append(dbFieldTxt + "由\"" + value + "\"改为空" + ",");
|
||||
}
|
||||
@@ -2994,7 +3041,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
} else {
|
||||
if (ObjectUtils.isNotEmpty(valueTemp)) {
|
||||
if("1".equals(flag)){
|
||||
sb.append(dbFieldTxt + " from null to \"" + valueTemp + "\",");
|
||||
sb.append(dbFieldTxt + " was changed from null to \"" + valueTemp + "\",");
|
||||
}else{
|
||||
sb.append(dbFieldTxt + "由空改为\"" + valueTemp + "\",");
|
||||
}
|
||||
@@ -3023,13 +3070,13 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
if (fileNameListTemp.size() != 0 && !checkDiffrent) {
|
||||
if("1".equals(flag)){
|
||||
//sysUser
|
||||
sb.append(dbFieldTxt +" from \""+ StringUtils.join(fileNameList, ",") + "\" to \"" + StringUtils.join(fileNameListTemp, ",") + "\",");
|
||||
sb.append(dbFieldTxt +" was changed from \""+ StringUtils.join(fileNameList, ",") + "\" to \"" + StringUtils.join(fileNameListTemp, ",") + "\",");
|
||||
}else{
|
||||
sb.append(dbFieldTxt + "由\"" + StringUtils.join(fileNameList, ",") + "\"改为\"" + StringUtils.join(fileNameListTemp, ",") + "\",");
|
||||
}
|
||||
} else if (fileNameListTemp.size() == 0) {
|
||||
if("1".equals(flag)){
|
||||
sb.append(dbFieldTxt + " from \""+StringUtils.join(fileNameList, ",") + "\" to null " + ",");
|
||||
sb.append(dbFieldTxt + " was changed from \""+StringUtils.join(fileNameList, ",") + "\" to null " + ",");
|
||||
}else{
|
||||
sb.append(dbFieldTxt + "由\"" + StringUtils.join(fileNameList, ",") + "\"改为空" + ",");
|
||||
}
|
||||
@@ -3038,7 +3085,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
} else {
|
||||
if (fileNameListTemp.size() != 0) {
|
||||
if("1".equals(flag)){
|
||||
sb.append(dbFieldTxt + " from null to \"" + StringUtils.join(fileNameListTemp, ",") + "\",");
|
||||
sb.append(dbFieldTxt + " was changed from null to \"" + StringUtils.join(fileNameListTemp, ",") + "\",");
|
||||
}else{
|
||||
sb.append(dbFieldTxt + "由空改为\"" + StringUtils.join(fileNameListTemp, ",") + "\",");
|
||||
}
|
||||
@@ -3059,13 +3106,13 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
if (ObjectUtils.isNotEmpty(value)) {
|
||||
if (ObjectUtils.isNotEmpty(valueTemp) && !value.equals(valueTemp)) {
|
||||
if("1".equals(flag)){
|
||||
sb.append(dbFieldTxt +" from \""+ value + "\" to \"" + valueTemp + "\",");
|
||||
sb.append(dbFieldTxt +" was changed from \""+ value + "\" to \"" + valueTemp + "\",");
|
||||
}else{
|
||||
sb.append(dbFieldTxt + "由\"" + value + "\"改为\"" + valueTemp + "\",");
|
||||
}
|
||||
} else if (ObjectUtils.isEmpty(valueTemp)) {
|
||||
if("1".equals(flag)){
|
||||
sb.append(dbFieldTxt + " from \""+value + "\" to null " + ",");
|
||||
sb.append(dbFieldTxt + " was changed from \""+value + "\" to null " + ",");
|
||||
}else{
|
||||
sb.append(dbFieldTxt + "由\"" + value + "\"改为空" + ",");
|
||||
}
|
||||
@@ -3073,7 +3120,203 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
} else {
|
||||
if (ObjectUtils.isNotEmpty(valueTemp)) {
|
||||
if("1".equals(flag)){
|
||||
sb.append(dbFieldTxt + " from null to \"" + valueTemp + "\",");
|
||||
sb.append(dbFieldTxt + " was changed from null to \"" + valueTemp + "\",");
|
||||
}else{
|
||||
sb.append(dbFieldTxt + "由空改为\"" + valueTemp + "\",");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return sb;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private StringBuilder getUpdateInfoCn(Map<String, Object> map, List<Map<String, Object>> dataList,
|
||||
List<OnlCgformField> fieldList, List<OnlCgformField> fieldDateList,
|
||||
List<OnlCgformField> fieldFileList, List<OnlCgformField> fieldPullList,
|
||||
String cut,String flagTemp) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
//调整dataList中map中字段顺序与表单中的一致
|
||||
Map<String, Object> mapNew = new LinkedHashMap<>();
|
||||
for (OnlCgformField onlCgformField : fieldList) {
|
||||
for (Map.Entry<String, Object> entry : dataList.get(0).entrySet()) {
|
||||
if (onlCgformField.getDbFieldName().equals(entry.getKey())) {
|
||||
mapNew.put(entry.getKey(), entry.getValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
dataList.remove(0);
|
||||
dataList.add(mapNew);
|
||||
Map<String, Object> mapTemp = new HashMap<>();
|
||||
mapCopy(map, mapTemp);
|
||||
//时间类型的字段
|
||||
List<String> fieldDate = fieldDateList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
//文件类型的字段
|
||||
List<String> fieldFile = fieldFileList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
//下拉类型的字段
|
||||
//过滤出树形字段
|
||||
List<OnlCgformField> treeFieldList = fieldList.stream()
|
||||
.filter(e -> FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
//数据字典
|
||||
List<SysDictItem> sysDictItems = sysDictItemServiceImpl.selectItemsAll();
|
||||
//树形数据字典
|
||||
List<SysCategory> categoryList = sysCategoryService.list();
|
||||
//下拉选处理数据字典
|
||||
for (Map.Entry<String, Object> entry : dataList.get(0).entrySet()) {
|
||||
//下拉选处理数据字典
|
||||
dictItemCn(sysDictItems, entry, cut, fieldList,flagTemp);
|
||||
treeDictItemCn(categoryList, entry, treeFieldList, cut,flagTemp);
|
||||
}
|
||||
for (Map.Entry<String, Object> entry : mapTemp.entrySet()) {
|
||||
//下拉选处理数据字典
|
||||
dictItemCn(sysDictItems, entry, cut, fieldList,flagTemp);
|
||||
treeDictItemCn(categoryList, entry, treeFieldList, cut,flagTemp);
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
dataList.get(0).entrySet().forEach(entry -> {
|
||||
String key = entry.getKey();
|
||||
Object value = entry.getValue();
|
||||
//字段中文名
|
||||
List<OnlCgformField> fields = fieldList.stream().filter(e -> e.getDbFieldName().equals(key)).collect(Collectors.toList());
|
||||
|
||||
if (fields.size() != 0) {
|
||||
String dbFieldTxt = fields.get(0).getDbFieldTxt();
|
||||
if("2".equals(flagTemp)){
|
||||
dbFieldTxt = fields.get(0).getDbFieldTxt();
|
||||
}else{
|
||||
dbFieldTxt = fields.get(0).getDbFieldTxt();
|
||||
}
|
||||
dbFieldTxt = "<text class='highlight-class'>" + dbFieldTxt + "</text>";
|
||||
if (value == null) {
|
||||
value = "";
|
||||
}
|
||||
for (Map.Entry<String, Object> entryTemp : mapTemp.entrySet()) {
|
||||
String keyTemp = entryTemp.getKey();
|
||||
Object valueTemp = entryTemp.getValue();
|
||||
if (valueTemp == null) {
|
||||
valueTemp = "";
|
||||
}
|
||||
if (!"create_time".equals(key) && !"update_time".equals(key)) {
|
||||
if (key.equals(keyTemp)) {
|
||||
if (fieldDate.contains(key)) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
if (ObjectUtils.isNotEmpty(value)) {
|
||||
value = sdf.format(value);
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(valueTemp)) {
|
||||
try {
|
||||
valueTemp = sdf.format(sdf.parse((String) valueTemp));
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
}
|
||||
//处理时间类型字段
|
||||
if (ObjectUtils.isNotEmpty(value)) {
|
||||
if (ObjectUtils.isNotEmpty(valueTemp) && !value.equals(valueTemp)) {
|
||||
if("2".equals(flagTemp)){
|
||||
sb.append(dbFieldTxt + "由\"" + value + "\"改为\"“" + valueTemp + "\",");
|
||||
}else{
|
||||
sb.append(dbFieldTxt + "由\"" + value + "\"改为\"“" + valueTemp + "\",");
|
||||
}
|
||||
} else if (ObjectUtils.isEmpty(valueTemp)) {
|
||||
if("2".equals(flagTemp)){
|
||||
sb.append(dbFieldTxt + "由\"" + value + "\"改为空" + ",");
|
||||
}else{
|
||||
sb.append(dbFieldTxt + "由\"" + value + "\"改为空" + ",");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (ObjectUtils.isNotEmpty(valueTemp)) {
|
||||
if("2".equals(flagTemp)){
|
||||
sb.append(dbFieldTxt + "由空改为\"" + valueTemp + "\",");
|
||||
}else{
|
||||
sb.append(dbFieldTxt + "由空改为\"" + valueTemp + "\",");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} else if (fieldFile.contains(key)) {
|
||||
//处理文件类型字段
|
||||
List<String> fileNameList = new ArrayList<>();
|
||||
List<String> fileNameListTemp = new ArrayList<>();
|
||||
//之前的文件
|
||||
if (ObjectUtils.isNotEmpty(value)) {
|
||||
List<OSSFile> fileInfos = iOSSFileService.getFileInfosByConnectId((String) value);
|
||||
fileNameList = fileInfos.stream().map(OSSFile::getFileName).collect(Collectors.toList());
|
||||
}
|
||||
//修改的文件
|
||||
if (ObjectUtils.isNotEmpty(valueTemp)) {
|
||||
List<OSSFile> fileInfosTemp = iOSSFileService.getFileInfos((String) valueTemp);
|
||||
fileNameListTemp = fileInfosTemp.stream().map(OSSFile::getFileName).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
if (ObjectUtils.isNotEmpty(value)) {
|
||||
boolean checkDiffrent = checkDiffrent(fileNameList, fileNameListTemp);
|
||||
|
||||
if (fileNameListTemp.size() != 0 && !checkDiffrent) {
|
||||
if("2".equals(flagTemp)){
|
||||
//sysUser
|
||||
sb.append(dbFieldTxt + "由\"" + StringUtils.join(fileNameList, ",") + "\"改为\"" + StringUtils.join(fileNameListTemp, ",") + "\",");
|
||||
}else{
|
||||
sb.append(dbFieldTxt + "由\"" + StringUtils.join(fileNameList, ",") + "\"改为\"" + StringUtils.join(fileNameListTemp, ",") + "\",");
|
||||
}
|
||||
} else if (fileNameListTemp.size() == 0) {
|
||||
if("2".equals(flagTemp)){
|
||||
sb.append(dbFieldTxt + "由\"" + StringUtils.join(fileNameList, ",") + "\"改为空" + ",");
|
||||
}else{
|
||||
sb.append(dbFieldTxt + "由\"" + StringUtils.join(fileNameList, ",") + "\"改为空" + ",");
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
if (fileNameListTemp.size() != 0) {
|
||||
if("2".equals(flagTemp)){
|
||||
sb.append(dbFieldTxt + "由空改为\"" + StringUtils.join(fileNameListTemp, ",") + "\",");
|
||||
}else{
|
||||
sb.append(dbFieldTxt + "由空改为\"" + StringUtils.join(fileNameListTemp, ",") + "\",");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// if ("replace_standard".equals(key) || "corresponding_standard".equals(key)) {
|
||||
// if (ObjectUtils.isNotEmpty(value)) {
|
||||
// value = getReplaceStandardName(value);
|
||||
// }
|
||||
// if (ObjectUtils.isNotEmpty(valueTemp)) {
|
||||
// valueTemp = getReplaceStandardName(valueTemp);
|
||||
// }
|
||||
// }
|
||||
//其他类型(被代替标准不处理)
|
||||
if (!"replaced_standard".equals(key)) {
|
||||
if (ObjectUtils.isNotEmpty(value)) {
|
||||
if (ObjectUtils.isNotEmpty(valueTemp) && !value.equals(valueTemp)) {
|
||||
if("2".equals(flagTemp)){
|
||||
sb.append(dbFieldTxt + "由\"" + value + "\"改为\"" + valueTemp + "\",");
|
||||
}else{
|
||||
sb.append(dbFieldTxt + "由\"" + value + "\"改为\"" + valueTemp + "\",");
|
||||
}
|
||||
} else if (ObjectUtils.isEmpty(valueTemp)) {
|
||||
if("2".equals(flagTemp)){
|
||||
sb.append(dbFieldTxt + "由\"" + value + "\"改为空" + ",");
|
||||
}else{
|
||||
sb.append(dbFieldTxt + "由\"" + value + "\"改为空" + ",");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (ObjectUtils.isNotEmpty(valueTemp)) {
|
||||
if("2".equals(flagTemp)){
|
||||
sb.append(dbFieldTxt + "由空改为\"" + valueTemp + "\",");
|
||||
}else{
|
||||
sb.append(dbFieldTxt + "由空改为\"" + valueTemp + "\",");
|
||||
}
|
||||
@@ -3114,20 +3357,34 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
List<OnlCgformField> fieldFileList,
|
||||
List<OnlCgformField> fieldPullList,
|
||||
String cut) {
|
||||
List<Map<String, Object>> dataListTemp = new ArrayList<>();
|
||||
for (Map<String, Object> stringObjectMap : dataList) {
|
||||
Map<String, Object> mapT = new HashMap<>();
|
||||
mapCopy(stringObjectMap, mapT);
|
||||
dataListTemp.add(mapT);
|
||||
}
|
||||
|
||||
String technologyTerritoryNew = (String) dataList.get(0).get("technology_territory");
|
||||
//1. 处理订阅的发送消息
|
||||
//修改的内容
|
||||
String flag ="1";//消息的标识(英文)
|
||||
StringBuilder sb = getUpdateInfo(map, dataList, fieldList, fieldDateList, fieldFileList, fieldPullList, null,flag);
|
||||
String flagTemp ="2";//消息的标识(中文--消息采用卡片型式发送, 消息内容包含中英文, 所以此处需要获取消息的中文)
|
||||
StringBuilder sbCn = getUpdateInfoCn(map, dataListTemp, fieldList, fieldDateList, fieldFileList, fieldPullList, null,flagTemp);
|
||||
//树形数据字典
|
||||
List<SysCategory> categoryList = sysCategoryService.list();
|
||||
String sbStr = "";
|
||||
if (ObjectUtils.isNotEmpty(sb)) {
|
||||
sbStr = sb.substring(0, sb.length() - 1);
|
||||
}
|
||||
String sbStrCn = "";
|
||||
if (ObjectUtils.isNotEmpty(sbCn)) {
|
||||
sbStrCn = sbCn.substring(0, sbCn.length() - 1);
|
||||
}
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String serialNumber = (String) dataList.get(0).get("serial_number");
|
||||
String category = (String)map.get("lei4_bie2");
|
||||
String categoryCn = (String)map.get("lei4_bie2");
|
||||
String technologyTerritory = (String) map.get("technology_territory");
|
||||
if(StringUtils.isNotBlank(category)){
|
||||
List<SysDictItem> dictItemList = sysDictItemServiceImpl.selectItemsAll();
|
||||
@@ -3137,21 +3394,20 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
.collect(Collectors.toList());
|
||||
if(stateDictItemList.size() != 0){
|
||||
category = stateDictItemList.get(0).getEnName();
|
||||
categoryCn = stateDictItemList.get(0).getItemText();
|
||||
}
|
||||
}else{
|
||||
category = "";
|
||||
}
|
||||
//只要修改了标准,就需要向订阅用户发送消息(内容为-->XXX对“GB 7258 进行了修改请及时查看”)
|
||||
//向订阅领域管理中订阅了该技术领域的人和文档库中订阅了该条文档的人发送消息
|
||||
// 只有技术领域变更为订阅的技术领域这一种情况发消息, 假如订阅了技术领域A,编辑的文档的技术领域也是A,这时编辑的是其他的字段,这种情况不发消息
|
||||
Map<String, Object> mapTemp = new HashMap<>();
|
||||
mapTemp.put("domainId", map.get("technology_territory"));
|
||||
mapTemp.put("documentId", map.get("id"));
|
||||
//订阅技术领域的人和订阅该条标准的人
|
||||
// List<String> userIdList = domainUserRelService.queryDomainUserRelInfo(mapTemp);
|
||||
//订阅技术领域发消息
|
||||
List<DomainUserRel> domainUserRelList = domainManageService.list();
|
||||
// List<String> thirdIdListAll = new ArrayList<>();
|
||||
// List<String> userListAll = new ArrayList<>();
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
List<String> userList = new ArrayList<>();
|
||||
String technologyTerritoryNameEn = "";
|
||||
@@ -3167,12 +3423,6 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
if(sysUsersFeishu.size() != 0){
|
||||
thirdIdList = sysUsersFeishu.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
userList = sysUsersFeishu.stream().map(SysUser::getId).collect(Collectors.toList());
|
||||
// if(thirdIdList.size() != 0){
|
||||
// thirdIdListAll.addAll(thirdIdList);
|
||||
// }
|
||||
// if(userList.size() != 0){
|
||||
// userListAll.addAll(userList);
|
||||
// }
|
||||
}
|
||||
}
|
||||
if(domainIdList.size() != 0){
|
||||
@@ -3208,25 +3458,26 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(sysUsers)) {
|
||||
userIdListUpdate = sysUsers.stream().map(SysUser::getId).collect(Collectors.toList());
|
||||
userIdListUpdateFeishu = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
// if(userIdListUpdate.size() != 0){
|
||||
// userListAll.addAll(userIdListUpdate);
|
||||
// }
|
||||
// if(userIdListUpdateFeishu.size() != 0){
|
||||
// thirdIdListAll.addAll(userIdListUpdateFeishu);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//订阅管理
|
||||
if(thirdIdList.size() != 0){
|
||||
// thirdIdListAll = thirdIdListAll.stream().distinct().collect(Collectors.toList());
|
||||
String contentInfoFei = "In the " + technologyTerritoryNameEn + " technical field you subscribed to, the " +
|
||||
category + " " + serialNumber+" has been updated.";
|
||||
String contentInfoFeiCn = "您所订阅的" + technologyTerritoryNameEn + "技术领域中更新了" + categoryCn + " " + serialNumber;
|
||||
try {
|
||||
//跳转文档详情
|
||||
String url = backUrl + "/docManage/library/detail?id=" + id;
|
||||
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentInfoFei, MessageTypeEnum.READ.getName(), url);
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setTitle(MessageTypeEnum.READ.getNameCn()+"/"+MessageTypeEnum.READ.getName());
|
||||
feishuMsgVo.setUrl(url);
|
||||
feishuMsgVo.setContentEn(contentInfoFei);
|
||||
feishuMsgVo.setContent(contentInfoFeiCn);
|
||||
|
||||
iFeishuService.sendCardMsgTerritory(thirdIdList.toArray(new String[]{}), feishuMsgVo);
|
||||
// iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentInfoFei, MessageTypeEnum.READ.getName(), url);
|
||||
} catch (IOException e) {
|
||||
log.error("文档新增飞书消息推送失败");
|
||||
}
|
||||
@@ -3243,8 +3494,30 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
//您订阅的XXX已被修改
|
||||
String contentInfo = "In the " + technologyTerritoryNameEn + " technical field you subscribed to," +sysUser.getUsername()+" changed the "+ href + " " + sbStr.toString();
|
||||
String msgTitle = "The " + technologyTerritoryNameEn + " technical field you subscribed to has been updated";
|
||||
//消息英文--不带标签
|
||||
String contentNo = "In the " + technologyTerritoryNameEn + " technical field you subscribed to, the " +
|
||||
category + " " + serialNumber+" has been updated.";;
|
||||
|
||||
//消息英文--带标签
|
||||
String contentYes = "In the " + technologyTerritoryNameEn + " technical field you subscribed to, the " +
|
||||
category + " " + href+" has been updated.";;
|
||||
|
||||
//消息中文--不带标签
|
||||
String contentInfoNo = "您所订阅的" + technologyTerritoryNameEn + "技术领域中更新了" + categoryCn + " " + serialNumber;;
|
||||
|
||||
//消息中文--带标签
|
||||
String contentInfoYes = "您所订阅的" + technologyTerritoryNameEn + "技术领域中更新了" + categoryCn + " " + href;;
|
||||
|
||||
|
||||
// 封装消息的实体类
|
||||
SysAnnouncement sysAnnouncement = getSysAnnouncement(userList, msgTitle, contentInfoFei, contentInfo,MessageTypeEnum.READ.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
SysAnnouncement sysAnnouncement = getSysAnnouncement(userList,
|
||||
msgTitle,
|
||||
contentNo,
|
||||
contentYes,
|
||||
MessageTypeEnum.READ.getValue(),
|
||||
MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
|
||||
contentInfoNo,
|
||||
contentInfoYes);
|
||||
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||
sendWebsocket((String) map.get("id"), contentInfo);
|
||||
}
|
||||
@@ -3258,27 +3531,61 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
"&title=" + title +
|
||||
"&serial_number=" + serialNumber + "'" + " target='_blank'>" + serialNumber + "</a>";
|
||||
String content = "";
|
||||
if (StringUtils.isNotBlank(sbStr.toString())) {
|
||||
if (StringUtils.isNotBlank(sbStr.toString()) && StringUtils.isNotBlank(sbStrCn)) {
|
||||
//去掉a标签
|
||||
sbStr = sbStr.replaceAll("<text class='highlight-class'>", "").replaceAll("</text>", "");
|
||||
//您订阅的XXX已被修改
|
||||
content = "In the "+category + " " + serialNumber+" you subscribed to, has been modified,Please pay attention to check.";
|
||||
String contentInfo = "In the "+category + " " + href+" you subscribed to, "+sysUser.getUsername()+" changed the "+ href + " " + sbStr.toString();
|
||||
//内容详情--英文(不带标签)
|
||||
String contentInfoNo = "In the "+category + " " + serialNumber+" you subscribed to, "+ sbStr.toString();
|
||||
|
||||
//内容详情--英文(带标签)
|
||||
String contentInfoYes = "In the "+category + " " + href+" you subscribed to, "+ sbStr.toString();
|
||||
|
||||
String msgTitle = serialNumber + " you subscribed to has been updated";
|
||||
//内容详情-中文(不带标签)
|
||||
String sbStrCnTemp = sbStrCn.replaceAll("<text class='highlight-class'>", "").replaceAll("</text>", "");
|
||||
String contentCnNo = "您所订阅的"+categoryCn+serialNumber+","+sbStrCnTemp;
|
||||
|
||||
//内容详情--中文(带标签)
|
||||
String contentInfoCnReplace = sbStrCn.replaceAll("<text class='highlight-class'>","").replaceAll("</text>","");
|
||||
String contentInfoCnYes ="您所订阅的"+categoryCn+href+","+contentInfoCnReplace;;
|
||||
//封装消息的实体类
|
||||
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdListUpdate, msgTitle, content, contentInfo,MessageTypeEnum.READ.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdListUpdate,
|
||||
msgTitle,
|
||||
contentInfoNo,
|
||||
contentInfoYes,
|
||||
MessageTypeEnum.READ.getValue(),
|
||||
MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
|
||||
contentCnNo,
|
||||
contentInfoCnYes);
|
||||
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||
sendWebsocket((String) map.get("id"), contentInfo);
|
||||
sendWebsocket((String) map.get("id"), contentInfoYes);
|
||||
}
|
||||
//订阅文档的飞书消息
|
||||
try {
|
||||
// String contentInfoFei = "In the " + technologyTerritoryNameEn + " technical field you subscribed to, the " +
|
||||
// category + " " + serialNumber+" has been updated.";
|
||||
String contentInfoFei = "In the "+category + " " + serialNumber +" you subscribed to, "+sysUser.getUsername()+" changed the " + sbStr.toString();;
|
||||
//英文消息
|
||||
String contentInfoFei = "In the "+category + " " + serialNumber +" you subscribed to, "+ sbStr.toString();;
|
||||
//中文消息
|
||||
String contentInfoFeiCn ="您所订阅的"+categoryCn+ serialNumber +","+ sbStrCn.toString();;
|
||||
//跳转文档详情
|
||||
String url = backUrl + "/docManage/library/detail?id=" + id;
|
||||
iFeishuService.batchSendMessage(userIdListUpdateFeishu.toArray(new String[]{}), contentInfoFei, MessageTypeEnum.READ.getName(), url);
|
||||
// iFeishuService.batchSendMessage(userIdListUpdateFeishu.toArray(new String[]{}), content, MessageTypeEnum.READ.getName(), url);
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setTitle(MessageTypeEnum.READ.getNameCn()+"/"+MessageTypeEnum.READ.getName());
|
||||
feishuMsgVo.setUrl(url);
|
||||
String replaceAll = contentInfoFei.replaceAll("\"", "<");
|
||||
feishuMsgVo.setContentEn(replaceAll);
|
||||
|
||||
String replaceAllCn = contentInfoFeiCn.replaceAll("<text class='highlight-class'>", "")
|
||||
.replaceAll("</text>","").replaceAll("\"", "<");
|
||||
feishuMsgVo.setContent(replaceAllCn);
|
||||
//
|
||||
iFeishuService.sendCardMsgDocument(userIdListUpdateFeishu.toArray(new String[]{}), feishuMsgVo);
|
||||
|
||||
// String contentInfoFei = "In the "+category + " " + serialNumber +" you subscribed to, "+sysUser.getUsername()+" changed the " + sbStr.toString();;
|
||||
// //跳转文档详情
|
||||
// String url = backUrl + "/docManage/library/detail?id=" + id;
|
||||
// iFeishuService.batchSendMessage(userIdListUpdateFeishu.toArray(new String[]{}), contentInfoFei, MessageTypeEnum.READ.getName(), url);
|
||||
} catch (IOException e) {
|
||||
log.error("文档新增飞书消息推送失败");
|
||||
}
|
||||
@@ -3349,7 +3656,13 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
String contentInfo = "New numbering implemented, please note update status of alternate numbering " + sbStr;
|
||||
String msgTitle = contentInfo;
|
||||
//封装消息的实体类
|
||||
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, msgTitle, content, contentInfo,MessageTypeEnum.READ.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList,
|
||||
msgTitle,
|
||||
content,
|
||||
contentInfo,MessageTypeEnum.READ.getValue(),
|
||||
MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
|
||||
null,
|
||||
null);
|
||||
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||
sendWebsocket(StringUtils.join(serialNumberListTemp, ","), contentInfo);
|
||||
//飞书
|
||||
@@ -3377,7 +3690,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
String content,
|
||||
String contentInfo,
|
||||
String messageType,
|
||||
String initiator) {
|
||||
String initiator,
|
||||
String contentCn,
|
||||
String contentInfoCn) {
|
||||
SysAnnouncement sysAnnouncement = new SysAnnouncement();
|
||||
sysAnnouncement.setInitiator(initiator);
|
||||
sysAnnouncement.setDelFlag("0");
|
||||
@@ -3389,6 +3704,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
sysAnnouncement.setTitile(title);
|
||||
sysAnnouncement.setMsgContent(content);
|
||||
sysAnnouncement.setMsgContentInfo(contentInfo);
|
||||
sysAnnouncement.setMsgContentCn(contentCn);
|
||||
sysAnnouncement.setMsgContentInfoCn(contentInfoCn);
|
||||
sysAnnouncement.setUserIds(StringUtils.join(userIdList, ","));
|
||||
return sysAnnouncement;
|
||||
}
|
||||
@@ -3932,6 +4249,64 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 用于获取飞书消息中的中文消息
|
||||
*
|
||||
* @param sysDictItems
|
||||
* @param entry
|
||||
*/
|
||||
public void dictItemCn(List<SysDictItem> sysDictItems, Map.Entry<String, Object> entry, String cut, List<OnlCgformField> fieldList,String flagTemp) {
|
||||
//通过dictField判断字段是否为下拉选(不为空则为下拉选)
|
||||
List<OnlCgformField> onlCgformFieldList = fieldList.stream().filter(e -> entry.getKey().equals(e.getDbFieldName())).collect(Collectors.toList());
|
||||
//数据字典中文
|
||||
List<String> dictItemsCh = new ArrayList<>();
|
||||
List<String> dictItemsEn = new ArrayList<>();
|
||||
for (OnlCgformField onlCgformField : onlCgformFieldList) {
|
||||
if (FieldTypeEnum.PULL_SINGLE.getValue().equals(onlCgformField.getFieldShowType())
|
||||
|| FieldTypeEnum.PULL_MORE.getValue().equals(onlCgformField.getFieldShowType())) {
|
||||
String value = (String) entry.getValue();
|
||||
if (StringUtils.isNotBlank(value) && onlCgformFieldList.size() != 0 && StringUtils.isNotBlank(onlCgformFieldList.get(0).getDictField())) {
|
||||
for (String itemValue : value.split(",")) {
|
||||
//字段的数据字典
|
||||
List<SysDictItem> dictItemList = sysDictItems.stream()
|
||||
.filter(e -> StringUtils.isNotBlank(e.getDictCode()) && e.getDictCode().equals(onlCgformFieldList.get(0).getDictField()))
|
||||
.collect(Collectors.toList());
|
||||
if (dictItemList.size() != 0) {
|
||||
List<SysDictItem> dictItems = dictItemList.stream()
|
||||
.filter(e -> itemValue.equals(e.getItemValue()))
|
||||
.collect(Collectors.toList());
|
||||
if (dictItems.size() != 0) {
|
||||
List<String> itemText = new ArrayList<>();
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList());
|
||||
} else if(CutEnum.EN.getValue().equals(cut)) {
|
||||
itemText = dictItems.stream().map(SysDictItem::getEnName).collect(Collectors.toList());
|
||||
}else if("2".equals(flagTemp)){
|
||||
itemText = dictItems.stream().map(SysDictItem::getItemText).collect(Collectors.toList());
|
||||
}
|
||||
dictItemsCh.addAll(itemText);
|
||||
dictItemsEn.addAll(itemText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (onlCgformFieldList.size() != 0 && StringUtils.isNotBlank(onlCgformFieldList.get(0).getDictField())) {
|
||||
if(FieldTypeEnum.PULL_SINGLE.getValue().equals(onlCgformFieldList.get(0).getFieldShowType())
|
||||
|| FieldTypeEnum.PULL_MORE.getValue().equals(onlCgformFieldList.get(0).getFieldShowType())){
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
entry.setValue(StringUtils.join(dictItemsCh, ","));
|
||||
} else if(CutEnum.EN.getValue().equals(cut)){
|
||||
entry.setValue(StringUtils.join(dictItemsEn, ","));
|
||||
}else if("2".equals(flagTemp)){
|
||||
entry.setValue(StringUtils.join(dictItemsEn, ","));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@@ -4890,8 +5265,20 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
// String contentInfo = sysUser.getUsername() + " pushed " + StringUtils.join(hrefList, ",") + " to you. Please be reminded to check it out.";
|
||||
// String title = StringUtils.join(serialNumberList, ",") + " has been pushed to you, please check";
|
||||
|
||||
String contentEnNo = sysUser.getUsername() + " shared " + StringUtils.join(serialNumberList, ",") + " with you, please be reminded to check it out.";
|
||||
String contentInfoEnYes = sysUser.getUsername() + " shared " + StringUtils.join(hrefList, ",") + " with you, please be reminded to check it out.";
|
||||
String contentInfoCnNo = sysUser.getUsername() + "向您分享了" + StringUtils.join(serialNumberList, ",") + "请查看.";
|
||||
String contentInfoCnYes = sysUser.getUsername() + "向您分享了" + StringUtils.join(hrefList, ",") + "请查看.";
|
||||
|
||||
//封装消息的实体类
|
||||
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, title, content, contentInfo,MessageTypeEnum.PUSH.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList,
|
||||
title,
|
||||
contentEnNo,
|
||||
contentInfoEnYes,
|
||||
MessageTypeEnum.PUSH.getValue(),
|
||||
MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
|
||||
contentInfoCnNo,
|
||||
contentInfoCnYes);
|
||||
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||
sendWebsocket(StringUtils.join(thirdIdList, ","), contentInfo);
|
||||
//飞书
|
||||
@@ -4906,10 +5293,15 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
});
|
||||
String contentTemp = sysUser.getUsername() + " shared " + StringUtils.join(list, ",") + " with you, please be reminded to check it out.";
|
||||
// String contentTemp = sysUser.getUsername() + " pushed " + StringUtils.join(list, ",") + " to you. Please be reminded to check it out.";
|
||||
// FeishuMsgVo feishuMsgVo = getFeishuMsgVo(MessageTypeEnum.PUSH.getName(),null, contentTemp, encode);
|
||||
// iFeishuService.sendCardMsg(thirdIdList.toArray(new String[]{}), feishuMsgVo);
|
||||
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentTemp, MessageTypeEnum.PUSH.getName(), encode);
|
||||
String contentTempCn = sysUser.getUsername() + "向您分享了" + StringUtils.join(list, ",") + "请查看.";
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setTitle(MessageTypeEnum.PUSH.getNameCn()+"/"+MessageTypeEnum.PUSH.getName());
|
||||
feishuMsgVo.setUrl(encode);
|
||||
feishuMsgVo.setContentEn(contentTemp);
|
||||
feishuMsgVo.setContent(contentTempCn);
|
||||
|
||||
iFeishuService.sendCardMsgTerritory(thirdIdList.toArray(new String[]{}),feishuMsgVo);
|
||||
// iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentTemp, MessageTypeEnum.PUSH.getName(), encode);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error("飞书推送失败");
|
||||
@@ -4956,6 +5348,34 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 用于获取飞书消息中的中文消息
|
||||
*
|
||||
* @param categoryList
|
||||
* @param entry
|
||||
* @param treeFieldList
|
||||
* @param cut
|
||||
*/
|
||||
public void treeDictItemCn(List<SysCategory> categoryList, Map.Entry<String, Object> entry, List<OnlCgformField> treeFieldList, String cut,String flagTemp) {
|
||||
List<String> treeFields = treeFieldList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
String key = entry.getKey();
|
||||
if (treeFields.contains(entry.getKey())) {
|
||||
String value = StringUtils.valueOf(entry.getValue());
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
List<String> idList = Arrays.asList(value.split(","));
|
||||
List<SysCategory> sysCategoryList = categoryList.stream().filter(e -> idList.contains(e.getId())).collect(Collectors.toList());
|
||||
List<String> nameList = sysCategoryList.stream().map(SysCategory::getName).collect(Collectors.toList());
|
||||
List<String> nameEnList = sysCategoryList.stream().map(SysCategory::getEnName).collect(Collectors.toList());
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
entry.setValue(StringUtils.join(nameList, ","));
|
||||
} else if(CutEnum.EN.getValue().equals(cut)){
|
||||
entry.setValue(StringUtils.join(nameEnList, ","));
|
||||
}else if("2".equals(flagTemp)){
|
||||
entry.setValue(StringUtils.join(nameList, ","));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SneakyThrows
|
||||
|
||||
+161
-51
@@ -29,6 +29,7 @@ import com.jero.modules.dummy.service.IDummyInventoryInfoEOService;
|
||||
import com.jero.modules.dummy.service.IDummyReadEOService;
|
||||
import com.jero.modules.dummy.vo.VirtualCreaterVo;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
import com.jero.modules.system.entity.SysAnnouncement;
|
||||
@@ -41,6 +42,7 @@ import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -250,10 +252,14 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
|
||||
@Override
|
||||
public IPage<DummyInventoryBaseEO> getPageInfo(Page<DummyInventoryBaseEO> page, QueryWrapper<DummyInventoryBaseEO> queryWrapper) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
queryWrapper.and(query->{
|
||||
query.in("create_by",sysUser.getUsername()).in("state",InventoryStateEnum.DRAFT.getValue())
|
||||
.or().in("state",InventoryStateEnum.ISSUE.getValue());
|
||||
});
|
||||
//系统管理
|
||||
boolean administrator = sysUserService.isAdministrator();
|
||||
if(!administrator){
|
||||
queryWrapper.and(query->{
|
||||
query.in("create_by",sysUser.getUsername()).in("state",InventoryStateEnum.DRAFT.getValue())
|
||||
.or().in("state",InventoryStateEnum.ISSUE.getValue());
|
||||
});
|
||||
}
|
||||
// queryWrapper.or(query->{
|
||||
// query.in("state",InventoryStateEnum.ISSUE.getValue());
|
||||
// });
|
||||
@@ -319,19 +325,19 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
|
||||
|
||||
DummyInventoryBaseEO baseEO = queryById(dummyInventoryBaseEO.getId());
|
||||
List<String> createByNameList =new ArrayList<>();
|
||||
if (StringUtils.isNotBlank(baseEO.getCreateBy())) {
|
||||
createByNameList = Arrays.asList(baseEO.getCreateBy().split(","));
|
||||
|
||||
if (CollectionUtils.isNotEmpty(createByNameList)){
|
||||
if (!createByNameList.contains(loginUserName)) {
|
||||
if (CutEnum.CN.getValue().equals(dummyInventoryBaseEO.getCut())) {
|
||||
throw new JeroBootException("当前用户非创建者,无法发布");
|
||||
} else {
|
||||
throw new JeroBootException("The current user is not the creator and cannot be issued.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// if (StringUtils.isNotBlank(baseEO.getCreateBy())) {
|
||||
// createByNameList = Arrays.asList(baseEO.getCreateBy().split(","));
|
||||
//
|
||||
// if (CollectionUtils.isNotEmpty(createByNameList)){
|
||||
// if (!createByNameList.contains(loginUserName)) {
|
||||
// if (CutEnum.CN.getValue().equals(dummyInventoryBaseEO.getCut())) {
|
||||
// throw new JeroBootException("当前用户非创建者,无法发布");
|
||||
// } else {
|
||||
// throw new JeroBootException("The current user is not the creator and cannot be issued.");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
Date now = new Date();
|
||||
UpdateWrapper<DummyInventoryBaseEO> baseWrapper=new UpdateWrapper<>();
|
||||
baseWrapper.set("state",dummyInventoryBaseEO.getState());
|
||||
@@ -366,6 +372,7 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
|
||||
List<DummyInventoryInfoEO> dummyInventoryInfoEOList = iDummyInventoryInfoEOService.list(lambdaQueryWrapper);
|
||||
String contentLog = "The "+ baseEO.getName()+" virtual list you subscribed to has been updated as follows:" + "</br>";
|
||||
String contentLogFeishu = "The "+ baseEO.getName()+" virtual list you subscribed to has been updated as follows:" + " ";
|
||||
String contentLogFeishuTemp = "The "+ baseEO.getName()+" virtual list you subscribed to has been updated as follows:" + " ";
|
||||
|
||||
if(dummyContentChangeEOList.size() == 0){
|
||||
//没有添加过需要进行第一次添加
|
||||
@@ -407,31 +414,85 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
|
||||
|
||||
//发消息
|
||||
int count = 1;
|
||||
List<String> hrefListAdd = new ArrayList<>();
|
||||
if(serialNumberAddList.size() != 0){
|
||||
List<String> hrefList = new ArrayList<>();
|
||||
|
||||
for (DummyInventoryInfoEO dummyInventoryInfoEO : collectAdd) {
|
||||
String href = "<a href='/docManage/library/detail?id=" + dummyInventoryInfoEO.getBussDocumentLibraryId() +
|
||||
"&title=" + dummyInventoryInfoEO.getTitle() +
|
||||
"&serial_number=" + dummyInventoryInfoEO.getSerialNumber() + "'" + " target='_blank'>" + dummyInventoryInfoEO.getSerialNumber() + "</a>";
|
||||
hrefList.add(href);
|
||||
hrefListAdd.add(href);
|
||||
}
|
||||
contentLog += count+". New regulations: " + StringUtils.join(hrefList,",") + "</br>";
|
||||
contentLog += count+". New regulations: " + StringUtils.join(hrefListAdd,",") + "</br>";
|
||||
contentLogFeishu += count+". New regulations: " + StringUtils.join(serialNumberAddList,",") + " ";
|
||||
count++;
|
||||
}
|
||||
List<String> hrefListDelete = new ArrayList<>();
|
||||
if(serialNumberDeleteList.size() != 0){
|
||||
List<String> hrefList = new ArrayList<>();
|
||||
for (DummyInventoryInfoEO dummyInventoryInfoEO : collectDelete) {
|
||||
String href = "<a href='/docManage/library/detail?id=" + dummyInventoryInfoEO.getBussDocumentLibraryId() +
|
||||
"&title=" + dummyInventoryInfoEO.getTitle() +
|
||||
"&serial_number=" + dummyInventoryInfoEO.getSerialNumber() + "'" + " target='_blank'>" + dummyInventoryInfoEO.getSerialNumber() + "</a>";
|
||||
hrefList.add(href);
|
||||
hrefListDelete.add(href);
|
||||
}
|
||||
contentLog += count + ". Remove regulations: " + StringUtils.join(hrefList,",") + "</br>";
|
||||
contentLog += count + ". Remove regulations: " + StringUtils.join(hrefListDelete,",") + "</br>";
|
||||
contentLogFeishu += count + ". Remove regulations: " + StringUtils.join(serialNumberDeleteList,",") + " ";
|
||||
}
|
||||
|
||||
if(serialNumberAddList.size() != 0 || serialNumberDeleteList.size() != 0){
|
||||
int countNo = 1;
|
||||
StringBuilder sbContentNo = new StringBuilder();
|
||||
if(ObjectUtils.isNotEmpty(serialNumberAddList)){
|
||||
sbContentNo.append(countNo+". New regulations: "+StringUtils.join(serialNumberAddList,",")+", ");
|
||||
countNo ++;
|
||||
}
|
||||
if(ObjectUtils.isNotEmpty(serialNumberDeleteList)){
|
||||
sbContentNo.append(countNo+". Remove regulations: "+StringUtils.join(serialNumberDeleteList,","));
|
||||
}
|
||||
|
||||
int countYes = 1;
|
||||
StringBuilder sbContentYes = new StringBuilder();
|
||||
if(ObjectUtils.isNotEmpty(serialNumberAddList)){
|
||||
sbContentYes.append(countYes+". New regulations: "+StringUtils.join(hrefListAdd,",")+"</br>");
|
||||
countYes ++;
|
||||
}
|
||||
if(ObjectUtils.isNotEmpty(serialNumberDeleteList)){
|
||||
sbContentYes.append(countYes+". Remove regulations: "+StringUtils.join(hrefListDelete,","));
|
||||
}
|
||||
String hrefTemp = "<a href='/virtualListDetails?id=" + dummyInventoryBaseEO.getId() +
|
||||
"&useExplain="+baseEO.getUseExplain()+
|
||||
"&name=" + baseEO.getName() + "'" + " target='_blank'>" + baseEO.getName() + "</a>";
|
||||
|
||||
//消息英文--不带标签
|
||||
String contentNo = "The "+ baseEO.getName()+" virtual list you subscribed to has been updated as follows:" + sbContentNo;
|
||||
//消息英文--带标签
|
||||
String contentYes = "The "+ hrefTemp+" virtual list you subscribed to has been updated as follows:"+ "</br>" + sbContentYes;;
|
||||
|
||||
int countInfoNo = 1;
|
||||
StringBuilder sbContentINfoNo = new StringBuilder();
|
||||
if(ObjectUtils.isNotEmpty(serialNumberAddList)){
|
||||
sbContentINfoNo.append(countInfoNo+". 新增文档: "+StringUtils.join(serialNumberAddList,",")+", ");
|
||||
countInfoNo ++;
|
||||
}
|
||||
if(ObjectUtils.isNotEmpty(serialNumberDeleteList)){
|
||||
sbContentINfoNo.append(countInfoNo+". 删除文档: "+StringUtils.join(serialNumberDeleteList,","));
|
||||
}
|
||||
|
||||
int countInfoYes = 1;
|
||||
StringBuilder sbContentInfoYes = new StringBuilder();
|
||||
if(ObjectUtils.isNotEmpty(serialNumberAddList)){
|
||||
sbContentInfoYes.append(countInfoYes+". 新增文档: "+StringUtils.join(hrefListAdd,",")+"</br>");
|
||||
countInfoYes ++;
|
||||
}
|
||||
if(ObjectUtils.isNotEmpty(serialNumberDeleteList)){
|
||||
sbContentInfoYes.append(countInfoYes+". 删除文档: "+StringUtils.join(hrefListDelete,","));
|
||||
}
|
||||
|
||||
//消息中文--不带标签
|
||||
String contentInfoNo = "您所订阅的"+baseEO.getName()+"虚拟清单已更新,更新内容如下:"+sbContentINfoNo;
|
||||
//消息中文--带标签
|
||||
String contentInfoYes = "您所订阅的"+hrefTemp+"虚拟清单已更新,更新内容如下:"+"</br>"+sbContentInfoYes;
|
||||
|
||||
List<String> userNameList = dummyReadEOService.queryReadUserInfo(dummyInventoryBaseEO.getId());
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(userNameList.size() != 0){
|
||||
@@ -440,7 +501,14 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
|
||||
if(userIdList.size() != 0){
|
||||
//封装消息的实体类
|
||||
String title = "The "+ baseEO.getName()+" virtual list you subscribed to has been updated.";
|
||||
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, title, title, contentLog,MessageTypeEnum.READ.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList,
|
||||
title,
|
||||
contentNo,
|
||||
contentYes,
|
||||
MessageTypeEnum.READ.getValue(),
|
||||
MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
|
||||
contentInfoNo,
|
||||
contentInfoYes);
|
||||
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||
bussDocumentLibraryEOService.sendWebsocket(dummyInventoryBaseEO.getId(), title);
|
||||
}
|
||||
@@ -449,7 +517,15 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
|
||||
if(thirdIdList.size() != 0){
|
||||
String href = backUrl + "/virtualListDetails?name=" + baseEO.getName() + "&useExplain=" + baseEO.getUseExplain() +"&id=" + baseEO.getId() +"&title=维护虚拟清单";
|
||||
try {
|
||||
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentLogFeishu, MessageTypeEnum.PUSH.getName(), href);
|
||||
String contentInfoFeiCn = "您所订阅的"+baseEO.getName()+"虚拟清单已更新,更新内容如下:";
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setTitle(MessageTypeEnum.READ.getNameCn()+"/"+MessageTypeEnum.READ.getName());
|
||||
feishuMsgVo.setUrl(href);
|
||||
feishuMsgVo.setContentEn(contentLogFeishuTemp);
|
||||
feishuMsgVo.setContent(contentInfoFeiCn);
|
||||
|
||||
iFeishuService.sendCardMsgVirtua(thirdIdList.toArray(new String[]{}),feishuMsgVo,serialNumberAddList,serialNumberDeleteList);
|
||||
// iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentLogFeishu, MessageTypeEnum.PUSH.getName(), href);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -471,31 +547,52 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
|
||||
}
|
||||
}else{
|
||||
//撤回,需要发消息
|
||||
try {
|
||||
List<String> userNameList = dummyReadEOService.queryReadUserInfo(dummyInventoryBaseEO.getId());
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(userNameList.size() != 0){
|
||||
List<String> userIdList = sysUserService.queryUserIdListByNameList(userNameList).stream().map(e -> e.getId()).collect(Collectors.toList());
|
||||
thirdIdList = sysUserService.queryUserIdListByNameList(userNameList).stream().map(e -> e.getThirdId()).collect(Collectors.toList());
|
||||
if(userIdList.size() != 0){
|
||||
//封装消息的实体类 The XX virtual list you subscribed to has been withdrawn
|
||||
String title = "The "+ baseEO.getName()+" virtual list you subscribed to has been withdrawn.";
|
||||
//Please note that the XX virtual list you subscribed to has been withdrawn.
|
||||
String contentLog = "Please note that the "+ baseEO.getName()+" virtual list you subscribed to has been withdrawn.";
|
||||
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, title, title, contentLog,MessageTypeEnum.READ.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||
bussDocumentLibraryEOService.sendWebsocket(dummyInventoryBaseEO.getId(), title);
|
||||
}
|
||||
}
|
||||
// try {
|
||||
// List<String> userNameList = dummyReadEOService.queryReadUserInfo(dummyInventoryBaseEO.getId());
|
||||
// List<String> thirdIdList = new ArrayList<>();
|
||||
// if(userNameList.size() != 0){
|
||||
// List<String> userIdList = sysUserService.queryUserIdListByNameList(userNameList).stream().map(e -> e.getId()).collect(Collectors.toList());
|
||||
// thirdIdList = sysUserService.queryUserIdListByNameList(userNameList).stream().map(e -> e.getThirdId()).collect(Collectors.toList());
|
||||
// if(userIdList.size() != 0){
|
||||
// String hrefTemp = "<a href='/virtualListDetails?id=" + dummyInventoryBaseEO.getId() +
|
||||
// "&useExplain="+baseEO.getUseExplain()+
|
||||
// "&name=" + baseEO.getName() + "'" + " target='_blank'>" + baseEO.getName() + "</a>";
|
||||
// //封装消息的实体类 The XX virtual list you subscribed to has been withdrawn
|
||||
// String title = "The "+ baseEO.getName()+" virtual list you subscribed to has been withdrawn.";
|
||||
// //Please note that the XX virtual list you subscribed to has been withdrawn.
|
||||
// String contentLog = "Please note that the "+ baseEO.getName()+" virtual list you subscribed to has been withdrawn.";
|
||||
|
||||
// String contentCnNo = "您订阅的虚拟清单"+ baseEO.getName()+"已被撤回.";
|
||||
// String contentCnYes = "您订阅的虚拟清单"+ hrefTemp+"已被撤回.";
|
||||
// String contentInfoEnNo = "Please note that the "+ baseEO.getName()+" virtual list you subscribed to has been withdrawn.";
|
||||
// String contentInfoEnYes = "Please note that the "+ hrefTemp+" virtual list you subscribed to has been withdrawn.";
|
||||
// SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList,
|
||||
// title,
|
||||
// contentInfoEnNo,
|
||||
// contentInfoEnYes,
|
||||
// MessageTypeEnum.READ.getValue(),
|
||||
// MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
|
||||
// contentCnNo,contentCnYes);
|
||||
// sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||
// bussDocumentLibraryEOService.sendWebsocket(dummyInventoryBaseEO.getId(), title);
|
||||
// }
|
||||
// }
|
||||
//飞书
|
||||
if(thirdIdList.size() != 0){
|
||||
String contentInfoTemp = "Please note that the "+ baseEO.getName()+" virtual list you subscribed to has been withdrawn.";
|
||||
String href = backUrl + "/virtualListDetails?name=" + baseEO.getName() + "&useExplain=" + baseEO.getUseExplain() +"&id=" + baseEO.getId() +"&title=维护虚拟清单";
|
||||
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentInfoTemp, MessageTypeEnum.PUSH.getName(), href);
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
// if(thirdIdList.size() != 0){
|
||||
// String contentInfoTemp = "Please note that the "+ baseEO.getName()+" virtual list you subscribed to has been withdrawn.";
|
||||
// String contentInfoFeiCn = "您订阅的虚拟清单"+ baseEO.getName()+"已被撤回.";
|
||||
// String href = backUrl + "/virtualListDetails?name=" + baseEO.getName() + "&useExplain=" + baseEO.getUseExplain() +"&id=" + baseEO.getId() +"&title=维护虚拟清单";
|
||||
// FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
// feishuMsgVo.setTitle(MessageTypeEnum.READ.getNameCn()+"/"+MessageTypeEnum.READ.getName());
|
||||
// feishuMsgVo.setUrl(href);
|
||||
// feishuMsgVo.setContentEn(contentInfoTemp);
|
||||
// feishuMsgVo.setContent(contentInfoFeiCn);
|
||||
// iFeishuService.sendCardMsgVirtua(thirdIdList.toArray(new String[]{}), feishuMsgVo,null,null);
|
||||
//// iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentInfoTemp, MessageTypeEnum.PUSH.getName(), href);
|
||||
// }
|
||||
// }catch (Exception e){
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
}
|
||||
}
|
||||
// /**
|
||||
@@ -1354,7 +1451,14 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
|
||||
|
||||
msgTitle = "The " + baseName + " virtual list you subscribed to has been updated";
|
||||
//封装消息的实体类
|
||||
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, msgTitle, content, contentInfo,MessageTypeEnum.READ.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList,
|
||||
msgTitle,
|
||||
content,
|
||||
contentInfo,
|
||||
MessageTypeEnum.READ.getValue(),
|
||||
MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
|
||||
null,
|
||||
null);
|
||||
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||
bussDocumentLibraryEOService.sendWebsocket(idTemp, contentInfo);
|
||||
//飞书
|
||||
@@ -1368,7 +1472,13 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
|
||||
contentInfo = "Please note that the "+baseName+" virtual list you subscribed to has been withdrawn.";
|
||||
msgTitle = "The " + baseName + " virtual list you subscribed to has been withdrawn";
|
||||
//封装消息的实体类
|
||||
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, msgTitle, content, contentInfo,MessageTypeEnum.READ.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList,
|
||||
msgTitle,
|
||||
content,
|
||||
contentInfo,
|
||||
MessageTypeEnum.READ.getValue(),
|
||||
MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
|
||||
null,null);
|
||||
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||
bussDocumentLibraryEOService.sendWebsocket(idTemp, contentInfo);
|
||||
//飞书
|
||||
|
||||
+41
@@ -1,9 +1,11 @@
|
||||
package com.jero.modules.feishu.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.modules.feishu.vo.FeishuMsg2Vo;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -38,6 +40,42 @@ public interface IFeishuService {
|
||||
*/
|
||||
String sendCardMsg(String[] userIds, FeishuMsgVo feishuMsgVo) throws IOException;
|
||||
|
||||
/**
|
||||
* 文档库卡片消息
|
||||
* @param userIds
|
||||
* @param feishuMsgVo
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
String sendCardMsgDocument(String[] userIds, FeishuMsgVo feishuMsgVo) throws IOException;
|
||||
|
||||
/**
|
||||
* 订阅领域(飞书消息)
|
||||
* @param userIds
|
||||
* @param feishuMsgVo
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
String sendCardMsgTerritory(String[] userIds, FeishuMsgVo feishuMsgVo) throws IOException;
|
||||
|
||||
/**
|
||||
* 预警推送(飞书消息)
|
||||
* @param userIds
|
||||
* @param feishuMsgVo
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
String sendCardMsgWarn(String[] userIds, FeishuMsgVo feishuMsgVo) throws IOException;
|
||||
|
||||
/**
|
||||
* 虚拟清单(飞书消息)
|
||||
* @param userIds
|
||||
* @param feishuMsgVo
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
String sendCardMsgVirtua(String[] userIds, FeishuMsgVo feishuMsgVo, List<String> serialNumberAddList,List<String> serialNumberDeleteList) throws IOException;
|
||||
|
||||
/**
|
||||
* 翻译文本
|
||||
* @param params
|
||||
@@ -62,4 +100,7 @@ public interface IFeishuService {
|
||||
* @param split
|
||||
*/
|
||||
void sendKnowledgeBaseTypeChargePersonCard(String[] split);
|
||||
|
||||
void sendCard(String[] thirdIds, FeishuMsg2Vo feishuMsgVo) throws IOException;
|
||||
|
||||
}
|
||||
|
||||
+554
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsg2Vo;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.ProblemKnowledgeBaseClassifyEO;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.ProblemKnowledgeBaseEO;
|
||||
@@ -24,6 +25,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -280,6 +282,476 @@ public class FeishuServiceImpl implements IFeishuService {
|
||||
return tokenJson.get("msg").toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 文档库卡片消息
|
||||
* @param userIds
|
||||
* @param feishuMsgVo
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public String sendCardMsgDocument(String[] userIds, FeishuMsgVo feishuMsgVo) throws IOException {
|
||||
String token = getTenantAccessToken();
|
||||
// 设置请求头
|
||||
Map<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("},");
|
||||
};
|
||||
contentSb.append("{\"tag\": \"hr\"},");
|
||||
|
||||
//内容英文
|
||||
if (StrUtil.isNotEmpty(feishuMsgVo.getContentEn())){
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"tag\": \"div\",");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"" + feishuMsgVo.getContentEn() + "\",");
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("},");
|
||||
};
|
||||
|
||||
|
||||
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"actions\": [");
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"tag\": \"button\",");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"view\",");
|
||||
contentSb.append("\"tag\": \"plain_text\"");
|
||||
contentSb.append("},");
|
||||
contentSb.append("\"type\": \"primary\",");
|
||||
contentSb.append("\"url\": \" "+ feishuMsgVo.getUrl() +" \"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("],");
|
||||
contentSb.append("\"tag\": \"action\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("],");
|
||||
|
||||
|
||||
|
||||
contentSb.append("\"header\": {");
|
||||
contentSb.append("\"template\": \"green\",");
|
||||
contentSb.append("\"title\": {");
|
||||
contentSb.append("\"content\": \" " + feishuMsgVo.getTitle() + " \",");
|
||||
contentSb.append("\"tag\": \"plain_text\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("}");
|
||||
contentSb.append("}");
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(contentSb.toString());
|
||||
|
||||
String content = JSONObject.parseObject(
|
||||
JSONObject.parseObject(JSONArray.parseArray(jsonObject.get("elements").toString()).get(0).toString()).get("text").toString())
|
||||
.get("content").toString();
|
||||
String contentEn = JSONObject.parseObject(
|
||||
JSONObject.parseObject(JSONArray.parseArray(jsonObject.get("elements").toString()).get(2).toString()).get("text").toString())
|
||||
.get("content").toString();
|
||||
|
||||
JSONObject elementTwo =
|
||||
JSONObject.parseObject(JSONArray.parseArray(jsonObject.get("elements").toString()).get(1).toString());
|
||||
JSONObject elementFour =
|
||||
JSONObject.parseObject(JSONArray.parseArray(jsonObject.get("elements").toString()).get(3).toString());
|
||||
|
||||
//处理内容中的双引号(将尖括号替换成双引号)
|
||||
JSONObject elementOne = getJsonObject(jsonObject, content);
|
||||
JSONObject elementThree = getJsonObject(jsonObject, contentEn);
|
||||
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
jsonArray.add(elementOne);
|
||||
jsonArray.add(elementTwo);
|
||||
jsonArray.add(elementThree);
|
||||
jsonArray.add(elementFour);
|
||||
jsonObject.put("elements",jsonArray);
|
||||
|
||||
// 设置请求参数
|
||||
JSONObject paramsMap = new JSONObject();
|
||||
paramsMap.put("user_ids", userIds);
|
||||
paramsMap.put("msg_type", "interactive");
|
||||
paramsMap.put("card", jsonObject);
|
||||
|
||||
// 发送请求给飞书
|
||||
String response = HttpRequestUtil.getResponseOfPOST(batchSendMessageUrl, headerMap, paramsMap.toJSONString());
|
||||
// 获取返回结果
|
||||
JSONObject tokenJson = JSONObject.parseObject(response);
|
||||
if(!tokenJson.get("code").toString().equals("0")) {
|
||||
log.error("请求出现异常:" + tokenJson.get("msg") + " " + tokenJson);
|
||||
}
|
||||
return tokenJson.get("msg").toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 订阅领域(飞书消息)
|
||||
* @param userIds
|
||||
* @param feishuMsgVo
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public String sendCardMsgTerritory(String[] userIds, FeishuMsgVo feishuMsgVo) throws IOException {
|
||||
String token = getTenantAccessToken();
|
||||
// 设置请求头
|
||||
Map<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("},");
|
||||
};
|
||||
contentSb.append("{\"tag\": \"hr\"},");
|
||||
|
||||
//内容英文
|
||||
if (StrUtil.isNotEmpty(feishuMsgVo.getContentEn())){
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"tag\": \"div\",");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"" + feishuMsgVo.getContentEn() + "\",");
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("},");
|
||||
};
|
||||
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"actions\": [");
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"tag\": \"button\",");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"view\",");
|
||||
contentSb.append("\"tag\": \"plain_text\"");
|
||||
contentSb.append("},");
|
||||
contentSb.append("\"type\": \"primary\",");
|
||||
contentSb.append("\"url\": \" "+ feishuMsgVo.getUrl() +" \"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("],");
|
||||
contentSb.append("\"tag\": \"action\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("],");
|
||||
|
||||
|
||||
|
||||
contentSb.append("\"header\": {");
|
||||
contentSb.append("\"template\": \"green\",");
|
||||
contentSb.append("\"title\": {");
|
||||
contentSb.append("\"content\": \" " + feishuMsgVo.getTitle() + " \",");
|
||||
contentSb.append("\"tag\": \"plain_text\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("}");
|
||||
contentSb.append("}");
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(contentSb.toString());
|
||||
|
||||
// 设置请求参数
|
||||
JSONObject paramsMap = new JSONObject();
|
||||
paramsMap.put("user_ids", userIds);
|
||||
paramsMap.put("msg_type", "interactive");
|
||||
paramsMap.put("card", jsonObject);
|
||||
|
||||
// 发送请求给飞书
|
||||
String response = HttpRequestUtil.getResponseOfPOST(batchSendMessageUrl, headerMap, paramsMap.toJSONString());
|
||||
// 获取返回结果
|
||||
JSONObject tokenJson = JSONObject.parseObject(response);
|
||||
if(!tokenJson.get("code").toString().equals("0")) {
|
||||
log.error("请求出现异常:" + tokenJson.get("msg") + " " + tokenJson);
|
||||
}
|
||||
return tokenJson.get("msg").toString();
|
||||
}
|
||||
/**
|
||||
* 预警推送(飞书消息)
|
||||
* @param userIds
|
||||
* @param feishuMsgVo
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public String sendCardMsgWarn(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() + "\"\n,");
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("},");
|
||||
};
|
||||
// 编号,标题,新车型实施日期,在产车实施日期
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"tag\": \"div\",");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"" + "编号: " + feishuMsgVo.getRegulationNo() + "\n")
|
||||
.append("标题: "+feishuMsgVo.getDocumentTitleCn() + "\n");
|
||||
if (StringUtils.isNotBlank(feishuMsgVo.getNewTypeExecutionDate())) {
|
||||
contentSb.append("新车型实施日期: " + feishuMsgVo.getNewTypeExecutionDate() + "\n");
|
||||
} else {
|
||||
contentSb.append("新车型实施日期: "+ "\n");
|
||||
}
|
||||
if (StringUtils.isNotBlank(feishuMsgVo.getNewVehicleExecutionDate())) {
|
||||
contentSb.append("在产车实施日期: " + feishuMsgVo.getNewVehicleExecutionDate());
|
||||
} else {
|
||||
contentSb.append("在产车实施日期: ");
|
||||
}
|
||||
contentSb.append("\",");
|
||||
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("},");
|
||||
contentSb.append("{\"tag\": \"hr\"},");
|
||||
|
||||
//内容英文
|
||||
if (StrUtil.isNotEmpty(feishuMsgVo.getContentEn())){
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"tag\": \"div\",");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"" + feishuMsgVo.getContentEn() + "\"\n,");
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("},");
|
||||
};
|
||||
// 编号,标题,新车型实施日期,在产车实施日期
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"tag\": \"div\",");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"" + "Regulation No: " + feishuMsgVo.getRegulationNo() + "\n")
|
||||
.append("Title: " + feishuMsgVo.getDocumentTitleEn() + "\n");
|
||||
if (StringUtils.isNotBlank(feishuMsgVo.getNewTypeExecutionDate())) {
|
||||
contentSb.append("New Type Execution Date: " + feishuMsgVo.getNewTypeExecutionDate() + "\n");
|
||||
} else {
|
||||
contentSb.append("New Type Execution Date: "+ "\n");
|
||||
}
|
||||
if (StringUtils.isNotBlank(feishuMsgVo.getNewVehicleExecutionDate())) {
|
||||
contentSb.append("New Vehicle Execution Date: " + feishuMsgVo.getNewVehicleExecutionDate());
|
||||
} else {
|
||||
contentSb.append("New Vehicle Execution Date: ");
|
||||
}
|
||||
contentSb.append("\",");
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("},");
|
||||
|
||||
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"actions\": [");
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"tag\": \"button\",");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"view\",");
|
||||
contentSb.append("\"tag\": \"plain_text\"");
|
||||
contentSb.append("},");
|
||||
contentSb.append("\"type\": \"primary\",");
|
||||
contentSb.append("\"url\": \" "+ feishuMsgVo.getUrl() +" \"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("],");
|
||||
contentSb.append("\"tag\": \"action\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("],");
|
||||
|
||||
|
||||
|
||||
contentSb.append("\"header\": {");
|
||||
contentSb.append("\"template\": \"green\",");
|
||||
contentSb.append("\"title\": {");
|
||||
contentSb.append("\"content\": \" " + feishuMsgVo.getTitle() + " \",");
|
||||
contentSb.append("\"tag\": \"plain_text\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("}");
|
||||
contentSb.append("}");
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(contentSb.toString());
|
||||
|
||||
// 设置请求参数
|
||||
JSONObject paramsMap = new JSONObject();
|
||||
paramsMap.put("user_ids", userIds);
|
||||
paramsMap.put("msg_type", "interactive");
|
||||
paramsMap.put("card", jsonObject);
|
||||
|
||||
// 发送请求给飞书
|
||||
String response = HttpRequestUtil.getResponseOfPOST(batchSendMessageUrl, headerMap, paramsMap.toJSONString());
|
||||
// 获取返回结果
|
||||
JSONObject tokenJson = JSONObject.parseObject(response);
|
||||
if(!tokenJson.get("code").toString().equals("0")) {
|
||||
log.error("请求出现异常:" + tokenJson.get("msg") + " " + tokenJson);
|
||||
}
|
||||
return tokenJson.get("msg").toString();
|
||||
}
|
||||
/**
|
||||
* 虚拟清单发布(飞书消息)
|
||||
* @param userIds
|
||||
* @param feishuMsgVo
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public String sendCardMsgVirtua(String[] userIds, FeishuMsgVo feishuMsgVo,
|
||||
List<String> serialNumberAddList,List<String> serialNumberDeleteList) 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() + "\"\n,");
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("},");
|
||||
};
|
||||
if(ObjectUtils.isNotEmpty(serialNumberAddList)){
|
||||
int count = 1;
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"tag\": \"div\",");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"" + count + ". 新增文档: " + StringUtils.join(serialNumberAddList,",") + "\"\n,");
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("},");
|
||||
}
|
||||
if(ObjectUtils.isNotEmpty(serialNumberDeleteList)){
|
||||
int count = 2;
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"tag\": \"div\",");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"" + count + ". 删除文档: " + StringUtils.join(serialNumberDeleteList,",") + "\"\n,");
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("},");
|
||||
}
|
||||
contentSb.append("{\"tag\": \"hr\"},");
|
||||
|
||||
//内容英文
|
||||
if (StrUtil.isNotEmpty(feishuMsgVo.getContentEn())){
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"tag\": \"div\",");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"" + feishuMsgVo.getContentEn() + "\"\n,");
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("},");
|
||||
};
|
||||
|
||||
if (ObjectUtils.isNotEmpty(serialNumberAddList)) {
|
||||
int count = 1;
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"tag\": \"div\",");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"" + count + ". New regulations: " + StringUtils.join(serialNumberAddList,",") + "\"\n,");
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("},");
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(serialNumberDeleteList)) {
|
||||
int count = 2;
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"tag\": \"div\",");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"" + count + ". Remove regulations: " + StringUtils.join(serialNumberDeleteList,",") + "\"\n,");
|
||||
contentSb.append("\"tag\": \"lark_md\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("},");
|
||||
}
|
||||
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"actions\": [");
|
||||
contentSb.append("{");
|
||||
contentSb.append("\"tag\": \"button\",");
|
||||
contentSb.append("\"text\": {");
|
||||
contentSb.append("\"content\": \"view\",");
|
||||
contentSb.append("\"tag\": \"plain_text\"");
|
||||
contentSb.append("},");
|
||||
contentSb.append("\"type\": \"primary\",");
|
||||
contentSb.append("\"url\": \" "+ feishuMsgVo.getUrl() +" \"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("],");
|
||||
contentSb.append("\"tag\": \"action\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("],");
|
||||
|
||||
|
||||
|
||||
contentSb.append("\"header\": {");
|
||||
contentSb.append("\"template\": \"green\",");
|
||||
contentSb.append("\"title\": {");
|
||||
contentSb.append("\"content\": \" " + feishuMsgVo.getTitle() + " \",");
|
||||
contentSb.append("\"tag\": \"plain_text\"");
|
||||
contentSb.append("}");
|
||||
contentSb.append("}");
|
||||
contentSb.append("}");
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(contentSb.toString());
|
||||
|
||||
// 设置请求参数
|
||||
JSONObject paramsMap = new JSONObject();
|
||||
paramsMap.put("user_ids", userIds);
|
||||
paramsMap.put("msg_type", "interactive");
|
||||
paramsMap.put("card", jsonObject);
|
||||
|
||||
// 发送请求给飞书
|
||||
String response = HttpRequestUtil.getResponseOfPOST(batchSendMessageUrl, headerMap, paramsMap.toJSONString());
|
||||
// 获取返回结果
|
||||
JSONObject tokenJson = JSONObject.parseObject(response);
|
||||
if(!tokenJson.get("code").toString().equals("0")) {
|
||||
log.error("请求出现异常:" + tokenJson.get("msg") + " " + tokenJson);
|
||||
}
|
||||
return tokenJson.get("msg").toString();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private JSONObject getJsonObject(JSONObject jsonObject, String content) {
|
||||
String contentReplaceAll = content.replaceAll("<", "\"");
|
||||
|
||||
JSONObject jsonObject1 = JSONObject.parseObject(
|
||||
JSONObject.parseObject(
|
||||
JSONArray.parseArray(jsonObject.get("elements").toString()).get(0).toString())
|
||||
.get("text").toString());
|
||||
jsonObject1.put("content",contentReplaceAll);
|
||||
|
||||
|
||||
JSONObject elementOne =
|
||||
JSONObject.parseObject(JSONArray.parseArray(jsonObject.get("elements").toString()).get(0).toString());
|
||||
|
||||
elementOne.put("text",jsonObject1);
|
||||
return elementOne;
|
||||
}
|
||||
|
||||
/**
|
||||
* 翻译文本
|
||||
* 参数:
|
||||
@@ -674,4 +1146,86 @@ public class FeishuServiceImpl implements IFeishuService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送消息
|
||||
* @param thirdIds
|
||||
* @param feishuMsgVo
|
||||
*/
|
||||
@Override
|
||||
public void sendCard(String[] thirdIds, FeishuMsg2Vo 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");
|
||||
|
||||
|
||||
String sendJson = "{\n" +
|
||||
" \"config\": {\n" +
|
||||
" \"wide_screen_mode\": true\n" +
|
||||
" },\n" +
|
||||
" \"elements\": [\n" +
|
||||
" {\n" +
|
||||
" \"tag\": \"markdown\",\n" +
|
||||
" \"content\": \"" + feishuMsgVo.getCnContentUpper() + "\"\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"tag\": \"markdown\",\n" +
|
||||
" \"content\": \"" + feishuMsgVo.getCnContentLower() + "\"\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"tag\": \"hr\"\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"tag\": \"markdown\",\n" +
|
||||
" \"content\": \"" + feishuMsgVo.getEnContentUpper() + "\"\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"tag\": \"markdown\",\n" +
|
||||
" \"content\": \"" + feishuMsgVo.getEnContentLower() + "\"\n" +
|
||||
" },\n" +
|
||||
" {\n" +
|
||||
" \"actions\": [\n" +
|
||||
" {\n" +
|
||||
" \"tag\": \"button\",\n" +
|
||||
" \"text\": {\n" +
|
||||
" \"content\": \"View\",\n" +
|
||||
" \"tag\": \"plain_text\"\n" +
|
||||
" },\n" +
|
||||
" \"type\": \"primary\",\n" +
|
||||
" \"url\": \"" + feishuMsgVo.getUrl() + "\"\n" +
|
||||
" }\n" +
|
||||
" ],\n" +
|
||||
" \"tag\": \"action\"\n" +
|
||||
" }\n" +
|
||||
" ],\n" +
|
||||
" \"header\": {\n" +
|
||||
" \"template\": \"" + feishuMsgVo.getColor() + "\",\n" +
|
||||
" \"title\": {\n" +
|
||||
" \"content\": \"" + feishuMsgVo.getTitle() + "\",\n" +
|
||||
" \"tag\": \"plain_text\"\n" +
|
||||
" }\n" +
|
||||
" }\n" +
|
||||
"}";
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(sendJson.toString());
|
||||
|
||||
// 设置请求参数
|
||||
JSONObject paramsMap = new JSONObject();
|
||||
|
||||
paramsMap.put("user_ids", thirdIds);
|
||||
|
||||
paramsMap.put("msg_type", "interactive");
|
||||
paramsMap.put("card", jsonObject);
|
||||
|
||||
// 发送请求给飞书
|
||||
String response = HttpRequestUtil.getResponseOfPOST(batchSendMessageUrl, headerMap, paramsMap.toJSONString());
|
||||
// 获取返回结果
|
||||
JSONObject tokenJson = JSONObject.parseObject(response);
|
||||
if (!tokenJson.get("code").toString().equals("0")) {
|
||||
log.error("请求出现异常:" + tokenJson.get("msg") + " " + tokenJson);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.jero.modules.feishu.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FeishuMsg2Vo {
|
||||
|
||||
private String title; //标题
|
||||
|
||||
private String color; //颜色
|
||||
|
||||
private String enContentUpper; //英文内容上部
|
||||
private String enContentLower; //英文内容下部
|
||||
|
||||
private String cnContentUpper; //中文内容上部
|
||||
private String cnContentLower; //中文内容下部
|
||||
|
||||
private String url; //回调的网址
|
||||
|
||||
}
|
||||
@@ -12,6 +12,8 @@ public class FeishuMsgVo {
|
||||
|
||||
private String content; //内容
|
||||
|
||||
private String contentEn; //内容英文
|
||||
|
||||
private String taskType; //任务类型
|
||||
|
||||
private String regulationNo; //法规编号
|
||||
@@ -26,5 +28,14 @@ public class FeishuMsgVo {
|
||||
|
||||
private String assignee; //评估人 适用范围:责任人提交通知发起人(设计符合性,pre-homo符合性,验证符合性)
|
||||
|
||||
private String documentTitleCn; //文档标题中文
|
||||
|
||||
private String documentTitleEn; //文档标题英文
|
||||
|
||||
private String newTypeExecutionDate; //新车型实施日期
|
||||
|
||||
private String newVehicleExecutionDate; //在产车实施日期
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
+24
-2
@@ -10,13 +10,19 @@ import com.jero.modules.home.mapper.HomeFunctionModuleEOMapper;
|
||||
import com.jero.modules.home.service.IHomeFunctionModuleEOService;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.modules.system.entity.SysPermission;
|
||||
import com.jero.modules.system.service.ISysPermissionService;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 功能模块
|
||||
@@ -27,6 +33,9 @@ import java.util.UUID;
|
||||
@Service
|
||||
public class HomeFunctionModuleEOServiceImpl extends ServiceImpl<HomeFunctionModuleEOMapper, HomeFunctionModuleEO> implements IHomeFunctionModuleEOService {
|
||||
|
||||
@Autowired
|
||||
private ISysPermissionService sysPermissionService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
@@ -103,22 +112,35 @@ public class HomeFunctionModuleEOServiceImpl extends ServiceImpl<HomeFunctionMod
|
||||
public List<HomeFunctionModuleEO> queryList(String cut) {
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
//用户拥有权限的菜单
|
||||
List<SysPermission> metaList = sysPermissionService.queryByUser(loginUser.getUsername());
|
||||
|
||||
//所有的图表(state=0)
|
||||
LambdaQueryWrapper<HomeFunctionModuleEO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(HomeFunctionModuleEO::getState,"0").isNull(HomeFunctionModuleEO::getCreateBy);
|
||||
List<HomeFunctionModuleEO> homeFunctionModuleEOList = this.list(wrapper);
|
||||
List<HomeFunctionModuleEO> homeFunctionModuleEOListTemp = new ArrayList<>();
|
||||
|
||||
if(ObjectUtils.isNotEmpty(homeFunctionModuleEOList)){
|
||||
for (SysPermission sysPermission : metaList) {
|
||||
List<HomeFunctionModuleEO> collect = homeFunctionModuleEOList.stream().filter(e -> e.getIconName().equals(sysPermission.getName())).collect(Collectors.toList());
|
||||
if(ObjectUtils.isNotEmpty(collect)){
|
||||
homeFunctionModuleEOListTemp.addAll(collect);
|
||||
}
|
||||
}
|
||||
}
|
||||
homeFunctionModuleEOListTemp = homeFunctionModuleEOListTemp.stream().distinct().collect(Collectors.toList());
|
||||
//当前用户配置的图表
|
||||
LambdaQueryWrapper<HomeFunctionModuleEO> wrapperTemp = new LambdaQueryWrapper<>();
|
||||
wrapperTemp.in(HomeFunctionModuleEO::getCreateBy,loginUser.getUsername()).orderByAsc(HomeFunctionModuleEO::getState).orderByAsc(HomeFunctionModuleEO::getSort);
|
||||
List<HomeFunctionModuleEO> homeFunctionModuleEOS = this.list(wrapperTemp);
|
||||
if(homeFunctionModuleEOS.size() == 0){
|
||||
if(CutEnum.EN.getValue().equals(cut)){
|
||||
for (HomeFunctionModuleEO homeFunctionModuleEO : homeFunctionModuleEOList) {
|
||||
for (HomeFunctionModuleEO homeFunctionModuleEO : homeFunctionModuleEOListTemp) {
|
||||
homeFunctionModuleEO.setIconName(homeFunctionModuleEO.getIconNameEn());
|
||||
}
|
||||
}
|
||||
return homeFunctionModuleEOList;
|
||||
return homeFunctionModuleEOListTemp;
|
||||
}else{
|
||||
if(CutEnum.EN.getValue().equals(cut)){
|
||||
for (HomeFunctionModuleEO homeFunctionModuleEO : homeFunctionModuleEOS) {
|
||||
|
||||
+37
-9
@@ -2,6 +2,7 @@ package com.jero.modules.lawsOpinionGather.job;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.lawsOpinionGather.entity.LawsOpinionGatherEO;
|
||||
import com.jero.modules.lawsOpinionGather.enums.GatherResultEnum;
|
||||
import com.jero.modules.lawsOpinionGather.service.ILawsOpinionGatherEOService;
|
||||
@@ -41,18 +42,45 @@ public class LawsOpinionGatherRemindJob implements Job {
|
||||
if(CollectionUtils.isNotEmpty(lawsOpinionGatherEOList)){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
Date currentDate = new Date();
|
||||
|
||||
//Date currentDate = new Date();
|
||||
String now = sdf.format(new Date());
|
||||
//获取后一天的时间
|
||||
Calendar calendar=new GregorianCalendar();
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DATE,1);
|
||||
Date nextDay = calendar.getTime();
|
||||
//Calendar calendar=new GregorianCalendar();
|
||||
//calendar.setTime(new Date());
|
||||
//calendar.add(Calendar.DATE,1);
|
||||
//Date nextDay = calendar.getTime();
|
||||
|
||||
String nextDayStr = sdf.format(nextDay);
|
||||
//String nextDayStr = sdf.format(nextDay);
|
||||
|
||||
lawsOpinionGatherEOList.forEach(lawsOpinionGatherEO -> {
|
||||
if(StringUtils.equals(nextDayStr,sdf.format(lawsOpinionGatherEO.getEndTime()))){
|
||||
String endTime = sdf.format(lawsOpinionGatherEO.getEndTime());
|
||||
int days = 0;
|
||||
try {
|
||||
days = (int) (sdf.parse(endTime).getTime() - sdf.parse(now).getTime()) / (24 * 60 * 60 * 1000);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new JeroBootException("日期转换错误");
|
||||
}
|
||||
if (days == 3) {
|
||||
List<String> userIdList = this.workFlowFeignClient.getLawsOpinionGatherFlowAssigneeList(lawsOpinionGatherEO.getId());
|
||||
if(CollectionUtils.isNotEmpty(userIdList)){
|
||||
JSONObject sendJsonObject = new JSONObject();
|
||||
sendJsonObject.put("msgType", MsgTypeEnum.LAWS_OPOMOPM_GATHER_ENALUATOR_EXPIRE_REMIND_THREE_DAYS_BEFORE_MSG.getValue());
|
||||
sendJsonObject.put("lawsOpinionGatherId",lawsOpinionGatherEO.getId());
|
||||
sendJsonObject.put("userIdList",userIdList);
|
||||
this.lawsOpinionGatherEOService.workFlowSendMsg(sendJsonObject);
|
||||
}
|
||||
} else if (endTime.equals(now)) {
|
||||
List<String> userIdList = this.workFlowFeignClient.getLawsOpinionGatherFlowAssigneeList(lawsOpinionGatherEO.getId());
|
||||
if(CollectionUtils.isNotEmpty(userIdList)){
|
||||
JSONObject sendJsonObject = new JSONObject();
|
||||
sendJsonObject.put("msgType", MsgTypeEnum.LAWS_OPOMOPM_GATHER_ENALUATOR_EXPIRE_REMIND_TODAY_MSG.getValue());
|
||||
sendJsonObject.put("lawsOpinionGatherId",lawsOpinionGatherEO.getId());
|
||||
sendJsonObject.put("userIdList",userIdList);
|
||||
this.lawsOpinionGatherEOService.workFlowSendMsg(sendJsonObject);
|
||||
}
|
||||
}
|
||||
/*if(StringUtils.equals(nextDayStr,sdf.format(lawsOpinionGatherEO.getEndTime()))){
|
||||
List<String> userIdList = this.workFlowFeignClient.getLawsOpinionGatherFlowAssigneeList(lawsOpinionGatherEO.getId());
|
||||
if(CollectionUtils.isNotEmpty(userIdList)){
|
||||
JSONObject sendJsonObject = new JSONObject();
|
||||
@@ -62,7 +90,7 @@ public class LawsOpinionGatherRemindJob implements Job {
|
||||
sendJsonObject.put("userIdList",userIdList);
|
||||
this.lawsOpinionGatherEOService.workFlowSendMsg(sendJsonObject);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
+146
-20
@@ -2,11 +2,18 @@ package com.jero.modules.lawsOpinionGather.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.constant.enums.MessageType2Enum;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.constant.enums.MsgColorEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsg2Vo;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.lawsOpinionGather.entity.LawsOpinionGatherEO;
|
||||
import com.jero.modules.lawsOpinionGather.enums.GatherResultEnum;
|
||||
@@ -29,8 +36,13 @@ import com.jero.modules.system.entity.SysCategory;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
||||
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
|
||||
import com.jero.modules.todoCenter.enums.TodoCenterStatusEnum;
|
||||
import com.jero.modules.todoCenter.service.IProcessInfoEOService;
|
||||
import com.jero.modules.wkflow.enums.FlowTypeEnum;
|
||||
import com.jero.modules.wkflow.feginClient.WorkFlowFeignClient;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.modules.jmreport.common.constant.CommonConstant;
|
||||
@@ -38,6 +50,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -70,6 +83,12 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
|
||||
private ILawsOpinionAssessmentResultEOService lawsOpinionAssessmentResultEOService;
|
||||
@Autowired
|
||||
private WorkFlowFeignClient workFlowFeignClient;
|
||||
@Autowired
|
||||
private IProcessInfoEOService processInfoEOService;
|
||||
@Autowired
|
||||
private IFeishuService feishuService;
|
||||
@Autowired
|
||||
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
@@ -129,6 +148,8 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
|
||||
QueryWrapper deleteWrapper = new QueryWrapper();
|
||||
deleteWrapper.in("laws_opinion_gather_id",ids);
|
||||
this.lawsOpinionAssessmentResultEOService.remove(deleteWrapper);
|
||||
|
||||
this.processInfoEOService.deleteByIds(actiProcInstIdList);
|
||||
}else {
|
||||
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
|
||||
throw new JeroBootException("删除失败,请联系管理员!");
|
||||
@@ -187,6 +208,13 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
|
||||
lawsOpinionGatherEO.setId(jsonObject.getString("id"));
|
||||
lawsOpinionGatherEO.setGatherResult(jsonObject.getString("gatherResult"));
|
||||
this.baseMapper.updateById(lawsOpinionGatherEO);
|
||||
|
||||
//飞书
|
||||
JSONObject sendMsgJson = new JSONObject();
|
||||
sendMsgJson.put("lawsOpinionGatherId",jsonObject.getString("id"));
|
||||
sendMsgJson.put("initiatorUserId",jsonObject.getString("initiatorUserId"));
|
||||
sendMsgJson.put("msgType", MsgTypeEnum.LAWS_OPOMOPM_GATHER_COMPLETE_MSG.getValue());
|
||||
workFlowSendMsg(sendMsgJson);
|
||||
}
|
||||
|
||||
// 发送消息
|
||||
@@ -264,51 +292,143 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
|
||||
}
|
||||
|
||||
String lawsOpinionGatherId = jsonObject.getString("lawsOpinionGatherId");
|
||||
String serialNumber = jsonObject.getString("serialNumber"); //文档库编号
|
||||
//String serialNumber = jsonObject.getString("serialNumber"); //文档库编号
|
||||
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
|
||||
String msgContentEN = "";
|
||||
String msgTitle = "";
|
||||
//String msgContentEN = "";
|
||||
//String msgTitle = "";
|
||||
|
||||
LawsOpinionGatherEO lawsOpinionGatherEO = queryById(lawsOpinionGatherId);
|
||||
//英文标题
|
||||
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(lawsOpinionGatherEO.getStandId());
|
||||
|
||||
//Map<String, String> lawsOpinionGatherPrcInfo = this.workFlowFeignClient.getLawsOpinionGatherPrcInfo(lawsOpinionGatherId);
|
||||
String initiator = "";
|
||||
String title = MessageType2Enum.REGULATION_OPINION_COLLECTION.getCn() + "/" + MessageType2Enum.REGULATION_OPINION_COLLECTION.getEn();
|
||||
String endTime = new SimpleDateFormat("yyyy-MM-dd").format(lawsOpinionGatherEO.getEndTime());//截止日期
|
||||
//String prcNum = lawsOpinionGatherPrcInfo.get("prcNum");
|
||||
//String prcName = lawsOpinionGatherPrcInfo.get("prcName");
|
||||
String cnContentUpper = "";
|
||||
String cnContentLower = "";
|
||||
String enContentUpper = "";
|
||||
String enContentLower = "";
|
||||
if(StringUtils.equals(msgType,MsgTypeEnum.LAWS_OPOMOPM_GATHER_START_MSG.getValue())){
|
||||
userIdList.addAll(Arrays.asList(jsonObject.getString("evaluatorIds").split(",")));
|
||||
String endTime = jsonObject.getString("endTime"); //截止日期
|
||||
msgContentEN = "You recieved the Collection of Legislative Comments of "+serialNumber+" . The due date is "+endTime+". Please check and address it in a timely manner.";
|
||||
msgTitle = "You have a Collection of Legislative Comments task to complete";
|
||||
|
||||
//msgContentEN = "You recieved the Collection of Legislative Comments of "+serialNumber+" . The due date is "+endTime+". Please check and address it in a timely manner.";
|
||||
//msgTitle = "You have a Collection of Legislative Comments task to complete";
|
||||
|
||||
String currentUserId = jsonObject.getString("currentUserId"); //当前操作用户id
|
||||
SysUser currentUser = sysUserService.getBaseMapper().selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, currentUserId));
|
||||
|
||||
initiator = currentUser.getUsername();
|
||||
cnContentUpper = "您好,请及时查看处理此项任务,谢谢!";
|
||||
cnContentLower = "编号: " + lawsOpinionGatherEO.getSerialNumber() +
|
||||
"\n标题: " + lawsOpinionGatherEO.getTitle() +
|
||||
"\n发起人: " + initiator +
|
||||
"\n截止时间: " + endTime;
|
||||
enContentUpper = "Hello! Please check and address the task in a timely manner. Thank you!";
|
||||
enContentLower = "Regulation No: " + lawsOpinionGatherEO.getSerialNumber() +
|
||||
"\nTitle: " + bussDocumentLibraryEO.getTitleEn() +
|
||||
"\nInitiator: " + initiator +
|
||||
"\nDue Date: " + endTime;
|
||||
|
||||
}else if(StringUtils.equals(msgType,MsgTypeEnum.LAWS_OPOMOPM_GATHER_ENALUATOR_SUBMIT_MSG.getValue())){
|
||||
String currentUserId = jsonObject.getString("currentUserId"); //当前操作用户id
|
||||
SysUser currentUser = sysUserService.getBaseMapper().selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, currentUserId));
|
||||
|
||||
userIdList.add(jsonObject.getString("initiatorUserId"));
|
||||
msgContentEN = currentUser.getUsername() + " has submitted the collection process of Collection of Legislative Comments of "+serialNumber+", please check it in time.";
|
||||
msgTitle = "You have a Collection of Legislative Comments task completed";
|
||||
//msgContentEN = currentUser.getUsername() + " has submitted the collection process of Collection of Legislative Comments of "+serialNumber+", please check it in time.";
|
||||
//msgTitle = "You have a Collection of Legislative Comments task completed";
|
||||
|
||||
initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
|
||||
}else if(StringUtils.equals(msgType, MsgTypeEnum.LAWS_OPOMOPM_GATHER_ENALUATOR_EXPIRE_REMIND_MSG.getValue())){
|
||||
initiator = currentUser.getUsername();
|
||||
cnContentUpper = "您好,"+ currentUser.getUsername() +"已提交反馈意见,请查看";
|
||||
cnContentLower = "编号: " + lawsOpinionGatherEO.getSerialNumber() +
|
||||
"\n标题: " + lawsOpinionGatherEO.getTitle() +
|
||||
"\n发起人: " + initiator +
|
||||
"\n截止时间: " + endTime;
|
||||
enContentUpper = "Hello! "+ currentUser.getUsername() +" has submitted the comments. Please check it";
|
||||
enContentLower = "Regulation No: " + lawsOpinionGatherEO.getSerialNumber() +
|
||||
"\nTitle: " + bussDocumentLibraryEO.getTitleEn() +
|
||||
"\nInitiator: " + initiator +
|
||||
"\nDue Date: " + endTime;
|
||||
|
||||
} else if (StringUtils.equals(msgType, MsgTypeEnum.LAWS_OPOMOPM_GATHER_ENALUATOR_EXPIRE_REMIND_THREE_DAYS_BEFORE_MSG.getValue())) {
|
||||
userIdList = (List<String>) jsonObject.get("userIdList");
|
||||
msgContentEN = "The the Collection of Legislative Comments of "+serialNumber+" will expire tomorrow . Please check and address it in time.";
|
||||
msgTitle = "You have a Collection of Legislative Comments task to complete";
|
||||
|
||||
cnContentUpper = "您好,该任务将于3天后到期,请及时查看处理,谢谢!";
|
||||
cnContentLower = "编号: " + lawsOpinionGatherEO.getSerialNumber() +
|
||||
"\n标题: " + lawsOpinionGatherEO.getTitle() +
|
||||
"\n发起人: 系统通知" ;
|
||||
enContentUpper = "Hello! This task will expire in 3 days. Please check and address the task in a timely manner. Thank you!";
|
||||
enContentLower = "Regulation No: " + lawsOpinionGatherEO.getSerialNumber() +
|
||||
"\nTitle: " + bussDocumentLibraryEO.getTitleEn() +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
|
||||
|
||||
} else if (StringUtils.equals(msgType, MsgTypeEnum.LAWS_OPOMOPM_GATHER_ENALUATOR_EXPIRE_REMIND_TODAY_MSG.getValue())){
|
||||
userIdList = (List<String>) jsonObject.get("userIdList");
|
||||
|
||||
cnContentUpper = "您好,该任务将于今天到期,请尽快查看处理,谢谢!";
|
||||
cnContentLower = "编号: " + lawsOpinionGatherEO.getSerialNumber() +
|
||||
"\n标题: " + lawsOpinionGatherEO.getTitle() +
|
||||
"\n发起人: 系统通知";
|
||||
enContentUpper = "Hello! This task will expire today. Please check and address the task ASAP. Thank you!";
|
||||
enContentLower = "Regulation No: " + lawsOpinionGatherEO.getSerialNumber() +
|
||||
"\nTitle: " + bussDocumentLibraryEO.getTitleEn() +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
|
||||
|
||||
} else if (StringUtils.equals(msgType, MsgTypeEnum.LAWS_OPOMOPM_GATHER_COMPLETE_MSG.getValue())) {
|
||||
userIdList.add((String) jsonObject.get("initiatorUserId"));
|
||||
|
||||
cnContentUpper = "您好,该任务已完成,请查看";
|
||||
cnContentLower = "编号: " + lawsOpinionGatherEO.getSerialNumber() +
|
||||
"\n标题: " + lawsOpinionGatherEO.getTitle() +
|
||||
"\n发起人: 系统通知"+
|
||||
"\n截止时间: " + endTime;
|
||||
enContentUpper = "Hello! The task is completed. Please check it.";
|
||||
enContentLower = "Regulation No: " + lawsOpinionGatherEO.getSerialNumber() +
|
||||
"\nTitle: " + bussDocumentLibraryEO.getTitleEn() +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName() +
|
||||
"\nDue Date: " + endTime;
|
||||
}
|
||||
/*else if(StringUtils.equals(msgType, MsgTypeEnum.LAWS_OPOMOPM_GATHER_ENALUATOR_EXPIRE_REMIND_MSG.getValue())){
|
||||
userIdList = (List<String>) jsonObject.get("userIdList");
|
||||
//msgContentEN = "The the Collection of Legislative Comments of "+serialNumber+" will expire tomorrow . Please check and address it in time.";
|
||||
//msgTitle = "You have a Collection of Legislative Comments task to complete";
|
||||
|
||||
initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
|
||||
}*/
|
||||
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
|
||||
if (ObjectUtils.isNotEmpty(sysUsers)) {
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl + JumpLinkEnum.TASK_AFFIRM_LINK.getLink();
|
||||
String hrefFeishu = backUrl + JumpLinkEnum.FGPG_TODO_CENTER_LINK.getLink();
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(title);
|
||||
feishuMsgVo.setCnContentUpper(cnContentUpper);
|
||||
feishuMsgVo.setCnContentLower(cnContentLower);
|
||||
feishuMsgVo.setEnContentUpper(enContentUpper);
|
||||
feishuMsgVo.setEnContentLower(enContentLower);
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
//系统内部跳转链接
|
||||
String href = "<a href='" + JumpLinkEnum.TASK_AFFIRM_LINK.getLink() + "'>" + " View details" + "</a>";
|
||||
String contentInfo = msgContentEN + " " + href;
|
||||
//String href = "<a href='" + JumpLinkEnum.TASK_AFFIRM_LINK.getLink() + "'>" + " View details" + "</a>";
|
||||
//String contentInfo = msgContentEN + " " + href;
|
||||
|
||||
Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
//Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
//sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
//sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
SendMessageUtils.sendMessage(msgTitle,msgContentEN,userIdList,lawsOpinionGatherId,sendMessageMap,null,MessageTypeEnum.COLLECTION_OF_LEGISLATIVE_COMMENTS,initiator);
|
||||
//SendMessageUtils.sendMessage(msgTitle,msgContentEN,userIdList,lawsOpinionGatherId,sendMessageMap,null,MessageTypeEnum.COLLECTION_OF_LEGISLATIVE_COMMENTS,initiator);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -338,6 +458,12 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
|
||||
lawsOpinionGatherEO.setGatherResult(GatherResultEnum.COMPLETED.getValue());
|
||||
});
|
||||
this.updateBatchById(lawsOpinionGatherEOList);
|
||||
|
||||
LambdaUpdateWrapper<ProcessInfoEO> processInfoUpdateWrap = new LambdaUpdateWrapper<>();
|
||||
processInfoUpdateWrap.set(ProcessInfoEO::getStatus, TodoCenterStatusEnum.COMPLETED.getValue());
|
||||
processInfoUpdateWrap.in(ProcessInfoEO::getId,actiProcInstIdList);
|
||||
processInfoUpdateWrap.eq(ProcessInfoEO::getFlowType, FlowTypeEnum.FGYJSJLC.getValue());
|
||||
this.processInfoEOService.update(processInfoUpdateWrap);
|
||||
}
|
||||
}
|
||||
return new Result<>().success("手动结束成功!");
|
||||
|
||||
+59
-6
@@ -2,6 +2,7 @@ package com.jero.modules.lawsTechnologyEvaluation.job;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.modules.lawsOpinionGather.enums.GatherResultEnum;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationFlowDetailEO;
|
||||
@@ -52,14 +53,16 @@ public class LawsTechnologyEvaluationRemindJob implements Job {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
//获取后一天的时间
|
||||
Calendar calendar=new GregorianCalendar();
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DATE,1);
|
||||
Date nextDay = calendar.getTime();
|
||||
//Calendar calendar=new GregorianCalendar();
|
||||
//calendar.setTime(new Date());
|
||||
//calendar.add(Calendar.DATE,1);
|
||||
//Date nextDay = calendar.getTime();
|
||||
|
||||
String nextDayStr = sdf.format(nextDay);
|
||||
//String nextDayStr = sdf.format(nextDay);
|
||||
|
||||
String now = sdf.format(new Date());
|
||||
LawsTechnologyEvaluationEOList.forEach(lawsTechnologyEvaluationEO -> {
|
||||
if(StringUtils.equals(nextDayStr,sdf.format(lawsTechnologyEvaluationEO.getEndTime()))){
|
||||
/*if(StringUtils.equals(nextDayStr,sdf.format(lawsTechnologyEvaluationEO.getEndTime()))){
|
||||
|
||||
String actiProcInstIds = flowDetailList.stream().filter(flowDetail -> {
|
||||
boolean flag = false;
|
||||
@@ -80,6 +83,56 @@ public class LawsTechnologyEvaluationRemindJob implements Job {
|
||||
this.lawsTechnologyEvaluationEOService.workFlowSendMsg(sendJsonObject);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
String endTime = sdf.format(lawsTechnologyEvaluationEO.getEndTime());
|
||||
int days = 0;
|
||||
try {
|
||||
days = (int) (sdf.parse(endTime).getTime() - sdf.parse(now).getTime()) / (24 * 60 * 60 * 1000);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new JeroBootException("日期转换错误");
|
||||
}
|
||||
|
||||
if (days == 3) {
|
||||
//到期前3天
|
||||
String actiProcInstIds = flowDetailList.stream().filter(flowDetail -> {
|
||||
boolean flag = false;
|
||||
if (StringUtils.equals(lawsTechnologyEvaluationEO.getId(), flowDetail.getLawsTechnologyEvaluationId())) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).map(LawsTechnologyEvaluationFlowDetailEO::getActiProcInstId).distinct().collect(Collectors.joining(","));
|
||||
|
||||
if(StringUtils.isNotEmpty(actiProcInstIds)){
|
||||
List<String> userIdList = this.workFlowFeignClient.getTaskAssigneeListByPrcIds(actiProcInstIds);
|
||||
if(CollectionUtils.isNotEmpty(userIdList)){
|
||||
JSONObject sendJsonObject = new JSONObject();
|
||||
sendJsonObject.put("msgType", MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_EXPIRE_REMIND_THREE_DAYS_BEFORE_MSG.getValue());
|
||||
sendJsonObject.put("lawsTechnologyEvaluationId",lawsTechnologyEvaluationEO.getId());
|
||||
sendJsonObject.put("userIdList",userIdList);
|
||||
this.lawsTechnologyEvaluationEOService.workFlowSendMsg(sendJsonObject);
|
||||
}
|
||||
}
|
||||
} else if (endTime.equals(now)){
|
||||
//当天
|
||||
String actiProcInstIds = flowDetailList.stream().filter(flowDetail -> {
|
||||
boolean flag = false;
|
||||
if (StringUtils.equals(lawsTechnologyEvaluationEO.getId(), flowDetail.getLawsTechnologyEvaluationId())) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).map(LawsTechnologyEvaluationFlowDetailEO::getActiProcInstId).distinct().collect(Collectors.joining(","));
|
||||
|
||||
if(StringUtils.isNotEmpty(actiProcInstIds)){
|
||||
List<String> userIdList = this.workFlowFeignClient.getTaskAssigneeListByPrcIds(actiProcInstIds);
|
||||
if(CollectionUtils.isNotEmpty(userIdList)){
|
||||
JSONObject sendJsonObject = new JSONObject();
|
||||
sendJsonObject.put("msgType", MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_EXPIRE_REMIND_TODAY_MSG.getValue());
|
||||
sendJsonObject.put("lawsTechnologyEvaluationId",lawsTechnologyEvaluationEO.getId());
|
||||
sendJsonObject.put("userIdList",userIdList);
|
||||
this.lawsTechnologyEvaluationEOService.workFlowSendMsg(sendJsonObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+2
@@ -14,4 +14,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
*/
|
||||
public interface LawsTechnologyEvaluationFlowDetailEOMapper extends BaseMapper<LawsTechnologyEvaluationFlowDetailEO> {
|
||||
|
||||
LawsTechnologyEvaluationFlowDetailEO queryByEvaluationId(@Param("lawsTechnologyEvaluationId") String lawsTechnologyEvaluationId);
|
||||
|
||||
}
|
||||
|
||||
+8
-1
@@ -14,4 +14,11 @@
|
||||
<result column="prc_name" property="prcName" />
|
||||
<result column="evaluator_id" property="evaluatorId" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
|
||||
<select id="queryByEvaluationId" resultMap="LawsTechnologyEvaluationFlowDetailEOResultMap">
|
||||
|
||||
select * from laws_technology_evaluation_flow_detail where laws_technology_evaluation_id = #{lawsTechnologyEvaluationId}
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
+157
-33
@@ -2,23 +2,26 @@ package com.jero.modules.lawsTechnologyEvaluation.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.constant.enums.ModuleEnum;
|
||||
import com.jero.common.constant.enums.*;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
|
||||
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.enums.FieldTypeEnum;
|
||||
import com.jero.modules.document.mapper.BussDocumentLibraryEOMapper;
|
||||
import com.jero.modules.document.service.impl.BussDocumentLibraryEOServiceImpl;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsg2Vo;
|
||||
import com.jero.modules.lawsOpinionGather.enums.GatherResultEnum;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationFlowDetailEO;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.mapper.LawsTechnologyEvaluationEOMapper;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.mapper.LawsTechnologyEvaluationFlowDetailEOMapper;
|
||||
import com.jero.modules.lawsTechnologyEvaluation.service.*;
|
||||
import com.jero.modules.project.enums.JumpLinkEnum;
|
||||
import com.jero.modules.project.enums.MsgTypeEnum;
|
||||
@@ -33,9 +36,14 @@ import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
|
||||
import com.jero.modules.todoCenter.enums.TodoCenterStatusEnum;
|
||||
import com.jero.modules.todoCenter.service.IProcessInfoEOService;
|
||||
import com.jero.modules.wkflow.enums.FlowTypeEnum;
|
||||
import com.jero.modules.wkflow.feginClient.WorkFlowFeignClient;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
@@ -47,7 +55,9 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -97,6 +107,13 @@ public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl<LawsTechn
|
||||
private ILawsTechnologyEvaluationComplianceResultEOService lawsTechnologyEvaluationComplianceResultEOService;
|
||||
@Autowired
|
||||
private WorkFlowFeignClient workFlowFeignClient;
|
||||
@Autowired
|
||||
private IProcessInfoEOService processInfoEOService;
|
||||
|
||||
@Autowired
|
||||
private IFeishuService feishuService;
|
||||
@Autowired
|
||||
private LawsTechnologyEvaluationFlowDetailEOMapper flowDetailEOMapper;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
@@ -156,7 +173,8 @@ public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl<LawsTechn
|
||||
List<LawsTechnologyEvaluationFlowDetailEO> lawsTechnologyEvaluationFlowDetailEOList = lawsTechnologyEvaluationFlowDetailEOService.list(flowDetailEOQueryWrapper);
|
||||
|
||||
if(CollectionUtils.isNotEmpty(lawsTechnologyEvaluationFlowDetailEOList)){
|
||||
String prcIds = lawsTechnologyEvaluationFlowDetailEOList.stream().map(LawsTechnologyEvaluationFlowDetailEO::getActiProcInstId).distinct().collect(Collectors.joining(","));
|
||||
List<String> actiProcInstIdList = lawsTechnologyEvaluationFlowDetailEOList.stream().map(LawsTechnologyEvaluationFlowDetailEO::getActiProcInstId).distinct().collect(Collectors.toList());
|
||||
String prcIds = actiProcInstIdList.stream().collect(Collectors.joining(","));
|
||||
Result<String> result = this.workFlowFeignClient.deleteProcessInstanceByPrcIds(prcIds);
|
||||
if(result.getCode().equals(CommonConstant.SC_OK_200)){
|
||||
removeByIds(ids);
|
||||
@@ -170,6 +188,8 @@ public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl<LawsTechn
|
||||
this.lawsTechnologyEvaluationResultEOService.remove(deleteWrapper);
|
||||
|
||||
this.lawsTechnologyEvaluationComplianceResultEOService.remove(deleteWrapper);
|
||||
|
||||
this.processInfoEOService.deleteByIds(actiProcInstIdList);
|
||||
}else {
|
||||
if(StringUtils.equals(cut,CutEnum.CN.getValue())){
|
||||
throw new JeroBootException("删除失败,请联系管理员!");
|
||||
@@ -599,69 +619,166 @@ public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl<LawsTechn
|
||||
throw new JeroBootException("发送消息类型不能为空,请检查!");
|
||||
}
|
||||
|
||||
String lawsTechnologyEvaluationId = jsonObject.getString("lawsTechnologyEvaluationId");
|
||||
String serialNumber = jsonObject.getString("serialNumber"); //文档库编号
|
||||
//String lawsTechnologyEvaluationId = jsonObject.getString("lawsTechnologyEvaluationId");
|
||||
//String serialNumber = jsonObject.getString("serialNumber"); //文档库编号
|
||||
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
|
||||
String msgContentEN = "";
|
||||
String msgTitle = "";
|
||||
//String msgContentEN = "";
|
||||
//String msgTitle = "";
|
||||
String initiator = "";
|
||||
String lawsTechnologyEvaluationId = jsonObject.getString("lawsTechnologyEvaluationId");
|
||||
LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO = queryById(lawsTechnologyEvaluationId);
|
||||
//LawsTechnologyEvaluationFlowDetailEO flowDetailEO = flowDetailEOMapper.queryByEvaluationId(lawsTechnologyEvaluationId);
|
||||
//String number = flowDetailEO.getPrcNum();
|
||||
//String name = flowDetailEO.getPrcName();
|
||||
String endTime = new SimpleDateFormat("yyyy-MM-dd").format(lawsTechnologyEvaluationEO.getEndTime());
|
||||
|
||||
//英文标题
|
||||
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(lawsTechnologyEvaluationEO.getStandId());
|
||||
|
||||
String title = MessageType2Enum.REGULATION_TECHNICAL_ASSESSMENT.getCn() + "/" + MessageType2Enum.REGULATION_TECHNICAL_ASSESSMENT.getEn();
|
||||
String cnContentUpper = "";
|
||||
String cnContentLower = "";
|
||||
String enContentUpper = "";
|
||||
String enContentLower = "";
|
||||
if(StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_START_MSG.getValue())){
|
||||
userIdList.add(jsonObject.getString("evaluationId"));
|
||||
String endTime = jsonObject.getString("endTime"); //截止日期
|
||||
//String endTime = jsonObject.getString("endTime"); //截止日期
|
||||
//您收到GB 7258 的法规技术评估流程任务,请及时查看处理。
|
||||
msgContentEN = "You recieved the Regulatory and technical assessment of "+serialNumber+" . The due date is "+endTime+". Please check and address it in a timely manner.";
|
||||
msgTitle = "You have a Regulatory and technical assessment task to complete";
|
||||
//msgContentEN = "You recieved the Regulatory and technical assessment of "+serialNumber+" . The due date is "+endTime+". Please check and address it in a timely manner.";
|
||||
//msgTitle = "You have a Regulatory and technical assessment task to complete";
|
||||
|
||||
String currentUserId = jsonObject.getString("currentUserId"); //当前操作用户id
|
||||
SysUser currentUser = sysUserService.getBaseMapper().selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, currentUserId));
|
||||
|
||||
initiator = currentUser.getUsername();
|
||||
cnContentUpper = "您好,请及时查看处理此项任务,谢谢!";
|
||||
cnContentLower = "编号:" + lawsTechnologyEvaluationEO.getSerialNumber() +
|
||||
"\n标题: " + lawsTechnologyEvaluationEO.getTitle() +
|
||||
"\n发起人: " + initiator +
|
||||
"\n截止时间: " + endTime;
|
||||
enContentUpper = "Hello! Please check and address the task in a timely manner. Thank you!";
|
||||
enContentLower = "Regulation No :" + lawsTechnologyEvaluationEO.getSerialNumber() +
|
||||
"\nTitle: " + bussDocumentLibraryEO.getTitleEn() +
|
||||
"\nInitiator: " + initiator +
|
||||
"\nDue Date: " + endTime;
|
||||
}else if(StringUtils.equals(msgType,MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_ENALUATOR_SUBMIT_MSG.getValue())){
|
||||
String currentUserId = jsonObject.getString("currentUserId"); //当前操作用户id
|
||||
SysUser currentUser = this.sysUserService.getBaseMapper().selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, currentUserId));
|
||||
|
||||
userIdList.add(jsonObject.getString("initiatorUserId"));
|
||||
//XXX(人员账号)已提交GB 7258 的法规意见收集流程,请及时查看审核。
|
||||
msgContentEN = currentUser.getUsername() + " has submitted the collection process of Regulatory and technical assessment of "+serialNumber+", Please check and address it in time.";
|
||||
msgTitle = "You have a Regulatory and technical assessment task to complete";
|
||||
//msgContentEN = currentUser.getUsername() + " has submitted the collection process of Regulatory and technical assessment of "+serialNumber+", Please check and address it in time.";
|
||||
//msgTitle = "You have a Regulatory and technical assessment task to complete";
|
||||
|
||||
initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
|
||||
initiator = currentUser.getUsername();
|
||||
cnContentUpper = "您好,"+ currentUser.getUsername() +"已提交评估结果,请审核";
|
||||
cnContentLower = "编号:" + lawsTechnologyEvaluationEO.getSerialNumber() +
|
||||
"\n标题: " + lawsTechnologyEvaluationEO.getTitle() +
|
||||
"\n发起人: " + initiator +
|
||||
"\n截止时间: " + endTime;
|
||||
enContentUpper = "Hello! "+ currentUser.getUsername() +" has submitted the assessment result. Please review it";
|
||||
enContentLower = "Regulation No :" + lawsTechnologyEvaluationEO.getSerialNumber() +
|
||||
"\nTitle: " + bussDocumentLibraryEO.getTitleEn() +
|
||||
"\nInitiator: " + initiator +
|
||||
"\nDue Date: " + endTime;
|
||||
}else if(StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_AUDIT_ACCEPTED_MSG.getValue())){
|
||||
userIdList.add(jsonObject.getString("evaluationId"));
|
||||
//您提交的GB 7258 的法规技术评估流程已通过。
|
||||
msgContentEN = "The regulatory and technical assessment process for "+serialNumber+" you submitted has passed.";
|
||||
msgTitle = "You have a Regulatory and technical assessment task completed";
|
||||
|
||||
initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
|
||||
//msgContentEN = "The regulatory and technical assessment process for "+serialNumber+" you submitted has passed.";
|
||||
//msgTitle = "You have a Regulatory and technical assessment task completed";
|
||||
String currentUserId = jsonObject.getString("currentUserId"); //当前操作用户id
|
||||
SysUser currentUser = this.sysUserService.getBaseMapper().selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, currentUserId));
|
||||
initiator = currentUser.getUsername();
|
||||
cnContentUpper = "您好,您提交的评估结果已通过";
|
||||
cnContentLower = "编号:" + lawsTechnologyEvaluationEO.getSerialNumber() +
|
||||
"\n标题: " + lawsTechnologyEvaluationEO.getTitle() +
|
||||
"\n发起人: " + initiator +
|
||||
"\n截止时间: " + endTime;
|
||||
enContentUpper = "Hello! The assessment result you submitted has passed";
|
||||
enContentLower = "Regulation No :" + lawsTechnologyEvaluationEO.getSerialNumber() +
|
||||
"\nTitle: " + bussDocumentLibraryEO.getTitleEn() +
|
||||
"\nInitiator: " + initiator +
|
||||
"\nDue Date: " + endTime;
|
||||
}else if(StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_AUDIT_REJECTED_MSG.getValue())){
|
||||
userIdList.add(jsonObject.getString("evaluationId"));
|
||||
//您提交的GB 7258 的法规技术评估流程已被退回,请及时查看处理。
|
||||
msgContentEN = "The regulatory and technical assessment process of "+serialNumber+" you submitted has been returned, Please check and address it in time.";
|
||||
msgTitle = "You have a Regulatory and technical assessment task to complete";
|
||||
//msgContentEN = "The regulatory and technical assessment process of "+serialNumber+" you submitted has been returned, Please check and address it in time.";
|
||||
//msgTitle = "You have a Regulatory and technical assessment task to complete";
|
||||
String currentUserId = jsonObject.getString("currentUserId"); //当前操作用户id
|
||||
SysUser currentUser = this.sysUserService.getBaseMapper().selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, currentUserId));
|
||||
initiator = currentUser.getUsername();
|
||||
cnContentUpper = "您好,您提交的评估结果被退回,请及时查看处理";
|
||||
cnContentLower = "编号:" + lawsTechnologyEvaluationEO.getSerialNumber() +
|
||||
"\n标题: " + lawsTechnologyEvaluationEO.getTitle() +
|
||||
"\n发起人: " + initiator +
|
||||
"\n截止时间: " + endTime;
|
||||
enContentUpper = "Hello! The assessment result you submitted has been rejected. Please check and address it in a timely manner";
|
||||
enContentLower = "Regulation No :" + lawsTechnologyEvaluationEO.getSerialNumber() +
|
||||
"\nTitle: " + bussDocumentLibraryEO.getTitleEn() +
|
||||
"\nInitiator: " + initiator +
|
||||
"\nDue Date: " + endTime;
|
||||
} else if (StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_EXPIRE_REMIND_THREE_DAYS_BEFORE_MSG.getValue())) {
|
||||
cnContentUpper = "您好,该任务将于3天后到期,请及时查看处理,谢谢!";
|
||||
cnContentLower = "编号:" + lawsTechnologyEvaluationEO.getSerialNumber() +
|
||||
"\n标题: " + lawsTechnologyEvaluationEO.getTitle() +
|
||||
"\n发起人: 系统通知";
|
||||
enContentUpper = "Hello! This task will expire in 3 days. Please check and address the task in a timely manner. Thank you!";
|
||||
enContentLower = "Regulation No :" + lawsTechnologyEvaluationEO.getSerialNumber() +
|
||||
"\nTitle: " + bussDocumentLibraryEO.getTitleEn() +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
|
||||
userIdList = (List<String>) jsonObject.get("userIdList");
|
||||
|
||||
initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
|
||||
}else if(StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_EXPIRE_REMIND_MSG.getValue())){
|
||||
} else if (StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_EXPIRE_REMIND_TODAY_MSG.getValue())) {
|
||||
cnContentUpper = "您好,该任务将于今天到期,请尽快查看处理,谢谢!";
|
||||
cnContentLower = "编号:" + lawsTechnologyEvaluationEO.getSerialNumber() +
|
||||
"\n标题: " + lawsTechnologyEvaluationEO.getTitle() +
|
||||
"\n发起人: 系统通知";
|
||||
enContentUpper = "Hello! This task will expire today. Please check and address the task ASAP. Thank you!";
|
||||
enContentLower = "Regulation No :" + lawsTechnologyEvaluationEO.getSerialNumber() +
|
||||
"\nTitle: " + bussDocumentLibraryEO.getTitleEn() +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
|
||||
userIdList = (List<String>) jsonObject.get("userIdList");
|
||||
|
||||
} /*else if (StringUtils.equals(msgType, MsgTypeEnum.LAWS_TECHNOLOGY_EVALUATION_EXPIRE_REMIND_MSG.getValue())) {
|
||||
userIdList = (List<String>) jsonObject.get("userIdList");
|
||||
//您GB 7258的法规技术评估流程将于明天结束,请及时查看处理
|
||||
msgContentEN = "The the Regulatory and technical assessment of "+serialNumber+" will expire tomorrow. Please check and address it in time.";
|
||||
msgTitle = "You have a Regulatory and technical assessment task to complete";
|
||||
//msgContentEN = "The the Regulatory and technical assessment of "+serialNumber+" will expire tomorrow. Please check and address it in time.";
|
||||
//msgTitle = "You have a Regulatory and technical assessment task to complete";
|
||||
|
||||
initiator = MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName();
|
||||
} */
|
||||
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
|
||||
if (ObjectUtils.isNotEmpty(sysUsers)) {
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl + JumpLinkEnum.TASK_AFFIRM_LINK.getLink();
|
||||
String hrefFeishu = backUrl + JumpLinkEnum.FGPG_TODO_CENTER_LINK.getLink();
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(title);
|
||||
feishuMsgVo.setCnContentUpper(cnContentUpper);
|
||||
feishuMsgVo.setCnContentLower(cnContentLower);
|
||||
feishuMsgVo.setEnContentUpper(enContentUpper);
|
||||
feishuMsgVo.setEnContentLower(enContentLower);
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
//系统内部跳转链接
|
||||
String href = "<a href='" + JumpLinkEnum.TASK_AFFIRM_LINK.getLink() + "'>" + " View details" + "</a>";
|
||||
String contentInfo = msgContentEN + " " + href;
|
||||
//String href = "<a href='" + JumpLinkEnum.TASK_AFFIRM_LINK.getLink() + "'>" + " View details" + "</a>";
|
||||
//String contentInfo = msgContentEN + " " + href;
|
||||
|
||||
Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
//Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
//sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
//sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
SendMessageUtils.sendMessage(msgTitle,msgContentEN,userIdList,lawsTechnologyEvaluationId,sendMessageMap,null, MessageTypeEnum.REGULATORY_AND_TECHNICAL_ASSESSMENT,initiator);
|
||||
//SendMessageUtils.sendMessage(msgTitle,msgContentEN,userIdList,lawsTechnologyEvaluationId,sendMessageMap,null, MessageTypeEnum.REGULATORY_AND_TECHNICAL_ASSESSMENT,initiator);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -690,13 +807,20 @@ public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl<LawsTechn
|
||||
List<LawsTechnologyEvaluationFlowDetailEO> lawsTechnologyEvaluationFlowDetailEOList = lawsTechnologyEvaluationFlowDetailEOService.list(flowDetailEOQueryWrapper);
|
||||
|
||||
if(CollectionUtils.isNotEmpty(lawsTechnologyEvaluationFlowDetailEOList)){
|
||||
String actiProcInstIds = lawsTechnologyEvaluationFlowDetailEOList.stream().map(LawsTechnologyEvaluationFlowDetailEO::getActiProcInstId).distinct().collect(Collectors.joining(","));
|
||||
List<String> actiProcInstIdList = lawsTechnologyEvaluationFlowDetailEOList.stream().map(LawsTechnologyEvaluationFlowDetailEO::getActiProcInstId).distinct().collect(Collectors.toList());
|
||||
String actiProcInstIds = actiProcInstIdList.stream().collect(Collectors.joining(","));
|
||||
Result<String> result = this.workFlowFeignClient.completeLawsTechnologyEvaluationTaskByPids(actiProcInstIds);
|
||||
if(result.getCode().equals(CommonConstant.SC_OK_200)){
|
||||
lawsTechnologyEvaluationEOList.forEach(lawsTechnologyEvaluationEO -> {
|
||||
lawsTechnologyEvaluationEO.setFlowStatus(GatherResultEnum.COMPLETED.getValue());
|
||||
});
|
||||
this.updateBatchById(lawsTechnologyEvaluationEOList);
|
||||
|
||||
LambdaUpdateWrapper<ProcessInfoEO> processInfoUpdateWrap = new LambdaUpdateWrapper<>();
|
||||
processInfoUpdateWrap.set(ProcessInfoEO::getStatus, TodoCenterStatusEnum.COMPLETED.getValue());
|
||||
processInfoUpdateWrap.in(ProcessInfoEO::getId,actiProcInstIdList);
|
||||
processInfoUpdateWrap.eq(ProcessInfoEO::getFlowType, FlowTypeEnum.FGJSPG.getValue());
|
||||
this.processInfoEOService.update(processInfoUpdateWrap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+83
-8
@@ -1,29 +1,43 @@
|
||||
package com.jero.modules.problemKnowledgeBase.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.document.service.impl.BussDocumentLibraryEOServiceImpl;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.ProblemKnowledgeBaseCommentEO;
|
||||
import com.jero.modules.problemKnowledgeBase.entity.ProblemKnowledgeBaseEO;
|
||||
import com.jero.modules.problemKnowledgeBase.mapper.ProblemKnowledgeBaseCommentEOMapper;
|
||||
import com.jero.modules.problemKnowledgeBase.service.IProblemKnowledgeBaseCommentEOService;
|
||||
import com.jero.modules.problemKnowledgeBase.service.IProblemKnowledgeBaseEOService;
|
||||
import com.jero.modules.problemKnowledgeBase.vo.ProblemKnowledgeBaseCommentVO;
|
||||
import com.jero.modules.project.entity.ProblemKnowledgeBaseReplyEO;
|
||||
import com.jero.modules.project.service.IProblemKnowledgeBaseReplyEOService;
|
||||
import com.jero.modules.system.entity.SysAnnouncement;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysAnnouncementService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 问题知识库评论表
|
||||
@@ -37,6 +51,24 @@ public class ProblemKnowledgeBaseCommentEOServiceImpl extends ServiceImpl<Proble
|
||||
|
||||
@Autowired
|
||||
private IProblemKnowledgeBaseReplyEOService problemKnowledgeBaseReplyEOService;
|
||||
|
||||
@Autowired
|
||||
private BussDocumentLibraryEOServiceImpl bussDocumentLibraryEOService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@Resource
|
||||
private IFeishuService iFeishuService;
|
||||
|
||||
@Autowired
|
||||
private ISysAnnouncementService sysAnnouncementService;
|
||||
|
||||
@Autowired
|
||||
private IProblemKnowledgeBaseEOService problemKnowledgeBaseEOService;
|
||||
|
||||
@Value(value = "${jero.backUrl}")
|
||||
private String backUrl;
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
@@ -49,7 +81,50 @@ public class ProblemKnowledgeBaseCommentEOServiceImpl extends ServiceImpl<Proble
|
||||
problemKnowledgeBaseCommentEO.setCreateTime(now);
|
||||
problemKnowledgeBaseCommentEO.setUpdateTime(now);
|
||||
save(problemKnowledgeBaseCommentEO);
|
||||
}
|
||||
|
||||
ProblemKnowledgeBaseEO problemKnowledgeBaseEO = problemKnowledgeBaseEOService.getById(problemKnowledgeBaseCommentEO.getProblemKnowledgeBaseId());
|
||||
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String createBy = problemKnowledgeBaseEO.getCreateBy();
|
||||
//自己回复的时候不发消息
|
||||
// if(!loginUser.getUsername().equals(createBy)){
|
||||
SysUser sysUser = sysUserService.getUserByName(createBy);
|
||||
String contentCNNo = "您发布的问题知识库信息"+problemKnowledgeBaseEO.getTitle()+"有新评论,请注意查看.";
|
||||
String contentENNo = "In the Q&A knowledge "+problemKnowledgeBaseEO.getTitle()+" you created, a new comment has been added. Please be reminded to check it out.";
|
||||
String url = backUrl +"/problemknowledgeBase";
|
||||
|
||||
String href = "<a href='"+url + "'"+ " target='_blank'>"+ problemKnowledgeBaseEO.getTitle() + "</a>";
|
||||
String contentINfoCNNo = "您发布的问题知识库信息"+href+"有新评论,请注意查看.";
|
||||
String contentInfoENNo = "In the Q&A knowledge "+href+" you created, a new comment has been added. Please be reminded to check it out.";
|
||||
|
||||
//发送消息(站内和飞书)
|
||||
//您发布的问题知识库信息XXXXXXXX有新评论,请注意查看。
|
||||
//In the Q&A knowledge xxxxxxxx you created, a new comment has been added. Please be reminded to check it out.
|
||||
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(Arrays.asList(sysUser.getId().split(",")),
|
||||
"msgTitle",
|
||||
contentENNo,
|
||||
contentInfoENNo,
|
||||
MessageTypeEnum.PUSH.getValue(),
|
||||
MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
|
||||
contentCNNo,
|
||||
contentINfoCNNo);
|
||||
this.sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||
bussDocumentLibraryEOService.sendWebsocket(com.jero.modules.system.util.StringUtils.join(sysUser.getThirdId(), ","), sysUser.getThirdId());
|
||||
|
||||
// String href = backUrl +"/problemknowledgeBase";
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setTitle(MessageTypeEnum.PUSH.getNameCn()+"/"+MessageTypeEnum.PUSH.getName());
|
||||
feishuMsgVo.setUrl(url);
|
||||
feishuMsgVo.setContentEn(contentENNo);
|
||||
feishuMsgVo.setContent(contentCNNo);
|
||||
|
||||
try {
|
||||
this.iFeishuService.sendCardMsgTerritory(sysUser.getThirdId().split(","), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
|
||||
+39
-3
@@ -18,6 +18,7 @@ import com.jero.modules.document.enums.SearchEnum;
|
||||
import com.jero.modules.document.utils.ReadPdfUtil;
|
||||
import com.jero.modules.document.utils.ReadWordUtil;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.message.websocket.WebSocket;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
@@ -113,6 +114,8 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl<ProblemKnowle
|
||||
@Override
|
||||
public void add(ProblemKnowledgeBaseEO problemKnowledgeBaseEO) {
|
||||
Date now = new Date();
|
||||
String problemKnowledgeBaseId = UUID.randomUUID().toString().replace("-", "");
|
||||
problemKnowledgeBaseEO.setId(problemKnowledgeBaseId);
|
||||
problemKnowledgeBaseEO.setCreateTime(now);
|
||||
problemKnowledgeBaseEO.setUpdateTime(now);
|
||||
|
||||
@@ -880,13 +883,42 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl<ProblemKnowle
|
||||
+ "'>" + " View details" + "</a>";
|
||||
String contentInfo = msgContentEN + " " + href;
|
||||
|
||||
|
||||
String ContentENNo = currentUser.getUsername()+" shared " + problemKnowledgeBaseTitle + " with you.Please be reminded to check it out.";
|
||||
String ContentInfoENYes = currentUser.getUsername()+" shared " + problemKnowledgeBaseTitle + " with you.Please be reminded to check it out."+ " " + href;
|
||||
|
||||
String contentCnNo = currentUser.getUsername()+"向您分享了"+problemKnowledgeBaseTitle+",请查看.";
|
||||
String contentInfoCnYes = currentUser.getUsername()+"向您分享了"+problemKnowledgeBaseTitle+",请查看"+ " " + href;
|
||||
|
||||
|
||||
//封装消息的实体类
|
||||
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, msgTitle, msgContentEN, contentInfo,MessageTypeEnum.PUSH.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList,
|
||||
msgTitle,
|
||||
ContentENNo,
|
||||
ContentInfoENYes,
|
||||
MessageTypeEnum.PUSH.getValue(),
|
||||
MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
|
||||
contentCnNo,
|
||||
contentInfoCnYes);
|
||||
|
||||
this.sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||
this.sendWebsocket(StringUtils.join(thirdIdList, ","), contentInfo);
|
||||
//飞书
|
||||
try {
|
||||
this.iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), msgContentEN, MessageTypeEnum.PUSH.getName(), hrefFeishu);
|
||||
//XXX向您分享了XXXXXXXXX,请查看。
|
||||
//XXX shared xxxxxxxx with you. Please be reminded to check it out.
|
||||
|
||||
String contentInfoFeiCn = currentUser.getUsername()+"向您分享了"+problemKnowledgeBaseTitle+",请查看";
|
||||
String msgContentENTemp = currentUser.getUsername()+" shared " + problemKnowledgeBaseTitle + " with you.Please be reminded to check it out.";
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setTitle(MessageTypeEnum.PUSH.getNameCn()+"/"+MessageTypeEnum.PUSH.getName());
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setContentEn(msgContentENTemp);
|
||||
feishuMsgVo.setContent(contentInfoFeiCn);
|
||||
|
||||
this.iFeishuService.sendCardMsgTerritory(thirdIdList.toArray(new String[]{}), feishuMsgVo);
|
||||
|
||||
// this.iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), msgContentEN, MessageTypeEnum.PUSH.getName(), hrefFeishu);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书推送失败");
|
||||
}
|
||||
@@ -908,7 +940,9 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl<ProblemKnowle
|
||||
String content,
|
||||
String contentInfo,
|
||||
String messageType,
|
||||
String initiator) {
|
||||
String initiator,
|
||||
String contentCn,
|
||||
String contentInfoCn) {
|
||||
SysAnnouncement sysAnnouncement = new SysAnnouncement();
|
||||
sysAnnouncement.setInitiator(initiator);
|
||||
sysAnnouncement.setDelFlag("0");
|
||||
@@ -920,6 +954,8 @@ public class ProblemKnowledgeBaseEOServiceImpl extends ServiceImpl<ProblemKnowle
|
||||
sysAnnouncement.setMsgContent(content);
|
||||
sysAnnouncement.setMsgContentInfo(contentInfo);
|
||||
sysAnnouncement.setUserIds(StringUtils.join(userIdList, ","));
|
||||
sysAnnouncement.setMsgContentCn(contentCn);
|
||||
sysAnnouncement.setMsgContentInfoCn(contentInfoCn);
|
||||
return sysAnnouncement;
|
||||
}
|
||||
}
|
||||
|
||||
+10
@@ -16,6 +16,7 @@ import com.jero.modules.dummy.entity.DummyInventoryBaseEO;
|
||||
import com.jero.modules.dummy.service.IDummyInventoryBaseEOService;
|
||||
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
||||
import com.jero.modules.project.service.IProjectLawsInventoryEOService;
|
||||
import com.jero.modules.project.vo.ProjectTaskUrgVo;
|
||||
import com.jero.modules.system.entity.SysRole;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -456,4 +457,13 @@ public class ProjectLawsInventoryEOController extends JeroController<ProjectLaws
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@AutoLog(value = "任务清单催办")
|
||||
@ApiOperation(value="任务清单催办", notes="任务清单催办")
|
||||
@PostMapping(value = "/taskUrg")
|
||||
public Result<?> taskUrg(@RequestBody ProjectTaskUrgVo projectTaskUrgVo) {
|
||||
return this.projectLawsInventoryEOService.taskUrg(projectTaskUrgVo);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+69
-5
@@ -1,6 +1,6 @@
|
||||
package com.jero.modules.project.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
@@ -12,7 +12,15 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -46,8 +54,9 @@ public class ProjectLibraryBaseController extends JeroController<ProjectLibraryB
|
||||
@ApiOperation(value="项目库基础表-分页列表查询", notes="项目库基础表-分页列表查询")
|
||||
@PostMapping(value = "/page")
|
||||
public Result<?> queryPageList(@RequestBody Map<String,Object> params) {
|
||||
IPage<ProjectLibraryBase> pageList= projectLibraryBaseService.queryPageList(params);
|
||||
return Result.OK(params.get("cut").toString(),pageList);
|
||||
List<ProjectLibraryBase> pageList= projectLibraryBaseService.queryPageList(params);
|
||||
Page pages = projectLibraryBaseService.getPages(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString()), pageList);
|
||||
return Result.OK(params.get("cut").toString(),pages);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,6 +86,20 @@ public class ProjectLibraryBaseController extends JeroController<ProjectLibraryB
|
||||
projectLibraryBaseService.add(projectLibraryBase);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
/**
|
||||
* 项目扩展(添加子项目子项目基本信息、相关人员名单、法规/认证任务计划与被扩展项目保持一致)
|
||||
*
|
||||
* @param projectLibraryBase
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目扩展(添加子项目)")
|
||||
@ApiOperation(value="项目扩展(添加子项目)", notes="项目扩展(添加子项目)")
|
||||
@RequiresPermissions("projectLibraryBase:add")
|
||||
@PostMapping(value = "/addChild")
|
||||
public Result<?> addChild(@Validated @RequestBody ProjectLibraryBase projectLibraryBase) throws ParseException {
|
||||
projectLibraryBaseService.addChild(projectLibraryBase);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
@@ -137,7 +160,7 @@ public class ProjectLibraryBaseController extends JeroController<ProjectLibraryB
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<ProjectLibraryBase> data = projectLibraryBaseService.queryById(id);
|
||||
List<ProjectLibraryBase> data = projectLibraryBaseService.queryById(id,cut);
|
||||
if(data==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
@@ -205,4 +228,45 @@ public class ProjectLibraryBaseController extends JeroController<ProjectLibraryB
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 项目置顶,取消置顶(只置顶主项目)
|
||||
* @param id
|
||||
* @param flag 0为置顶, 1为取消置顶
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目置顶,取消置顶(只置顶主项目)")
|
||||
@ApiOperation(value="项目置顶,取消置顶(只置顶主项目)", notes="项目置顶,取消置顶(只置顶主项目)")
|
||||
@GetMapping(value = "/top")
|
||||
public Result<?> top(String id,String flag) {
|
||||
projectLibraryBaseService.top(id,flag);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目所有的版本(主版本和子版本的集合)
|
||||
* @param id 项目id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "获取项目所有的版本(主版本和子版本的集合)")
|
||||
@ApiOperation(value="获取项目所有的版本(主版本和子版本的集合)", notes="获取项目所有的版本(主版本和子版本的集合)")
|
||||
@GetMapping(value = "/getVersionsInfo")
|
||||
public Result<?> getVersionsInfo(String id) {
|
||||
List<String> versionsInfoList = projectLibraryBaseService.getVersionsInfo(id);
|
||||
return Result.OK(versionsInfoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 版本统计
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "版本统计")
|
||||
@ApiOperation(value="版本统计)", notes="版本统计")
|
||||
@PostMapping(value = "/versionStatistics")
|
||||
public Result<?> versionStatistics(@RequestBody Map<String,Object> params) {
|
||||
List<ProjectLibraryBase> projectLibraryBasesList = projectLibraryBaseService.versionStatistics(String.valueOf(params.get("id")));
|
||||
Page pages = projectLibraryBaseService.getPages(Integer.parseInt(params.get("pageNo").toString()), Integer.parseInt(params.get("pageSize").toString()), projectLibraryBasesList);
|
||||
return Result.OK(pages);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+14
-1
@@ -22,9 +22,10 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Description: 项目库-任务清单表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-04-29
|
||||
@@ -231,4 +232,16 @@ public class ProjectTaskInventoryEOController extends JeroController<ProjectTask
|
||||
List<String> msgList = projectTaskInventoryEOService.verifyRoleCode(projectTaskInventoryVO);
|
||||
return Result.OK(msgList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理历史数据
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "项目库-任务清单表-处理历史数据")
|
||||
@ApiOperation(value="项目库-任务清单表-处理历史数据", notes="项目库-任务清单表-处理历史数据")
|
||||
@GetMapping(value = "/disposeHistoryData")
|
||||
public Result<?> disposeHistoryData(@RequestParam Map<String,Object> params){
|
||||
return this.projectTaskInventoryEOService.disposeHistoryData(params);
|
||||
}
|
||||
}
|
||||
|
||||
+34
-2
@@ -12,7 +12,7 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@@ -25,7 +25,7 @@ import java.io.Serializable;
|
||||
@TableName("project_library_base")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ProjectLibraryBase implements Serializable {
|
||||
public class ProjectLibraryBase implements Comparable<ProjectLibraryBase> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@@ -109,4 +109,36 @@ public class ProjectLibraryBase implements Serializable {
|
||||
/**目标市场展示名称*/
|
||||
@TableField(exist = false)
|
||||
private java.lang.String targetMarketName;
|
||||
|
||||
//主项目id parent_id
|
||||
private String parentId;
|
||||
|
||||
//项目版本
|
||||
private String projectVersion;
|
||||
|
||||
//软件版本
|
||||
private String softwareVersion;
|
||||
|
||||
//最后一个版本
|
||||
@TableField(exist = false)
|
||||
private String versionLast;
|
||||
|
||||
//说明
|
||||
private String explanation;
|
||||
|
||||
//排序(用于项目置顶)
|
||||
private String sort;
|
||||
|
||||
//置顶标识(flag为空的时候为置顶, flag为1的时候取消置顶)
|
||||
private String flag;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<ProjectLibraryBase> children;
|
||||
|
||||
@Override
|
||||
public int compareTo(ProjectLibraryBase o) {
|
||||
return Integer.valueOf(this.projectVersion)-Integer.valueOf(o.projectVersion);//升序
|
||||
// return o.id-this.id;//降序
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
@@ -108,4 +108,6 @@ public class ProjectTaskInventoryFeedbackEO implements Serializable {
|
||||
@ApiModelProperty(value = "序号")
|
||||
private String serialNumber;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String userId;
|
||||
}
|
||||
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
package com.jero.modules.project.enums;
|
||||
|
||||
import com.alibaba.druid.util.StringUtils;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
|
||||
/**
|
||||
* 清单确认节点枚举类
|
||||
*/
|
||||
public enum InventoryAffirmNodeEnum {
|
||||
|
||||
INITIATED_BY_STUDIO_ENGINEERS("studiofq","R&H Studio发起","R&H Studio initiate"),
|
||||
HOMOLOGATION_ENGINEER_AUDIT ("homologationEngineer audit","认证审核","homologationEngineer audit"),
|
||||
REGULATION_OWNER_AUDIT("regulationOwner audit","法规审核","regulationOwner audit"),
|
||||
;
|
||||
|
||||
String key;
|
||||
String cnName;
|
||||
String enName;
|
||||
|
||||
private InventoryAffirmNodeEnum(String key, String cnName, String enName) {
|
||||
this.key = key;
|
||||
this.cnName = cnName;
|
||||
this.enName = enName;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getCnName() {
|
||||
return cnName;
|
||||
}
|
||||
|
||||
public void setCnName(String cnName) {
|
||||
this.cnName = cnName;
|
||||
}
|
||||
|
||||
public String getEnName() {
|
||||
return enName;
|
||||
}
|
||||
|
||||
public void setEnName(String enName) {
|
||||
this.enName = enName;
|
||||
}
|
||||
|
||||
public static String getTextByValue(String key,String cut) {
|
||||
InventoryAffirmNodeEnum[] values = values();
|
||||
for (InventoryAffirmNodeEnum inventoryAffirmNodeEnum : values) {
|
||||
if (inventoryAffirmNodeEnum.key.equals(key)) {
|
||||
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
|
||||
return inventoryAffirmNodeEnum.cnName;
|
||||
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
return inventoryAffirmNodeEnum.enName;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+2
@@ -18,6 +18,8 @@ public enum JumpLinkEnum {
|
||||
VERIFY_AFFIRM_LINK("验证符合性确认链接","3","/ProjectDetails?id=","&type=103"),
|
||||
DESIGN_AFFIRM_LINK("设计符合性确认链接","4","/ProjectDetails?id=","&type=103"),
|
||||
TASK_AFFIRM_LINK("任务确认链接","2","/ProcessCenter",""),
|
||||
FGPG_TODO_CENTER_LINK("法规评估任务待办中心链接","88","/regulatoryAssessmentTasks",""),
|
||||
XMCS_TODO_CENTER_LINK("项目参数任务待办中心链接","99","/projectParameterTasks",""),
|
||||
COMPLIANCE_PROCESS_DETAIL_LINK("符合性流程明细页路由","2","/taskListProcess",""),
|
||||
|
||||
PROBLEM_KNOWLEDGE_BASE_DETAIL("问题知识库,详情页","","/problemKnowledgeBaseView",""),
|
||||
|
||||
+6
@@ -34,12 +34,18 @@ public enum MsgTypeEnum {
|
||||
LAWS_OPOMOPM_GATHER_START_MSG("法规意见收集发起消息","lawsOpomopmGatherStartMsg"),
|
||||
LAWS_OPOMOPM_GATHER_ENALUATOR_SUBMIT_MSG("法规意见收集评估人提交任务消息","lawsOpomopmGatherEnaluatorSubmitMsg"),
|
||||
LAWS_OPOMOPM_GATHER_ENALUATOR_EXPIRE_REMIND_MSG("法规意见收集到期前一天消息","lawsOpomopmGatherExpireRemindMsg"),
|
||||
LAWS_OPOMOPM_GATHER_ENALUATOR_EXPIRE_REMIND_THREE_DAYS_BEFORE_MSG("法规意见收集到期前三天消息","lawsOpomopmGatherExpireRemindThreeDaysBeforeMsg"),
|
||||
LAWS_OPOMOPM_GATHER_ENALUATOR_EXPIRE_REMIND_TODAY_MSG("法规意见收集到期当天消息","lawsOpomopmGatherExpireRemindTodayMsg"),
|
||||
LAWS_OPOMOPM_GATHER_COMPLETE_MSG("法规意见收集任务完成通知消息","lawsOpomopmGatherCompleteMsg"),
|
||||
|
||||
|
||||
LAWS_TECHNOLOGY_EVALUATION_START_MSG("法规技术评估发起消息","lawsTechnologyEvaluationStartMsg"),
|
||||
LAWS_TECHNOLOGY_EVALUATION_ENALUATOR_SUBMIT_MSG("法规技术评估,评估人提交任务消息","lawsTechnologyEvaluationEnaluatorSubmitMsg"),
|
||||
LAWS_TECHNOLOGY_EVALUATION_AUDIT_ACCEPTED_MSG("法规技术评估,发起人审核通过消息","lawsTechnologyEvaluationAuditAcceptedMsg"),
|
||||
LAWS_TECHNOLOGY_EVALUATION_AUDIT_REJECTED_MSG("法规技术评估,发起人审核拒绝消息","lawsTechnologyEvaluationAuditRejectedMsg"),
|
||||
LAWS_TECHNOLOGY_EVALUATION_EXPIRE_REMIND_MSG("法规技术评估到期前一天消息","lawsTechnologyEvaluationExpireRemindMsg"),
|
||||
LAWS_TECHNOLOGY_EVALUATION_EXPIRE_REMIND_THREE_DAYS_BEFORE_MSG("法规技术评估到期前三天消息","lawsTechnologyEvaluationExpireRemindThreeDaysBeforeMsg"),
|
||||
LAWS_TECHNOLOGY_EVALUATION_EXPIRE_REMIND_TODAY_MSG("法规技术评估到期当天消息","lawsTechnologyEvaluationExpireRemindTodayMsg"),
|
||||
;
|
||||
|
||||
String name;
|
||||
|
||||
+6
@@ -11,6 +11,7 @@ public enum OperatorTypeEnum {
|
||||
* 工作流调用后台操作类型
|
||||
*/
|
||||
ADD("添加","add"),
|
||||
UPDATE("更新","update"),
|
||||
UPDATE_STATUS("修改状态","updateStatus"),
|
||||
DELETE("删除","delete"),
|
||||
QUERY("查询","query"),
|
||||
@@ -40,6 +41,11 @@ public enum OperatorTypeEnum {
|
||||
|
||||
ADD_LAWS_OPINION_GATHER("添加法规意见收集数据","addLawsOpinionGather"),
|
||||
UPDATE_LAWS_OPINION_GATHER_GATHER_RESULT("更新法规意见收集数据收集结果","updateLawsOpinionGatherGatherResult"),
|
||||
|
||||
/**
|
||||
* 流程信息明细表
|
||||
*/
|
||||
UPDATE_PROCESS_INFO_DETAIL_BY_TASK_ID("根据taskId更新流程信息明细表","updateProcessInfoDetailByTaskId"),
|
||||
;
|
||||
|
||||
String name;
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.jero.modules.project.enums;
|
||||
|
||||
/**
|
||||
* 任务状态枚举类
|
||||
*/
|
||||
public enum TopEnum {
|
||||
TOP_CANCEL("取消置顶","1"),
|
||||
;
|
||||
|
||||
|
||||
String name;
|
||||
String value;
|
||||
|
||||
private TopEnum(String name, String value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static String getTextByValue(String value) {
|
||||
TopEnum[] values = values();
|
||||
for (TopEnum taskStatusEnum : values) {
|
||||
if (taskStatusEnum.value.equals(value)) {
|
||||
return taskStatusEnum.name;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+241
-79
@@ -1,7 +1,13 @@
|
||||
package com.jero.modules.project.job;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.constant.enums.MessageType2Enum;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.constant.enums.MsgColorEnum;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsg2Vo;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
||||
import com.jero.modules.project.entity.ProjectLibraryBase;
|
||||
@@ -15,8 +21,11 @@ import com.jero.modules.project.mapper.ProjectLibraryBaseMapper;
|
||||
import com.jero.modules.project.mapper.ProjectNameInfoEOMapper;
|
||||
import com.jero.modules.project.mapper.ProjectYearNameInfoEOMapper;
|
||||
import com.jero.modules.project.service.IProjectLawsInventoryEOService;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
@@ -24,6 +33,7 @@ import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -49,16 +59,24 @@ public class InventoryAffirmJob implements Job {
|
||||
@Autowired
|
||||
private ProjectYearNameInfoEOMapper projectYearNameInfoEOMapper;
|
||||
|
||||
@Autowired
|
||||
private IFeishuService feishuService;
|
||||
|
||||
@Value(value = "${jero.backUrl}")
|
||||
private String backUrl;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||
|
||||
/**
|
||||
* 清单任务到达截止时间后,给用户发送消息
|
||||
*/
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
log.info("清单确认流程,定时任务开启 =====================================================");
|
||||
//获取状态为待确认的数据
|
||||
log.info("清单确认流程,定时任务开启 =====================================================");
|
||||
/* //获取状态为待确认的数据
|
||||
QueryWrapper<ProjectLawsInventoryEO> queryWrapperInventory = new QueryWrapper<>();
|
||||
queryWrapperInventory.lambda().eq(ProjectLawsInventoryEO::getInventoryAffirmStatus, InventoryAffirmStatusEnum.LIST_TO_CONFIRM.getValue());
|
||||
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(queryWrapperInventory);
|
||||
@@ -96,125 +114,269 @@ public class InventoryAffirmJob implements Job {
|
||||
projectYearInfoEOQueryWrapper.lambda().eq(ProjectYearNameInfoEO::getId,projectLibraryBase.getYearNameId());
|
||||
ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper);
|
||||
|
||||
List<String> threeDaysUserIdList = new ArrayList<>();
|
||||
List<String> currentDaysUserIdList = new ArrayList<>();
|
||||
|
||||
Map<String, List<String>> threeDaysMap = new HashMap<>();
|
||||
Map<String, List<String>> currentDaysMap = new HashMap<>();
|
||||
Map<String, List<String>> overdueMap = new HashMap<>();
|
||||
|
||||
for (ProjectLawsInventoryEO projectLawsInventoryEO : projectLawsInventoryEOList) {
|
||||
if(StringUtils.equals(projectLibraryBase.getId(),projectLawsInventoryEO.getProjectLibraryId())){
|
||||
if(projectLawsInventoryEO.getInventoryAffirmDueDate() != null){
|
||||
//如果清单确认结束日期是当前日期
|
||||
if(StringUtils.equals(currentDateStr,sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate()))){
|
||||
List<String> currentDaysUserIdList = new ArrayList<>();
|
||||
if(StringUtils.isEmpty(projectLawsInventoryEO.getSendMsgFlag())){
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId()) && StringUtils.isEmpty(projectLawsInventoryEO.getRegulationOwnerSubmitStatus())){
|
||||
currentDaysUserIdList.add(projectLawsInventoryEO.getRegulationOwnerId());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerId()) && StringUtils.isEmpty(projectLawsInventoryEO.getHomologationEngineerSubmitStatus())){
|
||||
currentDaysUserIdList.add(projectLawsInventoryEO.getHomologationEngineerId());
|
||||
//if(StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId()) && StringUtils.isEmpty(projectLawsInventoryEO.getRegulationOwnerSubmitStatus())){
|
||||
// currentDaysUserIdList.add(projectLawsInventoryEO.getRegulationOwnerId());
|
||||
//}
|
||||
//if(StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerId()) && StringUtils.isEmpty(projectLawsInventoryEO.getHomologationEngineerSubmitStatus())){
|
||||
// currentDaysUserIdList.add(projectLawsInventoryEO.getHomologationEngineerId());
|
||||
//}
|
||||
if (StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerSubmitStatus())||StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerSubmitStatus())) {
|
||||
if (StringUtils.isNotEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())) {
|
||||
currentDaysUserIdList.add(projectLawsInventoryEO.getEngineeringInterfacePerson());
|
||||
}
|
||||
}
|
||||
projectLawsInventoryEO.setSendMsgFlag(SendMsgFlagEnum.FALSE.getValue());
|
||||
projectLawsInventoryEOMapper.updateById(projectLawsInventoryEO);
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(currentDaysUserIdList)) {
|
||||
currentDaysMap.put(projectLawsInventoryEO.getId(), currentDaysUserIdList);
|
||||
}
|
||||
}
|
||||
|
||||
//如果清单确认结束时间是当前系统时间后三天
|
||||
if(StringUtils.equals(threeDaysStr,sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate()))){
|
||||
List<String> threeDaysUserIdList = new ArrayList<>();
|
||||
if(StringUtils.isEmpty(projectLawsInventoryEO.getSendMsgCurrentFlag())){
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId()) && StringUtils.isEmpty(projectLawsInventoryEO.getRegulationOwnerSubmitStatus())){
|
||||
threeDaysUserIdList.add(projectLawsInventoryEO.getRegulationOwnerId());
|
||||
}
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerId()) && StringUtils.isEmpty(projectLawsInventoryEO.getHomologationEngineerSubmitStatus())){
|
||||
threeDaysUserIdList.add(projectLawsInventoryEO.getHomologationEngineerId());
|
||||
//if(StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerId()) && StringUtils.isEmpty(projectLawsInventoryEO.getRegulationOwnerSubmitStatus())){
|
||||
// threeDaysUserIdList.add(projectLawsInventoryEO.getRegulationOwnerId());
|
||||
//}
|
||||
//if(StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerId()) && StringUtils.isEmpty(projectLawsInventoryEO.getHomologationEngineerSubmitStatus())){
|
||||
// threeDaysUserIdList.add(projectLawsInventoryEO.getHomologationEngineerId());
|
||||
//}
|
||||
if (StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerSubmitStatus())||StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerSubmitStatus())) {
|
||||
if (StringUtils.isNotEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())) {
|
||||
threeDaysUserIdList.add(projectLawsInventoryEO.getEngineeringInterfacePerson());
|
||||
}
|
||||
}
|
||||
projectLawsInventoryEO.setSendMsgCurrentFlag(SendMsgFlagEnum.FALSE.getValue());
|
||||
projectLawsInventoryEOMapper.updateById(projectLawsInventoryEO);
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(threeDaysUserIdList)) {
|
||||
threeDaysMap.put(projectLawsInventoryEO.getId(), threeDaysUserIdList);
|
||||
}
|
||||
}
|
||||
|
||||
//逾期3天、七天、14天
|
||||
Calendar day3Later=new GregorianCalendar();
|
||||
day3Later.setTime(projectLawsInventoryEO.getInventoryAffirmDueDate());
|
||||
day3Later.add(Calendar.DATE,3);
|
||||
Date overdue3Days = day3Later.getTime();
|
||||
|
||||
Calendar day7Later=new GregorianCalendar();
|
||||
day7Later.setTime(projectLawsInventoryEO.getInventoryAffirmDueDate());
|
||||
day7Later.add(Calendar.DATE,7);
|
||||
Date overdue7Days = day7Later.getTime();
|
||||
|
||||
Calendar day14Later=new GregorianCalendar();
|
||||
day14Later.setTime(projectLawsInventoryEO.getInventoryAffirmDueDate());
|
||||
day14Later.add(Calendar.DATE,14);
|
||||
Date overdue14Days = day14Later.getTime();
|
||||
|
||||
if(StringUtils.equals(sdf.format(overdue3Days),sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate()))
|
||||
||StringUtils.equals(sdf.format(overdue7Days),sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate()))
|
||||
||StringUtils.equals(sdf.format(overdue14Days),sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate()))){
|
||||
List<String> overdueUserIdList = new ArrayList<>();
|
||||
if (StringUtils.isNotEmpty(projectLawsInventoryEO.getHomologationEngineerSubmitStatus())||StringUtils.isNotEmpty(projectLawsInventoryEO.getRegulationOwnerSubmitStatus())) {
|
||||
if (StringUtils.isNotEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())) {
|
||||
overdueUserIdList.add(projectLawsInventoryEO.getEngineeringInterfacePerson());
|
||||
}
|
||||
}
|
||||
if (ObjectUtils.isNotEmpty(overdueUserIdList)) {
|
||||
overdueMap.put(projectLawsInventoryEO.getId(), overdueUserIdList);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(threeDaysUserIdList)){
|
||||
threeDaysUserIdList = threeDaysUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl
|
||||
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink()
|
||||
+ projectLibraryBase.getId()
|
||||
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
+ projectYearNameInfoEO.getYearName()
|
||||
+ "&targetMarket=" + projectLibraryBase.getTargetMarket();
|
||||
|
||||
/*String msgContentCN = "您" + projectLibraryBase.getProjectName() + "(项目名称)法规清单的任务确认剩余处理时间还有3天,请及时查看处理";*/
|
||||
//项目名称
|
||||
String PRN = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" + projectLibraryBase.getTargetMarket() + "-" + projectLibraryBase.getProjectVersion();
|
||||
if(!threeDaysMap.isEmpty()){
|
||||
for (String key : threeDaysMap.keySet()) {
|
||||
List<String> threeDaysUserIdList = threeDaysMap.get(key);
|
||||
threeDaysUserIdList = threeDaysUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(threeDaysUserIdList);
|
||||
if (ObjectUtils.isNotEmpty(sysUsers)) {
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
//法规中英文
|
||||
ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryEOMapper.selectById(key);
|
||||
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId());
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn());
|
||||
feishuMsgVo.setCnContentUpper("您好,该任务将于3天后到期,请及时查看处理,谢谢!");
|
||||
feishuMsgVo.setCnContentLower("项目: " + PRN +
|
||||
"\n法规: " + projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle() +
|
||||
"\n发起人: 系统通知");
|
||||
feishuMsgVo.setEnContentUpper("Hello! This task will expire in 3 days. Please check and address it in a timely manner. Thank you!");
|
||||
feishuMsgVo.setEnContentLower("Project:" + PRN +
|
||||
"\nRegulation No: " + projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn() +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
*//*String msgContentCN = "您" + projectLibraryBase.getProjectName() + "(项目名称)法规清单的任务确认剩余处理时间还有3天,请及时查看处理";*//*
|
||||
// XXX .
|
||||
String msgContentEN = "The remaining processing time for the regulation task confirmation for "
|
||||
+ projectNameInfoEO.getProjectName() + "-"
|
||||
+ projectYearNameInfoEO.getYearName()+ " "
|
||||
+ projectLibraryBase.getTargetMarket()
|
||||
+ " are 3 days. Please check and address it in a timely manner.";
|
||||
String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a regulation task confirmation to complete";
|
||||
//String msgContentEN = "The remaining processing time for the regulation task confirmation for "
|
||||
// + projectNameInfoEO.getProjectName() + "-"
|
||||
// + projectYearNameInfoEO.getYearName()+ " "
|
||||
// + projectLibraryBase.getTargetMarket()
|
||||
// + " are 3 days. Please check and address it in a timely manner.";
|
||||
//String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket()
|
||||
// + ": You have a regulation task confirmation to complete";
|
||||
|
||||
//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 Task Confirmation");
|
||||
//feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
|
||||
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 Task Confirmation");
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl
|
||||
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink()
|
||||
+ projectLibraryBase.getId()
|
||||
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
+ projectYearNameInfoEO.getYearName()
|
||||
+ "&targetMarket=" + projectLibraryBase.getTargetMarket();
|
||||
//系统内部跳转链接
|
||||
String href = "<a href='"
|
||||
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
+ projectYearNameInfoEO.getYearName()
|
||||
+ "&targetMarket=" + projectLibraryBase.getTargetMarket()
|
||||
+ "'>" + " View details" + "</a>";
|
||||
String contentInfo = msgContentEN + " " + href;
|
||||
Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
//String href = "<a href='"
|
||||
// + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getType()
|
||||
// + "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
// + projectYearNameInfoEO.getYearName()
|
||||
// + "&targetMarket=" + projectLibraryBase.getTargetMarket()
|
||||
// + "'>" + " View details" + "</a>";
|
||||
//String contentInfo = msgContentEN + " " + href;
|
||||
//Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
// sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
//sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN, threeDaysUserIdList, projectLibraryBase.getId(), sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
//projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN, threeDaysUserIdList, projectLibraryBase.getId(), sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){
|
||||
currentDaysUserIdList = currentDaysUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
if(!currentDaysMap.isEmpty()){
|
||||
for (String key : currentDaysMap.keySet()) {
|
||||
List<String> currentDaysUserIdList = currentDaysMap.get(key);
|
||||
currentDaysUserIdList = currentDaysUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(currentDaysUserIdList);
|
||||
if (ObjectUtils.isNotEmpty(sysUsers)) {
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
//法规中英文
|
||||
ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryEOMapper.selectById(key);
|
||||
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId());
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn());
|
||||
feishuMsgVo.setCnContentUpper("您好,该任务今天即将到期,请尽快查看处理,谢谢!");
|
||||
feishuMsgVo.setCnContentLower("项目: " + PRN +
|
||||
"\n法规: " + projectLawsInventoryEO.getSerialNumber() + " " +projectLawsInventoryEO.getTitle() +
|
||||
"\n发起人: 系统通知");
|
||||
feishuMsgVo.setEnContentUpper("Hello! This task will expire today. Please check and address the task ASAP. Thank you!");
|
||||
feishuMsgVo.setEnContentLower("Project:" + PRN +
|
||||
"\nRegulation No: " + projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn() +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
}
|
||||
|
||||
/*String msgContentCN = "您" + projectLibraryBase.getProjectName() + "(项目名称)法规清单的任务今天即将结束,请及时查看处理*/
|
||||
String msgContentEN = "The regulation task confirmation for "
|
||||
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ " will expire today. Please check and address it in a timely manner.";
|
||||
String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a regulation task confirmation to complete";
|
||||
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
feishuMsgVo.setContent("Hello! The task will expire today. Please check and address it in a timely manner.");
|
||||
feishuMsgVo.setTaskType("Regulation Task Confirmation");
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
*//*String msgContentCN = "您" + projectLibraryBase.getProjectName() + "(项目名称)法规清单的任务今天即将结束,请及时查看处理*//*
|
||||
//String msgContentEN = "The regulation task confirmation for "
|
||||
// + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + " will expire today. Please check and address it in a timely manner.";
|
||||
//String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket()
|
||||
// + ": You have a regulation task confirmation to complete";
|
||||
|
||||
//FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
//feishuMsgVo.setContent("Hello! The task will expire today. Please check and address it in a timely manner.");
|
||||
//feishuMsgVo.setTaskType("Regulation Task Confirmation");
|
||||
//feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl
|
||||
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink()
|
||||
+ projectLibraryBase.getId()
|
||||
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
+ projectYearNameInfoEO.getYearName()
|
||||
+ "&targetMarket=" + projectLibraryBase.getTargetMarket();
|
||||
//系统内部跳转链接
|
||||
String href = "<a href='"
|
||||
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
+ projectYearNameInfoEO.getYearName()
|
||||
+ "&targetMarket=" + projectLibraryBase.getTargetMarket()
|
||||
+ "'>" + " View details" + "</a>";
|
||||
String contentInfo = msgContentEN + " " + href;
|
||||
Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
//String href = "<a href='"
|
||||
// + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getType()
|
||||
// + "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
// + projectYearNameInfoEO.getYearName()
|
||||
// + "&targetMarket=" + projectLibraryBase.getTargetMarket()
|
||||
// + "'>" + " View details" + "</a>";
|
||||
//String contentInfo = msgContentEN + " " + href;
|
||||
//Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
//sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
//sendMessageMap.put("contentInfo",contentInfo);
|
||||
//发送消息
|
||||
projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN, currentDaysUserIdList, projectLibraryBase.getId(), sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
//projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN, currentDaysUserIdList, projectLibraryBase.getId(), sendMessageMap, feishuMsgVo, MessageTypeEnum.LIST_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
}
|
||||
|
||||
if(!overdueMap.isEmpty()){
|
||||
for (String key : overdueMap.keySet()) {
|
||||
List<String> overdueUserIdList = overdueMap.get(key);
|
||||
overdueUserIdList = overdueUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(overdueUserIdList);
|
||||
if (ObjectUtils.isNotEmpty(sysUsers)) {
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
//法规中英文
|
||||
ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryEOMapper.selectById(key);
|
||||
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId());
|
||||
|
||||
String dueDate = sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate());
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn());
|
||||
feishuMsgVo.setCnContentUpper("您好,该任务已逾期,请尽快处理,谢谢!");
|
||||
feishuMsgVo.setCnContentLower("项目: " + PRN +
|
||||
"\n法规: " + projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle() +
|
||||
"\n发起人: 系统通知" +
|
||||
"\n截止时间: " + dueDate);
|
||||
feishuMsgVo.setEnContentUpper("Hello! This task is overdue. Please address it ASAP. Thank you!");
|
||||
feishuMsgVo.setEnContentLower("Project:" + PRN +
|
||||
"\nRegulation No: " + projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn() +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName() +
|
||||
"\nDue Date: " + dueDate);
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.YELLOW.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
log.info("清单确认流程,定时任务结束 =====================================================");
|
||||
}
|
||||
}
|
||||
|
||||
+235
-87
@@ -1,7 +1,13 @@
|
||||
package com.jero.modules.project.job;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.constant.enums.MessageType2Enum;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.constant.enums.MsgColorEnum;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsg2Vo;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.project.entity.*;
|
||||
import com.jero.modules.project.enums.DesignComplianceStatusEnum;
|
||||
@@ -14,8 +20,11 @@ import com.jero.modules.project.mapper.ProjectNameInfoEOMapper;
|
||||
import com.jero.modules.project.mapper.ProjectYearNameInfoEOMapper;
|
||||
import com.jero.modules.project.service.IProjectLawsInventoryEOService;
|
||||
import com.jero.modules.project.service.IProjectTaskInventoryEOService;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
@@ -23,6 +32,7 @@ import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -53,6 +63,13 @@ public class PrehomoJob implements Job {
|
||||
@Value(value = "${jero.backUrl}")
|
||||
private String backUrl;
|
||||
|
||||
@Autowired
|
||||
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private IFeishuService feishuService;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
log.info("prehomo流程,定时任务开启 =====================================================");
|
||||
@@ -60,7 +77,10 @@ public class PrehomoJob implements Job {
|
||||
//查询出已经启动了prehomo流程的数据。 并且流程没有结束。
|
||||
QueryWrapper<ProjectTaskInventoryEO> queryProjectTaskInventoryWrapper = new QueryWrapper<>();
|
||||
queryProjectTaskInventoryWrapper.isNotNull("prehomo_p_id");
|
||||
queryProjectTaskInventoryWrapper.lambda().ne(ProjectTaskInventoryEO::getPrehomoStatus, DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue());
|
||||
List<String> status = new ArrayList<>();
|
||||
status.add(DesignComplianceStatusEnum.TO_SUBMIT.getValue());
|
||||
status.add(DesignComplianceStatusEnum.REVIEW_THE_RETURN.getValue());
|
||||
queryProjectTaskInventoryWrapper.lambda().in(ProjectTaskInventoryEO::getPrehomoStatus, status);
|
||||
List<ProjectTaskInventoryEO> projectTaskInventoryEOList = projectTaskInventoryEOService.getBaseMapper().selectList(queryProjectTaskInventoryWrapper);
|
||||
|
||||
if(CollectionUtils.isNotEmpty(projectTaskInventoryEOList)){
|
||||
@@ -81,15 +101,24 @@ public class PrehomoJob implements Job {
|
||||
|
||||
Date currentDate = new Date();
|
||||
|
||||
//获取后三天前的时间
|
||||
Calendar calendar=new GregorianCalendar();
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DATE,3);
|
||||
Date threeDays = calendar.getTime();
|
||||
|
||||
String threeDaysStr = sdf.format(threeDays);
|
||||
//两周
|
||||
Calendar twoWeeksLaterCalendar=new GregorianCalendar();
|
||||
twoWeeksLaterCalendar.setTime(new Date());
|
||||
twoWeeksLaterCalendar.add(Calendar.DATE,14);
|
||||
Date twoWeeksLaterDays = twoWeeksLaterCalendar.getTime();
|
||||
String twoWeeksLaterDaysStr = sdf.format(twoWeeksLaterDays);
|
||||
//一周
|
||||
Calendar oneWeekLaterCalendar=new GregorianCalendar();
|
||||
oneWeekLaterCalendar.setTime(new Date());
|
||||
oneWeekLaterCalendar.add(Calendar.DATE,7);
|
||||
Date oneWeekLaterDays = oneWeekLaterCalendar.getTime();
|
||||
String oneWeekLaterDaysStr = sdf.format(oneWeekLaterDays);
|
||||
//当天
|
||||
String currentDateStr = sdf.format(currentDate);
|
||||
|
||||
String msgTitle = MessageType2Enum.PRE_HOMO_CONFIRMATION.getCn() + "/" + MessageType2Enum.PRE_HOMO_CONFIRMATION.getEn();
|
||||
|
||||
|
||||
for (ProjectLibraryBase projectLibraryBase : projectLibraryBaseList) {
|
||||
QueryWrapper<ProjectNameInfoEO> projectNameInfoEOQueryWrapper = new QueryWrapper<>();
|
||||
projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectNameId());
|
||||
@@ -99,115 +128,234 @@ public class PrehomoJob implements Job {
|
||||
projectYearInfoEOQueryWrapper.lambda().eq(ProjectYearNameInfoEO::getId,projectLibraryBase.getYearNameId());
|
||||
ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper);
|
||||
|
||||
//项目名称
|
||||
String projectVersion = (com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getParentId()) && com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getProjectVersion())) ? "00" : projectLibraryBase.getProjectVersion();
|
||||
String projectName = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" + projectLibraryBase.getTargetMarket() + "-" + projectVersion;
|
||||
|
||||
for (ProjectLawsInventoryEO projectLawsInventoryEO: projectLawsInventoryEOList) {
|
||||
List<String> threeDaysUserIdList = new ArrayList<>();
|
||||
List<String> currentDaysUserIdList = new ArrayList<>();
|
||||
|
||||
for (ProjectTaskInventoryEO projectTaskInventoryEO : projectTaskInventoryEOList) {
|
||||
if(StringUtils.equals(projectTaskInventoryEO.getProjectLawsInventoryId(),projectLawsInventoryEO.getId())){
|
||||
if(projectLawsInventoryEO.getPrehomoDueDate() != null){
|
||||
//如果prehomo - 结束日期是当前日期
|
||||
if(StringUtils.equals(currentDateStr,sdf.format(projectLawsInventoryEO.getPrehomoDueDate()))){
|
||||
if(StringUtils.isEmpty(projectTaskInventoryEO.getPrehomoSendMsgFlag())){
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getPrehomoDutyId())){
|
||||
currentDaysUserIdList.add(projectLawsInventoryEO.getPrehomoDutyId());
|
||||
}if(StringUtils.isNotEmpty(projectLawsInventoryEO.getPrehomoInitiatorId())){
|
||||
currentDaysUserIdList.add(projectLawsInventoryEO.getPrehomoInitiatorId());
|
||||
}
|
||||
projectTaskInventoryEO.setPrehomoSendMsgFlag(SendMsgFlagEnum.FALSE.getValue());
|
||||
projectTaskInventoryEOService.updateById(projectTaskInventoryEO);
|
||||
}
|
||||
//法规中英文
|
||||
String LAW_CN = projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle();//法规
|
||||
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId());
|
||||
String LAW_EN = "";
|
||||
if (ObjectUtils.isEmpty(bussDocumentLibraryEO)) {
|
||||
LAW_EN = LAW_CN;
|
||||
} else {
|
||||
LAW_EN = projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn();//法规
|
||||
}
|
||||
|
||||
List<String> twoWeeksLaterUserIdList = new ArrayList<>();
|
||||
List<String> oneWeeksLaterUserIdList = new ArrayList<>();
|
||||
List<String> currentDaysUserIdList = new ArrayList<>();
|
||||
List<String> dueUserIdList = new ArrayList<>();
|
||||
|
||||
if(StringUtils.equals(projectLawsInventoryEO.getProjectLibraryId(),projectLibraryBase.getId())){
|
||||
if(projectLawsInventoryEO.getPrehomoDueDate() != null){
|
||||
//如果prehomo - 结束日期是当前日期
|
||||
if(StringUtils.equals(currentDateStr,sdf.format(projectLawsInventoryEO.getPrehomoDueDate()))){
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getPrehomoDutyId())){
|
||||
currentDaysUserIdList.add(projectLawsInventoryEO.getPrehomoDutyId());
|
||||
}
|
||||
//如果prehomo - 结束日期是三天后的日期
|
||||
if(StringUtils.equals(threeDaysStr,sdf.format(projectLawsInventoryEO.getPrehomoDueDate()))){
|
||||
if(StringUtils.isEmpty(projectTaskInventoryEO.getPrehomoSendMsgCurrentFlag())){
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getPrehomoDutyId())){
|
||||
threeDaysUserIdList.add(projectLawsInventoryEO.getPrehomoDutyId());
|
||||
}if(StringUtils.isNotEmpty(projectLawsInventoryEO.getPrehomoInitiatorId())){
|
||||
threeDaysUserIdList.add(projectLawsInventoryEO.getPrehomoInitiatorId());
|
||||
}
|
||||
projectTaskInventoryEO.setPrehomoSendMsgCurrentFlag(SendMsgFlagEnum.FALSE.getValue());
|
||||
projectTaskInventoryEOService.updateById(projectTaskInventoryEO);
|
||||
}
|
||||
}
|
||||
//如果prehomo - 结束日期是两周后的日期
|
||||
if(StringUtils.equals(twoWeeksLaterDaysStr,sdf.format(projectLawsInventoryEO.getPrehomoDueDate()))){
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getPrehomoDutyId())){
|
||||
twoWeeksLaterUserIdList.add(projectLawsInventoryEO.getPrehomoDutyId());
|
||||
}
|
||||
}
|
||||
//如果prehomo - 结束日期是一周后的日期
|
||||
if(StringUtils.equals(oneWeekLaterDaysStr,sdf.format(projectLawsInventoryEO.getDesignDueDate()))){
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getDesignDutyId())){
|
||||
oneWeeksLaterUserIdList.add(projectLawsInventoryEO.getDesignDutyId());
|
||||
}
|
||||
}
|
||||
//如果prehomo - 逾期后每天通知
|
||||
if (!StringUtils.equals(currentDateStr,sdf.format(projectLawsInventoryEO.getPrehomoDueDate()))&&projectLawsInventoryEO.getDesignDueDate().before(currentDate)) {
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getDesignDutyId())){
|
||||
dueUserIdList.add(projectLawsInventoryEO.getDesignDutyId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(CollectionUtils.isNotEmpty(threeDaysUserIdList)){
|
||||
threeDaysUserIdList = threeDaysUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
|
||||
String hrefFeishu = backUrl
|
||||
+ JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink()
|
||||
+ projectLibraryBase.getId()
|
||||
+ JumpLinkEnum.PREHOMO_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName();
|
||||
|
||||
if (ObjectUtils.isNotEmpty(dueUserIdList)) {
|
||||
dueUserIdList = dueUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(dueUserIdList);
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(msgTitle);
|
||||
feishuMsgVo.setCnContentUpper("您好,您的任务已逾期,请尽快查看处理");
|
||||
feishuMsgVo.setCnContentLower("项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: 系统通知"+
|
||||
"\n截止时间: "+ sdf.format(projectLawsInventoryEO.getDesignDueDate()));
|
||||
feishuMsgVo.setEnContentUpper("Hello! Your task is overdue. Please check and address it ASAP");
|
||||
feishuMsgVo.setEnContentLower("Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()+
|
||||
"\nDue Date: "+ sdf.format(projectLawsInventoryEO.getDesignDueDate()));
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.YELLOW.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtils.isNotEmpty(oneWeeksLaterUserIdList)) {
|
||||
oneWeeksLaterUserIdList = oneWeeksLaterUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(oneWeeksLaterUserIdList);
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(msgTitle);
|
||||
feishuMsgVo.setCnContentUpper("您好,您的任务将于7天后结束,请及时查看处理");
|
||||
feishuMsgVo.setCnContentLower("项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: 系统通知");
|
||||
feishuMsgVo.setEnContentUpper("Hello! Your task will end in 7 days. Please check and address it in a timely manner");
|
||||
feishuMsgVo.setEnContentLower("Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(twoWeeksLaterUserIdList)){
|
||||
twoWeeksLaterUserIdList = twoWeeksLaterUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(twoWeeksLaterUserIdList);
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(msgTitle);
|
||||
feishuMsgVo.setCnContentUpper("您好,您的任务将于14天后结束,请及时查看处理");
|
||||
feishuMsgVo.setCnContentLower("项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: 系统通知");
|
||||
feishuMsgVo.setEnContentUpper("Hello! Your task will end in 14 days. Please check and address it in a timely manner");
|
||||
feishuMsgVo.setEnContentLower("Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
|
||||
//您XXX(项目名称)中GB 7258的Pre-Homo确认剩余处理时间还有3天,请及时查看处理
|
||||
//The remaining processing time for the Pre-Homo confirmation of GB 7258 in XXX (project name) is 3 days. Please check and handle it in time.
|
||||
String msgContentEN = "The remaining processing time for the Pre-Homo confirmation of "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName() + "-"
|
||||
+ projectYearNameInfoEO.getYearName()+ " "
|
||||
+ projectLibraryBase.getTargetMarket()
|
||||
+ " are 3 days. Please check and handle it in time.";
|
||||
String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a Pre-Homo task to complete";
|
||||
//String msgContentEN = "The remaining processing time for the Pre-Homo confirmation of "
|
||||
// + projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName() + "-"
|
||||
// + projectYearNameInfoEO.getYearName()+ " "
|
||||
// + projectLibraryBase.getTargetMarket()
|
||||
// + " are 3 days. Please check and handle it in time.";
|
||||
//String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket()
|
||||
// + ": You have a Pre-Homo task to complete";
|
||||
|
||||
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());
|
||||
//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
|
||||
+ JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink()
|
||||
+ projectLibraryBase.getId()
|
||||
+ JumpLinkEnum.PREHOMO_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName();
|
||||
//String hrefFeishu = backUrl
|
||||
// + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink()
|
||||
// + projectLibraryBase.getId()
|
||||
// + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getType()
|
||||
// + "&projectName=" + projectNameInfoEO.getProjectName();
|
||||
//系统内部跳转链接
|
||||
String href = "<a href='"
|
||||
+ JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName()
|
||||
+ "'>" + " View details" + "</a>";
|
||||
String contentInfo = msgContentEN + " " + href;
|
||||
Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
//String href = "<a href='"
|
||||
// + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getType()
|
||||
// + "&projectName=" + projectNameInfoEO.getProjectName()
|
||||
// + "'>" + " View details" + "</a>";
|
||||
//String contentInfo = msgContentEN + " " + href;
|
||||
// Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
//sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
//sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.COMPLIANCE_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
//projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.COMPLIANCE_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){
|
||||
currentDaysUserIdList = currentDaysUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(currentDaysUserIdList);
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(msgTitle);
|
||||
feishuMsgVo.setCnContentUpper("您好,您的任务将于今天到期,请及时查看处理");
|
||||
feishuMsgVo.setCnContentLower("项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: 系统通知");
|
||||
feishuMsgVo.setEnContentUpper("Hello! Your task will expire today. Please check and address it ASAP");
|
||||
feishuMsgVo.setEnContentLower("Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
|
||||
//您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
|
||||
String msgContentEN = "The the Pre-Homo confirmation of "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ " will expire today. Please check and address it in time.";
|
||||
String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a Pre-Homo task to complete";
|
||||
//String msgContentEN = "The the Pre-Homo confirmation of "
|
||||
// + projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + " will expire today. Please check and address it in time.";
|
||||
//String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket()
|
||||
// + ": You have a Pre-Homo task to complete";
|
||||
|
||||
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());
|
||||
//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
|
||||
+ JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink()
|
||||
+ projectLibraryBase.getId()
|
||||
+ JumpLinkEnum.PREHOMO_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName();
|
||||
// String hrefFeishu = backUrl
|
||||
// + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink()
|
||||
// + projectLibraryBase.getId()
|
||||
// + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getType()
|
||||
// + "&projectName=" + projectNameInfoEO.getProjectName();
|
||||
//系统内部跳转链接
|
||||
String href = "<a href='"
|
||||
+ JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName()
|
||||
+ "'>" + " View details" + "</a>";
|
||||
String contentInfo = msgContentEN + " " + href;
|
||||
Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
//String href = "<a href='"
|
||||
// + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getType()
|
||||
// + "&projectName=" + projectNameInfoEO.getProjectName()
|
||||
// + "'>" + " View details" + "</a>";
|
||||
//String contentInfo = msgContentEN + " " + href;
|
||||
//Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
//sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
//sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.COMPLIANCE_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
//projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.COMPLIANCE_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+268
@@ -0,0 +1,268 @@
|
||||
package com.jero.modules.project.job;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.constant.enums.MessageType2Enum;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.constant.enums.MsgColorEnum;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsg2Vo;
|
||||
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
||||
import com.jero.modules.project.entity.ProjectLibraryBase;
|
||||
import com.jero.modules.project.entity.ProjectNameInfoEO;
|
||||
import com.jero.modules.project.entity.ProjectYearNameInfoEO;
|
||||
import com.jero.modules.project.enums.InventoryAffirmStatusEnum;
|
||||
import com.jero.modules.project.enums.JumpLinkEnum;
|
||||
import com.jero.modules.project.mapper.ProjectLawsInventoryEOMapper;
|
||||
import com.jero.modules.project.mapper.ProjectLibraryBaseMapper;
|
||||
import com.jero.modules.project.mapper.ProjectNameInfoEOMapper;
|
||||
import com.jero.modules.project.mapper.ProjectYearNameInfoEOMapper;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
public class TaskAffirmJob implements Job {
|
||||
|
||||
@Autowired
|
||||
private ProjectLawsInventoryEOMapper projectLawsInventoryEOMapper;
|
||||
|
||||
@Autowired
|
||||
private ProjectLibraryBaseMapper projectLibraryBaseMapper;
|
||||
|
||||
@Autowired
|
||||
private ProjectNameInfoEOMapper projectNameInfoEOMapper;
|
||||
|
||||
@Autowired
|
||||
private ProjectYearNameInfoEOMapper projectYearNameInfoEOMapper;
|
||||
|
||||
@Autowired
|
||||
private IFeishuService feishuService;
|
||||
|
||||
@Value(value = "${jero.backUrl}")
|
||||
private String backUrl;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||
|
||||
|
||||
/**
|
||||
* 任务确认流程定时
|
||||
* @param context
|
||||
* @throws JobExecutionException
|
||||
*/
|
||||
@Override
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||
log.info("任务确认流程,定时任务开启 =====================================================");
|
||||
|
||||
QueryWrapper<ProjectLawsInventoryEO> queryWrapperInventory = new QueryWrapper<>();
|
||||
queryWrapperInventory.lambda().eq(ProjectLawsInventoryEO::getTaskAffirmStatus, InventoryAffirmStatusEnum.LIST_TO_CONFIRM.getValue());
|
||||
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(queryWrapperInventory);
|
||||
if (ObjectUtils.isNotEmpty(projectLawsInventoryEOList)) {
|
||||
List<String> projectLibraryIdList = projectLawsInventoryEOList.stream().distinct()
|
||||
.map(ProjectLawsInventoryEO::getProjectLibraryId).collect(Collectors.toList());
|
||||
|
||||
QueryWrapper<ProjectLibraryBase> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().in(ProjectLibraryBase::getId,projectLibraryIdList);
|
||||
List<ProjectLibraryBase> projectLibraryBaseList = projectLibraryBaseMapper.selectList(queryWrapper);
|
||||
if (ObjectUtils.isNotEmpty(projectLibraryBaseList)) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
Date currentDate = new Date();
|
||||
|
||||
//获取后三天前的时间
|
||||
Calendar calendar=new GregorianCalendar();
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DATE,3);
|
||||
Date threeDays = calendar.getTime();
|
||||
|
||||
String threeDaysStr = sdf.format(threeDays);
|
||||
String currentDateStr = sdf.format(currentDate);
|
||||
|
||||
for (ProjectLibraryBase projectLibraryBase : projectLibraryBaseList) {
|
||||
|
||||
QueryWrapper<ProjectNameInfoEO> projectNameInfoEOQueryWrapper = new QueryWrapper<>();
|
||||
projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId, projectLibraryBase.getProjectNameId());
|
||||
ProjectNameInfoEO projectNameInfoEO = projectNameInfoEOMapper.selectOne(projectNameInfoEOQueryWrapper);
|
||||
|
||||
QueryWrapper<ProjectYearNameInfoEO> projectYearInfoEOQueryWrapper = new QueryWrapper<>();
|
||||
projectYearInfoEOQueryWrapper.lambda().eq(ProjectYearNameInfoEO::getId, projectLibraryBase.getYearNameId());
|
||||
ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper);
|
||||
|
||||
|
||||
Map<String, String> threeDaysMap = new HashMap<>();
|
||||
Map<String, String> currentDaysMap = new HashMap<>();
|
||||
Map<String, String> overdueMap = new HashMap<>();
|
||||
|
||||
for (ProjectLawsInventoryEO projectLawsInventoryEO : projectLawsInventoryEOList) {
|
||||
if (StringUtils.equals(projectLibraryBase.getId(), projectLawsInventoryEO.getProjectLibraryId())) {
|
||||
if (projectLawsInventoryEO.getTaskAffirmDueDate() != null) {
|
||||
//结束日期是当前日期
|
||||
if (StringUtils.equals(currentDateStr, sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()))) {
|
||||
if (StringUtils.isNotEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())) {
|
||||
currentDaysMap.put(projectLawsInventoryEO.getId(), projectLawsInventoryEO.getEngineeringInterfacePerson());
|
||||
}
|
||||
}
|
||||
|
||||
//如果清单确认结束时间是当前系统时间后三天
|
||||
if (StringUtils.equals(threeDaysStr, sdf.format(projectLawsInventoryEO.getTaskAffirmDueDate()))) {
|
||||
if (StringUtils.isNotEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())) {
|
||||
threeDaysMap.put(projectLawsInventoryEO.getId(), projectLawsInventoryEO.getEngineeringInterfacePerson());
|
||||
}
|
||||
}
|
||||
|
||||
//逾期3天、七天、14天
|
||||
Calendar day3Later = new GregorianCalendar();
|
||||
day3Later.setTime(projectLawsInventoryEO.getTaskAffirmDueDate());
|
||||
day3Later.add(Calendar.DATE, 3);
|
||||
Date overdue3Days = day3Later.getTime();
|
||||
|
||||
Calendar day7Later = new GregorianCalendar();
|
||||
day7Later.setTime(projectLawsInventoryEO.getTaskAffirmDueDate());
|
||||
day7Later.add(Calendar.DATE, 7);
|
||||
Date overdue7Days = day7Later.getTime();
|
||||
|
||||
Calendar day14Later = new GregorianCalendar();
|
||||
day14Later.setTime(projectLawsInventoryEO.getTaskAffirmDueDate());
|
||||
day14Later.add(Calendar.DATE, 14);
|
||||
Date overdue14Days = day14Later.getTime();
|
||||
|
||||
if (StringUtils.equals(sdf.format(overdue3Days), sdf.format(currentDate))
|
||||
|| StringUtils.equals(sdf.format(overdue7Days), sdf.format(currentDate))
|
||||
|| StringUtils.equals(sdf.format(overdue14Days), sdf.format(currentDate))) {
|
||||
if (StringUtils.isNotEmpty(projectLawsInventoryEO.getEngineeringInterfacePerson())) {
|
||||
overdueMap.put(projectLawsInventoryEO.getId(), projectLawsInventoryEO.getEngineeringInterfacePerson());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//飞书跳转链接
|
||||
|
||||
String hrefFeishu = backUrl
|
||||
+ "/projectRegulationTasks";
|
||||
|
||||
//项目名称
|
||||
String projectVersion = (com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getParentId()) && com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getProjectVersion())) ? "00" : projectLibraryBase.getProjectVersion();
|
||||
String PRN = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" + projectLibraryBase.getTargetMarket() + "-" + projectVersion;
|
||||
if (!threeDaysMap.isEmpty()) {
|
||||
for (String key : threeDaysMap.keySet()) {
|
||||
String[] ids = threeDaysMap.get(key).split(",");
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(Arrays.asList(ids));
|
||||
if (ObjectUtils.isNotEmpty(sysUsers)) {
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
//法规中英文
|
||||
ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryEOMapper.selectById(key);
|
||||
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId());
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn());
|
||||
feishuMsgVo.setCnContentUpper("您好,该任务将于3天后到期,请及时查看处理,谢谢!");
|
||||
feishuMsgVo.setCnContentLower("项目: " + PRN +
|
||||
"\n法规: " + projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle() +
|
||||
"\n发起人: 系统通知");
|
||||
feishuMsgVo.setEnContentUpper("Hello! This task will expire in 3 days. Please check and address it in a timely manner. Thank you!");
|
||||
feishuMsgVo.setEnContentLower("Project:" + PRN +
|
||||
"\nRegulation No: " + projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn() +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!currentDaysMap.isEmpty()) {
|
||||
for (String key : currentDaysMap.keySet()) {
|
||||
String[] ids = currentDaysMap.get(key).split(",");
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(Arrays.asList(ids));
|
||||
if (ObjectUtils.isNotEmpty(sysUsers)) {
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
//法规中英文
|
||||
ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryEOMapper.selectById(key);
|
||||
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId());
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn());
|
||||
feishuMsgVo.setCnContentUpper("您好,该任务今天即将到期,请尽快查看处理,谢谢!");
|
||||
feishuMsgVo.setCnContentLower("项目: " + PRN +
|
||||
"\n法规: " + projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle() +
|
||||
"\n发起人: 系统通知");
|
||||
feishuMsgVo.setEnContentUpper("Hello! This task will expire today. Please check and address the task ASAP. Thank you!");
|
||||
feishuMsgVo.setEnContentLower("Project:" + PRN +
|
||||
"\nRegulation No: " + projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn() +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!overdueMap.isEmpty()) {
|
||||
for (String key : overdueMap.keySet()) {
|
||||
String[] ids = overdueMap.get(key).split(",");
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(Arrays.asList(ids));
|
||||
if (ObjectUtils.isNotEmpty(sysUsers)) {
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
//法规中英文
|
||||
ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryEOMapper.selectById(key);
|
||||
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId());
|
||||
|
||||
String dueDate = sdf.format(projectLawsInventoryEO.getInventoryAffirmDueDate());
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(MessageType2Enum.REGULATION_TASK_CONFIRMATION.getCn() + "/" + MessageType2Enum.REGULATION_TASK_CONFIRMATION.getEn());
|
||||
feishuMsgVo.setCnContentUpper("您好,该任务已逾期,请尽快处理,谢谢!");
|
||||
feishuMsgVo.setCnContentLower("项目: " + PRN +
|
||||
"\n法规: " + projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle() +
|
||||
"\n发起人: 系统通知" +
|
||||
"\n截止时间: " + dueDate);
|
||||
feishuMsgVo.setEnContentUpper("Hello! This task is overdue. Please address it ASAP. Thank you!");
|
||||
feishuMsgVo.setEnContentLower("Project:" + PRN +
|
||||
"\nRegulation No: " + projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn() +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName() +
|
||||
"\nDue Date: " + dueDate);
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.YELLOW.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
log.info("任务确认流程,定时任务结束 =====================================================");
|
||||
}
|
||||
}
|
||||
+238
-88
@@ -1,7 +1,13 @@
|
||||
package com.jero.modules.project.job;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.constant.enums.MessageType2Enum;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.constant.enums.MsgColorEnum;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsg2Vo;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.project.entity.*;
|
||||
import com.jero.modules.project.enums.DesignComplianceStatusEnum;
|
||||
@@ -13,8 +19,11 @@ import com.jero.modules.project.mapper.ProjectNameInfoEOMapper;
|
||||
import com.jero.modules.project.mapper.ProjectYearNameInfoEOMapper;
|
||||
import com.jero.modules.project.service.IProjectLawsInventoryEOService;
|
||||
import com.jero.modules.project.service.IProjectTaskInventoryEOService;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
@@ -22,6 +31,7 @@ import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -52,13 +62,23 @@ public class VerifyComplianceJob implements Job {
|
||||
@Value(value = "${jero.backUrl}")
|
||||
private String backUrl;
|
||||
|
||||
@Autowired
|
||||
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private IFeishuService feishuService;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
log.info("验证符合性流程,定时任务开启 =====================================================");
|
||||
//查询出已经启动了验证符合性流程的数据。 并且流程没有结束。
|
||||
QueryWrapper<ProjectTaskInventoryEO> queryProjectTaskInventoryWrapper = new QueryWrapper<>();
|
||||
queryProjectTaskInventoryWrapper.isNotNull("verify_p_id");
|
||||
queryProjectTaskInventoryWrapper.lambda().ne(ProjectTaskInventoryEO::getVerifyStatus, DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue());
|
||||
List<String> status = new ArrayList<>();
|
||||
status.add(DesignComplianceStatusEnum.TO_SUBMIT.getValue());
|
||||
status.add(DesignComplianceStatusEnum.REVIEW_THE_RETURN.getValue());
|
||||
queryProjectTaskInventoryWrapper.lambda().in(ProjectTaskInventoryEO::getVerifyStatus, status);
|
||||
List<ProjectTaskInventoryEO> projectTaskInventoryEOList = projectTaskInventoryEOService.getBaseMapper().selectList(queryProjectTaskInventoryWrapper);
|
||||
|
||||
if(CollectionUtils.isNotEmpty(projectTaskInventoryEOList)){
|
||||
@@ -79,15 +99,24 @@ public class VerifyComplianceJob implements Job {
|
||||
|
||||
Date currentDate = new Date();
|
||||
|
||||
//获取后三天前的时间
|
||||
Calendar calendar=new GregorianCalendar();
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DATE,3);
|
||||
Date threeDays = calendar.getTime();
|
||||
|
||||
String threeDaysStr = sdf.format(threeDays);
|
||||
//两周
|
||||
Calendar twoWeeksLaterCalendar=new GregorianCalendar();
|
||||
twoWeeksLaterCalendar.setTime(new Date());
|
||||
twoWeeksLaterCalendar.add(Calendar.DATE,14);
|
||||
Date twoWeeksLaterDays = twoWeeksLaterCalendar.getTime();
|
||||
String twoWeeksLaterDaysStr = sdf.format(twoWeeksLaterDays);
|
||||
//一周
|
||||
Calendar oneWeekLaterCalendar=new GregorianCalendar();
|
||||
oneWeekLaterCalendar.setTime(new Date());
|
||||
oneWeekLaterCalendar.add(Calendar.DATE,7);
|
||||
Date oneWeekLaterDays = oneWeekLaterCalendar.getTime();
|
||||
String oneWeekLaterDaysStr = sdf.format(oneWeekLaterDays);
|
||||
//当天
|
||||
String currentDateStr = sdf.format(currentDate);
|
||||
|
||||
String msgTitle = MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getEn();
|
||||
|
||||
|
||||
for (ProjectLibraryBase projectLibraryBase : projectLibraryBaseList) {
|
||||
QueryWrapper<ProjectNameInfoEO> projectNameInfoEOQueryWrapper = new QueryWrapper<>();
|
||||
projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectNameId());
|
||||
@@ -97,114 +126,235 @@ public class VerifyComplianceJob implements Job {
|
||||
projectYearInfoEOQueryWrapper.lambda().eq(ProjectYearNameInfoEO::getId,projectLibraryBase.getYearNameId());
|
||||
ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper);
|
||||
|
||||
for (ProjectLawsInventoryEO projectLawsInventoryEO: projectLawsInventoryEOList) {
|
||||
List<String> threeDaysUserIdList = new ArrayList<>();
|
||||
List<String> currentDaysUserIdList = new ArrayList<>();
|
||||
//项目名称
|
||||
String projectVersion = (com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getParentId()) && com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getProjectVersion())) ? "00" : projectLibraryBase.getProjectVersion();
|
||||
String projectName = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" + projectLibraryBase.getTargetMarket() + "-" + projectVersion;
|
||||
|
||||
for (ProjectTaskInventoryEO projectTaskInventoryEO : projectTaskInventoryEOList) {
|
||||
if(StringUtils.equals(projectTaskInventoryEO.getProjectLawsInventoryId(),projectLawsInventoryEO.getId())){
|
||||
if(projectLawsInventoryEO.getVerifyDueDate() != null){
|
||||
//如果验证符合性 - 结束日期是当前日期
|
||||
if(StringUtils.equals(currentDateStr,sdf.format(projectLawsInventoryEO.getVerifyDueDate()))){
|
||||
if(StringUtils.isEmpty(projectTaskInventoryEO.getVerifySendMsgFlag())){
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDutyId())){
|
||||
currentDaysUserIdList.add(projectLawsInventoryEO.getVerifyDutyId());
|
||||
}if(StringUtils.isNotEmpty(projectLawsInventoryEO.getVerifyInitiatorId())){
|
||||
currentDaysUserIdList.add(projectLawsInventoryEO.getVerifyInitiatorId());
|
||||
}
|
||||
projectTaskInventoryEO.setVerifySendMsgFlag(SendMsgFlagEnum.FALSE.getValue());
|
||||
projectTaskInventoryEOService.updateById(projectTaskInventoryEO);
|
||||
}
|
||||
|
||||
for (ProjectLawsInventoryEO projectLawsInventoryEO: projectLawsInventoryEOList) {
|
||||
|
||||
//法规中英文
|
||||
String LAW_CN = projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle();//法规
|
||||
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId());
|
||||
String LAW_EN = "";
|
||||
if (ObjectUtils.isEmpty(bussDocumentLibraryEO)) {
|
||||
LAW_EN = LAW_CN;
|
||||
} else {
|
||||
LAW_EN = projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn();//法规
|
||||
}
|
||||
|
||||
List<String> twoWeeksLaterUserIdList = new ArrayList<>();
|
||||
List<String> oneWeeksLaterUserIdList = new ArrayList<>();
|
||||
List<String> currentDaysUserIdList = new ArrayList<>();
|
||||
List<String> dueUserIdList = new ArrayList<>();
|
||||
|
||||
if(StringUtils.equals(projectLawsInventoryEO.getProjectLibraryId(),projectLibraryBase.getId())){
|
||||
if(projectLawsInventoryEO.getVerifyDueDate() != null){
|
||||
//如果验证符合性 - 结束日期是当前日期
|
||||
if(StringUtils.equals(currentDateStr,sdf.format(projectLawsInventoryEO.getVerifyDueDate()))){
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDutyId())){
|
||||
currentDaysUserIdList.add(projectLawsInventoryEO.getVerifyDutyId());
|
||||
}
|
||||
//如果验证符合性 - 结束日期是三天后的日期
|
||||
if(StringUtils.equals(threeDaysStr,sdf.format(projectLawsInventoryEO.getVerifyDueDate()))){
|
||||
if(StringUtils.isEmpty(projectTaskInventoryEO.getVerifySendMsgCurrentFlag())){
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDutyId())){
|
||||
threeDaysUserIdList.add(projectLawsInventoryEO.getVerifyDutyId());
|
||||
}if(StringUtils.isNotEmpty(projectLawsInventoryEO.getVerifyInitiatorId())){
|
||||
threeDaysUserIdList.add(projectLawsInventoryEO.getVerifyInitiatorId());
|
||||
}
|
||||
projectTaskInventoryEO.setVerifySendMsgCurrentFlag(SendMsgFlagEnum.FALSE.getValue());
|
||||
projectTaskInventoryEOService.updateById(projectTaskInventoryEO);
|
||||
}
|
||||
}
|
||||
//如果验证符合性 - 结束日期是两周后的日期
|
||||
if(StringUtils.equals(twoWeeksLaterDaysStr,sdf.format(projectLawsInventoryEO.getVerifyDueDate()))){
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDutyId())){
|
||||
currentDaysUserIdList.add(projectLawsInventoryEO.getVerifyDutyId());
|
||||
}
|
||||
}
|
||||
//如果验证符合性 - 结束日期是一周后的日期
|
||||
if(StringUtils.equals(oneWeekLaterDaysStr,sdf.format(projectLawsInventoryEO.getVerifyDueDate()))){
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDutyId())){
|
||||
oneWeeksLaterUserIdList.add(projectLawsInventoryEO.getVerifyDutyId());
|
||||
}
|
||||
}
|
||||
//如果验证符合性 - 逾期后每天通知
|
||||
if (!StringUtils.equals(currentDateStr,sdf.format(projectLawsInventoryEO.getVerifyDueDate()))&&projectLawsInventoryEO.getVerifyDueDate().before(currentDate)) {
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getVerifyDutyId())){
|
||||
dueUserIdList.add(projectLawsInventoryEO.getVerifyDutyId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(CollectionUtils.isNotEmpty(threeDaysUserIdList)){
|
||||
threeDaysUserIdList = threeDaysUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
|
||||
String hrefFeishu = backUrl
|
||||
+ JumpLinkEnum.VERIFY_AFFIRM_LINK.getLink()
|
||||
+ projectLibraryBase.getId()
|
||||
+ JumpLinkEnum.VERIFY_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName();
|
||||
|
||||
if (ObjectUtils.isNotEmpty(dueUserIdList)) {
|
||||
dueUserIdList = dueUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(dueUserIdList);
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(msgTitle);
|
||||
feishuMsgVo.setCnContentUpper("您好,您的任务已逾期,请尽快查看处理");
|
||||
feishuMsgVo.setCnContentLower("项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: 系统通知"+
|
||||
"\n截止时间: "+ sdf.format(projectLawsInventoryEO.getDesignDueDate()));
|
||||
feishuMsgVo.setEnContentUpper("Hello! Your task is overdue. Please check and address it ASAP");
|
||||
feishuMsgVo.setEnContentLower("Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()+
|
||||
"\nDue Date: "+ sdf.format(projectLawsInventoryEO.getDesignDueDate()));
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.YELLOW.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtils.isNotEmpty(oneWeeksLaterUserIdList)) {
|
||||
oneWeeksLaterUserIdList = oneWeeksLaterUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(oneWeeksLaterUserIdList);
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(msgTitle);
|
||||
feishuMsgVo.setCnContentUpper("您好,您的任务将于7天后结束,请及时查看处理");
|
||||
feishuMsgVo.setCnContentLower("项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: 系统通知");
|
||||
feishuMsgVo.setEnContentUpper("Hello! Your task will end in 7 days. Please check and address it in a timely manner");
|
||||
feishuMsgVo.setEnContentLower("Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(twoWeeksLaterUserIdList)){
|
||||
twoWeeksLaterUserIdList = twoWeeksLaterUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(twoWeeksLaterUserIdList);
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(msgTitle);
|
||||
feishuMsgVo.setCnContentUpper("您好,您的任务将于14天后结束,请及时查看处理");
|
||||
feishuMsgVo.setCnContentLower("项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: 系统通知");
|
||||
feishuMsgVo.setEnContentUpper("Hello! Your task will end in 14 days. Please check and address it in a timely manner");
|
||||
feishuMsgVo.setEnContentLower("Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
|
||||
//您XXX(项目名称)中GB 7258的验证符合性确认剩余处理时间还有3天,请及时查看处理
|
||||
//The remaining processing time for the Verify compliance confirmation of GB 7258 in XXX (project name) is 3 days. Please check and handle it in time.
|
||||
String msgContentEN = "The remaining processing time for the validation compliance confirmation of "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName() + "-"
|
||||
+ projectYearNameInfoEO.getYearName()+ " "
|
||||
+ projectLibraryBase.getTargetMarket()
|
||||
+ " are 3 days. Please check and handle it in time.";
|
||||
String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a validation compliance task to complete";
|
||||
//String msgContentEN = "The remaining processing time for the validation compliance confirmation of "
|
||||
// + projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName() + "-"
|
||||
// + projectYearNameInfoEO.getYearName()+ " "
|
||||
// + projectLibraryBase.getTargetMarket()
|
||||
// + " are 3 days. Please check and handle it in time.";
|
||||
//String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket()
|
||||
// + ": You have a validation compliance task to complete";
|
||||
|
||||
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());
|
||||
// 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
|
||||
+ JumpLinkEnum.VERIFY_AFFIRM_LINK.getLink()
|
||||
+ projectLibraryBase.getId()
|
||||
+ JumpLinkEnum.VERIFY_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName();
|
||||
//String hrefFeishu = backUrl
|
||||
// + JumpLinkEnum.VERIFY_AFFIRM_LINK.getLink()
|
||||
// + projectLibraryBase.getId()
|
||||
// + JumpLinkEnum.VERIFY_AFFIRM_LINK.getType()
|
||||
// + "&projectName=" + projectNameInfoEO.getProjectName();
|
||||
//系统内部跳转链接
|
||||
String href = "<a href='"
|
||||
+ JumpLinkEnum.VERIFY_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.VERIFY_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName()
|
||||
+ "'>" + " View details" + "</a>";
|
||||
String contentInfo = msgContentEN + " " + href;
|
||||
Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
//String href = "<a href='"
|
||||
// + JumpLinkEnum.VERIFY_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.VERIFY_AFFIRM_LINK.getType()
|
||||
// + "&projectName=" + projectNameInfoEO.getProjectName()
|
||||
// + "'>" + " View details" + "</a>";
|
||||
//String contentInfo = msgContentEN + " " + href;
|
||||
//Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
//sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
//sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.COMPLIANCE_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
//projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.COMPLIANCE_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){
|
||||
currentDaysUserIdList = currentDaysUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(currentDaysUserIdList);
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(msgTitle);
|
||||
feishuMsgVo.setCnContentUpper("您好,您的任务将于今天到期,请及时查看处理");
|
||||
feishuMsgVo.setCnContentLower("项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: 系统通知");
|
||||
feishuMsgVo.setEnContentUpper("Hello! Your task will expire today. Please check and address it ASAP");
|
||||
feishuMsgVo.setEnContentLower("Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
|
||||
//您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
|
||||
String msgContentEN = "The the validation compliance confirmation of "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ " will expire today. Please check and address it in time.";
|
||||
String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a validation compliance task to complete";
|
||||
//String msgContentEN = "The the validation compliance confirmation of "
|
||||
// + projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + " will expire today. Please check and address it in time.";
|
||||
//String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket()
|
||||
// + ": You have a validation compliance task to complete";
|
||||
|
||||
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());
|
||||
//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
|
||||
+ JumpLinkEnum.VERIFY_AFFIRM_LINK.getLink()
|
||||
+ projectLibraryBase.getId()
|
||||
+ JumpLinkEnum.VERIFY_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName();
|
||||
// String hrefFeishu = backUrl
|
||||
// + JumpLinkEnum.VERIFY_AFFIRM_LINK.getLink()
|
||||
// + projectLibraryBase.getId()
|
||||
// + JumpLinkEnum.VERIFY_AFFIRM_LINK.getType()
|
||||
// + "&projectName=" + projectNameInfoEO.getProjectName();
|
||||
//系统内部跳转链接
|
||||
String href = "<a href='"
|
||||
+ JumpLinkEnum.VERIFY_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.VERIFY_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName()
|
||||
+ "'>" + " View details" + "</a>";
|
||||
String contentInfo = msgContentEN + " " + href;
|
||||
Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
//String href = "<a href='"
|
||||
// + JumpLinkEnum.VERIFY_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.VERIFY_AFFIRM_LINK.getType()
|
||||
// + "&projectName=" + projectNameInfoEO.getProjectName()
|
||||
// + "'>" + " View details" + "</a>";
|
||||
// String contentInfo = msgContentEN + " " + href;
|
||||
// Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
// sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
// sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.COMPLIANCE_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
// projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.COMPLIANCE_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+251
-82
@@ -1,7 +1,13 @@
|
||||
package com.jero.modules.project.job;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.constant.enums.MessageType2Enum;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.constant.enums.MsgColorEnum;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsg2Vo;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.project.entity.*;
|
||||
import com.jero.modules.project.enums.DesignComplianceStatusEnum;
|
||||
@@ -13,8 +19,11 @@ import com.jero.modules.project.mapper.ProjectNameInfoEOMapper;
|
||||
import com.jero.modules.project.mapper.ProjectYearNameInfoEOMapper;
|
||||
import com.jero.modules.project.service.IProjectLawsInventoryEOService;
|
||||
import com.jero.modules.project.service.IProjectTaskInventoryEOService;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
@@ -22,6 +31,7 @@ import org.quartz.JobExecutionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -52,13 +62,23 @@ public class designComplianceJob implements Job {
|
||||
@Value(value = "${jero.backUrl}")
|
||||
private String backUrl;
|
||||
|
||||
@Autowired
|
||||
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private IFeishuService feishuService;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
||||
log.info("设计符合性确认流程,定时任务开启 =====================================================");
|
||||
//查询出已经启动了设计符合性流程的数据。 并且流程没有结束。
|
||||
QueryWrapper<ProjectTaskInventoryEO> queryProjectTaskInventoryWrapper = new QueryWrapper<>();
|
||||
queryProjectTaskInventoryWrapper.isNotNull("design_p_id");
|
||||
queryProjectTaskInventoryWrapper.lambda().ne(ProjectTaskInventoryEO::getDesignStatus, DesignComplianceStatusEnum.REVIEW_COMPLETED.getValue());
|
||||
List<String> status = new ArrayList<>();
|
||||
status.add(DesignComplianceStatusEnum.TO_SUBMIT.getValue());
|
||||
status.add(DesignComplianceStatusEnum.REVIEW_THE_RETURN.getValue());
|
||||
queryProjectTaskInventoryWrapper.lambda().in(ProjectTaskInventoryEO::getDesignStatus, status);
|
||||
List<ProjectTaskInventoryEO> projectTaskInventoryEOList = projectTaskInventoryEOService.getBaseMapper().selectList(queryProjectTaskInventoryWrapper);
|
||||
|
||||
if(CollectionUtils.isNotEmpty(projectTaskInventoryEOList)){
|
||||
@@ -79,15 +99,24 @@ public class designComplianceJob implements Job {
|
||||
|
||||
Date currentDate = new Date();
|
||||
|
||||
//获取后三天前的时间
|
||||
Calendar calendar=new GregorianCalendar();
|
||||
calendar.setTime(new Date());
|
||||
calendar.add(Calendar.DATE,3);
|
||||
Date threeDays = calendar.getTime();
|
||||
|
||||
String threeDaysStr = sdf.format(threeDays);
|
||||
//两周
|
||||
Calendar twoWeeksLaterCalendar=new GregorianCalendar();
|
||||
twoWeeksLaterCalendar.setTime(new Date());
|
||||
twoWeeksLaterCalendar.add(Calendar.DATE,14);
|
||||
Date twoWeeksLaterDays = twoWeeksLaterCalendar.getTime();
|
||||
String twoWeeksLaterDaysStr = sdf.format(twoWeeksLaterDays);
|
||||
//一周
|
||||
Calendar oneWeekLaterCalendar=new GregorianCalendar();
|
||||
oneWeekLaterCalendar.setTime(new Date());
|
||||
oneWeekLaterCalendar.add(Calendar.DATE,7);
|
||||
Date oneWeekLaterDays = oneWeekLaterCalendar.getTime();
|
||||
String oneWeekLaterDaysStr = sdf.format(oneWeekLaterDays);
|
||||
//当天
|
||||
String currentDateStr = sdf.format(currentDate);
|
||||
|
||||
|
||||
String msgTitle = MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getEn();
|
||||
|
||||
for (ProjectLibraryBase projectLibraryBase : projectLibraryBaseList) {
|
||||
QueryWrapper<ProjectNameInfoEO> projectNameInfoEOQueryWrapper = new QueryWrapper<>();
|
||||
projectNameInfoEOQueryWrapper.lambda().eq(ProjectNameInfoEO::getId,projectLibraryBase.getProjectNameId());
|
||||
@@ -97,109 +126,249 @@ public class designComplianceJob implements Job {
|
||||
projectYearInfoEOQueryWrapper.lambda().eq(ProjectYearNameInfoEO::getId,projectLibraryBase.getYearNameId());
|
||||
ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper);
|
||||
|
||||
//项目名称
|
||||
String projectVersion = (com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getParentId()) && com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getProjectVersion())) ? "00" : projectLibraryBase.getProjectVersion();
|
||||
String projectName = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" + projectLibraryBase.getTargetMarket() + "-" + projectVersion;
|
||||
|
||||
|
||||
for (ProjectLawsInventoryEO projectLawsInventoryEO: projectLawsInventoryEOList) {
|
||||
List<String> threeDaysUserIdList = new ArrayList<>();
|
||||
|
||||
//法规中英文
|
||||
String LAW_CN = projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle();//法规
|
||||
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId());
|
||||
String LAW_EN = "";
|
||||
if (ObjectUtils.isEmpty(bussDocumentLibraryEO)) {
|
||||
LAW_EN = LAW_CN;
|
||||
} else {
|
||||
LAW_EN = projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn();//法规
|
||||
}
|
||||
|
||||
|
||||
List<String> twoWeeksLaterUserIdList = new ArrayList<>();
|
||||
List<String> oneWeeksLaterUserIdList = new ArrayList<>();
|
||||
List<String> currentDaysUserIdList = new ArrayList<>();
|
||||
List<String> dueUserIdList = new ArrayList<>();
|
||||
|
||||
for (ProjectTaskInventoryEO projectTaskInventoryEO : projectTaskInventoryEOList) {
|
||||
if(StringUtils.equals(projectTaskInventoryEO.getProjectLawsInventoryId(),projectLawsInventoryEO.getId())){
|
||||
//如果设计符合性 - 结束日期是当前日期
|
||||
if(projectLawsInventoryEO.getDesignDueDate() != null){
|
||||
if(StringUtils.equals(currentDateStr,sdf.format(projectLawsInventoryEO.getDesignDueDate()))){
|
||||
if(StringUtils.isEmpty(projectTaskInventoryEO.getDesignSendMsgFlag())){
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getDesignDutyId())){
|
||||
currentDaysUserIdList.add(projectLawsInventoryEO.getDesignDutyId());
|
||||
}if(StringUtils.isNotEmpty(projectLawsInventoryEO.getDesignInitiatorId())){
|
||||
currentDaysUserIdList.add(projectLawsInventoryEO.getDesignInitiatorId());
|
||||
}
|
||||
projectTaskInventoryEO.setDesignSendMsgFlag(SendMsgFlagEnum.FALSE.getValue());
|
||||
projectTaskInventoryEOService.updateById(projectTaskInventoryEO);
|
||||
}
|
||||
if(StringUtils.equals(projectLawsInventoryEO.getProjectLibraryId(),projectLibraryBase.getId())){
|
||||
//如果设计符合性 - 结束日期是当前日期
|
||||
if(projectLawsInventoryEO.getDesignDueDate() != null){
|
||||
if(StringUtils.equals(currentDateStr,sdf.format(projectLawsInventoryEO.getDesignDueDate()))){
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getDesignDutyId())){
|
||||
currentDaysUserIdList.add(projectLawsInventoryEO.getDesignDutyId());
|
||||
}
|
||||
}
|
||||
|
||||
//如果设计符合性 - 结束日期是三天后的日期
|
||||
if(StringUtils.equals(threeDaysStr,sdf.format(projectLawsInventoryEO.getDesignDueDate()))){
|
||||
if(StringUtils.isEmpty(projectTaskInventoryEO.getDesignSendMsgCurrentFlag())){
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getDesignDutyId())){
|
||||
threeDaysUserIdList.add(projectLawsInventoryEO.getDesignDutyId());
|
||||
}if(StringUtils.isNotEmpty(projectLawsInventoryEO.getDesignInitiatorId())){
|
||||
threeDaysUserIdList.add(projectLawsInventoryEO.getDesignInitiatorId());
|
||||
}
|
||||
projectTaskInventoryEO.setDesignSendMsgCurrentFlag(SendMsgFlagEnum.FALSE.getValue());
|
||||
projectTaskInventoryEOService.updateById(projectTaskInventoryEO);
|
||||
}
|
||||
//如果设计符合性 - 结束日期是两周后的日期
|
||||
if(StringUtils.equals(twoWeeksLaterDaysStr,sdf.format(projectLawsInventoryEO.getDesignDueDate()))){
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getDesignDutyId())){
|
||||
twoWeeksLaterUserIdList.add(projectLawsInventoryEO.getDesignDutyId());
|
||||
}
|
||||
}
|
||||
|
||||
//如果设计符合性 - 结束日期是一周后的日期
|
||||
if(StringUtils.equals(oneWeekLaterDaysStr,sdf.format(projectLawsInventoryEO.getDesignDueDate()))){
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getDesignDutyId())){
|
||||
oneWeeksLaterUserIdList.add(projectLawsInventoryEO.getDesignDutyId());
|
||||
}
|
||||
}
|
||||
//逾期三天、七天、十四天
|
||||
Calendar due3Days = new GregorianCalendar();
|
||||
due3Days.setTime(projectLawsInventoryEO.getDesignDueDate());
|
||||
due3Days.add(Calendar.DATE, 3);
|
||||
Date overdue3Days = due3Days.getTime();
|
||||
|
||||
Calendar due7Days = new GregorianCalendar();
|
||||
due7Days.setTime(projectLawsInventoryEO.getDesignDueDate());
|
||||
due7Days.add(Calendar.DATE, 7);
|
||||
Date overdue7Days = due7Days.getTime();
|
||||
|
||||
Calendar due14Days = new GregorianCalendar();
|
||||
due14Days.setTime(projectLawsInventoryEO.getDesignDueDate());
|
||||
due14Days.add(Calendar.DATE, 14);
|
||||
Date overdue14Days = due14Days.getTime();
|
||||
if (StringUtils.equals(sdf.format(overdue3Days), currentDateStr)
|
||||
|| StringUtils.equals(sdf.format(overdue7Days), currentDateStr)
|
||||
|| StringUtils.equals(sdf.format(overdue14Days), currentDateStr)) {
|
||||
if(StringUtils.isNotEmpty(projectLawsInventoryEO.getDesignDutyId())){
|
||||
dueUserIdList.add(projectLawsInventoryEO.getDesignDutyId());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if(CollectionUtils.isNotEmpty(threeDaysUserIdList)){
|
||||
threeDaysUserIdList = threeDaysUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
|
||||
String hrefFeishu = backUrl
|
||||
+ JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink()
|
||||
+ projectLibraryBase.getId()
|
||||
+ JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName();
|
||||
|
||||
if (ObjectUtils.isNotEmpty(dueUserIdList)) {
|
||||
dueUserIdList = dueUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(dueUserIdList);
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(msgTitle);
|
||||
feishuMsgVo.setCnContentUpper("您好,您的任务已逾期,请尽快查看处理");
|
||||
feishuMsgVo.setCnContentLower("项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: 系统通知"+
|
||||
"\n截止时间: "+ sdf.format(projectLawsInventoryEO.getDesignDueDate()));
|
||||
feishuMsgVo.setEnContentUpper("Hello! Your task is overdue. Please check and address it ASAP");
|
||||
feishuMsgVo.setEnContentLower("Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName()+
|
||||
"\nDue Date: "+ sdf.format(projectLawsInventoryEO.getDesignDueDate()));
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.YELLOW.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtils.isNotEmpty(oneWeeksLaterUserIdList)) {
|
||||
oneWeeksLaterUserIdList = oneWeeksLaterUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(oneWeeksLaterUserIdList);
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(msgTitle);
|
||||
feishuMsgVo.setCnContentUpper("您好,您的任务将于7天后结束,请及时查看处理");
|
||||
feishuMsgVo.setCnContentLower("项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: 系统通知");
|
||||
feishuMsgVo.setEnContentUpper("Hello! Your task will end in 7 days. Please check and address it in a timely manner");
|
||||
feishuMsgVo.setEnContentLower("Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(twoWeeksLaterUserIdList)){
|
||||
twoWeeksLaterUserIdList = twoWeeksLaterUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(twoWeeksLaterUserIdList);
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(msgTitle);
|
||||
feishuMsgVo.setCnContentUpper("您好,您的任务将于14天后结束,请及时查看处理");
|
||||
feishuMsgVo.setCnContentLower("项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: 系统通知");
|
||||
feishuMsgVo.setEnContentUpper("Hello! Your task will end in 14 days. Please check and address it in a timely manner");
|
||||
feishuMsgVo.setEnContentLower("Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
//您XXX(项目名称)中GB 7258的设计符合性确认剩余处理时间还有3天,请及时查看处理
|
||||
String msgContentEN = "The remaining processing time for the design compliance confirmation for "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName()
|
||||
+ projectYearNameInfoEO.getYearName()+ " "
|
||||
+ projectLibraryBase.getTargetMarket()
|
||||
+ " are 3 days. Please check and address it in a timely manner.";
|
||||
String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a design compliance task to complete";
|
||||
//String msgContentEN = "The remaining processing time for the design compliance confirmation for "
|
||||
// + projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName()
|
||||
// + projectYearNameInfoEO.getYearName()+ " "
|
||||
// + projectLibraryBase.getTargetMarket()
|
||||
// + " are 3 days. Please check and address it in a timely manner.";
|
||||
//String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket()
|
||||
// + ": You have a design compliance task to complete";
|
||||
|
||||
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());
|
||||
//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 + JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.DESIGN_AFFIRM_LINK.getType();
|
||||
//String hrefFeishu = backUrl + JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.DESIGN_AFFIRM_LINK.getType();
|
||||
//系统内部跳转链接
|
||||
String href = "<a href='"
|
||||
+ JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
|
||||
+ "'>" + " View details" + "</a>";
|
||||
String contentInfo = msgContentEN + " " + href;
|
||||
Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
//String href = "<a href='"
|
||||
// + JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
|
||||
// + "'>" + " View details" + "</a>";
|
||||
//String contentInfo = msgContentEN + " " + href;
|
||||
//Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
//sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
//sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.COMPLIANCE_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
//projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.COMPLIANCE_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){
|
||||
currentDaysUserIdList = currentDaysUserIdList.stream().distinct().collect(Collectors.toList());
|
||||
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(currentDaysUserIdList);
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(msgTitle);
|
||||
feishuMsgVo.setCnContentUpper("您好,您的任务将于今天到期,请及时查看处理");
|
||||
feishuMsgVo.setCnContentLower("项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: 系统通知");
|
||||
feishuMsgVo.setEnContentUpper("Hello! Your task will expire today. Please check and address it ASAP");
|
||||
feishuMsgVo.setEnContentLower("Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
//您XXX(项目名称)中GB 7258的设计符合性确认任务今天即将结束,请及时查看处理
|
||||
String msgContentEN = "The design compliance confirmation of "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName()
|
||||
+ " will expire today. Please check and address it in time.";
|
||||
String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a design compliance task to complete";
|
||||
//String msgContentEN = "The design compliance confirmation of "
|
||||
// + projectLawsInventoryEO.getSerialNumber() + " in " + projectNameInfoEO.getProjectName()
|
||||
// + " will expire today. Please check and address it in time.";
|
||||
//String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName()+ " " + projectLibraryBase.getTargetMarket()
|
||||
// + ": You have a design compliance task to complete";
|
||||
|
||||
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());
|
||||
//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
|
||||
+ JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink()
|
||||
+ projectLibraryBase.getId()
|
||||
+ JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName();
|
||||
//String hrefFeishu = backUrl
|
||||
// + JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink()
|
||||
// + projectLibraryBase.getId()
|
||||
// + JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
|
||||
// + "&projectName=" + projectNameInfoEO.getProjectName();
|
||||
|
||||
|
||||
//系统内部跳转链接
|
||||
String href = "<a href='"
|
||||
+ JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName()
|
||||
+ "'>" + " View details" + "</a>";
|
||||
String contentInfo = msgContentEN + " " + href;
|
||||
Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
//String href = "<a href='"
|
||||
// + JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
|
||||
// + "&projectName=" + projectNameInfoEO.getProjectName()
|
||||
// + "'>" + " View details" + "</a>";
|
||||
//String contentInfo = msgContentEN + " " + href;
|
||||
//Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
//sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
//sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.COMPLIANCE_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
//projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.COMPLIANCE_CONFIRMATION,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -16,7 +16,9 @@ import java.util.Map;
|
||||
*/
|
||||
public interface ProjectLibraryBaseMapper extends BaseMapper<ProjectLibraryBase> {
|
||||
/**分页列表*/
|
||||
IPage<ProjectLibraryBase> queryPageList(IPage page, Map<String, Object> params);
|
||||
List<ProjectLibraryBase> queryPageList(@Param("params") Map<String, Object> params);
|
||||
List<ProjectLibraryBase> queryMaimList();
|
||||
// IPage<ProjectLibraryBase> queryPageList(IPage page, Map<String, Object> params);
|
||||
|
||||
List<ProjectLibraryBase> getList(@Param("projectLibraryBase") ProjectLibraryBase projectLibraryBase);
|
||||
|
||||
|
||||
+113
-15
@@ -15,13 +15,54 @@
|
||||
LEFT JOIN project_laws_inventory pli ON ( pli.stand_id = bdl.id )
|
||||
LEFT JOIN project_task_inventory pti ON ( pli.id = pti.project_laws_inventory_id )
|
||||
WHERE
|
||||
(
|
||||
bdl.id IN ( SELECT DISTINCT stand_id FROM laws_opinion_gather where gather_result = #{params.gatherResult})
|
||||
OR bdl.id IN ( SELECT DISTINCT stand_id FROM laws_technology_evaluation where flow_status = #{params.flowStatus})
|
||||
or pti.design_p_id IS NOT NULL
|
||||
OR pti.prehomo_p_id IS NOT NULL
|
||||
OR pti.verify_p_id IS NOT NULL
|
||||
)
|
||||
<if test="params.isEngineerOrEngineeringInterfacePerson != true">
|
||||
(
|
||||
bdl.id IN (
|
||||
SELECT
|
||||
DISTINCT stand_id
|
||||
FROM laws_opinion_gather
|
||||
where gather_result = #{params.gatherResult}
|
||||
)
|
||||
OR bdl.id IN (
|
||||
SELECT
|
||||
DISTINCT stand_id
|
||||
FROM laws_technology_evaluation
|
||||
where flow_status = #{params.flowStatus}
|
||||
)
|
||||
OR pti.design_p_id IS NOT NULL
|
||||
OR pti.prehomo_p_id IS NOT NULL
|
||||
OR pti.verify_p_id IS NOT NULL
|
||||
)
|
||||
</if>
|
||||
<!--2022-11-01 增加数据权限:如果当前登录用户,是工程师、工程接口人角色,只能查看到跟自己相关的数据。其余角色保留之前的查询结果。-->
|
||||
<if test="params.isEngineerOrEngineeringInterfacePerson == true">
|
||||
(
|
||||
bdl.id IN (
|
||||
SELECT
|
||||
DISTINCT stand_id
|
||||
FROM
|
||||
laws_opinion_gather
|
||||
where gather_result = #{params.gatherResult} and evaluator_ids like CONCAT(CONCAT('%',#{params.currentUserId}),'%')
|
||||
)
|
||||
OR bdl.id IN (
|
||||
SELECT
|
||||
DISTINCT stand_id
|
||||
FROM
|
||||
laws_technology_evaluation
|
||||
where flow_status = #{params.flowStatus}
|
||||
and id in (
|
||||
select
|
||||
laws_technology_evaluation_id
|
||||
from
|
||||
laws_technology_evaluation_flow_detail
|
||||
where evaluator_id = #{params.currentUserId}
|
||||
)
|
||||
)
|
||||
OR (pti.design_p_id IS NOT NULL and (pli.design_initiator_id = #{params.currentUserId} or pli.design_duty_id = #{params.currentUserId}))
|
||||
OR (pti.prehomo_p_id IS NOT NULL and (pli.prehomo_initiator_id = #{params.currentUserId} or pli.prehomo_duty_id = #{params.currentUserId}))
|
||||
OR (pti.verify_p_id IS NOT NULL and (pli.verify_initiator_id = #{params.currentUserId} or pli.verify_duty_id = #{params.currentUserId}))
|
||||
)
|
||||
</if>
|
||||
${params.condition}
|
||||
GROUP BY bdl.id
|
||||
order by bdl.create_time desc
|
||||
@@ -34,6 +75,12 @@
|
||||
pli.serial_number as "serialNumber",
|
||||
pli.title as "title",
|
||||
pli.project_library_id as "projectLibraryId",
|
||||
pli.design_initiator_id as "designInitiatorId",
|
||||
pli.design_duty_id as "designDutyId",
|
||||
pli.prehomo_initiator_id as "prehomoInitiatorId",
|
||||
pli.prehomo_duty_id as "prehomoDutyId",
|
||||
pli.verify_initiator_id as "verifyInitiatorId",
|
||||
pli.verify_duty_id as "verifyDutyId",
|
||||
pni.project_name as "projectName",
|
||||
pni.id as "projectNameId",
|
||||
pyni.year_name as "yearName",
|
||||
@@ -80,6 +127,16 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="params.isEngineerOrEngineeringInterfacePerson == true">
|
||||
and(
|
||||
pli.design_initiator_id = #{params.currentUserId}
|
||||
or pli.design_duty_id = #{params.currentUserId}
|
||||
or pli.prehomo_initiator_id = #{params.currentUserId}
|
||||
or pli.prehomo_duty_id = #{params.currentUserId}
|
||||
or pli.verify_initiator_id = #{params.currentUserId}
|
||||
or pli.verify_duty_id = #{params.currentUserId}
|
||||
)
|
||||
</if>
|
||||
order by pli.create_time desc
|
||||
</select>
|
||||
|
||||
@@ -96,16 +153,57 @@
|
||||
LEFT JOIN project_laws_inventory pli ON ( pli.stand_id = bdl.id )
|
||||
LEFT JOIN project_task_inventory pti ON ( pli.id = pti.project_laws_inventory_id )
|
||||
WHERE
|
||||
<if test="params.isEngineerOrEngineeringInterfacePerson != true">
|
||||
(
|
||||
bdl.id IN ( SELECT DISTINCT stand_id FROM laws_opinion_gather)
|
||||
OR bdl.id IN ( SELECT DISTINCT stand_id FROM laws_technology_evaluation)
|
||||
or pti.design_p_id IS NOT NULL
|
||||
OR pti.prehomo_p_id IS NOT NULL
|
||||
OR pti.verify_p_id IS NOT NULL
|
||||
bdl.id IN (
|
||||
SELECT
|
||||
DISTINCT stand_id
|
||||
FROM laws_opinion_gather
|
||||
where gather_result = #{params.gatherResult}
|
||||
)
|
||||
<if test="params.condition != '' ">
|
||||
${params.condition}
|
||||
</if>
|
||||
OR bdl.id IN (
|
||||
SELECT
|
||||
DISTINCT stand_id
|
||||
FROM laws_technology_evaluation
|
||||
where flow_status = #{params.flowStatus}
|
||||
)
|
||||
OR pti.design_p_id IS NOT NULL
|
||||
OR pti.prehomo_p_id IS NOT NULL
|
||||
OR pti.verify_p_id IS NOT NULL
|
||||
)
|
||||
</if>
|
||||
<!--2022-11-01 增加数据权限:如果当前登录用户,是工程师、工程接口人角色,只能查看到跟自己相关的数据。其余角色保留之前的查询结果。-->
|
||||
<if test="params.isEngineerOrEngineeringInterfacePerson == true">
|
||||
(
|
||||
bdl.id IN (
|
||||
SELECT
|
||||
DISTINCT stand_id
|
||||
FROM
|
||||
laws_opinion_gather
|
||||
where gather_result = #{params.gatherResult} and evaluator_ids like CONCAT(CONCAT('%',#{params.currentUserId}),'%')
|
||||
)
|
||||
OR bdl.id IN (
|
||||
SELECT
|
||||
DISTINCT stand_id
|
||||
FROM
|
||||
laws_technology_evaluation
|
||||
where flow_status = #{params.flowStatus}
|
||||
and id in (
|
||||
select
|
||||
laws_technology_evaluation_id
|
||||
from
|
||||
laws_technology_evaluation_flow_detail
|
||||
where evaluator_id = #{params.currentUserId}
|
||||
)
|
||||
)
|
||||
OR (pti.design_p_id IS NOT NULL and (pli.design_initiator_id = #{params.currentUserId} or pli.design_duty_id = #{params.currentUserId}))
|
||||
OR (pti.prehomo_p_id IS NOT NULL and (pli.prehomo_initiator_id = #{params.currentUserId} or pli.prehomo_duty_id = #{params.currentUserId}))
|
||||
OR (pti.verify_p_id IS NOT NULL and (pli.verify_initiator_id = #{params.currentUserId} or pli.verify_duty_id = #{params.currentUserId}))
|
||||
)
|
||||
</if>
|
||||
<if test="params.condition != '' ">
|
||||
${params.condition}
|
||||
</if>
|
||||
GROUP BY bdl.id
|
||||
order by bdl.create_time desc
|
||||
</select>
|
||||
|
||||
+9
-6
@@ -80,12 +80,15 @@
|
||||
or prehomo_flow_task_status =#{ncrTrackVO.inconformity} or prehomo_flow_task_status =#{ncrTrackVO.track}
|
||||
or verify_flow_task_status =#{ncrTrackVO.inconformity} or verify_flow_task_status =#{ncrTrackVO.track}
|
||||
)
|
||||
<if test="ncrTrackVO.userId != null and ncrTrackVO.userId != ''">
|
||||
and (pli.regulation_owner_id =#{ncrTrackVO.userId}
|
||||
or pli.homologation_engineer_id =#{ncrTrackVO.userId}
|
||||
or pli.engineering_interface_person =#{ncrTrackVO.userId}
|
||||
or ptid.user_id =#{ncrTrackVO.userId}
|
||||
)
|
||||
<!--如果当前操作人不是系统管理员角色,查询跟自己相关的数据,如果是系统管理员,查询所有的-->
|
||||
<if test="ncrTrackVO.administrator == 'false'">
|
||||
<if test="ncrTrackVO.userId != null and ncrTrackVO.userId != ''">
|
||||
and (pli.regulation_owner_id =#{ncrTrackVO.userId}
|
||||
or pli.homologation_engineer_id =#{ncrTrackVO.userId}
|
||||
or pli.engineering_interface_person =#{ncrTrackVO.userId}
|
||||
or ptid.user_id =#{ncrTrackVO.userId}
|
||||
)
|
||||
</if>
|
||||
</if>
|
||||
order by pli.create_time desc
|
||||
|
||||
|
||||
+8
-2
@@ -55,7 +55,10 @@
|
||||
from
|
||||
project_laws_inventory
|
||||
where
|
||||
project_library_id = #{projectLibraryId}
|
||||
project_library_id in
|
||||
<foreach collection="projectLibraryId.split(',')" index="index" separator="," open="(" close=")" item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
group by inventory_affirm_status
|
||||
</select>
|
||||
|
||||
@@ -67,7 +70,10 @@
|
||||
from
|
||||
project_laws_inventory
|
||||
where
|
||||
project_library_id = #{projectLibraryId}
|
||||
project_library_id in
|
||||
<foreach collection="projectLibraryId.split(',')" index="index" separator="," open="(" close=")" item="item">
|
||||
#{item}
|
||||
</foreach>
|
||||
group by task_affirm_status
|
||||
</select>
|
||||
|
||||
|
||||
+84
-6
@@ -43,7 +43,13 @@
|
||||
plb.create_time,
|
||||
plb.sys_org_code,
|
||||
plb.update_by,
|
||||
plb.update_time
|
||||
plb.update_time,
|
||||
plb.parent_id,
|
||||
plb.project_version,
|
||||
plb.explanation,
|
||||
plb.software_version,
|
||||
plb.sort,
|
||||
plb.flag
|
||||
from project_library_base as plb
|
||||
left join project_name_info as pni on plb.project_name_id=pni.id
|
||||
left join sys_user as studiouser on plb.studio_engineer=studiouser.id
|
||||
@@ -62,10 +68,10 @@
|
||||
( pni.project_name like '%1%%' escape '1' or pni.project_name like '%1%%' escape '1')
|
||||
</when>
|
||||
<otherwise>
|
||||
(pni.project_name like concat('%',#{params.projectName},'%') or pyni.year_name like concat('%',#{params.projectName},'%'))
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<!--(pni.project_name like concat('%',#{params.projectName},'%') or pyni.year_name like concat('%',#{params.projectName},'%'))-->
|
||||
</otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
|
||||
<!--搜索条件:目标市场-->
|
||||
<if test="params.targetMarket != null and params.targetMarket != '' ">
|
||||
@@ -111,8 +117,80 @@
|
||||
and plb.digital_platform like concat('%',#{params.digitalPlatform},'%')
|
||||
</if>
|
||||
</where>
|
||||
order by plb.create_time desc
|
||||
order by plb.sort desc, plb.create_time desc
|
||||
</select>
|
||||
<select id="queryMaimList" resultType="com.jero.modules.project.entity.ProjectLibraryBase">
|
||||
|
||||
<include refid="select_item"/>
|
||||
|
||||
<where>
|
||||
parent_id = '' or parent_id is null
|
||||
</where>
|
||||
order by plb.sort desc, plb.create_time desc
|
||||
</select>
|
||||
<!-- <select id="queryPageList" resultType="com.jero.modules.project.entity.ProjectLibraryBase">-->
|
||||
|
||||
<!-- <include refid="select_item"/>-->
|
||||
|
||||
<!-- <where>-->
|
||||
<!-- <if test="params.projectName != null and params.projectName != ''">-->
|
||||
<!-- <!–搜索条件:项目名称,包含%,单独搜索–>-->
|
||||
<!-- <choose>-->
|
||||
<!-- <when test='params.projectName != null and params.projectName != "" and params.projectName.contains("%")'>-->
|
||||
<!-- ( pni.project_name like '%1%%' escape '1' or pni.project_name like '%1%%' escape '1')-->
|
||||
<!-- </when>-->
|
||||
<!-- <otherwise>-->
|
||||
<!-- (pni.project_name like concat('%',#{params.projectName},'%') or pyni.year_name like concat('%',#{params.projectName},'%'))-->
|
||||
<!-- </otherwise>-->
|
||||
<!-- </choose>-->
|
||||
<!-- </if>-->
|
||||
|
||||
<!-- <!–搜索条件:目标市场–>-->
|
||||
<!-- <if test="params.targetMarket != null and params.targetMarket != '' ">-->
|
||||
<!-- and plb.target_market like concat('%',#{params.targetMarket},'%')-->
|
||||
<!-- </if>-->
|
||||
|
||||
<!-- <!–搜索条件:项目状态–>-->
|
||||
<!-- <if test="params.projectStatus != null and params.projectStatus != '' ">-->
|
||||
<!-- and plb.project_status like concat('%',#{params.projectStatus},'%')-->
|
||||
<!-- </if>-->
|
||||
|
||||
<!-- <if test="params.studioEngineer != null and params.studioEngineer != ''">-->
|
||||
<!-- <!–搜索条件:studio工程师,包含%,单独搜索–>-->
|
||||
<!-- <choose>-->
|
||||
<!-- <when test='params.studioEngineer != null and params.studioEngineer != "" and params.studioEngineer.contains("%")'>-->
|
||||
<!-- and plb.studio_engineer like '%1%%' escape '1'-->
|
||||
<!-- </when>-->
|
||||
<!-- <otherwise>-->
|
||||
<!-- and plb.studio_engineer like concat('%',#{params.studioEngineer},'%')-->
|
||||
<!-- </otherwise>-->
|
||||
<!-- </choose>-->
|
||||
<!-- </if>-->
|
||||
|
||||
<!-- <if test="params.certificationEngineer != null and params.certificationEngineer != ''">-->
|
||||
<!-- <!–搜索条件:认证工程师,包含%,单独搜索–>-->
|
||||
<!-- <choose>-->
|
||||
<!-- <when test='params.certificationEngineer != null and params.certificationEngineer != "" and params.certificationEngineer.contains("%")'>-->
|
||||
<!-- and plb.certification_engineer like '%1%%' escape '1'-->
|
||||
<!-- </when>-->
|
||||
<!-- <otherwise>-->
|
||||
<!-- and plb.certification_engineer like concat('%',#{params.certificationEngineer},'%')-->
|
||||
<!-- </otherwise>-->
|
||||
<!-- </choose>-->
|
||||
<!-- </if>-->
|
||||
|
||||
<!-- <!–搜索条件:车型平台–>-->
|
||||
<!-- <if test="params.vehiclePlatform != null and params.vehiclePlatform != '' ">-->
|
||||
<!-- and plb.vehicle_platform like concat('%',#{params.vehiclePlatform},'%')-->
|
||||
<!-- </if>-->
|
||||
|
||||
<!-- <!–搜索条件:数字平台–>-->
|
||||
<!-- <if test="params.digitalPlatform != null and params.digitalPlatform != '' ">-->
|
||||
<!-- and plb.digital_platform like concat('%',#{params.digitalPlatform},'%')-->
|
||||
<!-- </if>-->
|
||||
<!-- </where>-->
|
||||
<!-- order by plb.create_time desc-->
|
||||
<!-- </select>-->
|
||||
<select id="getList" resultType="com.jero.modules.project.entity.ProjectLibraryBase">
|
||||
|
||||
<include refid="select_item"/>
|
||||
|
||||
+11
@@ -8,11 +8,15 @@ import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
||||
import com.jero.modules.project.vo.ProjectTaskUrgVo;
|
||||
import com.jero.modules.system.entity.SysRole;
|
||||
import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO;
|
||||
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -149,4 +153,11 @@ public interface IProjectLawsInventoryEOService extends IService<ProjectLawsInve
|
||||
Result<?> expediting(JSONObject json);
|
||||
|
||||
List<SysRole> getRoleByUserId(String projectLibraryId,String cut);
|
||||
|
||||
void addProcessInfo(ProcessInfoEO processInfoEO, String projectLibraryId, Date endTime);
|
||||
|
||||
void addProcessInfoDetail(String processInfoId, List<ProcessInfoDetailEO> processInfoDetailEOList, Date endTime);
|
||||
|
||||
Result<?> taskUrg(ProjectTaskUrgVo projectTaskUrgVo);
|
||||
|
||||
}
|
||||
|
||||
+36
-3
@@ -1,6 +1,6 @@
|
||||
package com.jero.modules.project.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.project.entity.ProjectLibraryBase;
|
||||
|
||||
@@ -26,6 +26,14 @@ public interface IProjectLibraryBaseService extends IService<ProjectLibraryBase>
|
||||
*/
|
||||
void add(ProjectLibraryBase projectLibraryBase) throws ParseException;
|
||||
|
||||
/**
|
||||
* 项目扩展(添加子项目-子项目基本信息、相关人员名单、法规/认证任务计划与被扩展项目保持一致)
|
||||
*
|
||||
* @param projectLibraryBase
|
||||
* @return
|
||||
*/
|
||||
void addChild(ProjectLibraryBase projectLibraryBase) throws ParseException;
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
@@ -56,7 +64,7 @@ public interface IProjectLibraryBaseService extends IService<ProjectLibraryBase>
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<ProjectLibraryBase> queryById(String id);
|
||||
List<ProjectLibraryBase> queryById(String id,String cut);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
@@ -70,7 +78,8 @@ public interface IProjectLibraryBaseService extends IService<ProjectLibraryBase>
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
IPage<ProjectLibraryBase> queryPageList(Map<String, Object> params);
|
||||
List<ProjectLibraryBase> queryPageList(Map<String, Object> params);
|
||||
// IPage<ProjectLibraryBase> queryPageList(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 项目详情-统计接口
|
||||
@@ -91,4 +100,28 @@ public interface IProjectLibraryBaseService extends IService<ProjectLibraryBase>
|
||||
void checkData(String id, String cut);
|
||||
|
||||
void disposeData(List<ProjectLibraryBase> records,String cut,boolean disposeTargetMarketFlag);
|
||||
|
||||
Page getPages(Integer currentPage, Integer pageSize, List<ProjectLibraryBase> list);
|
||||
|
||||
/**
|
||||
* 项目置顶,取消置顶(只置顶主项目)
|
||||
* @param id
|
||||
* @param flag 0为置顶, 1为取消置顶
|
||||
* @return
|
||||
*/
|
||||
void top(String id,String flag);
|
||||
|
||||
/**
|
||||
* 获取项目所有的版本(主版本和子版本的集合)
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<String> getVersionsInfo(String id);
|
||||
|
||||
/**
|
||||
* 版本统计
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<ProjectLibraryBase> versionStatistics(String id);
|
||||
}
|
||||
|
||||
+8
@@ -9,6 +9,7 @@ import com.jero.modules.project.vo.ProjectTaskInventoryVO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 项目库-任务清单表
|
||||
@@ -102,4 +103,11 @@ public interface IProjectTaskInventoryEOService extends IService<ProjectTaskInve
|
||||
List<String> verifyRoleCode(ProjectTaskInventoryVO projectTaskInventoryVO);
|
||||
|
||||
void exportXls(HttpServletResponse response, HttpServletRequest request, ProjectTaskInventoryEO projectTaskInventoryEO);
|
||||
|
||||
/**
|
||||
* 处理历史数据
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Result<?> disposeHistoryData(Map<String, Object> params);
|
||||
}
|
||||
|
||||
+178
-42
@@ -25,6 +25,7 @@ import com.jero.modules.project.service.ILawsComplianceBoardService;
|
||||
import com.jero.modules.system.entity.SysCategory;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
import com.jero.modules.system.service.ISysDictItemService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
|
||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||
import com.jero.modules.system.util.StringUtils;
|
||||
@@ -68,6 +69,8 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
||||
private ISysDictItemService sysDictItemService;
|
||||
@Autowired
|
||||
private ProjectTaskInventoryDetailEOMapper projectTaskInventoryDetailEOMapper;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@Override
|
||||
public IPage queryPageList(Map<String, Object> params) {
|
||||
@@ -81,6 +84,18 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
||||
//只查询 法规技术评估流程状态、法规意见收集 收集结果 为已完成的数据
|
||||
params.put("flowStatus", GatherResultEnum.COMPLETED.getValue());
|
||||
params.put("gatherResult", GatherResultEnum.COMPLETED.getValue());
|
||||
|
||||
/**
|
||||
* 2022-11-01 增加数据权限:如果当前登录用户,是工程师、工程接口人角色,只能查看到跟自己相关的数据。其余角色保留之前的查询结果。
|
||||
*/
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
boolean isEngineer = this.sysUserService.isEngineer(currentUser);
|
||||
boolean isEngineeringInterfacePerson = this.sysUserService.isEngineeringInterfacePerson(currentUser);
|
||||
if(isEngineer || isEngineeringInterfacePerson){
|
||||
params.put("currentUserId",currentUser.getId());
|
||||
params.put("isEngineerOrEngineeringInterfacePerson",true);
|
||||
}
|
||||
|
||||
IPage page = new Page(pageNo, pageSize);
|
||||
IPage infoPage = this.lawsComplianceBoardMapper.queryPageList(page, params);
|
||||
List records = infoPage.getRecords();
|
||||
@@ -142,18 +157,28 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
||||
|
||||
@Override
|
||||
public JSONObject queryComplianceResultList(Map<String, Object> params) {
|
||||
/**
|
||||
* 2022-11-01 增加数据权限:如果当前登录用户,是工程师、工程接口人角色,只能查看到跟自己相关的数据。其余角色保留之前的查询结果。
|
||||
*/
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
boolean isEngineer = this.sysUserService.isEngineer(currentUser);
|
||||
boolean isEngineeringInterfacePerson = this.sysUserService.isEngineeringInterfacePerson(currentUser);
|
||||
if(isEngineer || isEngineeringInterfacePerson){
|
||||
params.put("currentUserId",currentUser.getId());
|
||||
params.put("isEngineerOrEngineeringInterfacePerson",true);
|
||||
}
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
String id = (String) params.get("id");
|
||||
String cut = (String) params.get("cut");
|
||||
List<Map<String,Object>> complianceResultList = this.lawsComplianceBoardMapper.queryComplianceResultList(params);
|
||||
if(CollectionUtils.isNotEmpty(complianceResultList)){
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
List<String> projectLawsInventoryIdList = complianceResultList.stream().map(map-> (String) map.get("id")).collect(Collectors.toList());
|
||||
QueryWrapper<ProjectTaskInventoryDetailEO> taskDetailQueryWrapper = new QueryWrapper<>();
|
||||
taskDetailQueryWrapper.lambda().in(ProjectTaskInventoryDetailEO::getProjectTaskInventoryId,projectLawsInventoryIdList);
|
||||
List<ProjectTaskInventoryDetailEO> projectTaskInventoryDetailEOList = this.projectTaskInventoryDetailEOMapper.selectList(taskDetailQueryWrapper);
|
||||
this.createTaskInventoryEOList(complianceResultList,projectTaskInventoryDetailEOList,currentUser);
|
||||
this.disposeComplianceResult(complianceResultList,cut);
|
||||
this.createTaskInventoryEOList(complianceResultList,projectTaskInventoryDetailEOList,currentUser,isEngineer,isEngineeringInterfacePerson);
|
||||
this.disposeComplianceResult(complianceResultList,cut,isEngineer,isEngineeringInterfacePerson);
|
||||
}
|
||||
result.put("complianceResultList",complianceResultList);
|
||||
|
||||
@@ -161,6 +186,10 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
||||
QueryWrapper<LawsOpinionGatherEO> opinionGatherEOQueryWrapper = new QueryWrapper<>();
|
||||
opinionGatherEOQueryWrapper.lambda().eq(LawsOpinionGatherEO::getStandId,id);
|
||||
opinionGatherEOQueryWrapper.lambda().eq(LawsOpinionGatherEO::getGatherResult,GatherResultEnum.COMPLETED.getValue());
|
||||
//如果当前登录用户是工程师或工程接口人,只查询自己为评估人的法规意见收集数据。
|
||||
if(isEngineer || isEngineeringInterfacePerson){
|
||||
opinionGatherEOQueryWrapper.lambda().like(LawsOpinionGatherEO::getEvaluatorIds,currentUser.getId());
|
||||
}
|
||||
int opinionGatherCount = this.lawsOpinionGatherEOService.count(opinionGatherEOQueryWrapper);
|
||||
result.put("opinionGather",opinionGatherCount);
|
||||
|
||||
@@ -168,6 +197,10 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
||||
QueryWrapper<LawsTechnologyEvaluationEO> evaluationEOQueryWrapper = new QueryWrapper<>();
|
||||
evaluationEOQueryWrapper.lambda().eq(LawsTechnologyEvaluationEO::getStandId,id);
|
||||
evaluationEOQueryWrapper.lambda().eq(LawsTechnologyEvaluationEO::getFlowStatus,GatherResultEnum.COMPLETED.getValue());
|
||||
//如果当前登录用户是工程师或工程接口人,只查询自己为评估人的法规技术评估数据。
|
||||
if(isEngineer || isEngineeringInterfacePerson){
|
||||
this.lawsTechnologyEvaluationEOService.createQueryPermission(evaluationEOQueryWrapper,null,false);
|
||||
}
|
||||
int evaluationCount = this.lawsTechnologyEvaluationEOService.count(evaluationEOQueryWrapper);
|
||||
result.put("technologyEvaluation",evaluationCount);
|
||||
return result;
|
||||
@@ -178,8 +211,14 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
||||
* @param complianceResultList
|
||||
* @param projectTaskInventoryDetailEOList
|
||||
* @param currentUser
|
||||
* @param isEngineer 是否是工程师角色
|
||||
* @param isEngineeringInterfacePerson 是否是工程接口人角色
|
||||
*/
|
||||
private void createTaskInventoryEOList(List<Map<String, Object>> complianceResultList, List<ProjectTaskInventoryDetailEO> projectTaskInventoryDetailEOList, LoginUser currentUser) {
|
||||
private void createTaskInventoryEOList(List<Map<String, Object>> complianceResultList,
|
||||
List<ProjectTaskInventoryDetailEO> projectTaskInventoryDetailEOList,
|
||||
LoginUser currentUser,
|
||||
boolean isEngineer,
|
||||
boolean isEngineeringInterfacePerson) {
|
||||
if(CollectionUtils.isNotEmpty(complianceResultList) && CollectionUtils.isNotEmpty(projectTaskInventoryDetailEOList)){
|
||||
for (Map<String, Object> complianceResult : complianceResultList) {
|
||||
String designPid = "";
|
||||
@@ -199,44 +238,97 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
||||
String verifyTaskStatus = "";
|
||||
String verifyTaskDefinitionKey = "";
|
||||
String verifyTaskDetailId = "";
|
||||
|
||||
for (ProjectTaskInventoryDetailEO projectTaskInventoryDetail : projectTaskInventoryDetailEOList) {
|
||||
if(StringUtils.equals(complianceResult.get("id").toString(),projectTaskInventoryDetail.getProjectTaskInventoryId())){
|
||||
/**
|
||||
* 查询数据权限,所有用户都是,自己的待办,可以跳转到处理任务详情页进行处理。
|
||||
* 不是自己的待办,只能跳转到处理任务的详情页。
|
||||
*/
|
||||
if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(), FlowTypeEnum.SJFHXSHLC.getValue())){
|
||||
designPid = projectTaskInventoryDetail.getActiProcInstId();
|
||||
designTaskId = projectTaskInventoryDetail.getTaskId();
|
||||
designTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey();
|
||||
designTaskDetailId = projectTaskInventoryDetail.getId();
|
||||
if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){
|
||||
designTaskStatus = projectTaskInventoryDetail.getStatus();
|
||||
}else {
|
||||
designTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue();
|
||||
//2022-11-01 增加数据权限:如果当前登录用户,是工程师、工程接口人角色,只能查看到跟自己相关的数据。其余角色保留之前的查询结果。
|
||||
if((isEngineer || isEngineeringInterfacePerson)){
|
||||
for (ProjectTaskInventoryDetailEO projectTaskInventoryDetail : projectTaskInventoryDetailEOList) {
|
||||
if(StringUtils.equals(complianceResult.get("id").toString(),projectTaskInventoryDetail.getProjectTaskInventoryId())){
|
||||
/**
|
||||
* 查询数据权限,所有用户都是,自己的待办,可以跳转到处理任务详情页进行处理。
|
||||
* 不是自己的待办,只能跳转到处理任务的详情页。
|
||||
*/
|
||||
if(StringUtils.equals(complianceResult.get("designInitiatorId").toString(),currentUser.getId())
|
||||
|| StringUtils.equals(complianceResult.get("designDutyId").toString(),currentUser.getId())){
|
||||
if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(), FlowTypeEnum.SJFHXSHLC.getValue())){
|
||||
designPid = projectTaskInventoryDetail.getActiProcInstId();
|
||||
designTaskId = projectTaskInventoryDetail.getTaskId();
|
||||
designTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey();
|
||||
designTaskDetailId = projectTaskInventoryDetail.getId();
|
||||
if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){
|
||||
designTaskStatus = projectTaskInventoryDetail.getStatus();
|
||||
}else {
|
||||
designTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(StringUtils.equals(complianceResult.get("prehomoInitiatorId").toString(),currentUser.getId())
|
||||
|| StringUtils.equals(complianceResult.get("prehomoDutyId").toString(),currentUser.getId())){
|
||||
if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(),FlowTypeEnum.PREHOMOQRLC.getValue())){
|
||||
prehomoPid = projectTaskInventoryDetail.getActiProcInstId();
|
||||
prehomoTaskId = projectTaskInventoryDetail.getTaskId();
|
||||
prehomoTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey();
|
||||
prehomoTaskDetailId = projectTaskInventoryDetail.getId();
|
||||
if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){
|
||||
prehomoTaskStatus = projectTaskInventoryDetail.getStatus();
|
||||
}else {
|
||||
prehomoTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(StringUtils.equals(complianceResult.get("verifyInitiatorId").toString(),currentUser.getId())
|
||||
|| StringUtils.equals(complianceResult.get("verifyDutyId").toString(),currentUser.getId())){
|
||||
if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(),FlowTypeEnum.YZFHXSCLC.getValue())){
|
||||
verifyPid = projectTaskInventoryDetail.getActiProcInstId();
|
||||
verifyTaskId = projectTaskInventoryDetail.getTaskId();
|
||||
verifyTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey();
|
||||
verifyTaskDetailId = projectTaskInventoryDetail.getId();
|
||||
if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){
|
||||
verifyTaskStatus = projectTaskInventoryDetail.getStatus();
|
||||
}else {
|
||||
verifyTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(),FlowTypeEnum.PREHOMOQRLC.getValue())){
|
||||
prehomoPid = projectTaskInventoryDetail.getActiProcInstId();
|
||||
prehomoTaskId = projectTaskInventoryDetail.getTaskId();
|
||||
prehomoTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey();
|
||||
prehomoTaskDetailId = projectTaskInventoryDetail.getId();
|
||||
if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){
|
||||
prehomoTaskStatus = projectTaskInventoryDetail.getStatus();
|
||||
}else {
|
||||
prehomoTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue();
|
||||
}
|
||||
}else {
|
||||
for (ProjectTaskInventoryDetailEO projectTaskInventoryDetail : projectTaskInventoryDetailEOList) {
|
||||
if(StringUtils.equals(complianceResult.get("id").toString(),projectTaskInventoryDetail.getProjectTaskInventoryId())){
|
||||
/**
|
||||
* 查询数据权限,所有用户都是,自己的待办,可以跳转到处理任务详情页进行处理。
|
||||
* 不是自己的待办,只能跳转到处理任务的详情页。
|
||||
*/
|
||||
if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(), FlowTypeEnum.SJFHXSHLC.getValue())){
|
||||
designPid = projectTaskInventoryDetail.getActiProcInstId();
|
||||
designTaskId = projectTaskInventoryDetail.getTaskId();
|
||||
designTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey();
|
||||
designTaskDetailId = projectTaskInventoryDetail.getId();
|
||||
if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){
|
||||
designTaskStatus = projectTaskInventoryDetail.getStatus();
|
||||
}else {
|
||||
designTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(),FlowTypeEnum.YZFHXSCLC.getValue())){
|
||||
verifyPid = projectTaskInventoryDetail.getActiProcInstId();
|
||||
verifyTaskId = projectTaskInventoryDetail.getTaskId();
|
||||
verifyTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey();
|
||||
verifyTaskDetailId = projectTaskInventoryDetail.getId();
|
||||
if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){
|
||||
verifyTaskStatus = projectTaskInventoryDetail.getStatus();
|
||||
}else {
|
||||
verifyTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue();
|
||||
if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(),FlowTypeEnum.PREHOMOQRLC.getValue())){
|
||||
prehomoPid = projectTaskInventoryDetail.getActiProcInstId();
|
||||
prehomoTaskId = projectTaskInventoryDetail.getTaskId();
|
||||
prehomoTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey();
|
||||
prehomoTaskDetailId = projectTaskInventoryDetail.getId();
|
||||
if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){
|
||||
prehomoTaskStatus = projectTaskInventoryDetail.getStatus();
|
||||
}else {
|
||||
prehomoTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue();
|
||||
}
|
||||
}
|
||||
if(StringUtils.equals(projectTaskInventoryDetail.getFlowType(),FlowTypeEnum.YZFHXSCLC.getValue())){
|
||||
verifyPid = projectTaskInventoryDetail.getActiProcInstId();
|
||||
verifyTaskId = projectTaskInventoryDetail.getTaskId();
|
||||
verifyTaskDefinitionKey = projectTaskInventoryDetail.getTaskDefinitionKey();
|
||||
verifyTaskDetailId = projectTaskInventoryDetail.getId();
|
||||
if(StringUtils.equals(currentUser.getId(),projectTaskInventoryDetail.getUserId())){
|
||||
verifyTaskStatus = projectTaskInventoryDetail.getStatus();
|
||||
}else {
|
||||
verifyTaskStatus = TaskStatusEnum.SHOW_FLAG.getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -267,10 +359,35 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
||||
}
|
||||
}
|
||||
|
||||
public void disposeComplianceResult(List<Map<String,Object>> complianceResultList,String cut){
|
||||
public void disposeComplianceResult(List<Map<String,Object>> complianceResultList,String cut,boolean isEngineer,boolean isEngineeringInterfacePerson){
|
||||
if(CollectionUtils.isNotEmpty(complianceResultList)){
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
List<SysDictItem> dutyTerritoryDictItemList = sysDictItemService.selectItemsByDictCode("duty_territory");
|
||||
for (Map<String, Object> complianceResult : complianceResultList) {
|
||||
if(isEngineer || isEngineeringInterfacePerson){
|
||||
if(!StringUtils.equals(complianceResult.get("designInitiatorId").toString(),currentUser.getId())
|
||||
|| !StringUtils.equals(complianceResult.get("designDutyId").toString(),currentUser.getId())){
|
||||
complianceResult.put("designStatus","");
|
||||
complianceResult.put("designFlowTaskStatus","");
|
||||
complianceResult.put("designPId","");
|
||||
complianceResult.put("designPersonChargeFeedback","");
|
||||
}
|
||||
if(!StringUtils.equals(complianceResult.get("prehomoInitiatorId").toString(),currentUser.getId())
|
||||
&& !StringUtils.equals(complianceResult.get("prehomoDutyId").toString(),currentUser.getId())){
|
||||
complianceResult.put("prehomoStatus","");
|
||||
complianceResult.put("prehomoFlowTaskStatus","");
|
||||
complianceResult.put("prehomoPId","");
|
||||
complianceResult.put("prehomoPersonChargeFeedback","");
|
||||
}
|
||||
if(!StringUtils.equals(complianceResult.get("verifyInitiatorId").toString(),currentUser.getId())
|
||||
&& !StringUtils.equals(complianceResult.get("verifyDutyId").toString(),currentUser.getId())){
|
||||
complianceResult.put("verifyStatus","");
|
||||
complianceResult.put("verifyFlowTaskStatus","");
|
||||
complianceResult.put("verifyPId","");
|
||||
complianceResult.put("verifyPersonChargeFeedback","");
|
||||
}
|
||||
}
|
||||
|
||||
if (complianceResult.get("designStatus") != null) {
|
||||
String textByValue = DesignComplianceStatusEnum.getTextByValue(complianceResult.get("designStatus").toString(), cut);
|
||||
complianceResult.put("designStatus_dicText",textByValue);
|
||||
@@ -342,6 +459,15 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
||||
String condition = this.getConditionStr(params);
|
||||
params.put("condition",StringUtils.isNotEmpty(condition) ? condition : "");
|
||||
List<Map<String,Object>> exportData = new ArrayList<>();
|
||||
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
boolean isEngineer = this.sysUserService.isEngineer(currentUser);
|
||||
boolean isEngineeringInterfacePerson = this.sysUserService.isEngineeringInterfacePerson(currentUser);
|
||||
if(isEngineer || isEngineeringInterfacePerson){
|
||||
params.put("currentUserId",currentUser.getId());
|
||||
params.put("isEngineerOrEngineeringInterfacePerson",true);
|
||||
}
|
||||
|
||||
if(StringUtils.equals(exportAll,"no")){
|
||||
IPage page = this.queryPageList(params);
|
||||
exportData = page.getRecords();
|
||||
@@ -358,7 +484,7 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
||||
List<Map<String,Object>> complianceResultList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(idList)){
|
||||
complianceResultList = this.lawsComplianceBoardMapper.queryComplianceResultList(params);
|
||||
this.disposeComplianceResult(complianceResultList,cut);
|
||||
this.disposeComplianceResult(complianceResultList,cut,isEngineer,isEngineeringInterfacePerson);
|
||||
}
|
||||
|
||||
String title = "";
|
||||
@@ -468,8 +594,18 @@ public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardServi
|
||||
@Override
|
||||
public void exportComplianceResultDetail(HttpServletResponse response, HttpServletRequest request, Map<String, Object> params) {
|
||||
String cut = (String) params.get("cut");
|
||||
/**
|
||||
* 2022-11-01 增加数据权限:如果当前登录用户,是工程师、工程接口人角色,只能查看到跟自己相关的数据。其余角色保留之前的查询结果。
|
||||
*/
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
boolean isEngineer = this.sysUserService.isEngineer(currentUser);
|
||||
boolean isEngineeringInterfacePerson = this.sysUserService.isEngineeringInterfacePerson(currentUser);
|
||||
if(isEngineer || isEngineeringInterfacePerson){
|
||||
params.put("currentUserId",currentUser.getId());
|
||||
params.put("isEngineerOrEngineeringInterfacePerson",true);
|
||||
}
|
||||
List<Map<String,Object>> exportData = this.lawsComplianceBoardMapper.queryComplianceResultList(params);
|
||||
this.disposeComplianceResult(exportData,cut);
|
||||
this.disposeComplianceResult(exportData,cut,isEngineer,isEngineeringInterfacePerson);
|
||||
String title = "";
|
||||
String fileName = "";
|
||||
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
|
||||
|
||||
+5
@@ -80,6 +80,11 @@ public class NcrTrackServiceImpl extends ServiceImpl<NcrTrackMapper, NcrTrackVO>
|
||||
|
||||
ncrTrackVO.setInconformity(ReviewResultEnum.INCONFORMITY.getValue());
|
||||
ncrTrackVO.setTrack(ReviewResultEnum.TO_TRACK.getValue());
|
||||
|
||||
//如果当前登录用户是系统管理员角色,可以查看所有的数据
|
||||
boolean administrator = this.sysUserService.isAdministrator();
|
||||
ncrTrackVO.setAdministrator(administrator ? "true":"false");
|
||||
|
||||
List<NcrTrackVO> infoList = ncrTrackMapper.getInfoList(ncrTrackVO);
|
||||
infoList = infoList.stream().distinct().collect(Collectors.toList());
|
||||
List<NcrTrackVO> trackVOList = new ArrayList<>();
|
||||
|
||||
+1008
-283
File diff suppressed because it is too large
Load Diff
+576
-23
@@ -1,8 +1,8 @@
|
||||
package com.jero.modules.project.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.func.Func1;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
@@ -11,9 +11,27 @@ import com.jero.common.system.vo.DictModel;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.cert.collect.service.IParamsManifestEOService;
|
||||
import com.jero.modules.enums.DictCodeEnum;
|
||||
import com.jero.modules.project.entity.*;
|
||||
import com.jero.modules.project.enums.*;
|
||||
import com.jero.modules.project.mapper.*;
|
||||
import com.jero.modules.project.entity.ConditionAssessmentEO;
|
||||
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
||||
import com.jero.modules.project.entity.ProjectLawsInventoryLogEO;
|
||||
import com.jero.modules.project.entity.ProjectLibraryBase;
|
||||
import com.jero.modules.project.entity.ProjectLibraryRoleRelEO;
|
||||
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
|
||||
import com.jero.modules.project.entity.ProjectTaskInventoryEO;
|
||||
import com.jero.modules.project.entity.ProjectTaskPlanning;
|
||||
import com.jero.modules.project.enums.CertificationProgressEnum;
|
||||
import com.jero.modules.project.enums.CurrentProjectStatusEnum;
|
||||
import com.jero.modules.project.enums.DesignComplianceStatusEnum;
|
||||
import com.jero.modules.project.enums.InventoryAffirmStatusEnum;
|
||||
import com.jero.modules.project.enums.OperatorTypeEnum;
|
||||
import com.jero.modules.project.enums.ProjectRoleEnum;
|
||||
import com.jero.modules.project.enums.TaskAffirmStatusEnum;
|
||||
import com.jero.modules.project.enums.TopEnum;
|
||||
import com.jero.modules.project.mapper.ProjectLawsInventoryEOMapper;
|
||||
import com.jero.modules.project.mapper.ProjectLibraryBaseMapper;
|
||||
import com.jero.modules.project.mapper.ProjectNameInfoEOMapper;
|
||||
import com.jero.modules.project.mapper.ProjectRelatedPersonnelMapper;
|
||||
import com.jero.modules.project.mapper.ProjectTaskInventoryEOMapper;
|
||||
import com.jero.modules.project.service.IConditionAssessmentEOService;
|
||||
import com.jero.modules.project.service.IProjectLibraryBaseService;
|
||||
import com.jero.modules.project.service.IProjectLibraryRoleRelEOService;
|
||||
@@ -23,16 +41,20 @@ import com.jero.modules.system.enums.DicCodeEnum;
|
||||
import com.jero.modules.system.mapper.SysDictItemMapper;
|
||||
import com.jero.modules.system.mapper.SysUserMapper;
|
||||
import com.jero.modules.system.service.ISysDictService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||
import com.jero.modules.system.util.StringUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -40,7 +62,15 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -100,6 +130,9 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
||||
@Autowired
|
||||
private ISysDictService sysDictService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
@@ -131,8 +164,64 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
||||
projectLibraryRoleRelEOService.add(projectLibraryRoleRelEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目扩展(添加子项目--子项目基本信息、相关人员名单、法规/认证任务计划与被扩展项目保持一致)
|
||||
* @param projectLibraryBase
|
||||
* @throws ParseException
|
||||
*/
|
||||
@Override
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public void addChild(ProjectLibraryBase projectLibraryBase) throws ParseException {
|
||||
String id = projectLibraryBase.getId();//主项目id
|
||||
String projectId = UUID.randomUUID().toString().replace("-", "");
|
||||
//主表中添加数据
|
||||
ProjectLibraryBase projectLibraryBaseTemp = this.getById(id);
|
||||
projectLibraryBaseTemp.setId(projectId);
|
||||
projectLibraryBaseTemp.setParentId(id);
|
||||
projectLibraryBaseTemp.setProjectVersion(projectLibraryBase.getProjectVersion());
|
||||
projectLibraryBaseTemp.setExplanation(projectLibraryBase.getExplanation());
|
||||
this.save(projectLibraryBaseTemp);
|
||||
|
||||
/**检查车型名称id,年款号,目标市场同时存在,报错*/
|
||||
|
||||
//相关人员名单中添加数据
|
||||
List<ProjectRelatedPersonnel> projectRelatedPersonnelList = projectRelatedPersonnelMapper.queryPageList(id,
|
||||
DictCodeEnum.DUTY_TERRITORY.getValue(),
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null);
|
||||
if(projectRelatedPersonnelList.size() != 0){
|
||||
for (ProjectRelatedPersonnel projectRelatedPersonnel : projectRelatedPersonnelList) {
|
||||
projectRelatedPersonnel.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
projectRelatedPersonnel.setProjectId(projectId);
|
||||
}
|
||||
projectRelatedPersonnelService.saveBatch(projectRelatedPersonnelList);
|
||||
}
|
||||
|
||||
//法规/认证任务计划添加数据 projectTaskPlanningService
|
||||
LambdaQueryWrapper<ProjectTaskPlanning> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(ProjectTaskPlanning::getProjectId,projectLibraryBase.getId());
|
||||
ProjectTaskPlanning projectTaskPlanning = projectTaskPlanningService.getOne(wrapper);
|
||||
if(ObjectUtils.isNotEmpty(projectTaskPlanning)){
|
||||
projectTaskPlanning.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
projectTaskPlanning.setProjectId(projectId);
|
||||
projectTaskPlanningService.add(projectTaskPlanning);
|
||||
}
|
||||
|
||||
|
||||
//初始化当前项目的studio与项目库 角色关系 projectLibraryRoleRelEOService
|
||||
LambdaQueryWrapper<ProjectLibraryRoleRelEO> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(ProjectLibraryRoleRelEO::getProjectLibraryId,projectLibraryBase.getId());
|
||||
ProjectLibraryRoleRelEO projectLibraryRoleRelEO = projectLibraryRoleRelEOService.getOne(queryWrapper);
|
||||
if(ObjectUtils.isNotEmpty(projectLibraryRoleRelEO)){
|
||||
projectLibraryRoleRelEO.setId(UUID.randomUUID().toString().replace("-", ""));
|
||||
projectLibraryRoleRelEO.setProjectLibraryId(projectId);
|
||||
projectLibraryRoleRelEOService.add(projectLibraryRoleRelEO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**检查车型名称id,年款号,目标市场,版本同时存在,报错*/
|
||||
public void checkExitData(ProjectLibraryBase projectLibraryBase){
|
||||
String projectNameId = projectLibraryBase.getProjectNameId();
|
||||
String yearNameId = projectLibraryBase.getYearNameId();
|
||||
@@ -140,7 +229,8 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
||||
QueryWrapper<ProjectLibraryBase> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("project_name_id",projectNameId)
|
||||
.eq("year_name_id",yearNameId)
|
||||
.eq("target_market",targetMarket);
|
||||
.eq("target_market",targetMarket)
|
||||
.eq("project_version",targetMarket);
|
||||
if(StringUtils.isNotBlank(projectLibraryBase.getId())){
|
||||
queryWrapper.ne("id",projectLibraryBase.getId());
|
||||
}
|
||||
@@ -253,8 +343,10 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
||||
public void checkData(String id, String cut) {
|
||||
//判断该条项目是否是自己创建,如果不是则不能删除
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
List<ProjectLibraryBase> projectLibraryBases = this.queryById(id);
|
||||
if(!loginUser.getUsername().equals(projectLibraryBases.get(0).getCreateBy())){
|
||||
List<ProjectLibraryBase> projectLibraryBases = this.queryById(id,null);
|
||||
//管理员和创建人可以删除,其余人不能删除
|
||||
boolean administrator = sysUserService.isAdministrator();
|
||||
if(!loginUser.getUsername().equals(projectLibraryBases.get(0).getCreateBy()) && !administrator){
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
throw new JeroBootException("该条项目非本人创建,不能删除");
|
||||
}else{
|
||||
@@ -335,12 +427,32 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ProjectLibraryBase> queryById(String id) {
|
||||
public List<ProjectLibraryBase> queryById(String id,String cut) {
|
||||
List<ProjectLibraryBase> records = projectLibraryBaseMapper.queryById(id);
|
||||
disposeData(records,"",false);
|
||||
//目标市场数据字典
|
||||
List<DictModel> targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
|
||||
for(ProjectLibraryBase projectLibraryBase: records){
|
||||
//历史数据的主版本没有版本号,所以默认给00
|
||||
if(StringUtils.isBlank(projectLibraryBase.getParentId()) && StringUtils.isBlank(projectLibraryBase.getProjectVersion())){
|
||||
projectLibraryBase.setProjectVersion("00");
|
||||
}
|
||||
//目标市场
|
||||
Map<String,Object> param = new HashMap<>();
|
||||
param.put("cut",cut);
|
||||
String targetMarket = getMarket(param, targetMarketList, projectLibraryBase);
|
||||
//主项目的版本号
|
||||
String projectVersion = "";
|
||||
if(StringUtils.isBlank(projectLibraryBase.getParentId())){
|
||||
projectVersion = "00";
|
||||
}else{
|
||||
projectVersion = projectLibraryBase.getProjectVersion();
|
||||
}
|
||||
if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){
|
||||
projectLibraryBase.setProjectName(projectLibraryBase.getProjectName() + "-" + projectLibraryBase.getYearName());
|
||||
projectLibraryBase.setProjectName(projectLibraryBase.getProjectName()
|
||||
+ "-" + projectLibraryBase.getYearName()
|
||||
+ "-" + targetMarket
|
||||
+ "-" + projectVersion);
|
||||
}
|
||||
}
|
||||
return records;
|
||||
@@ -363,21 +475,293 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public IPage<ProjectLibraryBase> queryPageList(Map<String,Object> params) {
|
||||
Integer pageNo = Integer.parseInt(params.get("pageNo").toString());
|
||||
Integer pageSize = Integer.parseInt(params.get("pageSize").toString());
|
||||
IPage page = new Page(pageNo, pageSize);
|
||||
IPage<ProjectLibraryBase> result = projectLibraryBaseMapper.queryPageList(page, params);
|
||||
List<ProjectLibraryBase> records = result.getRecords();
|
||||
disposeData(records,"",false);
|
||||
for(ProjectLibraryBase projectLibraryBase: records){
|
||||
public List<ProjectLibraryBase> queryPageList(Map<String,Object> params) {
|
||||
List<ProjectLibraryBase> result = projectLibraryBaseMapper.queryPageList(params);
|
||||
disposeData(result,"",false);
|
||||
//目标市场
|
||||
List<DictModel> targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
|
||||
|
||||
for(ProjectLibraryBase projectLibraryBase: result){
|
||||
//目标市场
|
||||
String targetMarket = getMarket(params, targetMarketList, projectLibraryBase);
|
||||
//主项目的版本号
|
||||
String projectVersion = "";
|
||||
if(StringUtils.isBlank(projectLibraryBase.getParentId())){
|
||||
projectVersion = "00";
|
||||
}else{
|
||||
projectVersion = projectLibraryBase.getProjectVersion();
|
||||
}
|
||||
if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){
|
||||
projectLibraryBase.setProjectName(projectLibraryBase.getProjectName() + "-" + projectLibraryBase.getYearName());
|
||||
projectLibraryBase.setProjectName(projectLibraryBase.getProjectName()
|
||||
+ "-" + projectLibraryBase.getYearName()
|
||||
+ "-" + targetMarket
|
||||
+ "-" + projectVersion);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
//所有主项目
|
||||
List<ProjectLibraryBase> projectLibraryBaseListParent = projectLibraryBaseMapper.queryMaimList();
|
||||
disposeData(projectLibraryBaseListParent,"",false);
|
||||
for(ProjectLibraryBase projectLibraryBase: projectLibraryBaseListParent){
|
||||
//目标市场
|
||||
String targetMarket = getMarket(params, targetMarketList, projectLibraryBase);
|
||||
//主项目的版本号
|
||||
String projectVersion = "";
|
||||
if(StringUtils.isBlank(projectLibraryBase.getParentId())){
|
||||
projectVersion = "00";
|
||||
}else{
|
||||
projectVersion = projectLibraryBase.getProjectVersion();
|
||||
}
|
||||
if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){
|
||||
projectLibraryBase.setProjectName(projectLibraryBase.getProjectName()
|
||||
+ "-" + projectLibraryBase.getYearName()
|
||||
+ "-" + targetMarket
|
||||
+ "-" + projectVersion);
|
||||
}
|
||||
}
|
||||
|
||||
//项目名称模糊查询特殊处理(因为项目名称是多字段拼接的)
|
||||
if(ObjectUtils.isNotEmpty(params.get("projectName"))){
|
||||
result = result.stream().filter(e->e.getProjectName().toLowerCase().contains(String.valueOf(params.get("projectName")).toLowerCase())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
//处理搜索版本号,(因为列表展示数据是以主项目为主并绑定子项目, 所以搜索的时候只有子项目这种情况需要特殊处理)
|
||||
List<ProjectLibraryBase> resultNew = getProjectLibraryBases(result, projectLibraryBaseListParent);
|
||||
|
||||
|
||||
//数据组装
|
||||
// List<ProjectLibraryBase> resultTemp = new LinkedList<>();
|
||||
// for (ProjectLibraryBase projectLibraryBase : result) {
|
||||
// if(StringUtils.isBlank(projectLibraryBase.getParentId())){
|
||||
// resultTemp.add(projectLibraryBase);
|
||||
// }
|
||||
// }
|
||||
|
||||
for (ProjectLibraryBase projectLibraryBase : resultNew) {
|
||||
//子项目
|
||||
List<ProjectLibraryBase> children = result.stream()
|
||||
.filter(e -> StringUtils.isNotBlank(e.getParentId()) && projectLibraryBase.getId().equals(e.getParentId())).collect(Collectors.toList());
|
||||
if(children.size() != 0){
|
||||
//子项目的基础上添加的子项目
|
||||
List<String> childrenIdList = children.stream().map(ProjectLibraryBase::getId).distinct().collect(Collectors.toList());
|
||||
List<ProjectLibraryBase> childrenList = result.stream()
|
||||
.filter(e -> StringUtils.isNotBlank(e.getParentId()) && childrenIdList.contains(e.getParentId())).collect(Collectors.toList());
|
||||
children.addAll(childrenList);
|
||||
|
||||
//按版本排序
|
||||
Collections.sort(children);
|
||||
projectLibraryBase.setChildren(children);
|
||||
//最后一个版本号(主项目和主项目都需要设置)
|
||||
String versionLast = children.get(children.size() - 1).getProjectVersion();
|
||||
//主版本设置最后一个版本号(用于项目扩展中的版本号)
|
||||
projectLibraryBase.setVersionLast(versionLast);
|
||||
for (ProjectLibraryBase child : children) {
|
||||
//每个子版本版本设置最后一个版本号(用于项目扩展中的版本号)
|
||||
child.setVersionLast(versionLast);
|
||||
}
|
||||
}
|
||||
}
|
||||
return resultNew;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private List<ProjectLibraryBase> getProjectLibraryBases(List<ProjectLibraryBase> result, List<ProjectLibraryBase> projectLibraryBaseListParent) {
|
||||
//result中的主项目以及子项目对应的主项目
|
||||
List<ProjectLibraryBase> resultParent = new LinkedList<>();
|
||||
for (ProjectLibraryBase projectLibraryBase : result) {
|
||||
if(StringUtils.isBlank(projectLibraryBase.getParentId())){
|
||||
resultParent.add(projectLibraryBase);
|
||||
}else{
|
||||
//子项目
|
||||
List<ProjectLibraryBase> collect = result.stream()
|
||||
.filter(e -> projectLibraryBase.getId().equals(e.getParentId()))
|
||||
.collect(Collectors.toList());
|
||||
if(ObjectUtils.isNotEmpty(collect)){
|
||||
resultParent.addAll(collect);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//搜索结果中子项目的子项目
|
||||
List<ProjectLibraryBase> resultChild = new ArrayList<>();
|
||||
//所有子项目
|
||||
List<ProjectLibraryBase> childrenListTemp = result.stream().filter(e -> StringUtils.isNotBlank(e.getParentId())).collect(Collectors.toList());
|
||||
List<String> childrenIdListTemp = childrenListTemp.stream().map(ProjectLibraryBase::getId).collect(Collectors.toList());
|
||||
|
||||
//子项目的子项目
|
||||
List<ProjectLibraryBase> collect3 = result.stream().filter(e -> StringUtils.isNotBlank(e.getParentId()) && childrenIdListTemp.contains(e.getParentId())).collect(Collectors.toList());
|
||||
|
||||
if(ObjectUtils.isNotEmpty(collect3)){
|
||||
//子项目的子项目的父id
|
||||
List<String> childList = collect3.stream().map(ProjectLibraryBase::getParentId).collect(Collectors.toList());
|
||||
//子项目
|
||||
resultChild = childrenListTemp.stream().filter(e -> childList.contains(e.getId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
//所有的主项目与通过筛选条件查询来的主项目进行过滤
|
||||
List<ProjectLibraryBase> resultNew = new LinkedList<>();
|
||||
//主项目
|
||||
List<ProjectLibraryBase> collect1 = result.stream().filter(e -> StringUtils.isBlank(e.getParentId())).collect(Collectors.toList());
|
||||
resultNew.addAll(collect1);
|
||||
for (ProjectLibraryBase projectLibraryBase : projectLibraryBaseListParent) {
|
||||
//子项目
|
||||
List<ProjectLibraryBase> collect = result.stream().filter(e -> projectLibraryBase.getId().equals(e.getParentId())).collect(Collectors.toList());
|
||||
if(ObjectUtils.isNotEmpty(collect)){
|
||||
resultNew.add(projectLibraryBase);
|
||||
}
|
||||
//子项目的子项目
|
||||
if(ObjectUtils.isNotEmpty(resultChild)){
|
||||
List<ProjectLibraryBase> collect2 = resultChild.stream().filter(e -> e.getParentId().equals(projectLibraryBase.getId())).collect(Collectors.toList());
|
||||
if(ObjectUtils.isNotEmpty(collect2)){
|
||||
resultNew.add(projectLibraryBase);
|
||||
}
|
||||
}
|
||||
}
|
||||
resultNew = resultNew.stream().distinct().collect(Collectors.toList());
|
||||
return resultNew;
|
||||
}
|
||||
// /**
|
||||
// * 分页列表查询
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// @Override
|
||||
// public List<ProjectLibraryBase> queryPageList(Map<String,Object> params) {
|
||||
// List<ProjectLibraryBase> result = projectLibraryBaseMapper.queryPageList(params);
|
||||
// disposeData(result,"",false);
|
||||
// //目标市场
|
||||
// List<DictModel> targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
|
||||
//
|
||||
// for(ProjectLibraryBase projectLibraryBase: result){
|
||||
// //目标市场
|
||||
// String targetMarket = getMarket(params, targetMarketList, projectLibraryBase);
|
||||
// //主项目的版本号
|
||||
// String projectVersion = "";
|
||||
// if(StringUtils.isBlank(projectLibraryBase.getParentId())){
|
||||
// projectVersion = "00";
|
||||
// }else{
|
||||
// projectVersion = projectLibraryBase.getProjectVersion();
|
||||
// }
|
||||
// if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){
|
||||
// projectLibraryBase.setProjectName(projectLibraryBase.getProjectName()
|
||||
// + "-" + projectLibraryBase.getYearName()
|
||||
// + "-" + targetMarket
|
||||
// + "-" + projectVersion);
|
||||
// }
|
||||
// }
|
||||
// //项目名称模糊查询特殊处理(因为项目名称是多字段拼接的)
|
||||
// if(ObjectUtils.isNotEmpty(params.get("projectName"))){
|
||||
// result = result.stream().filter(e->e.getProjectName().toLowerCase().contains(String.valueOf(params.get("projectName")).toLowerCase())).collect(Collectors.toList());
|
||||
// }
|
||||
// //数据组装
|
||||
// List<ProjectLibraryBase> resultTemp = new LinkedList<>();
|
||||
// for (ProjectLibraryBase projectLibraryBase : result) {
|
||||
// if(StringUtils.isBlank(projectLibraryBase.getParentId())){
|
||||
// resultTemp.add(projectLibraryBase);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// for (ProjectLibraryBase projectLibraryBase : resultTemp) {
|
||||
// //子项目
|
||||
// List<ProjectLibraryBase> children = result.stream()
|
||||
// .filter(e -> StringUtils.isNotBlank(e.getParentId()) && projectLibraryBase.getId().equals(e.getParentId())).collect(Collectors.toList());
|
||||
// if(children.size() != 0){
|
||||
// //子项目的基础上添加的子项目
|
||||
// List<String> childrenIdList = children.stream().map(ProjectLibraryBase::getId).distinct().collect(Collectors.toList());
|
||||
// List<ProjectLibraryBase> childrenList = result.stream()
|
||||
// .filter(e -> StringUtils.isNotBlank(e.getParentId()) && childrenIdList.contains(e.getParentId())).collect(Collectors.toList());
|
||||
// children.addAll(childrenList);
|
||||
//
|
||||
// //按版本排序
|
||||
// Collections.sort(children);
|
||||
// projectLibraryBase.setChildren(children);
|
||||
// //最后一个版本号(主项目和主项目都需要设置)
|
||||
// String versionLast = children.get(children.size() - 1).getProjectVersion();
|
||||
// //主版本设置最后一个版本号(用于项目扩展中的版本号)
|
||||
// projectLibraryBase.setVersionLast(versionLast);
|
||||
// for (ProjectLibraryBase child : children) {
|
||||
// //每个子版本版本设置最后一个版本号(用于项目扩展中的版本号)
|
||||
// child.setVersionLast(versionLast);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return resultTemp;
|
||||
// }
|
||||
|
||||
private String getMarket(Map<String, Object> params, List<DictModel> targetMarketList, ProjectLibraryBase projectLibraryBase) {
|
||||
List<DictModel> dictModelList = new ArrayList<>();
|
||||
for (String s : projectLibraryBase.getTargetMarket().split(",")) {
|
||||
List<DictModel> dictModelListTemp = targetMarketList.stream()
|
||||
.filter(e -> s.equals(e.getValue())).collect(Collectors.toList());
|
||||
dictModelList.addAll(dictModelListTemp);
|
||||
}
|
||||
String targetMarket = "";
|
||||
if(dictModelList.size() != 0){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (DictModel dictModel : dictModelList) {
|
||||
if(CutEnum.CN.getValue().equals(params.get("cut"))){
|
||||
sb.append(dictModel.getText()+",");
|
||||
}else{
|
||||
sb.append(dictModel.getTextEn()+",");
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotBlank(sb)){
|
||||
targetMarket = sb.substring(0,sb.length()-1);
|
||||
}
|
||||
}
|
||||
return targetMarket;
|
||||
}
|
||||
|
||||
public Page getPages(Integer currentPage, Integer pageSize, List<ProjectLibraryBase> list){
|
||||
Page page =new Page();
|
||||
if(list==null){
|
||||
return null;
|
||||
}
|
||||
int size = list.size();
|
||||
if(pageSize > size){
|
||||
pageSize = size;
|
||||
}
|
||||
if(pageSize!=0){
|
||||
//求出最⼤页数,防⽌currentPage越界
|
||||
int maxPage = size % pageSize ==0? size / pageSize : size / pageSize +1;
|
||||
if(currentPage > maxPage){
|
||||
currentPage = maxPage;
|
||||
}
|
||||
}
|
||||
//当前页第⼀条数据的下标
|
||||
int curIdx = currentPage >1?(currentPage -1)* pageSize :0;
|
||||
List pageList =new ArrayList();
|
||||
//将当前页的数据放进pageList
|
||||
for(int i =0; i < pageSize && curIdx + i < size; i++){
|
||||
pageList.add(list.get(curIdx + i));
|
||||
}
|
||||
page.setCurrent(currentPage).setSize(pageSize).setTotal(list.size()).setRecords(pageList);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
// /**
|
||||
// * 分页列表查询
|
||||
// *
|
||||
// * @return
|
||||
// */
|
||||
// @Override
|
||||
// public IPage<ProjectLibraryBase> queryPageList(Map<String,Object> params) {
|
||||
// Integer pageNo = Integer.parseInt(params.get("pageNo").toString());
|
||||
// Integer pageSize = Integer.parseInt(params.get("pageSize").toString());
|
||||
// IPage page = new Page(pageNo, pageSize);
|
||||
// IPage<ProjectLibraryBase> result = projectLibraryBaseMapper.queryPageList(page, params);
|
||||
// List<ProjectLibraryBase> records = result.getRecords();
|
||||
// disposeData(records,"",false);
|
||||
// for(ProjectLibraryBase projectLibraryBase: records){
|
||||
// if(StringUtils.isNotBlank(projectLibraryBase.getYearName())){
|
||||
// projectLibraryBase.setProjectName(projectLibraryBase.getProjectName() + "-" + projectLibraryBase.getYearName());
|
||||
// }
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void disposeData(List<ProjectLibraryBase> records,String cut,boolean disposeTargetMarketFlag) {
|
||||
List<DictModel> targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
|
||||
@@ -474,7 +858,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
||||
result.put("taskToConfirmMap",taskToConfirmMap);
|
||||
|
||||
QueryWrapper<ProjectLawsInventoryEO> lawsInventoryEOQueryWrapper = new QueryWrapper<>();
|
||||
lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,id);
|
||||
lawsInventoryEOQueryWrapper.lambda().in(ProjectLawsInventoryEO::getProjectLibraryId,Arrays.asList(id.split(",")));
|
||||
//lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getInventoryAffirmStatus, InventoryAffirmStatusEnum.ACCEPTED.getValue());
|
||||
//lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getTaskAffirmStatus, TaskAffirmStatusEnum.ACCEPTED.getValue());
|
||||
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(lawsInventoryEOQueryWrapper);
|
||||
@@ -555,6 +939,117 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
||||
|
||||
return result;
|
||||
}
|
||||
// @Override
|
||||
// public Map<String, Object> getProjectDetailsStatistics(String id) {
|
||||
// Map<String,Object> result = new HashMap<>();
|
||||
//
|
||||
// //当前项目状态
|
||||
// Map<String,Object> currentProjectStatusMap = new HashMap<>();
|
||||
// //清单确认
|
||||
// Map<String,Object> listingToConfirmMap = new HashMap<>();
|
||||
// //任务确认
|
||||
// Map<String,Object> taskToConfirmMap = new HashMap<>();
|
||||
// //设计符合性
|
||||
// Map<String,Object> designComplianceMap = new HashMap<>();
|
||||
// //prehomo确认
|
||||
// Map<String,Object> prehomoMap = new HashMap<>();
|
||||
// //验证符合性
|
||||
// Map<String,Object> verifyComplianceMap = new HashMap<>();
|
||||
// //认证进度
|
||||
// Map<String,Object> certificationProgressMap = new HashMap<>();
|
||||
//
|
||||
// //清单确认统计
|
||||
// List<Map<String,Object>> listingToConfirmMapList = this.projectLawsInventoryEOMapper.getlistingToConfirmStatistics(id);
|
||||
// listingToConfirmMap.put("listingToConfirmMapList",listingToConfirmMapList);
|
||||
// result.put("listingToConfirmMap",listingToConfirmMap);
|
||||
//
|
||||
// //任务确认统计
|
||||
// List<Map<String,Object>> taskToConfirmMapList = this.projectLawsInventoryEOMapper.getTaskToConfirmStatistics(id);
|
||||
// taskToConfirmMap.put("taskToConfirmMapList",taskToConfirmMapList);
|
||||
// result.put("taskToConfirmMap",taskToConfirmMap);
|
||||
//
|
||||
// QueryWrapper<ProjectLawsInventoryEO> lawsInventoryEOQueryWrapper = new QueryWrapper<>();
|
||||
// lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getProjectLibraryId,id);
|
||||
// //lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getInventoryAffirmStatus, InventoryAffirmStatusEnum.ACCEPTED.getValue());
|
||||
// //lawsInventoryEOQueryWrapper.lambda().eq(ProjectLawsInventoryEO::getTaskAffirmStatus, TaskAffirmStatusEnum.ACCEPTED.getValue());
|
||||
// List<ProjectLawsInventoryEO> projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(lawsInventoryEOQueryWrapper);
|
||||
// if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){
|
||||
// List<String> projectLawsInventoryIdList = projectLawsInventoryEOList.stream().distinct().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList());
|
||||
//
|
||||
// //当前项目状态统计 获取一个 最差的结果 统计的数据 就是studio看到的数据。
|
||||
// List<Map<String,Object>> currentProjectStatusMapList = new ArrayList<>();
|
||||
// CurrentProjectStatusEnum[] values = CurrentProjectStatusEnum.values();
|
||||
// for (CurrentProjectStatusEnum value : values) {
|
||||
// Map<String,Object> map = new HashMap<>();
|
||||
// map.put("color",value.getValue());
|
||||
// currentProjectStatusMapList.add(map);
|
||||
// }
|
||||
// int currentProjectStatusTotal;
|
||||
// List<ConditionAssessmentEO> projectStatusAssessList = this.conditionAssessmentEOService.getProjectStatusAssessList(projectLawsInventoryIdList);
|
||||
//
|
||||
// for (Map<String, Object> map : currentProjectStatusMapList) {
|
||||
// List<ConditionAssessmentEO> collect = projectStatusAssessList.stream().filter(
|
||||
// projectStatusAssess -> StringUtils.equals(projectStatusAssess.getConditionAssessment(),map.get("color").toString())
|
||||
// ).collect(Collectors.toList());
|
||||
// map.put("conditionAssessmentCount",collect.size());
|
||||
// }
|
||||
//
|
||||
// currentProjectStatusTotal = currentProjectStatusMapList.stream().filter(
|
||||
// currentProjectStatus -> Integer.parseInt(currentProjectStatus.get("conditionAssessmentCount").toString()) != 0
|
||||
// ).mapToInt(currentProjectStatus -> Integer.parseInt(currentProjectStatus.get("conditionAssessmentCount").toString())).sum();
|
||||
//
|
||||
// currentProjectStatusMap.put("currentProjectStatusMapList",currentProjectStatusMapList);
|
||||
// currentProjectStatusMap.put("currentProjectStatusTotal",currentProjectStatusTotal);
|
||||
// result.put("currentProjectStatusMap",currentProjectStatusMap);
|
||||
//
|
||||
// //设计符合性
|
||||
// List<Map<String,Object>> designComplianceMapList = this.projectTaskInventoryEOMapper.getDesignComplianceStatistice(projectLawsInventoryIdList);
|
||||
// designComplianceMap.put("designComplianceMapList",designComplianceMapList);
|
||||
// result.put("designComplianceMap",designComplianceMap);
|
||||
//
|
||||
// //prehomo确认
|
||||
// List<Map<String,Object>> prehomoMapList = this.projectTaskInventoryEOMapper.getPrehomoStatistice(projectLawsInventoryIdList);
|
||||
// prehomoMap.put("prehomoMapList",prehomoMapList);
|
||||
// result.put("prehomoMap",prehomoMap);
|
||||
//
|
||||
// //验证符合性
|
||||
// List<Map<String,Object>> verifyComplianceMapList = this.projectTaskInventoryEOMapper.getVerifyComplianceStatistice(projectLawsInventoryIdList);
|
||||
// verifyComplianceMap.put("verifyComplianceMapList",verifyComplianceMapList);
|
||||
// result.put("verifyComplianceMap",verifyComplianceMap);
|
||||
//
|
||||
// //认证进度统计
|
||||
// int certificationProgressTotal;
|
||||
// List<Map<String,Object>> certificationProgressMapList = this.projectTaskInventoryEOMapper.getCertificationProgressStatistics(projectLawsInventoryIdList);
|
||||
// certificationProgressTotal = certificationProgressMapList.stream().filter(
|
||||
// certificationProgress -> Integer.parseInt(certificationProgress.get("certificationProgressCount").toString()) != 0
|
||||
// ).mapToInt(certificationProgress -> Integer.parseInt(certificationProgress.get("certificationProgressCount").toString())).sum();
|
||||
//
|
||||
// CertificationProgressEnum[] CertificationProgressEnumValues = CertificationProgressEnum.values();
|
||||
// for (CertificationProgressEnum certificationProgressEnumValue : CertificationProgressEnumValues) {
|
||||
// boolean flag = true;
|
||||
// for (Map<String, Object> map : certificationProgressMapList) {
|
||||
// if(map.get("certificationProgress") != null){
|
||||
// if(StringUtils.equals(certificationProgressEnumValue.getValue(),map.get("certificationProgress").toString())){
|
||||
// flag = false;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if(flag){
|
||||
// Map<String,Object> map = new HashMap<>();
|
||||
// map.put("certificationProgress",certificationProgressEnumValue.getValue());
|
||||
// map.put("certificationProgressCount",0);
|
||||
// certificationProgressMapList.add(map);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// certificationProgressMap.put("certificationProgressTotal",certificationProgressTotal);
|
||||
// certificationProgressMap.put("certificationProgressMapList",certificationProgressMapList);
|
||||
// result.put("certificationProgressMap",certificationProgressMap);
|
||||
// }
|
||||
//
|
||||
// return result;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 项目详情-统计接口-根据领域分组
|
||||
@@ -761,6 +1256,64 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void top(String id, String flag) {
|
||||
ProjectLibraryBase projectLibraryBase = this.getById(id);
|
||||
//置顶的时候将取消置顶标识传过来即:flag=1
|
||||
if(TopEnum.TOP_CANCEL.getValue().equals(flag)){
|
||||
//置顶
|
||||
LambdaQueryWrapper<ProjectLibraryBase> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.isNotNull(ProjectLibraryBase::getSort).orderByDesc(ProjectLibraryBase::getSort);
|
||||
List<ProjectLibraryBase> list = this.list(wrapper);
|
||||
if(list.size() != 0){
|
||||
String sort = list.get(list.size() - 1).getSort();
|
||||
int sortTemp = Integer.valueOf(sort) + 1;
|
||||
projectLibraryBase.setSort(String.valueOf(sortTemp));
|
||||
}else{
|
||||
//首个置顶的项目排序为1
|
||||
projectLibraryBase.setSort("1");
|
||||
}
|
||||
projectLibraryBase.setFlag(TopEnum.TOP_CANCEL.getValue());
|
||||
this.updateById(projectLibraryBase);
|
||||
|
||||
}else{
|
||||
//取消置顶
|
||||
LambdaUpdateWrapper<ProjectLibraryBase> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.in(ProjectLibraryBase::getId,id);
|
||||
updateWrapper.set(ProjectLibraryBase::getSort,null).set(ProjectLibraryBase::getFlag,null);
|
||||
this.update(projectLibraryBase,updateWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getVersionsInfo(String id) {
|
||||
LambdaUpdateWrapper<ProjectLibraryBase> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.in(ProjectLibraryBase::getId,id).or().in(ProjectLibraryBase::getParentId,id);
|
||||
List<ProjectLibraryBase> list = this.list(wrapper);
|
||||
List<String> result = new ArrayList<>();
|
||||
if(list.size() != 0){
|
||||
result = list.stream().map(ProjectLibraryBase::getProjectVersion).collect(Collectors.toList());
|
||||
Collections.sort(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 版本统计
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ProjectLibraryBase> versionStatistics(String id) {
|
||||
LambdaUpdateWrapper<ProjectLibraryBase> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.in(ProjectLibraryBase::getId,id).or().in(ProjectLibraryBase::getParentId,id);
|
||||
List<ProjectLibraryBase> list = this.list(wrapper);
|
||||
if(list.size() != 0){
|
||||
Collections.sort(list);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+5
-1
@@ -31,6 +31,7 @@ import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.util.StringUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
@@ -856,7 +857,10 @@ public class ProjectRelatedPersonnelServiceImpl extends ServiceImpl<ProjectRelat
|
||||
ProjectRelatedPersonnel projectRelatedPersonnel = new ProjectRelatedPersonnel();
|
||||
|
||||
//责任领域不能为空
|
||||
String dutyTerritory = row.getCell(0).toString();
|
||||
String dutyTerritory = "";
|
||||
if(ObjectUtils.isNotEmpty(row.getCell(0))){
|
||||
dutyTerritory = row.getCell(0).toString();
|
||||
}
|
||||
if(StringUtils.isNotBlank(dutyTerritory)) {
|
||||
projectRelatedPersonnel.setDutyTerritory(row.getCell(0).toString());
|
||||
}else{//责任领域不能为空,报错
|
||||
|
||||
+174
-49
@@ -3,17 +3,25 @@ package com.jero.modules.project.service.impl;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.constant.enums.MessageType2Enum;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.constant.enums.MsgColorEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsg2Vo;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.project.entity.*;
|
||||
import com.jero.modules.project.enums.JumpLinkEnum;
|
||||
import com.jero.modules.project.enums.MsgTypeEnum;
|
||||
import com.jero.modules.project.enums.SendMsgFlagEnum;
|
||||
import com.jero.modules.project.enums.TaskStatusEnum;
|
||||
import com.jero.modules.project.mapper.*;
|
||||
import com.jero.modules.project.service.IFeedbackHistoryService;
|
||||
import com.jero.modules.project.service.IProjectTaskInventoryDetailEOService;
|
||||
@@ -21,6 +29,8 @@ import com.jero.modules.project.service.IProjectTaskInventoryFeedbackEOService;
|
||||
import com.jero.modules.project.util.SendMessageUtils;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO;
|
||||
import com.jero.modules.todoCenter.service.IProcessInfoDetailEOService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
@@ -28,6 +38,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -61,9 +73,17 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
|
||||
@Autowired
|
||||
private IFeedbackHistoryService feedbackHistoryService;
|
||||
|
||||
@Autowired
|
||||
private IProcessInfoDetailEOService processInfoDetailEOService;
|
||||
|
||||
@Value(value = "${jero.backUrl}")
|
||||
private String backUrl;
|
||||
|
||||
@Autowired
|
||||
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||
@Autowired
|
||||
private IFeishuService feishuService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
@@ -106,6 +126,7 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
|
||||
}else {
|
||||
String id = UUID.randomUUID().toString().replace("-", "");
|
||||
projectTaskInventoryDetail.setId(id);
|
||||
projectTaskInventoryDetail.setTaskId(UUID.randomUUID().toString().replace("-", ""));
|
||||
projectTaskInventoryDetailEOAddList.add(projectTaskInventoryDetail);
|
||||
}
|
||||
}
|
||||
@@ -115,6 +136,7 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
|
||||
List<String> createByList = new ArrayList<>();
|
||||
|
||||
List<ProjectTaskInventoryFeedbackEO> projectTaskInventoryFeedbackEOList = new ArrayList<>();
|
||||
List<ProcessInfoDetailEO> processInfoDetailEOList = new ArrayList<>();
|
||||
|
||||
String serialNumber = projectTaskInventoryFeedbackEOService.createSerialNumber();
|
||||
for (ProjectTaskInventoryDetailEO projectTaskInventoryDetailEO : projectTaskInventoryDetailEOAddList) {
|
||||
@@ -138,6 +160,17 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
|
||||
|
||||
long number = Long.parseLong(serialNumber) + 1;
|
||||
serialNumber = String.valueOf(number);
|
||||
|
||||
ProcessInfoDetailEO processInfoDetailEO = new ProcessInfoDetailEO();
|
||||
processInfoDetailEO.setActiProcInstId(projectTaskInventoryDetailEO.getActiProcInstId());
|
||||
processInfoDetailEO.setUserId(projectTaskInventoryDetailEO.getUserId());
|
||||
processInfoDetailEO.setTaskDefinitionKey(projectTaskInventoryDetailEO.getTaskDefinitionKey());
|
||||
processInfoDetailEO.setProjectLawsInventoryId(projectTaskInventoryDetailEO.getProjectTaskInventoryId());
|
||||
processInfoDetailEO.setStatus(TaskStatusEnum.NOT_DONE.getValue());
|
||||
processInfoDetailEO.setProcessInfoId(projectTaskInventoryDetailEO.getActiProcInstId());
|
||||
processInfoDetailEO.setFlowType(projectTaskInventoryDetailEO.getFlowType());
|
||||
processInfoDetailEO.setTaskId(projectTaskInventoryDetailEO.getTaskId());
|
||||
processInfoDetailEOList.add(processInfoDetailEO);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,6 +189,9 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
|
||||
this.baseMapper.delete(deleteWrapper);
|
||||
|
||||
super.saveBatch(projectTaskInventoryDetailEOAddList);
|
||||
|
||||
this.processInfoDetailEOService.batchInsertDreUserTask(processInfoDetailEOList);
|
||||
|
||||
//获取没有发送过消息的用户
|
||||
List<String> sendUserIdList = projectTaskInventoryDetailEOAddList.stream().filter(e -> {
|
||||
boolean flag = true;
|
||||
@@ -195,6 +231,17 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
|
||||
Date now = new Date();
|
||||
projectTaskInventoryDetailEO.setUpdateTime(now);
|
||||
this.baseMapper.updateById(projectTaskInventoryDetailEO);
|
||||
//如果是责任人 确认、取消确认操作。
|
||||
if(StringUtils.equals(projectTaskInventoryDetailEO.getStatus(),TaskStatusEnum.HAVE_DONE.getValue())
|
||||
|| StringUtils.equals(projectTaskInventoryDetailEO.getStatus(),TaskStatusEnum.NOT_DONE.getValue())){
|
||||
ProjectTaskInventoryDetailEO taskInventoryDetailById = this.baseMapper.selectById(projectTaskInventoryDetailEO.getId());
|
||||
if(taskInventoryDetailById != null){
|
||||
LambdaUpdateWrapper<ProcessInfoDetailEO> processInfoDetailUpdateWrap= new LambdaUpdateWrapper();
|
||||
processInfoDetailUpdateWrap.eq(ProcessInfoDetailEO::getTaskId,taskInventoryDetailById.getTaskId());
|
||||
processInfoDetailUpdateWrap.set(ProcessInfoDetailEO::getStatus,projectTaskInventoryDetailEO.getStatus());
|
||||
this.processInfoDetailEOService.update(processInfoDetailUpdateWrap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -205,8 +252,9 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
QueryWrapper<ProjectTaskInventoryFeedbackEO> queryWrapper = new QueryWrapper<>();
|
||||
ProjectTaskInventoryDetailEO projectTaskInventoryDetailEO = this.baseMapper.selectById(id);
|
||||
removeById(id);
|
||||
QueryWrapper<ProjectTaskInventoryFeedbackEO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(ProjectTaskInventoryFeedbackEO::getProjectTaskInventoryId,id);
|
||||
List<ProjectTaskInventoryFeedbackEO> list = this.projectTaskInventoryFeedbackEOService.list(queryWrapper);
|
||||
if(CollectionUtils.isNotEmpty(list)){
|
||||
@@ -216,6 +264,12 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
|
||||
historyDeleteWrapper.lambda().in(FeedbackHistory::getFeedbackId,projectTaskInventoryFeedbackIdList);
|
||||
this.feedbackHistoryService.remove(historyDeleteWrapper);
|
||||
}
|
||||
if(!Objects.isNull(projectTaskInventoryDetailEO)){
|
||||
//删除待办中心待办数据
|
||||
QueryWrapper<ProcessInfoDetailEO> processInfoDetailRemoveWrap = new QueryWrapper<>();
|
||||
processInfoDetailRemoveWrap.lambda().eq(ProcessInfoDetailEO::getTaskId,projectTaskInventoryDetailEO.getTaskId());
|
||||
this.processInfoDetailEOService.remove(processInfoDetailRemoveWrap);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -300,61 +354,113 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
|
||||
projectYearInfoEOQueryWrapper.lambda().eq(ProjectYearNameInfoEO::getId,projectLibraryBase.getYearNameId());
|
||||
ProjectYearNameInfoEO projectYearNameInfoEO = projectYearNameInfoEOMapper.selectOne(projectYearInfoEOQueryWrapper);
|
||||
|
||||
String id = UUID.randomUUID().toString().replace("-", "");
|
||||
//String id = UUID.randomUUID().toString().replace("-", "");
|
||||
|
||||
MessageTypeEnum messageTypeEnum = null;
|
||||
String msgContentEN = "";
|
||||
//MessageTypeEnum messageTypeEnum = null;
|
||||
//String msgContentEN = "";
|
||||
String msgTitle = "";
|
||||
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
String cnContentUpper = "";//中文上部分
|
||||
String cnContentLower = "";//中文下部分
|
||||
String enContentUpper = "";//英文上部分
|
||||
String enContentLower = "";//英文下部分
|
||||
|
||||
//项目名称
|
||||
String projectVersion = (com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getParentId()) && com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getProjectVersion())) ? "00" : projectLibraryBase.getProjectVersion();
|
||||
String projectName = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" + projectLibraryBase.getTargetMarket() + "-" + projectVersion;
|
||||
//法规中英文
|
||||
String LAW_CN = projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle();//法规
|
||||
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId());
|
||||
String LAW_EN = projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn();//法规
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
//FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
//给工程师下发消息
|
||||
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.
|
||||
msgContentEN = currentUser.getUsername() + " has assigned the design compliance confirmation process of "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ " to you. Please check and handle it in time.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a design compliance task to complete";
|
||||
//msgContentEN = currentUser.getUsername() + " has assigned the design compliance confirmation process of "
|
||||
// + projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
// + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + " to you. Please check and handle it in time.";
|
||||
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + ": You have a design compliance task to complete";
|
||||
|
||||
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());
|
||||
//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());
|
||||
|
||||
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
|
||||
msgTitle = MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getEn();
|
||||
cnContentUpper = "您好,"+ currentUser.getUsername() +"向您分发了该任务,请及时查看处理";
|
||||
cnContentLower = "项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: " + currentUser.getUsername() +
|
||||
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
|
||||
enContentUpper = "Hello! "+ currentUser.getUsername() +" has assigned the task to you. Please check and address the task in a timely manner.";
|
||||
enContentLower = "Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + currentUser.getUsername() +
|
||||
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
|
||||
|
||||
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
}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.
|
||||
msgContentEN = currentUser.getUsername() + " has assigned the Pre-Homo confirmation process of "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ " to you. Please check and handle it in time.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a Pre-Homo task to complete";
|
||||
//msgContentEN = currentUser.getUsername() + " has assigned the Pre-Homo confirmation process of "
|
||||
// + projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
// + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + " to you. Please check and handle it in time.";
|
||||
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + ": You have a Pre-Homo task to complete";
|
||||
|
||||
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());
|
||||
//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());
|
||||
|
||||
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
|
||||
msgTitle = MessageType2Enum.PRE_HOMO_CONFIRMATION.getCn() + "/" + MessageType2Enum.PRE_HOMO_CONFIRMATION.getEn();
|
||||
cnContentUpper = "您好,"+ currentUser.getUsername() +"向您分发了该任务,请及时查看处理";
|
||||
cnContentLower = "项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: " + currentUser.getUsername() +
|
||||
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
|
||||
enContentUpper = "Hello! "+ currentUser.getUsername() +" has assigned the task to you. Please check and address the task in a timely manner.";
|
||||
enContentLower = "Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + currentUser.getUsername() +
|
||||
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
|
||||
|
||||
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
}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.
|
||||
msgContentEN = currentUser.getUsername() + " has assigned the validation compliance confirmation process of "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ " to you. Please check and handle it in time.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a validation compliance task to complete";
|
||||
//msgContentEN = currentUser.getUsername() + " has assigned the validation compliance confirmation process of "
|
||||
// + projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
// + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + " to you. Please check and handle it in time.";
|
||||
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + ": You have a validation compliance task to complete";
|
||||
|
||||
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());
|
||||
//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());
|
||||
|
||||
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
|
||||
msgTitle = MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getEn();
|
||||
cnContentUpper = "您好,"+ currentUser.getUsername() +"向您分发了该任务,请及时查看处理";
|
||||
cnContentLower = "项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: " + currentUser.getUsername() +
|
||||
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
|
||||
enContentUpper = "Hello! "+ currentUser.getUsername() +" has assigned the task to you. Please check and address the task in a timely manner.";
|
||||
enContentLower = "Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + currentUser.getUsername() +
|
||||
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
|
||||
}
|
||||
if(CollectionUtils.isNotEmpty(userIdList) && org.apache.commons.lang3.StringUtils.isNotEmpty(msgContentEN)){
|
||||
if(CollectionUtils.isNotEmpty(userIdList) && org.apache.commons.lang3.StringUtils.isNotEmpty(msgTitle)){
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl
|
||||
+ JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink()
|
||||
@@ -362,17 +468,36 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
|
||||
+ JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName();
|
||||
//系统内部跳转链接
|
||||
String href = "<a href='"
|
||||
+ JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName()
|
||||
+ "'>" + " View details" + "</a>";
|
||||
String contentInfo = msgContentEN + " " + href;
|
||||
Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
//String href = "<a href='"
|
||||
// + JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
|
||||
// + "&projectName=" + projectNameInfoEO.getProjectName()
|
||||
// + "'>" + " View details" + "</a>";
|
||||
//String contentInfo = msgContentEN + " " + href;
|
||||
//Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
//sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
//sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
//SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
userIdList = userIdList.stream().distinct().collect(Collectors.toList());
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(msgTitle);
|
||||
feishuMsgVo.setCnContentUpper(cnContentUpper);
|
||||
feishuMsgVo.setCnContentLower(cnContentLower);
|
||||
feishuMsgVo.setEnContentUpper(enContentUpper);
|
||||
feishuMsgVo.setEnContentLower(enContentLower);
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+324
-99
@@ -6,10 +6,16 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.constant.enums.MessageType2Enum;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.constant.enums.MsgColorEnum;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsg2Vo;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.project.entity.*;
|
||||
import com.jero.modules.project.enums.*;
|
||||
@@ -24,6 +30,7 @@ import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.entity.SysUserRole;
|
||||
import com.jero.modules.system.mapper.SysUserMapper;
|
||||
import com.jero.modules.system.service.ISysUserRoleService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||
import com.jero.modules.wkflow.enums.DesignComplianceNodeEnum;
|
||||
import com.jero.modules.wkflow.enums.FlowTypeEnum;
|
||||
@@ -91,6 +98,12 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
@Value(value = "${jero.backUrl}")
|
||||
private String backUrl;
|
||||
|
||||
@Autowired
|
||||
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private IFeishuService feishuService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
@@ -380,58 +393,116 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
String dreUserIds = jsonObject.getString("dreUserIds"); //dre用户id
|
||||
userIdList.addAll(Arrays.asList(dreUserIds.split(",")));
|
||||
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
//FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
|
||||
String msgContentEN = "";
|
||||
//String msgContentEN = "";
|
||||
String msgTitle = "";
|
||||
MessageTypeEnum messageTypeEnum = null;
|
||||
//MessageTypeEnum messageTypeEnum = null;
|
||||
|
||||
String cnContentUpper = "";//中文上部分
|
||||
String cnContentLower = "";//中文下部分
|
||||
String enContentUpper = "";//英文上部分
|
||||
String enContentLower = "";//英文下部分
|
||||
|
||||
//项目名称
|
||||
String projectVersion = (com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getParentId()) && com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getProjectVersion())) ? "00" : projectLibraryBase.getProjectVersion();
|
||||
String projectName = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" + projectLibraryBase.getTargetMarket() + "-" + projectVersion;
|
||||
//法规中英文
|
||||
QueryWrapper<ProjectLawsInventoryEO> projectLawsInventoryEOQueryWrapper = new QueryWrapper<>();
|
||||
projectLawsInventoryEOQueryWrapper.eq("project_library_id", projectLibraryId).eq("serial_number", serialNumber);
|
||||
ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryEOMapper.selectOne(projectLawsInventoryEOQueryWrapper);
|
||||
String LAW_CN = projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle();//法规
|
||||
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId());
|
||||
String LAW_EN = projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn();//法规
|
||||
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
|
||||
if(StringUtils.equals(msgType,MsgTypeEnum.DESIGN_REMIND_MSG.getValue())){
|
||||
//Please check and deal with the design compliance confirmation process of GB 7258 in XXX (project name) in time.
|
||||
msgContentEN = "Please check and deal with the design compliance confirmation process of "
|
||||
+ serialNumber + " in "
|
||||
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ " in time.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a design compliance task to complete";
|
||||
//msgContentEN = "Please check and deal with the design compliance confirmation process of "
|
||||
// + serialNumber + " in "
|
||||
// + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + " in time.";
|
||||
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + ": You have a design compliance task to complete";
|
||||
|
||||
feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
|
||||
feishuMsgVo.setTaskType("Design Compliance Confirmation");
|
||||
feishuMsgVo.setRegulationNo(serialNumber);
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
//feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
|
||||
//feishuMsgVo.setTaskType("Design Compliance Confirmation");
|
||||
//feishuMsgVo.setRegulationNo(serialNumber);
|
||||
//feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
|
||||
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
|
||||
msgTitle = MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getEn();
|
||||
cnContentUpper = "您好,"+ currentUser.getUsername() +"向您分发了该任务,请尽快查看处理";
|
||||
cnContentLower = "项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: " + currentUser.getUsername() +
|
||||
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
|
||||
enContentUpper = "Hello! "+ currentUser.getUsername() +" has assigned the task to you. Please check and address the task ASAP";
|
||||
enContentLower = "Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + currentUser.getUsername() +
|
||||
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
|
||||
|
||||
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
}else if(StringUtils.equals(msgType,MsgTypeEnum.PREHOMO_REMIND_MSG.getValue())){
|
||||
//Please check and deal with the Pre-Homo confirmation process of GB 7258 in XXX (project name) in time.
|
||||
msgContentEN = "Please check and address the Pre-Homo confirmation process of "
|
||||
+ serialNumber + " in "+ projectNameInfoEO.getProjectName()
|
||||
+ " in time.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a Pre-Homo task to complete";
|
||||
//msgContentEN = "Please check and address the Pre-Homo confirmation process of "
|
||||
// + serialNumber + " in "+ projectNameInfoEO.getProjectName()
|
||||
// + " in time.";
|
||||
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + ": You have a Pre-Homo task to complete";
|
||||
|
||||
feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
|
||||
feishuMsgVo.setTaskType("Pre-Homo Confirmation");
|
||||
feishuMsgVo.setRegulationNo(serialNumber);
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
//feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
|
||||
//feishuMsgVo.setTaskType("Pre-Homo Confirmation");
|
||||
//feishuMsgVo.setRegulationNo(serialNumber);
|
||||
//feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
|
||||
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
|
||||
msgTitle = MessageType2Enum.PRE_HOMO_CONFIRMATION.getCn() + "/" + MessageType2Enum.PRE_HOMO_CONFIRMATION.getEn();
|
||||
cnContentUpper = "您好,"+ currentUser.getUsername() +"向您分发了该任务,请尽快查看处理";
|
||||
cnContentLower = "项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: " + currentUser.getUsername() +
|
||||
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
|
||||
enContentUpper = "Hello! "+ currentUser.getUsername() +" has assigned the task to you. Please check and address the task ASAP";
|
||||
enContentLower = "Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + currentUser.getUsername() +
|
||||
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
|
||||
|
||||
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
}else if(StringUtils.equals(msgType,MsgTypeEnum.VERIFY_REMIND_MSG.getValue())){
|
||||
//Please check and deal with the Verify compliance confirmation process of GB 7258 in XXX (project name) in time.
|
||||
msgContentEN = "Please check and address the validation compliance confirmation process of "
|
||||
+ serialNumber + " in "+ projectNameInfoEO.getProjectName()
|
||||
+ " in time.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a validation compliance task to complete";
|
||||
//msgContentEN = "Please check and address the validation compliance confirmation process of "
|
||||
// + serialNumber + " in "+ projectNameInfoEO.getProjectName()
|
||||
// + " in time.";
|
||||
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + ": You have a validation compliance task to complete";
|
||||
|
||||
feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
|
||||
feishuMsgVo.setTaskType("Validation Compliance Confirmation");
|
||||
feishuMsgVo.setRegulationNo(serialNumber);
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
//feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
|
||||
//feishuMsgVo.setTaskType("Validation Compliance Confirmation");
|
||||
//feishuMsgVo.setRegulationNo(serialNumber);
|
||||
//feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
|
||||
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
|
||||
msgTitle = MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getEn();
|
||||
cnContentUpper = "您好,"+ currentUser.getUsername() +"向您分发了该任务,请尽快查看处理";
|
||||
cnContentLower = "项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: " + currentUser.getUsername() +
|
||||
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
|
||||
enContentUpper = "Hello! "+ currentUser.getUsername() +" has assigned the task to you. Please check and address the task ASAP";
|
||||
enContentLower = "Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + currentUser.getUsername() +
|
||||
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
|
||||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgContentEN)){
|
||||
if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgTitle)){
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl
|
||||
@@ -441,20 +512,40 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
+ projectYearNameInfoEO.getYearName()
|
||||
+ "&targetMarket=" + projectLibraryBase.getTargetMarket();
|
||||
|
||||
userIdList = userIdList.stream().distinct().collect(Collectors.toList());
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(msgTitle);
|
||||
feishuMsgVo.setCnContentUpper(cnContentUpper);
|
||||
feishuMsgVo.setCnContentLower(cnContentLower);
|
||||
feishuMsgVo.setEnContentUpper(enContentUpper);
|
||||
feishuMsgVo.setEnContentLower(enContentLower);
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
//系统内部跳转链接
|
||||
String href = "<a href='"
|
||||
+ JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
+ projectYearNameInfoEO.getYearName()
|
||||
+ "&targetMarket=" + projectLibraryBase.getTargetMarket()
|
||||
+ "'>" + " View details" + "</a>";
|
||||
String contentInfo = msgContentEN + " " + href;
|
||||
Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
//String href = "<a href='"
|
||||
// + JumpLinkEnum.INVENTORY_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
|
||||
// + "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
// + projectYearNameInfoEO.getYearName()
|
||||
// + "&targetMarket=" + projectLibraryBase.getTargetMarket()
|
||||
// + "'>" + " View details" + "</a>";
|
||||
//String contentInfo = msgContentEN + " " + href;
|
||||
//Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
//sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
//sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
//SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
}
|
||||
return new Result<>().success("提醒办理成功!");
|
||||
}
|
||||
@@ -918,7 +1009,7 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
String personChargeFeedback = "";
|
||||
|
||||
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
//FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String dutDateStr = "";
|
||||
|
||||
@@ -926,90 +1017,138 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
String msgContentEN = "";
|
||||
String msgTitle = "";
|
||||
|
||||
String cnContentUpper = "";//中文上部分
|
||||
String cnContentLower = "";//中文下部分
|
||||
String enContentUpper = "";//英文上部分
|
||||
String enContentLower = "";//英文下部分
|
||||
|
||||
|
||||
//项目名称
|
||||
String projectVersion = (com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getParentId()) && com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBase.getProjectVersion())) ? "00" : projectLibraryBase.getProjectVersion();
|
||||
String PRN = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" + projectLibraryBase.getTargetMarket() + "-" + projectVersion;
|
||||
|
||||
String LAW_CN = projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle();//法规
|
||||
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId());
|
||||
String LAW_EN = projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn();//法规
|
||||
|
||||
if (StringUtils.equals(msgType, MsgTypeEnum.DESIGN_ISSUE_DRE_MSG.getValue())) {
|
||||
taskKey = DesignComplianceNodeEnum.DRE_DISPOSE.getKey();
|
||||
//taskKey = DesignComplianceNodeEnum.DRE_DISPOSE.getKey();
|
||||
|
||||
if(projectLawsInventoryEO.getDesignDueDate() != null){
|
||||
dutDateStr = sdf.format(projectLawsInventoryEO.getDesignDueDate());
|
||||
}
|
||||
|
||||
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.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a design compliance task to complete";
|
||||
|
||||
feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has assigned the task to you. Please check and handle it in time.");
|
||||
feishuMsgVo.setTaskType("Design Compliance Confirmation");
|
||||
|
||||
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
//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.";
|
||||
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + ": You have a design compliance task to complete";
|
||||
|
||||
//feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has assigned the task to you. Please check and handle it in time.");
|
||||
//feishuMsgVo.setTaskType("Design Compliance Confirmation");
|
||||
|
||||
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
}else if(StringUtils.equals(msgType, MsgTypeEnum.DESIGN_RETURN_MSG.getValue())){
|
||||
String designDutyId = jsonObject.getString("designDutyId");//设计符合性流程责任人id
|
||||
userIdList.add(designDutyId);
|
||||
|
||||
taskKey = DesignComplianceNodeEnum.THE_RESPONSIBLE_PERSON_HANDLES_THE_TASK.getKey();
|
||||
|
||||
//taskKey = DesignComplianceNodeEnum.THE_RESPONSIBLE_PERSON_HANDLES_THE_TASK.getKey();
|
||||
|
||||
if(projectLawsInventoryEO.getDesignDueDate() != null){
|
||||
dutDateStr = sdf.format(projectLawsInventoryEO.getDesignDueDate());
|
||||
}
|
||||
msgTitle = MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getEn();
|
||||
cnContentUpper = "您好,该任务被发起人审查退回,请及时查看处理";
|
||||
cnContentLower = "项目: " + PRN +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: " + sysUser.getUsername() +
|
||||
"\n截止时间: " + dutDateStr;
|
||||
enContentUpper = "Hello! The task has been rejected by initiator after review. Please check and address it in a timely manner";
|
||||
enContentLower = "Project: " + PRN +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + sysUser.getUsername() +
|
||||
"\nDue Date: " + dutDateStr;
|
||||
//msgContentEN = "The design compliance information of " + serialNumber + " in "
|
||||
// + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + " you sumitted has been rejected after review. Please check and address it in time.";
|
||||
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + ": You have a design compliance task to complete";
|
||||
|
||||
msgContentEN = "The design compliance information of " + serialNumber + " in "
|
||||
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ " you sumitted has been rejected after review. Please check and address it in time.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a design compliance task to complete";
|
||||
//feishuMsgVo.setContent("Hello! The compliance information you submitted has been rejected after review. Please check and address it in a timely manner.");
|
||||
//feishuMsgVo.setTaskType("Design Compliance Confirmation");
|
||||
|
||||
feishuMsgVo.setContent("Hello! The compliance information you submitted has been rejected after review. Please check and address it in a timely manner.");
|
||||
feishuMsgVo.setTaskType("Design Compliance Confirmation");
|
||||
|
||||
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
}else if(StringUtils.equals(msgType, MsgTypeEnum.PREHOMO_RETURN_MSG.getValue())){
|
||||
String prehomoDutyId = jsonObject.getString("prehomoDutyId");//prehomo流程责任人id
|
||||
userIdList.add(prehomoDutyId);
|
||||
|
||||
taskKey = DesignComplianceNodeEnum.THE_RESPONSIBLE_PERSON_HANDLES_THE_TASK.getKey();
|
||||
//taskKey = DesignComplianceNodeEnum.THE_RESPONSIBLE_PERSON_HANDLES_THE_TASK.getKey();
|
||||
|
||||
if(projectLawsInventoryEO.getPrehomoDueDate() != null){
|
||||
dutDateStr = sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
|
||||
}
|
||||
msgTitle = MessageType2Enum.PRE_HOMO_CONFIRMATION.getCn() + "/" + MessageType2Enum.PRE_HOMO_CONFIRMATION.getEn();
|
||||
cnContentUpper = "您好,该任务被发起人审查退回,请及时查看处理";
|
||||
cnContentLower = "项目: " + PRN +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: " + sysUser.getUsername() +
|
||||
"\n截止时间: " + dutDateStr;
|
||||
enContentUpper = "Hello! The task has been rejected by initiator after review. Please check and address it in a timely manner";
|
||||
enContentLower = "Project: " + PRN +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + sysUser.getUsername() +
|
||||
"\nDue Date: " + dutDateStr;
|
||||
|
||||
msgContentEN = "The Pre-Homo confirmation of " + serialNumber + " in "
|
||||
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ " you sumitted has been rejected after review. Please check and address it in time.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a Pre-Homo task to complete";
|
||||
//msgContentEN = "The Pre-Homo confirmation of " + serialNumber + " in "
|
||||
// + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + " you sumitted has been rejected after review. Please check and address it in time.";
|
||||
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + ": You have a Pre-Homo task to complete";
|
||||
|
||||
feishuMsgVo.setContent("Hello! The compliance information you submitted has been rejected after review. Please check and address it in a timely manner.");
|
||||
feishuMsgVo.setTaskType("Pre-Homo Confirmation");
|
||||
//feishuMsgVo.setContent("Hello! The compliance information you submitted has been rejected after review. Please check and address it in a timely manner.");
|
||||
//feishuMsgVo.setTaskType("Pre-Homo Confirmation");
|
||||
|
||||
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
}else if(StringUtils.equals(msgType, MsgTypeEnum.VERIFY_RETURN_MSG.getValue())){
|
||||
String verifyDutyId = jsonObject.getString("verifyDutyId");//验证符合性流程责任人id
|
||||
userIdList.add(verifyDutyId);
|
||||
|
||||
taskKey = DesignComplianceNodeEnum.THE_RESPONSIBLE_PERSON_HANDLES_THE_TASK.getKey();
|
||||
//taskKey = DesignComplianceNodeEnum.THE_RESPONSIBLE_PERSON_HANDLES_THE_TASK.getKey();
|
||||
|
||||
if(projectLawsInventoryEO.getVerifyDueDate() != null){
|
||||
dutDateStr = sdf.format(projectLawsInventoryEO.getVerifyDueDate());
|
||||
}
|
||||
msgTitle = MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getEn();
|
||||
cnContentUpper = "您好,该任务被发起人审查退回,请及时查看处理";
|
||||
cnContentLower = "项目: " + PRN +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: " + sysUser.getUsername() +
|
||||
"\n截止时间: " + dutDateStr;
|
||||
enContentUpper = "Hello! The task has been rejected by initiator after review. Please check and address it in a timely manner";
|
||||
enContentLower = "Project: " + PRN +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + sysUser.getUsername() +
|
||||
"\nDue Date: " + dutDateStr;
|
||||
//msgContentEN = "The validation compliance information of " + serialNumber + " in "
|
||||
// + projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + " you sumitted has been rejected after review. Please check and address it in time.";
|
||||
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
// + ": You have a validation compliance task to complete";
|
||||
|
||||
msgContentEN = "The validation compliance information of " + serialNumber + " in "
|
||||
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ " you sumitted has been rejected after review. Please check and address it in time.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
|
||||
+ ": You have a validation compliance task to complete";
|
||||
//feishuMsgVo.setContent("Hello! The compliance information you submitted has been rejected after review. Please check and address it in a timely manner.");
|
||||
//feishuMsgVo.setTaskType("Validation Compliance Confirmation");
|
||||
|
||||
feishuMsgVo.setContent("Hello! The compliance information you submitted has been rejected after review. Please check and address it in a timely manner.");
|
||||
feishuMsgVo.setTaskType("Validation Compliance Confirmation");
|
||||
|
||||
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
}
|
||||
/*55360问题。
|
||||
feishuMsgVo.setDueDate(dutDateStr);
|
||||
feishuMsgVo.setInitiator(sysUser.getUsername());
|
||||
*/
|
||||
feishuMsgVo.setRegulationNo(serialNumber);
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
//feishuMsgVo.setRegulationNo(serialNumber);
|
||||
//feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket());
|
||||
|
||||
|
||||
/*//根据流程实例id,查询待办id
|
||||
@@ -1065,7 +1204,7 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
personChargeFeedback = projectTaskInventoryEO.getVerifyPersonChargeFeedback();
|
||||
}*/
|
||||
|
||||
if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgContentEN)){
|
||||
if(CollectionUtils.isNotEmpty(userIdList) && StringUtils.isNotEmpty(msgTitle)){
|
||||
|
||||
//飞书跳转链接
|
||||
String hrefFeishu = backUrl
|
||||
@@ -1075,13 +1214,32 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
+ projectYearNameInfoEO.getYearName()
|
||||
+ projectLibraryBase.getTargetMarket();
|
||||
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(msgTitle);
|
||||
feishuMsgVo.setCnContentUpper(cnContentUpper);
|
||||
feishuMsgVo.setCnContentLower(cnContentLower);
|
||||
feishuMsgVo.setEnContentUpper(enContentUpper);
|
||||
feishuMsgVo.setEnContentLower(enContentLower);
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
//系统内部跳转链接
|
||||
String href = "<a href='"
|
||||
+ JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
+ projectYearNameInfoEO.getYearName()
|
||||
+ projectLibraryBase.getTargetMarket()
|
||||
+ "'>" + " View details" + "</a>";
|
||||
//String href = "<a href='"
|
||||
// + JumpLinkEnum.DESIGN_AFFIRM_LINK.getLink() + projectLibraryBase.getId() + JumpLinkEnum.DESIGN_AFFIRM_LINK.getType()
|
||||
// + "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
// + projectYearNameInfoEO.getYearName()
|
||||
// + projectLibraryBase.getTargetMarket()
|
||||
// + "'>" + " View details" + "</a>";
|
||||
|
||||
//飞书跳转链接 拼接跳转至任务详情页参数
|
||||
/*String hrefFeishu = backUrl
|
||||
@@ -1133,13 +1291,13 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
+ "&primaryKeyId=" + primaryKeyId
|
||||
+ "&PersonChargeFeedback=" + personChargeFeedback
|
||||
+ "'>" + " View details" + "</a>";*/
|
||||
String contentInfo = msgContentEN + " " + href;
|
||||
Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
//String contentInfo = msgContentEN + " " + href;
|
||||
//Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
//sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
//sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
//SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1301,6 +1459,73 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<?> disposeHistoryData(Map<String, Object> params) {
|
||||
List<ProjectTaskInventoryEO> projectTaskInventoryEOList = this.projectTaskInventoryEOService.list();
|
||||
|
||||
//获取没有任务清单数据的法规清单数据
|
||||
List<String> projectLawsInventoryIdList = projectTaskInventoryEOList.stream().map(ProjectTaskInventoryEO::getProjectLawsInventoryId).distinct().collect(Collectors.toList());
|
||||
QueryWrapper<ProjectLawsInventoryEO> lawsInventoryQueryWrap = new QueryWrapper<>();
|
||||
lawsInventoryQueryWrap.lambda().notIn(ProjectLawsInventoryEO::getId,projectLawsInventoryIdList);
|
||||
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = this.projectLawsInventoryEOService.list(lawsInventoryQueryWrap);
|
||||
|
||||
//如果有(没有任务清单数据的法规清单数据),进行历史数据处理
|
||||
if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){
|
||||
|
||||
List<String> projectLawsInventoryIds = projectLawsInventoryEOList.stream().map(ProjectLawsInventoryEO::getId).distinct().collect(Collectors.toList());
|
||||
|
||||
QueryWrapper<ProjectTaskInventoryDetailEO> taskInventoryDetailQueryWrap = new QueryWrapper<>();
|
||||
taskInventoryDetailQueryWrap.lambda().in(ProjectTaskInventoryDetailEO::getProjectTaskInventoryId,projectLawsInventoryIds);
|
||||
List<ProjectTaskInventoryDetailEO> projectTaskInventoryDetailEOS = this.projectTaskInventoryDetailEOMapper.selectList(taskInventoryDetailQueryWrap);
|
||||
|
||||
List<ProjectTaskInventoryEO> projectTaskInventoryEOAddList = new ArrayList<>();
|
||||
projectLawsInventoryEOList.forEach(lawsInventoryEO -> {
|
||||
ProjectTaskInventoryEO projectTaskInventoryEO = new ProjectTaskInventoryEO();
|
||||
String projectTaskInventoryId = UUID.randomUUID().toString().replace("-", "");
|
||||
projectTaskInventoryEO.setId(projectTaskInventoryId);
|
||||
projectTaskInventoryEO.setProjectLawsInventoryId(lawsInventoryEO.getId());
|
||||
projectTaskInventoryEO.setStandId(lawsInventoryEO.getStandId());
|
||||
projectTaskInventoryEO.setCreateBy("admin");
|
||||
projectTaskInventoryEO.setSysOrgCode("A01");
|
||||
|
||||
if(CollectionUtils.isNotEmpty(projectTaskInventoryDetailEOS)){
|
||||
//获取当前法规清单数据 启动的符合性流程数据
|
||||
List<ProjectTaskInventoryDetailEO> projectTaskInventoryDetailListTemp = projectTaskInventoryDetailEOS.stream().filter(taskInventoryDetail -> {
|
||||
boolean flag = false;
|
||||
if (StringUtils.equals(taskInventoryDetail.getProjectTaskInventoryId(), projectTaskInventoryEO.getProjectLawsInventoryId())) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
if(CollectionUtils.isNotEmpty(projectTaskInventoryDetailListTemp)){
|
||||
for (ProjectTaskInventoryDetailEO projectTaskInventoryDetailEO : projectTaskInventoryDetailListTemp) {
|
||||
//流程实例id
|
||||
String actiProcInstId = projectTaskInventoryDetailEO.getActiProcInstId();
|
||||
if(StringUtils.equals(projectTaskInventoryDetailEO.getFlowType(),FlowTypeEnum.SJFHXSHLC.getValue())){
|
||||
projectTaskInventoryEO.setDesignPId(actiProcInstId);
|
||||
projectTaskInventoryEO.setDesignFlowTaskStatus(ReviewResultEnum.TO_BE_CONFIRMED.getValue());
|
||||
projectTaskInventoryEO.setDesignStatus(DesignComplianceStatusEnum.TO_SUBMIT.getValue());
|
||||
}else if(StringUtils.equals(projectTaskInventoryDetailEO.getFlowType(),FlowTypeEnum.PREHOMOQRLC.getValue())){
|
||||
projectTaskInventoryEO.setPrehomoPId(actiProcInstId);
|
||||
projectTaskInventoryEO.setPrehomoFlowTaskStatus(ReviewResultEnum.TO_BE_CONFIRMED.getValue());
|
||||
projectTaskInventoryEO.setPrehomoStatus(DesignComplianceStatusEnum.TO_SUBMIT.getValue());
|
||||
}else if(StringUtils.equals(projectTaskInventoryDetailEO.getFlowType(),FlowTypeEnum.YZFHXSCLC.getValue())){
|
||||
projectTaskInventoryEO.setVerifyPId(actiProcInstId);
|
||||
projectTaskInventoryEO.setVerifyFlowTaskStatus(ReviewResultEnum.TO_BE_CONFIRMED.getValue());
|
||||
projectTaskInventoryEO.setVerifyStatus(DesignComplianceStatusEnum.TO_SUBMIT.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
projectTaskInventoryEOAddList.add(projectTaskInventoryEO);
|
||||
});
|
||||
this.projectTaskInventoryEOService.saveBatch(projectTaskInventoryEOAddList);
|
||||
}
|
||||
return new Result<>().success("处理任务清单历史数据成功!");
|
||||
}
|
||||
|
||||
public void setSheetStyle(HSSFSheet sheet){
|
||||
for (int i = 0; i <= 19; i++){
|
||||
sheet.setColumnWidth(i,4000);
|
||||
|
||||
+271
-102
@@ -1,8 +1,14 @@
|
||||
package com.jero.modules.project.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jero.common.constant.enums.MessageType2Enum;
|
||||
import com.jero.common.constant.enums.MessageTypeEnum;
|
||||
import com.jero.common.constant.enums.MsgColorEnum;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import com.jero.modules.feishu.service.IFeishuService;
|
||||
import com.jero.modules.feishu.vo.FeishuMsg2Vo;
|
||||
import com.jero.modules.feishu.vo.FeishuMsgVo;
|
||||
import com.jero.modules.project.entity.*;
|
||||
import com.jero.modules.project.enums.FeedBackHistoryDataStatusEnum;
|
||||
@@ -24,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -63,6 +70,12 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
|
||||
@Value(value = "${jero.backUrl}")
|
||||
private String backUrl;
|
||||
|
||||
@Autowired
|
||||
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||
@Autowired
|
||||
private IFeishuService feishuService;
|
||||
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
@@ -150,56 +163,108 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
|
||||
ProjectYearNameInfoEO projectYearNameInfoEO = this.projectYearNameInfoEOService.getOne(projectYearInfoEOQueryWrapper);
|
||||
|
||||
// 飞书消息封装
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
//FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
|
||||
feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has replied to your engineering deliverable information. Please check and address it in a timely manner.");
|
||||
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket());
|
||||
//feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has replied to your engineering deliverable information. Please check and address it in a timely manner.");
|
||||
//feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
|
||||
//feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket());
|
||||
|
||||
MessageTypeEnum messageTypeEnum = null;
|
||||
//MessageTypeEnum messageTypeEnum = null;
|
||||
|
||||
//消息内容
|
||||
String msgContentEN = "";
|
||||
//String msgContentEN = "";
|
||||
String msgTitle = "";
|
||||
String initiatorId = "";
|
||||
//String initiatorId = "";
|
||||
|
||||
String cnContentUpper = "";//中文上部分
|
||||
String cnContentLower = "";//中文下部分
|
||||
String enContentUpper = "";//英文上部分
|
||||
String enContentLower = "";//英文下部分
|
||||
|
||||
//项目名称
|
||||
String projectVersion = (com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBaseInfo.getParentId()) && com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBaseInfo.getProjectVersion())) ? "00" : projectLibraryBaseInfo.getProjectVersion();
|
||||
String projectName = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" + projectLibraryBaseInfo.getTargetMarket() + "-" + projectVersion;
|
||||
//法规中英文
|
||||
String LAW_CN = projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle();//法规
|
||||
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId());
|
||||
String LAW_EN = projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn();//法规
|
||||
|
||||
String flowType = projectTaskInventoryFeedbackEO.getFlowType();
|
||||
if(StringUtils.equals(flowType,FlowTypeEnum.SJFHXSHLC.getValue())){
|
||||
msgContentEN = currentUser.getUsername() + " has replied to your engineering deliverable information of "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
+ projectNameInfoEO.getProjectName() + " for design compliance confirmation. Please check and address it in time.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
|
||||
+ ": You have a design compliance task to complete";
|
||||
//msgContentEN = currentUser.getUsername() + " has replied to your engineering deliverable information of "
|
||||
// + projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
// + projectNameInfoEO.getProjectName() + " for design compliance confirmation. Please check and address it in time.";
|
||||
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
|
||||
// + ": You have a design compliance task to complete";
|
||||
|
||||
feishuMsgVo.setTaskType("Design Compliance Confirmation");
|
||||
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getDesignDueDate()));
|
||||
initiatorId = projectLawsInventoryEO.getDesignInitiatorId();
|
||||
//feishuMsgVo.setTaskType("Design Compliance Confirmation");
|
||||
//feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getDesignDueDate()));
|
||||
//initiatorId = projectLawsInventoryEO.getDesignInitiatorId();
|
||||
|
||||
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
|
||||
msgTitle = MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getEn();
|
||||
cnContentUpper = "您好,"+ currentUser.getUsername() +"回复了您提交的工程交付信息,请及时查看处理";
|
||||
cnContentLower = "项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: " + currentUser.getUsername() +
|
||||
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
|
||||
enContentUpper = "Hello! "+ currentUser.getUsername() +" has replied to your engineering deliverable information. Please check and address the task in a timely manner";
|
||||
enContentLower = "Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + currentUser.getUsername() +
|
||||
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
|
||||
|
||||
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
}else if(StringUtils.equals(flowType,FlowTypeEnum.PREHOMOQRLC.getValue())){
|
||||
msgContentEN = currentUser.getUsername() + " has replied to your engineering deliverable information of "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
+ projectNameInfoEO.getProjectName() + " for Pre-Homo compliance confirmation. Please check and address it in time.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
|
||||
+ ": You have a Pre-Homo task to complete";
|
||||
//msgContentEN = currentUser.getUsername() + " has replied to your engineering deliverable information of "
|
||||
// + projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
// + projectNameInfoEO.getProjectName() + " for Pre-Homo compliance confirmation. Please check and address it in time.";
|
||||
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
|
||||
// + ": You have a Pre-Homo task to complete";
|
||||
|
||||
feishuMsgVo.setTaskType("Pre-Homo Confirmation");
|
||||
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getPrehomoDueDate()));
|
||||
initiatorId = projectLawsInventoryEO.getPrehomoInitiatorId();
|
||||
//feishuMsgVo.setTaskType("Pre-Homo Confirmation");
|
||||
//feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getPrehomoDueDate()));
|
||||
//initiatorId = projectLawsInventoryEO.getPrehomoInitiatorId();
|
||||
|
||||
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
|
||||
msgTitle = MessageType2Enum.PRE_HOMO_CONFIRMATION.getCn() + "/" + MessageType2Enum.PRE_HOMO_CONFIRMATION.getEn();
|
||||
cnContentUpper = "您好,"+ currentUser.getUsername() +"回复了您提交的工程交付信息,请及时查看处理";
|
||||
cnContentLower = "项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: " + currentUser.getUsername() +
|
||||
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
|
||||
enContentUpper = "Hello! "+ currentUser.getUsername() +" has replied to your engineering deliverable information. Please check and address the task in a timely manner";
|
||||
enContentLower = "Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + currentUser.getUsername() +
|
||||
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
|
||||
|
||||
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
}else if(StringUtils.equals(flowType,FlowTypeEnum.YZFHXSCLC.getValue())){
|
||||
msgContentEN = currentUser.getUsername() + " has replied to your engineering deliverable information of "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
+ projectNameInfoEO.getProjectName() + " for validation compliance confirmation. Please check and address it in time.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
|
||||
+ ": You have a validation compliance task to complete";
|
||||
//msgContentEN = currentUser.getUsername() + " has replied to your engineering deliverable information of "
|
||||
// + projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
// + projectNameInfoEO.getProjectName() + " for validation compliance confirmation. Please check and address it in time.";
|
||||
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
|
||||
// + ": You have a validation compliance task to complete";
|
||||
|
||||
feishuMsgVo.setTaskType("Validation Compliance Confirmation");
|
||||
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getVerifyDueDate()));
|
||||
initiatorId = projectLawsInventoryEO.getVerifyInitiatorId();
|
||||
//feishuMsgVo.setTaskType("Validation Compliance Confirmation");
|
||||
//feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getVerifyDueDate()));
|
||||
//initiatorId = projectLawsInventoryEO.getVerifyInitiatorId();
|
||||
|
||||
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
|
||||
msgTitle = MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getEn();
|
||||
cnContentUpper = "您好,"+ currentUser.getUsername() +"回复了您提交的工程交付信息,请及时查看处理";
|
||||
cnContentLower = "项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: " + currentUser.getUsername() +
|
||||
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
|
||||
enContentUpper = "Hello! "+ currentUser.getUsername() +" has replied to your engineering deliverable information. Please check and address the task in a timely manner";
|
||||
enContentLower = "Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + currentUser.getUsername() +
|
||||
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
|
||||
|
||||
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
}
|
||||
|
||||
//飞书跳转链接
|
||||
@@ -209,28 +274,47 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
+ projectYearNameInfoEO.getYearName()
|
||||
+ "&targetMarket=" + projectLibraryBaseInfo.getTargetMarket();
|
||||
//系统内部跳转链接
|
||||
String href = "<a href='"
|
||||
+ JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink() + projectLibraryBaseInfo.getId() + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
+ projectYearNameInfoEO.getYearName()
|
||||
+ "&targetMarket=" + projectLibraryBaseInfo.getTargetMarket()
|
||||
+ "'>" + " View details" + "</a>";
|
||||
String contentInfo = msgContentEN + " " + href;
|
||||
Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
String initiator = "";
|
||||
if(StringUtils.isNotEmpty(initiatorId)){
|
||||
QueryWrapper<SysUser> queryOneWrapper = new QueryWrapper<>();
|
||||
queryOneWrapper.lambda().eq(SysUser::getId,initiatorId);
|
||||
SysUser sysUser = this.sysUserService.getBaseMapper().selectOne(queryOneWrapper);
|
||||
initiator = sysUser.getUsername();
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
feishuMsgVo.setInitiator(initiator);
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(msgTitle);
|
||||
feishuMsgVo.setCnContentUpper(cnContentUpper);
|
||||
feishuMsgVo.setCnContentLower(cnContentLower);
|
||||
feishuMsgVo.setEnContentUpper(enContentUpper);
|
||||
feishuMsgVo.setEnContentLower(enContentLower);
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
//系统内部跳转链接
|
||||
//String href = "<a href='"
|
||||
// + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink() + projectLibraryBaseInfo.getId() + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getType()
|
||||
// + "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
// + projectYearNameInfoEO.getYearName()
|
||||
// + "&targetMarket=" + projectLibraryBaseInfo.getTargetMarket()
|
||||
// + "'>" + " View details" + "</a>";
|
||||
//String contentInfo = msgContentEN + " " + href;
|
||||
//Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
//sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
//sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//String initiator = "";
|
||||
//if(StringUtils.isNotEmpty(initiatorId)){
|
||||
// QueryWrapper<SysUser> queryOneWrapper = new QueryWrapper<>();
|
||||
// queryOneWrapper.lambda().eq(SysUser::getId,initiatorId);
|
||||
// SysUser sysUser = this.sysUserService.getBaseMapper().selectOne(queryOneWrapper);
|
||||
// initiator = sysUser.getUsername();
|
||||
//}
|
||||
//feishuMsgVo.setInitiator(initiator);
|
||||
//发送消息
|
||||
SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryBaseInfo.getId(),sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
//SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryBaseInfo.getId(),sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -286,6 +370,9 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
|
||||
List<ProjectTaskInventoryFeedbackEO> projectTaskInventoryFeedbackEOS = this.baseMapper.selectList(queryWrapper);
|
||||
if(CollectionUtils.isNotEmpty(projectTaskInventoryFeedbackEOS)){
|
||||
List<String> idList = projectTaskInventoryFeedbackEOS.stream().distinct().map(ProjectTaskInventoryFeedbackEO::getProjectTaskInventoryId).collect(Collectors.toList());
|
||||
List<String> userNameList = projectTaskInventoryFeedbackEOS.stream().distinct().map(ProjectTaskInventoryFeedbackEO::getCreateBy).collect(Collectors.toList());
|
||||
List<SysUser> userList = this.sysUserService.queryUserIdListByNameList(userNameList);
|
||||
|
||||
QueryWrapper<ProjectTaskInventoryDetailEO> inventoryDetailEOQueryWrapper = new QueryWrapper<>();
|
||||
inventoryDetailEOQueryWrapper.lambda().in(ProjectTaskInventoryDetailEO::getId,idList);
|
||||
List<ProjectTaskInventoryDetailEO> projectTaskInventoryDetailEOList = projectTaskInventoryDetailEOMapper.selectList(inventoryDetailEOQueryWrapper);
|
||||
@@ -302,6 +389,18 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
|
||||
if(CollectionUtils.isNotEmpty(projectTaskInventoryDetailList)){
|
||||
projectTaskInventoryFeedbackEO.setStatus(projectTaskInventoryDetailList.get(0).getStatus());
|
||||
}
|
||||
if(CollectionUtils.isNotEmpty(userList)){
|
||||
List<SysUser> userListTemp = userList.stream().filter(user -> {
|
||||
boolean flag = false;
|
||||
if(StringUtils.equals(projectTaskInventoryFeedbackEO.getCreateBy(),user.getUsername())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
if(CollectionUtils.isNotEmpty(userListTemp)){
|
||||
projectTaskInventoryFeedbackEO.setUserId(userListTemp.get(0).getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return projectTaskInventoryFeedbackEOS;
|
||||
@@ -372,61 +471,112 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
|
||||
}
|
||||
|
||||
// 飞书消息封装
|
||||
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
//FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
|
||||
|
||||
feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has submitted the engineering deliverable information. Please check and address it in a timely manner.");
|
||||
feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
|
||||
feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket());
|
||||
//feishuMsgVo.setContent("Hello! " + currentUser.getUsername() + " has submitted the engineering deliverable information. Please check and address it in a timely manner.");
|
||||
//feishuMsgVo.setRegulationNo(projectLawsInventoryEO.getSerialNumber());
|
||||
//feishuMsgVo.setProject(projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket());
|
||||
|
||||
String initiator = "";
|
||||
if (StringUtils.isNotEmpty(initiatorId)) {
|
||||
QueryWrapper<SysUser> queryOneWrapper = new QueryWrapper<>();
|
||||
queryOneWrapper.lambda().eq(SysUser::getId,initiatorId);
|
||||
SysUser sysUser = this.sysUserService.getBaseMapper().selectOne(queryOneWrapper);
|
||||
initiator = sysUser.getUsername();
|
||||
}
|
||||
feishuMsgVo.setInitiator(initiator);
|
||||
//String initiator = "";
|
||||
//if (StringUtils.isNotEmpty(initiatorId)) {
|
||||
// QueryWrapper<SysUser> queryOneWrapper = new QueryWrapper<>();
|
||||
// queryOneWrapper.lambda().eq(SysUser::getId,initiatorId);
|
||||
// SysUser sysUser = this.sysUserService.getBaseMapper().selectOne(queryOneWrapper);
|
||||
// initiator = sysUser.getUsername();
|
||||
//}
|
||||
//feishuMsgVo.setInitiator(initiator);
|
||||
|
||||
MessageTypeEnum messageTypeEnum = null;
|
||||
//MessageTypeEnum messageTypeEnum = null;
|
||||
|
||||
//消息内容
|
||||
String msgContentEN = "";
|
||||
//String msgContentEN = "";
|
||||
String msgTitle = "";
|
||||
String cnContentUpper = "";//中文上部分
|
||||
String cnContentLower = "";//中文下部分
|
||||
String enContentUpper = "";//英文上部分
|
||||
String enContentLower = "";//英文下部分
|
||||
|
||||
//项目名称
|
||||
String projectVersion = (com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBaseInfo.getParentId()) && com.jero.modules.system.util.StringUtils.isBlank(projectLibraryBaseInfo.getProjectVersion())) ? "00" : projectLibraryBaseInfo.getProjectVersion();
|
||||
String projectName = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + "-" + projectLibraryBaseInfo.getTargetMarket() + "-" + projectVersion;
|
||||
//法规中英文
|
||||
String LAW_CN = projectLawsInventoryEO.getSerialNumber() + " " + projectLawsInventoryEO.getTitle();//法规
|
||||
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(projectLawsInventoryEO.getStandId());
|
||||
String LAW_EN = projectLawsInventoryEO.getSerialNumber() + " " + bussDocumentLibraryEO.getTitleEn();//法规
|
||||
|
||||
String flowType = projectTaskInventoryFeedbackEO.getFlowType();
|
||||
if(StringUtils.equals(flowType,FlowTypeEnum.SJFHXSHLC.getValue())){
|
||||
msgContentEN = currentUser.getUsername() + " has submitted the engineering deliverable information of "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
+ projectNameInfoEO.getProjectName() + "for design compliance confirmation. Please check and address it in time.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
|
||||
+ ": You have a design compliance task to complete";
|
||||
//msgContentEN = currentUser.getUsername() + " has submitted the engineering deliverable information of "
|
||||
// + projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
// + projectNameInfoEO.getProjectName() + "for design compliance confirmation. Please check and address it in time.";
|
||||
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
|
||||
// + ": You have a design compliance task to complete";
|
||||
|
||||
feishuMsgVo.setTaskType("Design Compliance Confirmation");
|
||||
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getDesignDueDate()));
|
||||
//feishuMsgVo.setTaskType("Design Compliance Confirmation");
|
||||
//feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getDesignDueDate()));
|
||||
|
||||
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
|
||||
msgTitle = MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.DESIGN_COMPLIANCE_CONFIRMATION.getEn();
|
||||
cnContentUpper = "您好,"+ currentUser.getUsername() +"向您提交了工程交付信息,请及时查看处理";
|
||||
cnContentLower = "项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: " + currentUser.getUsername() +
|
||||
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
|
||||
enContentUpper = "Hello! "+ currentUser.getUsername() +" has submitted the engineering deliverable information to you. Please check and address the task in a timely manner";
|
||||
enContentLower = "Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + currentUser.getUsername() +
|
||||
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
|
||||
|
||||
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
}else if(StringUtils.equals(flowType,FlowTypeEnum.PREHOMOQRLC.getValue())){
|
||||
msgContentEN = currentUser.getUsername() + " has submitted the engineering deliverable information of "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
+ projectNameInfoEO.getProjectName() + " for Pre-Homo confirmation. Please check and address it in time.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
|
||||
+ ": You have a Pre-Homo task to complete";
|
||||
//msgContentEN = currentUser.getUsername() + " has submitted the engineering deliverable information of "
|
||||
// + projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
// + projectNameInfoEO.getProjectName() + " for Pre-Homo confirmation. Please check and address it in time.";
|
||||
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
|
||||
// + ": You have a Pre-Homo task to complete";
|
||||
|
||||
feishuMsgVo.setTaskType("Pre-Homo Confirmation");
|
||||
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getPrehomoDueDate()));
|
||||
//feishuMsgVo.setTaskType("Pre-Homo Confirmation");
|
||||
//feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getPrehomoDueDate()));
|
||||
|
||||
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
|
||||
msgTitle = MessageType2Enum.PRE_HOMO_CONFIRMATION.getCn() + "/" + MessageType2Enum.PRE_HOMO_CONFIRMATION.getEn();
|
||||
cnContentUpper = "您好,"+ currentUser.getUsername() +"向您提交了工程交付信息,请及时查看处理";
|
||||
cnContentLower = "项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: " + currentUser.getUsername() +
|
||||
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
|
||||
enContentUpper = "Hello! "+ currentUser.getUsername() +" has submitted the engineering deliverable information to you. Please check and address the task in a timely manner";
|
||||
enContentLower = "Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + currentUser.getUsername() +
|
||||
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
|
||||
|
||||
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
}else if(StringUtils.equals(flowType,FlowTypeEnum.YZFHXSCLC.getValue())){
|
||||
msgContentEN = currentUser.getUsername() + " has submitted the engineering deliverable information of "
|
||||
+ projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
+ projectNameInfoEO.getProjectName() + " for validation compliance confirmation. Please check and address it in time.";
|
||||
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
|
||||
+ ": You have a validation compliance task to complete";
|
||||
//msgContentEN = currentUser.getUsername() + " has submitted the engineering deliverable information of "
|
||||
// + projectLawsInventoryEO.getSerialNumber() + " in "
|
||||
// + projectNameInfoEO.getProjectName() + " for validation compliance confirmation. Please check and address it in time.";
|
||||
//msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBaseInfo.getTargetMarket()
|
||||
// + ": You have a validation compliance task to complete";
|
||||
|
||||
feishuMsgVo.setTaskType("Validation Compliance Confirmation");
|
||||
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getVerifyDueDate()));
|
||||
//feishuMsgVo.setTaskType("Validation Compliance Confirmation");
|
||||
//feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getVerifyDueDate()));
|
||||
|
||||
//messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
|
||||
msgTitle = MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getCn() + "/" + MessageType2Enum.VALIDATION_COMPLIANCE_CONFIRMATION.getEn();
|
||||
cnContentUpper = "您好,"+ currentUser.getUsername() +"向您提交了工程交付信息,请及时查看处理";
|
||||
cnContentLower = "项目: " + projectName +
|
||||
"\n法规: " + LAW_CN +
|
||||
"\n发起人: " + currentUser.getUsername() +
|
||||
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
|
||||
enContentUpper = "Hello! "+ currentUser.getUsername() +" has submitted the engineering deliverable information to you. Please check and address the task in a timely manner";
|
||||
enContentLower = "Project: " + projectName +
|
||||
"\nRegulation No: " + LAW_EN +
|
||||
"\nInitiator: " + currentUser.getUsername() +
|
||||
"\nDue Date: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
|
||||
|
||||
messageTypeEnum = MessageTypeEnum.COMPLIANCE_CONFIRMATION;
|
||||
}
|
||||
|
||||
//飞书跳转链接
|
||||
@@ -436,20 +586,39 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
+ projectYearNameInfoEO.getYearName()
|
||||
+ "&targetMarket=" + projectLibraryBaseInfo.getTargetMarket();
|
||||
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
|
||||
List<String> thirdIdList = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(sysUsers)){
|
||||
thirdIdList = sysUsers.stream().map(SysUser::getThirdId).collect(Collectors.toList());
|
||||
}
|
||||
try {
|
||||
FeishuMsg2Vo feishuMsgVo = new FeishuMsg2Vo();
|
||||
feishuMsgVo.setTitle(msgTitle);
|
||||
feishuMsgVo.setCnContentUpper(cnContentUpper);
|
||||
feishuMsgVo.setCnContentLower(cnContentLower);
|
||||
feishuMsgVo.setEnContentUpper(enContentUpper);
|
||||
feishuMsgVo.setEnContentLower(enContentLower);
|
||||
feishuMsgVo.setUrl(hrefFeishu);
|
||||
feishuMsgVo.setColor(MsgColorEnum.GREEN.getValue()); // 颜色
|
||||
feishuService.sendCard(thirdIdList.toArray(new String[thirdIdList.size()]), feishuMsgVo);
|
||||
} catch (IOException e) {
|
||||
log.error("飞书消息推送失败");
|
||||
}
|
||||
//系统内部跳转链接
|
||||
String href = "<a href='"
|
||||
+ JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink() + projectLibraryBaseInfo.getId() + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getType()
|
||||
+ "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
+ projectYearNameInfoEO.getYearName()
|
||||
+ "&targetMarket=" + projectLibraryBaseInfo.getTargetMarket()
|
||||
+ "'>" + " View details" + "</a>";
|
||||
String contentInfo = msgContentEN + " " + href;
|
||||
Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
sendMessageMap.put("contentInfo",contentInfo);
|
||||
//String href = "<a href='"
|
||||
// + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getLink() + projectLibraryBaseInfo.getId() + JumpLinkEnum.PREHOMO_AFFIRM_LINK.getType()
|
||||
// + "&projectName=" + projectNameInfoEO.getProjectName() + "-"
|
||||
// + projectYearNameInfoEO.getYearName()
|
||||
// + "&targetMarket=" + projectLibraryBaseInfo.getTargetMarket()
|
||||
// + "'>" + " View details" + "</a>";
|
||||
//String contentInfo = msgContentEN + " " + href;
|
||||
//Map<String,Object> sendMessageMap = new HashMap<>();
|
||||
//sendMessageMap.put("hrefFeishu",hrefFeishu);
|
||||
//sendMessageMap.put("contentInfo",contentInfo);
|
||||
|
||||
//发送消息
|
||||
SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryBaseInfo.getId(),sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
//SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryBaseInfo.getId(),sendMessageMap, feishuMsgVo, messageTypeEnum,MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -137,8 +137,8 @@ public class NcrTrackVO implements Serializable {
|
||||
private String projectTaskInventoryDetailId;
|
||||
//任务节点定义key
|
||||
private String taskDefinitionKey;
|
||||
|
||||
|
||||
//是否是系统管理员角色
|
||||
private String administrator;
|
||||
|
||||
|
||||
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.jero.modules.project.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class ProjectTaskUrgVo {
|
||||
|
||||
private String cut;
|
||||
|
||||
private String projectLawsInventoryIds;
|
||||
|
||||
private String type;
|
||||
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package com.jero.modules.todoCenter.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.modules.todoCenter.service.IProcessInfoEOService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags="待办中心-法规评估")
|
||||
@RestController
|
||||
@RequestMapping("/todoCenter/lawsAssess")
|
||||
@Slf4j
|
||||
public class LawsAssessTodoCenterController {
|
||||
|
||||
@Autowired
|
||||
private IProcessInfoEOService processInfoEOService;
|
||||
|
||||
@AutoLog(value = "分页查询-待办任务列表")
|
||||
@ApiOperation(value="分页查询-待办任务列表", notes="分页查询-待办任务列表")
|
||||
@GetMapping(value = "/todoTaskList")
|
||||
public Result<?> todoTaskList(@RequestParam Map<String,Object> params) {
|
||||
IPage page = this.processInfoEOService.lawsAssessTodoTaskList(params);
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
@AutoLog(value = "分页查询-已办任务列表")
|
||||
@ApiOperation(value="分页查询-已办任务列表", notes="分页查询-已办任务列表")
|
||||
@GetMapping(value = "/doneProcess")
|
||||
public Result<?> doneProcess(@RequestParam Map<String,Object> params) {
|
||||
IPage page = this.processInfoEOService.lawsAssessDoneProcess(params);
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
@AutoLog(value = "分页查询-已发任务列表")
|
||||
@ApiOperation(value="分页查询-已发任务列表", notes="分页查询-已发任务列表")
|
||||
@GetMapping(value = "/issuedProcess")
|
||||
public Result<?> issuedProcess(@RequestParam Map<String,Object> params) {
|
||||
IPage page = this.processInfoEOService.lawsAssessIssuedProcess(params);
|
||||
return Result.OK(page);
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package com.jero.modules.todoCenter.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.modules.todoCenter.service.IParamsManifestTodoCenterService;
|
||||
import com.jero.modules.todoCenter.vo.ParamsManifestTodoCenterEOPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Author: liyawei
|
||||
* @Description:
|
||||
* @Date: Created in 09:43 2022/10/11
|
||||
*/
|
||||
|
||||
@Api(tags="待办中心-参数清单")
|
||||
@RestController
|
||||
@RequestMapping("/todoCenter/params/manifest")
|
||||
@Slf4j
|
||||
public class ParamsManifestTodoCenterController {
|
||||
|
||||
@Autowired
|
||||
private IParamsManifestTodoCenterService paramsManifestTodoCenterService;
|
||||
|
||||
@AutoLog(value = "分页查询")
|
||||
@ApiOperation(value="分页查询", notes="分页查询")
|
||||
@GetMapping(value = "/page")
|
||||
// @RequiresPermissions("params:collectManifest:list")
|
||||
public Result<?> page(ParamsManifestTodoCenterEOPage pageVO) {
|
||||
IPage page = paramsManifestTodoCenterService.queryPage(pageVO);
|
||||
return Result.OK(page);
|
||||
}
|
||||
}
|
||||
+184
@@ -0,0 +1,184 @@
|
||||
package com.jero.modules.todoCenter.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO;
|
||||
import com.jero.modules.todoCenter.service.IProcessInfoDetailEOService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 流程信息明细表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-10-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="流程信息明细表")
|
||||
@RestController
|
||||
@RequestMapping("/todoCenter/processInfoDetailEO")
|
||||
@Slf4j
|
||||
public class ProcessInfoDetailEOController extends JeroController<ProcessInfoDetailEO, IProcessInfoDetailEOService> {
|
||||
@Autowired
|
||||
private IProcessInfoDetailEOService processInfoDetailEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param processInfoDetailEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程信息明细表-分页列表查询")
|
||||
@ApiOperation(value="流程信息明细表-分页列表查询", notes="流程信息明细表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(ProcessInfoDetailEO processInfoDetailEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<ProcessInfoDetailEO> queryWrapper = QueryGenerator.initQueryWrapper(processInfoDetailEO, req.getParameterMap());
|
||||
Page<ProcessInfoDetailEO> page = new Page<ProcessInfoDetailEO>(pageNo, pageSize);
|
||||
IPage<ProcessInfoDetailEO> pageList = processInfoDetailEOService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程信息明细表-列表查询")
|
||||
@ApiOperation(value="流程信息明细表-列表查询", notes="流程信息明细表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<ProcessInfoDetailEO>> queryList() {
|
||||
List<ProcessInfoDetailEO> list = processInfoDetailEOService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param processInfoDetailEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程信息明细表-添加")
|
||||
@ApiOperation(value="流程信息明细表-添加", notes="流程信息明细表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody ProcessInfoDetailEO processInfoDetailEO) {
|
||||
processInfoDetailEOService.add(processInfoDetailEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param processInfoDetailEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程信息明细表-编辑")
|
||||
@ApiOperation(value="流程信息明细表-编辑", notes="流程信息明细表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody ProcessInfoDetailEO processInfoDetailEO) {
|
||||
processInfoDetailEOService.editById(processInfoDetailEO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程信息明细表-通过id删除")
|
||||
@ApiOperation(value="流程信息明细表-通过id删除", notes="流程信息明细表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
processInfoDetailEOService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程信息明细表-批量删除")
|
||||
@ApiOperation(value="流程信息明细表-批量删除", notes="流程信息明细表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.processInfoDetailEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程信息明细表-通过id查询")
|
||||
@ApiOperation(value="流程信息明细表-通过id查询", notes="流程信息明细表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
ProcessInfoDetailEO processInfoDetailEO = processInfoDetailEOService.queryById(id);
|
||||
if(processInfoDetailEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(processInfoDetailEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param processInfoDetailEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ProcessInfoDetailEO processInfoDetailEO) {
|
||||
return super.exportXls(request, processInfoDetailEO, ProcessInfoDetailEO.class, "流程信息明细表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, ProcessInfoDetailEO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程调用接口
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程信息明细表-流程调用")
|
||||
@ApiOperation(value="流程信息明细表-流程调用", notes="流程信息明细表-流程调用")
|
||||
@PostMapping(value = "/processCall")
|
||||
public Result<?> processCall(@RequestBody JSONObject jsonObject){
|
||||
return this.processInfoDetailEOService.processCall(jsonObject);
|
||||
}
|
||||
|
||||
}
|
||||
+183
@@ -0,0 +1,183 @@
|
||||
package com.jero.modules.todoCenter.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
|
||||
import com.jero.modules.todoCenter.service.IProcessInfoEOService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 流程信息表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-10-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="流程信息表")
|
||||
@RestController
|
||||
@RequestMapping("/todoCenter/processInfoEO")
|
||||
@Slf4j
|
||||
public class ProcessInfoEOController extends JeroController<ProcessInfoEO, IProcessInfoEOService> {
|
||||
@Autowired
|
||||
private IProcessInfoEOService processInfoEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param processInfoEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程信息表-分页列表查询")
|
||||
@ApiOperation(value="流程信息表-分页列表查询", notes="流程信息表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(ProcessInfoEO processInfoEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<ProcessInfoEO> queryWrapper = QueryGenerator.initQueryWrapper(processInfoEO, req.getParameterMap());
|
||||
Page<ProcessInfoEO> page = new Page<ProcessInfoEO>(pageNo, pageSize);
|
||||
IPage<ProcessInfoEO> pageList = processInfoEOService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程信息表-列表查询")
|
||||
@ApiOperation(value="流程信息表-列表查询", notes="流程信息表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<ProcessInfoEO>> queryList() {
|
||||
List<ProcessInfoEO> list = processInfoEOService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param processInfoEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程信息表-添加")
|
||||
@ApiOperation(value="流程信息表-添加", notes="流程信息表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody ProcessInfoEO processInfoEO) {
|
||||
processInfoEOService.add(processInfoEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param processInfoEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程信息表-编辑")
|
||||
@ApiOperation(value="流程信息表-编辑", notes="流程信息表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody ProcessInfoEO processInfoEO) {
|
||||
processInfoEOService.editById(processInfoEO);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程信息表-通过id删除")
|
||||
@ApiOperation(value="流程信息表-通过id删除", notes="流程信息表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
processInfoEOService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程信息表-批量删除")
|
||||
@ApiOperation(value="流程信息表-批量删除", notes="流程信息表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.processInfoEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程信息表-通过id查询")
|
||||
@ApiOperation(value="流程信息表-通过id查询", notes="流程信息表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
ProcessInfoEO processInfoEO = processInfoEOService.queryById(id);
|
||||
if(processInfoEO==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(processInfoEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param processInfoEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ProcessInfoEO processInfoEO) {
|
||||
return super.exportXls(request, processInfoEO, ProcessInfoEO.class, "流程信息表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, ProcessInfoEO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程调用接口
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "流程信息表-流程调用")
|
||||
@ApiOperation(value="流程信息表-流程调用", notes="流程信息表-流程调用")
|
||||
@PostMapping(value = "/processCall")
|
||||
public Result<?> processCall(@RequestBody JSONObject jsonObject){
|
||||
return this.processInfoEOService.processCall(jsonObject);
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package com.jero.modules.todoCenter.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.modules.todoCenter.service.IProcessInfoEOService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags="待办中心-项目流程")
|
||||
@RestController
|
||||
@RequestMapping("/todoCenter/projectProcess")
|
||||
@Slf4j
|
||||
public class ProjectProcessTodoCenterController {
|
||||
|
||||
@Autowired
|
||||
private IProcessInfoEOService processInfoEOService;
|
||||
|
||||
@AutoLog(value = "分页查询-待办任务列表")
|
||||
@ApiOperation(value="分页查询-待办任务列表", notes="分页查询-待办任务列表")
|
||||
@GetMapping(value = "/todoTaskList")
|
||||
public Result<?> todoTaskList(@RequestParam Map<String,Object> params) {
|
||||
IPage page = this.processInfoEOService.projectProcessTodoTaskList(params);
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
@AutoLog(value = "分页查询-已办任务列表")
|
||||
@ApiOperation(value="分页查询-已办任务列表", notes="分页查询-已办任务列表")
|
||||
@GetMapping(value = "/doneProcess")
|
||||
public Result<?> doneProcess(@RequestParam Map<String,Object> params) {
|
||||
IPage page = this.processInfoEOService.projectProcessDoneProcess(params);
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
@AutoLog(value = "分页查询-已发任务列表")
|
||||
@ApiOperation(value="分页查询-已发任务列表", notes="分页查询-已发任务列表")
|
||||
@GetMapping(value = "/issuedProcess")
|
||||
public Result<?> issuedProcess(@RequestParam Map<String,Object> params) {
|
||||
IPage page = this.processInfoEOService.projectProcessIssuedProcess(params);
|
||||
return Result.OK(page);
|
||||
}
|
||||
|
||||
@AutoLog(value = "待办中心-法规评估-初始化历史数据")
|
||||
@ApiOperation(value="待办中心-法规评估-初始化历史数据", notes="待办中心-法规评估-初始化历史数据")
|
||||
@GetMapping(value = "/initHistoryData")
|
||||
public Result<?> initHistoryData(@RequestParam Map<String,Object> params) {
|
||||
return this.processInfoEOService.initHistoryData(params);
|
||||
}
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.jero.modules.todoCenter.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class ParamsManifestTodoCenterEO {
|
||||
/**
|
||||
* 参数清单id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 相关项目名称
|
||||
*/
|
||||
private String projectName;
|
||||
|
||||
/**
|
||||
* 参数清单标题
|
||||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 相关项目版本
|
||||
*/
|
||||
private String projectVersion;
|
||||
|
||||
/**
|
||||
* 待发起数量 包括状态:待发起收集,变更,工程接口人退回
|
||||
*/
|
||||
private Integer waitCollectNum;
|
||||
|
||||
/**
|
||||
* 待工程接口人处理数量(即待分配) 包括状态:待工程接口人处理,填写人退回
|
||||
*/
|
||||
private Integer waitSdtNum;
|
||||
|
||||
/**
|
||||
* 待填写数量 包括状态:待填写,认证工程师退回
|
||||
*/
|
||||
private Integer waitFillNum;
|
||||
|
||||
private Date createTime;
|
||||
private String state;
|
||||
private String projectId;
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
package com.jero.modules.todoCenter.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 流程信息明细表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-10-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("process_info_detail")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="process_info_detail对象", description="流程信息明细表")
|
||||
public class ProcessInfoDetailEO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private java.lang.String id;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
|
||||
/**流程实例id*/
|
||||
@Excel(name = "流程实例id", width = 15)
|
||||
@ApiModelProperty(value = "流程实例id")
|
||||
private java.lang.String actiProcInstId;
|
||||
|
||||
/**待办id*/
|
||||
@Excel(name = "待办id", width = 15)
|
||||
@ApiModelProperty(value = "待办id")
|
||||
private java.lang.String taskId;
|
||||
|
||||
/**处理人id*/
|
||||
@Excel(name = "处理人id", width = 15)
|
||||
@ApiModelProperty(value = "处理人id")
|
||||
private java.lang.String userId;
|
||||
|
||||
/**任务状态:待办/已办*/
|
||||
@Excel(name = "任务状态:待办/已办", width = 15)
|
||||
@ApiModelProperty(value = "任务状态:待办/已办")
|
||||
private java.lang.String status;
|
||||
|
||||
/**任务节点定义key*/
|
||||
@Excel(name = "任务节点定义key", width = 15)
|
||||
@ApiModelProperty(value = "任务节点定义key")
|
||||
private java.lang.String taskDefinitionKey;
|
||||
|
||||
/**提交时间*/
|
||||
@Excel(name = "提交时间", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "提交时间")
|
||||
private java.util.Date submitTime;
|
||||
|
||||
/**流程信息id*/
|
||||
@Excel(name = "流程信息id", width = 15)
|
||||
@ApiModelProperty(value = "流程信息id")
|
||||
private java.lang.String processInfoId;
|
||||
|
||||
/**法规清单id*/
|
||||
@Excel(name = "法规清单id", width = 15)
|
||||
@ApiModelProperty(value = "法规清单id")
|
||||
private java.lang.String projectLawsInventoryId;
|
||||
|
||||
/**文档库id/标准id*/
|
||||
@Excel(name = "文档库id/标准id", width = 15)
|
||||
@ApiModelProperty(value = "文档库id/标准id")
|
||||
private java.lang.String bussDocumentLibraryId;
|
||||
|
||||
/**流程类型*/
|
||||
@Excel(name = "流程类型", width = 15)
|
||||
@ApiModelProperty(value = "流程类型")
|
||||
private java.lang.String flowType;
|
||||
|
||||
/**截止时间*/
|
||||
@Excel(name = "截止时间", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "截止时间")
|
||||
private java.util.Date endTime;
|
||||
}
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
package com.jero.modules.todoCenter.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 流程信息表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-10-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("process_info")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="process_info对象", description="流程信息表")
|
||||
public class ProcessInfoEO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private java.lang.String id;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
|
||||
/**项目库id*/
|
||||
@Excel(name = "项目库id", width = 15)
|
||||
@ApiModelProperty(value = "项目库id")
|
||||
private java.lang.String projectLibraryId;
|
||||
|
||||
/**法规清单id*/
|
||||
@Excel(name = "法规清单id", width = 15)
|
||||
@ApiModelProperty(value = "法规清单id")
|
||||
private java.lang.String projectLawsInventoryId;
|
||||
|
||||
/**文档库id/标准id*/
|
||||
@Excel(name = "文档库id/标准id", width = 15)
|
||||
@ApiModelProperty(value = "文档库id/标准id")
|
||||
private java.lang.String bussDocumentLibraryId;
|
||||
|
||||
/**流程实例id*/
|
||||
@Excel(name = "流程实例id", width = 15)
|
||||
@ApiModelProperty(value = "流程实例id")
|
||||
private java.lang.String actiProcInstId;
|
||||
|
||||
/**流程类型*/
|
||||
@Excel(name = "流程类型", width = 15)
|
||||
@ApiModelProperty(value = "流程类型")
|
||||
private java.lang.String flowType;
|
||||
|
||||
/**截止日期*/
|
||||
@Excel(name = "截止日期", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "截止日期")
|
||||
private java.util.Date endTime;
|
||||
|
||||
/**任务状态*/
|
||||
@Excel(name = "任务状态", width = 15)
|
||||
@ApiModelProperty(value = "任务状态")
|
||||
private java.lang.String status;
|
||||
|
||||
@ApiModelProperty(value = "流程编号")
|
||||
private String prcNum;
|
||||
|
||||
@ApiModelProperty(value = "流程名称")
|
||||
private String prcName;
|
||||
|
||||
/**流程类型展示字段*/
|
||||
@TableField(exist = false)
|
||||
private String flowTypeShow;
|
||||
|
||||
/**任务状态展示字段*/
|
||||
@TableField(exist = false)
|
||||
private String statusShow;
|
||||
|
||||
/**上一个操作人 用户id*/
|
||||
@TableField(exist = false)
|
||||
private String lastAssignee;
|
||||
@TableField(exist = false)
|
||||
private String lastAssigneeName;
|
||||
|
||||
/**当前操作人/代理人 用户id*/
|
||||
@TableField(exist = false)
|
||||
private String assignee;
|
||||
@TableField(exist = false)
|
||||
private String assigneeName;
|
||||
|
||||
/**标准编号*/
|
||||
@TableField(exist = false)
|
||||
private String serialNumber;
|
||||
/**标准标题*/
|
||||
@TableField(exist = false)
|
||||
private String title;
|
||||
/**项目名称*/
|
||||
@TableField(exist = false)
|
||||
private String projectName;
|
||||
/**年份*/
|
||||
@TableField(exist = false)
|
||||
private String yearName;
|
||||
/**待办id*/
|
||||
@TableField(exist = false)
|
||||
private String taskId;
|
||||
/**任务节点定义key*/
|
||||
@TableField(exist = false)
|
||||
private String taskDefinitionKey;
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package com.jero.modules.todoCenter.enums;
|
||||
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* 待办中心状态枚举类
|
||||
*/
|
||||
public enum TodoCenterStatusEnum {
|
||||
LIST_TO_CONFIRM("待确认","List to confirm","List to confirm"),
|
||||
COMPLETED("已完成","Completed","Completed"),
|
||||
INQUIRY("询问","Inquiry","Inquiry"),
|
||||
TO_SUBMIT("待提交","To submit","To submit"),
|
||||
TO_AUDIT("待审核","To audit","To audit"),
|
||||
;
|
||||
|
||||
String cnName;
|
||||
String enName;
|
||||
String value;
|
||||
|
||||
private TodoCenterStatusEnum(String cnName,String enName, String value) {
|
||||
this.cnName = cnName;
|
||||
this.enName = enName;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getCnName() {
|
||||
return cnName;
|
||||
}
|
||||
|
||||
public void setCnName(String cnName) {
|
||||
this.cnName = cnName;
|
||||
}
|
||||
|
||||
public String getEnName() {
|
||||
return enName;
|
||||
}
|
||||
|
||||
public void setEnName(String enName) {
|
||||
this.enName = enName;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public static String getTextByValue(String value,String cut) {
|
||||
TodoCenterStatusEnum[] values = values();
|
||||
for (TodoCenterStatusEnum todoCenterStatusEnum : values) {
|
||||
if (todoCenterStatusEnum.value.equals(value)) {
|
||||
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
|
||||
return todoCenterStatusEnum.cnName;
|
||||
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
|
||||
return todoCenterStatusEnum.enName;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.jero.modules.todoCenter.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 流程信息明细表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-10-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ProcessInfoDetailEOMapper extends BaseMapper<ProcessInfoDetailEO> {
|
||||
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.jero.modules.todoCenter.mapper;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.todoCenter.vo.ProcessInfoVO;
|
||||
|
||||
/**
|
||||
* @Description: 流程信息表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-10-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ProcessInfoEOMapper extends BaseMapper<ProcessInfoEO> {
|
||||
/**
|
||||
* 查询项目流程分页列表(已办、已发使用)
|
||||
* @param page
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
IPage<ProcessInfoVO> queryProjectProcessPageList(IPage page, Map<String, Object> params);
|
||||
|
||||
/**+
|
||||
* 查询项目流程-待办列表
|
||||
* @param page
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
IPage<ProcessInfoVO> queryProjectProcessTodoTaskListList(IPage page,Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 查询法规评估流程分页列表
|
||||
* @param page
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
IPage<ProcessInfoVO> queryLawsAssessPageList(IPage page, Map<String, Object> params);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.todoCenter.mapper.ProcessInfoDetailEOMapper">
|
||||
<resultMap id="ProcessInfoDetailEOResultMap" type="com.jero.modules.todoCenter.entity.ProcessInfoDetailEO">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="acti_proc_inst_id" property="actiProcInstId" />
|
||||
<result column="task_id" property="taskId" />
|
||||
<result column="user_id" property="userId" />
|
||||
<result column="status" property="status" />
|
||||
<result column="task_definition_key" property="taskDefinitionKey" />
|
||||
<result column="submit_time" property="submitTime" />
|
||||
<result column="process_info_id" property="processInfoId" />
|
||||
<result column="project_laws_inventory_id" property="projectLawsInventoryId" />
|
||||
<result column="buss_document_library_id" property="bussDocumentLibraryId" />
|
||||
<result column="flow_type" property="flowType" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+316
@@ -0,0 +1,316 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.todoCenter.mapper.ProcessInfoEOMapper">
|
||||
<resultMap id="ProcessInfoEOResultMap" type="com.jero.modules.todoCenter.entity.ProcessInfoEO">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="project_library_id" property="projectLibraryId" />
|
||||
<result column="project_laws_inventory_id" property="projectLawsInventoryId" />
|
||||
<result column="buss_document_library_id" property="bussDocumentLibraryId" />
|
||||
<result column="acti_proc_inst_id" property="actiProcInstId" />
|
||||
<result column="flow_type" property="flowType" />
|
||||
<result column="end_time" property="endTime" />
|
||||
<result column="status" property="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="BaseQuerySql">
|
||||
<where>
|
||||
<if test="params.projectName != null and params.projectName !=''">
|
||||
and (
|
||||
temp.project_name like CONCAT(CONCAT('%',#{params.projectName}),'%')
|
||||
or temp.year_name like CONCAT(CONCAT('%',#{params.projectName}),'%')
|
||||
)
|
||||
</if>
|
||||
<if test="params.standardInfo != null and params.standardInfo !=''">
|
||||
and temp.standard_info like CONCAT(CONCAT('%',#{params.standardInfo}),'%')
|
||||
</if>
|
||||
<if test="params.flowType != null and params.flowType !=''">
|
||||
and temp.flow_type = #{params.flowType}
|
||||
</if>
|
||||
<if test="params.status != null and params.status !=''">
|
||||
and temp.status = #{params.status}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="queryProjectProcessPageList" resultType="com.jero.modules.todoCenter.vo.ProcessInfoVO">
|
||||
select temp.* from (
|
||||
SELECT
|
||||
pi.id,
|
||||
pi.project_library_id,
|
||||
pi.project_laws_inventory_id,
|
||||
pi.buss_document_library_id,
|
||||
pi.acti_proc_inst_id,
|
||||
pni.project_name,
|
||||
pyni.year_name,
|
||||
pli.serial_number,
|
||||
pli.title,
|
||||
bdl.title_en,
|
||||
<if test="params.cut == 'cn'">
|
||||
concat(pli.serial_number,'、',pli.title) as standard_info,
|
||||
</if>
|
||||
<if test="params.cut == 'en'">
|
||||
concat(pli.serial_number,'、',bdl.title_en) as standard_info,
|
||||
</if>
|
||||
pi.flow_type,
|
||||
createBy.username as "create_by",
|
||||
pi.end_time,
|
||||
(
|
||||
select
|
||||
detail.task_id
|
||||
from
|
||||
process_info_detail detail
|
||||
where detail.process_info_id = pi.id and detail.user_id = #{params.currentUserId} order by submit_time desc limit 1
|
||||
) as task_id,
|
||||
(
|
||||
select
|
||||
detail.task_definition_key
|
||||
from
|
||||
process_info_detail detail
|
||||
where detail.process_info_id = pi.id and detail.user_id = #{params.currentUserId} order by submit_time desc limit 1
|
||||
) as task_definition_key,
|
||||
pi.status,
|
||||
pi.prc_num,
|
||||
pi.prc_name,
|
||||
plb.project_name_id,
|
||||
plb.target_market,
|
||||
plb.studio_engineer
|
||||
FROM
|
||||
process_info pi
|
||||
left join project_library_base plb on plb.id = pi.project_library_id
|
||||
left join project_name_info pni on pni.id = plb.project_name_id
|
||||
left join project_year_name_info pyni on pyni.id = plb.year_name_id
|
||||
left join project_laws_inventory pli on pi.project_laws_inventory_id = pli.id
|
||||
LEFT JOIN sys_user createBy on createBy.id = pi.create_by
|
||||
LEFT JOIN buss_document_library bdl ON pi.buss_document_library_id = bdl.id
|
||||
<where>
|
||||
and pi.id IN (
|
||||
SELECT
|
||||
pid.process_info_id
|
||||
FROM
|
||||
process_info_detail pid
|
||||
<where>
|
||||
pid.user_id = #{params.currentUserId}
|
||||
<if test="params.taskStatus != null and params.taskStatus != ''">
|
||||
and pid.status = #{params.taskStatus}
|
||||
</if>
|
||||
</where>
|
||||
)
|
||||
<if test="params.flowTypeList != null">
|
||||
and pi.flow_type in
|
||||
<foreach collection="params.flowTypeList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="params.queryType == 'issuedProcess'">
|
||||
<if test="params.createBy != null and params.createBy != ''">
|
||||
and pi.create_by = #{params.createBy}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
) temp
|
||||
<include refid="BaseQuerySql"/>
|
||||
order by temp.end_time desc
|
||||
</select>
|
||||
<select id="queryProjectProcessTodoTaskListList" resultType="com.jero.modules.todoCenter.vo.ProcessInfoVO">
|
||||
select temp.* from (
|
||||
SELECT
|
||||
pi.id,
|
||||
pi.project_library_id,
|
||||
pi.project_laws_inventory_id,
|
||||
pi.buss_document_library_id,
|
||||
pi.acti_proc_inst_id,
|
||||
pni.project_name,
|
||||
pyni.year_name,
|
||||
pli.serial_number,
|
||||
pli.title,
|
||||
bdl.title_en,
|
||||
<if test="params.cut == 'cn'">
|
||||
concat(pli.serial_number,'、',pli.title) as standard_info,
|
||||
</if>
|
||||
<if test="params.cut == 'en'">
|
||||
concat(pli.serial_number,'、',bdl.title_en) as standard_info,
|
||||
</if>
|
||||
pi.flow_type,
|
||||
createBy.username AS "create_by",
|
||||
pi.end_time,
|
||||
(
|
||||
select
|
||||
detail.task_id
|
||||
from
|
||||
process_info_detail detail
|
||||
where detail.process_info_id = pi.id and detail.user_id = #{params.currentUserId} and detail.`status` = 'NotDone' limit 1
|
||||
) as task_id,
|
||||
(
|
||||
select
|
||||
detail.task_definition_key
|
||||
from
|
||||
process_info_detail detail
|
||||
where detail.process_info_id = pi.id and detail.user_id = #{params.currentUserId} and detail.`status` = 'NotDone' limit 1
|
||||
) as task_definition_key,
|
||||
pi.STATUS,
|
||||
pi.prc_num,
|
||||
pi.prc_name,
|
||||
plb.project_name_id,
|
||||
plb.target_market,
|
||||
plb.studio_engineer
|
||||
FROM
|
||||
process_info pi
|
||||
LEFT JOIN project_library_base plb ON plb.id = pi.project_library_id
|
||||
LEFT JOIN project_name_info pni ON pni.id = plb.project_name_id
|
||||
LEFT JOIN project_year_name_info pyni ON pyni.id = plb.year_name_id
|
||||
LEFT JOIN project_laws_inventory pli ON pi.project_laws_inventory_id = pli.id
|
||||
LEFT JOIN sys_user createBy ON createBy.id = pi.create_by
|
||||
LEFT JOIN buss_document_library bdl ON pi.buss_document_library_id = bdl.id
|
||||
where
|
||||
(
|
||||
pi.id IN (
|
||||
SELECT
|
||||
pid.process_info_id
|
||||
FROM
|
||||
process_info_detail pid
|
||||
where pid.user_id = #{params.currentUserId} and pid.status = #{params.taskStatus}
|
||||
)
|
||||
)
|
||||
AND pi.flow_type IN
|
||||
<foreach collection="params.flowTypeList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
union
|
||||
SELECT
|
||||
pi.id,
|
||||
pi.project_library_id,
|
||||
pi.project_laws_inventory_id,
|
||||
pi.buss_document_library_id,
|
||||
pi.acti_proc_inst_id,
|
||||
pni.project_name,
|
||||
pyni.year_name,
|
||||
'--' as serial_number,
|
||||
'--' as standard_info,
|
||||
'' as title,
|
||||
'' as title_en,
|
||||
pi.flow_type,
|
||||
createBy.username AS "create_by",
|
||||
(
|
||||
select
|
||||
pid.end_time
|
||||
from
|
||||
process_info_detail pid
|
||||
where pid.process_info_id = pi.id and pid.STATUS = 'NotDone' order by pid.end_time asc limit 1
|
||||
) as end_time,
|
||||
'' as task_id,
|
||||
'' as task_definition_key,
|
||||
pi.STATUS,
|
||||
pi.prc_num,
|
||||
pi.prc_name,
|
||||
plb.project_name_id,
|
||||
plb.target_market,
|
||||
plb.studio_engineer
|
||||
FROM
|
||||
process_info pi
|
||||
LEFT JOIN project_library_base plb ON plb.id = pi.project_library_id
|
||||
LEFT JOIN project_name_info pni ON pni.id = plb.project_name_id
|
||||
LEFT JOIN project_year_name_info pyni ON pyni.id = plb.year_name_id
|
||||
LEFT JOIN project_laws_inventory pli ON pi.project_laws_inventory_id = pli.id
|
||||
LEFT JOIN sys_user createBy ON createBy.id = pi.create_by
|
||||
WHERE
|
||||
(
|
||||
pi.id IN (
|
||||
SELECT
|
||||
pid.process_info_id
|
||||
FROM
|
||||
process_info_detail pid
|
||||
where pid.user_id = #{params.currentUserId} and pid.status = #{params.taskStatus}
|
||||
)
|
||||
)
|
||||
AND pi.flow_type = #{params.qdqrFlowTypeValue}
|
||||
)temp
|
||||
<include refid="BaseQuerySql"/>
|
||||
order by temp.end_time asc
|
||||
</select>
|
||||
<select id="queryLawsAssessPageList" resultType="com.jero.modules.todoCenter.vo.ProcessInfoVO">
|
||||
select temp.* from (
|
||||
SELECT
|
||||
pi.id,
|
||||
pi.buss_document_library_id,
|
||||
bdl.serial_number,
|
||||
bdl.title,
|
||||
bdl.title_en,
|
||||
<if test="params.cut == 'cn'">
|
||||
concat(bdl.serial_number,'、',bdl.title) as standard_info,
|
||||
</if>
|
||||
<if test="params.cut == 'en'">
|
||||
concat(bdl.serial_number,'、',bdl.title_en) as standard_info,
|
||||
</if>
|
||||
pi.flow_type,
|
||||
pi.end_time,
|
||||
pi.STATUS,
|
||||
pi.prc_num,
|
||||
pi.prc_name,
|
||||
(
|
||||
select
|
||||
detail.task_id
|
||||
from
|
||||
process_info_detail detail
|
||||
where detail.process_info_id = pi.id and detail.user_id = #{params.currentUserId}
|
||||
<if test="params.taskStatus != null and params.taskStatus != ''">
|
||||
and detail.`status` = #{params.taskStatus}
|
||||
</if>
|
||||
order by detail.submit_time desc
|
||||
limit 1
|
||||
) as task_id,
|
||||
(
|
||||
select
|
||||
detail.task_definition_key
|
||||
from
|
||||
process_info_detail detail
|
||||
where detail.process_info_id = pi.id and detail.user_id = #{params.currentUserId}
|
||||
<if test="params.taskStatus != null and params.taskStatus != ''">
|
||||
and detail.`status` = #{params.taskStatus}
|
||||
</if>
|
||||
order by detail.submit_time desc
|
||||
limit 1
|
||||
) as task_definition_key,
|
||||
createBy.username AS create_by,
|
||||
pi.acti_proc_inst_id,
|
||||
pi.create_time
|
||||
FROM
|
||||
process_info pi
|
||||
LEFT JOIN buss_document_library bdl ON pi.buss_document_library_id = bdl.id
|
||||
LEFT JOIN sys_user createBy on createBy.id = pi.create_by
|
||||
<where>
|
||||
pi.flow_type IN
|
||||
<foreach collection="params.flowTypeList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and (
|
||||
pi.id IN (
|
||||
SELECT
|
||||
pid.process_info_id
|
||||
FROM
|
||||
process_info_detail pid
|
||||
where pid.user_id = #{params.currentUserId}
|
||||
<if test="params.taskStatus != null and params.taskStatus != ''">
|
||||
and pid.status = #{params.taskStatus}
|
||||
</if>
|
||||
)
|
||||
)
|
||||
<if test="params.queryType == 'issuedProcess'">
|
||||
and pi.create_by = #{params.createBy}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
) temp
|
||||
<include refid="BaseQuerySql"/>
|
||||
<if test="params.queryType == 'todoProcess' ">
|
||||
order by temp.end_time asc
|
||||
</if>
|
||||
<if test="params.queryType != 'todoProcess' ">
|
||||
order by temp.end_time desc
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.jero.modules.todoCenter.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.modules.todoCenter.vo.ParamsManifestTodoCenterEOPage;
|
||||
|
||||
/**
|
||||
* @Author: liyawei
|
||||
* @Description:
|
||||
* @Date: Created in 09:43 2022/10/11
|
||||
*/
|
||||
|
||||
public interface IParamsManifestTodoCenterService {
|
||||
|
||||
// 分页查询当前登录人待办清单列表
|
||||
IPage queryPage(ParamsManifestTodoCenterEOPage pageVO);
|
||||
}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
package com.jero.modules.todoCenter.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
||||
import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 流程信息明细表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-10-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IProcessInfoDetailEOService extends IService<ProcessInfoDetailEO> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param processInfoDetailEO
|
||||
* @return
|
||||
*/
|
||||
void add(ProcessInfoDetailEO processInfoDetailEO);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param processInfoDetailEO
|
||||
* @return
|
||||
*/
|
||||
void editById(ProcessInfoDetailEO processInfoDetailEO);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
ProcessInfoDetailEO queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ProcessInfoDetailEO> queryList();
|
||||
|
||||
/**
|
||||
* 流程调用
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
Result<?> processCall(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* 批量插入dre工程师的待办任务
|
||||
* @param processInfoDetailEOList
|
||||
*/
|
||||
void batchInsertDreUserTask(List<ProcessInfoDetailEO> processInfoDetailEOList);
|
||||
|
||||
/**
|
||||
* 更新待办中心流程信息明细表,处理人
|
||||
* @param projectLawsInventoryEO
|
||||
* @param pId
|
||||
* @param flowType
|
||||
*/
|
||||
void updateProcessInfoDetailUserId(ProjectLawsInventoryEO projectLawsInventoryEO, String pId, String flowType);
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
package com.jero.modules.todoCenter.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 流程信息表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-10-14
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IProcessInfoEOService extends IService<ProcessInfoEO> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param processInfoEO
|
||||
* @return
|
||||
*/
|
||||
void add(ProcessInfoEO processInfoEO);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param processInfoEO
|
||||
* @return
|
||||
*/
|
||||
void editById(ProcessInfoEO processInfoEO);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
ProcessInfoEO queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ProcessInfoEO> queryList();
|
||||
|
||||
/**
|
||||
* 流程调用
|
||||
* @param jsonObject
|
||||
* @return
|
||||
*/
|
||||
Result<?> processCall(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* 项目流程-待办任务列表
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
IPage projectProcessTodoTaskList(Map<String,Object> params);
|
||||
|
||||
/**
|
||||
* 项目流程-已办任务列表
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
IPage projectProcessDoneProcess(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 项目流程-已发任务列表
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
IPage projectProcessIssuedProcess(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 法规清单变更,清除对应待办中心数据。
|
||||
* @param params
|
||||
*/
|
||||
void change(Map<String,Object> params);
|
||||
|
||||
/**
|
||||
* 法规评估-待办任务列表
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
IPage lawsAssessTodoTaskList(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 法规评估-已办任务列表
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
IPage lawsAssessDoneProcess(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 法规评估-已发任务列表
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
IPage lawsAssessIssuedProcess(Map<String, Object> params);
|
||||
|
||||
Result<?> initHistoryData(Map<String, Object> params);
|
||||
}
|
||||
+140
@@ -0,0 +1,140 @@
|
||||
package com.jero.modules.todoCenter.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
|
||||
import com.jero.modules.cert.collect.enums.CollectManifestStateEnum;
|
||||
import com.jero.modules.cert.collect.enums.ManifestStateEnum;
|
||||
import com.jero.modules.cert.collect.mapper.ParamsCollectManifestEOMapper;
|
||||
import com.jero.modules.cert.collect.mapper.ParamsManifestEOMapper;
|
||||
import com.jero.modules.todoCenter.entity.ParamsManifestTodoCenterEO;
|
||||
import com.jero.modules.todoCenter.service.IParamsManifestTodoCenterService;
|
||||
import com.jero.modules.todoCenter.vo.ParamsManifestTodoCenterEOPage;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author: liyawei
|
||||
* @Description:
|
||||
* @Date: Created in 09:43 2022/10/11
|
||||
*/
|
||||
@Service
|
||||
public class ParamsManifestTodoCenterServiceImpl implements IParamsManifestTodoCenterService {
|
||||
@Autowired
|
||||
private ParamsCollectManifestEOMapper paramsCollectManifestEOMapper;
|
||||
|
||||
@Autowired
|
||||
private ParamsManifestEOMapper paramsManifestEOMapper;
|
||||
|
||||
@Override
|
||||
public IPage queryPage(ParamsManifestTodoCenterEOPage pageVO) {
|
||||
int pageNo = pageVO.getPageNo();
|
||||
int pageSize = pageVO.getPageSize();
|
||||
IPage page = new Page(pageNo, pageSize);
|
||||
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
|
||||
// 查询所有项目下的 状态为收集中的清单
|
||||
pageVO.setState(ManifestStateEnum.COLLECTING.getValue());
|
||||
pageVO.setUserId(loginUser.getId());
|
||||
pageVO.setUserName(loginUser.getUsername());
|
||||
List<ParamsManifestTodoCenterEO> paramsManifestEOListAll = paramsManifestEOMapper.listForTodoCenter(pageVO);
|
||||
|
||||
// 查询清单的所有参数项
|
||||
List<String> manifestIdList = paramsManifestEOListAll.stream().map(ParamsManifestTodoCenterEO::getId).collect(Collectors.toList());
|
||||
if (CollectionUtil.isEmpty(manifestIdList)) {
|
||||
return page;
|
||||
}
|
||||
List<ParamsCollectManifestEO> pcmListAll = paramsCollectManifestEOMapper.listInfoOfTodoCenter(manifestIdList);
|
||||
if (CollectionUtil.isEmpty(pcmListAll)) {
|
||||
return page;
|
||||
}
|
||||
|
||||
List<String> manifestIdListHomo = paramsManifestEOMapper.listInfoHomo(loginUser.getId(), ManifestStateEnum.COLLECTING.getValue());// 获取当前登录人 拥有认证工程师角色的清单
|
||||
for(ParamsManifestTodoCenterEO paramsManifestEO : paramsManifestEOListAll) {
|
||||
// 查询清单的所有参数项
|
||||
List<ParamsCollectManifestEO> pcmList = pcmListAll.stream().filter(e->paramsManifestEO.getId().equals(e.getParamsManifestId())).collect(Collectors.toList());
|
||||
int count1 = (int) pcmList.stream().filter(e-> CollectManifestStateEnum.SUBMIT.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.SYNC_REPORT.getValue().equals(e.getState())).count();
|
||||
if (count1 == pcmList.size()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
|
||||
if(CollectionUtil.isNotEmpty(manifestIdListHomo) && manifestIdListHomo.contains(paramsManifestEO.getId())) { // 认证工程师 可以看到三种数量
|
||||
// 统计待发起数量 包括状态:待发起收集,变更,工程接口人退回
|
||||
count = (int) pcmList.stream().filter(e -> CollectManifestStateEnum.WAIT_COLLECT.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.SDT_BACK.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.CHANGE.getValue().equals(e.getState())).count();
|
||||
if (count > 0) {
|
||||
paramsManifestEO.setWaitCollectNum(count);
|
||||
}
|
||||
|
||||
// 统计待分配数量 包括状态:待工程接口人处理,填写人退回
|
||||
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_SDT.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.DRE_BACK.getValue().equals(e.getState()))).count();
|
||||
if (count > 0) {
|
||||
paramsManifestEO.setWaitSdtNum(count);
|
||||
}
|
||||
|
||||
// 统计待填写数量 包括状态:待填写,认证工程师退回
|
||||
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_FILL.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.CERT_BACK.getValue().equals(e.getState()))).count();
|
||||
if (count > 0) {
|
||||
paramsManifestEO.setWaitFillNum(count);
|
||||
}
|
||||
} else { // 工程接口人和填写人 只能看到 工程接口人是自己 或 填写人是自己 的数量
|
||||
// 统计待分配数量 包括状态:待工程接口人处理,填写人退回
|
||||
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_SDT.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.DRE_BACK.getValue().equals(e.getState()))
|
||||
&& loginUser.getUsername().equals(e.getSdt())).count();
|
||||
if (count > 0) {
|
||||
paramsManifestEO.setWaitSdtNum(count);
|
||||
}
|
||||
|
||||
// 统计待填写数量 包括状态:待填写,认证工程师退回
|
||||
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_FILL.getValue().equals(e.getState())
|
||||
|| CollectManifestStateEnum.CERT_BACK.getValue().equals(e.getState()))
|
||||
&& loginUser.getUsername().equals(e.getDre())).count();
|
||||
if (count > 0) {
|
||||
paramsManifestEO.setWaitFillNum(count);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 分页
|
||||
List<ParamsManifestTodoCenterEO> paramsManifestEOList =paramsManifestEOListAll.stream()
|
||||
.filter(e->ObjectUtil.isNotNull(e.getWaitCollectNum()) || ObjectUtil.isNotNull(e.getWaitSdtNum()) || ObjectUtil.isNotNull(e.getWaitFillNum()))
|
||||
.sorted(Comparator.comparing(ParamsManifestTodoCenterEO::getCreateTime).reversed())
|
||||
.collect(Collectors.toList());
|
||||
List<ParamsManifestTodoCenterEO> result = new ArrayList<>();
|
||||
|
||||
int subSize = pageVO.getPageSize(); // 每页记录数
|
||||
int subCount = paramsManifestEOList.size(); // 总记录数
|
||||
int subPageTotal = (subCount / subSize) + ((subCount % subSize > 0) ? 1 : 0); //总页数
|
||||
// 分页计算
|
||||
int fromIndex = (pageNo-1) * subSize;
|
||||
int toIndex = ((pageNo == subPageTotal) ? subCount : (pageNo * subSize));
|
||||
if( fromIndex <= subCount && toIndex <= subCount) {
|
||||
result = paramsManifestEOList.subList(fromIndex, toIndex);
|
||||
} else {
|
||||
result = new ArrayList();
|
||||
}
|
||||
|
||||
page.setTotal(paramsManifestEOList.size());
|
||||
page.setRecords(result);
|
||||
return page;
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user