Procházet zdrojové kódy

Merge branch 'v3' of http://git.ycjcjy.com/zhiyuxing/estateagents into v3

魏熙美 před 5 roky
rodič
revize
166d730806

+ 2
- 2
pom.xml Zobrazit soubor

@@ -10,8 +10,8 @@
10 10
 	</parent>
11 11
 	<groupId>com.huiju</groupId>
12 12
 	<artifactId>estateagents</artifactId>
13
-	<version>v0.3.2</version>
14
-	<name>estateagents</name>
13
+	<version>v2.5.1</version>
14
+	<name>estateages</name>
15 15
 	<description>置业经纪人</description>
16 16
 
17 17
 	<properties>

+ 37
- 6
src/main/java/com/huiju/estateagents/controller/TaBuildingController.java Zobrazit soubor

@@ -4,6 +4,7 @@ package com.huiju.estateagents.controller;
4 4
 import com.huiju.estateagents.base.ResponseBean;
5 5
 import com.huiju.estateagents.common.CommConstant;
6 6
 import com.huiju.estateagents.common.JWTUtils;
7
+import com.huiju.estateagents.common.StringUtils;
7 8
 import com.huiju.estateagents.entity.TaBuilding;
8 9
 import com.huiju.estateagents.entity.TaPerson;
9 10
 import com.huiju.estateagents.service.ITaBuildingService;
@@ -20,6 +21,7 @@ import com.huiju.estateagents.base.BaseController;
20 21
 import javax.servlet.http.HttpServletRequest;
21 22
 import javax.servlet.http.HttpSession;
22 23
 import java.time.LocalDateTime;
24
+import java.util.ArrayList;
23 25
 import java.util.List;
24 26
 
