Merge branch 'dev_2nd_period_test' into 'dev_third_stage'

# Conflicts:
#   jero-web/src/common/lang/en-us.js
#   jero-web/src/common/lang/zh-cn.js
#   jero-web/src/views/projectManagement/components/TaskList.vue
#   jero-web/src/views/projectManagement/components/cuibanModel.vue
This commit is contained in:
787203167
2022-11-03 14:39:38 +08:00
148 changed files with 17095 additions and 1741 deletions
@@ -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';
@@ -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;
}
}
@@ -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;
}
}
@@ -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;
}
}
@@ -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);
@@ -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,47 @@ 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;
meta.put("existTask",existTaskFlag);
}
json.put("meta", meta);
}
@@ -157,4 +157,8 @@ public class SysAnnouncement implements Serializable {
* 发起人
*/
private java.lang.String initiator;
private java.lang.String msgContentCn;//消息的中文(不带标签)
private java.lang.String msgContentInfoCn;//消息的中文(带标签)
}
@@ -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;
}
}
@@ -0,0 +1,14 @@
package com.jero.modules.system.mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Map;
/**
* 待办中心mapper层
* @Author: wzj
* @Date: 2022/10/26 16:41
**/
public interface TodoCenterMapper {
int todoCenterTaskCount(@Param("params") Map<String, Object> params);
}
@@ -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'
@@ -0,0 +1,21 @@
<?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>
</mapper>
@@ -87,4 +87,8 @@ public class AnnouncementSendModel implements Serializable {
*/
private java.lang.String initiator;
private java.lang.String msgContentCn;//消息的中文(不带标签)
private java.lang.String msgContentInfoCn;//消息的中文(带标签)
}
@@ -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;
@@ -530,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);
}
/**
* 调整责任领域
*
@@ -103,4 +103,10 @@ public class ParamsManifestEO implements Serializable {
@TableField(exist = false)
private String projectName;
//相关项目版本
private String projectVersion;
//说明
private String explanation;
}
@@ -17,11 +17,13 @@ import java.util.Map;
public interface ParamsCollectManifestEOMapper extends BaseMapper<ParamsCollectManifestEO> {
List<ParamsCollectManifestEO> listInfo(@Param("paramsCollectManifestEO") ParamsCollectManifestEO paramsCollectManifestEO);
List<Map<String, Object>> listInfoForExport(@Param("paramsCollectManifestEO") ParamsCollectManifestEO paramsCollectManifestEO);
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);
}
@@ -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,6 +26,8 @@ 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);
@@ -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,20 @@
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
</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 +117,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>
@@ -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,35 @@
</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}
<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 +164,4 @@
where project_id = #{projectId}
order by create_time desc
</select>
</mapper>
</mapper>
@@ -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;
@@ -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) throws IOException;
Result<?> importData(List<Map<String, Object>> dataList,
String unzipfilepath,
String cut,
String paramsManifestId) throws IOException;
// 调整责任领域
List<String> updateBatchDutyTerritory(ParamsCollectManifestVO paramsCollectManifestVO);
//监控参数收集任务的截止时间并根据时间段发送飞书
void checkDeadline();
}
@@ -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) {
@@ -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-----------");
}
}
@@ -24,4 +24,10 @@ public class ParamsManifestVO {
private String ids;
private String cut;
private String sourceManifestId;
//相关项目版本
private String projectVersion;
//说明
private String explanation;
}
@@ -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;
}
}
@@ -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;
}
}
@@ -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;
}
}
@@ -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
@@ -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;
@@ -370,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){
//没有添加过需要进行第一次添加
@@ -411,31 +414,83 @@ 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 contentNo = "The "+ baseEO.getName()+" virtual list you subscribed to has been updated as follows" + sbContentNo;
//消息英文--带标签
String contentYes = "The "+ baseEO.getName()+" 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 = "您所订阅的"+baseEO.getName()+"虚拟清单已更新,更新内容如下:"+"</br>"+sbContentInfoYes;
List<String> userNameList = dummyReadEOService.queryReadUserInfo(dummyInventoryBaseEO.getId());
List<String> thirdIdList = new ArrayList<>();
if(userNameList.size() != 0){
@@ -444,7 +499,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);
}
@@ -453,7 +515,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();
}
@@ -486,7 +556,16 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
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());
String contentCn = "您订阅的虚拟清单"+ baseEO.getName()+"已被撤回.";
String contentInfoEn = "Please note that the "+ baseEO.getName()+" virtual list you subscribed to has been withdrawn.";
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList,
title,
contentInfoEn,
contentInfoEn,
MessageTypeEnum.READ.getValue(),
MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
contentCn,contentCn);
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
bussDocumentLibraryEOService.sendWebsocket(dummyInventoryBaseEO.getId(), title);
}
@@ -494,8 +573,15 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
//飞书
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=维护虚拟清单";
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentInfoTemp, MessageTypeEnum.PUSH.getName(), href);
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();
@@ -1358,7 +1444,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);
//飞书
@@ -1372,7 +1465,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);
//飞书
@@ -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;
}
@@ -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);
}
}
}
@@ -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; //在产车实施日期
}
@@ -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);
}
}
}*/
});
}
@@ -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("手动结束成功!");
@@ -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);
}
}
}
});
}
@@ -14,4 +14,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface LawsTechnologyEvaluationFlowDetailEOMapper extends BaseMapper<LawsTechnologyEvaluationFlowDetailEO> {
LawsTechnologyEvaluationFlowDetailEO queryByEvaluationId(@Param("lawsTechnologyEvaluationId") String lawsTechnologyEvaluationId);
}
@@ -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>
@@ -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);
}
}
}
@@ -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,45 @@ 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.";
//发送消息(站内和飞书)
//您发布的问题知识库信息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,
contentENNo,
MessageTypeEnum.PUSH.getValue(),
MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
contentCNNo,
contentCNNo);
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(href);
feishuMsgVo.setContentEn(contentENNo);
feishuMsgVo.setContent(contentCNNo);
try {
this.iFeishuService.sendCardMsgTerritory(sysUser.getThirdId().split(","), feishuMsgVo);
} catch (IOException e) {
e.printStackTrace();
}
// }
}
/**
* 更新
@@ -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;
}
}
@@ -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);
}
}
@@ -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);
}
}
@@ -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);
}
}
@@ -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;//降序
}
}
@@ -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;
}
}
@@ -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",""),
@@ -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;
@@ -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;
}
}
@@ -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("清单确认流程,定时任务结束 =====================================================");
}
}
@@ -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());
}
}
}
@@ -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("任务确认流程,定时任务结束 =====================================================");
}
}
@@ -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());
}
}
}
@@ -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());
}
}
}
@@ -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);
@@ -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>
@@ -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 != ''">-->
<!-- &lt;!&ndash;搜索条件:项目名称,包含%,单独搜索&ndash;&gt;-->
<!-- <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>-->
<!-- &lt;!&ndash;搜索条件:目标市场&ndash;&gt;-->
<!-- <if test="params.targetMarket != null and params.targetMarket != '' ">-->
<!-- and plb.target_market like concat('%',#{params.targetMarket},'%')-->
<!-- </if>-->
<!-- &lt;!&ndash;搜索条件:项目状态&ndash;&gt;-->
<!-- <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 != ''">-->
<!-- &lt;!&ndash;搜索条件:studio工程师,包含%,单独搜索&ndash;&gt;-->
<!-- <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 != ''">-->
<!-- &lt;!&ndash;搜索条件:认证工程师,包含%,单独搜索&ndash;&gt;-->
<!-- <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>-->
<!-- &lt;!&ndash;搜索条件:车型平台&ndash;&gt;-->
<!-- <if test="params.vehiclePlatform != null and params.vehiclePlatform != '' ">-->
<!-- and plb.vehicle_platform like concat('%',#{params.vehiclePlatform},'%')-->
<!-- </if>-->
<!-- &lt;!&ndash;搜索条件:数字平台&ndash;&gt;-->
<!-- <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"/>
@@ -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);
}
@@ -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);
}
@@ -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);
}
@@ -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;
@@ -26,13 +44,16 @@ import com.jero.modules.system.service.ISysDictService;
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 +61,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;
/**
@@ -131,8 +160,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 +225,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,7 +339,7 @@ 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);
List<ProjectLibraryBase> projectLibraryBases = this.queryById(id,null);
if(!loginUser.getUsername().equals(projectLibraryBases.get(0).getCreateBy())){
if(CutEnum.CN.getValue().equals(cut)){
throw new JeroBootException("该条项目非本人创建,不能删除");
@@ -335,12 +421,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 +469,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 +852,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 +933,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 +1250,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;
}
}
@@ -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{//责任领域不能为空,报错
@@ -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("飞书消息推送失败");
}
}
}
}
@@ -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);
@@ -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());
}
}
}
@@ -387,11 +471,11 @@ 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)) {
@@ -400,48 +484,99 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
SysUser sysUser = this.sysUserService.getBaseMapper().selectOne(queryOneWrapper);
initiator = sysUser.getUsername();
}
feishuMsgVo.setInitiator(initiator);
//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 = "您好,"+ initiator +"向您提交了工程交付信息,请及时查看处理";
cnContentLower = "项目: " + projectName +
"\n法规: " + LAW_CN +
"\n发起人: " + currentUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getDesignDueDate());
enContentUpper = "Hello! "+ initiator +" 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 = "您好,"+ initiator +"向您提交了工程交付信息,请及时查看处理";
cnContentLower = "项目: " + projectName +
"\n法规: " + LAW_CN +
"\n发起人: " + currentUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getPrehomoDueDate());
enContentUpper = "Hello! "+ initiator +" 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 = "您好,"+ initiator +"向您提交了工程交付信息,请及时查看处理";
cnContentLower = "项目: " + projectName +
"\n法规: " + LAW_CN +
"\n发起人: " + currentUser.getUsername() +
"\n截止时间: " + sdf.format(projectLawsInventoryEO.getVerifyDueDate());
enContentUpper = "Hello! "+ initiator +" 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;
}
//飞书跳转链接
@@ -451,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());
}
}
}
@@ -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;
}
@@ -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);
}
}
@@ -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);
}
}
@@ -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);
}
}
@@ -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);
}
}
@@ -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);
}
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
}
@@ -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> {
}
@@ -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);
}
@@ -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>
@@ -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>
@@ -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);
}
@@ -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);
}
@@ -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);
}
@@ -0,0 +1,350 @@
package com.jero.modules.todoCenter.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.CollectManifestUserTypeEnum;
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.project.entity.ProjectLibraryBase;
import com.jero.modules.project.entity.ProjectRelatedPersonnel;
import com.jero.modules.project.mapper.ProjectLibraryBaseMapper;
import com.jero.modules.project.service.IProjectRelatedPersonnelService;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.todoCenter.entity.ParamsManifestTodoCenterEO;
import com.jero.modules.todoCenter.service.IParamsManifestTodoCenterService;
import com.jero.modules.todoCenter.vo.ParamsManifestTodoCenterEOPage;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Author: liyawei
* @Description:
* @Date: Created in 09:43 2022/10/11
*/
@Service
public class ParamsManifestTodoCenterServiceImpl implements IParamsManifestTodoCenterService {
@Autowired
private ProjectLibraryBaseMapper projectLibraryBaseMapper;
@Autowired
private ISysUserService sysUserService;
@Autowired
private IProjectRelatedPersonnelService projectRelatedPersonnelService;
@Autowired
private ParamsCollectManifestEOMapper paramsCollectManifestEOMapper;
@Autowired
private ParamsManifestEOMapper paramsManifestEOMapper;
@Override
public IPage queryPage(ParamsManifestTodoCenterEOPage pageVO) {
// 查询所有项目下的 状态为收集中的清单
pageVO.setState(ManifestStateEnum.COLLECTING.getValue());
List<ParamsManifestTodoCenterEO> paramsManifestEOListAll = paramsManifestEOMapper.listForTodoCenter(pageVO);
// 筛选出当前登录人能在清单中是homo/sdt/dre角色的清单并分页
LambdaQueryWrapper<ProjectLibraryBase> projectLibraryBaseLambdaQueryWrapper = new LambdaQueryWrapper<>();
List<ProjectLibraryBase> projectLibraryBaseListAll = projectLibraryBaseMapper.selectList(projectLibraryBaseLambdaQueryWrapper);
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
List<ParamsManifestTodoCenterEO> paramsManifestEOList = new ArrayList<>();
List<ProjectLibraryBase> projectLibraryBaseList = new ArrayList<>();
Map<String, Boolean> manifestUserTypeOfHomo = new HashMap<>();
Map<String, Boolean> manifestUserTypeOfSdt = new HashMap<>();
Map<String, Boolean> manifestUserTypeOfDre = new HashMap<>();
Map<String, List<ParamsCollectManifestEO>> paramsManifestEOListMap = new HashMap<>();
// 查询清单的所有参数项
List<ParamsCollectManifestEO> pcmListAll = paramsCollectManifestEOMapper.listInfoOfTodoCenter();
String userType = "";
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;
}
// 判断是不是homo角色
projectLibraryBaseList = projectLibraryBaseListAll.stream().filter(e->paramsManifestEO.getProjectId().equals(e.getId())).collect(Collectors.toList());
userType = getLoginUserTypeOfHomo(projectLibraryBaseList, loginUser);
if(StringUtils.isNotBlank(userType)) {
paramsManifestEOList.add(paramsManifestEO);
manifestUserTypeOfHomo.put(paramsManifestEO.getId(), true);
paramsManifestEOListMap.put(paramsManifestEO.getId(), pcmList);
continue;
}
// 判断是不是sdt角色
userType = getLoginUserTypeOfSdt(pcmList, loginUser);
if(StringUtils.isNotBlank(userType)) {
paramsManifestEOList.add(paramsManifestEO);
manifestUserTypeOfSdt.put(paramsManifestEO.getId(), true);
paramsManifestEOListMap.put(paramsManifestEO.getId(), pcmList);
continue;
}
// 判断是不是dre角色
userType = getLoginUserTypeOfDre(pcmList, loginUser);
if(StringUtils.isNotBlank(userType)) {
paramsManifestEOList.add(paramsManifestEO);
manifestUserTypeOfDre.put(paramsManifestEO.getId(), true);
paramsManifestEOListMap.put(paramsManifestEO.getId(), pcmList);
continue;
}
}
// 分页
paramsManifestEOList = paramsManifestEOList.stream()
.sorted(Comparator.comparing(ParamsManifestTodoCenterEO::getCreateTime).reversed())
.collect(Collectors.toList());
List<ParamsManifestTodoCenterEO> result = new ArrayList<>();
int pageNo = pageVO.getPageNo();
int pageSize = pageVO.getPageSize();
IPage page = new Page(pageNo, pageSize);
page.setTotal(paramsManifestEOList.size());
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();
}
// 统计清单中的待办参数数据
List<ParamsManifestTodoCenterEO> records = getStatistics(result, manifestUserTypeOfHomo, manifestUserTypeOfSdt, manifestUserTypeOfDre, paramsManifestEOListMap,loginUser);
page.setRecords(records);
return page;
}
public List<ParamsManifestTodoCenterEO> getStatistics(List<ParamsManifestTodoCenterEO> paramsManifestEOList, Map<String, Boolean> manifestUserTypeOfHomo
,Map<String, Boolean> manifestUserTypeOfSdt, Map<String, Boolean> manifestUserTypeOfDre, Map<String, List<ParamsCollectManifestEO>> paramsManifestEOListMap, LoginUser loginUser) {
List<ParamsManifestTodoCenterEO> paramsManifestTodoCenterEOList = new ArrayList<>();
for(ParamsManifestTodoCenterEO paramsManifestTodoCenterEO : paramsManifestEOList) {
// 查询清单的所有参数项
ParamsCollectManifestEO paramsCollectManifestEO = new ParamsCollectManifestEO();
paramsCollectManifestEO.setParamsManifestId(paramsManifestTodoCenterEO.getId());
List<ParamsCollectManifestEO> pcmList = paramsManifestEOListMap.get(paramsManifestTodoCenterEO.getId());
int count = 0;
if (ObjectUtil.isNotEmpty(paramsManifestTodoCenterEO.getId())
&& ObjectUtil.isNotEmpty(manifestUserTypeOfHomo.get(paramsManifestTodoCenterEO.getId()))) {
// 统计待发起数量 包括状态待发起收集,变更,工程接口人退回
count = (int) pcmList.stream().filter(e-> CollectManifestStateEnum.WAIT_COLLECT.getValue().equals(e.getState())
|| CollectManifestStateEnum.SDT_BACK.getValue().equals(e.getState())
|| CollectManifestStateEnum.CHANGE.getValue().equals(e.getState())).count();
if (count > 0) {
paramsManifestTodoCenterEO.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) {
paramsManifestTodoCenterEO.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) {
paramsManifestTodoCenterEO.setWaitFillNum(count);
}
} else if (ObjectUtil.isNotEmpty(paramsManifestTodoCenterEO.getId())
&& ObjectUtil.isNotEmpty(manifestUserTypeOfSdt.get(paramsManifestTodoCenterEO.getId()))) {
// 统计待分配数量 包括状态待工程接口人处理,填写人退回
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_SDT.getValue().equals(e.getState())
|| CollectManifestStateEnum.DRE_BACK.getValue().equals(e.getState()))
&& loginUser.getUsername().equals(e.getSdt())).count();
if (count > 0) {
paramsManifestTodoCenterEO.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) {
paramsManifestTodoCenterEO.setWaitFillNum(count);
}
} else if (ObjectUtil.isNotEmpty(paramsManifestTodoCenterEO.getId())
&& ObjectUtil.isNotEmpty(manifestUserTypeOfDre.get(paramsManifestTodoCenterEO.getId()))) {
// 统计待填写数量 包括状态待填写,认证工程师退回
count = (int) pcmList.stream().filter(e-> (CollectManifestStateEnum.WAIT_FILL.getValue().equals(e.getState())
|| CollectManifestStateEnum.CERT_BACK.getValue().equals(e.getState()))
&& loginUser.getUsername().equals(e.getDre())).count();
if (count > 0) {
paramsManifestTodoCenterEO.setWaitFillNum(count);
}
}
paramsManifestTodoCenterEOList.add(paramsManifestTodoCenterEO);
}
return paramsManifestTodoCenterEOList;
}
/**
* 根据项目id清单id查询当前登录人的Homo角色
* @param projectId
* @param paramsManifestId
* @return
*/
public List<String> getLoginUserTypes(String projectId, String paramsManifestId, LoginUser loginUser) {
List<String> userTypeList = new ArrayList<>(); // 一个用户可以有多个用户类型
// LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
// 查询项目下所有责任领域下的 homo人员
List<ProjectLibraryBase> projectLibraryBaseList = projectLibraryBaseMapper.queryById(projectId);
List<String> homoList = new ArrayList<>();
if (CollectionUtil.isNotEmpty(projectLibraryBaseList)) {
String homoIdStr = projectLibraryBaseList.get(0).getCertificationEngineer();
if (StringUtils.isNotEmpty(homoIdStr)) {
List<String> homoIdList = Arrays.asList(homoIdStr.split(",")).stream().distinct().collect(Collectors.toList());
homoList = sysUserService.listByIds(homoIdList).stream().map(SysUser::getUsername).collect(Collectors.toList());
}
}
// 查询项目下所有责任领域下的 sdt人员
List<String> sdtList = new ArrayList<>();
LambdaQueryWrapper<ProjectRelatedPersonnel> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ProjectRelatedPersonnel::getProjectId, projectId);
List<ProjectRelatedPersonnel> prpList = projectRelatedPersonnelService.list(queryWrapper);
// String homoIdStr = prpList.stream().map(e -> e.getCertificationEngineer()).collect(Collectors.joining(","));
String sdtIdStr = prpList.stream().map(e -> e.getEngineeringInterfacePerson()).collect(Collectors.joining(","));
// 项目下有homo-->不一定有sdt
if(StringUtils.isNotBlank(sdtIdStr)) {
List<String> sdtIdList = Arrays.asList(sdtIdStr.split(",")).stream().distinct().collect(Collectors.toList());
sdtList = sysUserService.listByIds(sdtIdList).stream().map(SysUser::getUsername).collect(Collectors.toList());
}
// 查询项目下参数清单下收集参数项中的 sdt,dre人员
ParamsCollectManifestEO paramsCollectManifestEO = new ParamsCollectManifestEO();
paramsCollectManifestEO.setParamsManifestId(paramsManifestId);
List<ParamsCollectManifestEO> pcmList = paramsCollectManifestEOMapper.listInfo(paramsCollectManifestEO);
List<String> sdtListOfPCM = pcmList.stream()
.filter(e->StringUtils.isNotEmpty(e.getSdt()))
.map(ParamsCollectManifestEO::getSdt)
.distinct()
.collect(Collectors.toList());
sdtList.addAll(sdtListOfPCM); // 需要取并集因为存在参数项开始收集但 人员相关名单中sdt被修改的情况
List<String> dreListOfPCM = pcmList.stream()
.filter(e->StringUtils.isNotEmpty(e.getDre()))
.map(ParamsCollectManifestEO::getDre)
.distinct()
.collect(Collectors.toList());
String loginUserName = loginUser.getUsername().toLowerCase();
homoList = toLowerCaseOfList(homoList);
sdtList = toLowerCaseOfList(sdtList);
dreListOfPCM = toLowerCaseOfList(dreListOfPCM);
if (homoList.contains(loginUserName)) {
userTypeList.add(CollectManifestUserTypeEnum.HOMO.getValue());
}
if (sdtList.contains(loginUserName)) {
userTypeList.add(CollectManifestUserTypeEnum.SDT.getValue());
}
if (dreListOfPCM.contains(loginUserName)) {
userTypeList.add(CollectManifestUserTypeEnum.DRE.getValue());
}
return userTypeList;
}
public String getLoginUserTypeOfHomo(List<ProjectLibraryBase> projectLibraryBaseList, LoginUser loginUser) {
String userType = ""; // 一个用户可以有多个用户类型
// 查询项目下的 homo人员
List<String> homoList = new ArrayList<>();
if (CollectionUtil.isNotEmpty(projectLibraryBaseList)) {
String homoIdStr = projectLibraryBaseList.get(0).getCertificationEngineer();
if (StringUtils.isNotEmpty(homoIdStr)) {
List<String> homoIdList = Arrays.asList(homoIdStr.split(",")).stream().distinct().collect(Collectors.toList());
homoList = sysUserService.listByIds(homoIdList).stream().map(SysUser::getUsername).collect(Collectors.toList());
}
}
String loginUserName = loginUser.getUsername().toLowerCase();
homoList = toLowerCaseOfList(homoList);
if (homoList.contains(loginUserName)) {
userType = CollectManifestUserTypeEnum.HOMO.getValue();
}
return userType;
}
public String getLoginUserTypeOfSdt(List<ParamsCollectManifestEO> pcmList, LoginUser loginUser) {
String userType = ""; // 一个用户可以有多个用户类型
List<String> sdtListOfPCM = pcmList.stream()
.filter(e->StringUtils.isNotEmpty(e.getSdt()))
.map(ParamsCollectManifestEO::getSdt)
.distinct()
.collect(Collectors.toList());
String loginUserName = loginUser.getUsername().toLowerCase();
sdtListOfPCM = toLowerCaseOfList(sdtListOfPCM);
if (sdtListOfPCM.contains(loginUserName)) {
userType = CollectManifestUserTypeEnum.SDT.getValue();
}
return userType;
}
public String getLoginUserTypeOfDre(List<ParamsCollectManifestEO> pcmList, LoginUser loginUser) {
String userType = ""; // 一个用户可以有多个用户类型
List<String> dreListOfPCM = pcmList.stream()
.filter(e->StringUtils.isNotEmpty(e.getDre()))
.map(ParamsCollectManifestEO::getDre)
.distinct()
.collect(Collectors.toList());
String loginUserName = loginUser.getUsername().toLowerCase();
dreListOfPCM = toLowerCaseOfList(dreListOfPCM);
if (dreListOfPCM.contains(loginUserName)) {
userType = CollectManifestUserTypeEnum.DRE.getValue();
}
return userType;
}
private List<String> toLowerCaseOfList(List<String> list) {
List<String> newList = list;
if (CollectionUtil.isNotEmpty(list)) {
newList = list.stream().map(String::toLowerCase).collect(Collectors.toList());
}
return newList;
}
}
@@ -0,0 +1,226 @@
package com.jero.modules.todoCenter.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.jero.common.api.vo.Result;
import com.jero.common.exception.JeroBootException;
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
import com.jero.modules.project.enums.OperatorTypeEnum;
import com.jero.modules.project.enums.RequestSourceEnum;
import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO;
import com.jero.modules.todoCenter.mapper.ProcessInfoDetailEOMapper;
import com.jero.modules.todoCenter.service.IProcessInfoDetailEOService;
import com.jero.modules.wkflow.enums.DesignComplianceNodeEnum;
import com.jero.modules.wkflow.enums.FlowTypeEnum;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Date;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
/**
* @Description: 流程信息明细表
* @Author: jero-boot
* @Date: 2022-10-14
* @Version: V1.0
*/
@Service
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
public class ProcessInfoDetailEOServiceImpl extends ServiceImpl<ProcessInfoDetailEOMapper, ProcessInfoDetailEO> implements IProcessInfoDetailEOService {
/**
* 保存
*
* @param processInfoDetailEO
* @return
*/
@Override
public void add(ProcessInfoDetailEO processInfoDetailEO) {
Date now = new Date();
processInfoDetailEO.setCreateTime(now);
processInfoDetailEO.setUpdateTime(now);
save(processInfoDetailEO);
}
/**
* 更新
*
* @param processInfoDetailEO
* @return
*/
@Override
public void editById(ProcessInfoDetailEO processInfoDetailEO) {
Date now = new Date();
processInfoDetailEO.setUpdateTime(now);
saveOrUpdate(processInfoDetailEO);
}
/**
* 通过id删除
*
* @param id
* @return
*/
@Override
public void deleteById(String id) {
removeById(id);
}
/**
* 批量删除
*
* @param ids
* @return
*/
@Override
public void deleteByIds(List<String> ids) {
removeByIds(ids);
}
/**
* 通过id查询
*
* @param id
* @return
*/
@Override
public ProcessInfoDetailEO queryById(String id) {
return getById(id);
}
/**
* 列表查询
*
* @return
*/
@Override
public List<ProcessInfoDetailEO> queryList() {
return list();
}
@Override
public Result<?> processCall(JSONObject jsonObject) {
String requestSource = jsonObject.getString("requestSource");
if(StringUtils.isEmpty(requestSource)){
throw new JeroBootException("请求来源不能为空!");
}
if(!StringUtils.equals(requestSource, RequestSourceEnum.WORK_FLOW.getValue())){
throw new JeroBootException("来源有误,没有权限调用该接口!");
}
String operatorType = jsonObject.getString("operatorType");
if(StringUtils.isEmpty(operatorType)){
throw new JeroBootException("操作类型不能为空!");
}
if(StringUtils.equals(operatorType, OperatorTypeEnum.ADD.getValue())){
JSONArray processInfoDetailList = jsonObject.getJSONArray("processInfoDetailList");
ProcessInfoDetailEO processInfoDetailEO = null;
List<ProcessInfoDetailEO> detailEOList = new ArrayList<>();
for (Object processInfoDetail : processInfoDetailList) {
processInfoDetailEO = JSONObject.parseObject(JSONObject.toJSONString(processInfoDetail), ProcessInfoDetailEO.class);
// 当前流程 当前用户 的数据删掉 确保唯一
QueryWrapper<ProcessInfoDetailEO> deleteWrapper = new QueryWrapper<>();
deleteWrapper.lambda().eq(ProcessInfoDetailEO::getActiProcInstId,processInfoDetailEO.getActiProcInstId());
deleteWrapper.lambda().eq(ProcessInfoDetailEO::getUserId,processInfoDetailEO.getUserId());
deleteWrapper.lambda().eq(ProcessInfoDetailEO::getFlowType,processInfoDetailEO.getFlowType());
this.baseMapper.delete(deleteWrapper);
detailEOList.add(processInfoDetailEO);
}
this.saveBatch(detailEOList);
}else if(StringUtils.equals(operatorType, OperatorTypeEnum.UPDATE.getValue())){
ProcessInfoDetailEO processInfoDetailEO = JSONObject.parseObject(jsonObject.toString(), ProcessInfoDetailEO.class);
this.baseMapper.updateById(processInfoDetailEO);
}else if(StringUtils.equals(operatorType, OperatorTypeEnum.QUERY.getValue())){
String userId = jsonObject.getString("userId");
String flowType = jsonObject.getString("flowType");
String actiProcInstId = jsonObject.getString("actiProcInstId");
QueryWrapper<ProcessInfoDetailEO> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(ProcessInfoDetailEO::getUserId,userId);
queryWrapper.lambda().eq(ProcessInfoDetailEO::getFlowType,flowType);
queryWrapper.lambda().eq(ProcessInfoDetailEO::getActiProcInstId,actiProcInstId);
queryWrapper.isNull("task_id");
List<ProcessInfoDetailEO> processInfoDetailEOList = this.baseMapper.selectList(queryWrapper);
Result<List<ProcessInfoDetailEO>> objectResult = new Result<>();
objectResult.setResult(processInfoDetailEOList);
objectResult.setSuccess(true);
return objectResult;
}else if(StringUtils.equals(operatorType, OperatorTypeEnum.UPDATE_PROCESS_INFO_DETAIL_BY_TASK_ID.getValue())){
String taskId = jsonObject.getString("taskId");
String taskStatus = jsonObject.getString("taskStatus");
LambdaUpdateWrapper<ProcessInfoDetailEO> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(ProcessInfoDetailEO::getStatus,taskStatus);
updateWrapper.set(ProcessInfoDetailEO::getSubmitTime,new Date());
updateWrapper.eq(ProcessInfoDetailEO::getTaskId,taskId);
this.update(updateWrapper);
}
return new Result<>().success("调用成功!");
}
@Override
public void batchInsertDreUserTask(List<ProcessInfoDetailEO> processInfoDetailEOList) {
processInfoDetailEOList.forEach(detail -> {
QueryWrapper<ProcessInfoDetailEO> removeWrap = new QueryWrapper<>();
removeWrap.lambda().eq(ProcessInfoDetailEO::getUserId,detail.getUserId());
removeWrap.lambda().eq(ProcessInfoDetailEO::getFlowType,detail.getFlowType());
removeWrap.lambda().eq(ProcessInfoDetailEO::getActiProcInstId,detail.getActiProcInstId());
removeWrap.lambda().eq(ProcessInfoDetailEO::getTaskDefinitionKey,detail.getTaskDefinitionKey());
this.remove(removeWrap);
});
this.saveBatch(processInfoDetailEOList);
}
@Override
public void updateProcessInfoDetailUserId(ProjectLawsInventoryEO projectLawsInventoryEO, String pId, String flowType) {
QueryWrapper<ProcessInfoDetailEO> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(ProcessInfoDetailEO::getActiProcInstId,pId);
queryWrapper.lambda().eq(ProcessInfoDetailEO::getFlowType,flowType);
List<ProcessInfoDetailEO> processInfoDetailEOList = this.list(queryWrapper);
if(CollectionUtils.isNotEmpty(processInfoDetailEOList)){
for (ProcessInfoDetailEO processInfoDetailEO : processInfoDetailEOList) {
if(StringUtils.equals(flowType, FlowTypeEnum.SJFHXSHLC.getValue())){
if(StringUtils.equals(processInfoDetailEO.getTaskDefinitionKey(), DesignComplianceNodeEnum.THE_RESPONSIBLE_PERSON_HANDLES_THE_TASK.getKey())){
//更新责任人的任务
processInfoDetailEO.setUserId(projectLawsInventoryEO.getDesignDutyId());
}
if(StringUtils.equals(processInfoDetailEO.getTaskDefinitionKey(), DesignComplianceNodeEnum.SPONSOR_REVIEW.getKey())){
//更新发起人的任务
processInfoDetailEO.setUserId(projectLawsInventoryEO.getDesignInitiatorId());
}
}
if(StringUtils.equals(flowType, FlowTypeEnum.PREHOMOQRLC.getValue())){
if(StringUtils.equals(processInfoDetailEO.getTaskDefinitionKey(), DesignComplianceNodeEnum.THE_RESPONSIBLE_PERSON_HANDLES_THE_TASK.getKey())){
//更新责任人的任务
processInfoDetailEO.setUserId(projectLawsInventoryEO.getPrehomoDutyId());
}
if(StringUtils.equals(processInfoDetailEO.getTaskDefinitionKey(), DesignComplianceNodeEnum.SPONSOR_REVIEW.getKey())){
//更新发起人的任务
processInfoDetailEO.setUserId(projectLawsInventoryEO.getPrehomoInitiatorId());
}
}
if(StringUtils.equals(flowType,FlowTypeEnum.YZFHXSCLC.getValue())){
if(StringUtils.equals(processInfoDetailEO.getTaskDefinitionKey(), DesignComplianceNodeEnum.THE_RESPONSIBLE_PERSON_HANDLES_THE_TASK.getKey())){
//更新责任人的任务
processInfoDetailEO.setUserId(projectLawsInventoryEO.getVerifyDutyId());
}
if(StringUtils.equals(processInfoDetailEO.getTaskDefinitionKey(), DesignComplianceNodeEnum.SPONSOR_REVIEW.getKey())){
//更新发起人的任务
processInfoDetailEO.setUserId(projectLawsInventoryEO.getVerifyInitiatorId());
}
}
this.baseMapper.updateById(processInfoDetailEO);
}
}
}
}
@@ -0,0 +1,45 @@
package com.jero.modules.todoCenter.vo;
import lombok.Data;
@Data
public class ParamsManifestTodoCenterEOPage {
/**
* 参数清单id
*/
private String id;
/**
* 相关项目名称
*/
private String projectName;
/**
* 参数清单标题
*/
private String title;
/**
* 相关项目版本
*/
private String projectVersion;
/**
* 待发起数量 包括状态待发起收集,变更,工程接口人退回
*/
private Integer waitCollectNum;
/**
* 待工程接口人处理数量即待分配 包括状态待工程接口人处理,填写人退回
*/
private Integer waitSdtNum;
/**
* 待填写数量 包括状态待填写,认证工程师退回
*/
private Integer waitFillNum;
private int pageNo;
private int pageSize;
private String state;
}
@@ -0,0 +1,110 @@
package com.jero.modules.todoCenter.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/**
* 流程信息表VO类
*/
@Data
public class ProcessInfoVO implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
private String id;
/**创建人*/
private String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private java.util.Date createTime;
/**更新人*/
private String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private java.util.Date updateTime;
/**所属部门*/
private String sysOrgCode;
/**项目库id*/
private String projectLibraryId;
/**法规清单id*/
private String projectLawsInventoryId;
/**文档库id/标准id*/
private String bussDocumentLibraryId;
/**流程实例id*/
private String actiProcInstId;
/**流程类型*/
private String flowType;
/**截止日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private java.util.Date endTime;
/**任务状态*/
private String status;
/**流程编号**/
private String prcNum;
/**流程名称*/
private String prcName;
/**流程类型展示字段*/
private String flowTypeShow;
/**任务状态展示字段*/
private String statusShow;
/**上一个操作人 用户id*/
private String lastAssignee;
private String lastAssigneeName;
/**当前操作人/代理人 用户id*/
private String assignee;
private String assigneeName;
/**标准编号*/
private String serialNumber;
/**标准标题-中文*/
private String title;
/**标准标题-英文*/
private String titleEn;
/**项目名称*/
private String projectName;
/**年份*/
private String yearName;
/**待办id*/
private String taskId;
/**任务节点定义key*/
private String taskDefinitionKey;
/**项目名称id*/
private String projectNameId;
/**目标市场*/
private String targetMarket;
/**studio*/
private String studioEngineer;
/**任务清单明细表id,任务清单明细数据与待办中心明细表 是taskId一对一的关系**/
private String primaryKeyId;
/**符合性流程:责任人填写反馈意见*/
private String personChargeFeedback;
/**截止日期 过期标识:true为已经过期 false为没有过期**/
private boolean endTimePastDueFlag = false;
/**标准信息**/
private String standardInfo;
}
@@ -13,6 +13,7 @@ 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.FeishuMsgVo;
import com.jero.modules.system.entity.SysAnnouncement;
import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.entity.SysDictItem;
@@ -372,7 +373,7 @@ public class LawsWarnService {
thirdIdList.addAll(thirdId);
}
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//查询文档
List<Map<String, Object>> mapList = bussDocumentLibraryEOMapper.selectMapsAll(documentIds);
List<String> serialNumberList = new ArrayList<>();
@@ -408,29 +409,65 @@ public class LawsWarnService {
"&serial_number=" + map.get("serial_number") + "'" + " target='_blank'>" + map.get("serial_number") + "</a>";
urlList.add(url);
hrefList.add(href+timeContent);
//推送多条时, 每条单独发消息
//编号, 标题, 新车型实施日期, 在产车实施日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String serialNumber = StringUtils.valueOf(map.get("serial_number"));
String titleCn = StringUtils.valueOf(map.get("title"));
String titleEn = StringUtils.valueOf(map.get("title_en"));
String newType = "";
if(ObjectUtils.isNotEmpty(map.get("xin1_che1_xing2_shi2_shi1_ri4_qi1"))){
newType = sdf.format(map.get("xin1_che1_xing2_shi2_shi1_ri4_qi1"));
}
String newVehicle = "";
if(ObjectUtils.isNotEmpty(map.get("implement_time"))){
newVehicle = sdf.format(map.get("implement_time"));
}
//消息-英文
String contentNo = sysUser.getUsername() +" shared Regulation Early Warning infomation with you, "
+"Regulation No: "+serialNumber+",Title: "+titleEn+",New Type Execution Date: "+newType+",New Vehicle Execution Date: "+newVehicle;
String contentInfoYes = sysUser.getUsername() +" shared Regulation Early Warning infomation with you, "+"</br>"
+"Regulation No: "+href+"</br>"
+"Title: "+titleEn+"</br>"
+"New Type Execution Date: "+newType+"</br>"
+"New Vehicle Execution Date: "+newVehicle;
//消息中文
String contentCnNo = sysUser.getUsername() +"向您分享了法规预警信息, "+"编号: "+serialNumber+",标题: "+titleCn+",新车型实施日期: "+newType+",在产车实施日期: "+newVehicle;
String contentInfoCnYes = sysUser.getUsername() +"向您分享了法规预警信息,"+"</br>"
+"编号: "+href+"</br>"
+"标题: "+titleCn+"</br>"
+"新车型实施日期: "+newType+"</br>"
+"在产车实施日期: "+newVehicle;
//封装消息的实体类
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList,
null,
contentNo,
contentInfoYes,
MessageTypeEnum.PUSH.getValue(),
MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
contentCnNo,contentInfoCnYes);
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
bussDocumentLibraryEOService.sendWebsocket(StringUtils.join(thirdIdList, ","), contentInfoCnYes);
}
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String content = StringUtils.join(serialNumberList, ",") + " has been shared with you, please check.";
//消息详情模板
// XXX has pushed GB 7258 to you as the implementation date of vehicle production is XXXX-XX-XX
// GB 7258 to you as the implementation date of vehicle production is XXXX-XX-XX Please be reminded to check it out.
String contentInfo = sysUser.getUsername() + " has pushed " + StringUtils.join(hrefList, ",") + ", Please be reminded to check it out.";
String title = content;
//封装消息的实体类
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, title, content, contentInfo,MessageTypeEnum.PUSH.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
bussDocumentLibraryEOService.sendWebsocket(StringUtils.join(thirdIdList, ","), contentInfo);
//飞书
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for (String s : urlList) {
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
String encode = UriEncoder.encode(s);
List<String> list = new ArrayList<>();
mapList.stream().forEach(e->{
if(s.contains((String)e.get("id"))){
String serialNumber = StringUtils.valueOf(e.get("serial_number"));
//封装飞书消息实体类
setFeishuMsgVo(sysUser, sdf, feishuMsgVo, encode, e, serialNumber);
String timeContent = "";
if("1".equals(flag)){
String value = StringUtils.valueOf(e.get("xin1_che1_xing2_shi2_shi1_ri4_qi1"));
@@ -452,15 +489,50 @@ public class LawsWarnService {
list.add(serialNumber + timeContent);
}
});
String contentTemp = sysUser.getUsername() + " has pushed " + StringUtils.join(list, ",") + ", Please be reminded to check it out.";
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentTemp, MessageTypeEnum.PUSH.getName(), encode);
iFeishuService.sendCardMsgWarn(thirdIdList.toArray(new String[]{}), feishuMsgVo);
// String contentTemp = sysUser.getUsername() + " has pushed " + StringUtils.join(list, ",") + ", Please be reminded to check it out.";
// iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentTemp, MessageTypeEnum.PUSH.getName(), encode);
}
} catch (IOException e) {
e.printStackTrace();
}
bussDocumentLibraryEOService.sendWebsocket(documentIds, contentInfo);
bussDocumentLibraryEOService.sendWebsocket(documentIds, documentIds);
return "推送成功";
}
private void setFeishuMsgVo(LoginUser sysUser, SimpleDateFormat sdf, FeishuMsgVo feishuMsgVo, String encode, Map<String, Object> e, String serialNumber) {
String documentTitleCn = ""; //文档标题
String documentTitleEn = ""; //文档标题
String newTypeExecutionDate = ""; //新车型实施日期
String newVehicleExecutionDate = ""; //在产车实施日期
if(ObjectUtils.isNotEmpty(e.get("title"))){
documentTitleCn = String.valueOf(e.get("title"));
}
if(ObjectUtils.isNotEmpty(e.get("title_en"))){
documentTitleEn = String.valueOf(e.get("title_en"));
}
if(ObjectUtils.isNotEmpty(e.get("xin1_che1_xing2_shi2_shi1_ri4_qi1"))){
newTypeExecutionDate = sdf.format(e.get("xin1_che1_xing2_shi2_shi1_ri4_qi1"));
}
if(ObjectUtils.isNotEmpty(e.get("implement_time"))){
newVehicleExecutionDate = sdf.format(e.get("implement_time"));
}
String contentInfoFei = sysUser.getUsername() +" shared Regulation Early Warning infomation with you.";
String contentInfoFeiCn = sysUser.getUsername() +"向您分享了法规预警信息.";
feishuMsgVo.setTitle(MessageTypeEnum.WARN.getNameCn()+"/"+MessageTypeEnum.WARN.getName());
feishuMsgVo.setUrl(encode);
feishuMsgVo.setContentEn(contentInfoFei);
feishuMsgVo.setContent(contentInfoFeiCn);
feishuMsgVo.setRegulationNo(serialNumber);
feishuMsgVo.setNewTypeExecutionDate(newTypeExecutionDate);
feishuMsgVo.setNewVehicleExecutionDate(newVehicleExecutionDate);
feishuMsgVo.setDocumentTitleCn(documentTitleCn);
feishuMsgVo.setDocumentTitleEn(documentTitleEn);
}
// public String warnPullMessage(String departIds, String userIds, String documentIds,String flag) {
// Set<String> allDepartIds = new HashSet<>();
// //查询当前部门下所有部门
@@ -4,6 +4,7 @@ import com.jero.common.constant.enums.MessageTypeEnum;
import com.jero.modules.document.entity.BussDocumentLibraryEO;
import com.jero.modules.document.service.impl.BussDocumentLibraryEOServiceImpl;
import com.jero.modules.feishu.service.IFeishuService;
import com.jero.modules.feishu.vo.FeishuMsgVo;
import com.jero.modules.subscribe.entity.OnlCgformSubscribe;
import com.jero.modules.subscribe.service.IOnlCgformSubscribeService;
import com.jero.modules.system.entity.SysAnnouncement;
@@ -123,15 +124,33 @@ public class TimedTaskWarn implements Job {
//当前时间的前12个月
String beforeTimeSixTen = beforeTime(12,xin1Che1Xing2Shi2Shi1Ri4Qi1);
if(currentTime.equals(beforeTimeSix) || currentTime.equals(beforeTimeSixTen) || currentTime.equals(xin1Che1Xing2Shi2Shi1Ri4Qi1Str)){
//发送站内消息和飞书消息
String format = sdf.format(xin1Che1Xing2Shi2Shi1Ri4Qi1);
String content = "The implementation date of the " + category +" "+ serialNumber
+ " new model you subscribed to is "+format+",please pay attention to check";
String contentInfo = "The implementation date of the " + category +" "+ href
+ " new model you subscribed to is "+format+",please pay attention to check";
String msgTitle = content;
sendMessage(msgTitle, content,contentInfo,content, url, userIdList, thirdIdList);
// if(currentTime.equals(beforeTimeSix) || currentTime.equals(beforeTimeSixTen) || currentTime.equals(xin1Che1Xing2Shi2Shi1Ri4Qi1Str)){
// //发送站内消息和飞书消息
// String format = sdf.format(xin1Che1Xing2Shi2Shi1Ri4Qi1);
// String content = "The implementation date of the " + category +" "+ serialNumber
// + " new model you subscribed to is "+format+",please pay attention to check";
// String contentInfo = "The implementation date of the " + category +" "+ href
// + " new model you subscribed to is "+format+",please pay attention to check";
// String msgTitle = content;
// sendMessage(msgTitle, content,contentInfo,content, url, userIdList, thirdIdList);
// }
if(currentTime.equals(beforeTimeSixTen)){
//发送飞书消息(提前一年)
sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"1");
//站内消息
sendMessage(bussDocumentLibraryEO, userIdList,"1",sdf,href);
}
if(currentTime.equals(beforeTimeSix)){
//发送飞书消息(提前6个月)
sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"6");
//站内消息
sendMessage(bussDocumentLibraryEO, userIdList,"6",sdf,href);
}
if(currentTime.equals(xin1Che1Xing2Shi2Shi1Ri4Qi1Str)){
//发送飞书消息(当天)
sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"0");
//站内消息
sendMessage(bussDocumentLibraryEO, userIdList,"0",sdf,href);
}
}
@@ -152,27 +171,165 @@ public class TimedTaskWarn implements Job {
String contentInfo = "The implementation date of the " + category +" "+ href
+ " production vehicle you subscribed to is "+format+",please pay attention to check";
String msgTitle = content;
sendMessage(msgTitle, content,contentInfo,content, url, userIdList, thirdIdList);
// sendMessage(msgTitle, content,contentInfo,content, url, userIdList, thirdIdList);
}
if(currentTime.equals(beforeTimeSixTen)){
//发送飞书消息(提前一年)
sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"1");
//站内消息
sendMessage(bussDocumentLibraryEO, userIdList,"1",sdf,href);
}
if(currentTime.equals(beforeTimeSix)){
//发送飞书消息(提前6个月)
sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"6");
//站内消息
sendMessage(bussDocumentLibraryEO, userIdList,"6",sdf,href);
}
if(currentTime.equals(implementTimeStr)){
//发送飞书消息(当天)
sendFeishu(sdf, bussDocumentLibraryEO, url, thirdIdList,"0");
//站内消息
sendMessage(bussDocumentLibraryEO, userIdList,"0",sdf,href);
}
}
}
}
private void sendMessage(String title, String content,String contentInfo,String contentFeiShu, String url, List<String> userIdList, List<String> thirdIdList) {
//站内消息
//封装消息的实体类
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, title, content, contentInfo,MessageTypeEnum.WARN.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
bussDocumentLibraryEOService.sendWebsocket(StringUtils.join(userIdList, ","), content);
private void sendFeishu(SimpleDateFormat sdf,
BussDocumentLibraryEO bussDocumentLibraryEO,
String url,
List<String> thirdIdList,
String flag) {
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setTitle(MessageTypeEnum.WARN.getNameCn()+"/"+MessageTypeEnum.WARN.getName());
feishuMsgVo.setUrl(url);
String contentCn = "";
String contentEn = "";
if("1".equals(flag)){
contentCn = "您所订阅的法规将于1年后实施.";
contentEn = "The regulation you subscribed to will be implemented in one year.";
}
if("6".equals(flag)){
contentCn = "您所订阅的法规将于6个月后实施.";
contentEn = "The regulation you subscribed to will be implemented in six months.";
}
if("0".equals(flag)){
contentCn = "您所订阅的法规已实施.";
contentEn = "The regulation you subscribed to is implemented.";
}
feishuMsgVo.setContent(contentCn);
feishuMsgVo.setContentEn(contentEn);
feishuMsgVo.setRegulationNo(bussDocumentLibraryEO.getSerialNumber());
feishuMsgVo.setDocumentTitleCn(bussDocumentLibraryEO.getTitle());
feishuMsgVo.setDocumentTitleEn(bussDocumentLibraryEO.getTitleEn());
if(ObjectUtils.isNotEmpty(bussDocumentLibraryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1())){
feishuMsgVo.setNewTypeExecutionDate(sdf.format(bussDocumentLibraryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1()));
}
if(ObjectUtils.isNotEmpty(bussDocumentLibraryEO.getImplementTime())){
feishuMsgVo.setNewVehicleExecutionDate(sdf.format(bussDocumentLibraryEO.getImplementTime()));
}
//飞书消息
try {
iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentFeiShu, MessageTypeEnum.WARN.getName(), url);
iFeishuService.sendCardMsgWarn(thirdIdList.toArray(new String[]{}),feishuMsgVo);
} catch (IOException e) {
e.printStackTrace();
}
}
// private void sendMessage(String title, String content,String contentInfo,String contentFeiShu, String url, List<String> userIdList, List<String> thirdIdList) {
// //站内消息
// //封装消息的实体类
// SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList,
// title,
// content,
// contentInfo,
// MessageTypeEnum.WARN.getValue(),
// MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
// null,null);
// sysAnnouncementService.saveAnnouncement(sysAnnouncement);
// bussDocumentLibraryEOService.sendWebsocket(StringUtils.join(userIdList, ","), content);
//
//// //飞书消息
//// try {
//// iFeishuService.batchSendMessage(thirdIdList.toArray(new String[]{}), contentFeiShu, MessageTypeEnum.WARN.getName(), url);
//// } catch (IOException e) {
//// e.printStackTrace();
//// }
// }
private void sendMessage(BussDocumentLibraryEO bussDocumentLibraryEO,
List<String> userIdList,
String flag,
SimpleDateFormat sdf,
String href) {
String number = bussDocumentLibraryEO.getSerialNumber();
String title = bussDocumentLibraryEO.getTitle();
String titleEn = bussDocumentLibraryEO.getTitleEn();
Date xin1Che1Xing2Shi2Shi1Ri4Qi1 = bussDocumentLibraryEO.getXin1Che1Xing2Shi2Shi1Ri4Qi1();
Date implementTime = bussDocumentLibraryEO.getImplementTime();
String newType = "";
String newVehicle = "";
if(ObjectUtils.isNotEmpty(xin1Che1Xing2Shi2Shi1Ri4Qi1)){
newType = sdf.format(xin1Che1Xing2Shi2Shi1Ri4Qi1);
}
if(ObjectUtils.isNotEmpty(implementTime)){
newVehicle = sdf.format(implementTime);
}
String contentCn = "";
String contentInfoCn = "";
String contentEn = "";
String contentInfoEn = "";
//"</br>"
contentCn = ",编号: "+number
+",标题: "+title
+",新车型实施日期: "+newType
+",在产车实施日期: "+newVehicle;
contentInfoCn = "编号: "+href+"</br>"
+"标题: "+title+"</br>"
+"新车型实施日期: "+newType+"</br>"
+"在产车实施日期: "+newVehicle;
contentEn = ",Regulation No: "+number
+",Title: "+titleEn
+",New Type Execution Date: "+newType
+",New Vehicle Execution Date: "+newVehicle;
contentInfoEn = "Regulation No: "+href+"</br>"
+"Title: "+titleEn+"</br>"
+"New Type Execution Date: "+newType+"</br>"
+"New Vehicle Execution Date: "+newVehicle;
if("1".equals(flag)){
contentCn = "您所订阅的法规将于1年后实施"+contentCn;
contentInfoCn = "您所订阅的法规将于1年后实施"+"</br>"+contentInfoCn;
contentEn = "The regulation you subscribed to will be implemented in one year"+contentEn;
contentInfoEn = "The regulation you subscribed to will be implemented in one year"+"</br>"+contentInfoEn;
}
if("6".equals(flag)){
contentCn = "您所订阅的法规将于6个月后实施"+contentCn;
contentInfoCn = "您所订阅的法规将于6个月后实施"+"</br>"+contentInfoCn;
contentEn = "The regulation you subscribed to will be implemented in six months"+contentEn;
contentInfoEn = "The regulation you subscribed to will be implemented in six months"+"</br>"+contentInfoEn;
}
if("0".equals(flag)){
contentCn = "您所订阅的法规已实施"+contentCn;
contentInfoCn = "您所订阅的法规已实施"+"</br>"+contentInfoCn;
contentEn = "The regulation you subscribed to is implemented"+contentEn;
contentInfoEn = "The regulation you subscribed to is implemented"+"</br>"+contentInfoEn;
}
//封装消息的实体类
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList,
title,
contentEn,
contentInfoEn,
MessageTypeEnum.WARN.getValue(),
MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName(),
contentCn,contentInfoCn);
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
bussDocumentLibraryEOService.sendWebsocket(StringUtils.join(userIdList, ","), contentInfoEn);
}
private String beforeTime (int month,Date date){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendarBefore = Calendar.getInstance();
@@ -1,16 +1,21 @@
package com.jero.modules.wkflow.enums;
import com.jero.common.constant.enums.CutEnum;
import com.jero.modules.todoCenter.enums.TodoCenterStatusEnum;
import org.apache.commons.lang3.StringUtils;
/**
* 流程类型枚举类
*/
public enum FlowTypeEnum {
RWQRLC("1","任务确认流程","RWQRLC","任务确认流程","rwqrlc"),
SJFHXSHLC("2","设计符合性审查流程","SJFHXSHLC","设计符合性审查流程","sjfhxlc"),
PREHOMOQRLC("3","prehomo确认流程","PREHOMOQRLC","prehomo确认流程","prehomoqrlc"),
YZFHXSCLC("4","验证符合性审查流程","YZFHXSCLC","验证符合性审查流程","yzfhxsclc"),
FGYJSJLC("5","法规意见收集流程","FGYJSJLC","法规意见收集流程","fgyjsjlc"),
FGJSPG("6","法规技术评估","FGJSPG","法规技术评估流程","fgjspglc"),
RWQRLC("1","任务确认流程","RWQRLC","任务确认流程","rwqrlc","清单任务确认","List task Confirmation"),
SJFHXSHLC("2","设计符合性审查流程","SJFHXSHLC","设计符合性审查流程","sjfhxlc","设计符合性确认","Design conformance verification"),
PREHOMOQRLC("3","prehomo确认流程","PREHOMOQRLC","prehomo确认流程","prehomoqrlc","Pre-Homo确认","The Pre - Homo confirmation"),
YZFHXSCLC("4","验证符合性审查流程","YZFHXSCLC","验证符合性审查流程","yzfhxsclc","验证符合性确认","Verify conformance confirmation"),
FGYJSJLC("5","法规意见收集流程","FGYJSJLC","法规意见收集流程","fgyjsjlc","法规意见收集","Collection of Legislative Comments"),
FGJSPG("6","法规技术评估流程","FGJSPG","法规技术评估流程","fgjspglc","法规技术评估","Regulatory and technical assessment"),
QDQR("10","清单确认","QDQR","清单确认流程","qdqr","法规清单确认","Regulation list confirmation"),
;
private String value;
@@ -18,13 +23,17 @@ public enum FlowTypeEnum {
private String prcNum;
private String prcName;
private String processDefinitionKey;
private String cnName;
private String enName;
private FlowTypeEnum(String value, String lable, String prcNum, String prcName, String processDefinitionKey) {
private FlowTypeEnum(String value, String lable, String prcNum, String prcName, String processDefinitionKey,String cnName,String enName) {
this.value = value;
this.lable = lable;
this.prcNum = prcNum;
this.prcName = prcName;
this.processDefinitionKey = processDefinitionKey;
this.cnName = cnName;
this.enName = enName;
}
public String getValue() {
return value;
@@ -43,4 +52,26 @@ public enum FlowTypeEnum {
public String getProcessDefinitionKey() {
return processDefinitionKey;
}
public String getCnName() {
return cnName;
}
public String getEnName() {
return enName;
}
public static String getTextByValue(String value, String cut) {
FlowTypeEnum[] values = values();
for (FlowTypeEnum flowTypeEnum : values) {
if (flowTypeEnum.value.equals(value)) {
if(StringUtils.equals(cut, CutEnum.CN.getValue())){
return flowTypeEnum.cnName;
}else if(StringUtils.equals(cut,CutEnum.EN.getValue())){
return flowTypeEnum.enName;
}
}
}
return null;
}
}
@@ -181,4 +181,21 @@ public interface WorkFlowFeignClient {
@RequestMapping(value = "/bat-wkflow/deleteProcessInstanceByPrcIds",method = RequestMethod.GET)
Result<String> deleteProcessInstanceByPrcIds(@RequestParam("prcIds") String prcIds);
@RequestMapping(value = "/bat-wkflow/task/getLawsOpinionGatherPrcInfo",method = RequestMethod.GET)
Map<String,String> getLawsOpinionGatherPrcInfo(@RequestParam("lawsOpinionGatherId") String lawsOpinionGatherId);
/**
* 根据流程类型查询未完成的流程信息
* @param prcType
* @return
*/
@RequestMapping(value = "/bat-wkflow/datas/bus-process-name/queryProcessInfoByPrcType",method = RequestMethod.GET)
List<Map<String, Object>> queryProcessInfoByPrcType(@RequestParam("prcType") String prcType);
/**
* 处理历史数据-之前的数据发起的时候在busProcessNew中没有待办信息
*/
@RequestMapping(value = "/bat-wkflow/datas/bus-process-new/dispostHistoryBusProcessNewData",method = RequestMethod.GET)
Result dispostHistoryBusProcessNewData();
}
@@ -196,4 +196,20 @@ public class WorkFlowFeignClientImpl{
public Result<String> deleteProcessInstanceByTaskId(@RequestParam("taskId")String taskId){
return workFlowFeignClient.deleteProcessInstance(taskId);
}
/**
* 根据流程类型查询未完成的流程信息
* @param prcType
* @return
*/
public List<Map<String, Object>> queryProcessInfoByPrcType(String prcType) {
return workFlowFeignClient.queryProcessInfoByPrcType(prcType);
}
/**
* 处理历史数据-之前的数据发起的时候在busProcessNew中没有待办信息
*/
public Result dispostHistoryBusProcessNewData() {
return workFlowFeignClient.dispostHistoryBusProcessNewData();
}
}
@@ -11,6 +11,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
import java.net.InetAddress;
@@ -25,6 +26,7 @@ import java.net.UnknownHostException;
@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients
@EnableScheduling
public class LawNioApplication extends SpringBootServletInitializer {
@Override
+31
View File
@@ -793,6 +793,7 @@ module.exports = {
parameter: 'Parameter',
changeExtension: 'Change Extension',
addDetailList: 'Add',
editDetailList:'Edit DetailList',
detailedList: 'DetailedList',
copyParamDetailList: 'Copy Parameter List',
collectionCompletionTime: 'Collection Completed',
@@ -1329,5 +1330,35 @@ module.exports = {
thereForTheCurrentlySelectedData:'There is no standard breakdown for the currently selected data',
secondaryDirectory:'Secondary Directory',
OnlyPersonsCanBeSelected:'The maximum upper limit is exceeded; Only 100 persons can be selected',
projectVersion:'Project Version',
softwareVersion:'Authentication Software version',
versionStatistics:'Version statistics',
addSubproject:'Add Subproject',
Topping:'Topping',
cancelTopping:'Cancel Topping',
relatedProjectVersion:'Related project version',
taskType:'Task Type',
taskStatus:'Task Status',
taskConfirmationHandling:'Task confirmation handling',
relatedVersion:'Related version',
filledBy:'Filled by',
parameterToBeInitiated:'Parameter to be initiated',
listTaskConfirmation:'List task confirmation',
completednum: 'Quantity to be filled',
filledBynum:'Filled by',
parameterToBeInitiatednum:'Parameter to be initiated',
listToConfirm:'List to confirm',
toSubmit:'To submit',
toAudit:'To audit',
secondaryDirectory:'Secondary Directory',
OnlyPersonsCanBeSelected:'The maximum upper limit is exceeded; Only 100 persons can be selected',
projectVersion:'Project Version',
softwareVersion:'Authentication Software version',
versionStatistics:'Version statistics',
addSubproject:'Add Subproject',
Topping:'Topping',
cancelTopping:'Cancel Topping',
relatedProjectVersion:'Related project version',
Importfailure:'Import failure',
CuiBan:'CuiBan',
}
+33 -2
View File
@@ -516,8 +516,8 @@ module.exports = {
AddProcess: '添加流程',
RelatedItems: '相关项目',
Sponsor: '发起人',
CurrentProcessor: '当前处理',
LastProcessor: '上一处理',
CurrentProcessor: '当前操作',
LastProcessor: '上一操作',
ProcessingTime: '办理时间',
cutoffTime: '截止时间',
ProcessStatus: '流程状态',
@@ -809,6 +809,7 @@ module.exports = {
parameter: '参数',
changeExtension: '变更扩展',
addDetailList: '添加清单',
editDetailList:'编辑清单',
detailedList: '清单',
copyParamDetailList: '复制参数清单',
collectionCompletionTime: '收集完成时间',
@@ -1430,5 +1431,35 @@ module.exports = {
thereForTheCurrentlySelectedData:'当前所选数据暂无标准分解单',
secondaryDirectory:'二级目录',
OnlyPersonsCanBeSelected:'超出最大上限最多只能选择100个人员',
projectVersion:'项目版本',
softwareVersion:'认证软件版本',
versionStatistics:'版本统计',
addSubproject:'添加子项目',
Topping:'置顶',
cancelTopping:'取消置顶',
relatedProjectVersion:'相关项目版本',
taskType:'任务类型',
taskStatus:'任务状态',
taskConfirmationHandling:'任务确认办理',
relatedVersion:'相关版本',
filledBy:'待分配填写人',
parameterToBeInitiated:'参数待发起',
listTaskConfirmation:'清单任务确认',
completednum: '待填写',
filledBynum:'待分配填写人',
parameterToBeInitiatednum:'参数待发起',
listToConfirm:'待确认',
toSubmit:'待提交',
toAudit:'待审核',
secondaryDirectory:'二级目录',
OnlyPersonsCanBeSelected:'超出最大上限最多只能选择100个人员',
projectVersion:'项目版本',
softwareVersion:'认证软件版本',
versionStatistics:'版本统计',
addSubproject:'添加子项目',
Topping:'置顶',
cancelTopping:'取消置顶',
relatedProjectVersion:'相关项目版本',
Importfailure:'导入失败',
CuiBan:'催办',
}
@@ -29,6 +29,7 @@
:disabled="item.isLock == '1' ? true: false"
:placeholder="$t('pleaseEnter')+$t('chinese')"
@input="onInput"
:maxLength="1000"
onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\u4E00-\u9FA5]/g,''))"
v-model="item.dataValue"/>
</div>
@@ -27,6 +27,7 @@
<a-input class="box-input inputWid"
:placeholder="$t('pleaseEnter')+$t('chinese')"
@input="onInput"
:maxLength="1000"
onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\u4E00-\u9FA5]/g,''))"
v-model="item.dataValue"/>
</div>
@@ -54,6 +54,10 @@ export default {
type: String,
default: ''
},
paramsManifestId: {
type: String,
default: ''
},
projectLibraryId: {
type: String,
default: ''
@@ -76,6 +80,8 @@ export default {
return window._CONFIG['domianURL'] + '/' + this.url.importZipUrl + '?cut=' + this.cut + '&paramsTemplateId=' + this.paramsTemplateId
} else if (this.projectLibraryId) {
return window._CONFIG['domianURL'] + '/' + this.url.importZipUrl + '?cut=' + this.cut + '&projectLibraryId=' + this.projectLibraryId
} else if (this.paramsManifestId) {
return window._CONFIG['domianURL'] + '/' + this.url.importZipUrl + '?cut=' + this.cut + '&paramsManifestId=' + this.paramsManifestId
}
return window._CONFIG['domianURL'] + '/' + this.url.importZipUrl + '?cut=' + this.cut
}

Some files were not shown because too many files have changed in this diff Show More