Browse Source

泵站关联小区时 返回的楼号的状态调整

王苗苗 3 tháng trước cách đây
mục cha
commit
16e7c463e5

+ 4 - 3
slibra-system/src/main/java/com/slibra/business/res/NeighbourhoodNumberAndAddFlag.java

@@ -14,7 +14,7 @@ public class NeighbourhoodNumberAndAddFlag {
 
 
     //记录ID
-    private Long id;
+//    private Long id;
 
     //泵站ID
     private Long pumpingStationId;
@@ -28,8 +28,9 @@ public class NeighbourhoodNumberAndAddFlag {
     //楼号名称
     private String buildingsNames;
 
-    //在该泵站是否已经添加过来
-    private boolean add = false;
+    //按钮的显示状态: 0:可以勾选,前面是白色的框  1:被其他泵站关联,置灰  2:已经被本泵站勾选过来,前面显示✔️
+    private int addStatus;
+
 
 
 

+ 6 - 1
slibra-system/src/main/java/com/slibra/business/service/impl/TCutOffWaterServiceImpl.java

@@ -7,6 +7,7 @@ import org.springframework.stereotype.Service;
 import com.slibra.business.mapper.TCutOffWaterMapper;
 import com.slibra.business.domain.TCutOffWater;
 import com.slibra.business.service.ITCutOffWaterService;
+import org.springframework.util.CollectionUtils;
 
 /**
  * 停水信息Service业务层处理
@@ -41,7 +42,11 @@ public class TCutOffWaterServiceImpl implements ITCutOffWaterService
     @Override
     public List<TCutOffWater> selectTCutOffWaterList(TCutOffWater tCutOffWater)
     {
-        return tCutOffWaterMapper.selectTCutOffWaterList(tCutOffWater);
+        List<TCutOffWater> tCutOffWaters = tCutOffWaterMapper.selectTCutOffWaterList(tCutOffWater);
+        if(!CollectionUtils.isEmpty(tCutOffWaters)){
+            //额外返回 停水范围(小区)和 停水状态字段
+        }
+        return tCutOffWaters;
     }
 
     /**

+ 11 - 3
slibra-system/src/main/java/com/slibra/business/service/impl/TPumpingStationServiceImpl.java

@@ -171,9 +171,17 @@ public class TPumpingStationServiceImpl implements ITPumpingStationService
             //通过楼号和泵站查询对应的楼号是否已经添加过了
             List<TPumpingStationNeighbourhoodNumber> tPumpingStationNeighbourhoodNumbers = this.tPumpingStationNeighbourhoodNumberMapper.selectTPumpingStationNeighbourhoodNumberList(TPumpingStationNeighbourhoodNumber.builder().pumpingStationId(pumpingStationId).neighborhoodId(tNeighborhoodBuilding.getNeighborhoodId()).neighborhoodBuildingId(tNeighborhoodBuilding.getId()).build());
             if(!CollectionUtils.isEmpty(tPumpingStationNeighbourhoodNumbers)){
-                TPumpingStationNeighbourhoodNumber tPumpingStationNeighbourhoodNumber = tPumpingStationNeighbourhoodNumbers.get(0);
-                neighbourhoodNumberAndAddFlag.setId(tPumpingStationNeighbourhoodNumber.getId());
-                neighbourhoodNumberAndAddFlag.setAdd(true);
+//                TPumpingStationNeighbourhoodNumber tPumpingStationNeighbourhoodNumber = tPumpingStationNeighbourhoodNumbers.get(0);
+//                neighbourhoodNumberAndAddFlag.setId(tPumpingStationNeighbourhoodNumber.getId());
+                neighbourhoodNumberAndAddFlag.setAddStatus(2);
+            }else{
+                //查看对应的楼号是不是被其他泵站添加了
+                List<TPumpingStationNeighbourhoodNumber> tPumpingStationNeighbourhoodNumbers1 = this.tPumpingStationNeighbourhoodNumberMapper.selectTPumpingStationNeighbourhoodNumberList(TPumpingStationNeighbourhoodNumber.builder().neighborhoodId(tNeighborhoodBuilding.getNeighborhoodId()).neighborhoodBuildingId(tNeighborhoodBuilding.getId()).build());
+                if(!CollectionUtils.isEmpty(tPumpingStationNeighbourhoodNumbers1)){
+                    neighbourhoodNumberAndAddFlag.setAddStatus(1);
+                }else{
+                    neighbourhoodNumberAndAddFlag.setAddStatus(0);
+                }
             }
             result.add(neighbourhoodNumberAndAddFlag);
         }