|
@@ -198,30 +198,46 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
|
|
|
@Override
|
|
|
public R getRectifyReportData(Map<String, Object> map) {
|
|
|
Object projectIdObj = map.get("projectId");
|
|
|
+ Object batchIdObj = map.get("batchId");
|
|
|
if (ObjectUtil.isEmpty(projectIdObj)) {
|
|
|
- return R.error("");
|
|
|
+ return R.error();
|
|
|
}
|
|
|
String projectId = (String) projectIdObj;
|
|
|
- //整改清单
|
|
|
- List<ZhcxProjectRectifyDo> rectifyDos = projectRectifyService.list(
|
|
|
- Wrappers.<ZhcxProjectRectifyDo>lambdaQuery()
|
|
|
- .eq(ZhcxProjectRectifyDo::getPrjid, projectId)
|
|
|
- .eq(ZhcxProjectRectifyDo::getDeleted, "0"));
|
|
|
-
|
|
|
- if (rectifyDos == null || rectifyDos.isEmpty()) {
|
|
|
- return R.ok();
|
|
|
- }
|
|
|
//获取机号
|
|
|
RectifyReportDto rectifyReportDto = new RectifyReportDto();
|
|
|
- String machineno = rectifyDos.get(0).getMachineno();
|
|
|
+ List<ZhcxProjectRectifyMachineVo> list;
|
|
|
+ String machineno = "";
|
|
|
+ //整改清单
|
|
|
+ if (ObjectUtil.isEmpty(batchIdObj)) {
|
|
|
+ List<ZhcxProjectRectifyDo> rectifyDos = projectRectifyService.list(
|
|
|
+ Wrappers.<ZhcxProjectRectifyDo>lambdaQuery()
|
|
|
+ .eq(ZhcxProjectRectifyDo::getPrjid, projectId)
|
|
|
+ .eq(ZhcxProjectRectifyDo::getDeleted, "0"));
|
|
|
+
|
|
|
+ if (rectifyDos == null || rectifyDos.isEmpty()) {
|
|
|
+ return R.ok();
|
|
|
+ }
|
|
|
+ machineno = rectifyDos.get(0).getMachineno();
|
|
|
+ }else{
|
|
|
+ //批次
|
|
|
+ String batchId = (String) batchIdObj;
|
|
|
+ ZhcxProjectManageRectifyBatchDo rectifyBatchDo = projectManageRectifyBatchService.getById(batchId);
|
|
|
+ machineno = rectifyBatchDo.getMachineno();
|
|
|
+ }
|
|
|
if (StringUtils.isBlank(machineno)) {
|
|
|
return R.ok();
|
|
|
}
|
|
|
|
|
|
List<String> machineNoList = Arrays.asList(machineno.split(","));
|
|
|
+ Collections.sort(machineNoList, (s1, s2) -> {
|
|
|
+ // 提取数字部分并转换为整数进行比较
|
|
|
+ int num1 = Integer.parseInt(s1.replace("#", ""));
|
|
|
+ int num2 = Integer.parseInt(s2.replace("#", ""));
|
|
|
+ return Integer.compare(num1, num2);
|
|
|
+ });
|
|
|
rectifyReportDto.setNoList(machineNoList);
|
|
|
|
|
|
- List<ZhcxProjectRectifyMachineVo> list = this.getListData(rectifyDos.get(0).getPrjid());
|
|
|
+ list = this.getListData(map);
|
|
|
// 根据一级部门分组
|
|
|
Map<String, List<ZhcxProjectRectifyMachineVo>> groupFirstDeptList = list.stream()
|
|
|
.filter(e -> Objects.nonNull(e.getFirstdeptid()))
|
|
@@ -297,6 +313,7 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
|
|
|
//基地外合计
|
|
|
List<ZhcxProjectRectifyMachineVo> collect3 = list.stream()
|
|
|
.filter(e -> !"b0bd3ed27bfb4af08535c39f464b3d3a".equals(e.getDeptid())
|
|
|
+ && !"55c58ffb9d9b486abdd0dcb073f9b451".equals(e.getDeptid())
|
|
|
&& Objects.isNull(e.getFirstdeptid())).collect(Collectors.toList());
|
|
|
RectifyDto outSideRectifyDto = new RectifyDto();
|
|
|
outSideRectifyDto.setDeptid(null);
|
|
@@ -321,8 +338,8 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
|
|
|
return R.ok(rectifyReportDto);
|
|
|
}
|
|
|
|
|
|
- private List<ZhcxProjectRectifyMachineVo> getListData(String prjid) {
|
|
|
- return zhcxProjectManageDao.getListData(prjid);
|
|
|
+ private List<ZhcxProjectRectifyMachineVo> getListData(Map<String, Object> map) {
|
|
|
+ return zhcxProjectManageDao.getListData(map);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -349,7 +366,7 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
Map<String, Long> statusCount = distinctEntities.stream()
|
|
|
- .collect(Collectors.groupingBy(ZhcxProjectRectifyMachineDo::getStatus, Collectors.counting()));
|
|
|
+ .collect(Collectors.groupingBy(e-> e.getStatus().trim().toLowerCase(), Collectors.counting()));
|
|
|
|
|
|
int okCount = statusCount.getOrDefault("ok", 0L).intValue();
|
|
|
int tbcCount = statusCount.getOrDefault("√", 0L).intValue();
|