dingxin 6 years ago
parent
commit
378057c6dd
17 changed files with 427 additions and 132 deletions
  1. 5
    5
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBuildingMapper.java
  2. 81
    32
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpBuildingOwnerInfo.java
  3. 10
    10
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/IBuildingOwnerInfo.java
  4. 4
    4
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoImpl.java
  5. 138
    63
      CODE/smart-community/app-api/src/main/resources/mapper/TpBuildingOwnerInfoMapper.xml
  6. 25
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/BuildingOwnerInfoController.java
  7. 6
    2
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpBuilding.java
  8. 6
    2
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpLevel.java
  9. 6
    2
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpPhase.java
  10. 6
    2
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TpUnit.java
  11. 7
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/IBuildingOwnerInfoService.java
  12. 89
    8
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoServiceImpl.java
  13. 10
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingTreeServiceImpl.java
  14. BIN
      CODE/smart-community/property-api/src/main/resources/业主资料库.xlsx
  15. 9
    0
      VUECODE/smart-property-manage/src/api/buildingOwnerInfo.js
  16. 10
    1
      VUECODE/smart-property-manage/src/store/modules/buildingOwnerInfo.js
  17. 15
    1
      VUECODE/smart-property-manage/src/views/building/batch/batchImport.vue

+ 5
- 5
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBuildingMapper.java View File

23
     /**
23
     /**
24
      * 根据 小区/期/栋/单元/楼层/户号 进行条件查询
24
      * 根据 小区/期/栋/单元/楼层/户号 进行条件查询
25
      * @param communityId
25
      * @param communityId
26
-     * @param phase
27
-     * @param building
28
-     * @param unit
29
-     * @param level
26
+     * @param phaseId
27
+     * @param buildingId
28
+     * @param unitId
29
+     * @param levelId
30
      * @param roomNo
30
      * @param roomNo
31
      * @return
31
      * @return
32
      */
32
      */
33
-    List<TpBuilding> selectByAddress(Integer communityId,String phase,String building, String unit,String level,String roomNo);
33
+    List<TpBuilding> selectByAddress(Integer communityId,Integer phaseId,Integer buildingId, Integer unitId,Integer levelId,String roomNo);
34
 
34
 
35
 
35
 
36
 }
36
 }

+ 81
- 32
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpBuildingOwnerInfo.java View File

9
 
9
 
10
     private String idCard;
10
     private String idCard;
11
 
11
 
12
-    // 期
13
-    private String phase;
12
+    private Integer phaseId;
14
 
13
 
15
-    private String building;
14
+    private String phaseName;
16
 
15
 
17
-    private String unit;
16
+    private Integer buildingId;
18
 
17
 
19
-    private String level;
18
+    private String buildingName;
20
 
19
 
21
-    private String roomNo;
20
+    private Integer unitId;
21
+
22
+    private String unitName;
23
+
24
+    private Integer levelId;
25
+
26
+    private String levelName;
27
+
28
+    private String name;
22
 
29
 
23
     private String ownerName;
30
     private String ownerName;
24
 
31
 
30
 
37
 
31
     private String verifyStatus;
38
     private String verifyStatus;
32
 
39
 
40
+    private String sort;
41
+
33
     private Integer createUser;
42
     private Integer createUser;
34
 
43
 
35
     private Date createDate;
44
     private Date createDate;
59
     }
68
     }
60
 
69
 
61
     public void setIdCard(String idCard) {
70
     public void setIdCard(String idCard) {
62
-        this.idCard = idCard == null ? null : idCard.trim();
71
+        this.idCard = idCard;
72
+    }
73
+
74
+    public Integer getPhaseId() {
75
+        return phaseId;
76
+    }
77
+
78
+    public void setPhaseId(Integer phaseId) {
79
+        this.phaseId = phaseId;
80
+    }
81
+
82
+    public String getPhaseName() {
83
+        return phaseName;
84
+    }
85
+
86
+    public void setPhaseName(String phaseName) {
87
+        this.phaseName = phaseName;
63
     }
88
     }
64
 
89
 
65
-    public String getPhase() {
66
-        return phase;
90
+    public Integer getBuildingId() {
91
+        return buildingId;
67
     }
92
     }
68
 
93
 
69
-    public void setPhase(String phase) {
70
-        this.phase = phase;
94
+    public void setBuildingId(Integer buildingId) {
95
+        this.buildingId = buildingId;
71
     }
96
     }
72
 
97
 
73
-    public String getBuilding() {
74
-        return building;
98
+    public String getBuildingName() {
99
+        return buildingName;
75
     }
100
     }
76
 
101
 
77
-    public void setBuilding(String building) {
78
-        this.building = building == null ? null : building.trim();
102
+    public void setBuildingName(String buildingName) {
103
+        this.buildingName = buildingName;
79
     }
104
     }
80
 
105
 
81
-    public String getUnit() {
82
-        return unit;
106
+    public Integer getUnitId() {
107
+        return unitId;
83
     }
108
     }
84
 
109
 
85
-    public void setUnit(String unit) {
86
-        this.unit = unit == null ? null : unit.trim();
110
+    public void setUnitId(Integer unitId) {
111
+        this.unitId = unitId;
87
     }
112
     }
88
 
113
 
89
-    public String getLevel() {
90
-        return level;
114
+    public String getUnitName() {
115
+        return unitName;
91
     }
116
     }
92
 
117
 
93
-    public void setLevel(String level) {
94
-        this.level = level == null ? null : level.trim();
118
+    public void setUnitName(String unitName) {
119
+        this.unitName = unitName;
95
     }
120
     }
96
 
121
 
97
-    public String getRoomNo() {
98
-        return roomNo;
122
+    public Integer getLevelId() {
123
+        return levelId;
99
     }
124
     }
100
 
125
 
101
-    public void setRoomNo(String roomNo) {
102
-        this.roomNo = roomNo == null ? null : roomNo.trim();
126
+    public void setLevelId(Integer levelId) {
127
+        this.levelId = levelId;
128
+    }
129
+
130
+    public String getLevelName() {
131
+        return levelName;
132
+    }
133
+
134
+    public void setLevelName(String levelName) {
135
+        this.levelName = levelName;
136
+    }
137
+
138
+    public String getName() {
139
+        return name;
140
+    }
141
+
142
+    public void setName(String name) {
143
+        this.name = name;
103
     }
144
     }
