fix(标准主计划): 完善

This commit is contained in:
yjz
2024-07-18 18:49:38 +08:00
parent 21ac79320c
commit 9ab7458aaf
3 changed files with 60 additions and 4 deletions
@@ -1,8 +1,10 @@
package com.jero.modules.laws.standardmasterplan.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jero.common.aspect.annotation.Dict;
import com.jero.modules.activiti.entity.ProcessAll;
import com.jero.modules.laws.documenttool.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -12,6 +14,7 @@ import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
/**
* @ClassName: 标准主计划_子表
@@ -76,4 +79,10 @@ public class LawsStandardMasterPlanSublist extends BaseEntity {
/**关联id*/
@ApiModelProperty(value = "关联id")
private String associationId;
/**流程总表*/
@ApiModelProperty(value = "流程总表")
@TableField(exist = false)
private List<ProcessAll> processAllList;
}
@@ -3,6 +3,8 @@ package com.jero.modules.laws.standardmasterplan.job;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.common.api.SendMessageAPI;
import com.jero.common.api.dto.message.SendMessageDTO;
import com.jero.modules.laws.marketStandard.entity.LawsMarketStandard;
import com.jero.modules.laws.marketStandard.service.ILawsMarketStandardService;
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
import com.jero.modules.laws.standardmasterplan.common.LawsStandardMasterPlanCommon;
@@ -10,6 +12,7 @@ import com.jero.modules.laws.standardmasterplan.entity.LawsStandardMasterPlan;
import com.jero.modules.laws.standardmasterplan.entity.LawsStandardMasterPlanSublist;
import com.jero.modules.laws.standardmasterplan.servicce.ILawsStandardMasterPlanService;
import com.jero.modules.laws.standardmasterplan.servicce.ILawsStandardMasterPlanSublistService;
import com.jero.modules.system.service.ISysDictService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
@@ -35,6 +38,10 @@ public class StandardMasterPlanJob implements Job {
@Resource
private ILawsDomesticStandardService lawsDomesticStandardService;
@Resource
private ILawsMarketStandardService lawsMarketStandardService;
@Resource
private ISysDictService sysDictService;
@Resource
private SendMessageAPI sendMessageAPI;
@Override
@@ -58,6 +65,7 @@ public class StandardMasterPlanJob implements Job {
for (LawsStandardMasterPlanSublist lawsStandardMasterPlanSublist : list) {
String standardNumber = "";
String standardName = "";
LawsMarketStandard lawsMarketStandard = new LawsMarketStandard();
LawsStandardMasterPlan lawsStandardMasterPlan =
lawsStandardMasterPlanService.getById(lawsStandardMasterPlanSublist.getMasterPlanId());
LawsDomesticStandard lawsDomesticStandard =
@@ -68,6 +76,7 @@ public class StandardMasterPlanJob implements Job {
if (!Objects.isNull(lawsDomesticStandard)){
standardNumber = lawsDomesticStandard.getStandardNumber();
standardName = lawsDomesticStandard.getStandardName();
lawsMarketStandard = lawsMarketStandardService.getById(lawsStandardMasterPlan.getMarketStandardId());
}
SendMessageDTO sendMessageDTO = new SendMessageDTO();
@@ -76,8 +85,12 @@ public class StandardMasterPlanJob implements Job {
Map<String, String> map = new HashMap<>();
map.put("standardNumber", standardNumber);
map.put("standardName", standardName);
map.put("applicableMarket", "");
map.put("taskNode", "");
String applicableMarket =
sysDictService.queryDictTextByKey("market_state", lawsMarketStandard.getCountry());
map.put("applicableMarket", applicableMarket);
String type = sysDictService.queryDictTextByKey("laws_standard_master_plan_type",
lawsStandardMasterPlanSublist.getType());
map.put("type", type);
sendMessageDTO.setMap(map);
sendMessageAPI.sendMessage(sendMessageDTO);
++ count;
@@ -12,6 +12,8 @@ import com.jero.common.exception.JeroBootException;
import com.jero.common.util.SnowflakeUtils;
import com.jero.modules.activiti.entity.ProcessAll;
import com.jero.modules.activiti.enums.ProcessStatusEnum;
import com.jero.modules.activiti.process.ni.entity.ProcessNewStandardImport;
import com.jero.modules.activiti.process.ni.service.IProcessNewStandardImportService;
import com.jero.modules.activiti.process.standardinterpret.entity.ProcessStandardInterpret;
import com.jero.modules.activiti.process.standardinterpret.service.ProcessStandardInterpretService;
import com.jero.modules.activiti.service.ProcessAllService;
@@ -81,6 +83,7 @@ public class LawsStandardMasterPlanServiceImpl
private final ILawsEvaluationNotMetLibraryService lawsEvaluationNotMetLibraryService;
private final ProcessAllService processAllService;
private final ProcessStandardInterpretService processStandardInterpretService;
private final IProcessNewStandardImportService processNewStandardImportService;
@Value("${jero.path.exportExcelTempPath}")
private String exportExcelTempPath;
@@ -244,6 +247,32 @@ public class LawsStandardMasterPlanServiceImpl
lawsStandardMasterPlanSublist.setActualCompletionDate(lawsDomesticStandard.getCreateTime());
}
break;
case LawsStandardMasterPlanCommon.IMPORT_NOTIFICATION:
List<ProcessNewStandardImport> list1 = processNewStandardImportService.list(
new LambdaQueryWrapper<ProcessNewStandardImport>()
.eq(ProcessNewStandardImport::getStandardId, lawsStandardMasterPlan.getStandardId())
.eq(ProcessNewStandardImport::getApplicableMarket,
lawsStandardMasterPlan.getApplicableMarket())
.orderByAsc(ProcessNewStandardImport::getCreateTime));
if (CollectionUtils.isNotEmpty(list1)){
ProcessNewStandardImport processNewStandardImport = list1.get(0);
ProcessAll processAll = processAllService.getOne(new LambdaQueryWrapper<ProcessAll>()
.eq(ProcessAll::getProcessInstanceId,
processNewStandardImport.getProcessInstanceId())
.eq(ProcessAll::getPrcStatus,ProcessStatusEnum.COMPLETED.getValue()));
if (!Objects.isNull(processAll)){
lawsStandardMasterPlanSublist.setActualCompletionDate(processAll.getEndTime());
}
List<String> processInstanceIdList = list1.stream()
.map(ProcessNewStandardImport::getProcessInstanceId).collect(Collectors.toList());
List<ProcessAll> processAllList = processAllService.list(new LambdaQueryWrapper<ProcessAll>()
.in(ProcessAll::getProcessInstanceId, processInstanceIdList));
if (CollectionUtils.isNotEmpty(processAllList)){
lawsStandardMasterPlanSublist.setProcessAllList(processAllList);
}
}
break;
case LawsStandardMasterPlanCommon.INTERPRETATION_OF_REGULATIONS:
if (!Objects.isNull(lawsDomesticStandard)){
lawsStandardMasterPlanSublist.setResponsiblePerson(lawsDomesticStandard.getResponsibleUser());
@@ -415,8 +444,13 @@ public class LawsStandardMasterPlanServiceImpl
@Override
public void syncRegulatoryComplianceInvestigation(LawsConformityAssessmentLibrary lawsConformityAssessmentLibrary) {
LawsStandardMasterPlanVO lawsStandardMasterPlanVO = new LawsStandardMasterPlanVO();
lawsStandardMasterPlanVO.setStandardNumber(lawsConformityAssessmentLibrary.getStandardNumber());
lawsStandardMasterPlanVO.setApplicableMarket(lawsConformityAssessmentLibrary.getApplicableMarket());
String standardNumber = lawsConformityAssessmentLibrary.getStandardNumber();
String applicableMarket = lawsConformityAssessmentLibrary.getApplicableMarket();
if (StringUtils.isBlank(standardNumber) || StringUtils.isBlank(applicableMarket)){
return;
}
lawsStandardMasterPlanVO.setStandardNumber(standardNumber);
lawsStandardMasterPlanVO.setApplicableMarket(applicableMarket);
List<LawsStandardMasterPlanVO> lawsStandardMasterPlanVOList = queryByList(lawsStandardMasterPlanVO);
if (CollectionUtils.isNotEmpty(lawsStandardMasterPlanVOList)){
List<String> idList = lawsStandardMasterPlanVOList.stream()