Explorar el Código

房间号单独拉出一张表

傅行帆 hace 6 años
padre
commit
4ff95866ac

+ 18
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpRoomNoMapper.java Ver fichero

@@ -0,0 +1,18 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.community.huiju.model.TpRoomNo;
5
+import org.apache.ibatis.annotations.Mapper;
6
+
7
+/**
8
+ * <p>
9
+ * 户号信息表 Mapper 接口
10
+ * </p>
11
+ *
12
+ * @author jobob
13
+ * @since 2019-04-09
14
+ */
15
+@Mapper
16
+public interface TpRoomNoMapper extends BaseMapper<TpRoomNo> {
17
+
18
+}

+ 6
- 10
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpBuildingOwnerInfo.java Ver fichero

@@ -86,7 +86,12 @@ public class TpBuildingOwnerInfo implements Serializable {
86 86
     /**
87 87
      * 户号
88 88
      */
89
-    private String name;
89
+    private String roomNoId;
90
+    
91
+    /**
92
+     * 户号
93
+     */
94
+    private String roomNoName;
90 95
     
91 96
     /**
92 97
      * 业主姓名
@@ -132,16 +137,7 @@ public class TpBuildingOwnerInfo implements Serializable {
132 137
      * 更新时间
133 138
      */
134 139
     private LocalDateTime updateDate;
135
-
136
-    /**
137
-     * 户号树信息
138
-     */
139
-    private Integer treeStatus;
140 140
     
141
-    /**
142
-     * 1代表的是资料库信息
143
-     */
144
-    private String ownerStatus;
145 141
     /**
146 142
      * 身份
147 143
      */

+ 93
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpRoomNo.java Ver fichero

@@ -0,0 +1,93 @@
1
+package com.community.huiju.model;
2
+
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
5
+import com.baomidou.mybatisplus.annotation.TableName;
6
+import lombok.Data;
7
+import lombok.EqualsAndHashCode;
8
+import lombok.experimental.Accessors;
9
+
10
+import java.io.Serializable;
11
+import java.time.LocalDateTime;
12
+
13
+/**
14
+ * <p>
15
+ * 户号信息表
16
+ * </p>
17
+ *
18
+ * @author jobob
19
+ * @since 2019-04-09
20
+ */
21
+@Data
22
+@EqualsAndHashCode(callSuper = false)
23
+@Accessors(chain = true)
24
+@TableName("tp_room_no")
25
+public class TpRoomNo implements Serializable {
26
+
27
+    private static final long serialVersionUID = 1L;
28
+    
29
+    @TableId(value = "id", type = IdType.AUTO)
30
+    private Integer id;
31
+    
32
+    /**
33
+     * 小区id
34
+     */
35
+    private Integer communityId;
36
+
37
+    /**
38
+     * 期区ID
39
+     */
40
+    private Integer phaseId;
41
+
42
+    /**
43
+     * 期区名称
44
+     */
45
+    private String phaseName;
46
+
47
+    /**
48
+     * 楼栋ID
49
+     */
50
+    private Integer buildingId;
51
+
52
+    /**
53
+     * 楼栋姓名
54
+     */
55
+    private String buildingName;
56
+
57
+    /**
58
+     * 单元ID
59
+     */
60
+    private Integer unitId;
61
+
62
+    /**
63
+     * 单元名称
64
+     */
65
+    private String unitName;
66
+
67
+    /**
68
+     * 楼层ID
69
+     */
70
+    private Integer levelId;
71
+
72
+    /**
73
+     * 楼层名字
74
+     */
75
+    private String levelName;
76
+
77
+    /**
78
+     * 户号
79
+     */
80
+    private String name;
81
+
82
+    /**
83
+     * 排序
84
+     */
85
+    private String sort;
86
+
87
+    /**
88
+     * 创建时间
89
+     */
90
+    private LocalDateTime createDate;
91
+
92
+
93
+}

+ 1
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillServiceImpl.java Ver fichero

@@ -653,7 +653,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
653 653
                 cell = row.createCell(3);
654 654
                 cell.setCellValue(buildingOwnerInfo.getLevelName());
655 655
                 cell = row.createCell(4);
656
-                cell.setCellValue(buildingOwnerInfo.getName());
656
+                cell.setCellValue(buildingOwnerInfo.getRoomNoName());
657 657
                 cell = row.createCell(5);
658 658
                 cell.setCellValue(buildingOwnerInfo.getOwnerName());
659 659
                 currentRow ++;

+ 5
- 6
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoServiceImpl.java Ver fichero

@@ -475,7 +475,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
475 475
         taUserVerify.setLevelId(tpBuildingOwnerInfo.getLevelId());
476 476
         taUserVerify.setLevelName(tpBuildingOwnerInfo.getLevelName());
477 477
         taUserVerify.setRoomNoId(tpBuildingOwnerInfo.getId());
478
-        taUserVerify.setRoomNoName(tpBuildingOwnerInfo.getName());
478
+        taUserVerify.setRoomNoName(tpBuildingOwnerInfo.getRoomNoName());
479 479
         taUserVerify.setVerifyStatus("1");
480 480
         taUserVerify.setCreateDate(LocalDateTime.now());
481 481
         taUserVerify.setVerifyName(userElement.getUserName());
@@ -605,7 +605,6 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
605 605
                 checkOwnerInfo.setRoleName(ownerRole);
606 606
                 checkOwnerInfo.setOwnerName(ownerName);
607 607
                 checkOwnerInfo.setOwnerTel(ownerTel);
608
-                checkOwnerInfo.setOwnerStatus("1");
609 608
                 list.add(checkOwnerInfo);
610 609
             }