104
 
145
 
105
     public String getOwnerName() {
146
     public String getOwnerName() {
107
     }
148
     }
108
 
149
 
109
     public void setOwnerName(String ownerName) {
150
     public void setOwnerName(String ownerName) {
110
-        this.ownerName = ownerName == null ? null : ownerName.trim();
151
+        this.ownerName = ownerName;
111
     }
152
     }
112
 
153
 
113
     public String getOwnerTel() {
154
     public String getOwnerTel() {
115
     }
156
     }
116
 
157
 
117
     public void setOwnerTel(String ownerTel) {
158
     public void setOwnerTel(String ownerTel) {
118
-        this.ownerTel = ownerTel == null ? null : ownerTel.trim();
159
+        this.ownerTel = ownerTel;
119
     }
160
     }
120
 
161
 
121
     public String getGender() {
162
     public String getGender() {
123
     }
164
     }
124
 
165
 
125
     public void setGender(String gender) {
166
     public void setGender(String gender) {
126
-        this.gender = gender == null ? null : gender.trim();
167
+        this.gender = gender;
127
     }
168
     }
128
 
169
 
129
     public String getPairStatus() {
170
     public String getPairStatus() {
131
     }
172
     }
132
 
173
 
133
     public void setPairStatus(String pairStatus) {
174
     public void setPairStatus(String pairStatus) {
134
-        this.pairStatus = pairStatus == null ? null : pairStatus.trim();
175
+        this.pairStatus = pairStatus;
135
     }
176
     }
136
 
177
 
137
     public String getVerifyStatus() {
178
     public String getVerifyStatus() {
139
     }
180
     }
140
 
181
 
141
     public void setVerifyStatus(String verifyStatus) {
182
     public void setVerifyStatus(String verifyStatus) {
142
-        this.verifyStatus = verifyStatus == null ? null : verifyStatus.trim();
183
+        this.verifyStatus = verifyStatus;
184
+    }
185
+
186
+    public String getSort() {
187
+        return sort;
188
+    }
189
+
190
+    public void setSort(String sort) {
191
+        this.sort = sort;
143
     }
192
     }
144
 
193
 
145
     public Integer getCreateUser() {
194
     public Integer getCreateUser() {

+ 10
- 10
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/IBuildingOwnerInfo.java View File

15
     /**
15
     /**
16
      * 根据 小区/期/楼栋/单元/楼层/户号
16
      * 根据 小区/期/楼栋/单元/楼层/户号
17
      * @param communityId
17
      * @param communityId
18
-     * @param phase
19
-     * @param building
20
-     * @param unit
21
-     * @param level
18
+     * @param phaseId
19
+     * @param buildingId
20
+     * @param unitId
21
+     * @param levelId
22
      * @param roomNo
22
      * @param roomNo
23
      * @return
23
      * @return
24
      */
24
      */
25
-    ResponseBean selectBuildList(Integer communityId, String phase, String building, String unit, String level, String roomNo);
25
+    ResponseBean selectBuildList(Integer communityId, Integer phaseId, Integer buildingId, Integer unitId, Integer levelId, String roomNo);
26
 
26
 
27
     /**
27
     /**
28
      * 根据 小区/期/楼栋/单元/楼层/户号
28
      * 根据 小区/期/楼栋/单元/楼层/户号
29
-     * @param phase
30
-     * @param building
31
-     * @param unit
32
-     * @param level
29
+     * @param phaseId
30
+     * @param buildingId
31
+     * @param unitId
32
+     * @param levelId
33
      * @param roomNo
33
      * @param roomNo
34
      * @return
34
      * @return
35
      */
35
      */
36
-    ResponseBean hasBuild(UserElement userElement,String phase, String building, String unit, String level, String roomNo);
36
+    ResponseBean hasBuild(UserElement userElement,Integer phaseId, Integer buildingId, Integer unitId, Integer levelId, String roomNo);
37
 
37
 
38
 }
38
 }

+ 4
- 4
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoImpl.java View File

39
     private TaUserVerifyMapper taUserVerifyMapper;
39
     private TaUserVerifyMapper taUserVerifyMapper;
40
 
40
 
41
     @Override
41
     @Override
42
-    public ResponseBean selectBuildList(Integer communityId, String phase, String building, String unit, String level, String roomNo) {
42
+    public ResponseBean selectBuildList(Integer communityId, Integer phaseId, Integer buildingId, Integer unitId, Integer levelId, String roomNo) {
43
         ResponseBean responseBean = new ResponseBean();
43
         ResponseBean responseBean = new ResponseBean();
44
 
44
 
45
-        List<TpBuilding> buildingList = tpBuildingMapper.selectByAddress(communityId, phase, building, unit, level, roomNo);
45
+        List<TpBuilding> buildingList = tpBuildingMapper.selectByAddress(communityId, phaseId, buildingId, unitId, levelId, roomNo);
46
         responseBean.addSuccess(buildingList);
46
         responseBean.addSuccess(buildingList);
47
         return responseBean;
47
         return responseBean;
48
     }
48
     }
49
 
49
 
50
     @Override
50
     @Override
