|
@@ -7,8 +7,24 @@ import com.community.commom.constant.Constant;
|
7
|
7
|
import com.community.commom.mode.ResponseBean;
|
8
|
8
|
import com.community.commom.session.UserElement;
|
9
|
9
|
import com.community.commom.utils.AccountValidatorUtil;
|
|
10
|
+
|
|
11
|
+import com.community.huiju.dao.TpBuildingMapper;
|
|
12
|
+import com.community.huiju.dao.TpBuildingOwnerInfoMapper;
|
|
13
|
+import com.community.huiju.dao.TpLevelMapper;
|
|
14
|
+import com.community.huiju.dao.TpPhaseMapper;
|
|
15
|
+import com.community.huiju.dao.TpRoomNoMapper;
|
|
16
|
+import com.community.huiju.dao.TpUnitMapper;
|
|
17
|
+import com.community.huiju.model.TaUser;
|
|
18
|
+import com.community.huiju.model.TpBuilding;
|
|
19
|
+import com.community.huiju.model.TpBuildingOwnerInfo;
|
|
20
|
+import com.community.huiju.model.TpLevel;
|
|
21
|
+import com.community.huiju.model.TpPhase;
|
|
22
|
+import com.community.huiju.model.TpRoomNo;
|
|
23
|
+import com.community.huiju.model.TpUnit;
|
|
24
|
+
|
10
|
25
|
import com.community.huiju.dao.*;
|
11
|
26
|
import com.community.huiju.model.*;
|
|
27
|
+
|
12
|
28
|
import com.community.huiju.service.BuildingTreeServiceI;
|
13
|
29
|
import jdk.nashorn.internal.ir.IfNode;
|
14
|
30
|
import org.apache.ibatis.annotations.Mapper;
|
|
@@ -51,7 +67,8 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
51
|
67
|
private TpLevelMapper tpLevelMapper;
|
52
|
68
|
|
53
|
69
|
@Autowired
|
54
|
|
- private TpBuildingOwnerInfoMapper tpBuildingOwnerInfoMapper;
|
|
70
|
+ private TpRoomNoMapper tpRoomNoMapper;
|
|
71
|
+
|
55
|
72
|
@Autowired
|
56
|
73
|
private TaUserVerifyMapper taUserVerifyMapper;
|
57
|
74
|
|
|
@@ -139,7 +156,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
139
|
156
|
tpBuildingOwnerInfo.setBuildingName(building);
|
140
|
157
|
tpBuildingOwnerInfo.setUnitName(unit);
|
141
|
158
|
tpBuildingOwnerInfo.setLevelName(level);
|
142
|
|
- tpBuildingOwnerInfo.setName(roomNo);
|
|
159
|
+ tpBuildingOwnerInfo.setRoomNoName(roomNo);
|
143
|
160
|
list.add(tpBuildingOwnerInfo);
|
144
|
161
|
}
|
145
|
162
|
}
|
|
@@ -244,11 +261,11 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
244
|
261
|
resultList.add(map);
|
245
|
262
|
});
|
246
|
263
|
}else if (treeType.equals("roomNo")){
|
247
|
|
- QueryWrapper<TpBuildingOwnerInfo> queryWrapper = new QueryWrapper<>();
|
|
264
|
+ QueryWrapper<TpRoomNo> queryWrapper = new QueryWrapper<>();
|
248
|
265
|
queryWrapper.eq("community_id",communityId);
|
249
|
266
|
queryWrapper.eq("level_id",id);
|
250
|
267
|
queryWrapper.orderByAsc("create_date");
|
251
|
|
- List<TpBuildingOwnerInfo> list = tpBuildingOwnerInfoMapper.selectList(queryWrapper);
|
|
268
|
+ List<TpRoomNo> list = tpRoomNoMapper.selectList(queryWrapper);
|
252
|
269
|
list.stream().forEach(e -> {
|
253
|
270
|
Map<String,Object> map = new HashMap<>();
|
254
|
271
|
map.put("name",e.getName());
|
|
@@ -333,8 +350,8 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
333
|
350
|
//房间号
|
334
|
351
|
TpLevel selectTpLevel= tpLevelMapper.selectById(id);
|
335
|
352
|
if(type.equals("roomNo")){
|
336
|
|
- TpBuildingOwnerInfo tpBuildingOwnerInfo= new TpBuildingOwnerInfo();
|
337
|
|
- tpBuildingOwnerInfo.setCommunityId(selectTpLevel.getCommunityId())
|
|
353
|
+ TpRoomNo tpRoomNo= new TpRoomNo();
|
|
354
|
+ tpRoomNo.setCommunityId(selectTpLevel.getCommunityId())
|
338
|
355
|
.setPhaseId(selectTpLevel.getPhaseId())
|
339
|
356
|
.setPhaseName(selectTpLevel.getPhaseName())
|
340
|
357
|
.setBuildingId(selectTpLevel.getBuildingId())
|
|
@@ -344,11 +361,10 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
344
|
361
|
.setLevelId(selectTpLevel.getId())
|
345
|
362
|
.setLevelName(selectTpLevel.getName())
|
346
|
363
|
.setName(nodeNumber)
|
347
|
|
- .setTreeStatus(1)
|
348
|
364
|
.setCreateDate(LocalDateTime.now());
|
349
|
365
|
|
350
|
366
|
|
351
|
|
- tpBuildingOwnerInfoMapper.insert(tpBuildingOwnerInfo);
|
|
367
|
+ tpRoomNoMapper.insert(tpRoomNo);
|
352
|
368
|
}
|
353
|
369
|
responseBean.addSuccess("成功");
|
354
|
370
|
return responseBean;
|
|
@@ -369,18 +385,18 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
369
|
385
|
//审核是否通过
|
370
|
386
|
InfoPass(type,id);
|
371
|
387
|
if (type.equals("end")) {
|
372
|
|
- tpBuildingOwnerInfoMapper.deleteById(id);
|
|
388
|
+ tpRoomNoMapper.deleteById(id);
|
373
|
389
|
}
|
374
|
390
|
//删除楼层
|
375
|
391
|
if(type.equals("roomNo")){
|
376
|
392
|
TpLevel tpLevel= tpLevelMapper.selectById(id);
|
377
|
|
- QueryWrapper<TpBuildingOwnerInfo> Info = new QueryWrapper<>();
|
|
393
|
+ QueryWrapper<TpRoomNo> Info = new QueryWrapper<>();
|
378
|
394
|
Info.eq("community_id", tpLevel.getCommunityId());
|
379
|
395
|
Info.eq("phase_id", tpLevel.getPhaseId());
|
380
|
396
|
Info.eq("building_id",tpLevel.getBuildingId());
|
381
|
397
|
Info.eq("unit_id", tpLevel.getUnitId());
|
382
|
398
|
Info.eq("level_id", tpLevel.getId());
|
383
|
|
- tpBuildingOwnerInfoMapper.delete(Info);
|
|
399
|
+ tpRoomNoMapper.delete(Info);
|
384
|
400
|
tpLevelMapper.deleteById(id);
|
385
|
401
|
}
|
386
|
402
|
|
|
@@ -398,7 +414,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
398
|
414
|
Integer tpLevelID=null;
|
399
|
415
|
|
400
|
416
|
TpLevel levelevel = tpLevelMapper.selectOne(tpLevel);
|
401
|
|
- QueryWrapper<TpBuildingOwnerInfo> Info = new QueryWrapper<>();
|
|
417
|
+ QueryWrapper<TpRoomNo> Info = new QueryWrapper<>();
|
402
|
418
|
Info.eq("community_id", tpUnit.getCommunityId());
|
403
|
419
|
Info.eq("phase_id", tpUnit.getPhaseId());
|
404
|
420
|
Info.eq("building_id",tpUnit.getBuildingId());
|
|
@@ -408,7 +424,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
408
|
424
|
}
|
409
|
425
|
|
410
|
426
|
//先删除所有房间
|
411
|
|
- tpBuildingOwnerInfoMapper.delete(Info);
|
|
427
|
+ tpRoomNoMapper.delete(Info);
|
412
|
428
|
//再删除所有楼层
|
413
|
429
|
tpLevelMapper.delete(tpLevel);
|
414
|
430
|
//删除此单元
|
|
@@ -423,7 +439,17 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
423
|
439
|
tpUnit.eq("community_id", tpBuilding.getCommunityId());
|
424
|
440
|
tpUnit.eq("phase_id", tpBuilding.getPhaseId());
|
425
|
441
|
tpUnit.eq("building_id", tpBuilding.getId());
|
426
|
|
-
|
|
442
|
+
|
|
443
|
+ //删除单元-楼层-下的房间
|
|
444
|
+ TpLevel tpLevelToo= tpLevelMapper.selectById(id);
|
|
445
|
+ QueryWrapper<TpRoomNo> Info = new QueryWrapper<>();
|
|
446
|
+ Info.eq("community_id", tpLevelToo.getCommunityId());
|
|
447
|
+ Info.eq("phase_id", tpLevelToo.getPhaseId());
|
|
448
|
+ Info.eq("building_id",tpLevelToo.getBuildingId());
|
|
449
|
+ Info.eq("unit_id", tpLevelToo.getUnitId());
|
|
450
|
+ Info.eq("level_id", tpLevelToo.getId());
|
|
451
|
+ //先删除所有房间
|
|
452
|
+ tpRoomNoMapper.delete(Info);
|
427
|
453
|
//先查询楼层
|
428
|
454
|
TpUnit unit= tpUnitMapper.selectOne(tpUnit);
|
429
|
455
|
QueryWrapper<TpLevel> tpLevel = new QueryWrapper<>();
|
|
@@ -435,18 +461,19 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
435
|
461
|
}
|
436
|
462
|
//查询房间
|
437
|
463
|
List<TpLevel> levelList= tpLevelMapper.selectList(tpLevel);
|
438
|
|
- QueryWrapper<TpBuildingOwnerInfo> tpBuildingOwnerInfo = new QueryWrapper<>();
|
|
464
|
+ QueryWrapper<TpRoomNo> tpRoomNoQueryWrapper = new QueryWrapper<>();
|
439
|
465
|
if (null!=levelList) {
|
440
|
466
|
for (TpLevel level:levelList) {
|
441
|
|
- tpBuildingOwnerInfo.eq("phase_id", level.getPhaseId());
|
442
|
|
- tpBuildingOwnerInfo.eq("community_id", level.getCommunityId());
|
443
|
|
- tpBuildingOwnerInfo.eq("building_id", level.getBuildingId());
|
444
|
|
- tpBuildingOwnerInfo.eq("unit_id", level.getUnitId());
|
445
|
|
- tpBuildingOwnerInfo.eq("level_id", level.getId());
|
|
467
|
+ tpRoomNoQueryWrapper.eq("phase_id", level.getPhaseId());
|
|
468
|
+ tpRoomNoQueryWrapper.eq("community_id", level.getCommunityId());
|
|
469
|
+ tpRoomNoQueryWrapper.eq("building_id", level.getBuildingId());
|
|
470
|
+ tpRoomNoQueryWrapper.eq("unit_id", level.getUnitId());
|
|
471
|
+ tpRoomNoQueryWrapper.eq("level_id", level.getId());
|
446
|
472
|
//先删除所有房间
|
447
|
|
- tpBuildingOwnerInfoMapper.delete(tpBuildingOwnerInfo);
|
|
473
|
+ tpRoomNoMapper.delete(tpRoomNoQueryWrapper);
|
448
|
474
|
}
|
449
|
475
|
}
|
|
476
|
+
|
450
|
477
|
//再删除所有楼层
|
451
|
478
|
tpLevelMapper.delete(tpLevel);
|
452
|
479
|
//删除此单元
|
|
@@ -479,14 +506,14 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
479
|
506
|
//查询房间
|
480
|
507
|
TpLevel level= tpLevelMapper.selectOne(tpLevel);
|
481
|
508
|
if (null!=level) {
|
482
|
|
- QueryWrapper<TpBuildingOwnerInfo> tpBuildingOwnerInfo = new QueryWrapper<>();
|
483
|
|
- tpBuildingOwnerInfo.eq("phase_id", level.getPhaseId());
|
484
|
|
- tpBuildingOwnerInfo.eq("community_id", level.getCommunityId());
|
485
|
|
- tpBuildingOwnerInfo.eq("building_id", level.getBuildingId());
|
486
|
|
- tpBuildingOwnerInfo.eq("unit_id", level.getUnitId());
|
487
|
|
- tpBuildingOwnerInfo.eq("level_id", level.getId());
|
|
509
|
+ QueryWrapper<TpRoomNo> tpRoomNoQueryWrapper = new QueryWrapper<>();
|
|
510
|
+ tpRoomNoQueryWrapper.eq("phase_id", level.getPhaseId());
|
|
511
|
+ tpRoomNoQueryWrapper.eq("community_id", level.getCommunityId());
|
|
512
|
+ tpRoomNoQueryWrapper.eq("building_id", level.getBuildingId());
|
|
513
|
+ tpRoomNoQueryWrapper.eq("unit_id", level.getUnitId());
|
|
514
|
+ tpRoomNoQueryWrapper.eq("level_id", level.getId());
|
488
|
515
|
//先删除所有房间
|
489
|
|
- tpBuildingOwnerInfoMapper.delete(tpBuildingOwnerInfo);
|
|
516
|
+ tpRoomNoMapper.delete(tpRoomNoQueryWrapper);
|
490
|
517
|
}
|
491
|
518
|
//再删除所有楼层
|
492
|
519
|
tpLevelMapper.delete(tpLevel);
|
|
@@ -577,21 +604,20 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
577
|
604
|
lastLevelId = tpLevel.getId();
|
578
|
605
|
}
|
579
|
606
|
//插入房间号信息
|
580
|
|
- if (!tpBuildingOwnerInfo.getName().equals(lastRoomNoName)){
|
581
|
|
- TpBuildingOwnerInfo tpBuildingOwnerInfoNew = new TpBuildingOwnerInfo();
|
582
|
|
- tpBuildingOwnerInfoNew.setCommunityId(communityId);
|
583
|
|
- tpBuildingOwnerInfoNew.setPhaseId(lastPhaseId);
|
584
|
|
- tpBuildingOwnerInfoNew.setPhaseName(lastPhaseName);
|
585
|
|
- tpBuildingOwnerInfoNew.setBuildingId(lastBuildingId);
|
586
|
|
- tpBuildingOwnerInfoNew.setBuildingName(lastBuildingName);
|
587
|
|
- tpBuildingOwnerInfoNew.setUnitId(lastUnitId);
|
588
|
|
- tpBuildingOwnerInfoNew.setUnitName(lastUnitName);
|
589
|
|
- tpBuildingOwnerInfoNew.setLevelId(lastLevelId);
|
590
|
|
- tpBuildingOwnerInfoNew.setLevelName(lastLevelName);
|
591
|
|
- tpBuildingOwnerInfoNew.setName(tpBuildingOwnerInfo.getName());
|
592
|
|
- tpBuildingOwnerInfoNew.setCreateDate(LocalDateTime.now());
|
593
|
|
- tpBuildingOwnerInfoNew.setTreeStatus(1);
|
594
|
|
- tpBuildingOwnerInfoMapper.insert(tpBuildingOwnerInfoNew);
|
|
607
|
+ if (!tpBuildingOwnerInfo.getRoomNoName().equals(lastRoomNoName)){
|
|
608
|
+ TpRoomNo tpRoomNo = new TpRoomNo();
|
|
609
|
+ tpRoomNo.setCommunityId(communityId);
|
|
610
|
+ tpRoomNo.setPhaseId(lastPhaseId);
|
|
611
|
+ tpRoomNo.setPhaseName(lastPhaseName);
|
|
612
|
+ tpRoomNo.setBuildingId(lastBuildingId);
|
|
613
|
+ tpRoomNo.setBuildingName(lastBuildingName);
|
|
614
|
+ tpRoomNo.setUnitId(lastUnitId);
|
|
615
|
+ tpRoomNo.setUnitName(lastUnitName);
|
|
616
|
+ tpRoomNo.setLevelId(lastLevelId);
|
|
617
|
+ tpRoomNo.setLevelName(lastLevelName);
|
|
618
|
+ tpRoomNo.setName(tpBuildingOwnerInfo.getRoomNoName());
|
|
619
|
+ tpRoomNo.setCreateDate(LocalDateTime.now());
|
|
620
|
+ tpRoomNoMapper.insert(tpRoomNo);
|
595
|
621
|
}
|
596
|
622
|
}
|
597
|
623
|
}
|
|
@@ -600,7 +626,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
600
|
626
|
ResponseBean responseBean = new ResponseBean();
|
601
|
627
|
if (type.equals("end")) {
|
602
|
628
|
//判断书否有已审核人员
|
603
|
|
- TpBuildingOwnerInfo info = tpBuildingOwnerInfoMapper.selectById(id);
|
|
629
|
+ TpRoomNo info = tpRoomNoMapper.selectById(id);
|
604
|
630
|
QueryWrapper<TaUserVerify> taUserVerify = new QueryWrapper<>();
|
605
|
631
|
taUserVerify.eq("community_id", info.getCommunityId())
|
606
|
632
|
.eq("phase_id", info.getPhaseId())
|