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();
@@ -35,6 +35,28 @@ public class AssessCommon {
*/
public final static String NOT_INVOLVED = "4";
/**
* 待整改
*/
public final static String TO_BE_RECTIFIED = "1";
/**
* 整改中
*/
public final static String RECTIFICATION = "2";
/**
* 审批中
*/
public final static String UNDER_APPROVAL = "3";
/**
* 已完成
*/
public final static String DONE = "4";
/**
* 已关闭
*/
public final static String CLOSED = "5";
}
@@ -9,6 +9,7 @@ import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
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.projectLibrary.common.AssessCommon;
import com.jero.modules.projectLibrary.entity.LawsEvaluationNotMet;
import com.jero.modules.projectLibrary.mapper.LawsEvaluationNotMetMapper;
import com.jero.modules.projectLibrary.service.ILawsEvaluationNotMetService;
@@ -171,7 +172,7 @@ public class LawsEvaluationNotMetServiceImpl extends ServiceImpl<LawsEvaluationN
return;
}
LambdaUpdateWrapper<LawsEvaluationNotMet> wrapper = new LambdaUpdateWrapper<>();
wrapper.set(LawsEvaluationNotMet::getState, "5");
wrapper.set(LawsEvaluationNotMet::getState, AssessCommon.CLOSED);
wrapper.in(LawsEvaluationNotMet::getId, ids);
update(wrapper);
}