25 27
 /**
@@ -189,12 +191,14 @@ public class TaBuildingController extends BaseController {
189 191
             @RequestParam(defaultValue = "false") Boolean mine,
190 192
             @RequestParam(required = false) Integer cityId,
191 193
             @RequestParam(required = false) String name,
194
+            @RequestParam(required = false) String buildingType, // 项目类型Id
192 195
             @RequestParam(required = false) String houseType, // 户型
193
-            @RequestParam(required = false) Integer buildingTypeId, // 项目类型Id
194
-            @RequestParam(required = false) Integer minPrice, // 最低价格
195
-            @RequestParam(required = false) Integer maxPrice, // 最高价格
196
-            @RequestParam(required = false) Double minBuildingArea, // 最小面积
197
-            @RequestParam(required = false) Double maxBuildingArea, // 最大面积
196
+            @RequestParam(required = false) String price,   // 价格
197
+            @RequestParam(required = false) String area,    // 面积
198
+//            @RequestParam(required = false) Integer minPrice, // 最低价格
199
+//            @RequestParam(required = false) Integer maxPrice, // 最高价格
200
+//            @RequestParam(required = false) Double minBuildingArea, // 最小面积
201
+//            @RequestParam(required = false) Double maxBuildingArea, // 最大面积
198 202
             HttpServletRequest request
199 203
     ){
200 204
         List<String> targets = null;
@@ -208,9 +212,36 @@ public class TaBuildingController extends BaseController {
208 212
             targets = iTaSaveService.getTargesOfPerson(persons.get(0).getPersonId(), CommConstant.FAVOR_PROJECT);
209 213
         }
210 214
 
211
-        return taBuildingService.getWxBuildingList(pageNum, pageSize, name, targets, cityId,mine, houseType, buildingTypeId, minPrice, maxPrice, minBuildingArea, maxBuildingArea);
215
+        String[] buildingTypeList = !StringUtils.isEmpty(buildingType) ? buildingType.split(",") : null;
216
+        String[] houseTypeList = !StringUtils.isEmpty(houseType) ? houseType.split(",") : null;
217
+        List<String[]> priceList = getParamListOf(price);
218
+        List<String[]> areaList = getParamListOf(area);
219
+
220
+        return taBuildingService.getWxBuildingList(pageNum, pageSize, name, targets, cityId,mine, houseTypeList, buildingTypeList, priceList, areaList);
212 221
     }
213 222
 
223
+
224
+    /**
225
+     * 先按照 逗号 拆分, 再按照 横线 拆分
226
+     * @param params
227
+     * @return
228
+     */
229
+    private List<String[]> getParamListOf(String params) {
230
+        List<String[]> paramList = new ArrayList<>();
231
+
232
+        if (null == params || "".equals(params.trim())) {
233
+            return paramList;
234
+        }
235
+
236
+        String[] paramsArray = params.split(",");
237
+        for(String param : paramsArray) {
238
+            paramList.add(param.split("-"));
239
+        }
240
+
241
+        return paramList;
242
+    }
243
+
244
+
214 245
     /**
215 246
      * 微信推荐楼盘列表
216 247
      * @return

+ 1
- 1
src/main/java/com/huiju/estateagents/controller/TaRecommendCustomerController.java Zobrazit soubor

@@ -99,7 +99,7 @@ public class TaRecommendCustomerController extends BaseController {
99 99
     }
100 100
 
101 101
     /**
102
-     * 推荐客户
102
+     * 报备客户
103 103
      * @param paramStr
104 104
      * @param request
105 105
      * @return

+ 1
- 1
src/main/java/com/huiju/estateagents/controller/TaSaveController.java Zobrazit soubor

@@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletRequest;
12 12
 
13 13
 /**
14 14
  * <p>
15
- * 收藏表  前端控制器
15
+ * 表  前端控制器
16 16
  * </p>
17 17
  *
18 18
  * @author jobob

+ 4
- 0
src/main/java/com/huiju/estateagents/entity/TaPerson.java Zobrazit soubor

@@ -228,6 +228,10 @@ public class TaPerson implements Serializable {
228 228
 
229 229
     private String fromCode;
230 230
 
231
+    private Integer userId;
232
+
233
+    private String userPort;
234
+
231 235
     @TableField(exist = false)
232 236
     private Integer isSave;
233 237
 }

+ 1
- 0
src/main/java/com/huiju/estateagents/interceptor/AccessInterceptor.java Zobrazit soubor

@@ -23,6 +23,7 @@ public class AccessInterceptor implements HandlerInterceptor {
23 23
     private String[] whiteList = {
24 24
             "/wx/chat", // 聊天暂时不鉴权
25 25
             "/api/wx/login",
26
+            "/api/wx/tdCity",
26 27
             "/api/admin/signin",
27 28
             "/api/taCheckin/activity",
28 29
             "/api/wx/qrcode/scene",

+ 12
- 6
src/main/java/com/huiju/estateagents/mapper/TaBuildingMapper.java Zobrazit soubor

@@ -62,13 +62,19 @@ public interface TaBuildingMapper extends BaseMapper<TaBuilding> {
62 62
      * @param name
63 63
      * @param cityId
64 64
      * @param targets
65
-     * @param houseType
66
-     * @param buildingTypeId
65
+     * @param houseTypeList
66
+     * @param buildingTypeList
67
+     * @param priceList
68
+     * @param areaList
67 69
      * @return
68 70
      */
69
-    IPage<TaBuilding> selectBuildingPage(IPage<TaBuilding> page, @Param("name") String name, @Param("cityId") Integer cityId,
70
-                                         @Param("targets") List<String> targets, @Param("houseType") String houseType, @Param("buildingTypeId") Integer buildingTypeId,
71
-                                         @Param("minPrice") Integer minPrice, @Param("maxPrice") Integer maxPrice,
72
-                                         @Param("minBuildingArea") Double minBuildingArea, @Param("maxBuildingArea") Double maxBuildingArea);
71
+    IPage<TaBuilding> selectBuildingPage(IPage<TaBuilding> page,
72
+                                         @Param("name") String name,
73
+                                         @Param("cityId") Integer cityId,
74
+                                         @Param("targets") List<String> targets,
75
+                                         @Param("houseTypeList") String[] houseTypeList,
76
+                                         @Param("buildingTypeList") String[] buildingTypeList,
77
+                                         @Param("priceList") List<String[]> priceList,
78
+                                         @Param("areaList") List<String[]> areaList);
73 79
 
74 80
 }

+ 10
- 1
src/main/java/com/huiju/estateagents/service/ITaBuildingService.java Zobrazit soubor