51
-    public ResponseBean hasBuild(UserElement userElement,  String phase, String building, String unit, String level, String roomNo) {
51
+    public ResponseBean hasBuild(UserElement userElement,  Integer phaseId, Integer buildingId, Integer unitId, Integer levelId, String roomNo) {
52
         ResponseBean responseBean = new ResponseBean();
52
         ResponseBean responseBean = new ResponseBean();
53
         // 1.检验该用户关联有没有这个 户号
53
         // 1.检验该用户关联有没有这个 户号
54
-        TaUserVerify taUserVerify = taUserVerifyMapper.selectCommunityAndAddress(userElement.getId(),userElement.getCommunityId(), phase, building, unit, level, roomNo);
54
+        TaUserVerify taUserVerify = taUserVerifyMapper.selectCommunityAndAddress(userElement.getId(),userElement.getCommunityId(), phaseId, buildingId, unitId, levelId, roomNo);
55
         if (null != taUserVerify) {
55
         if (null != taUserVerify) {
56
             responseBean.addError("您已关联此房产,无法再次关联!");
56
             responseBean.addError("您已关联此房产,无法再次关联!");
57
             return responseBean;
57
             return responseBean;

+ 138
- 63
CODE/smart-community/app-api/src/main/resources/mapper/TpBuildingOwnerInfoMapper.xml View File

5
     <id column="id" property="id" jdbcType="INTEGER" />
5
     <id column="id" property="id" jdbcType="INTEGER" />
6
     <result column="community_id" property="communityId" jdbcType="INTEGER" />
6
     <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
     <result column="id_card" property="idCard" jdbcType="VARCHAR" />
7
     <result column="id_card" property="idCard" jdbcType="VARCHAR" />
8
-    <result column="phase" property="phase" jdbcType="VARCHAR" />
9
-    <result column="building" property="building" jdbcType="VARCHAR" />
10
-    <result column="unit" property="unit" jdbcType="VARCHAR" />
11
-    <result column="level" property="level" jdbcType="VARCHAR" />
12
-    <result column="room_no" property="roomNo" jdbcType="VARCHAR" />
8
+    <result column="phase_id" property="phaseId" jdbcType="INTEGER" />
9
+    <result column="phase_name" property="phaseName" jdbcType="VARCHAR" />
10
+    <result column="building_id" property="buildingId" jdbcType="INTEGER" />
11
+    <result column="building_name" property="buildingName" jdbcType="VARCHAR" />
12
+    <result column="unit_id" property="unitId" jdbcType="INTEGER" />
13
+    <result column="unit_name" property="unitName" jdbcType="VARCHAR" />
14
+    <result column="level_id" property="levelId" jdbcType="INTEGER" />
15
+    <result column="level_name" property="levelName" jdbcType="VARCHAR" />
16
+    <result column="name" property="name" jdbcType="VARCHAR" />
13
     <result column="owner_name" property="ownerName" jdbcType="VARCHAR" />
17
     <result column="owner_name" property="ownerName" jdbcType="VARCHAR" />
14
     <result column="owner_tel" property="ownerTel" jdbcType="VARCHAR" />
18
     <result column="owner_tel" property="ownerTel" jdbcType="VARCHAR" />
15
     <result column="gender" property="gender" jdbcType="CHAR" />
19
     <result column="gender" property="gender" jdbcType="CHAR" />
16
     <result column="pair_status" property="pairStatus" jdbcType="CHAR" />
20
     <result column="pair_status" property="pairStatus" jdbcType="CHAR" />
17
     <result column="verify_status" property="verifyStatus" jdbcType="CHAR" />
21
     <result column="verify_status" property="verifyStatus" jdbcType="CHAR" />
22
+    <result column="sort" property="sort" jdbcType="VARCHAR" />
18
     <result column="create_user" property="createUser" jdbcType="INTEGER" />
23
     <result column="create_user" property="createUser" jdbcType="INTEGER" />
19
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
24
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
20
     <result column="update_user" property="updateUser" jdbcType="INTEGER" />
25
     <result column="update_user" property="updateUser" jdbcType="INTEGER" />
21
     <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
26
     <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
22
   </resultMap>
27
   </resultMap>
23
   <sql id="Base_Column_List" >
28
   <sql id="Base_Column_List" >
24
-    id, community_id, id_card, phase, building, unit, level, room_no, owner_name, owner_tel,
25
-    gender, pair_status, verify_status, create_user, create_date, update_user, update_date
29
+    id, community_id, id_card, phase_id, phase_name, building_id, building_name, unit_id,
30
+    unit_name, level_id, level_name, name, owner_name, owner_tel, gender, pair_status,
31
+    verify_status, sort, create_user, create_date, update_user, update_date
26
   </sql>
32
   </sql>
27
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
33
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
28
-    select 
34
+    select
29
     <include refid="Base_Column_List" />
35
     <include refid="Base_Column_List" />
30
     from tp_building_owner_info
36
     from tp_building_owner_info
31
     where id = #{id,jdbcType=INTEGER}
37
     where id = #{id,jdbcType=INTEGER}
35
     where id = #{id,jdbcType=INTEGER}
41
     where id = #{id,jdbcType=INTEGER}
36
   </delete>
42
   </delete>
37
   <insert id="insert" parameterType="com.community.huiju.model.TpBuildingOwnerInfo" >
43
   <insert id="insert" parameterType="com.community.huiju.model.TpBuildingOwnerInfo" >
38
-    insert into tp_building_owner_info (id, community_id, id_card, phase,
39
-      building, unit, level, 
40
-      room_no, owner_name, owner_tel, 
41
-      gender, pair_status, verify_status, 
42
-      create_user, create_date, update_user, 
44
+    insert into tp_building_owner_info (id, community_id, id_card,
45
+      phase_id, phase_name, building_id,
46
+      building_name, unit_id, unit_name,
47
+      level_id, level_name, name,
48
+      owner_name, owner_tel, gender,
49
+      pair_status, verify_status, sort,
50
+      create_user, create_date, update_user,
43
       update_date)
51
       update_date)
44
-    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{idCard,jdbcType=VARCHAR}, 
45
-      #{phase,jdbcType=VARCHAR}, #{building,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, #{level,jdbcType=VARCHAR},
46
-      #{roomNo,jdbcType=VARCHAR}, #{ownerName,jdbcType=VARCHAR}, #{ownerTel,jdbcType=VARCHAR}, 
47
-      #{gender,jdbcType=CHAR}, #{pairStatus,jdbcType=CHAR}, #{verifyStatus,jdbcType=CHAR}, 
48
-      #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, 
52
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{idCard,jdbcType=VARCHAR},
53
+      #{phaseId,jdbcType=INTEGER}, #{phaseName,jdbcType=VARCHAR}, #{buildingId,jdbcType=INTEGER},
54
+      #{buildingName,jdbcType=VARCHAR}, #{unitId,jdbcType=INTEGER}, #{unitName,jdbcType=VARCHAR},
55
+      #{levelId,jdbcType=INTEGER}, #{levelName,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
56
+      #{ownerName,jdbcType=VARCHAR}, #{ownerTel,jdbcType=VARCHAR}, #{gender,jdbcType=CHAR},
57
+      #{pairStatus,jdbcType=CHAR}, #{verifyStatus,jdbcType=CHAR}, #{sort,jdbcType=VARCHAR},
58
+      #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER},
49
       #{updateDate,jdbcType=TIMESTAMP})
59
       #{updateDate,jdbcType=TIMESTAMP})
50
   </insert>
60
   </insert>
51
   <insert id="insertSelective" parameterType="com.community.huiju.model.TpBuildingOwnerInfo" >
61
   <insert id="insertSelective" parameterType="com.community.huiju.model.TpBuildingOwnerInfo" >
60
       <if test="idCard != null" >
70
       <if test="idCard != null" >
61
         id_card,
71
         id_card,
62
       </if>
72
       </if>
63
-      <if test="phase != null">
64
-        phase,
73
+      <if test="phaseId != null" >
74
+        phase_id,
75
+      </if>
76
+      <if test="phaseName != null" >
77
+        phase_name,
78
+      </if>
79
+      <if test="buildingId != null" >
80
+        building_id,
65
       </if>
81
       </if>
66
-      <if test="building != null" >
67
-        building,
82
+      <if test="buildingName != null" >
83
+        building_name,
68
       </if>
84
       </if>
69
-      <if test="unit != null" >
70
-        unit,
85
+      <if test="unitId != null" >
86
+        unit_id,
71
       </if>
87
       </if>
72
-      <if test="level != null" >
73
-        level,
88
+      <if test="unitName != null" >
89
+        unit_name,
74
       </if>
90
       </if>
75
-      <if test="roomNo != null" >
76
-        room_no,
91
+      <if test="levelId != null" >
92
+        level_id,
93
+      </if>
94
+      <if test="levelName != null" >
95
+        level_name,
96
+      </if>
97
+      <if test="name != null" >
98
+        name,
77
       </if>
99
       </if>
78
       <if test="ownerName != null" >
100
       <if test="ownerName != null" >
79
         owner_name,
101
         owner_name,
90
       <if test="verifyStatus != null" >
112
       <if test="verifyStatus != null" >
91
         verify_status,
113
         verify_status,
92
       </if>
114
       </if>
115
+      <if test="sort != null" >
116
+        sort,
117
+      </if>
93
       <if test="createUser != null" >
118
       <if test="createUser != null" >
94
         create_user,
119
         create_user,
95
       </if>
120
       </if>
113
       <if test="idCard != null" >
138
       <if test="idCard != null" >
114
         #{idCard,jdbcType=VARCHAR},
139
         #{idCard,jdbcType=VARCHAR},
115
       </if>
140
       </if>
116
-      <if test="phase != null">
117
-        #{phase,jdbcType=VARCHAR},
141
+      <if test="phaseId != null" >
142
+        #{phaseId,jdbcType=INTEGER},
118
       </if>
143
       </if>
119
-      <if test="building != null" >
120
-        #{building,jdbcType=VARCHAR},
144
+      <if test="phaseName != null" >
145
+        #{phaseName,jdbcType=VARCHAR},
121
       </if>
146
       </if>
122
-      <if test="unit != null" >
123
-        #{unit,jdbcType=VARCHAR},
147
+      <if test="buildingId != null" >
148
+        #{buildingId,jdbcType=INTEGER},
124
       </if>
149
       </if>
125
-      <if test="level != null" >
126
-        #{level,jdbcType=VARCHAR},
150
+      <if test="buildingName != null" >
151
+        #{buildingName,jdbcType=VARCHAR},
127
       </if>
152
       </if>
128
-      <if test="roomNo != null" >
129
-        #{roomNo,jdbcType=VARCHAR},
153
+      <if test="unitId != null" >
154
+        #{unitId,jdbcType=INTEGER},
155
+      </if>
156
+      <if test="unitName != null" >
157
+        #{unitName,jdbcType=VARCHAR},
158
+      </if>
159
+      <if test="levelId != null" >
160
+        #{levelId,jdbcType=INTEGER},
161
+      </if>
162
+      <if test="levelName != null" >
163
+        #{levelName,jdbcType=VARCHAR},
164
+      </if>
165
+      <if test="name != null" >
166
+        #{name,jdbcType=VARCHAR},
130
       </if>
167
       </if>
131
       <if test="ownerName != null" >
168
       <if test="ownerName != null" >
132
         #{ownerName,jdbcType=VARCHAR},
169
         #{ownerName,jdbcType=VARCHAR},
143
       <if test="verifyStatus != null" >
180
       <if test="verifyStatus != null" >
144
         #{verifyStatus,jdbcType=CHAR},
181
         #{verifyStatus,jdbcType=CHAR},
145
       </if>
182
       </if>
183
+      <if test="sort != null" >
184
+        #{sort,jdbcType=VARCHAR},
185
+      </if>
146
       <if test="createUser != null" >
186
       <if test="createUser != null" >
147
         #{createUser,jdbcType=INTEGER},
187
         #{createUser,jdbcType=INTEGER},
148
       </if>
188
       </if>
166
       <if test="idCard != null" >
206
       <if test="idCard != null" >
167
         id_card = #{idCard,jdbcType=VARCHAR},
207
         id_card = #{idCard,jdbcType=VARCHAR},
168
       </if>
208
       </if>
169
-      <if test="phase != null">
170
-        phase = #{phase,jdbcType=VARCHAR},
209
+      <if test="phaseId != null" >
210
+        phase_id = #{phaseId,jdbcType=INTEGER},
171
       </if>
211
       </if>
172
-      <if test="building != null" >
173
-        building = #{building,jdbcType=VARCHAR},
212
+      <if test="phaseName != null" >
213
+        phase_name = #{phaseName,jdbcType=VARCHAR},
174
       </if>
214
       </if>
175
-      <if test="unit != null" >
176
-        unit = #{unit,jdbcType=VARCHAR},
215
+      <if test="buildingId != null" >
216
+        building_id = #{buildingId,jdbcType=INTEGER},
177
       </if>
217
       </if>
178
-      <if test="level != null" >
179
-        level = #{level,jdbcType=VARCHAR},
218
+      <if test="buildingName != null" >
219
+        building_name = #{buildingName,jdbcType=VARCHAR},
180
       </if>
220
       </if>
181
-      <if test="roomNo != null" >
182
-        room_no = #{roomNo,jdbcType=VARCHAR},
221
+      <if test="unitId != null" >
222
+        unit_id = #{unitId,jdbcType=INTEGER},
223
+      </if>
224
+      <if test="unitName != null" >
225
+        unit_name = #{unitName,jdbcType=VARCHAR},
226
+      </if>
227
+      <if test="levelId != null" >
228
+        level_id = #{levelId,jdbcType=INTEGER},
229
+      </if>
230
+      <if test="levelName != null" >
231
+        level_name = #{levelName,jdbcType=VARCHAR},
232
+      </if>
233
+      <if test="name != null" >
234
+        name = #{name,jdbcType=VARCHAR},
183
       </if>
235
       </if>
184
       <if test="ownerName != null" >
236
       <if test="ownerName != null" >
185
         owner_name = #{ownerName,jdbcType=VARCHAR},
237
         owner_name = #{ownerName,jdbcType=VARCHAR},
196
       <if test="verifyStatus != null" >
248
       <if test="verifyStatus != null" >
197
         verify_status = #{verifyStatus,jdbcType=CHAR},
249
         verify_status = #{verifyStatus,jdbcType=CHAR},
198
       </if>
250
       </if>
251
+      <if test="sort != null" >
252
+        sort = #{sort,jdbcType=VARCHAR},
253
+      </if>
199
       <if test="createUser != null" >
254
       <if test="createUser != null" >
200
         create_user = #{createUser,jdbcType=INTEGER},
255
         create_user = #{createUser,jdbcType=INTEGER},
201
       </if>
256
       </if>
215
     update tp_building_owner_info
270
     update tp_building_owner_info
216
     set community_id = #{communityId,jdbcType=INTEGER},
271
     set community_id = #{communityId,jdbcType=INTEGER},
217
       id_card = #{idCard,jdbcType=VARCHAR},
272
       id_card = #{idCard,jdbcType=VARCHAR},
218
-      phase = #{phase,jdbcType=VARCHAR},
219
-      building = #{building,jdbcType=VARCHAR},
220
-      unit = #{unit,jdbcType=VARCHAR},
221
-      level = #{level,jdbcType=VARCHAR},
222
-      room_no = #{roomNo,jdbcType=VARCHAR},
273
+      phase_id = #{phaseId,jdbcType=INTEGER},
274
+      phase_name = #{phaseName,jdbcType=VARCHAR},
275
+      building_id = #{buildingId,jdbcType=INTEGER},
276
+      building_name = #{buildingName,jdbcType=VARCHAR},
277
+      unit_id = #{unitId,jdbcType=INTEGER},
278
+      unit_name = #{unitName,jdbcType=VARCHAR},
279
+      level_id = #{levelId,jdbcType=INTEGER},
280
+      level_name = #{levelName,jdbcType=VARCHAR},
281
+      name = #{name,jdbcType=VARCHAR},
223
       owner_name = #{ownerName,jdbcType=VARCHAR},
282
       owner_name = #{ownerName,jdbcType=VARCHAR},
224
       owner_tel = #{ownerTel,jdbcType=VARCHAR},
283
       owner_tel = #{ownerTel,jdbcType=VARCHAR},
225
       gender = #{gender,jdbcType=CHAR},
284
       gender = #{gender,jdbcType=CHAR},
226
       pair_status = #{pairStatus,jdbcType=CHAR},
285
       pair_status = #{pairStatus,jdbcType=CHAR},
227
       verify_status = #{verifyStatus,jdbcType=CHAR},
286
       verify_status = #{verifyStatus,jdbcType=CHAR},
287
+      sort = #{sort,jdbcType=VARCHAR},
228
       create_user = #{createUser,jdbcType=INTEGER},
288
       create_user = #{createUser,jdbcType=INTEGER},
229
       create_date = #{createDate,jdbcType=TIMESTAMP},
289
       create_date = #{createDate,jdbcType=TIMESTAMP},
230
       update_user = #{updateUser,jdbcType=INTEGER},
290
       update_user = #{updateUser,jdbcType=INTEGER},
240
       <if test="idCard != null" >
300
       <if test="idCard != null" >
241
         id_card = #{idCard,jdbcType=VARCHAR},
301
         id_card = #{idCard,jdbcType=VARCHAR},
242
       </if>
302
       </if>
243
-      <if test="phase != null">
244
-        phase = #{phase,jdbcType=VARCHAR},
303
+      <if test="phaseId != null" >
304
+        phase_id = #{phaseId,jdbcType=INTEGER},
245
       </if>
305
       </if>
246
-      <if test="building != null" >
247
-        building = #{building,jdbcType=VARCHAR},
306
+      <if test="phaseName != null" >
307
+        phase_name = #{phaseName,jdbcType=VARCHAR},
248
       </if>
308
       </if>
249
-      <if test="unit != null" >
250
-        unit = #{unit,jdbcType=VARCHAR},
309
+      <if test="buildingId != null" >
310
+        building_id = #{buildingId,jdbcType=INTEGER},
251
       </if>
311
       </if>
252
-      <if test="level != null" >
253
-        level = #{level,jdbcType=VARCHAR},
312
+      <if test="buildingName != null" >
313
+        building_name = #{buildingName,jdbcType=VARCHAR},
254
       </if>
314
       </if>
255
-      <if test="roomNo != null" >
256
-        room_no = #{roomNo,jdbcType=VARCHAR},
315
+      <if test="unitId != null" >
316
+        unit_id = #{unitId,jdbcType=INTEGER},
317
+      </if>
318
+      <if test="unitName != null" >
319
+        unit_name = #{unitName,jdbcType=VARCHAR},
320
+      </if>
321
+      <if test="levelId != null" >
322
+        level_id = #{levelId,jdbcType=INTEGER},
323
+      </if>
324
+      <if test="levelName != null" >
325
+        level_name = #{levelName,jdbcType=VARCHAR},
326
+      </if>
327
+      <if test="name != null" >
328
+        name = #{name,jdbcType=VARCHAR},
257
       </if>
329
       </if>
258
       <if test="ownerName != null" >
330
       <if test="ownerName != null" >
259
         owner_name = #{ownerName,jdbcType=VARCHAR},
331
         owner_name = #{ownerName,jdbcType=VARCHAR},
270
       <if test="verifyStatus != null" >
342
       <if test="verifyStatus != null" >
271
         verify_status = #{verifyStatus,jdbcType=CHAR},
343
         verify_status = #{verifyStatus,jdbcType=CHAR},
272
       </if>
344
       </if>
345
+      <if test="sort != null" >
346
+        sort = #{sort,jdbcType=VARCHAR},
347
+      </if>
273
       <if test="createUser != null" >
348
       <if test="createUser != null" >
274
         create_user = #{createUser,jdbcType=INTEGER},
349
         create_user = #{createUser,jdbcType=INTEGER},
275
       </if>
350
       </if>

+ 25
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/BuildingOwnerInfoController.java View File

10
 import io.swagger.annotations.ApiImplicitParam;
10
 import io.swagger.annotations.ApiImplicitParam;
11
 import io.swagger.annotations.ApiImplicitParams;
11
 import io.swagger.annotations.ApiImplicitParams;
12
 import io.swagger.annotations.ApiOperation;
12
 import io.swagger.annotations.ApiOperation;
13
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
14
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
13
 import org.springframework.beans.factory.annotation.Autowired;
15
 import org.springframework.beans.factory.annotation.Autowired;
14
 import org.springframework.cloud.context.config.annotation.RefreshScope;
16
 import org.springframework.cloud.context.config.annotation.RefreshScope;
15
 import org.springframework.web.bind.annotation.*;
17
 import org.springframework.web.bind.annotation.*;
16
 import org.springframework.web.multipart.MultipartFile;
18
 import org.springframework.web.multipart.MultipartFile;
17
 
19
 
20
+import javax.servlet.http.HttpServletResponse;
18
 import javax.servlet.http.HttpSession;
21
 import javax.servlet.http.HttpSession;
22
+import java.io.OutputStream;
19
 import java.util.List;
23
 import java.util.List;
20
 import java.util.stream.Collectors;
24
 import java.util.stream.Collectors;
21
 
25
 
193
         ResponseBean responseBean = iBuildingOwnerInfoService.communitybuildingUpdate(parameter, userElement.getCommunityId());
197
         ResponseBean responseBean = iBuildingOwnerInfoService.communitybuildingUpdate(parameter, userElement.getCommunityId());
194
         return responseBean;
198
         return responseBean;
195
     }
199
     }
200
+
201
+    @ApiOperation(value = "下载Excel模板(小区楼栋信息)", notes = "下载Excel模板(小区楼栋信息)")
202
+    @ApiImplicitParams({
203
+//            @ApiImplicitParam(dataTypeClass = String.class, paramType = "body", name = "parameter", value = "billExplain收费组说明"),
204
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
205
+    })
206
+    @RequestMapping(value = "/building/downloadExcel", method = RequestMethod.GET)
207
+    public void exportExcel(HttpServletResponse response, HttpSession session) {
208
+        UserElement userElement = getUserElement(session);
209
+        XSSFWorkbook workbook = (XSSFWorkbook) iBuildingOwnerInfoService.downloadExcel(userElement).getData();
210
+        this.setResponseHeader(response, "业主资料库.xlsx");
211
+        //响应到客户端
212
+        try {
213
+            OutputStream os = response.getOutputStream();
214
+            workbook.write(os);
215
+            os.flush();
216
+            os.close();
217
+        } catch (Exception e) {
218
+            e.printStackTrace();
219
+        }
220
+    }
196
 }
221
 }

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

