|
@@ -599,7 +599,6 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
599
|
599
|
|
600
|
600
|
for (TpBuildingOwnerInfo tpBuildingOwnerInfo : list){
|
601
|
601
|
//插入期/区数据
|
602
|
|
- if (!tpBuildingOwnerInfo.getPhaseName().equals(lastPhaseName)){
|
603
|
602
|
TpPhase tpPhase = new TpPhase();
|
604
|
603
|
tpPhase.setName(tpBuildingOwnerInfo.getPhaseName());
|
605
|
604
|
tpPhase.setCommunityId(communityId);
|
|
@@ -608,11 +607,11 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
608
|
607
|
QueryWrapper<TpPhase> phaseQueryWrapper = new QueryWrapper<>();
|
609
|
608
|
phaseQueryWrapper.eq("community_id", communityId);
|
610
|
609
|
phaseQueryWrapper.eq("`NAME`", tpBuildingOwnerInfo.getPhaseName());
|
611
|
|
- TpPhase selectOne = tpPhaseMapper.selectOne(phaseQueryWrapper);
|
|
610
|
+ TpPhase selectPhase = tpPhaseMapper.selectOne(phaseQueryWrapper);
|
612
|
611
|
// 判断是否存在库里
|
613
|
|
- if (null != selectOne) {
|
614
|
|
- lastPhaseName = selectOne.getName();
|
615
|
|
- lastPhaseId = selectOne.getId();
|
|
612
|
+ if (null != selectPhase) {
|
|
613
|
+ lastPhaseName = selectPhase.getName();
|
|
614
|
+ lastPhaseId = selectPhase.getId();
|
616
|
615
|
} else {
|
617
|
616
|
tpPhaseMapper.insert(tpPhase);
|
618
|
617
|
//重置Last
|
|
@@ -623,9 +622,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
623
|
622
|
lastRoomNoName = "";
|
624
|
623
|
lastPhaseId = tpPhase.getId();
|
625
|
624
|
}
|
626
|
|
- }
|
627
|
625
|
//插入楼栋数据
|
628
|
|
- if (!tpBuildingOwnerInfo.getBuildingName().equals(lastBuildingName)){
|
629
|
626
|
TpBuilding tpBuilding = new TpBuilding();
|
630
|
627
|
tpBuilding.setCommunityId(communityId);
|
631
|
628
|
tpBuilding.setPhaseId(lastPhaseId);
|
|
@@ -637,18 +634,17 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
637
|
634
|
buildingQueryWrapper.eq("community_id", communityId);
|
638
|
635
|
buildingQueryWrapper.eq("phase_id", lastPhaseId);
|
639
|
636
|
buildingQueryWrapper.eq("`name`", tpBuildingOwnerInfo.getBuildingName());
|
640
|
|
- TpBuilding selectOne = tpBuildingMapper.selectOne(buildingQueryWrapper);
|
641
|
|
- if (null != selectOne) {
|
642
|
|
- lastBuildingName = selectOne.getName();
|
643
|
|
- lastBuildingId = selectOne.getId();
|
|
637
|
+ TpBuilding selectBuilding = tpBuildingMapper.selectOne(buildingQueryWrapper);
|
|
638
|
+ if (null != selectBuilding) {
|
|
639
|
+ lastBuildingName = selectBuilding.getName();
|
|
640
|
+ lastBuildingId = selectBuilding.getId();
|
644
|
641
|
} else {
|
645
|
642
|
tpBuildingMapper.insert(tpBuilding);
|
646
|
643
|
lastBuildingName = tpBuildingOwnerInfo.getBuildingName();
|
647
|
644
|
lastBuildingId = tpBuilding.getId();
|
648
|
645
|
}
|
649
|
|
- }
|
|
646
|
+
|
650
|
647
|
//插入单元信息
|
651
|
|
- if (!tpBuildingOwnerInfo.getUnitName().equals(lastUnitName)){
|
652
|
648
|
TpUnit tpUnit = new TpUnit();
|
653
|
649
|
tpUnit.setCommunityId(communityId);
|
654
|
650
|
tpUnit.setPhaseId(lastPhaseId);
|
|
@@ -663,19 +659,19 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
663
|
659
|
unitQueryWrapper.eq("phase_id", lastPhaseId);
|
664
|
660
|
unitQueryWrapper.eq("building_id", lastBuildingId);
|
665
|
661
|
unitQueryWrapper.eq("`name`",tpBuildingOwnerInfo.getUnitName());
|
666
|
|
- TpUnit selectOne = tpUnitMapper.selectOne(unitQueryWrapper);
|
|
662
|
+ TpUnit selectUnit = tpUnitMapper.selectOne(unitQueryWrapper);
|
667
|
663
|
// 校验是否存在库里
|
668
|
|
- if (null != selectOne) {
|
669
|
|
- lastUnitName = selectOne.getName();
|
670
|
|
- lastUnitId = selectOne.getId();
|
|
664
|
+ if (null != selectUnit) {
|
|
665
|
+ lastUnitName = selectUnit.getName();
|
|
666
|
+ lastUnitId = selectUnit.getId();
|
671
|
667
|
} else {
|
672
|
668
|
tpUnitMapper.insert(tpUnit);
|
673
|
669
|
lastUnitName = tpBuildingOwnerInfo.getUnitName();
|
674
|
670
|
lastUnitId = tpUnit.getId();
|
675
|
671
|
}
|
676
|
|
- }
|
|
672
|
+
|
677
|
673
|
//插入楼层信息
|
678
|
|
- if (!tpBuildingOwnerInfo.getLevelName().equals(lastLevelName)){
|
|
674
|
+
|
679
|
675
|
TpLevel tpLevel = new TpLevel();
|
680
|
676
|
tpLevel.setCommunityId(communityId);
|
681
|
677
|
tpLevel.setPhaseId(lastPhaseId);
|
|
@@ -693,19 +689,18 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
693
|
689
|
levelQueryWrapper.eq("building_id", lastBuildingId);
|
694
|
690
|
levelQueryWrapper.eq("unit_id", lastUnitId);
|
695
|
691
|
levelQueryWrapper.eq("`name`", tpBuildingOwnerInfo.getLevelName());
|
696
|
|
- TpLevel selectOne = tpLevelMapper.selectOne(levelQueryWrapper);
|
|
692
|
+ TpLevel selectLevel = tpLevelMapper.selectOne(levelQueryWrapper);
|
697
|
693
|
// 校验是否存在库里
|
698
|
|
- if (null != selectOne) {
|
699
|
|
- lastLevelName = selectOne.getName();
|
700
|
|
- lastLevelId = selectOne.getId();
|
|
694
|
+ if (null != selectLevel) {
|
|
695
|
+ lastLevelName = selectLevel.getName();
|
|
696
|
+ lastLevelId = selectLevel.getId();
|
701
|
697
|
} else {
|
702
|
698
|
tpLevelMapper.insert(tpLevel);
|
703
|
699
|
lastLevelName = tpBuildingOwnerInfo.getLevelName();
|
704
|
700
|
lastLevelId = tpLevel.getId();
|
705
|
701
|
}
|
706
|
|
- }
|
|
702
|
+
|
707
|
703
|
//插入房间号信息
|
708
|
|
- if (!tpBuildingOwnerInfo.getRoomNoName().equals(lastRoomNoName)){
|
709
|
704
|
TpRoomNo tpRoomNo = new TpRoomNo();
|
710
|
705
|
tpRoomNo.setCommunityId(communityId);
|
711
|
706
|
tpRoomNo.setPhaseId(lastPhaseId);
|
|
@@ -726,11 +721,11 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
726
|
721
|
roomNoQueryWrapper.eq("unit_id", lastUnitId);
|
727
|
722
|
roomNoQueryWrapper.eq("level_id", lastLevelId);
|
728
|
723
|
roomNoQueryWrapper.eq("`name`", tpBuildingOwnerInfo.getRoomNoName());
|
729
|
|
- TpRoomNo selectOne = tpRoomNoMapper.selectOne(roomNoQueryWrapper);
|
730
|
|
- if (null == selectOne) {
|
|
724
|
+ TpRoomNo selectRoomNo = tpRoomNoMapper.selectOne(roomNoQueryWrapper);
|
|
725
|
+ if (null == selectRoomNo) {
|
731
|
726
|
tpRoomNoMapper.insert(tpRoomNo);
|
732
|
727
|
}
|
733
|
|
- }
|
|
728
|
+
|
734
|
729
|
}
|
735
|
730
|
}
|
736
|
731
|
//删除当前节点判断是否有审核通过的
|