feat: scc结束后同步标准主计划字段
This commit is contained in:
+3
-13
@@ -177,19 +177,9 @@ public class ProcessStandardComplianceCheckController extends JeroController<Pro
|
||||
*/
|
||||
@AutoLog(value = "法规符合性排查流程-分发列表导出")
|
||||
@ApiOperation(value="法规符合性排查流程-分发列表导出", notes="法规符合性排查流程-分发列表导出")
|
||||
@GetMapping(value = "/exportXlsDistribute")
|
||||
public void exportXlsDistribute(@RequestParam("taskId") String taskId, HttpServletResponse response) {
|
||||
sccService.exportXlsDistribute(taskId, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*/
|
||||
@AutoLog(value = "法规符合性排查流程-不分发列表导出")
|
||||
@ApiOperation(value="法规符合性排查流程-不分发列表导出", notes="法规符合性排查流程-不分发列表导出")
|
||||
@GetMapping(value = "/exportXlsNotDistribute")
|
||||
public void exportXlsNotDistribute(@RequestParam("taskId") String taskId, HttpServletResponse response) {
|
||||
sccService.exportXlsNotDistribute(taskId, response);
|
||||
@GetMapping(value = "/exportXls")
|
||||
public void exportXls(@RequestParam("taskId") String taskId, HttpServletResponse response) {
|
||||
sccService.exportXls(taskId, response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+29
-5
@@ -12,16 +12,20 @@ import com.jero.modules.assessmentLibrary.service.ILawsConformityAssessmentLibra
|
||||
import com.jero.modules.assessmentLibrary.service.ILawsConformityAssessmentLibraryService;
|
||||
import com.jero.modules.assessmentLibrary.service.ILawsEvaluationNotMetLibraryService;
|
||||
import com.jero.modules.laws.enterprise.util.BeanCopyUtils;
|
||||
import com.jero.modules.laws.standardmasterplan.servicce.ILawsStandardMasterPlanService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.activiti.engine.delegate.DelegateExecution;
|
||||
import org.activiti.engine.delegate.ExecutionListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.jero.modules.activiti.process.standardComplianceCheck.common.ProcessStandardComplianceCheckConstants.*;
|
||||
import static com.jero.modules.activiti.process.standardComplianceCheck.common.ProcessStandardComplianceCheckConstants.DISCREPANCY;
|
||||
import static com.jero.modules.activiti.process.standardComplianceCheck.common.ProcessStandardComplianceCheckConstants.NOT_INVOLVE;
|
||||
|
||||
/**
|
||||
* @author liJiaRao
|
||||
@@ -45,6 +49,9 @@ public class ProcessSCCEndListener implements ExecutionListener {
|
||||
|
||||
@Resource
|
||||
private ILawsEvaluationNotMetLibraryService notMetService;
|
||||
|
||||
@Resource
|
||||
private ILawsStandardMasterPlanService lawsStandardMasterPlanService;
|
||||
|
||||
@Override
|
||||
public void notify(DelegateExecution delegateExecution) {
|
||||
@@ -59,12 +66,29 @@ public class ProcessSCCEndListener implements ExecutionListener {
|
||||
sccDetailWrapper.eq(ProcessStandardComplianceCheckDetail::getCheckId, scc.getId());
|
||||
List<ProcessStandardComplianceCheckDetail> list = sccDetailService.list(sccDetailWrapper);
|
||||
// 入库保存
|
||||
LawsConformityAssessmentLibrary lawsConformityAssessmentLibrary = BeanCopyUtils.copyBean(scc, LawsConformityAssessmentLibrary.class);
|
||||
lawsConformityAssessmentLibrary.setId(null);
|
||||
calService.save(lawsConformityAssessmentLibrary);
|
||||
LambdaQueryWrapper<LawsConformityAssessmentLibrary> calWrapper = new LambdaQueryWrapper<>();
|
||||
calWrapper.eq(LawsConformityAssessmentLibrary::getStandardNumber, scc.getStandardNumber());
|
||||
calWrapper.eq(LawsConformityAssessmentLibrary::getStandardName, scc.getApplicableMarket());
|
||||
LawsConformityAssessmentLibrary lawsConformityAssessmentLibrary = calService.getOne(calWrapper);
|
||||
if (lawsConformityAssessmentLibrary == null) {
|
||||
lawsConformityAssessmentLibrary = BeanCopyUtils.copyBean(scc, LawsConformityAssessmentLibrary.class);
|
||||
lawsConformityAssessmentLibrary.setId(null);
|
||||
calService.save(lawsConformityAssessmentLibrary);
|
||||
lawsStandardMasterPlanService.syncRegulatoryComplianceInvestigation(lawsConformityAssessmentLibrary);
|
||||
} else {
|
||||
// 获取最晚的评估日期
|
||||
Optional<ProcessStandardComplianceCheckDetail> latestEvaluation = list.stream()
|
||||
.max(Comparator.comparing(ProcessStandardComplianceCheckDetail::getValuationTime));
|
||||
lawsConformityAssessmentLibrary.setValuationTime(latestEvaluation
|
||||
.map(ProcessStandardComplianceCheckDetail::getValuationTime).orElse(null));
|
||||
// 更新评估日期
|
||||
calService.updateById(lawsConformityAssessmentLibrary);
|
||||
}
|
||||
|
||||
List<LawsConformityAssessmentLibraryDetail> lawsConformityAssessmentLibraryDetails = BeanCopyUtils.copyBeanList(list, LawsConformityAssessmentLibraryDetail.class);
|
||||
LawsConformityAssessmentLibrary finalLawsConformityAssessmentLibrary = lawsConformityAssessmentLibrary;
|
||||
lawsConformityAssessmentLibraryDetails.forEach(detail -> {
|
||||
detail.setBindId(lawsConformityAssessmentLibrary.getId());
|
||||
detail.setBindId(finalLawsConformityAssessmentLibrary.getId());
|
||||
});
|
||||
calDetailService.saveBatch(lawsConformityAssessmentLibraryDetails);
|
||||
// 找出不符合和待验证的存入不符合项库
|
||||
|
||||
+1
-2
@@ -29,7 +29,6 @@ public interface IProcessStandardComplianceCheckService extends IService<Process
|
||||
|
||||
List<ProcessStandardComplianceCheckDetail> generate(ProcessStandardComplianceCheck scc) throws Exception;
|
||||
|
||||
void exportXlsDistribute(String taskId, HttpServletResponse response);
|
||||
void exportXls(String taskId, HttpServletResponse response);
|
||||
|
||||
void exportXlsNotDistribute(String taskId, HttpServletResponse response);
|
||||
}
|
||||
|
||||
+6
-9
@@ -431,10 +431,12 @@ public class ProcessStandardComplianceCheckServiceImpl extends ServiceImpl<Proce
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportXlsDistribute(String taskId, HttpServletResponse response) {
|
||||
public void exportXls(String taskId, HttpServletResponse response) {
|
||||
ProcessInfoVO<ProcessSccVO> handleData = this.getHandleData(taskId);
|
||||
List<ProcessStandardComplianceCheckDetail> detailInfoList = handleData.getBusinessInfoDTO().getDetailInfoList();
|
||||
String fileName = "123";
|
||||
ProcessSccVO businessInfoDTO = handleData.getBusinessInfoDTO();
|
||||
ProcessStandardComplianceCheck standardInfo = businessInfoDTO.getStandardInfo();
|
||||
List<ProcessStandardComplianceCheckDetail> detailInfoList = businessInfoDTO.getDetailInfoList();
|
||||
String fileName = standardInfo.getStandardNumber() + "-" + standardInfo.getStandardName() + "-符合性排查";
|
||||
String url = exportExcelTempPath.replace(EXPORT_EXCEL_TEMP, fileName);
|
||||
File file = new File(url);
|
||||
if (!file.exists()) {
|
||||
@@ -455,7 +457,7 @@ public class ProcessStandardComplianceCheckServiceImpl extends ServiceImpl<Proce
|
||||
.exportExcel(exportParams, ProcessStandardComplianceCheckDetail.class, detailInfoList);
|
||||
// 生成超链接
|
||||
excelExportUtilPro.generateHyperlink(newRecordsExport, workbook,
|
||||
ProcessStandardComplianceCheckDetail::getFileList, 12);
|
||||
ProcessStandardComplianceCheckDetail::getFileList, 15);
|
||||
// 导出excel
|
||||
workbook.write(fos);
|
||||
// 生成并导出zip
|
||||
@@ -471,11 +473,6 @@ public class ProcessStandardComplianceCheckServiceImpl extends ServiceImpl<Proce
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportXlsNotDistribute(String taskId, HttpServletResponse response) {
|
||||
ProcessInfoVO<ProcessSccVO> handleData = this.getHandleData(taskId);
|
||||
}
|
||||
|
||||
private List<ProcessStandardComplianceCheckDetail> getSplitDataByStandard(ProcessStandardComplianceCheck scc) {
|
||||
String standardId = scc.getStandardId();
|
||||
String fileType = scc.getSplitFileSource();
|
||||
|
||||
Reference in New Issue
Block a user