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

This commit is contained in:
wangzhijiang
2022-07-09 13:22:13 +08:00
73 changed files with 3433 additions and 302 deletions
@@ -203,4 +203,38 @@ CREATE TABLE `params_report_export_history` (
-- 参数清单历史版本 添加字段
ALTER TABLE `laws_weilai`.`params_manifest_history`
ADD COLUMN `source_params_manifest_id` varchar(50) NULL COMMENT '源参数清单id' AFTER `params_template_publish_version`;
ADD COLUMN `source_params_manifest_id` varchar(50) NULL COMMENT '源参数清单id' AFTER `params_template_publish_version`;
-- 上报库表 添加字段 2022-07-08
ALTER TABLE `laws_weilai`.`params_report`
ADD COLUMN `project_name` varchar(200) NULL COMMENT '项目名称' AFTER `params_template_publish_version`,
ADD COLUMN `title` varchar(200) NULL COMMENT '清单标题' AFTER `project_name`;
ALTER TABLE `laws_opinion_gather`
ADD COLUMN `opinion_archive_id` varchar(4000) NULL COMMENT '意见归档文件id' AFTER `prc_num`;
-- 法规技术评估流程相关表 - 法规技术评估表
CREATE TABLE `laws_technology_evaluation` (
`id` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`create_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建日期',
`update_by` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人',
`update_time` datetime NULL DEFAULT NULL COMMENT '更新日期',
`sys_org_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '所属部门',
`stand_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标准id',
`serial_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '编号',
`title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标题',
`technology_territory` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '技术领域',
`evaluation_methods` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '评估方式',
`flow_status` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程状态',
`start_time` datetime NULL DEFAULT NULL COMMENT '发起日期',
`end_time` datetime NULL DEFAULT NULL COMMENT '截止日期',
`remark` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
`acti_proc_inst_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程实例id',
`related_data_file_id` varchar(4000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '相关资料id',
`process_background` varchar(600) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程背景',
`regulation_owner_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '法规工程师id',
`evaluation_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '评估类型(类型有:反馈评估、条款评估)',
`prc_num` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '流程编号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '法规技术评估表' ROW_FORMAT = DYNAMIC;
@@ -21,17 +21,17 @@ UPDATE `laws_weilai`.`onl_cgform_field` SET `id`='e4fe526794af4477321227f69b764b
-- 2022年7月8日增加字段 未同步正式环境
-- 2022年7月8日增加字段 已同步正式环境
ALTER TABLE `project_laws_inventory`
ADD COLUMN `stand_id` varchar(100) NULL COMMENT '文档库id/标准id' AFTER `file_id`;
ALTER TABLE `project_task_inventory`
ADD COLUMN `stand_id` varchar(100) NULL COMMENT '文档库id/标准id' AFTER `process_end_time`;
-- 2022年7月8日增加字段
-- 2022年7月8日增加字段 已同步正式环境
ALTER TABLE `dummy_inventory_info`
ADD COLUMN `buss_document_library_id` varchar(32) NULL COMMENT '文档库id' AFTER `design_remark`;
-- 2022年7月8日法规清单交付物类型字段长度
-- 2022年7月8日法规清单交付物类型字段长度 已同步正式环境
ALTER TABLE `project_laws_inventory`
MODIFY COLUMN `design_deliverable_type` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设计符合性确认-交付物类型' AFTER `remark`,
MODIFY COLUMN `prehomo_deliverable_type` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'prehomo确认-交付物类型' AFTER `design_due_date`,
@@ -3,8 +3,11 @@ package com.jero.modules.cert.collect.mapper;
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 org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Description: 参数清单
* @Author: jero-boot
@@ -18,4 +21,6 @@ public interface ParamsManifestEOMapper extends BaseMapper<ParamsManifestEO> {
@Param("state") String state,
IPage page);
List<ParamsManifestVO> listInfoAll(@Param("idList") List<String> idList);
}
@@ -20,6 +20,7 @@
<resultMap id="ParamsManifestEOResultMapForCopy" type="com.jero.modules.cert.collect.vo.ParamsManifestVO">
<id column="id" property="id" />
<result column="title" property="title" />
<result column="version" property="version" />
<result column="project_id" property="projectId" />
<result column="project_name" property="projectName" />
<result column="state" property="state" />
@@ -72,6 +73,7 @@
select
pm.id as id,
pm.title as title,
pm.version as version,
pm.project_id as project_id,
pm.state as state,
concat(pni.project_name,'-',pyni.year_name) as project_name,
@@ -91,4 +93,23 @@
</if>
order by create_time desc
</select>
<select id="listInfoAll" resultMap="ParamsManifestEOResultMapForCopy">
select tmp_tb.* from(
select
pm.id as id,
pm.version as version,
pm.title as title,
concat(pni.project_name,'-',pyni.year_name) 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 id in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select>
</mapper>
@@ -34,4 +34,12 @@ public interface IParamsCollectManifestHistoryEOService extends IService<ParamsC
*/
List<Map<String, Object>> getHeader(String paramsManifestId, String flag, String cut);
/**
* 批量删除
*
* @param ids
* @return
*/
boolean deleteByIds(List<String> ids);
}
@@ -1,7 +1,6 @@
package com.jero.modules.cert.collect.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.modules.cert.collect.entity.ParamsConfigDataEO;
import com.jero.modules.cert.collect.entity.ParamsConfigDataHistoryEO;
import java.util.List;
@@ -29,4 +28,7 @@ public interface IParamsConfigDataHistoryEOService extends IService<ParamsConfig
* @return
*/
List<ParamsConfigDataHistoryEO> queryListByConfigIdList(List<String> configIdList);
int deleteByParamsCollectManifestIdList(List<String> paramsCollectManifestIdList);
}
@@ -17,4 +17,6 @@ public interface IParamsManifestHistoryEOService extends IService<ParamsManifest
void addForChangeExtension(String paramsManifestId);
List<ParamsManifestHistoryVO> getHistoryVersionList(String paramsManifestId);
void deleteAllHistoryVersion(List<String> paramsManifestIdList);
}
@@ -1202,7 +1202,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
String[] paramsCollectManifestIdStr = paramsCollectManifestIds.split(",");
List<ParamsCollectManifestEO> updateEOList = new ArrayList<>();
StringBuilder connectBuilder = new StringBuilder();
connectBuilder.append("You are required to fll in ");
connectBuilder.append("You are required to fill in ");
for (int i=0; i<paramsCollectManifestIdStr.length; i++) {
ParamsCollectManifestEO paramsCollectManifestEO = getById(paramsCollectManifestIdStr[i]);
if (i < 3) {
@@ -1282,7 +1282,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
for(String sdt : sdtList) {
StringBuilder connectBuilder = new StringBuilder();
connectBuilder.append("You are required to fll in ");
connectBuilder.append("You are required to fill in ");
for (int i=0; i<paramsCollectManifestEOList.size(); i++) {
ParamsCollectManifestEO paramsCollectManifestEO = paramsCollectManifestEOList.get(i);
if (sdt.equals(paramsCollectManifestEO.getSdt()) && i<3) {
@@ -1297,7 +1297,9 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
String hrefFeishu = backUrl + "/ParameterItemCollection?id=" + paramsManifestId + "&projectId=" + projectId;
String href = "<a href='/ParameterItemCollection?id=" + paramsManifestId + "&projectId=" + projectId + "'" + " target='_blank'>the link</a>,";
String contentInfo = connectBuilder.substring(0, connectBuilder.toString().length()-1) + " and other parameter items, please enter " + href + " and fill in the relevant information.";
String msgTitle = "You have a homo parameter task to complete";
// TODO 为什么不用SendMessageUtils工具类呢?
// 发送系统消息
SysAnnouncement sysAnnouncement = new SysAnnouncement();
sysAnnouncement.setDelFlag("0");
@@ -1305,6 +1307,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
sysAnnouncement.setSendTime(new Date());
sysAnnouncement.setMsgCategory(MessageTypeEnum.HOMO_TASK.getValue());//消息类型
sysAnnouncement.setMsgType(CommonConstant.MSG_TYPE_UESR);//指定用户
sysAnnouncement.setTitile(msgTitle);
sysAnnouncement.setMsgContent(content);
sysAnnouncement.setMsgContentInfo(contentInfo);
sysAnnouncement.setUserIds(sysUser.getId());
@@ -455,6 +455,19 @@ public class ParamsCollectManifestHistoryEOServiceImpl extends ServiceImpl<Param
return list;
}
/**
* 批量删除
*
* @param ids
* @return
*/
@Override
public boolean deleteByIds(List<String> ids) {
// 关联删除配置数据
paramsConfigDataHistoryEOService.deleteByParamsCollectManifestIdList(ids);
return removeByIds(ids);
}
/**
* 获取一个类和其父类的所有属性
*
@@ -7,6 +7,7 @@ import com.jero.modules.cert.collect.entity.ParamsConfigDataEO;
import com.jero.modules.cert.collect.entity.ParamsConfigDataHistoryEO;
import com.jero.modules.cert.collect.mapper.ParamsConfigDataHistoryEOMapper;
import com.jero.modules.cert.collect.service.IParamsConfigDataHistoryEOService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@@ -20,6 +21,9 @@ import java.util.List;
@Service
public class ParamsConfigDataHistoryEOServiceImpl extends ServiceImpl<ParamsConfigDataHistoryEOMapper, ParamsConfigDataHistoryEO> implements IParamsConfigDataHistoryEOService {
@Autowired
private ParamsConfigDataHistoryEOMapper paramsConfigDataHistoryEOMapper;
/**
* 通过id查询
*
@@ -50,4 +54,12 @@ public class ParamsConfigDataHistoryEOServiceImpl extends ServiceImpl<ParamsConf
}
return null;
}
@Override
public int deleteByParamsCollectManifestIdList(List<String> paramsCollectManifestIdList) {
LambdaQueryWrapper<ParamsConfigDataHistoryEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(ParamsConfigDataEO::getParamsCollectManifestId, paramsCollectManifestIdList);
return paramsConfigDataHistoryEOMapper.delete(queryWrapper);
}
}
@@ -20,6 +20,7 @@ import com.jero.modules.cert.collect.mapper.ParamsConfigEOMapper;
import com.jero.modules.cert.collect.mapper.ParamsManifestEOMapper;
import com.jero.modules.cert.collect.service.*;
import com.jero.modules.cert.collect.vo.ParamsManifestHistoryVO;
import com.jero.modules.cert.report.service.IParamsReportEOService;
import com.jero.modules.cert.template.entity.ParamsInfoPublishEO;
import com.jero.modules.cert.template.entity.ParamsTemplateEO;
import com.jero.modules.cert.template.service.IParamsInfoPublishEOService;
@@ -81,6 +82,9 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
@Autowired
private IParamsConfigDataEOService paramsConfigDataEOService;
@Autowired
private IParamsReportEOService paramsReportEOService;
@@ -212,6 +216,14 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
}
// 删除对应的历史版本数据
List<String> idList = new ArrayList<>();
idList.add(id);
paramsManifestHistoryEOService.deleteAllHistoryVersion(idList);
// 添加上报库的项目名称和清单标题
paramsReportEOService.setProjectNameAndTitle(idList);
return removeById(id);
}
@@ -251,6 +263,13 @@ public class ParamsManifestEOServiceImpl extends ServiceImpl<ParamsManifestEOMap
paramsCollectManifestEOService.deleteByIds(paramsCollectManifestIdList);
}
// 删除对应的历史版本数据
paramsManifestHistoryEOService.deleteAllHistoryVersion(ids);
// 添加上报库的项目名称和清单标题
paramsReportEOService.setProjectNameAndTitle(ids);
return removeByIds(ids);
}
@@ -1,9 +1,11 @@
package com.jero.modules.cert.collect.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.modules.cert.collect.entity.*;
import com.jero.modules.cert.collect.mapper.ParamsCollectManifestEOMapper;
import com.jero.modules.cert.collect.mapper.ParamsConfigHistoryEOMapper;
import com.jero.modules.cert.collect.mapper.ParamsManifestHistoryEOMapper;
import com.jero.modules.cert.collect.service.*;
import com.jero.modules.cert.collect.vo.ParamsManifestHistoryVO;
@@ -133,7 +135,7 @@ public class ParamsManifestHistoryEOServiceImpl extends ServiceImpl<ParamsManife
@Override
public List<ParamsManifestHistoryVO> getHistoryVersionList(String paramsManifestId) {
// 同一项目下标题时唯一的,历史版本和当前版本通过标题进行关联
// 历史版本和当前版本通过id进行关联
LambdaQueryWrapper<ParamsManifestHistoryEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ParamsManifestHistoryEO::getSourceParamsManifestId, paramsManifestId)
.orderByAsc(ParamsManifestHistoryEO::getVersion);
@@ -149,4 +151,37 @@ public class ParamsManifestHistoryEOServiceImpl extends ServiceImpl<ParamsManife
return historyVersionList;
}
@Autowired
private ParamsConfigHistoryEOMapper paramsConfigHistoryEOMapper;
@Autowired
private ParamsManifestHistoryEOMapper paramsManifestHistoryEOMapper;
@Override
public void deleteAllHistoryVersion(List<String> paramsManifestIdList) {
LambdaQueryWrapper<ParamsManifestHistoryEO> manifestHistoryEOLambdaQueryWrapper = new LambdaQueryWrapper<>();
manifestHistoryEOLambdaQueryWrapper.in(ParamsManifestHistoryEO::getSourceParamsManifestId, paramsManifestIdList);
List<ParamsManifestHistoryEO> list = list(manifestHistoryEOLambdaQueryWrapper);
if (CollectionUtil.isNotEmpty(list)) {
List<String> ids = list.stream().map(ParamsManifestHistoryEO::getId).collect(Collectors.toList());
// 关联删除配置
LambdaQueryWrapper<ParamsConfigHistoryEO> configEOQueryWrapper = new LambdaQueryWrapper<>();
configEOQueryWrapper.in(ParamsConfigHistoryEO::getParamsManifestId, ids);
paramsConfigHistoryEOMapper.delete(configEOQueryWrapper);
// 关联删除收集的参数项(包含配置数据)
LambdaQueryWrapper<ParamsCollectManifestHistoryEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(ParamsCollectManifestHistoryEO::getParamsManifestId, ids);
List<ParamsCollectManifestHistoryEO> paramsCollectManifestHistoryEOList = paramsCollectManifestHistoryEOService.list(queryWrapper);
if (CollectionUtil.isNotEmpty(paramsCollectManifestHistoryEOList)) {
List<String> paramsCollectManifestIdList = paramsCollectManifestHistoryEOList.stream().map(ParamsCollectManifestHistoryEO::getId).collect(Collectors.toList());
paramsCollectManifestHistoryEOService.deleteByIds(paramsCollectManifestIdList);
}
// 删除清单对应的所有历史版本清单
paramsManifestHistoryEOMapper.delete(manifestHistoryEOLambdaQueryWrapper);
}
}
}
@@ -1,5 +1,6 @@
package com.jero.modules.cert.collect.vo;
import io.swagger.models.auth.In;
import lombok.Data;
/**
@@ -12,6 +13,7 @@ public class ParamsManifestVO {
private String id;
private String title;
private Integer version;
private String projectName;
private String projectId;
private String state;
@@ -1,13 +1,10 @@
package com.jero.modules.cert.report.controller;
import com.alibaba.fastjson.JSONObject;
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;
import com.jero.modules.cert.collect.entity.ParamsCollectManifestEO;
import com.jero.modules.cert.collect.vo.ParamsCollectManifestVO;
import com.jero.modules.cert.report.entity.ParamsReportDetailEO;
import com.jero.modules.cert.report.service.IParamsReportDetailEOService;
import com.jero.modules.cert.report.vo.ParamsReportDetailVO;
@@ -15,9 +12,11 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
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 javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -89,7 +88,7 @@ public class ParamsReportDetailEOController extends JeroController<ParamsReportD
@ApiOperation(value = "上报库参数项-常规导出")
@GetMapping(value = "/exportNormal")
// @RequiresPermissions("report:detail:export:normal")
public void exportSplitInfoZip(ParamsReportDetailVO paramsReportDetailVO,
public void exportNormal(ParamsReportDetailVO paramsReportDetailVO,
HttpServletResponse response,
HttpServletRequest request) {
paramsReportDetailEOService.exportNormal(paramsReportDetailVO, response, request);
@@ -140,4 +139,13 @@ public class ParamsReportDetailEOController extends JeroController<ParamsReportD
return Result.OK(templateLabelList);
}
@ApiOperation(value = "上报库参数项-自定义导出")
@GetMapping(value = "/exportCustom")
// @RequiresPermissions("report:detail:export:custom")
public void exportCustom(ParamsReportDetailVO paramsReportDetailVO,
HttpServletResponse response,
HttpServletRequest request) {
paramsReportDetailEOService.exportCustom(paramsReportDetailVO, response, request);
}
}
@@ -1,7 +1,6 @@
package com.jero.modules.cert.report.entity;
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 com.fasterxml.jackson.annotation.JsonFormat;
@@ -70,11 +69,9 @@ public class ParamsReportEO implements Serializable {
@ApiModelProperty(value = "对应参数模板发布版本")
private Integer paramsTemplatePublishVersion;
@TableField(exist = false)
@ApiModelProperty(value = "项目名称")
private String projectName;
@TableField(exist = false)
@ApiModelProperty(value = "清单标题")
private String title;
@@ -13,6 +13,8 @@
<result column="project_name" property="projectName" />
<result column="old_params_manifest_id" property="oldParamsManifestId" />
<result column="params_template_publish_version" property="paramsTemplatePublishVersion" />
<result column="project_name" property="projectName" />
<result column="title" property="title" />
</resultMap>
<sql id="BaseColumnList">
@@ -24,8 +26,8 @@
pr.create_time as create_time,
pr.update_by as update_by,
pr.update_time as update_time,
pm.title as title,
pni.project_name as project_name
if (pm.title is not null, pm.title, pr.title) as title,
if (pni.project_name is not null, concat(pni.project_name,'-', pyni.year_name), pr.project_name) as project_name
</sql>
<sql id="BaseQuerySql">
@@ -48,6 +50,7 @@
left join params_manifest as pm on pm.id = pr.old_params_manifest_id
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
<include refid="BaseQuerySql"/>
order by create_time desc
@@ -36,6 +36,12 @@ public interface IParamsReportDetailEOService extends IService<ParamsReportDetai
*/
List<Map<String, Object>> getHeader(String paramsManifestId, String flag, String cut);
/**
* 常规导出
* @param paramsReportDetailVO
* @param response
* @param request
*/
void exportNormal(ParamsReportDetailVO paramsReportDetailVO, HttpServletResponse response, HttpServletRequest request);
// 配置-下拉选项
@@ -43,4 +49,7 @@ public interface IParamsReportDetailEOService extends IService<ParamsReportDetai
// 导出模板下拉选项
List<Map<String, String>> getTemplateLabelList();
void exportCustom(ParamsReportDetailVO paramsReportDetailVO, HttpServletResponse response, HttpServletRequest request);
}
@@ -67,4 +67,5 @@ public interface IParamsReportEOService extends IService<ParamsReportEO> {
ParamsReportEO queryByOldParamsManifestId(String oldParamsManifestId, Integer version);
boolean setProjectNameAndTitle(List<String> oldParamsManifestIdList);
}
@@ -14,7 +14,8 @@ import com.jero.common.exception.JeroBootException;
import com.jero.common.util.oss.CosBootUtil;
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
import com.jero.modules.cert.collect.entity.*;
import com.jero.modules.cert.collect.entity.ParamsConfigDataEO;
import com.jero.modules.cert.collect.entity.ParamsConfigEO;
import com.jero.modules.cert.collect.enums.CollectManifestStateEnum;
import com.jero.modules.cert.collect.enums.ConfigDataTypeEnum;
import com.jero.modules.cert.collect.vo.ParamsConfigDataVO;
@@ -22,34 +23,23 @@ import com.jero.modules.cert.report.entity.*;
import com.jero.modules.cert.report.enums.ExportTypeEnum;
import com.jero.modules.cert.report.mapper.ParamsReportDetailEOMapper;
import com.jero.modules.cert.report.service.*;
import com.jero.modules.cert.report.util.Docx4jUtil;
import com.jero.modules.cert.report.vo.ParamsReportDetailVO;
import com.jero.modules.cert.template.enums.ControlTypeEnum;
import com.jero.modules.document.enums.FieldTypeEnum;
import com.jero.modules.ocr.util.LineHumpUtil;
import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.split.common.ConvertHtml2Excel;
import com.jero.modules.split.common.ReadExcel;
import com.jero.modules.split.dto.FileSpiltValTableExportDto;
import com.jero.modules.split.dto.FileSplitValExportDto;
import com.jero.modules.split.dto.FileSplitValImgExportDto;
import com.jero.modules.split.entity.SarFileSplitItemsValEO;
import com.jero.modules.split.page.SarFileSplitItemsEOPage;
import com.jero.modules.split.page.SarFileSplitItemsValEOPage;
import com.jero.modules.system.entity.SysDictItem;
import com.jero.modules.system.service.ISysDictItemService;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.apache.poi.common.usermodel.HyperlinkType;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.CreationHelper;
import org.apache.poi.ss.usermodel.Hyperlink;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.util.IOUtils;
import org.apache.poi.xssf.usermodel.*;
import org.aspectj.util.FileUtil;
import org.docx4j.openpackaging.exceptions.Docx4JException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mock.web.MockMultipartFile;
@@ -97,6 +87,10 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
@Autowired
private IParamsReportExportHistoryEOService paramsReportExportHistoryEOService;
@Autowired
private IParamsExportTemplateEOService paramsExportTemplateEOService;
@Value(value = "${jero.path.upload}")
private String uploadpath;
@@ -527,7 +521,7 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
List<String> fieldList = Arrays.asList(field.split(",")); // list形式
// 查询导出数据
List<Map<String, Object>> allParamsInfoList = queryForExport(paramsReportDetailVO); // id记得去掉
List<Map<String, Object>> allParamsInfoList = queryForExportNormal(paramsReportDetailVO); // id记得去掉
// 开始处理工作表
List<OSSFile> allRelevFileList = new ArrayList<>();
@@ -641,9 +635,6 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
return configLabelList;
}
@Autowired
private IParamsExportTemplateEOService paramsExportTemplateEOService;
@Override
public List<Map<String, String>> getTemplateLabelList() {
// 查询所有导出模板
@@ -664,6 +655,113 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
return templateLabelList;
}
@Override
public void exportCustom(ParamsReportDetailVO paramsReportDetailVO, HttpServletResponse response, HttpServletRequest request) {
OutputStream os = null;
OutputStream wordOS = null;
String fileOriName = "上报库参数项自定义导出信息";
if (CutEnum.EN.getValue().equals(paramsReportDetailVO.getCut())) {
fileOriName = "Params report custom data";
}
if (StringUtils.isNotEmpty(paramsReportDetailVO.getExportName())) {
fileOriName = paramsReportDetailVO.getExportName();
}
//创建临时文件夹
String fileNowPath = uploadpath + "/tempZip/" + UUID.randomUUID().toString().replace("-","") + File.separator + fileOriName;
File nowFile = new File(fileNowPath);
if (nowFile.exists()){
nowFile.delete();
}
nowFile.mkdirs();
String fileName = fileOriName + ".docx";
// 查询导出数据
List<Map> allParamsInfoList = queryForExportCustom(paramsReportDetailVO);
Map<String, String> params = allParamsInfoList.get(0);
String templateUrl = "";
ParamsExportTemplateEO paramsExportTemplateEO = paramsExportTemplateEOService.getById(paramsReportDetailVO.getExportTemplateId());
List<OSSFile> ossFiles = ossFileService.getFileInfosByConnectId(paramsExportTemplateEO.getFileConnectId());
if (CollectionUtil.isNotEmpty(ossFiles)) {
templateUrl = ossFiles.get(0).getUrl();
}
// 替换模板中的占位符
try {
//下载关联文件内容
List<OSSFile> allRelevFileList = (List<OSSFile>) allParamsInfoList.get(1).get("fileListAll");
if (allRelevFileList != null && !allRelevFileList.isEmpty()) {
allRelevFileList = allRelevFileList.stream().distinct().collect(Collectors.toList());
downLoadFileList(allRelevFileList,fileNowPath + File.separator + "导出文件");
}
// 拿取模板
String repFileName = fileName.replaceAll("/","_");
wordOS = new FileOutputStream(fileNowPath + File.separator + repFileName);
if (CosBootUtil.doesObjectExist(templateUrl)) {
InputStream wordTemplate = CosBootUtil.download(templateUrl);
com.qcloud.cos.utils.IOUtils.copy(wordTemplate, wordOS);
}
// 替换占位符内容
byte[] wordContent = Docx4jUtil.of(fileNowPath + File.separator + repFileName)
.addParams(params)
.get();
ByteArrayInputStream wordis = new ByteArrayInputStream(wordContent);
OutputStream wordFileOS = new FileOutputStream(fileNowPath + File.separator + repFileName);
int len1 = 0;
while ((len1 = wordis.read()) != -1) {
wordFileOS.write(len1);
}
wordOS.flush();
wordOS.close();
wordFileOS.flush();
wordFileOS.close();
// 打包导出压缩包
response.setHeader("Content-Disposition",
"attachment; filename=\""+ ReadExcel.encodeFileName(fileOriName+".zip", request) +"\"");
response.setContentType("application/force-download");
response.flushBuffer();
os = response.getOutputStream();
ZipUtil.zip(fileNowPath,fileNowPath+".zip");
FileInputStream fis = new FileInputStream(fileNowPath+".zip");
int len2 = 0;
while ((len2 = fis.read()) != -1) {
os.write(len2);
}
// 添加导出历史
/*String uploadFileName = fileOriName + ".zip";
MultipartFile mFile = new MockMultipartFile(uploadFileName, uploadFileName, ContentType.APPLICATION_OCTET_STREAM.toString(), fis); // 用于上传
OSSFile ossFile = ossFileService.uploadLocalOfCos(mFile, "/report", "", CutEnum.CN.getValue()); // 上传导出的压缩包
ParamsReportExportHistoryEO paramsReportExportHistoryEO = new ParamsReportExportHistoryEO();
paramsReportExportHistoryEO.setExportType(ExportTypeEnum.NORMAL.getValue());
paramsReportExportHistoryEO.setExportFileId(ossFile.getId());
paramsReportExportHistoryEO.setParamsManifestId(paramsReportDetailVO.getParamsManifestId());
paramsReportExportHistoryEO.setExportTime(new Date());
paramsReportExportHistoryEOService.add(paramsReportExportHistoryEO);*/
os.flush();
os.close(); // 后开先关
fis.close(); // 先开后关
} catch (Docx4JException e) {
log.error(e.getMessage(), e);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new JeroBootException("下载文件失败,请重试");
} finally {
IOUtils.closeQuietly(os);
IOUtils.closeQuietly(wordOS);
File tempZipFile = new File(uploadpath + "/tempZip");
FileUtil.deleteContents(tempZipFile);
}
}
private void downLoadFileList(List<OSSFile> allRelevFileList,String fileNowPath) {
File nowFile = new File(fileNowPath);
if (nowFile.exists()){
@@ -710,7 +808,7 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
bis.close(); // 先开后关
}
private List<Map<String, Object>> queryForExport(ParamsReportDetailVO paramsReportDetailVO) {
private List<Map<String, Object>> queryForExportNormal(ParamsReportDetailVO paramsReportDetailVO) {
List<String> idList = new ArrayList<>();
if (StringUtils.isNotEmpty(paramsReportDetailVO.getIds())) {
idList = Arrays.asList(paramsReportDetailVO.getIds().split(","));
@@ -803,6 +901,80 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
return dataList;
}
private List<Map> queryForExportCustom(ParamsReportDetailVO paramsReportDetailVO) {
List<String> idList = new ArrayList<>();
if (StringUtils.isNotEmpty(paramsReportDetailVO.getIds())) {
idList = Arrays.asList(paramsReportDetailVO.getIds().split(","));
}
List<String> configIdList = Arrays.asList(paramsReportDetailVO.getConfigIds().split(","));
List<Map<String, Object>> dataList = paramsReportDetailEOMapper.listInfoForExport(idList, paramsReportDetailVO);
List<ParamsReportConfigEO> paramsConfigEOList = paramsReportConfigEOService.queryList(paramsReportDetailVO.getParamsManifestId()); // 查询所有配置列
List<Map> resultList = new ArrayList<>();
Map<String, Object> resultMap = new HashMap<>();
List<OSSFile> fileListAll = new ArrayList<>();
// 查询配置列数据
for (Map<String, Object> record1 : dataList) {
String paramsCollectManifestId = (String) record1.get("id");
String nioNumber = (String) record1.get("nio_number");
if (CollectionUtil.isNotEmpty(paramsConfigEOList)) {
List<OSSFile> fileList = new ArrayList<>();
// 合并配置数据
String configData = "";
List<ParamsReportConfigDataEO> paramsReportConfigDataEOS = paramsReportConfigDataEOService.queryByConfigIdListAndCollectManifestId(configIdList, paramsCollectManifestId);
String textDatas = paramsReportConfigDataEOS.stream().filter(e->StringUtils.isNotEmpty(e.getTextData()))
.map(ParamsReportConfigDataEO::getTextData).distinct().collect(Collectors.joining(paramsReportDetailVO.getSeparator()));
String pullDatas = paramsReportConfigDataEOS.stream().filter(e->StringUtils.isNotEmpty(e.getPullData()))
.map(ParamsReportConfigDataEO::getPullData).distinct().collect(Collectors.joining(paramsReportDetailVO.getSeparator()));
List<String> fileNameList = new ArrayList<>();
paramsReportConfigDataEOS.forEach(paramsReportConfigDataEO -> {
if (StringUtils.isNotEmpty(paramsReportConfigDataEO.getFileConnectId())) {
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(paramsReportConfigDataEO.getFileConnectId());
if (CollectionUtil.isNotEmpty(ossFileList)) {
fileNameList.add(ossFileList.get(0).getFileName());
fileList.addAll(ossFileList);
}
}
});
StringBuilder configDataBuilder = new StringBuilder(); // 重新组合配置数据
if (StringUtils.isNotEmpty(textDatas)) {
configDataBuilder.append(textDatas).append("&");
}
if (StringUtils.isNotEmpty(pullDatas)) {
configDataBuilder.append(pullDatas).append("&");
}
if (CollectionUtil.isNotEmpty(fileNameList)) {
configDataBuilder.append(StringUtils.join(fileNameList, ",")).append("&");
}
configData = configDataBuilder.toString();
if (configData.contains("&")) {
configData = configData.substring(0, configData.lastIndexOf("&"));
}
resultMap.put(nioNumber, configData);
fileListAll.addAll(fileList);
}
}
Map<String, Object> fileMap = new HashMap<>();
fileMap.put("fileListAll", fileListAll);
resultList.add(resultMap);
resultList.add(fileMap);
return resultList;
}
/**
* 获取导出文件的表头
*
@@ -3,13 +3,15 @@ package com.jero.modules.cert.report.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.modules.cert.collect.mapper.ParamsManifestEOMapper;
import com.jero.modules.cert.collect.vo.ParamsManifestVO;
import com.jero.modules.cert.report.entity.ParamsReportEO;
import com.jero.modules.cert.report.mapper.ParamsReportEOMapper;
import com.jero.modules.cert.report.service.IParamsReportEOService;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -25,6 +27,9 @@ public class ParamsReportEOServiceImpl extends ServiceImpl<ParamsReportEOMapper,
@Autowired
private ParamsReportEOMapper paramsReportEOMapper;
@Autowired
private ParamsManifestEOMapper paramsManifestEOMapper;
/**
* 保存
*
@@ -121,4 +126,26 @@ public class ParamsReportEOServiceImpl extends ServiceImpl<ParamsReportEOMapper,
.eq(ParamsReportEO::getVersion, version);
return getOne(queryWrapper);
}
@Override
public boolean setProjectNameAndTitle(List<String> oldParamsManifestIdList) {
List<ParamsReportEO> updateEOList = new ArrayList<>();
List<ParamsManifestVO> paramsManifestEOList = paramsManifestEOMapper.listInfoAll(oldParamsManifestIdList);
paramsManifestEOList.forEach(paramsManifestVO -> {
LambdaQueryWrapper<ParamsReportEO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(ParamsReportEO::getOldParamsManifestId, paramsManifestVO.getId())
.eq(ParamsReportEO::getVersion, paramsManifestVO.getVersion());
ParamsReportEO paramsReportEO = getOne(queryWrapper);
ParamsReportEO updateEO = new ParamsReportEO();
updateEO.setId(paramsReportEO.getId());
updateEO.setTitle(paramsManifestVO.getTitle());
updateEO.setProjectName(paramsManifestVO.getProjectName());
updateEOList.add(updateEO);
});
return updateBatchById(updateEOList);
}
}
@@ -0,0 +1,481 @@
package com.jero.modules.cert.report.util;
import org.docx4j.XmlUtils;
import org.docx4j.dml.wordprocessingDrawing.Inline;
import org.docx4j.openpackaging.exceptions.Docx4JException;
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
import org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage;
import org.docx4j.wml.*;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Docx4jUtil {
public static Builder Builder;
public static Builder of(String path) throws FileNotFoundException, Docx4JException {
return new Builder(path);
}
public static class Builder {
private WordprocessingMLPackage template = null;
private Iterator<Text> texts = null;
// 占位符参数map
private Map<String, String> params = new HashMap<>();
private Builder(String path) throws FileNotFoundException, Docx4JException {
if (path != null && !path.isEmpty()) {
this.template = WordprocessingMLPackage.load(new FileInputStream(new File(path)));
this.texts = getAllPlaceholderElementFromObject(template.getMainDocumentPart()).iterator();
}
}
/**
* 增加文本占位符参数(一个)
*
* @param key 键
* @param value 值
* @return Builder对象
*/
public Builder addParam(String key, String value) {
Builder builder = this;
if (key != null && !key.isEmpty()) {
/*while (texts.hasNext()) {
Text text = texts.next();
String temp = text.getValue();
if (temp.equals("${" + key + "}")) {
text.setValue(value);
texts.remove();
return builder;
}
}*/
params.put(key, value);
}
return builder;
}
/**
* 增加参数(多个)
*
* @param params 多个参数的map
* @return Builder对象
*/
public Builder addParams(Map<String, String> params) {
this.params = params;
return this;
}
/**
* 增加一个表格
*
* @param tablePlaceholder 寻找表格的占位符
* @param placeholderRows 模板行所占行数
* @param list 替换模板占位符的数据
* @return Builder对象
* @throws JAXBException JAXBException
* @throws Docx4JException Docx4JException
*/
public Builder addTable(String tablePlaceholder, int placeholderRows, List<Map<String, String>> list)
throws Docx4JException, JAXBException {
List<Object> tables = getAllElementFromObject(template.getMainDocumentPart(), Tbl.class);
Tbl tempTable = getTemplateTable(tables, tablePlaceholder); //
if (tempTable != null && list != null && !list.isEmpty()) {
List<Object> trs = getAllElementFromObject(tempTable, Tr.class);
int rows = trs.size();
if (rows > placeholderRows) {
List<Tr> tempTrs = new ArrayList<>();
for (int i = rows - placeholderRows; i < rows; i++) {
tempTrs.add((Tr) trs.get(i));
}
for (Map<String, String> trData : list) {
for (Tr tempTr : tempTrs) {
addRowToTable(tempTable, tempTr, trData);
}
}
for (Tr tempTr : tempTrs) {
tempTable.getContent().remove(tempTr);
}
}
}
return this;
}
private void loadImg(Tbl tempTable, byte[] decodeBuffer, int maxWidth) {
Inline inline = createInlineImage(template, decodeBuffer, maxWidth);
P paragraph = addInlineImageToParagraph(inline);
List<Object> rows = getAllElementFromObject(tempTable, Tr.class);
Tr tr = (Tr) rows.get(0);
List<Object> cells = getAllElementFromObject(tr, Tc.class);
Tc tc = (Tc) cells.get(0);
tc.getContent().clear();
tc.getContent().add(paragraph);
}
/**
* 通过占位符确定加载图片的位置,图片的位置为表格
*
* @param placeholder 占位符
* @param decodeBuffer 图片的字节流
* @return 当前对象
* @throws Docx4JException Docx4JException
* @throws JAXBException JAXBException
*/
public Builder addImg(String placeholder, byte[] decodeBuffer) throws Docx4JException, JAXBException {
addImg(placeholder, decodeBuffer, 0);
return this;
}
/**
* 通过占位符确定加载图片的位置,图片的位置为表格
*
* @param placeholder 占位符
* @param decodeBuffer 图片的字节流
* @param maxWidth 图片的最多宽度,不传默认写入图片原始宽度
* @return 当前对象
* @throws Docx4JException Docx4JException
* @throws JAXBException JAXBException
*/
public Builder addImg(String placeholder, byte[] decodeBuffer, int maxWidth) throws Docx4JException, JAXBException {
List<Object> tables = getAllElementFromObject(template.getMainDocumentPart(), Tbl.class);
Tbl tempTable = getTemplateTable(tables, placeholder);
loadImg(tempTable, decodeBuffer, maxWidth);
return this;
}
/**
* 通过int的位置数组确定加载图片的位置,图片的位置为表格(以主界面为基准)
*
* @param wz int型数组,长度必须为3 ,第一个值为第几个表格,第二个值为第几行,第三个参数为第几个单元格
* @param decodeBuffer 图片的字节流
* @param maxWidth 图片的最多宽度,不传默认写入图片原始宽度
* @return 当前对象
*/
public Builder addImg(int[] wz, byte[] decodeBuffer, int maxWidth) {
Tc tc = getTcByWz(wz);
Tbl tempTable = (Tbl) getAllElementFromObject(tc, Tbl.class).get(0);
loadImg(tempTable, decodeBuffer, maxWidth);
return this;
}
/**
* 通过int的位置数组确定加载图片的位置,图片的位置为表格(以主界面为基准)
*
* @param wz int型数组,长度必须为3 ,第一个值为第几个表格,第二个值为第几行,第三个参数为第几个单元格
* @param decodeBuffer 图片的字节流
* @return 当前对象
*/
public Builder addImg(int[] wz, byte[] decodeBuffer) {
addImg(wz, decodeBuffer, 0);
return this;
}
/**
* 添加段落
*
* @param list 数据集合
* @param wz 模板段落所在的位置,长度为三(第几个表格,第几行,第几个单元格)
* @return Builder对象
*/
public Builder addParagrash(List<Map<String, String>> list, int[] wz) {
Tc tc = getTcByWz(wz);
List<Object> paraList = getAllElementFromObject(tc, P.class);
tc.getContent().clear();
for (Map<String, String> item : list) {
paraList.forEach((tempPara) -> {
P workingPara = (P) XmlUtils.deepCopy(tempPara);
repaleTexts(workingPara, item);
tc.getContent().add(workingPara);
});
}
return this;
}
/**
* 移除含有占位符的Tr
* @param placeholder 占位符
* @return Builder对象
*/
public Builder removeTrByPlaceholder(String placeholder) {
//这种方式获取是正常的,但是get()方法操作的时候不能正常替换文本了。
//List<Object> trs = template.getMainDocumentPart().getJAXBNodesViaXPath("//w:tr", true);
List<Object> trs = getAllElementFromObject(template.getMainDocumentPart(), Tr.class);
Tr tr = (Tr) getTemplateObj(trs,placeholder,false);
if(tr != null){
Tbl tbl = (Tbl) tr.getParent();
tbl.getContent().remove(tr);
}
return this;
}
/**
* 移除含有占位符的Tr
* @param placeholders 占位符的集合
* @return Builder对象
*/
public Builder removeTrByPlaceholder(List<String> placeholders) {
/* List<Object> trs = template.getMainDocumentPart().getJAXBNodesViaXPath("//w:tr", true);*/
List<Object> trs = getAllElementFromObject(template.getMainDocumentPart(), Tr.class);
List<Object> list = getTemplateObjs(trs,placeholders);
for (Object o:list) {
Tr tr = (Tr) o;
if(tr != null){
Tbl tbl = (Tbl) tr.getParent();
tbl.getContent().remove(tr);
}
}
return this;
}
/**
* 获取文件字节流
*
* @return 文件字节流
* @throws Docx4JException docx异常
*/
public byte[] get() throws Docx4JException {
if (!params.isEmpty()) {
while (texts.hasNext()) {
Text text = texts.next();
String temp = text.getValue();
for (Map.Entry<String, String> param : params.entrySet()) {
if (temp.equals("${" + param.getKey() + "}")) {
text.setValue(param.getValue());
}
}
}
}
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
template.save(outputStream);
return outputStream.toByteArray();
}
/**
* 获取指定单元格
*
* @param temp 模板段落所在的位置,长度为三(第几个表格,第几行,第几个单元格)
* @return tc
*/
private Tc getTcByWz(int[] temp) {
List<Object> tables = getAllElementFromObject(template.getMainDocumentPart(), Tbl.class);
Tbl wzTable = (Tbl) tables.get(temp[0]);
Tr tr = (Tr) getAllElementFromObject(wzTable, Tr.class).get(temp[1]);
return (Tc) getAllElementFromObject(tr, Tc.class).get(temp[2]);
}
}
/**
* 创建包含图片的一个内联对象
*
* @param wordMLPackage WordprocessingMLPackage
* @param bytes 图片字节流
* @param maxWidth 最大宽度
* @return 图片的内联对象
*/
private static Inline createInlineImage(WordprocessingMLPackage wordMLPackage, byte[] bytes, int maxWidth) {
Inline inline = null;
try {
BinaryPartAbstractImage imagePart = BinaryPartAbstractImage.createImagePart(wordMLPackage, bytes);
int docPrId = 1;
int cNvPrId = 2;
if (maxWidth > 0) {
inline = imagePart.createImageInline("Filename hint", "Alternative text", docPrId, cNvPrId, false, maxWidth);
} else {
inline = imagePart.createImageInline("Filename hint", "Alternative text", docPrId, cNvPrId, false);
}
} catch (Exception e) {
e.printStackTrace();
}
return inline;
}
/**
* 创建一个对象工厂并用它创建一个段落和一个可运行块R. 然后将可运行块添加到段落中. 接下来创建一个图画并将其添加到可运行块R中. 最后我们将内联
* 对象添加到图画中并返回段落对象.
*
* @param inline 包含图片的内联对象.
* @return 包含图片的段落
*/
private static P addInlineImageToParagraph(Inline inline) {
// 添加内联对象到一个段落中
ObjectFactory factory = new ObjectFactory();
P paragraph = factory.createP();
R run = factory.createR();
paragraph.getContent().add(run);
Drawing drawing = factory.createDrawing();
run.getContent().add(drawing);
drawing.getAnchorOrInline().add(inline);
return paragraph;
}
// 发现docx文档包含占位符的文本节点
private static List<Text> getAllPlaceholderElementFromObject(Object obj) {
List<Text> result = new ArrayList<>();
Class<Text> toSearch = Text.class;
Text textPlaceholder;
if (obj instanceof JAXBElement) {
obj = ((JAXBElement<?>) obj).getValue();
}
if (obj.getClass().equals(toSearch)) {
textPlaceholder = (Text) obj;
if (isPlaceholder(textPlaceholder.getValue())) {
result.add((Text) obj);
}
} else if (obj instanceof ContentAccessor) {
List<?> children = ((ContentAccessor) obj).getContent();
for (Object child : children) {
result.addAll(getAllPlaceholderElementFromObject(child));
}
}
return result;
}
// 发现docx文档中的节点
private static List<Object> getAllElementFromObject(Object obj, Class<?> toSearch) {
List<Object> result = new ArrayList<>();
if (obj instanceof JAXBElement) {
obj = ((JAXBElement<?>) obj).getValue();
}
if (obj.getClass().equals(toSearch)) {
result.add(obj);
} else if (obj instanceof ContentAccessor) {
List<?> children = ((ContentAccessor) obj).getContent();
for (Object child : children) {
result.addAll(getAllElementFromObject(child, toSearch));
}
}
return result;
}
// 这个方法只是查看表格是否含有我们的占位符,如果有则返回表格
private static Tbl getTemplateTable(List<Object> tables, String templateKey) {
return (Tbl) getTemplateObj(tables,templateKey,false);
}
/**
* 这个方法只是查看dom是否含有我们的占位符,如果有则返回dom
*
* @param objects 需要查找的dom元素
* @param placeholder 占位符
* @param f 是否全部查找,为ture时全部查找,返回的是list,为false时一找到元素就返回,只是单个元素
* @return 找到的元素
*/
private static Object getTemplateObj(List<Object> objects, String placeholder, boolean f) {
List<Object> objectList = new ArrayList<>();
for (Object o : objects) {
List<?> textElements = getAllElementFromObject(o, Text.class);
for (Object text : textElements) {
Text textElement = (Text) text;
if (textElement.getValue() != null && textElement.getValue().equals("${" + placeholder + "}")) {
if (!f) {
return o;
} else {
objectList.add(o);
}
}
}
}
return objectList.isEmpty()?null:objectList;
}
/**
* 这个方法只是查看dom是否含有我们的占位符,如果有则返回dom
* @param objects 需要查找的dom元素的集合
* @param placeholders 占位符集合
* @return 找到的元素的集合
*/
private static List<Object> getTemplateObjs(List<Object> objects, List<String> placeholders) {
List<Object> objectList = new ArrayList<>();
for (Object o : objects) {
List<?> textElements = getAllElementFromObject(o, Text.class);
for (Object text : textElements) {
Text textElement = (Text) text;
if (textElement.getValue() != null && placeholders.contains(getPlaceholderStr(textElement.getValue()))) {
objectList.add(o);
}
}
}
return objectList;
}
/**
* 复制模板行
*
* @param reviewtable 表格
* @param templateRow 模板行
* @param replacements 填充模板行的数据
*/
private static void addRowToTable(Tbl reviewtable, Tr templateRow, Map<String, String> replacements) {
Tr workingRow = XmlUtils.deepCopy(templateRow);
repaleTexts(workingRow, replacements);
reviewtable.getContent().add(workingRow);
}
/**
* 把工作对象中的全部占位符都替换掉
*
* @param working 工作对象
* @param replacements map数据对象
*/
private static void repaleTexts(Object working, Map<String, String> replacements) {
List<?> textElements = getAllElementFromObject(working, Text.class);
for (Object object : textElements) {
Text text = (Text) object;
String keyStr = getPlaceholderStr(text.getValue());
if (keyStr != null && !keyStr.isEmpty()) {
String replacementValue = replacements.get(keyStr);
if (replacementValue != null) {
text.setValue(replacementValue);
} else {
text.setValue("--");
}
}
}
}
/**
* 判断字符串是否有${}占位符
*
* @param str 需要判断的字符串
* @return 是否字符串是否有${}占位符
*/
private static boolean isPlaceholder(String str) {
if (str != null && !str.isEmpty()) {
Pattern pattern = Pattern.compile("([$]\\{\\w+\\})");
Matcher m = pattern.matcher(str);
return m.find();
}
return false;
}
/**
* 得到占位符${}中的文本
*
* @param str 需要判断的字符串
* @return 占位符${}中的文本
*/
private static String getPlaceholderStr(String str) {
if (str != null && !str.isEmpty()) {
Pattern p = Pattern.compile("\\$\\{(.*?)\\}");
Matcher m = p.matcher(str);
if (m.find()) {
return m.group(1);//m.group(0)包括这两个字符
}
}
return null;
}
}
@@ -1,13 +1,7 @@
package com.jero.modules.cert.report.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
@Data
public class ParamsReportDetailVO {
@@ -43,12 +37,19 @@ public class ParamsReportDetailVO {
@ApiModelProperty(value = "对应参数模板发布版本")
private Integer paramsTemplatePublishVersion;
// 导出通用
private String cut;
private String exportName;
private String ids; // 勾选导出
private String configIds; // 导出的配置列
// 常规导出专用
private String combineFlag; // 合并标识 1-不合并,2-合并
private String separator; // 分隔符
private String cut;
private String exportName;
// 自定义导出专用
private String exportTemplateId; //导出模板id
}
@@ -35,11 +35,9 @@ import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.aspectj.util.FileUtil;
import org.checkerframework.checker.units.qual.C;
import org.jeecgframework.poi.excel.ExcelExportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
@@ -516,14 +514,17 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
}
List<OSSFile> fileTemplateList = new ArrayList<>();
Map<String, String> fileNowPathMap = new HashMap<>();
for (ParamsInfoEO paramsInfoEO : paramsInfoEOList) {
String fileTemplateConnectId = paramsInfoEO.getFileTemplateConnectId();
if (StringUtils.isNotBlank(fileTemplateConnectId)) {
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(fileTemplateConnectId);
List<String> fileNameList = ossFileList.stream().map(OSSFile::getFileName).collect(Collectors.toList());
paramsInfoEO.setFileTemplateName(StringUtils.join(fileNameList, ","));
if (CollectionUtil.isNotEmpty(ossFileList)) {
paramsInfoEO.setFileTemplateName(paramsInfoEO.getNioNumber() + "/" + ossFileList.get(0).getFileName());
fileTemplateList.addAll(ossFileList);
fileNowPathMap.put(ossFileList.get(0).getId(), fileNowPath + File.separator + paramsInfoEO.getNioNumber());
fileTemplateList.add(ossFileList.get(0));
}
}
}
@@ -590,7 +591,7 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
//下载附件模板对应文件
if (fileTemplateList != null && !fileTemplateList.isEmpty()) {
fileTemplateList = fileTemplateList.stream().distinct().collect(Collectors.toList());
downLoadFileList(fileTemplateList,fileNowPath);
downLoadFileList(fileTemplateList, fileNowPathMap);
}
return sheetsList;
@@ -603,14 +604,17 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
}
List<OSSFile> fileTemplateList = new ArrayList<>();
Map<String, String> fileNowPathMap = new HashMap<>();
for (ParamsInfoEnExport paramsInfoEnExport : paramsInfoEnExportList) {
String fileTemplateConnectId = paramsInfoEnExport.getFileTemplateConnectId();
if (StringUtils.isNotBlank(fileTemplateConnectId)) {
List<OSSFile> ossFileList = ossFileService.getFileInfosByConnectId(fileTemplateConnectId);
List<String> fileNameList = ossFileList.stream().map(OSSFile::getFileName).collect(Collectors.toList());
paramsInfoEnExport.setFileTemplateName(StringUtils.join(fileNameList, ","));
if (CollectionUtil.isNotEmpty(ossFileList)) {
paramsInfoEnExport.setFileTemplateName(paramsInfoEnExport.getNioNumber() + "/" + ossFileList.get(0).getFileName());
fileTemplateList.addAll(ossFileList);
fileNowPathMap.put(ossFileList.get(0).getId(), fileNowPath + File.separator + paramsInfoEnExport.getNioNumber());
fileTemplateList.add(ossFileList.get(0));
}
}
}
@@ -677,14 +681,21 @@ public class ParamsInfoEOServiceImpl extends ServiceImpl<ParamsInfoEOMapper, Par
//下载附件模板对应文件
if (fileTemplateList != null && !fileTemplateList.isEmpty()) {
fileTemplateList = fileTemplateList.stream().distinct().collect(Collectors.toList());
downLoadFileList(fileTemplateList,fileNowPath);
downLoadFileList(fileTemplateList, fileNowPathMap);
}
return sheetsList;
}
private void downLoadFileList(List<OSSFile> fileTemplateList,String fileNowPath) {
private void downLoadFileList(List<OSSFile> fileTemplateList,Map<String ,String> fileNowPathMap) {
for(OSSFile fileExportDto : fileTemplateList){
String fileNowPath = fileNowPathMap.get(fileExportDto.getId());
File nowFile = new File(fileNowPath);
if (nowFile.exists()){
nowFile.delete();
}
nowFile.mkdirs();
String oldPath = fileExportDto.getUrl();
String newPath = fileNowPath + File.separator + fileExportDto.getFileName();
if (CosBootUtil.doesObjectExist(oldPath)){
@@ -290,20 +290,13 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//The standard GB 7258-2017 Technical specifications has been deleted from the document library.
//文档动态信息添加
if(StringUtils.isNotBlank(sbTemp)){
String substring = sbTemp.substring(0, sbTemp.length() - 1);
HomeDocumentDynamicEO homeDocumentDynamicEO = new HomeDocumentDynamicEO();
String msgContent = "The " + StringUtils.join(serialNumberListTemp,",") + " has been deleted from the document library.";
String msgContentInfo = "The " + substring + " has been deleted from the document library.";
homeDocumentDynamicEO.setMsgContent(msgContent);
homeDocumentDynamicEO.setMsgContentInfo(msgContent);
homeDocumentDynamicEOService.save(homeDocumentDynamicEO);
}
String sbStr = "";
if (ObjectUtils.isNotEmpty(sb)) {
sbStr = sb.substring(0, sb.length() - 1);
}
List<String> userNameList = new ArrayList<>();
if (onlCgformSubscribeList.size() != 0) {
for (OnlCgformSubscribe onlCgformSubscribe : onlCgformSubscribeList) {
@@ -313,10 +306,10 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<String> userIdList = userList.stream().map(SysUser::getId).collect(Collectors.toList());
String content = sysUser.getUsername() + " delete " + StringUtils.join(serialNumberList, ",") + ",Please pay attention to check.";
// String contentInfo = sysUser.getUsername() + " delete " + sbStr + ",Please pay attention to check.";
String contentInfo =content;
String title = content;
//封装消息的实体类
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, content, contentInfo,MessageTypeEnum.READ.getValue());
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, title, content, contentInfo,MessageTypeEnum.READ.getValue());
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
sendWebsocket(StringUtils.join(serialNumberList, ","), contentInfo);
}
@@ -2148,9 +2141,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
String contentInfo = "In the "+ technologyTerritoryName
+ " technical field you subscribed to, the "
+ href +" has been updated.";
// String contentInfo = sysUser.getUsername() + " add " + serialNumber + ",Please pay attention to check.";
String msgTitle = "The " + technologyTerritoryName + " technical field you subscribed to has been updated";
//封装消息的实体类
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, content, contentInfo,MessageTypeEnum.READ.getValue());
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, msgTitle, content, contentInfo,MessageTypeEnum.READ.getValue());
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
sendWebsocket(idTemp, contentInfo);
//飞书
@@ -3138,6 +3131,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
} catch (IOException e) {
log.error("文档新增飞书消息推送失败");
}
//站内消息(在文档中订阅和订阅管理中订阅中,因为站内消息和飞书消息的内容不一样所以都要独立发送)
//userList
String title = (String) map.get("title");
@@ -3149,9 +3143,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
sbStr = sbStr.replaceAll("<text class='highlight-class'>", "").replaceAll("</text>", "");
//您订阅的XXX已被修改
String contentInfo = "In the " + technologyTerritoryNameEn + " technical field you subscribed to," +sysUser.getUsername()+" changed the "+ href + " " + sbStr.toString();
// String contentInfo = "In the "+category + " " + href+" you subscribed to, "+sysUser.getUsername()+" changed the "+ href + " " + sbStr.toString();
//封装消息的实体类
SysAnnouncement sysAnnouncement = getSysAnnouncement(userList, contentInfoFei, contentInfo,MessageTypeEnum.READ.getValue());
String msgTitle = "The" + technologyTerritoryNameEn + "technical field you subscribed to has been updated";
// 封装消息的实体类
SysAnnouncement sysAnnouncement = getSysAnnouncement(userList, msgTitle, contentInfoFei, contentInfo,MessageTypeEnum.READ.getValue());
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
sendWebsocket((String) map.get("id"), contentInfo);
}
@@ -3171,8 +3165,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//您订阅的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 msgTitle = serialNumber + "you subsribed to has been updated";
//封装消息的实体类
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdListUpdate, content, contentInfo,MessageTypeEnum.READ.getValue());
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdListUpdate, msgTitle, content, contentInfo,MessageTypeEnum.READ.getValue());
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
sendWebsocket((String) map.get("id"), contentInfo);
}
@@ -3251,8 +3246,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
List<String> thirdIdList = userList.stream().map(SysUser::getThirdId).collect(Collectors.toList());
String content = "New numbering implemented, please note update status of alternate numbering " + StringUtils.join(serialNumberList, ",");
String contentInfo = "New numbering implemented, please note update status of alternate numbering " + sbStr;
String msgTitle = contentInfo;
//封装消息的实体类
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, content, contentInfo,MessageTypeEnum.READ.getValue());
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, msgTitle, content, contentInfo,MessageTypeEnum.READ.getValue());
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
sendWebsocket(StringUtils.join(serialNumberListTemp, ","), contentInfo);
//飞书
@@ -3275,7 +3271,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
@NotNull
public SysAnnouncement getSysAnnouncement(List<String> userIdList, String content, String contentInfo,String messageType) {
public SysAnnouncement getSysAnnouncement(List<String> userIdList, String title, String content, String contentInfo,String messageType) {
SysAnnouncement sysAnnouncement = new SysAnnouncement();
sysAnnouncement.setDelFlag("0");
sysAnnouncement.setSendStatus("0");
@@ -3283,6 +3279,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
// sysAnnouncement.setDocumentId((String) dataList.get(0).get("id"));
sysAnnouncement.setMsgCategory(messageType);//消息类型
sysAnnouncement.setMsgType(CommonConstant.MSG_TYPE_UESR);//指定用户
sysAnnouncement.setTitile(title);
sysAnnouncement.setMsgContent(content);
sysAnnouncement.setMsgContentInfo(contentInfo);
sysAnnouncement.setUserIds(StringUtils.join(userIdList, ","));
@@ -4749,8 +4746,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String content = sysUser.getUsername() + " pushed " + StringUtils.join(serialNumberList, ",") + " to you. Please be reminded to check it out.";
String contentInfo = sysUser.getUsername() + " pushed " + StringUtils.join(hrefList, ",") + " to you. Please be reminded to check it out.";
String title = StringUtils.join(hrefList, ",") + "has been pushed to you, please check";
//封装消息的实体类
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, content, contentInfo,MessageTypeEnum.PUSH.getValue());
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, title, content, contentInfo,MessageTypeEnum.PUSH.getValue());
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
sendWebsocket(StringUtils.join(thirdIdList, ","), contentInfo);
//飞书
@@ -1137,6 +1137,7 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
String content = null;
String contentInfo = null;
String contentInfoTemp = null;
String msgTitle = null;
if(InventoryStateEnum.ISSUE.getValue().equals(state)) {
//The xx virtual list you subscribed to has been updated as follows:1 . xxxxx 2.xxxx
@@ -1146,8 +1147,10 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
//拼接维护清单的消息
contentInfo = setContentInfo(contentInfo, baseDiff,contentLog);
contentInfoTemp = setContentInfo(contentInfoTemp, baseDiff,contentLog).replace("</br>"," ");
msgTitle = "The " + baseName + " virtual list you subscribed to has been updated";
//封装消息的实体类
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, content, contentInfo,MessageTypeEnum.READ.getValue());
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, msgTitle, content, contentInfo,MessageTypeEnum.READ.getValue());
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
bussDocumentLibraryEOService.sendWebsocket(idTemp, contentInfo);
//飞书
@@ -1159,9 +1162,9 @@ public class DummyInventoryBaseEOServiceImpl extends ServiceImpl<DummyInventoryB
}else{//撤回的消息
content = "Please note that the "+baseName+" virtual list you subscribed to has been withdrawn.";
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, content, contentInfo,MessageTypeEnum.READ.getValue());
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, msgTitle, content, contentInfo,MessageTypeEnum.READ.getValue());
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
bussDocumentLibraryEOService.sendWebsocket(idTemp, contentInfo);
//飞书
@@ -2,11 +2,13 @@ package com.jero.modules.lawsOpinionGather.entity;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
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 com.jero.modules.oss.entity.OSSFile;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
@@ -111,4 +113,10 @@ public class LawsOpinionGatherEO implements Serializable {
@ApiModelProperty(value = "流程编号")
private String prcNum;
@ApiModelProperty(value = "对外意见归档文件id")
private String opinionArchiveId;
/**对外意见归档文件数组**/
@TableField(exist = false)
private List<OSSFile> opinionArchiveFileList;
}
@@ -8,6 +8,8 @@ import com.jero.modules.lawsOpinionGather.entity.LawsOpinionGatherEO;
import com.jero.modules.lawsOpinionGather.enums.GatherResultEnum;
import com.jero.modules.lawsOpinionGather.mapper.LawsOpinionGatherEOMapper;
import com.jero.modules.lawsOpinionGather.service.ILawsOpinionGatherEOService;
import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.project.enums.OperatorTypeEnum;
import com.jero.modules.project.enums.RequestSourceEnum;
import com.jero.modules.system.entity.SysCategory;
@@ -33,6 +35,8 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
@Autowired
private SysCategoryServiceImpl sysCategoryService;
@Autowired
private IOSSFileService iOSSFileService;
/**
* 保存
@@ -149,6 +153,10 @@ public class LawsOpinionGatherEOServiceImpl extends ServiceImpl<LawsOpinionGathe
String technologyTerritoryShow = disposeTechnologyTerritory(technologyTerritoryList, lawsOpinionGather.getTechnologyTerritory(), cut);
lawsOpinionGather.setTechnologyTerritoryShow(technologyTerritoryShow);
}
if(StringUtils.isNotEmpty(lawsOpinionGather.getOpinionArchiveId())){
List<OSSFile> opinionArchiveFileList = iOSSFileService.getFileInfosByConnectId(StringUtils.join(lawsOpinionGather.getOpinionArchiveId(), ","));
lawsOpinionGather.setOpinionArchiveFileList(opinionArchiveFileList);
}
});
}
}
@@ -0,0 +1,170 @@
package com.jero.modules.lawsTechnologyEvaluation.controller;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jero.common.api.vo.Result;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO;
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationEOService;
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-07-07
* @Version: V1.0
*/
@Api(tags="法规技术评估")
@RestController
@RequestMapping("/lawsTechnologyEvaluation/lawsTechnologyEvaluationEO")
@Slf4j
public class LawsTechnologyEvaluationEOController extends JeroController<LawsTechnologyEvaluationEO, ILawsTechnologyEvaluationEOService> {
@Autowired
private ILawsTechnologyEvaluationEOService lawsTechnologyEvaluationEOService;
/**
* 分页列表查询
*
* @param lawsTechnologyEvaluationEO
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "法规技术评估-分页列表查询")
@ApiOperation(value="法规技术评估-分页列表查询", notes="法规技术评估-分页列表查询")
@GetMapping(value = "/page")
public Result<?> queryPageList(LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<LawsTechnologyEvaluationEO> queryWrapper = QueryGenerator.initQueryWrapper(lawsTechnologyEvaluationEO, req.getParameterMap());
Page<LawsTechnologyEvaluationEO> page = new Page<LawsTechnologyEvaluationEO>(pageNo, pageSize);
IPage<LawsTechnologyEvaluationEO> pageList = lawsTechnologyEvaluationEOService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 列表查询
*
* @return
*/
@AutoLog(value = "法规技术评估-列表查询")
@ApiOperation(value="法规技术评估-列表查询", notes="法规技术评估-列表查询")
@GetMapping(value = "/list")
public Result<List<LawsTechnologyEvaluationEO>> queryList() {
List<LawsTechnologyEvaluationEO> list = lawsTechnologyEvaluationEOService.queryList();
return Result.OK(list);
}
/**
* 添加
*
* @param lawsTechnologyEvaluationEO
* @return
*/
@AutoLog(value = "法规技术评估-添加")
@ApiOperation(value="法规技术评估-添加", notes="法规技术评估-添加")
@PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO) {
lawsTechnologyEvaluationEOService.add(lawsTechnologyEvaluationEO);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param lawsTechnologyEvaluationEO
* @return
*/
@AutoLog(value = "法规技术评估-编辑")
@ApiOperation(value="法规技术评估-编辑", notes="法规技术评估-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@Validated @RequestBody LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO) {
lawsTechnologyEvaluationEOService.editById(lawsTechnologyEvaluationEO);
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) {
lawsTechnologyEvaluationEOService.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.lawsTechnologyEvaluationEOService.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) {
LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO = lawsTechnologyEvaluationEOService.queryById(id);
if(lawsTechnologyEvaluationEO==null) {
return Result.error("未找到对应数据");
}
return Result.OK(lawsTechnologyEvaluationEO);
}
/**
* 导出excel
*
* @param request
* @param lawsTechnologyEvaluationEO
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO) {
return super.exportXls(request, lawsTechnologyEvaluationEO, LawsTechnologyEvaluationEO.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, LawsTechnologyEvaluationEO.class);
}
}
@@ -0,0 +1,145 @@
package com.jero.modules.lawsTechnologyEvaluation.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.util.Date;
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-07-07
* @Version: V1.0
*/
@Data
@TableName("laws_technology_evaluation")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="laws_technology_evaluation对象", description="法规技术评估")
public class LawsTechnologyEvaluationEO implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
/**标准id*/
@Excel(name = "标准id", width = 15)
@ApiModelProperty(value = "标准id")
private String standId;
/**编号*/
@Excel(name = "编号", width = 15)
@ApiModelProperty(value = "编号")
private String serialNumber;
/**标题*/
@Excel(name = "标题", width = 15)
@ApiModelProperty(value = "标题")
private String title;
/**技术领域*/
@Excel(name = "技术领域", width = 15)
@ApiModelProperty(value = "技术领域")
private String technologyTerritory;
/**评估方式*/
@Excel(name = "评估方式", width = 15)
@ApiModelProperty(value = "评估方式")
private String evaluationMethods;
/**流程状态*/
@Excel(name = "流程状态", width = 15)
@ApiModelProperty(value = "流程状态")
private String flowStatus;
/**发起日期*/
@Excel(name = "发起日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "发起日期")
private Date startTime;
/**截止日期*/
@Excel(name = "截止日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "截止日期")
private Date endTime;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remark;
/**流程实例id*/
@Excel(name = "流程实例id", width = 15)
@ApiModelProperty(value = "流程实例id")
private String actiProcInstId;
/**相关资料id*/
@Excel(name = "相关资料id", width = 15)
@ApiModelProperty(value = "相关资料id")
private String relatedDataFileId;
/**流程背景*/
@Excel(name = "流程背景", width = 15)
@ApiModelProperty(value = "流程背景")
private String processBackground;
/**法规工程师id*/
@Excel(name = "法规工程师id", width = 15)
@ApiModelProperty(value = "法规工程师id")
private String regulationOwnerId;
/**评估类型(类型有:反馈评估、条款评估)*/
@Excel(name = "评估类型(类型有:反馈评估、条款评估)", width = 15)
@ApiModelProperty(value = "评估类型(类型有:反馈评估、条款评估)")
private String evaluationType;
/**流程编号*/
@Excel(name = "流程编号", width = 15)
@ApiModelProperty(value = "流程编号")
private String prcNum;
}
@@ -0,0 +1,17 @@
package com.jero.modules.lawsTechnologyEvaluation.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 法规技术评估
* @Author: jero-boot
* @Date: 2022-07-07
* @Version: V1.0
*/
public interface LawsTechnologyEvaluationEOMapper extends BaseMapper<LawsTechnologyEvaluationEO> {
}
@@ -0,0 +1,27 @@
<?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.lawsTechnologyEvaluation.mapper.LawsTechnologyEvaluationEOMapper">
<resultMap id="LawsTechnologyEvaluationEOResultMap" type="com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO">
<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="stand_id" property="standId" />
<result column="serial_number" property="serialNumber" />
<result column="title" property="title" />
<result column="technology_territory" property="technologyTerritory" />
<result column="evaluation_methods" property="evaluationMethods" />
<result column="flow_status" property="flowStatus" />
<result column="start_time" property="startTime" />
<result column="end_time" property="endTime" />
<result column="remark" property="remark" />
<result column="acti_proc_inst_id" property="actiProcInstId" />
<result column="related_data_file_id" property="relatedDataFileId" />
<result column="process_background" property="processBackground" />
<result column="regulation_owner_id" property="regulationOwnerId" />
<result column="evaluation_type" property="evaluationType" />
<result column="prc_num" property="prcNum" />
</resultMap>
</mapper>
@@ -0,0 +1,61 @@
package com.jero.modules.lawsTechnologyEvaluation.service;
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @Description: 法规技术评估
* @Author: jero-boot
* @Date: 2022-07-07
* @Version: V1.0
*/
public interface ILawsTechnologyEvaluationEOService extends IService<LawsTechnologyEvaluationEO> {
/**
* 保存
*
* @param lawsTechnologyEvaluationEO
* @return
*/
void add(LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO);
/**
* 更新
*
* @param lawsTechnologyEvaluationEO
* @return
*/
void editById(LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO);
/**
* 通过id删除
*
* @param id
* @return
*/
void deleteById(String id);
/**
* 批量删除
*
* @param ids
* @return
*/
void deleteByIds(List<String> ids);
/**
* 通过id查询
*
* @param id
* @return
*/
LawsTechnologyEvaluationEO queryById(String id);
/**
* 列表查询
*
* @return
*/
List<LawsTechnologyEvaluationEO> queryList();
}
@@ -0,0 +1,89 @@
package com.jero.modules.lawsTechnologyEvaluation.service.impl;
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO;
import com.jero.modules.lawsTechnologyEvaluation.mapper.LawsTechnologyEvaluationEOMapper;
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationEOService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Date;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 法规技术评估
* @Author: jero-boot
* @Date: 2022-07-07
* @Version: V1.0
*/
@Service
public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl<LawsTechnologyEvaluationEOMapper, LawsTechnologyEvaluationEO> implements ILawsTechnologyEvaluationEOService {
/**
* 保存
*
* @param lawsTechnologyEvaluationEO
* @return
*/
@Override
public void add(LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO) {
Date now = new Date();
lawsTechnologyEvaluationEO.setCreateTime(now);
lawsTechnologyEvaluationEO.setUpdateTime(now);
save(lawsTechnologyEvaluationEO);
}
/**
* 更新
*
* @param lawsTechnologyEvaluationEO
* @return
*/
@Override
public void editById(LawsTechnologyEvaluationEO lawsTechnologyEvaluationEO) {
Date now = new Date();
lawsTechnologyEvaluationEO.setUpdateTime(now);
saveOrUpdate(lawsTechnologyEvaluationEO);
}
/**
* 通过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 LawsTechnologyEvaluationEO queryById(String id) {
return getById(id);
}
/**
* 列表查询
*
* @return
*/
@Override
public List<LawsTechnologyEvaluationEO> queryList() {
return list();
}
}
@@ -136,11 +136,13 @@ public class InventoryAffirmJob implements Job {
/*String msgContentCN = "您" + projectLibraryBase.getProjectName() + "(项目名称)法规清单的任务确认剩余处理时间还有3天,请及时查看处理";*/
// XXX .
String msgContentEN = "The remaining processing time for the regulation list confirmation of "
String msgContentEN = "The remaining processing time for the regulation list confirmation for "
+ 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 regulation list confirmation 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.");
@@ -168,7 +170,7 @@ public class InventoryAffirmJob implements Job {
sendMessageMap.put("contentInfo",contentInfo);
//发送消息
projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLibraryBase.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.REGULATION_LIST_CONFIRMATION_TASK);
projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN, threeDaysUserIdList, projectLibraryBase.getId(), sendMessageMap, feishuMsgVo, MessageTypeEnum.REGULATION_LIST_CONFIRMATION_TASK);
}
if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){
@@ -178,6 +180,8 @@ public class InventoryAffirmJob implements Job {
String msgContentEN = "The regulation list 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 list confirmation task to complete";
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setContent("Hello! The task will expire today. Please check and address it in a timely manner.");
@@ -204,7 +208,7 @@ public class InventoryAffirmJob implements Job {
sendMessageMap.put("hrefFeishu",hrefFeishu);
sendMessageMap.put("contentInfo",contentInfo);
//发送消息
projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLibraryBase.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.REGULATION_LIST_CONFIRMATION_TASK);
projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN, currentDaysUserIdList, projectLibraryBase.getId(), sendMessageMap, feishuMsgVo, MessageTypeEnum.REGULATION_LIST_CONFIRMATION_TASK);
}
}
}
@@ -144,6 +144,8 @@ public class PrehomoJob implements Job {
+ 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.");
@@ -168,7 +170,7 @@ public class PrehomoJob implements Job {
sendMessageMap.put("contentInfo",contentInfo);
//发送消息
projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.PRE_HOMO_TASK);
projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.PRE_HOMO_TASK);
}
if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){
@@ -179,6 +181,8 @@ public class PrehomoJob implements Job {
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.");
@@ -203,7 +207,7 @@ public class PrehomoJob implements Job {
sendMessageMap.put("contentInfo",contentInfo);
//发送消息
projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.PRE_HOMO_TASK);
projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.PRE_HOMO_TASK);
}
}
}
@@ -141,6 +141,8 @@ public class VerifyComplianceJob implements Job {
+ 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.");
@@ -165,7 +167,7 @@ public class VerifyComplianceJob implements Job {
sendMessageMap.put("contentInfo",contentInfo);
//发送消息
projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.VALIDATION_TASK);
projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.VALIDATION_TASK);
}
if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){
@@ -176,6 +178,8 @@ public class VerifyComplianceJob implements Job {
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.");
@@ -200,7 +204,7 @@ public class VerifyComplianceJob implements Job {
sendMessageMap.put("contentInfo",contentInfo);
//发送消息
projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.VALIDATION_TASK);
projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.VALIDATION_TASK);
}
}
}
@@ -142,6 +142,8 @@ public class designComplianceJob implements Job {
+ 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.");
@@ -161,7 +163,7 @@ public class designComplianceJob implements Job {
sendMessageMap.put("contentInfo",contentInfo);
//发送消息
projectLawsInventoryEOService.sendMessage(msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.DESIGN_COMPLIANCE_TASK);
projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN,threeDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.DESIGN_COMPLIANCE_TASK);
}
if(CollectionUtils.isNotEmpty(currentDaysUserIdList)){
@@ -171,6 +173,8 @@ public class designComplianceJob implements Job {
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.");
@@ -195,7 +199,7 @@ public class designComplianceJob implements Job {
sendMessageMap.put("contentInfo",contentInfo);
//发送消息
projectLawsInventoryEOService.sendMessage(msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.DESIGN_COMPLIANCE_TASK);
projectLawsInventoryEOService.sendMessage(msgTitle, msgContentEN,currentDaysUserIdList,projectLawsInventoryEO.getId(),sendMessageMap, feishuMsgVo, MessageTypeEnum.DESIGN_COMPLIANCE_TASK);
}
}
}
@@ -78,7 +78,7 @@ public interface IProjectLawsInventoryEOService extends IService<ProjectLawsInve
*/
Result<?> updateStatusBatch(JSONObject json);
void sendMessage(String msgContent, List<String> userIdList, String projectLibraryId, Map<String,Object> params, FeishuMsgVo feishuMsgVo, MessageTypeEnum messageType);
void sendMessage(String msgTitle, String msgContent, List<String> userIdList, String projectLibraryId, Map<String,Object> params, FeishuMsgVo feishuMsgVo, MessageTypeEnum messageType);
/**
* 匹配相关人员
@@ -1346,6 +1346,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
String msgContentEN = currentUser.getUsername() + " initiated the regulation list confirmation for "
+ projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ ". The due date is:" +inventoryAffirmDueDate+ " .Please check and address it in a timely manner.";
String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ ": You have a regulation list confirmation task to complete";
// 飞书消息封装
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
@@ -1375,7 +1377,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
sendMessageMap.put("contentInfo",contentInfo);
//发送消息
sendMessage(msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.REGULATION_LIST_CONFIRMATION_TASK);
sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.REGULATION_LIST_CONFIRMATION_TASK);
}
result = "发起清单确认";
@@ -1471,10 +1473,14 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//消息内容
String msgContentEN = "";
String msgTitle = "";
if(isProjectRole == Integer.parseInt(ProjectRoleEnum.REGULATI_ENGINEER.getValue()) || isProjectRole == Integer.parseInt(ProjectRoleEnum.REGULATI_AND_HOMOLOGATION_ENGINEER.getValue())){
msgContentEN = "The regulation list confirmation" +" of "+projectLawsInventoryEO.getSerialNumber() +" for "
+ projectNameInfoEO.getProjectName() +" is rejected by " +currentUser.getUsername() +". Please check and address it in a timely manner.";
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() +
": You have a regulation list confirmation task to complete";
// 飞书消息封装
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
@@ -1507,12 +1513,15 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
//发送消息
List<String> userIdList = new ArrayList<>();
userIdList.add(projectLibraryBase.getStudioEngineer());
sendMessage(msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.REGULATION_LIST_CONFIRMATION_TASK);
sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.REGULATION_LIST_CONFIRMATION_TASK);
}
if(isProjectRole == Integer.parseInt(ProjectRoleEnum.HOMOLOGATION_ENGINEER.getValue()) || isProjectRole == Integer.parseInt(ProjectRoleEnum.REGULATI_AND_HOMOLOGATION_ENGINEER.getValue())){
msgContentEN = "The regulation list confirmation of "+projectLawsInventoryEO.getSerialNumber() + " for "
+ projectNameInfoEO.getProjectName() +" is rejected by " + currentUser.getUsername() +". Please check and address it in a timely manner.";
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket() +
": You have a regulation list confirmation task to complete";
// 飞书消息封装
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
@@ -1545,7 +1554,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
//发送消息
List<String> userIdList = new ArrayList<>();
userIdList.add(projectLibraryBase.getStudioEngineer());
sendMessage(msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.REGULATION_LIST_CONFIRMATION_TASK);
sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.REGULATION_LIST_CONFIRMATION_TASK);
}
}
@@ -1561,6 +1570,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
String msgContentEN = "The regulation list confirmation of "
+projectLawsInventoryEO.getSerialNumber()+" for "
+ projectNameInfoEO.getProjectName() +" is completed. Please check.";
String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ ": You have a regulation list confirmation notification to check";
// 飞书消息封装
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
@@ -1593,7 +1604,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
//发送消息
List<String> userIdList = new ArrayList<>();
userIdList.add(projectLibraryBase.getStudioEngineer());
sendMessage(msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.REGULATION_LIST_CONFIRMATION_NOTIFICATION);
sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.REGULATION_LIST_CONFIRMATION_NOTIFICATION);
}
}
}
@@ -1616,7 +1627,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
* @param projectLibraryId
*/
@Override
public void sendMessage(String msgContent, List<String> userIdList,String projectLibraryId,Map<String,Object> sendMessageMap, FeishuMsgVo feishuMsgVo, MessageTypeEnum messageType){
public void sendMessage(String msgTitle, String msgContent, List<String> userIdList,String projectLibraryId,Map<String,Object> sendMessageMap, FeishuMsgVo feishuMsgVo, MessageTypeEnum messageType){
String idTemp = projectLibraryId;
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
@@ -1630,7 +1641,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
String contentInfo = (String) sendMessageMap.get("contentInfo");
//系统消息
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, msgContent, contentInfo, messageType);
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, msgTitle, msgContent, contentInfo, messageType);
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
sendWebsocket(idTemp, idTemp);
@@ -1650,13 +1661,14 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
}
@NotNull
private SysAnnouncement getSysAnnouncement(List<String> userIdList, String content, String contentInfo, MessageTypeEnum messageType) {
private SysAnnouncement getSysAnnouncement(List<String> userIdList, String title, String content, String contentInfo, MessageTypeEnum messageType) {
SysAnnouncement sysAnnouncement = new SysAnnouncement();
sysAnnouncement.setDelFlag("0");
sysAnnouncement.setSendStatus("0");
sysAnnouncement.setSendTime(new Date());
sysAnnouncement.setMsgCategory(messageType.getValue());//消息类型
sysAnnouncement.setMsgType(CommonConstant.MSG_TYPE_UESR);//指定用户
sysAnnouncement.setTitile(title);
sysAnnouncement.setMsgContent(content);
sysAnnouncement.setMsgContentInfo(contentInfo);
sysAnnouncement.setUserIds(StringUtils.join(userIdList, ","));
@@ -2073,36 +2085,45 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
SysUser sysUser = sysUserMapper.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getId, currentUserId));
String msgContentEN = "";
String msgTitle = "";
List<String> userIdList = new ArrayList<>();
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_START_MSG.getValue())) {
userIdList.add(engineeringInterfacePerson);
msgContentEN = sysUser.getUsername() + " assigned the regulation task confirmation of " + projectNameInfoEO.getProjectName()
msgContentEN = sysUser.getUsername() + " initiated the regulation task confirmation of " + projectNameInfoEO.getProjectName()
+ ".The due date is:" +taskAffirmDueDate+ " Please check and address it in a timely manner.";
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ ": You have a regulation task confirmation to complete";
feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has assigned the task to you. Please check and and handle it in time.");
feishuMsgVo.setContent("Hello! Please check and address this task in a timely manner.");
} else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_ISSUE_DRE_MSG.getValue())) {
String dreUserId = jsonObject.getString("dreUserId"); //dre用户id
userIdList.add(dreUserId);
msgContentEN = sysUser.getUsername() + " has assigned the regulation task confirmation of " + serialNumber + " in "+ projectNameInfoEO.getProjectName()
+ ".to you. the due date is " +taskAffirmDueDate+ " Please check and handle it in time.";
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ ": You have a regulation task confirmation to complete";
feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has assigned the task. Please check and and handle it in time.");
} else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_DRE_REJECTED.getValue())) {
userIdList.add(engineeringInterfacePerson);
msgContentEN = sysUser.getUsername() + " has returned the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName()
msgContentEN = sysUser.getUsername() + " has rejected the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName()
+ ".The due date is " +taskAffirmDueDate+ " Please check and handle it in time.";
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ ": You have a regulation task confirmation to complete";
feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has returned the task. Please check and and handle it in time.");
feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has rejected the task. Please check and and handle it in time.");
} else if (StringUtils.equals(msgType, MsgTypeEnum.TASK_AFFIRM_DRE_ACCEPTED.getValue())) {
userIdList.add(engineeringInterfacePerson);
msgContentEN = sysUser.getUsername() + " has submitted the regulation task confirmation of " + serialNumber +" in "+ projectNameInfoEO.getProjectName()
+ ".The due date is " +taskAffirmDueDate+ " Please check and handle it in time.";
msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ ": You have a regulation task confirmation to complete";
feishuMsgVo.setContent("Hello! " + sysUser.getUsername() + " has submitted the task. Please check and and handle it in time.");
@@ -2128,7 +2149,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
sendMessageMap.put("contentInfo",contentInfo);
//发送消息
sendMessage(msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, MessageTypeEnum.REGULATION_TASK_CONFIRMATION_TASK);
sendMessage(msgTitle, msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, MessageTypeEnum.REGULATION_TASK_CONFIRMATION_TASK);
}
}
@@ -6465,6 +6486,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
//消息内容
String msgContentEN = "Please address the regulation list confirmation process for "+ projectNameInfoEO.getProjectName() +" ASAP. ";
String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ ": You have a regulation task confirmation to complete";
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setContent("Hello! Please address the regulation list confirmation process ASAP. ");
@@ -6492,7 +6515,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
sendMessageMap.put("contentInfo",contentInfo);
//发送消息
sendMessage(msgContentEN,inventoryAffirmUserIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.REGULATION_LIST_CONFIRMATION_TASK);
sendMessage(msgTitle, msgContentEN,inventoryAffirmUserIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.REGULATION_LIST_CONFIRMATION_TASK);
}
}
@@ -6529,6 +6552,8 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
//消息内容
String msgContentEN = "Please address the regulation task confirmation process for "+ projectNameInfoEO.getProjectName() +" ASAP. ";
String msgTitle = projectNameInfoEO.getProjectName() + "-" + projectYearNameInfoEO.getYearName() + " " + projectLibraryBase.getTargetMarket()
+ ": You have a regulation task confirmation to complete";
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
feishuMsgVo.setContent("Hello! Please address the task ASAP. ");
@@ -6546,7 +6571,7 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
sendMessageMap.put("contentInfo",contentInfo);
//发送消息
sendMessage(msgContentEN,taskAffirmUserIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.REGULATION_TASK_CONFIRMATION_TASK);
sendMessage(msgTitle, msgContentEN,taskAffirmUserIdList,projectLibraryId,sendMessageMap, feishuMsgVo, MessageTypeEnum.REGULATION_TASK_CONFIRMATION_TASK);
}
}
});
@@ -289,9 +289,7 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
public void sendMessage(ProjectTaskInventoryDetailEO projectTaskInventoryDetailEO,List<String> userIdList){
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String msgContentEN = "";
String projectTaskInventoryId = projectTaskInventoryDetailEO.getProjectTaskInventoryId();
String projectTaskInventoryId = projectTaskInventoryDetailEO.getProjectTaskInventoryId();
ProjectLawsInventoryEO projectLawsInventoryEO = projectLawsInventoryEOMapper.selectOne(new QueryWrapper<ProjectLawsInventoryEO>().lambda().eq(ProjectLawsInventoryEO::getId, projectTaskInventoryId));
String projectLibraryId = projectLawsInventoryEO.getProjectLibraryId();
ProjectLibraryBase projectLibraryBase = projectLibraryBaseMapper.selectOne(new QueryWrapper<ProjectLibraryBase>().lambda().eq(ProjectLibraryBase::getId, projectLibraryId));
@@ -305,6 +303,8 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
String id = UUID.randomUUID().toString().replace("-", "");
MessageTypeEnum messageTypeEnum = null;
String msgContentEN = "";
String msgTitle = "";
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
//给工程师下发消息
@@ -314,6 +314,8 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
+ 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");
@@ -327,6 +329,8 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
+ 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");
@@ -340,6 +344,8 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
+ 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");
@@ -366,7 +372,7 @@ public class ProjectTaskInventoryDetailEOServiceImpl extends ServiceImpl<Project
sendMessageMap.put("contentInfo",contentInfo);
//发送消息
SendMessageUtils.sendMessage(msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, messageTypeEnum);
SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, messageTypeEnum);
}
}
}
@@ -335,7 +335,6 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
//项目库id
String projectLibraryId = jsonObject.getString("projectLibraryId");
String msgContentEN = "";
List<String> userIdList = new ArrayList<>();
ProjectLibraryBase projectLibraryBase = projectLibraryBaseMapper.selectOne(new QueryWrapper<ProjectLibraryBase>()
@@ -354,6 +353,8 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
FeishuMsgVo feishuMsgVo = new FeishuMsgVo();
String msgContentEN = "";
String msgTitle = "";
MessageTypeEnum messageTypeEnum = null;
if(StringUtils.equals(msgType,MsgTypeEnum.DESIGN_REMIND_MSG.getValue())){
@@ -362,6 +363,8 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
+ 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");
@@ -374,6 +377,8 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
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");
@@ -386,6 +391,8 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
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");
@@ -418,7 +425,7 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
sendMessageMap.put("contentInfo",contentInfo);
//发送消息
SendMessageUtils.sendMessage(msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, messageTypeEnum);
SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryId,sendMessageMap, feishuMsgVo, messageTypeEnum);
}
return new Result<>().success("提醒办理成功!");
}
@@ -733,7 +740,6 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
new QueryWrapper<ProjectLawsInventoryEO>().lambda().eq(ProjectLawsInventoryEO::getId, id)
);
String msgContentEN = "";
List<String> userIdList = new ArrayList<>();
String dreUserIds = jsonObject.getString("dreUserIds"); //dre用户id
if(StringUtils.isNotEmpty(dreUserIds)){
@@ -770,6 +776,8 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
String dutDateStr = "";
MessageTypeEnum messageTypeEnum = null;
String msgContentEN = "";
String msgTitle = "";
if (StringUtils.equals(msgType, MsgTypeEnum.DESIGN_ISSUE_DRE_MSG.getValue())) {
taskKey = DesignComplianceNodeEnum.DRE_DISPOSE.getKey();
@@ -781,6 +789,8 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
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");
@@ -798,7 +808,9 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
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.";
+ " 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");
@@ -817,6 +829,8 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
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");
@@ -835,6 +849,8 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
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");
@@ -976,7 +992,7 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl<ProjectTaskIn
sendMessageMap.put("contentInfo",contentInfo);
//发送消息
SendMessageUtils.sendMessage(msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, messageTypeEnum);
SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,id,sendMessageMap, feishuMsgVo, messageTypeEnum);
}
}
@@ -160,11 +160,15 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
//消息内容
String msgContentEN = "";
String msgTitle = "";
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";
feishuMsgVo.setTaskType("Design Compliance Confirmation");
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getDesignDueDate()));
@@ -174,6 +178,8 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
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()));
@@ -183,6 +189,8 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
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()));
@@ -210,7 +218,7 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
sendMessageMap.put("contentInfo",contentInfo);
//发送消息
SendMessageUtils.sendMessage(msgContentEN,userIdList,projectLibraryBaseInfo.getId(),sendMessageMap, feishuMsgVo, messageTypeEnum);
SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryBaseInfo.getId(),sendMessageMap, feishuMsgVo, messageTypeEnum);
}
}
@@ -353,11 +361,15 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
//消息内容
String msgContentEN = "";
String msgTitle = "";
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";
feishuMsgVo.setTaskType("Design Compliance Confirmation");
feishuMsgVo.setDueDate(sdf.format(projectLawsInventoryEO.getDesignDueDate()));
@@ -367,6 +379,8 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
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()));
@@ -376,6 +390,8 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
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()));
@@ -403,7 +419,7 @@ public class ProjectTaskInventoryFeedbackEOServiceImpl extends ServiceImpl<Proje
sendMessageMap.put("contentInfo",contentInfo);
//发送消息
SendMessageUtils.sendMessage(msgContentEN,userIdList,projectLibraryBaseInfo.getId(),sendMessageMap, feishuMsgVo, messageTypeEnum);
SendMessageUtils.sendMessage(msgTitle, msgContentEN,userIdList,projectLibraryBaseInfo.getId(),sendMessageMap, feishuMsgVo, messageTypeEnum);
}
}
}
@@ -54,7 +54,7 @@ public class SendMessageUtils {
SendMessageUtils.webSocket = webSocket;
}
public static void sendMessage(String msgContent, List<String> userIdList, String projectLibraryId, Map<String,Object> sendMessageMap, FeishuMsgVo feishuMsgVo, MessageTypeEnum messageType) {
public static void sendMessage(String msgTitle, String msgContent, List<String> userIdList, String projectLibraryId, Map<String,Object> sendMessageMap, FeishuMsgVo feishuMsgVo, MessageTypeEnum messageType) {
String idTemp = projectLibraryId;
List<SysUser> sysUsers = sysUserService.listByIds(userIdList);
@@ -69,7 +69,7 @@ public class SendMessageUtils {
String contentInfo = (String) sendMessageMap.get("contentInfo");
//系统消息
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, msgContent, contentInfo,messageType);
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdList, msgTitle, msgContent, contentInfo,messageType);
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
sendWebsocket(idTemp, idTemp);
@@ -89,13 +89,14 @@ public class SendMessageUtils {
}
@NotNull
private static SysAnnouncement getSysAnnouncement(List<String> userIdList, String content, String contentInfo, MessageTypeEnum messageType) {
private static SysAnnouncement getSysAnnouncement(List<String> userIdList, String title, String content, String contentInfo, MessageTypeEnum messageType) {
SysAnnouncement sysAnnouncement = new SysAnnouncement();
sysAnnouncement.setDelFlag("0");
sysAnnouncement.setSendStatus("0");
sysAnnouncement.setSendTime(new Date());
sysAnnouncement.setMsgCategory(messageType.getValue());//消息类型
sysAnnouncement.setMsgType(CommonConstant.MSG_TYPE_UESR);//指定用户
sysAnnouncement.setTitile(title);
sysAnnouncement.setMsgContent(content);
sysAnnouncement.setMsgContentInfo(contentInfo);
sysAnnouncement.setUserIds(StringUtils.join(userIdList, ","));
@@ -10,6 +10,7 @@ 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.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@@ -22,6 +23,7 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -172,4 +174,14 @@ public class LawsMonthlyReportWriteEOController extends JeroController<LawsMonth
return super.importExcel(request, response, LawsMonthlyReportWriteEO.class);
}
/**
* 月报整合导出zip
*/
@AutoLog(value = "月报整合导出zip")
@ApiOperation(value = "月报整合导出zip", notes = "月报整合导出zip")
@RequestMapping(value = "/exportMonthlyReport", method = RequestMethod.GET)
public ResponseEntity<byte[]> exportMonthlyReport(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO) throws IOException {
return lawsMonthlyReportWriteEOService.exportMonthlyReport(lawsMonthlyReportWriteEO);
}
}
@@ -187,4 +187,8 @@ public class LawsMonthlyReportWriteEO implements Serializable {
@TableField(exist = false)
private String cut;
//导出
@TableField(exist = false)
private String ids;
}
@@ -3,6 +3,7 @@ package com.jero.modules.report.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.modules.report.entity.LawsMonthlyReportWriteEO;
import org.springframework.http.ResponseEntity;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@@ -74,4 +75,6 @@ public interface ILawsMonthlyReportWriteEOService extends IService<LawsMonthlyRe
Integer pageNo,
Integer pageSize,
HttpServletRequest req);
ResponseEntity<byte[]> exportMonthlyReport(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO);
}
@@ -18,13 +18,21 @@ import com.jero.modules.report.service.ILawsMonthlyReportTitleTemplateEOService;
import com.jero.modules.report.service.ILawsMonthlyReportWriteEOService;
import com.jero.modules.report.service.INewOpinionTemplateEOService;
import com.jero.modules.report.service.INewStandardTemplateEOService;
import com.jero.modules.report.util.WordUtil;
import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
import com.jero.modules.system.util.StringUtils;
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
@@ -48,6 +56,8 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
private ILawsMonthlyReportTitleTemplateEOService lawsMonthlyReportTitleTemplateEOService;
@Autowired
private SysCategoryServiceImpl sysCategoryService;
@Value(value = "${jero.path.upload}")
private String uploadpath;
/**
* 保存
*
@@ -298,4 +308,77 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
}
return pageInfo;
}
@Override
public ResponseEntity<byte[]> exportMonthlyReport(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO) {
ResponseEntity<byte[]> result = null;
//获取数据
LambdaQueryWrapper<LawsMonthlyReportWriteEO> wrapper = new LambdaQueryWrapper<>();
if(StringUtils.isNotBlank(lawsMonthlyReportWriteEO.getMonth())){
wrapper.eq(LawsMonthlyReportWriteEO::getMonth,lawsMonthlyReportWriteEO.getMonth());
}
if(StringUtils.isNotBlank(lawsMonthlyReportWriteEO.getIds())){
wrapper.in(LawsMonthlyReportWriteEO::getId,StringUtils.join(lawsMonthlyReportWriteEO.getIds(),""));
}
List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS = this.list(wrapper);
//月报填写列表所有的章节目录
List<String> memoriesChapterList = lawsMonthlyReportWriteEOS.stream()
.map(LawsMonthlyReportWriteEO::getMemoriesChapter).distinct().collect(Collectors.toList());
//所有的章节目录
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOS = lawsMonthlyReportTitleTemplateEOService.list();
lawsMonthlyReportTitleTemplateEOS = lawsMonthlyReportTitleTemplateEOS.stream()
.filter(e -> memoriesChapterList.contains(e.getId())).collect(Collectors.toList());
String path = uploadpath + "/tempZip";
File fileTemp = new File(path);
if (fileTemp.exists()) {
fileTemp.delete();
}
fileTemp.mkdirs();
createWord(path,lawsMonthlyReportWriteEOS,lawsMonthlyReportTitleTemplateEOS);
return null;
}
/**
*
* @param path
* @param lawsMonthlyReportWriteEOS 列表数据
* @param lawsMonthlyReportTitleTemplateEOS 章节目录
*/
private void createWord(String path,
List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOS){
//蔚来汽车法规月报-202004-主页面-CN
//NIO Monthly Report on Automobile Regulations-202004-Main Page-EN
String memoriesChapterCN = path + File.separator +"蔚来汽车法规月报" + lawsMonthlyReportWriteEOS.get(0).getMonth()+"主页面-CN.docx";
String memoriesChapterEN = path + File.separator +"NIO Monthly Report on Automobile Regulations-" + lawsMonthlyReportWriteEOS.get(0).getMonth()+"-Main Page-EN.docx";
File wordFile = new File(memoriesChapterCN);
if(!wordFile.exists()){
try {
wordFile.getParentFile().mkdirs();
wordFile.createNewFile();
} catch (IOException e) {
log.error("文件《"+memoriesChapterCN+"》创建失败");
}
}
try (XWPFDocument document = new XWPFDocument();
FileOutputStream out = new FileOutputStream(wordFile)) {
WordUtil.exportWord(document, memoriesChapterCN, null, ParagraphAlignment.CENTER, 0, 12, false, true, "Microsoft YaHei UI");
} catch (IOException e) {
log.error("文件创建异常,异常信息为:" + e.getMessage());
}
}
}
@@ -0,0 +1,87 @@
package com.jero.modules.report.util;
import cn.hutool.core.util.ObjectUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFRun;
public class WordUtil {
/**
* 导出工具示例
*
* @param document POI文件类
* @param text 输出文本
* @param textColor 字体颜色
* @param align 字体位置,默认居左
* @param spaceNum 预留空格数,默认不留空格
* @param fontSize 字体大小,默认11
* @param isNewline 是否换行,换行后文本失效
* @param isBold 是否加粗,默认不加粗
* @param fontFamily 字体,默认宋体
*/
public static void exportWord(XWPFDocument document,
String text,
String textColor,
ParagraphAlignment align,
Integer spaceNum,
Integer fontSize,
Boolean isNewline,
Boolean isBold,
String fontFamily) {
document.createParagraph();
//添加标题
XWPFParagraph titleParagraph = document.createParagraph();
//设置段落左对齐
if (align == null) {
titleParagraph.setAlignment(ParagraphAlignment.LEFT);
} else {
titleParagraph.setAlignment(align);
}
XWPFRun titleParagraphRun = titleParagraph.createRun();
if (isNewline) {
titleParagraphRun.setText("\r");
} else {
//封装文字内容
StringBuilder newText = new StringBuilder();
for (int i = 0; i < spaceNum; i++) {
newText.append(" ");
}
newText.append(text);
titleParagraphRun.setText(newText.toString());
//设置颜色
if (StringUtils.isNotEmpty(textColor)) {
titleParagraphRun.setColor(textColor);
} else {
titleParagraphRun.setColor("000000");
}
//设置文字大小
if (ObjectUtil.isNotEmpty(fontSize)) {
titleParagraphRun.setFontSize(fontSize);
} else {
titleParagraphRun.setFontSize(11);
}
//设置加粗
if (ObjectUtil.isNotEmpty(isBold)) {
titleParagraphRun.setBold(isBold);
} else {
titleParagraphRun.setBold(false);
}
//设置字体样式
if (StringUtils.isNotEmpty(fontFamily)) {
titleParagraphRun.setFontFamily(fontFamily);
} else {
titleParagraphRun.setFontFamily("宋体");
}
}
}
}
@@ -332,8 +332,10 @@ public class LawsWarnService {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String content = sysUser.getUsername() + " pushed " + StringUtils.join(serialNumberList, ",") + " to you. Please be reminded to check it out.";
String contentInfo = sysUser.getUsername() + " pushed " + StringUtils.join(hrefList, ",") + " to you. Please be reminded to check it out.";
String title = content;
//封装消息的实体类
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, content, contentInfo,MessageTypeEnum.PUSH.getValue());
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, title, content, contentInfo,MessageTypeEnum.PUSH.getValue());
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
bussDocumentLibraryEOService.sendWebsocket(StringUtils.join(thirdIdList, ","), contentInfo);
//飞书
@@ -122,7 +122,8 @@ public class TimedTaskWarn implements Job {
+ " 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";
sendMessage(content,contentInfo,content, url, userIdList, thirdIdList);
String msgTitle = content;
sendMessage(msgTitle, content,contentInfo,content, url, userIdList, thirdIdList);
}
}
@@ -141,16 +142,17 @@ public class TimedTaskWarn implements Job {
+ " production vehicle you subscribed to is "+format+",please pay attention to check";
String contentInfo = "The implementation date of the " + category +" "+ href
+ " production vehicle you subscribed to is "+format+",please pay attention to check";
sendMessage(content,contentInfo,content, url, userIdList, thirdIdList);
String msgTitle = content;
sendMessage(msgTitle, content,contentInfo,content, url, userIdList, thirdIdList);
}
}
}
}
private void sendMessage(String content,String contentInfo,String contentFeiShu, String url, List<String> userIdList, List<String> thirdIdList) {
private void sendMessage(String title, String content,String contentInfo,String contentFeiShu, String url, List<String> userIdList, List<String> thirdIdList) {
//站内消息
//封装消息的实体类
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, content, contentInfo,MessageTypeEnum.WARN.getValue());
SysAnnouncement sysAnnouncement = bussDocumentLibraryEOService.getSysAnnouncement(userIdList, title, content, contentInfo,MessageTypeEnum.WARN.getValue());
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
bussDocumentLibraryEOService.sendWebsocket(StringUtils.join(userIdList, ","), content);