傅行帆 6 years ago
parent
commit
19a875256d

+ 6
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpBuilding.java View File

@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
7 7
 import lombok.experimental.Accessors;
8 8
 
9 9
 import java.io.Serializable;
10
+import java.time.LocalDateTime;
10 11
 import java.util.Date;
11 12
 @Data
12 13
 @EqualsAndHashCode(callSuper = false)
@@ -34,6 +35,9 @@ public class TpBuilding implements Serializable {
34 35
      * 楼栋名称
35 36
      */
36 37
     private String name;
37
-
38
-
38
+    
39
+    /**
40
+     * 创建时间
41
+     */
42
+    private LocalDateTime createDate;
39 43
 }

+ 6
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpLevel.java View File

@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
8 8
 import lombok.experimental.Accessors;
9 9
 
10 10
 import java.io.Serializable;
11
+import java.time.LocalDateTime;
11 12
 
12 13
 /**
13 14
  * <p>
@@ -67,6 +68,9 @@ public class TpLevel implements Serializable {
67 68
      * 楼层名称
68 69
      */
69 70
     private String name;
70
-
71
-
71
+    
72
+    /**
73
+     * 创建时间
74
+     */
75
+    private LocalDateTime createDate;
72 76
 }

+ 6
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpPhase.java View File

@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
8 8
 import lombok.experimental.Accessors;
9 9
 
10 10
 import java.io.Serializable;
11
+import java.time.LocalDateTime;
11 12
 
12 13
 /**
13 14
  * <p>
@@ -37,6 +38,9 @@ public class TpPhase implements Serializable {
37 38
      * 期区名称
38 39
      */
39 40
     private String name;
40
-
41
-
41
+    
42
+    /**
43
+     * 创建时间
44
+     */
45
+    private LocalDateTime createDate;
42 46
 }

+ 6
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpUnit.java View File

@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
8 8
 import lombok.experimental.Accessors;
9 9
 
10 10
 import java.io.Serializable;
11
+import java.time.LocalDateTime;
11 12
 
12 13
 /**
13 14
  * <p>
@@ -57,6 +58,9 @@ public class TpUnit implements Serializable {
57 58
      * 单元名称
58 59
      */
59 60
     private String name;
60
-
61
-
61
+    
62
+    /**
63
+     * 创建时间
64
+     */
65
+    private LocalDateTime createDate;
62 66
 }

+ 10
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingTreeServiceImpl.java View File

