fix(标准宣贯流程): 79571、草稿存储人员信息

This commit is contained in:
yjz
2023-12-27 13:59:43 +08:00
parent d67da3f18d
commit 1291666d42
20 changed files with 102 additions and 9 deletions
@@ -222,7 +222,7 @@
</select>
<select id="translateUserRealNameFromTableByKeys" resultType="com.jero.common.system.vo.DictModel">
select concat(realname,'',username,'') as "text", id as "value" from sys_user
select concat(realname,'(',username,')') as "text", id as "value" from sys_user
where id IN (
<foreach item="key" collection="keys" separator=",">
#{key}
@@ -340,7 +340,7 @@ public interface ISysUserService extends IService<SysUser> {
String getNameNoByUsername(String userName);
/**
* 通过 id 或 username 翻译 用户名工号
* 通过 id 或 username 翻译 用户名(工号)
* @param ids :“1,2,3”
* @param userNames:“admin,test”
* @return
@@ -348,7 +348,7 @@ public interface ISysUserService extends IService<SysUser> {
String dictByIdsOrUserNames(String ids, String userNames);
/**
* 通过 用户名工号查询用户
* 通过 用户名(工号)查询用户
* @param inspectUser
* @return
*/
@@ -676,7 +676,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
// 按顺序排序翻译
for (String item : list) {
Optional<SysUser> optionalSysUser = sysUserList.stream().filter(v -> v.getUsername().equals(item)).findFirst();
optionalSysUser.ifPresent(v -> sysList.add(v.getRealname() + "" + v.getUsername() + ""));
optionalSysUser.ifPresent(v -> sysList.add(v.getRealname() + "(" + v.getUsername() + ")"));
}
}else {
return "";
@@ -3,6 +3,8 @@ package com.jero.modules.activiti.process.esdeclare.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.jero.common.api.dto.message.SendMessageDTO;
import com.jero.common.api.vo.SendMessageAPI;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.SnowflakeUtils;
@@ -20,10 +22,12 @@ import com.jero.modules.activiti.process.esdeclare.vo.EsDeclareFlowVO;
import com.jero.modules.activiti.service.ProcessAllService;
import com.jero.modules.activiti.service.ProcessApprovalRecordService;
import com.jero.modules.activiti.service.ProcessNodeLinkService;
import com.jero.modules.laws.common.constant.MessageTemplateCodeCommon;
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardDeclare;
import com.jero.modules.laws.enterprise.service.EnterpriseStandardDeclareService;
import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.system.service.ISysUserService;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RuntimeService;
@@ -56,6 +60,8 @@ public class EsDeclareFlowServiceImpl implements IEsDeclareFlowService {
private final IProcessEsDeclareService processEsDeclareService;
private final EnterpriseStandardDeclareService enterpriseStandardDeclareService;
private final IOSSFileService ossFileService;
private final SendMessageAPI sendMessageAPI;
private final ISysUserService sysUserService;
public EsDeclareFlowServiceImpl(ProcessAllService processAllService,
ProcessApprovalRecordService processApprovalRecordService,
@@ -63,7 +69,9 @@ public class EsDeclareFlowServiceImpl implements IEsDeclareFlowService {
ProcessNodeLinkService processNodeLinkService,
IProcessEsDeclareService processEsDeclareService,
EnterpriseStandardDeclareService enterpriseStandardDeclareService,
IOSSFileService ossFileService) {
IOSSFileService ossFileService,
SendMessageAPI sendMessageAPI,
ISysUserService sysUserService) {
this.processAllService = processAllService;
this.processApprovalRecordService = processApprovalRecordService;
this.processDraftService = processDraftService;
@@ -71,6 +79,8 @@ public class EsDeclareFlowServiceImpl implements IEsDeclareFlowService {
this.processEsDeclareService = processEsDeclareService;
this.enterpriseStandardDeclareService = enterpriseStandardDeclareService;
this.ossFileService = ossFileService;
this.sendMessageAPI = sendMessageAPI;
this.sysUserService = sysUserService;
}
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
@@ -149,6 +159,16 @@ public class EsDeclareFlowServiceImpl implements IEsDeclareFlowService {
.set(OSSFile::getStandardNo, enterpriseStandardDeclare.getStandardNo())
.set(OSSFile::getStandardFileType, "associated_file"));
}
// 发送消息
SendMessageDTO sendMessageDTO = new SendMessageDTO();
sendMessageDTO.setTemplateCode(MessageTemplateCodeCommon.STANDARD_DECLARE);
sendMessageDTO.setToUserId(processEsDeclare.getInitiator());
Map<String, String> sendMap = new HashMap<>();
sendMap.put("standardNumber", processEsDeclare.getStandardNo());
sendMap.put("standardName", processEsDeclare.getStandardName());
sendMap.put("declareUser", sysUserService.dictByIdsOrUserNames(processEsDeclare.getDeclareUser(), ""));
sendMessageDTO.setMap(sendMap);
sendMessageAPI.sendMessage(sendMessageDTO);
}
@Override
@@ -183,6 +203,9 @@ public class EsDeclareFlowServiceImpl implements IEsDeclareFlowService {
if (StringUtils.isNotBlank(processAll.getPrcMes())){
processDraft.setProcessDescription(processAll.getPrcMes());
}
if (StringUtils.isNotBlank(esDeclareFlowVO.getInfoJsonStr())){
processDraft.setInfoJsonStr(esDeclareFlowVO.getInfoJsonStr());
}
processDraft.setUserId(loginUser.getId());
// 删除旧草稿
processDraftService.remove(new LambdaQueryWrapper<ProcessDraft>()
@@ -232,6 +255,9 @@ public class EsDeclareFlowServiceImpl implements IEsDeclareFlowService {
if (StringUtils.isNotBlank(processDraft.getProcessDescription())){
processAll.setPrcMes(processDraft.getProcessDescription());
}
if (StringUtils.isNotBlank(processDraft.getInfoJsonStr())){
esDeclareFlowVO.setInfoJsonStr(processDraft.getInfoJsonStr());
}
}else {
// 不存在草稿
processApprovalRecord = processApprovalRecordService.getOne(new LambdaQueryWrapper<ProcessApprovalRecord>()
@@ -29,4 +29,7 @@ public class EsDeclareFlowVO {
/**map*/
@ApiModelProperty(value = "map")
private Map<String, Object> map;
/**草稿信息json字符串*/
@ApiModelProperty(value = "草稿信息json字符串")
private String infoJsonStr;
}
@@ -213,6 +213,9 @@ public class EsInspectFlowServiceImpl implements IEsInspectFlowService {
if (StringUtils.isNotBlank(processAll.getPrcMes())){
processDraft.setProcessDescription(processAll.getPrcMes());
}
if (StringUtils.isNotBlank(esInspectFlowVO.getInfoJsonStr())){
processDraft.setInfoJsonStr(esInspectFlowVO.getInfoJsonStr());
}
processDraft.setUserId(loginUser.getId());
// 删除旧草稿
processDraftService.remove(new LambdaQueryWrapper<ProcessDraft>()
@@ -259,6 +262,9 @@ public class EsInspectFlowServiceImpl implements IEsInspectFlowService {
if (StringUtils.isNotBlank(processDraft.getProcessDescription())){
processAll.setPrcMes(processDraft.getProcessDescription());
}
if (StringUtils.isNotBlank(processDraft.getInfoJsonStr())){
esInspectFlowVO.setInfoJsonStr(processDraft.getInfoJsonStr());
}
}else {
// 不存在草稿
processApprovalRecord = processApprovalRecordService.getOne(new LambdaQueryWrapper<ProcessApprovalRecord>()
@@ -30,4 +30,7 @@ public class EsInspectFlowVO {
/**map*/
@ApiModelProperty(value = "map")
private Map<String, Object> map;
/**草稿信息json字符串*/
@ApiModelProperty(value = "草稿信息json字符串")
private String infoJsonStr;
}
@@ -168,6 +168,9 @@ public class EsInspectDelayApplyFlowServiceImpl implements IEsInspectDelayApplyF
if (StringUtils.isNotBlank(processAll.getPrcMes())){
processDraft.setProcessDescription(processAll.getPrcMes());
}
if (StringUtils.isNotBlank(esInspectDelayApplyFlowVO.getInfoJsonStr())){
processDraft.setInfoJsonStr(esInspectDelayApplyFlowVO.getInfoJsonStr());
}
processDraft.setUserId(loginUser.getId());
// 删除旧草稿
processDraftService.remove(new LambdaQueryWrapper<ProcessDraft>()
@@ -214,6 +217,9 @@ public class EsInspectDelayApplyFlowServiceImpl implements IEsInspectDelayApplyF
if (StringUtils.isNotBlank(processDraft.getProcessDescription())){
processAll.setPrcMes(processDraft.getProcessDescription());
}
if (StringUtils.isNotBlank(processDraft.getInfoJsonStr())){
esInspectDelayApplyFlowVO.setInfoJsonStr(processDraft.getInfoJsonStr());
}
}else {
// 不存在草稿
processApprovalRecord = processApprovalRecordService.getOne(new LambdaQueryWrapper<ProcessApprovalRecord>()
@@ -30,4 +30,7 @@ public class EsInspectDelayApplyFlowVO {
/**map*/
@ApiModelProperty(value = "map")
private Map<String, Object> map;
/**草稿信息json字符串*/
@ApiModelProperty(value = "草稿信息json字符串")
private String infoJsonStr;
}
@@ -182,6 +182,9 @@ public class EsInspectPlanFlowServiceImpl implements IEsInspectPlanFlowService {
if (StringUtils.isNotBlank(processAll.getPrcMes())){
processDraft.setProcessDescription(processAll.getPrcMes());
}
if (StringUtils.isNotBlank(esInspectPlanFlowVO.getInfoJsonStr())){
processDraft.setInfoJsonStr(esInspectPlanFlowVO.getInfoJsonStr());
}
processDraft.setUserId(loginUser.getId());
// 删除旧草稿
processDraftService.remove(new LambdaQueryWrapper<ProcessDraft>()
@@ -248,6 +251,9 @@ public class EsInspectPlanFlowServiceImpl implements IEsInspectPlanFlowService {
if (StringUtils.isNotBlank(processDraft.getProcessDescription())){
processAll.setPrcMes(processDraft.getProcessDescription());
}
if (StringUtils.isNotBlank(processDraft.getInfoJsonStr())){
esInspectPlanFlowVO.setInfoJsonStr(processDraft.getInfoJsonStr());
}
}else {
// 不存在草稿
processApprovalRecord = processApprovalRecordService.getOne(new LambdaQueryWrapper<ProcessApprovalRecord>()
@@ -30,6 +30,9 @@ public class EsInspectPlanFlowVO {
/**map*/
@ApiModelProperty(value = "map")
private Map<String, Object> map;
/**草稿信息json字符串*/
@ApiModelProperty(value = "草稿信息json字符串")
private String infoJsonStr;
/**
* 是否会签
@@ -152,6 +152,9 @@ public class EsInspectRectifyFlowServiceImpl implements IEsInspectRectifyFlowSer
if (StringUtils.isNotBlank(processAll.getPrcMes())){
processDraft.setProcessDescription(processAll.getPrcMes());
}
if (StringUtils.isNotBlank(esInspectReportFlowVO.getInfoJsonStr())){
processDraft.setInfoJsonStr(esInspectReportFlowVO.getInfoJsonStr());
}
processDraft.setUserId(loginUser.getId());
// 删除旧草稿
processDraftService.remove(new LambdaQueryWrapper<ProcessDraft>()
@@ -202,6 +205,9 @@ public class EsInspectRectifyFlowServiceImpl implements IEsInspectRectifyFlowSer
if (StringUtils.isNotBlank(processDraft.getProcessDescription())){
processAll.setPrcMes(processDraft.getProcessDescription());
}
if (StringUtils.isNotBlank(processDraft.getInfoJsonStr())){
esInspectReportFlowVO.setInfoJsonStr(processDraft.getInfoJsonStr());
}
}else {
// 不存在草稿
processApprovalRecord = processApprovalRecordService.getOne(new LambdaQueryWrapper<ProcessApprovalRecord>()
@@ -33,4 +33,7 @@ public class EsInspectRectifyFlowVO {
/**人员信息*/
@ApiModelProperty(value = "人员信息")
private List<UserInfo> userInfo;
/**草稿信息json字符串*/
@ApiModelProperty(value = "草稿信息json字符串")
private String infoJsonStr;
}
@@ -175,6 +175,9 @@ public class EsPermissionApplyFlowServiceImpl implements EsPermissionApplyFlowSe
if (StringUtils.isNotBlank(processAll.getPrcMes())){
processDraft.setProcessDescription(processAll.getPrcMes());
}
if (StringUtils.isNotBlank(esPermissionApplyFlowVO.getInfoJsonStr())){
processDraft.setInfoJsonStr(esPermissionApplyFlowVO.getInfoJsonStr());
}
processDraft.setUserId(loginUser.getId());
// 删除旧草稿
processDraftService.remove(new LambdaQueryWrapper<ProcessDraft>()
@@ -225,6 +228,9 @@ public class EsPermissionApplyFlowServiceImpl implements EsPermissionApplyFlowSe
if (StringUtils.isNotBlank(processDraft.getProcessDescription())){
processAll.setPrcMes(processDraft.getProcessDescription());
}
if (StringUtils.isNotBlank(processDraft.getInfoJsonStr())){
esPermissionApplyFlowVO.setInfoJsonStr(processDraft.getInfoJsonStr());
}
}else {
// 不存在草稿
processApprovalRecord = processApprovalRecordService.getOne(new LambdaQueryWrapper<ProcessApprovalRecord>()
@@ -29,4 +29,7 @@ public class EsPermissionApplyFlowVO {
/**map*/
@ApiModelProperty(value = "map")
private Map<String, Object> map;
/**草稿信息json字符串*/
@ApiModelProperty(value = "草稿信息json字符串")
private String infoJsonStr;
}
@@ -171,6 +171,9 @@ public class MeetingManageFlowServiceImpl implements IMeetingManageFlowService {
if (StringUtils.isNotBlank(processAll.getPrcMes())){
processDraft.setProcessDescription(processAll.getPrcMes());
}
if (StringUtils.isNotBlank(meetingManageFlowVO.getInfoJsonStr())){
processDraft.setInfoJsonStr(meetingManageFlowVO.getInfoJsonStr());
}
processDraft.setUserId(loginUser.getId());
// 删除旧草稿
processDraftService.remove(new LambdaQueryWrapper<ProcessDraft>()
@@ -235,6 +238,9 @@ public class MeetingManageFlowServiceImpl implements IMeetingManageFlowService {
if (StringUtils.isNotBlank(processDraft.getProcessDescription())){
processAll.setPrcMes(processDraft.getProcessDescription());
}
if (StringUtils.isNotBlank(processDraft.getInfoJsonStr())){
meetingManageFlowVO.setInfoJsonStr(processDraft.getInfoJsonStr());
}
}else {
// 不存在草稿
processApprovalRecord = processApprovalRecordService.getOne(new LambdaQueryWrapper<ProcessApprovalRecord>()
@@ -35,4 +35,7 @@ public class MeetingManageFlowVO {
/**未参加*/
@ApiModelProperty(value = "未参加")
private boolean notAttend;
/**草稿信息json字符串*/
@ApiModelProperty(value = "草稿信息json字符串")
private String infoJsonStr;
}
@@ -15,6 +15,7 @@ public class MessageTemplateCodeCommon {
public static final String ON_THE_PRODUCTION = "on_the_production"; // 【在产车实施预警】
public static final String LAWS_STANDARD_SHARING = "laws_standard_sharing"; // 【分享】收到分享
public static final String ES_INSPECT_PLAN = "es_inspect_plan"; // 【企标稽查计划】流程结束
public static final String STANDARD_DECLARE = "standard_declare"; // 【标准宣贯】流程结束
public static final String STANDARD_CHANGE_REPLACE = "standard_change_replace"; // 【法规变更】代替/被代替标准变更
public static final String STANDARD_CHANGE_REFERENCE = "standard_change_reference"; // 【法规变更】引用标准变更
public static final String STANDARD_CONSULTATION = "standard_consultation"; // 【征求意见结果提醒】
@@ -38,12 +38,10 @@
d.declare_date,
d.declare_user,
CONCAT(u.realname, '', u.username, '') AS declareUserName,
d.declare_file,
f.file_name AS declareFileName
d.declare_file
FROM
`laws_enterprise_standard_declare` AS d
LEFT JOIN laws_enterprise_standard AS s ON d.standard_id = s.id
LEFT JOIN oss_file AS f ON f.id = d.declare_file
LEFT JOIN sys_user AS u ON u.id = d.declare_user
Where 1 = 1
<!--企标编号判断-->
@@ -18,6 +18,7 @@ import com.jero.modules.laws.enterprise.util.BeanCopyUtils;
import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.jeecgframework.poi.excel.ExcelExportUtil;
import org.jeecgframework.poi.excel.entity.ExportParams;
@@ -56,7 +57,17 @@ public class EnterpriseStandardDeclareServiceImpl extends ServiceImpl<Enterprise
@Override
public IPage<EnterpriseStandardDeclareVo> queryPageList(ESQueryCommonDTO esDeclare, Integer pageNo, Integer pageSize) {
IPage<EnterpriseStandardDeclareVo> page = new Page<>(pageNo, pageSize);
return esDeclareMapper.page(page, esDeclare);
IPage<EnterpriseStandardDeclareVo> pageList = esDeclareMapper.page(page, esDeclare);
for (EnterpriseStandardDeclareVo enterpriseStandardDeclareVo : pageList.getRecords()) {
if (StringUtils.isNotBlank(enterpriseStandardDeclareVo.getDeclareFile())){
List<String> fileIdList = Arrays.asList(enterpriseStandardDeclareVo.getDeclareFile().split(","));
List<OSSFile> ossFileList = ossFileService.listByIds(fileIdList);
if (!ossFileList.isEmpty()){
enterpriseStandardDeclareVo.setDeclareFileName(ossFileList.stream().map(OSSFile::getFileName).collect(Collectors.joining(",")));
}
}
}
return pageList;
}
@Override