fix(标准法规变更流程): 80749

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