diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaManageApplyEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaManageApplyEOController.java index 736b86a3d..57b9c8dfc 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaManageApplyEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaManageApplyEOController.java @@ -292,8 +292,12 @@ public class OtaManageApplyEOController extends JeroController getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut) { - Map res = otaManageApplyEOService.getStatisticalStatus(projectId, plannedBpLaunchBatch, cut); - return Result.OK("操作成功!", res); + List> res = otaManageApplyEOService.getStatisticalStatus(projectId, plannedBpLaunchBatch, cut); + if(!res.isEmpty()){ + return Result.OK("操作成功!", res.get(0)); + }else{ + return Result.OK("操作成功!", new HashMap<>()); + } } /** diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaManageApplyEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaManageApplyEOService.java index e26df0208..75b3f0b57 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaManageApplyEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaManageApplyEOService.java @@ -127,7 +127,7 @@ public interface IOtaManageApplyEOService extends IService { List getVdrListByProject(String projectId, String cut); - Map getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut); + List> getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut); ModelAndView otaExportXls(HttpServletRequest request, OtaManageApplyEO otaManageApplyEO); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaManageApplyEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaManageApplyEOServiceImpl.java index 6e311ee43..d46d86ce7 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaManageApplyEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaManageApplyEOServiceImpl.java @@ -1354,91 +1354,104 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut) { + public List> getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut) { List receiveList = this.getBaseMapper().getListByProjectId(projectId, plannedBpLaunchBatch); - int total = receiveList.size(); - //匹配状态 - int toBeMatched = 0;//待匹配 - int toBeApproved = 0;//待审批 - int locked = 0;//锁定 - int rejected = 0;//退回 - //认证进度 - int notStart = 0;//未开始 - int inProgress = 0;//进行中 - int testPassed = 0;//实验通过 - int testFailed = 0;//实验失败 - int notSubmitted = 0;//部件报告未提交 - int submitted = 0;//部件报告已提交 - int stored = 0;//部件报告已入库 + List> result = new ArrayList<>(); + if(!receiveList.isEmpty()){ + List plannedBpLaunchBatchList = receiveList.stream() + .filter(e -> StringUtils.isNotBlank(e.getPlannedBpLaunchBatch())) + .map(OtaManageApplyEO::getPlannedBpLaunchBatch).distinct().collect(Collectors.toList()); - for (OtaManageApplyEO oma : receiveList) { - if (StringUtils.isBlank(oma.getMatchStatus()) || oma.getMatchStatus().equals(OtaStatusEnum.TO_BE_MATCHED.getKey())) { - toBeMatched++; - } else if (oma.getMatchStatus().equals(OtaStatusEnum.TO_BE_APPROVED.getKey())) { - toBeApproved++; - } else if (oma.getMatchStatus().equals(OtaStatusEnum.LOCKED.getKey())) { - locked++; - } else if (oma.getMatchStatus().equals(OtaStatusEnum.REJECTED.getKey())) { - rejected++; - } else { - toBeMatched++; - } - if (StringUtils.isBlank(oma.getAttestationSchedule()) || oma.getAttestationSchedule().equals(CertificationProgressEnum.NOT_START.getValue())) { - notStart++; - } else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.IN_PROGRESS.getValue())) { - inProgress++; - } else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.TEST_PASSED.getValue())) { - testPassed++; - } else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.TEST_FAILED.getValue())) { - testFailed++; - } else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue())) { - notSubmitted++; - } else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue())) { - submitted++; - } else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue())) { - stored++; - } else { - notStart++; + for (String s : plannedBpLaunchBatchList) { + List otaManageApplyEOList = receiveList.stream() + .filter(e -> s.equals(e.getPlannedBpLaunchBatch())).collect(Collectors.toList()); + + int total = otaManageApplyEOList.size(); + //匹配状态 + int toBeMatched = 0;//待匹配 + int toBeApproved = 0;//待审批 + int locked = 0;//锁定 + int rejected = 0;//退回 + //认证进度 + int notStart = 0;//未开始 + int inProgress = 0;//进行中 + int testPassed = 0;//实验通过 + int testFailed = 0;//实验失败 + int notSubmitted = 0;//部件报告未提交 + int submitted = 0;//部件报告已提交 + int stored = 0;//部件报告已入库 + + for (OtaManageApplyEO oma : otaManageApplyEOList) { + if (StringUtils.isBlank(oma.getMatchStatus()) || oma.getMatchStatus().equals(OtaStatusEnum.TO_BE_MATCHED.getKey())) { + toBeMatched++; + } else if (oma.getMatchStatus().equals(OtaStatusEnum.TO_BE_APPROVED.getKey())) { + toBeApproved++; + } else if (oma.getMatchStatus().equals(OtaStatusEnum.LOCKED.getKey())) { + locked++; + } else if (oma.getMatchStatus().equals(OtaStatusEnum.REJECTED.getKey())) { + rejected++; + } else { + toBeMatched++; + } + if (StringUtils.isBlank(oma.getAttestationSchedule()) || oma.getAttestationSchedule().equals(CertificationProgressEnum.NOT_START.getValue())) { + notStart++; + } else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.IN_PROGRESS.getValue())) { + inProgress++; + } else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.TEST_PASSED.getValue())) { + testPassed++; + } else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.TEST_FAILED.getValue())) { + testFailed++; + } else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue())) { + notSubmitted++; + } else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue())) { + submitted++; + } else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue())) { + stored++; + } else { + notStart++; + } + } + + Map statisticalMap = new HashMap<>(); + statisticalMap.put("plannedBpLaunchBatch",s); + statisticalMap.put("allCount", total); + List> matchStatusMapList = new ArrayList<>(); + matchStatusMapList.add(wrapStatMap("matchStatus", "matchStatusCount", OtaStatusEnum.TO_BE_MATCHED.getKey(), toBeMatched)); + matchStatusMapList.add(wrapStatMap("matchStatus", "matchStatusCount", OtaStatusEnum.TO_BE_APPROVED.getKey(), toBeApproved)); + matchStatusMapList.add(wrapStatMap("matchStatus", "matchStatusCount", OtaStatusEnum.LOCKED.getKey(), locked)); + matchStatusMapList.add(wrapStatMap("matchStatus", "matchStatusCount", OtaStatusEnum.REJECTED.getKey(), rejected)); + statisticalMap.put("matchStatusMapList", matchStatusMapList); + + Map matchStatusMap = new HashMap<>(); + matchStatusMap.put(OtaStatusEnum.TO_BE_MATCHED.getKey(), toBeMatched); + matchStatusMap.put(OtaStatusEnum.TO_BE_APPROVED.getKey(), toBeApproved); + matchStatusMap.put(OtaStatusEnum.LOCKED.getKey(), locked); + matchStatusMap.put(OtaStatusEnum.REJECTED.getKey(), rejected); + statisticalMap.put("matchStatusMap", matchStatusMap); + + List> attestationScheduleMapList = new ArrayList<>(); + attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.NOT_START.getValue(), notStart)); + attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.IN_PROGRESS.getValue(), inProgress)); + attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.TEST_PASSED.getValue(), testPassed)); + attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.TEST_FAILED.getValue(), testFailed)); + attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue(), notSubmitted)); + attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue(), submitted)); + attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue(), stored)); + statisticalMap.put("attestationScheduleMapList", attestationScheduleMapList); + + Map attestationScheduleMap = new HashMap<>(); + attestationScheduleMap.put(CertificationProgressEnum.NOT_START.getValue().replace(" ", "_"), notStart); + attestationScheduleMap.put(CertificationProgressEnum.IN_PROGRESS.getValue().replace(" ", "_"), inProgress); + attestationScheduleMap.put(CertificationProgressEnum.TEST_PASSED.getValue().replace(" ", "_"), testPassed); + attestationScheduleMap.put(CertificationProgressEnum.TEST_FAILED.getValue().replace(" ", "_"), testFailed); + attestationScheduleMap.put(CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue().replace(" ", "_"), notSubmitted); + attestationScheduleMap.put(CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue().replace(" ", "_"), submitted); + attestationScheduleMap.put(CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue().replace(" ", "_"), stored); + statisticalMap.put("attestationScheduleMap", attestationScheduleMap); + result.add(statisticalMap); } } - - Map statisticalMap = new HashMap<>(); - statisticalMap.put("allCount", total); - List> matchStatusMapList = new ArrayList<>(); - matchStatusMapList.add(wrapStatMap("matchStatus", "matchStatusCount", OtaStatusEnum.TO_BE_MATCHED.getKey(), toBeMatched)); - matchStatusMapList.add(wrapStatMap("matchStatus", "matchStatusCount", OtaStatusEnum.TO_BE_APPROVED.getKey(), toBeApproved)); - matchStatusMapList.add(wrapStatMap("matchStatus", "matchStatusCount", OtaStatusEnum.LOCKED.getKey(), locked)); - matchStatusMapList.add(wrapStatMap("matchStatus", "matchStatusCount", OtaStatusEnum.REJECTED.getKey(), rejected)); - statisticalMap.put("matchStatusMapList", matchStatusMapList); - - Map matchStatusMap = new HashMap<>(); - matchStatusMap.put(OtaStatusEnum.TO_BE_MATCHED.getKey(), toBeMatched); - matchStatusMap.put(OtaStatusEnum.TO_BE_APPROVED.getKey(), toBeApproved); - matchStatusMap.put(OtaStatusEnum.LOCKED.getKey(), locked); - matchStatusMap.put(OtaStatusEnum.REJECTED.getKey(), rejected); - statisticalMap.put("matchStatusMap", matchStatusMap); - - List> attestationScheduleMapList = new ArrayList<>(); - attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.NOT_START.getValue(), notStart)); - attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.IN_PROGRESS.getValue(), inProgress)); - attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.TEST_PASSED.getValue(), testPassed)); - attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.TEST_FAILED.getValue(), testFailed)); - attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue(), notSubmitted)); - attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue(), submitted)); - attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue(), stored)); - statisticalMap.put("attestationScheduleMapList", attestationScheduleMapList); - - Map attestationScheduleMap = new HashMap<>(); - attestationScheduleMap.put(CertificationProgressEnum.NOT_START.getValue().replace(" ", "_"), notStart); - attestationScheduleMap.put(CertificationProgressEnum.IN_PROGRESS.getValue().replace(" ", "_"), inProgress); - attestationScheduleMap.put(CertificationProgressEnum.TEST_PASSED.getValue().replace(" ", "_"), testPassed); - attestationScheduleMap.put(CertificationProgressEnum.TEST_FAILED.getValue().replace(" ", "_"), testFailed); - attestationScheduleMap.put(CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue().replace(" ", "_"), notSubmitted); - attestationScheduleMap.put(CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue().replace(" ", "_"), submitted); - attestationScheduleMap.put(CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue().replace(" ", "_"), stored); - statisticalMap.put("attestationScheduleMap", attestationScheduleMap); - - return statisticalMap; + return result; } private Map wrapStatMap(String key, String val, String keyStr, Object valObj) { diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java index c311feb4c..d4334bbe5 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLibraryBaseServiceImpl.java @@ -22,6 +22,8 @@ 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; +import com.jero.modules.ota.entity.OtaManageApplyEO; +import com.jero.modules.ota.service.impl.OtaManageApplyEOServiceImpl; import com.jero.modules.project.entity.*; import com.jero.modules.project.enums.*; import com.jero.modules.project.mapper.ProjectLawsInventoryEOMapper; @@ -48,6 +50,7 @@ import com.jero.modules.todoCenter.service.IProcessInfoDetailEOService; import com.jero.modules.top.entity.TopProjectEO; import com.jero.modules.top.service.ITopProjectEOService; import com.jero.modules.wkflow.enums.FlowTypeEnum; +import javafx.beans.binding.ObjectBinding; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.ObjectUtils; import org.apache.poi.hssf.usermodel.HSSFSheet; @@ -173,6 +176,8 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl> mapList = otaManageApplyEOService.getStatisticalStatus(projectLibraryId, null, cut); + + if(ObjectUtils.isNotEmpty(mapList)){ + int dataIndex = 2; + for (Map map : mapList) { + String plannedBpLaunchBatch = (String) map.get("plannedBpLaunchBatch"); + Map matchStatusMap = (Map)map.get("matchStatusMap"); + Map attestationScheduleMap = (Map)map.get("attestationScheduleMap"); + + String.valueOf(matchStatusMap.get("locked")); + String locked = String.valueOf(matchStatusMap.get("locked")); + String rejected = String.valueOf(matchStatusMap.get("rejected")); + String to_be_approved = String.valueOf(matchStatusMap.get("to_be_approved")); + String to_be_matched = String.valueOf(matchStatusMap.get("to_be_matched")); + String Component_report_has_been_stored = String.valueOf(attestationScheduleMap.get("Component_report_has_been_stored")); + String Component_report_not_submitted = String.valueOf(attestationScheduleMap.get("Component_report_not_submitted")); + String Component_report_submitted = String.valueOf(attestationScheduleMap.get("Component_report_submitted")); + String In_progress = String.valueOf(attestationScheduleMap.get("In_progress")); + String Not_start =String.valueOf(attestationScheduleMap.get("Not_start")); + String Test_failed = String.valueOf(attestationScheduleMap.get("Test_failed")); + String Test_passed = String.valueOf(attestationScheduleMap.get("Test_passed")); + Row dataRow = sheet.createRow(dataIndex); + dataRow.createCell(0).setCellValue(plannedBpLaunchBatch); + dataRow.createCell(1).setCellValue(to_be_matched); + dataRow.createCell(2).setCellValue(to_be_approved); + dataRow.createCell(3).setCellValue(locked); + dataRow.createCell(4).setCellValue(rejected); + dataRow.createCell(5).setCellValue(Not_start); + dataRow.createCell(6).setCellValue(In_progress); + dataRow.createCell(7).setCellValue(Test_passed); + dataRow.createCell(8).setCellValue(Test_failed); + dataRow.createCell(9).setCellValue(Component_report_not_submitted); + dataRow.createCell(10).setCellValue(Component_report_submitted); + dataRow.createCell(11).setCellValue(Component_report_has_been_stored); + dataIndex ++; + } + } + } /** * 导出认证参数收集-设置数据