7
 import lombok.experimental.Accessors;
7
 import lombok.experimental.Accessors;
8
 
8
 
9
 import java.io.Serializable;
9
 import java.io.Serializable;
10
+import java.time.LocalDateTime;
10
 import java.util.Date;
11
 import java.util.Date;
11
 @Data
12
 @Data
12
 @EqualsAndHashCode(callSuper = false)
13
 @EqualsAndHashCode(callSuper = false)
34
      * 楼栋名称
35
      * 楼栋名称
35
      */
36
      */
36
     private String name;
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
 import lombok.experimental.Accessors;
8
 import lombok.experimental.Accessors;
9
 
9
 
10
 import java.io.Serializable;
10
 import java.io.Serializable;
11
+import java.time.LocalDateTime;
11
 
12
 
12
 /**
13
 /**
13
  * <p>
14
  * <p>
67
      * 楼层名称
68
      * 楼层名称
68
      */
69
      */
69
     private String name;
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
 import lombok.experimental.Accessors;
8
 import lombok.experimental.Accessors;
9
 
9
 
10
 import java.io.Serializable;
10
 import java.io.Serializable;
11
+import java.time.LocalDateTime;
11
 
12
 
12
 /**
13
 /**
13
  * <p>
14
  * <p>
37
      * 期区名称
38
      * 期区名称
38
      */
