|
@@ -381,53 +381,54 @@ public class ZhcxApiServiceImpl implements ZhcxApiService {
|
|
|
Wrappers.<ZhcxProjectManageDo>lambdaQuery()
|
|
|
.eq(ZhcxProjectManageDo::getProjectCode, map.get("projectcode"))
|
|
|
.eq(ZhcxProjectManageDo::getDeleted, "0"));
|
|
|
-
|
|
|
+ List<RectifyApiDataDto> rectifyDtoList;
|
|
|
map.clear();
|
|
|
- map.put("projectId", projectManageDo.getId());
|
|
|
-
|
|
|
- List<ZhcxProjectRectifyMachineVo> list = zhcxProjectManageService.getListData(map);
|
|
|
+ if (projectManageDo != null) {
|
|
|
+ map.put("projectId", projectManageDo.getId());
|
|
|
|
|
|
- // 处理一级部门数据
|
|
|
- List<RectifyApiDataDto> firstDeptRectifyList = processFirstDeptData(list, projectManageDo);
|
|
|
+ List<ZhcxProjectRectifyMachineVo> list = zhcxProjectManageService.getListData(map);
|
|
|
|
|
|
- // 处理施工部门数据
|
|
|
- List<RectifyApiDataDto> rectifyDtoList = processSecondaryDeptData(list, projectManageDo, firstDeptRectifyList);
|
|
|
+ // 处理一级部门数据
|
|
|
+ List<RectifyApiDataDto> firstDeptRectifyList = processFirstDeptData(list, projectManageDo);
|
|
|
|
|
|
- // 排序
|
|
|
- rectifyDtoList.sort((d1, d2) -> {
|
|
|
- int ifoutsidebase1 = "inside".equals(d1.getIfoutsidebase()) ? 0 : 1;
|
|
|
- int ifoutsidebase2 = "inside".equals(d2.getIfoutsidebase()) ? 0 : 1;
|
|
|
- int ifoutsideBaseCompare = Integer.compare(ifoutsidebase1, ifoutsidebase2);
|
|
|
- if (ifoutsideBaseCompare != 0) {
|
|
|
- return ifoutsideBaseCompare;
|
|
|
- }
|
|
|
+ // 处理施工部门数据
|
|
|
+ rectifyDtoList = processSecondaryDeptData(list, projectManageDo, firstDeptRectifyList);
|
|
|
|
|
|
- int machineNoCompare = compareMachineNo(d1.getMachineNo(), d2.getMachineNo());
|
|
|
- if (machineNoCompare != 0) {
|
|
|
- return machineNoCompare;
|
|
|
- }
|
|
|
+ // 排序
|
|
|
+ rectifyDtoList.sort((d1, d2) -> {
|
|
|
+ int ifoutsidebase1 = "inside".equals(d1.getIfoutsidebase()) ? 0 : 1;
|
|
|
+ int ifoutsidebase2 = "inside".equals(d2.getIfoutsidebase()) ? 0 : 1;
|
|
|
+ int ifoutsideBaseCompare = Integer.compare(ifoutsidebase1, ifoutsidebase2);
|
|
|
+ if (ifoutsideBaseCompare != 0) {
|
|
|
+ return ifoutsideBaseCompare;
|
|
|
+ }
|
|
|
|
|
|
- int firstDeptCompare = Comparator.comparing(RectifyApiDataDto::getFirstdeptsort, Comparator.nullsLast(Integer::compareTo)).compare(d1, d2);
|
|
|
- if (firstDeptCompare != 0) {
|
|
|
- return firstDeptCompare;
|
|
|
- }
|
|
|
+ int machineNoCompare = compareMachineNo(d1.getMachineNo(), d2.getMachineNo());
|
|
|
+ if (machineNoCompare != 0) {
|
|
|
+ return machineNoCompare;
|
|
|
+ }
|
|
|
|
|
|
- int secondDeptCompare = Comparator.comparing(RectifyApiDataDto::getDeptsort, Comparator.nullsFirst(Integer::compareTo)).compare(d1, d2);
|
|
|
- if (secondDeptCompare != 0) {
|
|
|
- return secondDeptCompare;
|
|
|
- }
|
|
|
- return 0;
|
|
|
- });
|
|
|
+ int firstDeptCompare = Comparator.comparing(RectifyApiDataDto::getFirstdeptsort, Comparator.nullsLast(Integer::compareTo)).compare(d1, d2);
|
|
|
+ if (firstDeptCompare != 0) {
|
|
|
+ return firstDeptCompare;
|
|
|
+ }
|
|
|
|
|
|
- // 处理基地内合计数据
|
|
|
- rectifyDtoList.addAll(processBaseData(list, true, projectManageDo));
|
|
|
+ int secondDeptCompare = Comparator.comparing(RectifyApiDataDto::getDeptsort, Comparator.nullsFirst(Integer::compareTo)).compare(d1, d2);
|
|
|
+ if (secondDeptCompare != 0) {
|
|
|
+ return secondDeptCompare;
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+ });
|
|
|
|
|
|
- // 处理基地外合计数据
|
|
|
- rectifyDtoList.addAll(processBaseData(list, false, projectManageDo));
|
|
|
+ // 处理基地内合计数据
|
|
|
+ rectifyDtoList.addAll(processBaseData(list, true, projectManageDo));
|
|
|
|
|
|
- // 处理总合计数据
|
|
|
- rectifyDtoList.addAll(processTotalData(list, projectManageDo));
|
|
|
+ // 处理基地外合计数据
|
|
|
+ rectifyDtoList.addAll(processBaseData(list, false, projectManageDo));
|
|
|
|
|
|
+ // 处理总合计数据
|
|
|
+ rectifyDtoList.addAll(processTotalData(list, projectManageDo));
|
|
|
+ }
|
|
|
|
|
|
|
|
|
return rectifyDtoList;
|