瀏覽代碼

优化格式化小区

shiyj1101 4 年之前
父節點
當前提交
b35b8f3028

+ 5 - 5
java110-db/src/main/resources/mapper/community/InitializeBuildingUnitDaoImplMapper.xml

@@ -6,7 +6,7 @@
 
     <!-- 初始化数据 add by wuxw 2018-07-03 -->
     <delete id="deleteBuildingUnit" parameterType="Map">
-         delete from building_unit t where 1=1
+        delete from building_unit t where 1=1
             and t.floor_id in
             <foreach collection="floorIds" item="item" open="(" close=")" separator=",">
                 #{item}
@@ -15,22 +15,22 @@
 
     <!-- 初始化数据 add by wuxw 2018-07-03 -->
     <delete id="deletefFloor" parameterType="Map">
-         delete from f_floor t where 1=1
+        delete from f_floor t where 1=1
             and t.community_id = #{communityId}
     </delete>
     <!-- 初始化数据 add by wuxw 2018-07-03 -->
     <delete id="deleteBuildingRoom" parameterType="Map">
-         delete from building_room t where 1=1
+        delete from building_room t where 1=1
             and t.community_id = #{communityId}
     </delete>
     <!-- 初始化数据 add by wuxw 2018-07-03 -->
     <delete id="deleteParkingArea" parameterType="Map">
-         delete from parking_area t where 1=1
+        delete from parking_area t where 1=1
             and t.community_id = #{communityId}
     </delete>
     <!-- 初始化数据 add by wuxw 2018-07-03 -->
     <delete id="deleteParkingSpace" parameterType="Map">
-         delete from parking_space t where 1=1
+        delete from parking_space t where 1=1
             and t.community_id = #{communityId}
     </delete>
 </mapper>

+ 7 - 5
service-community/src/main/java/com/java110/community/bmo/initializeBuildingUnit/impl/IinitializeBuildingUnitBmoImpl.java

@@ -70,20 +70,22 @@ public class IinitializeBuildingUnitBmoImpl implements IinitializeBuildingUnitBm
         floorDto.setCommunityId(communityId);
         List<FloorDto> floorDtos =  floorInnerServiceSMOImpl.queryFloors(floorDto);
         List floors = new ArrayList();
+        int communitys = 0;
         if(null != floorDtos && floorDtos.size() > 0){
             for (FloorDto floorDtotmp: floorDtos){
                 floors.add(floorDtotmp.getFloorId());
             }
+            Map floorIds = new HashMap<String,String []>();
+            floorIds.put("floorIds",floors.toArray(new String[floors.size()]));
+            //单元
+            communitys = initializeBuildingUnitSMOImpl.deleteBuildingUnit(floorIds);
         }
-        Map floorIds = new HashMap<String,String []>();
-        floorIds.put("floorIds",floors.toArray(new String[floors.size()]));
-        //单元
-        int communitys = initializeBuildingUnitSMOImpl.deleteBuildingUnit(floorIds);
 
+        massage.append( "开始格式化小区数据:" );
         if(communitys > 0){
             massage.append("单元初始化成功【"+communitys+"】");
             Map communityIds = new HashMap<String,String []>();
-            floorIds.put("communityId",communityId);
+            communityIds.put("communityId",communityId);
             //楼栋
             int deleteFlag = initializeBuildingUnitSMOImpl.deletefFloor(communityIds);
             if(deleteFlag > 0){