update 项目合规评估流程 推送数据到未符合项

This commit is contained in:
lijiarao
2023-12-23 17:43:14 +08:00
parent bc1b661efb
commit e718461425
4 changed files with 82 additions and 17 deletions
@@ -42,9 +42,11 @@ import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
import com.jero.modules.projectLibrary.common.AssessCommon;
import com.jero.modules.projectLibrary.entity.LawsAssess;
import com.jero.modules.projectLibrary.entity.LawsAssessResults;
import com.jero.modules.projectLibrary.entity.LawsEvaluationNotMet;
import com.jero.modules.projectLibrary.entity.LawsProjectLibrary;
import com.jero.modules.projectLibrary.service.ILawsAssessResultsService;
import com.jero.modules.projectLibrary.service.ILawsAssessService;
import com.jero.modules.projectLibrary.service.ILawsEvaluationNotMetService;
import com.jero.modules.projectLibrary.service.ILawsProjectLibraryService;
import org.activiti.engine.HistoryService;
import org.activiti.engine.RuntimeService;
@@ -106,6 +108,8 @@ public class ProcessProjectAssessService extends ServiceImpl<ProcessProjectAsses
@Resource
private ILawsAssessService lawsAssessService;
@Resource
private ILawsEvaluationNotMetService lawsEvaluationNotMetService;
HashMap<String, String> tempCache = new HashMap<>();
@@ -625,6 +629,44 @@ public class ProcessProjectAssessService extends ServiceImpl<ProcessProjectAsses
lawsAssessService.update(wrapper);
}
//推送数据到未符合项,过滤出不符合和待验证的数据
List<ProcessProjectAssessTerm> saveLawsEvaluationNotMetList = processProjectAssessTermList.stream()
.filter(item -> AssessCommon.NOT_COMPLIANT.equals(item.getEvaluationFeedback())
|| AssessCommon.TO_BE_VERIFIED.equals(item.getEvaluationFeedback()))
.collect(Collectors.toList());
List<LawsEvaluationNotMet> evaluationNotMetList = new ArrayList<>();
for (ProcessProjectAssessTerm assessTerm : saveLawsEvaluationNotMetList) {
String standardId = assessTerm.getStandardId();
LawsDomesticStandard domesticStandard = lawsDomesticStandardService.getById(standardId);
String source;
String standardName;
String standardNumber;
if (domesticStandard != null){
source = CommonConstant.STANDARD_SOURCE_1;
standardName = domesticStandard.getStandardName();
standardNumber = domesticStandard.getStandardNumber();
}else {
LawsOverseasStandard overseasStandard = lawsOverseasStandardService.getById(standardId);
source = CommonConstant.STANDARD_SOURCE_2;
standardName = overseasStandard.getStandardName();
standardNumber = overseasStandard.getStandardNumber();
}
LawsEvaluationNotMet lawsEvaluationNotMet = new LawsEvaluationNotMet();
lawsEvaluationNotMet.setProjectId(projectId);
lawsEvaluationNotMet.setProjectName(lawsProjectLibrary.getProjectName());
lawsEvaluationNotMet.setStandardId(standardId);
lawsEvaluationNotMet.setSource(source);
lawsEvaluationNotMet.setStandardNumber(standardNumber);
lawsEvaluationNotMet.setStandardName(standardName);
lawsEvaluationNotMet.setTermNum(assessTerm.getTermNumber());
lawsEvaluationNotMet.setTermName(assessTerm.getTermName());
lawsEvaluationNotMet.setEngineerId(assessTerm.getAssessorId());
lawsEvaluationNotMet.setExpectedTime(assessTerm.getExpectedTime());
lawsEvaluationNotMet.setState(AssessCommon.TO_BE_RECTIFIED);
lawsEvaluationNotMet.setDelFlag(0);
evaluationNotMetList.add(lawsEvaluationNotMet);
}
lawsEvaluationNotMetService.saveBatch(evaluationNotMetList);
//发送消息
String carbonCopyPersonnels = businessInfoDTO.getCarbonCopyPersonnels();
SendMessageDTO sendMessageDTO = new SendMessageDTO();