611 610
         }
@@ -653,8 +652,8 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
653 652
             if (null!=e.getLevelName()&&!"".equals(e.getLevelName())&&isNumeric(e.getLevelName())){
654 653
                 e.setLevelName(e.getLevelName()+"层");
655 654
             }
656
-            if (null!=e.getName()&&!"".equals(e.getName())&&isNumeric(e.getName())){
657
-                e.setName(e.getName()+"户");
655
+            if (null!=e.getRoomNoName()&&!"".equals(e.getRoomNoName())&&isNumeric(e.getRoomNoName())){
656
+                e.setRoomNoName(e.getRoomNoName()+"户");
658 657
             }
659 658
             if (null!=e.getPhaseName()&&!"".equals(e.getPhaseName())&&isNumeric(e.getPhaseName())){
660 659
                 e.setPhaseName(e.getPhaseName()+"期");
@@ -817,7 +816,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
817 816
         // 楼层
818 817
         queryWrapper.eq("level", tpBuildingOwnerInfo.getLevelName());
819 818
         // 房号
820
-        queryWrapper.eq("room_no", tpBuildingOwnerInfo.getName());
819
+        queryWrapper.eq("room_no", tpBuildingOwnerInfo.getRoomNoName());
821 820
         TpBuildingOwnerInfo selectBuild = tpBuildingOwnerInfoMapper.selectOne(queryWrapper);
822 821
 
823 822
         return selectBuild;
@@ -876,7 +875,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
876 875
                         buildingOwnerInfo.getBuildingName() +
877 876
                         buildingOwnerInfo.getUnitName() +
878 877
                         buildingOwnerInfo.getLevelName() +
879
-                        buildingOwnerInfo.getName();
878
+                        buildingOwnerInfo.getRoleName();
880 879
 
881 880
                 cell = row.createCell(0);
882 881
                 cell.setCellValue(address);

+ 27
- 24
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingTreeServiceImpl.java Ver fichero

@@ -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
 	}

+ 1
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpActivitySignUpServiceImpl.java Ver fichero

@@ -87,7 +87,7 @@ public class TpActivitySignUpServiceImpl extends ServiceImpl<TpActivitySignUpMap
87 87
             activitySignUpVO.setPhone(taUser.getLoginName());
88 88
             activitySignUpVO.setRoleName(taSysRole.getRoleName());
89 89
             activitySignUpVO.setAddress(tpBuildingOwnerInfo.getPhaseName() + tpBuildingOwnerInfo.getBuildingName()
90
-                    + tpBuildingOwnerInfo.getUnitName() + tpBuildingOwnerInfo.getLevelName() + tpBuildingOwnerInfo.getName());
90
+                    + tpBuildingOwnerInfo.getUnitName() + tpBuildingOwnerInfo.getLevelName() + tpBuildingOwnerInfo.getRoomNoName());
91 91
 
92 92
             return activitySignUpVO;
93 93
         }).collect(Collectors.toList());

+ 5
- 0
CODE/smart-community/property-api/src/main/resources/mapper/TpRoomNoMapper.xml Ver fichero

@@ -0,0 +1,5 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.community.huiju.dao.TpRoomNoMapper">
4
+
5
+</mapper>

+ 1242
- 984
文档/MYSQL/smartCommunity.pdb
La diferencia del archivo ha sido suprimido porque es demasiado grande
Ver fichero


+ 1238
- 980
文档/MYSQL/smartCommunity.pdm
La diferencia del archivo ha sido suprimido porque es demasiado grande
Ver fichero