@@ -117,7 +117,16 @@ public interface ITaBuildingService extends IService<TaBuilding> {
117 117
      * @param pageSize
118 118
      * @param name
119 119
      */
120
-    ResponseBean getWxBuildingList(Integer pageNum, Integer pageSize, String name, List<String> targets,Integer cityId,boolean mine, String houseType, Integer buildingTypeId, Integer minPrice, Integer maxPrice, Double minBuildingArea, Double maxBuildingArea);
120
+    ResponseBean getWxBuildingList(
121
+            Integer pageNum,
122
+            Integer pageSize,
123
+            String name,
124
+            List<String> targets,
125
+            Integer cityId,boolean mine,
126
+            String[] houseTypeList,
127
+            String[] buildingTypeList,
128
+            List<String[]> priceList,
129
+            List<String[]> areaList);
121 130
 
122 131
     /**
123 132
      * 微信小程序 楼盘列表

+ 17
- 9
src/main/java/com/huiju/estateagents/service/impl/TaBuildingServiceImpl.java Zobrazit soubor

@@ -381,9 +381,23 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
381 381
     }
382 382
 
383 383
     @Override
384
-    public ResponseBean getWxBuildingList(Integer pageNum, Integer pageSize, String name, List<String> targets,Integer cityId,boolean mine, String houseType, Integer buildingTypeId, Integer minPrice, Integer maxPrice, Double minBuildingArea, Double maxBuildingArea) {
384
+    public ResponseBean getWxBuildingList(
385
+            Integer pageNum,
386
+            Integer pageSize,
387
+            String name,
388
+            List<String> targets,
389
+            Integer cityId,
390
+            boolean mine,
391
+            String[] houseTypeList,
392
+            String[] buildingTypeList,
393
+            List<String[]> priceList,
394
+            List<String[]> areaList) {
385 395
         IPage<TaBuilding> page = new Page<>(pageNum, pageSize);
386 396
 
397
+        if(CollectionUtils.isEmpty(targets) && mine){
398
+            return ResponseBean.success(page);
399
+        }
400
+
387 401
 //        QueryWrapper<TaBuilding> buildingQueryWrapper = new QueryWrapper<>();
388 402
 //        buildingQueryWrapper.nested(null != name && !"".equals(name.trim()), i -> i.like("name", name).or().like("building_name", name));
389 403
 //        buildingQueryWrapper.eq("status", 1);
@@ -395,7 +409,7 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
395 409
 //
396 410
 //        IPage<TaBuilding> result = taBuildingMapper.selectPage(page, buildingQueryWrapper);
397 411
 
398
-        IPage<TaBuilding> result = taBuildingMapper.selectBuildingPage(page, name, cityId, targets, houseType,buildingTypeId, minPrice, maxPrice, minBuildingArea, maxBuildingArea);
412
+        IPage<TaBuilding> result = taBuildingMapper.selectBuildingPage(page, name, cityId, targets, houseTypeList, buildingTypeList, priceList, areaList);
399 413
 
400 414
         List<TaBuilding> buildingList = result.getRecords();
401 415
         if (CollectionUtils.isNotEmpty(buildingList)) {
@@ -403,14 +417,8 @@ public class TaBuildingServiceImpl extends ServiceImpl<TaBuildingMapper, TaBuild
403 417
                 getBuildingAttaches(build);
404 418
             }
405 419
         }
406
-        if(CollectionUtils.isEmpty(targets) && mine){
407
-            return ResponseBean.success(null);
408
-        }else {
409
-            return ResponseBean.success(result);
410
-        }
411
-
412
-
413 420
 
421
+        return ResponseBean.success(result);
414 422
     }
415 423
 
416 424
     private void getBuildingAttaches(TaBuilding build) {

+ 25
- 23
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java Zobrazit soubor

@@ -229,44 +229,46 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
229 229
         }
230 230
         TaPerson taPerson = taPersons.get(0);
231 231
 
232
-        String checkResult = checkCustomerParams(params);
233
-        if (null != checkResult) {
234
-            return ResponseBean.error(checkResult, ResponseBean.ERROR_MISSING_PARAMS);
235
-        }
232
+//        String checkResult = checkCustomerParams(params);
233
+//        if (null != checkResult) {
234
+//            return ResponseBean.error(checkResult, ResponseBean.ERROR_MISSING_PARAMS);
235
+//        }
236 236
 
237 237
         TaRecommendCustomer taRecommendCustomer = new TaRecommendCustomer();
238 238
 
239
-        taRecommendCustomer.setName(params.getString("name"));
240
-        taRecommendCustomer.setPicture(params.getString("picture"));
239
+        taRecommendCustomer.setName(taPerson.getNickname());
240
+        taRecommendCustomer.setPicture(taPerson.getAvatarurl());
241 241
         taRecommendCustomer.setPhone(params.getString("phone"));
242
-        taRecommendCustomer.setSex(params.getInteger("sex"));
243
-        taRecommendCustomer.setDescribe(params.getString("describe"));
244
-        taRecommendCustomer.setRealtyConsultant(params.getString("RealtyConsultant"));
242
+        taRecommendCustomer.setSex(null == taPerson.getGender() ? null : ("1".equals(taPerson.getGender()) ? 1 : 2));
243
+//        taRecommendCustomer.setDescribe(params.getString("describe"));
244
+        taRecommendCustomer.setRealtyConsultant(params.getString("realtyConsultant"));
245 245
         taRecommendCustomer.setBuildingId(params.getString("buildingId"));
246 246
         taRecommendCustomer.setReportRecommendStatus(CommConstant.REPORTED);
247 247
         taRecommendCustomer.setCreateDate(LocalDateTime.now());
248 248
         taRecommendCustomer.setReportDate(LocalDateTime.now());
249 249
 
250 250
         // 时间格式 yyyy-MM-dd
251
-        String at = params.getString("appointmentTime");
252
-        if (!StringUtils.isEmpty(at)) {
253
-            taRecommendCustomer.setAppointmentTime(DateUtils.day2LocalDateime(at));
254
-        }
251
+//        String at = params.getString("appointmentTime");
252
+//        if (!StringUtils.isEmpty(at)) {
253
+//            taRecommendCustomer.setAppointmentTime(DateUtils.day2LocalDateime(at));
254
+//        }ni
255 255
 
256 256
 //        taRecommendCustomer.setAppointmentTime((String) params.get("appointmentTime"));
257
-        taRecommendCustomer.setVisiteNum(params.getInteger("visiteNum"));
258
-        taRecommendCustomer.setIntention(params.getString("intention"));
259
-        taRecommendCustomer.setRealtyManageType(params.getString("realtyManageType"));
260
-        taRecommendCustomer.setDemandType(params.getString("demandType"));
261
-        taRecommendCustomer.setPriceRange(params.getString("priceRange"));
262
-        taRecommendCustomer.setEntryType(CommConstant.ENTRY_INPUT);
257
+//        taRecommendCustomer.setVisiteNum(params.getInteger("visiteNum"));
258
+//        taRecommendCustomer.setIntention(params.getString("intention"));
259
+//        taRecommendCustomer.setRealtyManageType(params.getString("realtyManageType"));
260
+//        taRecommendCustomer.setDemandType(params.getString("demandType"));
261
+//        taRecommendCustomer.setPriceRange(params.getString("priceRange"));
262
+        taRecommendCustomer.setEntryType(CommConstant.ENTRY_VERIFY);
263 263
         taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
264
+        taRecommendCustomer.setStatus(CommConstant.STATUS_NORMAL + "");
264 265
 
265 266
 
266
-        String status = params.getString("status");
267
-        if (null == status) status = "1";
268
-        taRecommendCustomer.setStatus(status);
269
-        taRecommendCustomer.setRecommendPerson(taPerson.getPersonId());
267
+//        String status = params.getString("status");
268
+//        if (null == status) status = "1";
269
+//        taRecommendCustomer.setStatus(status);
270
+//        taRecommendCustomer.setRecommendPerson(taPerson.getPersonId());
271
+        taRecommendCustomer.setRecommendPerson(params.getString("realtyConsultant"));
270 272
 
271 273
         // 报备有 10 天有效期
272 274
         QueryWrapper<TaRecommendCustomer> queryWrapper = new QueryWrapper<>();

+ 48
- 21
src/main/resources/mapper/TaBuildingMapper.xml Zobrazit soubor

@@ -89,11 +89,11 @@
89 89
                 <if test="cityId != null">
90 90
                     AND city_id = #{cityId}
91 91
                 </if>
92
-                <if test="buildingTypeId != null">
93
-                    AND building_type = #{buildingTypeId}
94
-                </if>
95
-                <if test="targets != null">
96
-                    AND building_id IN (#{targets})
92
+                <if test="targets != null and targets.size > 0">
93
+                    AND building_id IN
94
+                    <foreach collection="targets" item="buildingId" open="(" close=")" separator=",">
95
+                        #{buildingId}
96
+                    </foreach>
97 97
                 </if>
98 98
                 <if test="name != null and name !=''">
99 99
                     AND `name` LIKE CONCAT('%',#{name},'%')
@@ -101,22 +101,33 @@
101 101
                 </if>
102 102
             ) as tb
103 103
 
104
-            <if test="minPrice != null or maxPrice != null or buildingTypeId != null">
104
+            <if test="(priceList != null and priceList.size > 0) or (buildingTypeList != null and buildingTypeList.length > 0)">
105 105
                 INNER JOIN
106 106
                 (
107 107
                 SELECT * FROM ta_building_project_type
108 108
                 <trim prefix="where" prefixOverrides="and | or">
109
-                    <if test="minPrice != null and maxPrice != null">
110
-                        and price BETWEEN #{minPrice} AND #{maxPrice}
111
-                    </if>
112
-                    <if test="minPrice != null and maxPrice == null">
113
-                        <![CDATA[  and price >= #{minPrice}  ]]>
114
-                    </if>
115
-                    <if test="minPrice == null and maxPrice != null">
116
-                        <![CDATA[  and price <= #{maxPrice}  ]]>
109
+
110
+                    <if test="priceList != null">
111
+                        <foreach collection="priceList" item="priceArr" open="(" close=")" separator=" OR ">
112
+                            (
113
+                                <if test='priceArr[0] != null and priceArr[0] != ""'>
114
+                                    <![CDATA[ price >= ${priceArr[0]}  ]]>
115
+                                </if>
116
+                                <if test='priceArr.length > 1 and priceArr[0] != null and priceArr[0] != ""'>
117
+                                    AND
118
+                                </if>
119
+                                <if test='priceArr.length > 1 and priceArr[1] != null and priceArr[1] != ""'>
120
+                                    <![CDATA[ price <= ${priceArr[1]}  ]]>
121
+                                </if>
122
+                            )
123
+                        </foreach>
117 124
                     </if>
118
-                    <if test="buildingTypeId != null">
119
-                        AND building_type_id = #{buildingTypeId}
125
+
126
+                    <if test="buildingTypeList != null and buildingTypeList.length > 0">
127
+                        AND building_type_id in
128
+                        <foreach collection="buildingTypeList" item="buildingType" open="(" close=")" separator=",">
129
+                            #{buildingType}
130
+                        </foreach>
120 131
                     </if>
121 132
                 </trim>
122 133
                 GROUP BY building_id
@@ -124,16 +135,32 @@
124 135
                 AS tbpt ON tb.building_id = tbpt.building_id
125 136
             </if>
126 137
 
127
-            <if test="minBuildingArea != null or maxBuildingArea != null or (houseType != null and houseType != '')">
138
+            <if test="(areaList != null and areaList.size > 0) or (houseTypeList != null and houseTypeList.length > 0)">
128 139
                 INNER JOIN
129 140
                 (
130 141
                 SELECT * FROM ta_building_apartment
131 142
                 <trim prefix="where" prefixOverrides="and | or">
132
-                    <if test="minBuildingArea != null and maxBuildingArea != null">
133
-                        and building_area BETWEEN #{minBuildingArea} AND #{maxBuildingArea}
143
+                    <if test="areaList != null">
144
+                        <foreach collection="areaList" item="areaArr" open="(" close=")" separator=" OR ">
145
+                            (
146
+                                <if test='areaArr[0] != null and areaArr[0] != ""'>
147
+                                    <![CDATA[ building_area >= ${areaArr[0]}  ]]>
148
+                                </if>
149
+                                <if test='areaArr.length > 1 and areaArr[0] != null and areaArr[0] != ""'>
150
+                                    AND
151
+                                </if>
152
+                                <if test='areaArr.length > 1 and areaArr[1] != null and areaArr[1] != ""'>
153
+                                    <![CDATA[ building_area <= ${areaArr[1]}  ]]>
154
+                                </if>
155
+                            )
156
+                        </foreach>
134 157
                     </if>
135
-                    <if test="houseType != null and houseType != ''">
136
-                        AND house_type = #{houseType}
158
+
159
+                    <if test="houseTypeList != null and houseTypeList.length > 0">
160
+                        AND house_type in
161
+                        <foreach collection="houseTypeList" item="houseType" open="(" close=")" separator=",">
162
+                            #{houseType}
163
+                        </foreach>
137 164
                     </if>
138 165
                 </trim>
139 166
                 GROUP BY building_id