@@ -200,6 +200,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
200 200
 		if (treeType.equals("phase")){
201 201
 			QueryWrapper<TpPhase> queryWrapper = new QueryWrapper<>();
202 202
 			queryWrapper.eq("community_id",communityId);
203
+			queryWrapper.orderByAsc("create_date");
203 204
 			List<TpPhase> list = tpPhaseMapper.selectList(queryWrapper);
204 205
 			list.stream().forEach(e -> {
205 206
 				Map<String,Object> map = new HashMap<>();
@@ -212,6 +213,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
212 213
 			QueryWrapper<TpBuilding> queryWrapper = new QueryWrapper<>();
213 214
 			queryWrapper.eq("community_id",communityId);
214 215
 			queryWrapper.eq("phase_id",id);
216
+			queryWrapper.orderByAsc("create_date");
215 217
 			List<TpBuilding> list = tpBuildingMapper.selectList(queryWrapper);
216 218
 			list.stream().forEach(e -> {
217 219
 				Map<String,Object> map = new HashMap<>();
@@ -224,6 +226,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
224 226
 			QueryWrapper<TpUnit> queryWrapper = new QueryWrapper<>();
225 227
 			queryWrapper.eq("community_id",communityId);
226 228
 			queryWrapper.eq("building_id",id);
229
+			queryWrapper.orderByAsc("create_date");
227 230
 			List<TpUnit> list = tpUnitMapper.selectList(queryWrapper);
228 231
 			list.stream().forEach(e -> {
229 232
 				Map<String,Object> map = new HashMap<>();
@@ -236,6 +239,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
236 239
 			QueryWrapper<TpLevel> queryWrapper = new QueryWrapper<>();
237 240
 			queryWrapper.eq("community_id",communityId);
238 241
 			queryWrapper.eq("unit_id",id);
242
+			queryWrapper.orderByAsc("create_date");
239 243
 			List<TpLevel> list = tpLevelMapper.selectList(queryWrapper);
240 244
 			list.stream().forEach(e -> {
241 245
 				Map<String,Object> map = new HashMap<>();
@@ -248,6 +252,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
248 252
 			QueryWrapper<TpBuildingOwnerInfo> queryWrapper = new QueryWrapper<>();
249 253
 			queryWrapper.eq("community_id",communityId);
250 254
 			queryWrapper.eq("level_id",id);
255
+			queryWrapper.orderByAsc("create_date");
251 256
 			List<TpBuildingOwnerInfo> list = tpBuildingOwnerInfoMapper.selectList(queryWrapper);
252 257
 			list.stream().forEach(e -> {
253 258
 				Map<String,Object> map = new HashMap<>();
@@ -280,6 +285,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
280 285
 				TpPhase tpPhase = new TpPhase();
281 286
 				tpPhase.setName(tpBuildingOwnerInfo.getPhaseName());
282 287
 				tpPhase.setCommunityId(communityId);
288
+				tpPhase.setCreateDate(LocalDateTime.now());
283 289
 				tpPhaseMapper.insert(tpPhase);
284 290
 				//重置Last
285 291
 				lastPhaseName = tpBuildingOwnerInfo.getPhaseName();
@@ -296,6 +302,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
296 302
 				tpBuilding.setPhaseId(lastPhaseId);
297 303
 				tpBuilding.setPhaseName(lastPhaseName);
298 304
 				tpBuilding.setName(tpBuildingOwnerInfo.getBuildingName());
305
+				tpBuilding.setCreateDate(LocalDateTime.now());
299 306
 				tpBuildingMapper.insert(tpBuilding);
300 307
 				lastBuildingName = tpBuildingOwnerInfo.getBuildingName();
301 308
 				lastBuildingId = tpBuilding.getId();
@@ -309,6 +316,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
309 316
 				tpUnit.setBuildingId(lastBuildingId);
310 317
 				tpUnit.setBuildingName(lastBuildingName);
311 318
 				tpUnit.setName(tpBuildingOwnerInfo.getUnitName());
319
+				tpUnit.setCreateDate(LocalDateTime.now());
312 320
 				tpUnitMapper.insert(tpUnit);
313 321
 				lastUnitName = tpBuildingOwnerInfo.getUnitName();
314 322
 				lastUnitId = tpUnit.getId();
@@ -324,6 +332,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
324 332
 				tpLevel.setUnitId(lastUnitId);
325 333
 				tpLevel.setUnitName(lastUnitName);
326 334
 				tpLevel.setName(tpBuildingOwnerInfo.getLevelName());
335
+				tpLevel.setCreateDate(LocalDateTime.now());
327 336
 				tpLevelMapper.insert(tpLevel);
328 337
 				lastLevelName = tpBuildingOwnerInfo.getLevelName();
329 338
 				lastLevelId = tpLevel.getId();
@@ -341,6 +350,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
341 350
 				tpBuildingOwnerInfoNew.setLevelId(lastLevelId);
342 351
 				tpBuildingOwnerInfoNew.setLevelName(lastLevelName);
343 352
 				tpBuildingOwnerInfoNew.setName(tpBuildingOwnerInfo.getName());
353
+				tpBuildingOwnerInfoNew.setCreateDate(LocalDateTime.now());
344 354
 				tpBuildingOwnerInfoMapper.insert(tpBuildingOwnerInfoNew);
345 355
 			}
346 356
 		}