|
@@ -11,12 +11,14 @@ import com.community.huiju.dao.TpBuildingMapper;
|
11
|
11
|
import com.community.huiju.dao.TpBuildingOwnerInfoMapper;
|
12
|
12
|
import com.community.huiju.dao.TpLevelMapper;
|
13
|
13
|
import com.community.huiju.dao.TpPhaseMapper;
|
|
14
|
+import com.community.huiju.dao.TpRoomNoMapper;
|
14
|
15
|
import com.community.huiju.dao.TpUnitMapper;
|
15
|
16
|
import com.community.huiju.model.TaUser;
|
16
|
17
|
import com.community.huiju.model.TpBuilding;
|
17
|
18
|
import com.community.huiju.model.TpBuildingOwnerInfo;
|
18
|
19
|
import com.community.huiju.model.TpLevel;
|
19
|
20
|
import com.community.huiju.model.TpPhase;
|
|
21
|
+import com.community.huiju.model.TpRoomNo;
|
20
|
22
|
import com.community.huiju.model.TpUnit;
|
21
|
23
|
import com.community.huiju.service.BuildingTreeServiceI;
|
22
|
24
|
import org.apache.ibatis.annotations.Mapper;
|
|
@@ -58,6 +60,9 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
58
|
60
|
@Autowired
|
59
|
61
|
private TpLevelMapper tpLevelMapper;
|
60
|
62
|
|
|
63
|
+ @Autowired
|
|
64
|
+ private TpRoomNoMapper tpRoomNoMapper;
|
|
65
|
+
|
61
|
66
|
@Autowired
|
62
|
67
|
private TpBuildingOwnerInfoMapper tpBuildingOwnerInfoMapper;
|
63
|
68
|
|
|
@@ -145,7 +150,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
145
|
150
|
tpBuildingOwnerInfo.setBuildingName(building);
|
146
|
151
|
tpBuildingOwnerInfo.setUnitName(unit);
|
147
|
152
|
tpBuildingOwnerInfo.setLevelName(level);
|
148
|
|
- tpBuildingOwnerInfo.setName(roomNo);
|
|
153
|
+ tpBuildingOwnerInfo.setRoomNoName(roomNo);
|
149
|
154
|
list.add(tpBuildingOwnerInfo);
|
150
|
155
|
}
|
151
|
156
|
}
|
|
@@ -250,11 +255,11 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
250
|
255
|
resultList.add(map);
|
251
|
256
|
});
|
252
|
257
|
}else if (treeType.equals("roomNo")){
|
253
|
|
- QueryWrapper<TpBuildingOwnerInfo> queryWrapper = new QueryWrapper<>();
|
|
258
|
+ QueryWrapper<TpRoomNo> queryWrapper = new QueryWrapper<>();
|
254
|
259
|
queryWrapper.eq("community_id",communityId);
|
255
|
260
|
queryWrapper.eq("level_id",id);
|
256
|
261
|
queryWrapper.orderByAsc("create_date");
|
257
|
|
- List<TpBuildingOwnerInfo> list = tpBuildingOwnerInfoMapper.selectList(queryWrapper);
|
|
262
|
+ List<TpRoomNo> list = tpRoomNoMapper.selectList(queryWrapper);
|
258
|
263
|
list.stream().forEach(e -> {
|
259
|
264
|
Map<String,Object> map = new HashMap<>();
|
260
|
265
|
map.put("name",e.getName());
|
|
@@ -339,8 +344,8 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
339
|
344
|
//房间号
|
340
|
345
|
TpLevel selectTpLevel= tpLevelMapper.selectById(id);
|
341
|
346
|
if(type.equals("roomNo")){
|
342
|
|
- TpBuildingOwnerInfo tpBuildingOwnerInfo= new TpBuildingOwnerInfo();
|
343
|
|
- tpBuildingOwnerInfo.setCommunityId(selectTpLevel.getCommunityId())
|
|
347
|
+ TpRoomNo tpRoomNo= new TpRoomNo();
|
|
348
|
+ tpRoomNo.setCommunityId(selectTpLevel.getCommunityId())
|
344
|
349
|
.setPhaseId(selectTpLevel.getPhaseId())
|
345
|
350
|
.setPhaseName(selectTpLevel.getPhaseName())
|
346
|
351
|
.setBuildingId(selectTpLevel.getBuildingId())
|
|
@@ -350,11 +355,10 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
350
|
355
|
.setLevelId(selectTpLevel.getId())
|
351
|
356
|
.setLevelName(selectTpLevel.getName())
|
352
|
357
|
.setName(nodeNumber)
|
353
|
|
- .setTreeStatus(1)
|
354
|
358
|
.setCreateDate(LocalDateTime.now());
|
355
|
359
|
|
356
|
360
|
|
357
|
|
- tpBuildingOwnerInfoMapper.insert(tpBuildingOwnerInfo);
|
|
361
|
+ tpRoomNoMapper.insert(tpRoomNo);
|
358
|
362
|
}
|
359
|
363
|
responseBean.addSuccess("成功");
|
360
|
364
|
return null;
|
|
@@ -438,14 +442,14 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
438
|
442
|
|
439
|
443
|
//删除单元-楼层-下的房间
|
440
|
444
|
TpLevel tpLevelToo= tpLevelMapper.selectById(id);
|
441
|
|
- QueryWrapper<TpBuildingOwnerInfo> Info = new QueryWrapper<>();
|
|
445
|
+ QueryWrapper<TpRoomNo> Info = new QueryWrapper<>();
|
442
|
446
|
Info.eq("community_id", tpLevelToo.getCommunityId());
|
443
|
447
|
Info.eq("phase_id", tpLevelToo.getPhaseId());
|
444
|
448
|
Info.eq("building_id",tpLevelToo.getBuildingId());
|
445
|
449
|
Info.eq("unit_id", tpLevelToo.getUnitId());
|
446
|
450
|
Info.eq("level_id", tpLevelToo.getId());
|
447
|
451
|
//先删除所有房间
|
448
|
|
- tpBuildingOwnerInfoMapper.delete(Info);
|
|
452
|
+ tpRoomNoMapper.delete(Info);
|
449
|
453
|
//再删除所有楼层
|
450
|
454
|
tpLevelMapper.delete(tpLevel);
|
451
|
455
|
//删除此单元
|
|
@@ -544,21 +548,20 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
|
544
|
548
|
lastLevelId = tpLevel.getId();
|
545
|
549
|
}
|
546
|
550
|
//插入房间号信息
|
547
|
|
- if (!tpBuildingOwnerInfo.getName().equals(lastRoomNoName)){
|
548
|
|
- TpBuildingOwnerInfo tpBuildingOwnerInfoNew = new TpBuildingOwnerInfo();
|
549
|
|
- tpBuildingOwnerInfoNew.setCommunityId(communityId);
|
550
|
|
- tpBuildingOwnerInfoNew.setPhaseId(lastPhaseId);
|
551
|
|
- tpBuildingOwnerInfoNew.setPhaseName(lastPhaseName);
|
552
|
|
- tpBuildingOwnerInfoNew.setBuildingId(lastBuildingId);
|
553
|
|
- tpBuildingOwnerInfoNew.setBuildingName(lastBuildingName);
|
554
|
|
- tpBuildingOwnerInfoNew.setUnitId(lastUnitId);
|
555
|
|
- tpBuildingOwnerInfoNew.setUnitName(lastUnitName);
|
556
|
|
- tpBuildingOwnerInfoNew.setLevelId(lastLevelId);
|
557
|
|
- tpBuildingOwnerInfoNew.setLevelName(lastLevelName);
|
558
|
|
- tpBuildingOwnerInfoNew.setName(tpBuildingOwnerInfo.getName());
|
559
|
|
- tpBuildingOwnerInfoNew.setCreateDate(LocalDateTime.now());
|
560
|
|
- tpBuildingOwnerInfoNew.setTreeStatus(1);
|
561
|
|
- tpBuildingOwnerInfoMapper.insert(tpBuildingOwnerInfoNew);
|
|
551
|
+ if (!tpBuildingOwnerInfo.getRoomNoName().equals(lastRoomNoName)){
|
|
552
|
+ TpRoomNo tpRoomNo = new TpRoomNo();
|
|
553
|
+ tpRoomNo.setCommunityId(communityId);
|
|
554
|
+ tpRoomNo.setPhaseId(lastPhaseId);
|
|
555
|
+ tpRoomNo.setPhaseName(lastPhaseName);
|
|
556
|
+ tpRoomNo.setBuildingId(lastBuildingId);
|
|
557
|
+ tpRoomNo.setBuildingName(lastBuildingName);
|
|
558
|
+ tpRoomNo.setUnitId(lastUnitId);
|
|
559
|
+ tpRoomNo.setUnitName(lastUnitName);
|
|
560
|
+ tpRoomNo.setLevelId(lastLevelId);
|
|
561
|
+ tpRoomNo.setLevelName(lastLevelName);
|
|
562
|
+ tpRoomNo.setName(tpBuildingOwnerInfo.getRoomNoName());
|
|
563
|
+ tpRoomNo.setCreateDate(LocalDateTime.now());
|
|
564
|
+ tpRoomNoMapper.insert(tpRoomNo);
|
562
|
565
|
}
|
563
|
566
|
}
|
564
|
567
|
}
|