39
      */
39
     private String name;
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
 import lombok.experimental.Accessors;
8
 import lombok.experimental.Accessors;
9
 
9
 
10
 import java.io.Serializable;
10
 import java.io.Serializable;
11
+import java.time.LocalDateTime;
11
 
12
 
12
 /**
13
 /**
13
  * <p>
14
  * <p>
57
      * 单元名称
58
      * 单元名称
58
      */
59
      */
59
     private String name;
60
     private String name;
60
-
61
-
61
+    
62
+    /**
63
+     * 创建时间
64
+     */
65
+    private LocalDateTime createDate;
62
 }
66
 }

+ 7
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/IBuildingOwnerInfoService.java View File

111
      * @return
111
      * @return
112
      */
112
      */
113
     ResponseBean communitybuildingUpdate(String parameter, Integer communityId);
113
     ResponseBean communitybuildingUpdate(String parameter, Integer communityId);
114
+
115
+    /**
116
+     * 下载Excel模板(小区楼栋信息)
117
+     * @param userElement
118
+     * @return
119
+     */
120
+    ResponseBean downloadExcel(UserElement userElement);
114
 }
121
 }

+ 89
- 8
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoServiceImpl.java View File

1
 package com.community.huiju.service.impl;
1
 package com.community.huiju.service.impl;
