dingxin 6 лет назад
Родитель
Сommit
378057c6dd
17 измененных файлов: 427 добавлений и 132 удалений
  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. Двоичные данные
      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 Просмотреть файл

@@ -23,14 +23,14 @@ public interface TpBuildingMapper {
23 23
     /**
24 24
      * 根据 小区/期/栋/单元/楼层/户号 进行条件查询
25 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 30
      * @param roomNo
31 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 Просмотреть файл

@@ -9,16 +9,23 @@ public class TpBuildingOwnerInfo {
9 9
 
10 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 30
     private String ownerName;
24 31
 
@@ -30,6 +37,8 @@ public class TpBuildingOwnerInfo {
30 37
 
31 38
     private String verifyStatus;
32 39
 
40
+    private String sort;
41
+
33 42
     private Integer createUser;
34 43
 
35 44
     private Date createDate;
@@ -59,47 +68,79 @@ public class TpBuildingOwnerInfo {
59 68
     }
60 69
 
61 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 146
     public String getOwnerName() {
@@ -107,7 +148,7 @@ public class TpBuildingOwnerInfo {
107 148
     }
108 149
 
109 150
     public void setOwnerName(String ownerName) {
110
-        this.ownerName = ownerName == null ? null : ownerName.trim();
151
+        this.ownerName = ownerName;
111 152
     }
112 153
 
113 154
     public String getOwnerTel() {
@@ -115,7 +156,7 @@ public class TpBuildingOwnerInfo {
115 156
     }
116 157
 
117 158
     public void setOwnerTel(String ownerTel) {
118
-        this.ownerTel = ownerTel == null ? null : ownerTel.trim();
159
+        this.ownerTel = ownerTel;
119 160
     }
120 161
 
121 162
     public String getGender() {
@@ -123,7 +164,7 @@ public class TpBuildingOwnerInfo {
123 164
     }
124 165
 
125 166
     public void setGender(String gender) {
126
-        this.gender = gender == null ? null : gender.trim();
167
+        this.gender = gender;
127 168
     }
128 169
 
129 170
     public String getPairStatus() {
@@ -131,7 +172,7 @@ public class TpBuildingOwnerInfo {
131 172
     }
132 173
 
133 174
     public void setPairStatus(String pairStatus) {
134
-        this.pairStatus = pairStatus == null ? null : pairStatus.trim();
175
+        this.pairStatus = pairStatus;
135 176
     }
136 177
 
137 178
     public String getVerifyStatus() {
@@ -139,7 +180,15 @@ public class TpBuildingOwnerInfo {
139 180
     }
140 181
 
141 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 194
     public Integer getCreateUser() {

+ 10
- 10
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/IBuildingOwnerInfo.java Просмотреть файл

@@ -15,24 +15,24 @@ public interface IBuildingOwnerInfo {
15 15
     /**
16 16
      * 根据 小区/期/楼栋/单元/楼层/户号
17 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 22
      * @param roomNo
23 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 33
      * @param roomNo
34 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 Просмотреть файл

@@ -39,19 +39,19 @@ public class BuildingOwnerInfoImpl implements IBuildingOwnerInfo {
39 39
     private TaUserVerifyMapper taUserVerifyMapper;
40 40
 
41 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 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 46
         responseBean.addSuccess(buildingList);
47 47
         return responseBean;
48 48
     }
49 49
 
50 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 52
         ResponseBean responseBean = new ResponseBean();
53 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 55
         if (null != taUserVerify) {
56 56
             responseBean.addError("您已关联此房产,无法再次关联!");
57 57
             return responseBean;

+ 138
- 63
CODE/smart-community/app-api/src/main/resources/mapper/TpBuildingOwnerInfoMapper.xml Просмотреть файл

@@ -5,27 +5,33 @@
5 5
     <id column="id" property="id" jdbcType="INTEGER" />
6 6
     <result column="community_id" property="communityId" jdbcType="INTEGER" />
7 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 17
     <result column="owner_name" property="ownerName" jdbcType="VARCHAR" />
14 18
     <result column="owner_tel" property="ownerTel" jdbcType="VARCHAR" />
15 19
     <result column="gender" property="gender" jdbcType="CHAR" />
16 20
     <result column="pair_status" property="pairStatus" jdbcType="CHAR" />
17 21
     <result column="verify_status" property="verifyStatus" jdbcType="CHAR" />
22
+    <result column="sort" property="sort" jdbcType="VARCHAR" />
18 23
     <result column="create_user" property="createUser" jdbcType="INTEGER" />
19 24
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
20 25
     <result column="update_user" property="updateUser" jdbcType="INTEGER" />
21 26
     <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
22 27
   </resultMap>
23 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 32
   </sql>
27 33
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
28
-    select 
34
+    select
29 35
     <include refid="Base_Column_List" />
30 36
     from tp_building_owner_info
31 37
     where id = #{id,jdbcType=INTEGER}
@@ -35,17 +41,21 @@
35 41
     where id = #{id,jdbcType=INTEGER}
36 42
   </delete>
37 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 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 59
       #{updateDate,jdbcType=TIMESTAMP})
50 60
   </insert>
51 61
   <insert id="insertSelective" parameterType="com.community.huiju.model.TpBuildingOwnerInfo" >
@@ -60,20 +70,32 @@
60 70
       <if test="idCard != null" >
61 71
         id_card,
62 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 81
       </if>
66
-      <if test="building != null" >
67
-        building,
82
+      <if test="buildingName != null" >
83
+        building_name,
68 84
       </if>
69
-      <if test="unit != null" >
70
-        unit,
85
+      <if test="unitId != null" >
86
+        unit_id,
71 87
       </if>
72
-      <if test="level != null" >
73
-        level,
88
+      <if test="unitName != null" >
89
+        unit_name,
74 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 99
       </if>
78 100
       <if test="ownerName != null" >
79 101
         owner_name,
@@ -90,6 +112,9 @@
90 112
       <if test="verifyStatus != null" >
91 113
         verify_status,
92 114
       </if>
115
+      <if test="sort != null" >
116
+        sort,
117
+      </if>
93 118
       <if test="createUser != null" >
94 119
         create_user,
95 120
       </if>
@@ -113,20 +138,32 @@
113 138
       <if test="idCard != null" >
114 139
         #{idCard,jdbcType=VARCHAR},
115 140
       </if>
116
-      <if test="phase != null">
117
-        #{phase,jdbcType=VARCHAR},
141
+      <if test="phaseId != null" >
142
+        #{phaseId,jdbcType=INTEGER},
118 143
       </if>
119
-      <if test="building != null" >
120
-        #{building,jdbcType=VARCHAR},
144
+      <if test="phaseName != null" >
145
+        #{phaseName,jdbcType=VARCHAR},
121 146
       </if>
122
-      <if test="unit != null" >
123
-        #{unit,jdbcType=VARCHAR},
147
+      <if test="buildingId != null" >
148
+        #{buildingId,jdbcType=INTEGER},
124 149
       </if>
125
-      <if test="level != null" >
126
-        #{level,jdbcType=VARCHAR},
150
+      <if test="buildingName != null" >
151
+        #{buildingName,jdbcType=VARCHAR},
127 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 167
       </if>
131 168
       <if test="ownerName != null" >
132 169
         #{ownerName,jdbcType=VARCHAR},
@@ -143,6 +180,9 @@
143 180
       <if test="verifyStatus != null" >
144 181
         #{verifyStatus,jdbcType=CHAR},
145 182
       </if>
183
+      <if test="sort != null" >
184
+        #{sort,jdbcType=VARCHAR},
185
+      </if>
146 186
       <if test="createUser != null" >
147 187
         #{createUser,jdbcType=INTEGER},
148 188
       </if>
@@ -166,20 +206,32 @@
166 206
       <if test="idCard != null" >
167 207
         id_card = #{idCard,jdbcType=VARCHAR},
168 208
       </if>
169
-      <if test="phase != null">
170
-        phase = #{phase,jdbcType=VARCHAR},
209
+      <if test="phaseId != null" >
210
+        phase_id = #{phaseId,jdbcType=INTEGER},
171 211
       </if>
172
-      <if test="building != null" >
173
-        building = #{building,jdbcType=VARCHAR},
212
+      <if test="phaseName != null" >
213
+        phase_name = #{phaseName,jdbcType=VARCHAR},
174 214
       </if>
175
-      <if test="unit != null" >
176
-        unit = #{unit,jdbcType=VARCHAR},
215
+      <if test="buildingId != null" >
216
+        building_id = #{buildingId,jdbcType=INTEGER},
177 217
       </if>
178
-      <if test="level != null" >
179
-        level = #{level,jdbcType=VARCHAR},
218
+      <if test="buildingName != null" >
219
+        building_name = #{buildingName,jdbcType=VARCHAR},
180 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 235
       </if>
184 236
       <if test="ownerName != null" >
185 237
         owner_name = #{ownerName,jdbcType=VARCHAR},
@@ -196,6 +248,9 @@
196 248
       <if test="verifyStatus != null" >
197 249
         verify_status = #{verifyStatus,jdbcType=CHAR},
198 250
       </if>
251
+      <if test="sort != null" >
252
+        sort = #{sort,jdbcType=VARCHAR},
253
+      </if>
199 254
       <if test="createUser != null" >
200 255
         create_user = #{createUser,jdbcType=INTEGER},
201 256
       </if>
@@ -215,16 +270,21 @@
215 270
     update tp_building_owner_info
216 271
     set community_id = #{communityId,jdbcType=INTEGER},
217 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 282
       owner_name = #{ownerName,jdbcType=VARCHAR},
224 283
       owner_tel = #{ownerTel,jdbcType=VARCHAR},
225 284
       gender = #{gender,jdbcType=CHAR},
226 285
       pair_status = #{pairStatus,jdbcType=CHAR},
227 286
       verify_status = #{verifyStatus,jdbcType=CHAR},
287
+      sort = #{sort,jdbcType=VARCHAR},
228 288
       create_user = #{createUser,jdbcType=INTEGER},
229 289
       create_date = #{createDate,jdbcType=TIMESTAMP},
230 290
       update_user = #{updateUser,jdbcType=INTEGER},
@@ -240,20 +300,32 @@
240 300
       <if test="idCard != null" >
241 301
         id_card = #{idCard,jdbcType=VARCHAR},
242 302
       </if>
243
-      <if test="phase != null">
244
-        phase = #{phase,jdbcType=VARCHAR},
303
+      <if test="phaseId != null" >
304
+        phase_id = #{phaseId,jdbcType=INTEGER},
245 305
       </if>
246
-      <if test="building != null" >
247
-        building = #{building,jdbcType=VARCHAR},
306
+      <if test="phaseName != null" >
307
+        phase_name = #{phaseName,jdbcType=VARCHAR},
248 308
       </if>
249
-      <if test="unit != null" >
250
-        unit = #{unit,jdbcType=VARCHAR},
309
+      <if test="buildingId != null" >
310
+        building_id = #{buildingId,jdbcType=INTEGER},
251 311
       </if>
252
-      <if test="level != null" >
253
-        level = #{level,jdbcType=VARCHAR},
312
+      <if test="buildingName != null" >
313
+        building_name = #{buildingName,jdbcType=VARCHAR},
254 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 329
       </if>
258 330
       <if test="ownerName != null" >
259 331
         owner_name = #{ownerName,jdbcType=VARCHAR},
@@ -270,6 +342,9 @@
270 342
       <if test="verifyStatus != null" >
271 343
         verify_status = #{verifyStatus,jdbcType=CHAR},
272 344
       </if>
345
+      <if test="sort != null" >
346
+        sort = #{sort,jdbcType=VARCHAR},
347
+      </if>
273 348
       <if test="createUser != null" >
274 349
         create_user = #{createUser,jdbcType=INTEGER},
275 350
       </if>

+ 25
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/BuildingOwnerInfoController.java Просмотреть файл

@@ -10,12 +10,16 @@ import io.swagger.annotations.Api;
10 10
 import io.swagger.annotations.ApiImplicitParam;
11 11
 import io.swagger.annotations.ApiImplicitParams;
12 12
 import io.swagger.annotations.ApiOperation;
13
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
14
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
13 15
 import org.springframework.beans.factory.annotation.Autowired;
14 16
 import org.springframework.cloud.context.config.annotation.RefreshScope;
15 17
 import org.springframework.web.bind.annotation.*;
16 18
 import org.springframework.web.multipart.MultipartFile;
17 19
 
20
+import javax.servlet.http.HttpServletResponse;
18 21
 import javax.servlet.http.HttpSession;
22
+import java.io.OutputStream;
19 23
 import java.util.List;
20 24
 import java.util.stream.Collectors;
21 25
 
@@ -193,4 +197,25 @@ public class BuildingOwnerInfoController extends BaseController {
193 197
         ResponseBean responseBean = iBuildingOwnerInfoService.communitybuildingUpdate(parameter, userElement.getCommunityId());
194 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 Просмотреть файл

@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
7 7
 import lombok.experimental.Accessors;
8 8
 
9 9
 import java.io.Serializable;
10
+import java.time.LocalDateTime;
10 11
 import java.util.Date;
11 12
 @Data
12 13
 @EqualsAndHashCode(callSuper = false)
@@ -34,6 +35,9 @@ public class TpBuilding implements Serializable {
34 35
      * 楼栋名称
35 36
      */
36 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 Просмотреть файл

@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
8 8
 import lombok.experimental.Accessors;
9 9
 
10 10
 import java.io.Serializable;
11
+import java.time.LocalDateTime;
11 12
 
12 13
 /**
13 14
  * <p>
@@ -67,6 +68,9 @@ public class TpLevel implements Serializable {
67 68
      * 楼层名称
68 69
      */
69 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 Просмотреть файл

@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
8 8
 import lombok.experimental.Accessors;
9 9
 
10 10
 import java.io.Serializable;
11
+import java.time.LocalDateTime;
11 12
 
12 13
 /**
13 14
  * <p>
@@ -37,6 +38,9 @@ public class TpPhase implements Serializable {
37 38
      * 期区名称
38 39
      */
39 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 Просмотреть файл

@@ -8,6 +8,7 @@ import lombok.EqualsAndHashCode;
8 8
 import lombok.experimental.Accessors;
9 9
 
10 10
 import java.io.Serializable;
11
+import java.time.LocalDateTime;
11 12
 
12 13
 /**
13 14
  * <p>
@@ -57,6 +58,9 @@ public class TpUnit implements Serializable {
57 58
      * 单元名称
58 59
      */
59 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 Просмотреть файл

@@ -111,4 +111,11 @@ public interface IBuildingOwnerInfoService extends IService<TpBuildingOwnerInfo>
111 111
      * @return
112 112
      */
113 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 Просмотреть файл

@@ -1,10 +1,9 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3
+import com.alibaba.fastjson.JSON;
3 4
 import com.alibaba.fastjson.JSONObject;
4 5
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
5
-import com.baomidou.mybatisplus.core.enums.SqlMethod;
6 6
 import com.baomidou.mybatisplus.core.metadata.IPage;
7
-import com.baomidou.mybatisplus.core.toolkit.Constants;
8 7
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
9 8
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
10 9
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -21,15 +20,12 @@ import com.community.huiju.model.*;
21 20
 import com.community.huiju.service.IBillInvoiceService;
22 21
 import com.community.huiju.service.IBuildingOwnerInfoService;
23 22
 import com.community.huiju.service.ITaUserService;
24
-import com.google.common.collect.Lists;
25 23
 import com.google.common.collect.Maps;
26 24
 import org.apache.commons.collections.CollectionUtils;
27 25
 
28 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 29
 import org.slf4j.Logger;
34 30
 import org.slf4j.LoggerFactory;
35 31
 
@@ -39,6 +35,8 @@ import org.springframework.stereotype.Service;
39 35
 import org.springframework.transaction.annotation.Transactional;
40 36
 import org.springframework.web.multipart.MultipartFile;
41 37
 
38
+import java.io.IOException;
39
+import java.io.InputStream;
42 40
 import java.time.LocalDateTime;
43 41
 import java.util.*;
44 42
 import java.util.regex.Pattern;
@@ -89,7 +87,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
89 87
         ResponseBean responseBean = new ResponseBean();
90 88
 
91 89
         JSONObject jsonObject = JSONObject.parseObject(parameter);
92
-        TpBuildingOwnerInfo tpBuildingOwnerInfo = jsonObject.toJavaObject(TpBuildingOwnerInfo.class);
90
+        TpBuildingOwnerInfo tpBuildingOwnerInfo = jsonObject.toJavaObject(jsonObject,TpBuildingOwnerInfo.class);
93 91
 
94 92
         Long pageNum = jsonObject.getLong("pageNum") == null ? 1 : jsonObject.getLong("pageNum");
95 93
         Long pageSize = jsonObject.getLong("pageSize") == null ? 10 : jsonObject.getLong("pageSize");
@@ -845,4 +843,87 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
845 843
 
846 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 Просмотреть файл

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

Двоичные данные
CODE/smart-community/property-api/src/main/resources/业主资料库.xlsx Просмотреть файл


+ 9
- 0
VUECODE/smart-property-manage/src/api/buildingOwnerInfo.js Просмотреть файл

@@ -164,3 +164,12 @@ export function communityBuildingAdd(data) {
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 Просмотреть файл

@@ -1,5 +1,5 @@
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 4
 const buildingOwnerInfo = {
5 5
   state: {
@@ -113,6 +113,15 @@ const buildingOwnerInfo = {
113 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 Просмотреть файл

@@ -4,7 +4,8 @@
4 4
     <el-form :inline="true" :model="listQuery" class="form-listQuery">
5 5
       <el-form-item>
6 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 9
           <el-button slot="trigger" size="large" type="primary">选取文件并预览</el-button>
9 10
           <el-button style="margin-left: 10px;" size="large" type="success" @click="submitUpload">提交</el-button>
10 11
           <el-button style="margin-left: 10px;" size="large" type="success" @click="dialogBuildingIndex">取消</el-button>
@@ -142,6 +143,19 @@ export default {
142 143
     },
143 144
     dialogBuildingIndex() {
144 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
 };