Browse Source

整改清单对外接口

zhuang 11 months ago
parent
commit
2aed35029e

+ 3 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/dao/ZhcxProjectManageDao.java

@@ -39,6 +39,9 @@ public interface ZhcxProjectManageDao extends BaseMapper<ZhcxProjectManageDo> {
             "<if test='batchId !=null'>" +
             "AND x.BATCHID=#{batchId}" +
             "</if>" +
+            "<if test='machineno !=null'>" +
+            "AND x.MACHINENO=#{machineno}" +
+            "</if>" +
             "AND x.DEPTID is not null and " +
             "x.STATUS is not null " +
             "</script>")

+ 34 - 34
business-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ZhcxApiServiceImpl.java

@@ -382,52 +382,52 @@ public class ZhcxApiServiceImpl implements ZhcxApiService {
                         .eq(ZhcxProjectManageDo::getProjectCode, map.get("projectcode"))
                         .eq(ZhcxProjectManageDo::getDeleted, "0"));
         List<RectifyApiDataDto> rectifyDtoList = new ArrayList<>();
-        map.clear();
         if (projectManageDo != null) {
             map.put("projectId", projectManageDo.getId());
-
             List<ZhcxProjectRectifyMachineVo> list = zhcxProjectManageService.getListData(map);
 
-            // 处理一级部门数据
-            List<RectifyApiDataDto> firstDeptRectifyList = processFirstDeptData(list, projectManageDo);
+            if (list != null && list.size() > 0) {
+                // 处理一级部门数据
+                List<RectifyApiDataDto> firstDeptRectifyList = processFirstDeptData(list, projectManageDo);
 
-            // 处理施工部门数据
-            rectifyDtoList = processSecondaryDeptData(list, projectManageDo, firstDeptRectifyList);
+                // 处理施工部门数据
+                rectifyDtoList = processSecondaryDeptData(list, projectManageDo, firstDeptRectifyList);
 
-            // 排序
-            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.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 machineNoCompare = compareMachineNo(d1.getMachineNo(), d2.getMachineNo());
-                if (machineNoCompare != 0) {
-                    return machineNoCompare;
-                }
+                    int machineNoCompare = compareMachineNo(d1.getMachineNo(), d2.getMachineNo());
+                    if (machineNoCompare != 0) {
+                        return machineNoCompare;
+                    }
 
-                int firstDeptCompare = Comparator.comparing(RectifyApiDataDto::getFirstdeptsort, Comparator.nullsLast(Integer::compareTo)).compare(d1, d2);
-                if (firstDeptCompare != 0) {
-                    return firstDeptCompare;
-                }
+                    int firstDeptCompare = Comparator.comparing(RectifyApiDataDto::getFirstdeptsort, Comparator.nullsLast(Integer::compareTo)).compare(d1, d2);
+                    if (firstDeptCompare != 0) {
+                        return firstDeptCompare;
+                    }
 
-                int secondDeptCompare = Comparator.comparing(RectifyApiDataDto::getDeptsort, Comparator.nullsFirst(Integer::compareTo)).compare(d1, d2);
-                if (secondDeptCompare != 0) {
-                    return secondDeptCompare;
-                }
-                return 0;
-            });
+                    int secondDeptCompare = Comparator.comparing(RectifyApiDataDto::getDeptsort, Comparator.nullsFirst(Integer::compareTo)).compare(d1, d2);
+                    if (secondDeptCompare != 0) {
+                        return secondDeptCompare;
+                    }
+                    return 0;
+                });
 
-            // 处理基地内合计数据
-            rectifyDtoList.addAll(processBaseData(list, true, projectManageDo));
+                // 处理基地内合计数据
+                rectifyDtoList.addAll(processBaseData(list, true, projectManageDo));
 
-            // 处理基地外合计数据
-            rectifyDtoList.addAll(processBaseData(list, false, projectManageDo));
+                // 处理基地外合计数据
+                rectifyDtoList.addAll(processBaseData(list, false, projectManageDo));
 
-            // 处理总合计数据
-            rectifyDtoList.addAll(processTotalData(list, projectManageDo));
+                // 处理总合计数据
+                rectifyDtoList.addAll(processTotalData(list, projectManageDo));
+            }
         }