2
 
2
 
3
+import com.alibaba.fastjson.JSON;
3
 import com.alibaba.fastjson.JSONObject;
4
 import com.alibaba.fastjson.JSONObject;
4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
-import com.baomidou.mybatisplus.core.enums.SqlMethod;
6
 import com.baomidou.mybatisplus.core.metadata.IPage;
6
 import com.baomidou.mybatisplus.core.metadata.IPage;
7
-import com.baomidou.mybatisplus.core.toolkit.Constants;
8
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
7
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
9
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
8
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
10
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
21
 import com.community.huiju.service.IBillInvoiceService;
20
 import com.community.huiju.service.IBillInvoiceService;
22
 import com.community.huiju.service.IBuildingOwnerInfoService;
21
 import com.community.huiju.service.IBuildingOwnerInfoService;
23
 import com.community.huiju.service.ITaUserService;
22
 import com.community.huiju.service.ITaUserService;
24
-import com.google.common.collect.Lists;
25
 import com.google.common.collect.Maps;
23
 import com.google.common.collect.Maps;
26
 import org.apache.commons.collections.CollectionUtils;
24
 import org.apache.commons.collections.CollectionUtils;
27
 
25
 
28
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
26
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
29
-import org.apache.poi.ss.usermodel.Row;
30
-import org.apache.poi.ss.usermodel.Sheet;
31
-import org.apache.poi.ss.usermodel.Workbook;
32
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
27
+import org.apache.poi.ss.usermodel.*;
28
+import org.apache.poi.xssf.usermodel.*;
33
 import org.slf4j.Logger;
