fix(标准法规变更流程): 80749
This commit is contained in:
+25
-27
@@ -31,14 +31,8 @@ import com.jero.modules.laws.common.constant.MessageTemplateCodeCommon;
|
||||
import com.jero.modules.laws.common.mapper.LawsCommonMapper;
|
||||
import com.jero.modules.laws.common.service.ILawsCommonService;
|
||||
import com.jero.modules.laws.common.util.CurrentUserUtil;
|
||||
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
|
||||
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
||||
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
|
||||
import com.jero.modules.laws.standard.entity.LawsTreeNode;
|
||||
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
|
||||
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
|
||||
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
|
||||
import com.jero.modules.laws.standard.service.ILawsTreeNodeService;
|
||||
import com.jero.modules.laws.standard.entity.*;
|
||||
import com.jero.modules.laws.standard.service.*;
|
||||
import com.jero.modules.laws.standardization.entity.LawsStandardization;
|
||||
import com.jero.modules.laws.standardization.service.ILawsStandardizationService;
|
||||
import com.jero.modules.system.entity.SysDepart;
|
||||
@@ -107,6 +101,8 @@ public class ProcessFbEntryChangeServiceImpl extends ServiceImpl<ProcessFbEntryC
|
||||
|
||||
@Resource
|
||||
private ILawsTreeNodeService lawsTreeNodeService;
|
||||
@Resource
|
||||
private ILawsReplacedStandardService lawsReplacedStandardService;
|
||||
|
||||
/**
|
||||
* @Author: liao
|
||||
@@ -250,7 +246,7 @@ public class ProcessFbEntryChangeServiceImpl extends ServiceImpl<ProcessFbEntryC
|
||||
} else {
|
||||
// 如果是标准法规变更流程
|
||||
// 发送消息
|
||||
sendMsg(objectMap);
|
||||
sendMsg(objectMap, processInfoVO.getBusinessId());
|
||||
lawsCommonService.commonEdit(objectMap);
|
||||
}
|
||||
log.info("《标准法规入库/变更流程》结束,流程名称:{}", basicProcessInfoDTO.getProcessName());
|
||||
@@ -262,7 +258,7 @@ public class ProcessFbEntryChangeServiceImpl extends ServiceImpl<ProcessFbEntryC
|
||||
* @Date: 2023/11/29 16:55
|
||||
* @Description: 发消息
|
||||
**/
|
||||
private void sendMsg(Map<String, Object> objectMap) {
|
||||
private void sendMsg(Map<String, Object> objectMap, String businessId) {
|
||||
String module = (String) objectMap.get(FieldCommon.MODULE);
|
||||
String id = (String) objectMap.get("id");
|
||||
String standardNumber = (String) objectMap.get(FieldCommon.STANDARD_NUMBER);
|
||||
@@ -276,28 +272,30 @@ public class ProcessFbEntryChangeServiceImpl extends ServiceImpl<ProcessFbEntryC
|
||||
|
||||
String userId = "";
|
||||
String templateCode = "";
|
||||
if (StringUtils.isNotBlank(replaced) && !replaced.equals(replacedOld)) { // 代替标准
|
||||
List<String> replacedList = Arrays.asList(replaced.split(","));
|
||||
if (StringUtils.isNotBlank(replaced) && !replaced.equals(replacedOld) && StringUtils.isNotBlank(replacedOld)) { // 代替标准
|
||||
List<String> replacedOldList = Arrays.asList(replacedOld.split(","));
|
||||
LambdaQueryWrapper<ProcessFbEntryChange> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(ProcessFbEntryChange::getStandardNumber, replacedList);
|
||||
queryWrapper.eq(ProcessFbEntryChange::getOperateType, "2");
|
||||
List<ProcessFbEntryChange> fbEntryChangeList = list(queryWrapper);
|
||||
List<String> userIdList = fbEntryChangeList.stream()
|
||||
.map(ProcessFbEntryChange::getUserId)
|
||||
.distinct().collect(Collectors.toList());
|
||||
userId = StringUtils.join(userIdList, ",");
|
||||
queryWrapper.in(ProcessFbEntryChange::getStandardNumber, replacedOldList);
|
||||
queryWrapper.eq(ProcessFbEntryChange::getOperateType, "1");
|
||||
List<ProcessFbEntryChange> processFbEntryChangeList = list(queryWrapper);
|
||||
userId = processFbEntryChangeList.stream().map(ProcessFbEntryChange::getUserId).collect(Collectors.joining(","));
|
||||
templateCode = MessageTemplateCodeCommon.STANDARD_CHANGE_REPLACE;
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(reference) && !reference.equals(referenceOld)) { // 引用标准
|
||||
LambdaQueryWrapper<LawsEnterpriseStandard> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(LawsEnterpriseStandard::getReferenceStandard, standardNumber);
|
||||
queryWrapper.isNotNull(LawsEnterpriseStandard::getMainDraftingUser);
|
||||
List<LawsEnterpriseStandard> enterpriseStandardList = lawsEnterpriseStandardService.list(queryWrapper);
|
||||
List<String> userIdList = enterpriseStandardList.stream()
|
||||
.map(LawsEnterpriseStandard::getMainDraftingUser)
|
||||
.distinct().collect(Collectors.toList());
|
||||
userId = StringUtils.join(userIdList, ",");
|
||||
List<LawsReplacedStandard> lawsReplacedStandardList = lawsReplacedStandardService.list(
|
||||
new LambdaQueryWrapper<LawsReplacedStandard>()
|
||||
.eq(LawsReplacedStandard::getReplaced, standardNumber));
|
||||
if (!lawsReplacedStandardList.isEmpty()){
|
||||
List<String> replacedByList = lawsReplacedStandardList.stream().map(LawsReplacedStandard::getReplacedBy).collect(Collectors.toList());
|
||||
List<LawsEnterpriseStandard> lawsEnterpriseStandardList = lawsEnterpriseStandardService.list(
|
||||
new LambdaQueryWrapper<LawsEnterpriseStandard>()
|
||||
.in(LawsEnterpriseStandard::getStandardNumber, replacedByList));
|
||||
if (!lawsEnterpriseStandardList.isEmpty()){
|
||||
List<String> mainDraftingUserList = lawsEnterpriseStandardList.stream().map(LawsEnterpriseStandard::getMainDraftingUser).collect(Collectors.toList());
|
||||
userId = String.join(",", mainDraftingUserList);
|
||||
}
|
||||
}
|
||||
templateCode = MessageTemplateCodeCommon.STANDARD_CHANGE_REFERENCE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user