合并分支 'fix_20230524' 到 'master'

Fix 20230524

查看合并请求 laws-nio/laws-weilai!330
This commit is contained in:
高嵩
2023-05-24 18:07:34 +08:00
6 changed files with 95 additions and 36 deletions
@@ -140,7 +140,7 @@
SELECT * from params_collect_manifest pcm LEFT JOIN params_manifest pm ON pm.id = pcm.params_manifest_id WHERE pm.project_id = #{projectId}
</select>
<select id="getList" resultType="com.jero.modules.cert.collect.entity.ParamsCollectManifestEO">
SELECT id,params_manifest_id,state FROM params_collect_manifest
SELECT id,params_manifest_id,state,control_type FROM params_collect_manifest
</select>
</mapper>
@@ -353,7 +353,7 @@ public class OtaBaSjSjxtbhServiceImpl extends ServiceImpl<OtaBaSjSjxtbhMapper, O
if(ObjectUtils.isNotEmpty(otaBaSjSjyxpg)){
newClfjList.addAll(oldClfjList);
otaBaSjSjyxpg.setClfj(StringUtils.join(newClfjList.stream().distinct().collect(Collectors.toList()), ","));
this.otaBaSjSjyxpgService.updateById(otaBaSjSjyxpg);
this.otaBaSjSjyxpgService.saveOrUpdate(otaBaSjSjyxpg);
}
}
FileUnZip.deleteDir(tempFile);
@@ -5712,8 +5712,12 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
refuseCount = refuse.size();
count = toBeReleasedCount + toBeVerifiedCount + toBeConfirmedCount + acceptCount + refuseCount;
// 计算百分比
percentage = acceptCount / count * 100;
if(count <= 0){
percentage = 0;
}else{
// 计算百分比
percentage = acceptCount / count * 100;
}
percentageStr = percentage != 0 ? df.format(percentage) : "0";
}
@@ -5789,8 +5793,12 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
refuseCount = refuse.size();
count = notStartCount + toBeSubmittedCount + toBeReviewedCount + acceptCount + refuseCount;
// 计算百分比
percentage = acceptCount / count * 100;
if(count <= 0){
percentage = 0;
}else{
// 计算百分比
percentage = acceptCount / count * 100;
}
percentageStr = percentage != 0 ? df.format(percentage) : "0";
}
@@ -5886,8 +5894,12 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl<Proj
storedCount = (double) storedPciEoList.size();
count = notStartCount + inProgressCount + testPassedCount + testFailedCount + testFailedCount + notSubmitCount + reportSubmitCount + storedCount;
// 计算百分比
percentage = testPassedCount / count * 100;
if(count<=0){
percentage = 0;
}else {
// 计算百分比
percentage = testPassedCount / count * 100;
}
percentageStr = percentage != 0 ? df.format(percentage) : "0";
}
projectScheduleExportMap.put("notStartCount",notStartCount);
@@ -13179,8 +13179,12 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
acceptCount = designAccept.size() + verifyAccept.size();
refuseCount = designRefuse.size() + verifyRefuse.size();
count = toBeReleasedCount + toBeVerifiedCount + toBeConfirmedCount + acceptCount + refuseCount;
// 计算百分比
percentage = acceptCount / count * 100;
if(count <= 0){
percentage = 0;
}else{
// 计算百分比
percentage = acceptCount / count * 100;
}
percentageStr = percentage != 0 ? df.format(percentage) : "0";
}
result.put(ComplianceFlowStatusEnum.LIST_TO_BE_RELEASED.getValue(),toBeReleasedMap);
@@ -13286,9 +13290,13 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
toBeTrackedCount = designToBeTracked.size();
notInvolvedCount = designNotInvolved.size();
taskTerminationCount = taskTermination.size();
count = notStartCount + toBeSubmittedCount + toBeReviewedCount + complianceCount + nonComplianceCount + toBeTrackedCount + notInvolvedCount + taskTerminationCount;
count = notStartCount + toBeSubmittedCount + toBeReviewedCount + complianceCount + nonComplianceCount + toBeTrackedCount + taskTerminationCount;
// 计算百分比
percentage = complianceCount / count * 100;
if(count <= 0){
percentage = 0;
}else{
percentage = complianceCount / count * 100;
}
percentageStr = percentage != 0 ? df.format(percentage) : "0";
}
@@ -13393,9 +13401,14 @@ public class ProjectLawsInventoryEOServiceImpl extends ServiceImpl<ProjectLawsIn
toBeTrackedCount = verifyToBeTracked.size();
notInvolvedCount = verifyNotInvolved.size();
taskTerminationCount = taskTermination.size();
count = notStartCount + toBeSubmittedCount + toBeReviewedCount + complianceCount + nonComplianceCount + toBeTrackedCount + notInvolvedCount + taskTerminationCount;
// 计算百分比
percentage = complianceCount / count * 100;
count = notStartCount + toBeSubmittedCount + toBeReviewedCount + complianceCount + nonComplianceCount + toBeTrackedCount + taskTerminationCount;
if(count <= 0){
percentage = 0;
}else{
// 计算百分比
percentage = complianceCount / count * 100;
}
percentageStr = percentage != 0 ? df.format(percentage) : "0";
}
@@ -17,6 +17,7 @@ import com.jero.modules.cert.collect.enums.CollectManifestStateEnum;
import com.jero.modules.cert.collect.enums.CollectManifestStatisticsStateEnum;
import com.jero.modules.cert.collect.service.IParamsCollectManifestEOService;
import com.jero.modules.cert.collect.service.IParamsManifestEOService;
import com.jero.modules.cert.template.enums.ControlTypeEnum;
import com.jero.modules.dummy.enums.OrderEnum;
import com.jero.modules.enums.DictCodeEnum;
import com.jero.modules.feishu.enums.TemplateInfoEnum2;
@@ -2937,6 +2938,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
QueryWrapper<ParamsCollectManifestEO> pcmQueryWrap = new QueryWrapper<>();
pcmQueryWrap.lambda().in(ParamsCollectManifestEO::getParamsManifestId,pmIdList);
List<ParamsCollectManifestEO> pcmEoList = this.paramsCollectManifestEOService.list(pcmQueryWrap);
pcmEoList = pcmEoList.stream().filter(pcmEo -> !StringUtils.equals(pcmEo.getControlType(),ControlTypeEnum.Title.getValue())).collect(Collectors.toList());
List<SysDictItem> sysDictItems = new ArrayList<>();
String pcmDutyTerritoryStr = pcmEoList.stream().map(ParamsCollectManifestEO::getDutyTerritory).collect(Collectors.joining(","));
@@ -15,6 +15,7 @@ import com.jero.modules.cert.collect.entity.ParamsManifestEO;
import com.jero.modules.cert.collect.enums.CollectManifestStatisticsStateEnum;
import com.jero.modules.cert.collect.service.IParamsCollectManifestEOService;
import com.jero.modules.cert.collect.service.IParamsManifestEOService;
import com.jero.modules.cert.template.enums.ControlTypeEnum;
import com.jero.modules.project.entity.*;
import com.jero.modules.project.enums.*;
import com.jero.modules.project.mapper.ProjectUserPermissionMapper;
@@ -578,6 +579,7 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
List<ParamsManifestEO> pmEoList = this.paramsManifestEOService.list();
log.info("一阶段消耗时间:" + (System.currentTimeMillis() - startTime));
List<ParamsCollectManifestEO> pcmEoList = this.paramsCollectManifestEOService.getList(null);
pcmEoList = pcmEoList.stream().filter(pcmEo -> !StringUtils.equals(pcmEo.getControlType(), ControlTypeEnum.Title.getValue())).collect(Collectors.toList());;
log.info("二阶段消耗时间:" + (System.currentTimeMillis() - startTime));
@@ -593,10 +595,11 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
// 多线程代码
// 创建线程一
List<ProjectLibraryBase> finalPlbEoList = plbEoList;
List<ParamsCollectManifestEO> finalPcmEoList = pcmEoList;
Thread thread1 = new Thread(new Runnable() {
@Override
public void run() {
exportCrossProjectProgressSetData(finalPlbEoList, corssProjectProgressSheet,pliEoList,pciEoList,pmEoList,pcmEoList,projectLibraryBase,ptpEoList);
exportCrossProjectProgressSetData(finalPlbEoList, corssProjectProgressSheet,pliEoList,pciEoList,pmEoList, finalPcmEoList,projectLibraryBase,ptpEoList);
}
});
@@ -604,7 +607,7 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
Thread thread2 = new Thread(new Runnable() {
@Override
public void run() {
exportOverviewCrossProjectProgressSetData(finalPlbEoList, overviewCrossProjectProgressSheet,pliEoList,pciEoList,pmEoList,pcmEoList,projectLibraryBase,ptpEoList,cellStyleTitle);
exportOverviewCrossProjectProgressSetData(finalPlbEoList, overviewCrossProjectProgressSheet,pliEoList,pciEoList,pmEoList,finalPcmEoList,projectLibraryBase,ptpEoList,cellStyleTitle);
}
});
@@ -773,6 +776,8 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
List<ParamsCollectManifestEO> pcmEoList,
ProjectLibraryBase projectLibraryBase,
List<ProjectTaskPlanning> ptpEoList) {
CellStyle style = sheet.getWorkbook().createCellStyle();
style.setDataFormat(sheet.getWorkbook().createDataFormat().getFormat("0.00%")); // 将格式设置为百分比(保留两位小数)
int dataIndex = 2;
for (ProjectLibraryBase plbEo : plbEoList) {
long startTime = System.currentTimeMillis();
@@ -821,7 +826,12 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
dataRow.createCell(3).setCellValue(fgrqqrToBeConfirmed);
dataRow.createCell(4).setCellValue(fgrqqrAccept);
dataRow.createCell(5).setCellValue(fgrqqrRefuse);
dataRow.createCell(6).setCellValue(fgrqqrPercentage);
Cell cell = dataRow.createCell(6);
cell.setCellStyle(style);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(Double.valueOf(fgrqqrPercentage.replace("%",""))/100);
dataRow.createCell(7).setCellValue(legalTaskConfirmationStr);
Map<String,Object> designMap = this.projectLawsInventoryEOService.groupByDesignStatus(pliEos);
@@ -844,7 +854,10 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
dataRow.createCell(13).setCellValue(designToBeTracked);
dataRow.createCell(14).setCellValue(designNotInvolved);
dataRow.createCell(15).setCellValue(designTaskTermination);
dataRow.createCell(16).setCellValue(designPercentage);
cell = dataRow.createCell(16);
cell.setCellStyle(style);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(Double.valueOf(designPercentage.replace("%",""))/100);
dataRow.createCell(17).setCellValue(designDeadlineStr);
Map<String,Object> verifyMap = this.projectLawsInventoryEOService.groupByVerifyStatus(pliEos);
@@ -867,7 +880,10 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
dataRow.createCell(23).setCellValue(verifyToBeTracked);
dataRow.createCell(24).setCellValue(verifyNotInvolved);
dataRow.createCell(25).setCellValue(verifyTaskTermination);
dataRow.createCell(26).setCellValue(verifyPercentage);
cell = dataRow.createCell(26);
cell.setCellStyle(style);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(Double.valueOf(verifyPercentage.replace("%",""))/100);
dataRow.createCell(27).setCellValue(verifyDeadlineStr);
List<ProjectCertificationInventoryEO> pciEos = pciEoList.stream().filter(pciEo -> StringUtils.equals(pciEo.getProjectLibraryId(), plbEo.getId())).collect(Collectors.toList());
@@ -884,7 +900,10 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
dataRow.createCell(30).setCellValue(rzRqqrToBeConfirmed);
dataRow.createCell(31).setCellValue(rzRqqrAccept);
dataRow.createCell(32).setCellValue(rzRqqrRefuse);
dataRow.createCell(33).setCellValue(rzRqqrPercentage);
cell = dataRow.createCell(33);
cell.setCellStyle(style);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(Double.valueOf(rzRqqrPercentage.replace("%",""))/100);
dataRow.createCell(34).setCellValue(legalTaskConfirmationStr);
Map<String,Object> preHomoMap = this.projectCertificationInventoryEOService.groupByPreHomoStatus(pciEos);
@@ -900,7 +919,10 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
dataRow.createCell(37).setCellValue(preHomoToBeReviewedCount);
dataRow.createCell(38).setCellValue(preHomoAccept);
dataRow.createCell(39).setCellValue(preHomoRefuse);
dataRow.createCell(40).setCellValue(preHomoPercentage);
cell = dataRow.createCell(40);
cell.setCellStyle(style);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(Double.valueOf(preHomoPercentage.replace("%",""))/100);
dataRow.createCell(41).setCellValue(attestationStartTimeStr);
Map<String,Object> certificationProgressMap = this.projectCertificationInventoryEOService.groupByCertificationProgress(pciEos);
@@ -921,7 +943,10 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
dataRow.createCell(46).setCellValue(certificationProgressNotSubmitCount);
dataRow.createCell(47).setCellValue(certificationProgressReportSubmitCount);
dataRow.createCell(48).setCellValue(certificationProgressStoredCount);
dataRow.createCell(49).setCellValue(certificationProgressPercentage);
cell = dataRow.createCell(49);
cell.setCellStyle(style);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(Double.valueOf(certificationProgressPercentage.replace("%",""))/100);
dataRow.createCell(50).setCellValue(certificationSubmissionStr);
@@ -959,14 +984,17 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
syncReporAmount = (double) syncReporMap.get("amount");
double parameterCollectingCount = notStartAmount + collectingAmount + submitAmount + syncReporAmount;
double parameterCollectingPercentage = (syncReporAmount / parameterCollectingCount) * 100;
double parameterCollectingPercentage = ((submitAmount + syncReporAmount) / parameterCollectingCount) * 100;
parameterCollectingPercentageStr = (parameterCollectingPercentage != 0 && (syncReporAmount !=0 )) ? df.format(parameterCollectingPercentage) : "0";
}
dataRow.createCell(51).setCellValue(notStartAmount);
dataRow.createCell(52).setCellValue(collectingAmount);
dataRow.createCell(53).setCellValue(submitAmount);
dataRow.createCell(54).setCellValue(syncReporAmount);
dataRow.createCell(55).setCellValue(parameterCollectingPercentageStr + percentSign);
cell = dataRow.createCell(55);
cell.setCellStyle(style);
cell.setCellType(CellType.NUMERIC);
cell.setCellValue(Double.valueOf(parameterCollectingPercentageStr)/100);
dataRow.createCell(56).setCellValue(certificationSubmissionStr);
dataIndex ++;
@@ -976,7 +1004,7 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
/**
* 导出跨项目进度概览
* @param workbook
* @param sheet
* @param projectLibraryBase
* @param plbEoList
* @param pliEoList
@@ -1110,30 +1138,30 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
List<ProjectLawsInventoryEO> pliEos = pliEoList.stream().filter(pliEo -> StringUtils.equals(pliEo.getProjectLibraryId(), plbEo.getId())).collect(Collectors.toList());
Map<String,Object> fgRwqrMap = this.projectLawsInventoryEOService.groupByFGRwqrStatus(pliEos);
Map<String,Object> fgRwqrProjectScheduleExportMap = (Map<String, Object>) fgRwqrMap.get("projectScheduleExportMap");
String fgrqqrPercentage = (String) fgRwqrProjectScheduleExportMap.get("percentage");
double fgrqqrPercentage = Double.parseDouble(((String)fgRwqrProjectScheduleExportMap.get("percentage")).replace("%",""))/100;
Map<String,Object> designMap = this.projectLawsInventoryEOService.groupByDesignStatus(pliEos);
Map<String,Object> designMapProjectScheduleExportMap = (Map<String, Object>) designMap.get("projectScheduleExportMap");
String designPercentage = (String) designMapProjectScheduleExportMap.get("percentage");
double designPercentage = Double.parseDouble(((String)designMapProjectScheduleExportMap.get("percentage")).replace("%",""))/100;
Map<String,Object> verifyMap = this.projectLawsInventoryEOService.groupByVerifyStatus(pliEos);
Map<String,Object> verifyMapProjectScheduleExportMap = (Map<String, Object>) verifyMap.get("projectScheduleExportMap");
String verifyPercentage = (String) verifyMapProjectScheduleExportMap.get("percentage");
double verifyPercentage = Double.parseDouble(((String)verifyMapProjectScheduleExportMap.get("percentage")).replace("%",""))/100;
List<ProjectCertificationInventoryEO> pciEos = pciEoList.stream().filter(pciEo -> StringUtils.equals(pciEo.getProjectLibraryId(), plbEo.getId())).collect(Collectors.toList());
Map<String,Object> rzRwqrMap = this.projectCertificationInventoryEOService.groupByFGRwqrStatus(pciEos);
Map<String,Object> rzRwqrProjectScheduleExportMap = (Map<String, Object>) rzRwqrMap.get("projectScheduleExportMap");
String rzRqqrPercentage = (String) rzRwqrProjectScheduleExportMap.get("percentage");
double rzRqqrPercentage = Double.parseDouble(((String)rzRwqrProjectScheduleExportMap.get("percentage")).replace("%",""))/100;
Map<String,Object> preHomoMap = this.projectCertificationInventoryEOService.groupByPreHomoStatus(pciEos);
Map<String,Object> preHomoProjectScheduleExportMap = (Map<String, Object>) preHomoMap.get("projectScheduleExportMap");
String preHomoPercentage = (String) preHomoProjectScheduleExportMap.get("percentage");
double preHomoPercentage = Double.parseDouble(((String)preHomoProjectScheduleExportMap.get("percentage")).replace("%",""))/100;
List<ParamsManifestEO> pmEos = pmEoList.stream().filter(pmEo -> {
return StringUtils.equals(pmEo.getProjectId(), plbEo.getId());
}).collect(Collectors.toList());
String parameterCollectingPercentageStr = "0" + percentSign;
double parameterCollectingPercentageStr = 0;
if(CollectionUtils.isNotEmpty(pmEos)){
List<String> pmEoIdList = pmEos.stream().map(ParamsManifestEO::getId).distinct().collect(Collectors.toList());
@@ -1159,13 +1187,13 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
double syncReporAmount = (double) syncReporMap.get("amount");
double parameterCollectingCount = notStartAmount + collectingAmount + submitAmount + syncReporAmount;
double parameterCollectingPercentage = (syncReporAmount / parameterCollectingCount) * 100;
parameterCollectingPercentageStr = (parameterCollectingPercentage != 0 && (syncReporAmount !=0 )) ? df.format(parameterCollectingPercentage) + percentSign : "0" + percentSign;
double parameterCollectingPercentage = (submitAmount + syncReporAmount) / parameterCollectingCount;
parameterCollectingPercentageStr = (parameterCollectingPercentage != 0 && (syncReporAmount !=0 )) ? parameterCollectingPercentage : 0;
}
Map<String,Object> certificationProgressMap = this.projectCertificationInventoryEOService.groupByCertificationProgress(pciEos);
Map<String,Object> certificationProgressMapProjectScheduleExportMap = (Map<String, Object>) certificationProgressMap.get("projectScheduleExportMap");
String certificationProgressPercentage = (String) certificationProgressMapProjectScheduleExportMap.get("percentage");
double certificationProgressPercentage = Double.parseDouble(((String)certificationProgressMapProjectScheduleExportMap.get("percentage")).replace("%",""))/100;
CellRangeAddress regionCell1 = new CellRangeAddress(dataIndex, dataIndex + 1, 0, 0);
sheet.addMergedRegion(regionCell1);
@@ -1179,7 +1207,11 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
Cell dataRowCell = dataRow.createCell(i);
dataRowCell.setCellStyle(cellStyleTitle);
Cell dataRow2Cell = dataRow2.createCell(i);
dataRow2Cell.setCellStyle(cellStyleTitle);
CellStyle style = sheet.getWorkbook().createCellStyle();
style.setDataFormat(sheet.getWorkbook().createDataFormat().getFormat("0.00%"));
dataRow2Cell.setCellStyle(style);
dataRow2Cell.setCellType(CellType.NUMERIC);
if(i == 0){
dataRowCell.setCellValue(plbEo.getShowName());
}else if(i==1){