29
 import org.slf4j.Logger;
34
 import org.slf4j.LoggerFactory;
30
 import org.slf4j.LoggerFactory;
35
 
31
 
39
 import org.springframework.transaction.annotation.Transactional;
35
 import org.springframework.transaction.annotation.Transactional;
40
 import org.springframework.web.multipart.MultipartFile;
36
 import org.springframework.web.multipart.MultipartFile;
41
 
37
 
38
+import java.io.IOException;
39
+import java.io.InputStream;
42
 import java.time.LocalDateTime;
40
 import java.time.LocalDateTime;
43
 import java.util.*;
41
 import java.util.*;
44
 import java.util.regex.Pattern;
42
 import java.util.regex.Pattern;
89
         ResponseBean responseBean = new ResponseBean();
87
         ResponseBean responseBean = new ResponseBean();
90
 
88
 
91
         JSONObject jsonObject = JSONObject.parseObject(parameter);
89
         JSONObject jsonObject = JSONObject.parseObject(parameter);
92
-        TpBuildingOwnerInfo tpBuildingOwnerInfo = jsonObject.toJavaObject(TpBuildingOwnerInfo.class);
90
+        TpBuildingOwnerInfo tpBuildingOwnerInfo = jsonObject.toJavaObject(jsonObject,TpBuildingOwnerInfo.class);
93
 
91
 
94
         Long pageNum = jsonObject.getLong("pageNum") == null ? 1 : jsonObject.getLong("pageNum");
92
         Long pageNum = jsonObject.getLong("pageNum") == null ? 1 : jsonObject.getLong("pageNum");
95
         Long pageSize = jsonObject.getLong("pageSize") == null ? 10 : jsonObject.getLong("pageSize");
93
         Long pageSize = jsonObject.getLong("pageSize") == null ? 10 : jsonObject.getLong("pageSize");
845
 
843
 
846
         return selectBuild;
844
         return selectBuild;
847
     }
845
     }
846
+
847
+    @Override
848
+    public ResponseBean downloadExcel(UserElement userElement) {
849
+        ResponseBean responseBean = new ResponseBean();
850
+
851
+        InputStream inputStream = null;
852
+        inputStream = this.getClass().getResourceAsStream("/业主资料库.xlsx");
853
+
854
+        XSSFWorkbook workbook = null;
855
+        try {
856
+            workbook = new XSSFWorkbook(inputStream);
857
+        } catch (IOException e) {
858
+            e.printStackTrace();
859
+        }
860
+
861
+        XSSFSheet sheet = workbook.getSheetAt(0);
862
+        // 创建行
863
+        XSSFRow row = null;
864
+        // 创建列
865
+        XSSFCell cell = null;
866
+
867
+        Integer pageNum = 1;
868
+        Integer pageSize = 10;
869
+        Page<TpBuildingOwnerInfo> page = new Page(pageNum,pageSize);
870
+        // 分页查询
871
+        QueryWrapper<TpBuildingOwnerInfo> buildingOwnerInfoQueryWrapper = new QueryWrapper<>();
872
+        buildingOwnerInfoQueryWrapper.eq("community_id", userElement.getCommunityId());
873
+        IPage<TpBuildingOwnerInfo> infoIPage = tpBuildingOwnerInfoMapper.selectPage(page, buildingOwnerInfoQueryWrapper);
874
+        List<TpBuildingOwnerInfo> records = infoIPage.getRecords();
875
+        // 总页数
876
+        Long pages = infoIPage.getPages();
877
+
878
+
879
+        // 行数 默认从 第 5 行开始
880
+        int currentRow = 5;
881
+        // 记录坐标
882
+        int index = 0;
883
+
884
+        // 样式
885
+        XSSFCellStyle cellStyle = workbook.createCellStyle();
886
+        cellStyle.setBorderBottom(XSSFCellStyle.BORDER_THIN); //下边框
887
+        cellStyle.setBorderLeft(XSSFCellStyle.BORDER_THIN);//左边框
888
+        cellStyle.setBorderTop(XSSFCellStyle.BORDER_THIN);//上边框
889
+        cellStyle.setBorderRight(XSSFCellStyle.BORDER_THIN);//右边框
890
+        cellStyle.setAlignment(HorizontalAlignment.LEFT);
891
+
892
+        if (records.size() > 0) {
893
+            do {
894
+                TpBuildingOwnerInfo buildingOwnerInfo = records.get(index);
895
+                row = sheet.createRow(currentRow);
896
+                String address = buildingOwnerInfo.getPhaseName() +
897
+                        buildingOwnerInfo.getBuildingName() +
898
+                        buildingOwnerInfo.getUnitName() +
899
+                        buildingOwnerInfo.getLevelName() +
900
+                        buildingOwnerInfo.getName();
901
+
902
+                cell = row.createCell(0);
903
+                cell.setCellValue(address);
904
+                cell.setCellStyle(cellStyle);
905
+                cell = row.createCell(1);
906
+                cell.setCellValue(buildingOwnerInfo.getId());
907
+                cell.setCellStyle(cellStyle);
908
+                cell = row.createCell(2);
909
+                cell.setCellStyle(cellStyle);
910
+                cell = row.createCell(3);
911
+                cell.setCellStyle(cellStyle);
912
+                cell = row.createCell(4);
913
+                cell.setCellStyle(cellStyle);
914
+
915
+                currentRow ++;
916
+                index ++;
917
+                if (index == records.size()) {
918
+                    index = 0;
919
+                    page = new Page(infoIPage.getCurrent() + 1,pageSize);
920
+                    infoIPage = tpBuildingOwnerInfoMapper.selectPage(page, buildingOwnerInfoQueryWrapper);
921
+                    records = infoIPage.getRecords();
922
+                }
923
+            } while (infoIPage.getCurrent() <= pages);
924
+        }
925
+
926
+        responseBean.addSuccess(workbook);
927
+        return responseBean;
928
+    }
848
 }
929
 }

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

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

BIN
CODE/smart-community/property-api/src/main/resources/业主资料库.xlsx View File


+ 9
- 0
VUECODE/smart-property-manage/src/api/buildingOwnerInfo.js View File

164
     }
164
     }
165
   })
165
   })
166
 }
166
 }
167
+
168
+// 下载excel模板
169
+export function buildingDownloadExcel() {
170
+  return request({
171
+    url: '/building/downloadExcel',
172
+    method: 'get',
173
+    responseType: 'blob'
174
+  })
175
+}

+ 10
- 1
VUECODE/smart-property-manage/src/store/modules/buildingOwnerInfo.js View File

1
 
1
 
2
-import { buildingAddress, buildingList, deleteBuilding, addBuilding, updateBuilding, getByIdBuildingId, userPassCertification, updataPassCertification, communityBuildinglist, buildingHouse,communityBuildingAdd } from '@/api/buildingOwnerInfo'
2
+import { buildingAddress, buildingList, deleteBuilding, addBuilding, updateBuilding, getByIdBuildingId, userPassCertification, updataPassCertification, communityBuildinglist, buildingHouse, communityBuildingAdd, buildingDownloadExcel } from '@/api/buildingOwnerInfo'
3
 
3
 
4
 const buildingOwnerInfo = {
4
 const buildingOwnerInfo = {
5
   state: {
5
   state: {
113
           reject(error)
113
           reject(error)
114
         })
114
         })
115
       })
115
       })
116
+    },
117
+    BuildingDownloadExcel({ commit }) { // 下载模板
118
+      return new Promise((resolve, reject) => {
119
+        buildingDownloadExcel().then(response => {
120
+          resolve(response)
121
+        }).catch(error => {
122
+          reject(error)
123
+        })
124
+      })
116
     }
125
     }
117
   }
126
   }
118
 }
127
 }

+ 15
- 1
VUECODE/smart-property-manage/src/views/building/batch/batchImport.vue View File

4
     <el-form :inline="true" :model="listQuery" class="form-listQuery">
4
     <el-form :inline="true" :model="listQuery" class="form-listQuery">
5
       <el-form-item>
5
       <el-form-item>
6
         <el-upload :on-preview="handlePreview" :on-change="handleChange" :before-upload="beforeUpload" :limit="1" :on-exceed="handleExceed" class="upload-demo" action="" multiple>
6
         <el-upload :on-preview="handlePreview" :on-change="handleChange" :before-upload="beforeUpload" :limit="1" :on-exceed="handleExceed" class="upload-demo" action="" multiple>
7
-          <a href="http://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/%E6%A5%BC%E6%A0%8B%E5%BA%93%E6%A8%A1%E6%9D%BF.xlsx?Expires=1548327771"><el-button style="margin-left: 10px;" size="large" type="primary">下载模板</el-button></a>
7
+          <!-- <a href="http://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/%E6%A5%BC%E6%A0%8B%E5%BA%93%E6%A8%A1%E6%9D%BF.xlsx?Expires=1548327771"></a> -->
8
+          <el-button style="margin-left: 10px;" size="large" type="primary" @click="exportExcel">下载模板-小区</el-button>
8
           <el-button slot="trigger" size="large" type="primary">选取文件并预览</el-button>
9
           <el-button slot="trigger" size="large" type="primary">选取文件并预览</el-button>
9
           <el-button style="margin-left: 10px;" size="large" type="success" @click="submitUpload">提交</el-button>
10
           <el-button style="margin-left: 10px;" size="large" type="success" @click="submitUpload">提交</el-button>
10
           <el-button style="margin-left: 10px;" size="large" type="success" @click="dialogBuildingIndex">取消</el-button>
11
           <el-button style="margin-left: 10px;" size="large" type="success" @click="dialogBuildingIndex">取消</el-button>
142
     },
143
     },
143
     dialogBuildingIndex() {
144
     dialogBuildingIndex() {
144
       this.$router.push({ name: "building-index" });
145
       this.$router.push({ name: "building-index" });
146
+    },
147
+    exportExcel() {
148
+      this.$store.dispatch('BuildingDownloadExcel').then(res => {
149
+        const url = window.URL.createObjectURL(new Blob([res]))
150
+        const link = document.createElement('a')
151
+        link.style.display = 'none'
152
+        link.href = url
153
+        link.setAttribute('download', '业主资料库.xlsx')
154
+        document.body.appendChild(link)
155
+        link.click()
156
+      }).catch(() => {
157
+        console.log('error BuildingDownloadExcel')
158
+      })
145
     }
159
     }
146
   }
160
   }
147
 };
161
 };