胡轶钦 5 年之前
父節點
當前提交
793be180e1

+ 9
- 3
src/main/java/com/huiju/estateagents/controller/MiniAppController.java 查看文件

208
             if(!taRecommendCustomerService.updateById(customers)){
208
             if(!taRecommendCustomerService.updateById(customers)){
209
                 return ResponseBean.error("验证人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
209
                 return ResponseBean.error("验证人员信息失败", ResponseBean.ERROR_UNAVAILABLE);
210
             }
210
             }
211
-            person.setRecommendPerson(customers.getRecommendPerson());
212
-            TaPerson recommender = taPersonService.getById(customers.getRecommendPerson());
213
-            person.setRecommendPersonType(recommender.getPersonType());
211
+            if(null != customers.getRecommendPerson()&&!StringUtils.isEmpty(customers.getRecommendPerson())){
212
+                person.setRecommendPerson(customers.getRecommendPerson());
213
+                person.setRecommendPerson(customers.getRecommendPerson());
214
+                TaPerson recommender = taPersonService.getById(customers.getRecommendPerson());
215
+                if(null != recommender.getPersonType()&&!StringUtils.isEmpty(recommender.getPersonType())){
216
+                    person.setRecommendPersonType(recommender.getPersonType());
217
+                }
218
+            }
219
+
214
             QueryWrapper<TaCustomerPerson> customerPersonQueryWrapper = new QueryWrapper<>();
220
             QueryWrapper<TaCustomerPerson> customerPersonQueryWrapper = new QueryWrapper<>();
215
             customerPersonQueryWrapper.eq("person_id",person.getPersonId());
221
             customerPersonQueryWrapper.eq("person_id",person.getPersonId());
216
             customerPersonQueryWrapper.eq("customer_id",customers.getCustomerId());
222
             customerPersonQueryWrapper.eq("customer_id",customers.getCustomerId());

+ 21
- 0
src/main/java/com/huiju/estateagents/controller/TaBuildingController.java 查看文件

75
         return taBuildingService.buildingList(pageNum,pageSize,name,code,startDate,buildingStatus,marketStatus,cityId,isMain);
75
         return taBuildingService.buildingList(pageNum,pageSize,name,code,startDate,buildingStatus,marketStatus,cityId,isMain);
76
     }
76
     }
77
 
77
 
78
+    /**
79
+     * 楼盘列表
80
+     * @param pageNum
81
+     * @param pageSize
82
+     * @param name
83
+     * @param code
84
+     * @return
85
+     */
86
+    @GetMapping("/admin/buildinglist/select")
87
+    public ResponseBean buildingListSelect(@RequestParam(value = "pageNum", defaultValue = "1")Integer pageNum,
88
+                                     @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize,
89
+                                     @RequestParam(value = "name", required = false)String name,
90
+                                     @RequestParam(value = "code", required = false)String code,
91
+                                     @RequestParam(value = "startDate",required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)LocalDateTime startDate,
92
+                                     @RequestParam(value = "buildingStatus",required = false)String buildingStatus,
93
+                                     @RequestParam(value = "marketStatus",required = false)String marketStatus,
94
+                                     @RequestParam(value = "cityId",required = false)Integer cityId,
95
+                                     @RequestParam(value = "isMain",required = false)Integer isMain){
96
+        return taBuildingService.buildingListSelect(pageNum,pageSize,name,code,startDate,buildingStatus,marketStatus,cityId,isMain);
97
+    }
98
+
78
     /**
99
     /**
79
      * 更新楼盘
100
      * 更新楼盘
80
      * @param parameter
101
      * @param parameter

+ 2
- 0
src/main/java/com/huiju/estateagents/controller/TaBuildingDynamicController.java 查看文件

318
         return responseBean;
318
         return responseBean;
319
     }
319
     }
320
 
320
 
321
+
322
+
321
 }
323
 }
322
 
324
 

+ 8
- 0
src/main/java/com/huiju/estateagents/mapper/TaBuildingMapper.java 查看文件

30
      */
30
      */
31
     List<TaBuilding> buildingList(IPage<TaBuilding> page, @Param("Name") String name, @Param("Code")String code,@Param("startDate")LocalDateTime startDate, @Param("buildingStatus")String buildingStatus, @Param("marketStatus")String marketStatus, @Param("cityId")Integer cityId, @Param("isMain")Integer isMain);
31
     List<TaBuilding> buildingList(IPage<TaBuilding> page, @Param("Name") String name, @Param("Code")String code,@Param("startDate")LocalDateTime startDate, @Param("buildingStatus")String buildingStatus, @Param("marketStatus")String marketStatus, @Param("cityId")Integer cityId, @Param("isMain")Integer isMain);
32
 
32
 
33
+    /**
34
+     * 楼盘列表
35
+     * @param page
36
+     * @return
37
+     */
38
+    List<TaBuilding> buildingListSelect(IPage<TaBuilding> page, @Param("Name") String name, @Param("Code")String code,@Param("startDate")LocalDateTime startDate, @Param("buildingStatus")String buildingStatus, @Param("marketStatus")String marketStatus, @Param("cityId")Integer cityId, @Param("isMain")Integer isMain);
39
+
40
+
33
     @Update("UPDATE ta_building  SET ${field} = IFNULL(${field}, 0) + #{increment}  WHERE building_id = #{buildingId}")
41
     @Update("UPDATE ta_building  SET ${field} = IFNULL(${field}, 0) + #{increment}  WHERE building_id = #{buildingId}")
34
     void setFieldNum(@Param("buildingId") String buildingId, @Param("field") String field, @Param("increment") int increment);
42
     void setFieldNum(@Param("buildingId") String buildingId, @Param("field") String field, @Param("increment") int increment);
35
 
43
 

+ 1
- 1
src/main/java/com/huiju/estateagents/mapper/TaRecommendCustomerMapper.java 查看文件

21
 
21
 
22
     String getCustomerPersonId(@Param("customerId")String customerId);
22
     String getCustomerPersonId(@Param("customerId")String customerId);
23
 
23
 
24
-    TaRecommendCustomer getCustomerDetail(@Param("customerId")String customerId);
24
+    TaRecommendCustomer getCustomerDetail(@Param("customerId")String customerId,@Param("personId")String personId);
25
 
25
 
26
     TaRecommendCustomer getCustomerById(@Param("customerId")String customerId);
26
     TaRecommendCustomer getCustomerById(@Param("customerId")String customerId);
27
 
27
 

+ 8
- 0
src/main/java/com/huiju/estateagents/service/ITaBuildingService.java 查看文件

26
      */
26
      */
27
     ResponseBean buildingList(Integer pageNum, Integer pageSize, String name, String code, LocalDateTime startDate, String buildingStatus, String marketStatus, Integer cityId, Integer isMain);
27
     ResponseBean buildingList(Integer pageNum, Integer pageSize, String name, String code, LocalDateTime startDate, String buildingStatus, String marketStatus, Integer cityId, Integer isMain);
28
 
28
 
29
+    /**
30
+     * 楼盘列表
31
+     * @param pageNum
32
+     * @param pageSize
33
+     * @return
34
+     */
35
+    ResponseBean buildingListSelect(Integer pageNum, Integer pageSize, String name, String code, LocalDateTime startDate, String buildingStatus, String marketStatus, Integer cityId, Integer isMain);
36
+
29
     /**
37
     /**
30
      * 楼盘详情
38
      * 楼盘详情
31
      * @param id
39
      * @param id

+ 10
- 0
src/main/java/com/huiju/estateagents/service/impl/TaBuildingServiceImpl.java 查看文件

73
 
73
 
74
         return ResponseBean.success(page);
74
         return ResponseBean.success(page);
75
     }
75
     }
76
+    @Override
77
+    public ResponseBean buildingListSelect(Integer pageNum, Integer pageSize, String name, String code, LocalDateTime startDate, String buildingStatus, String marketStatus, Integer cityId, Integer isMain) {
78
+        Page<TaBuilding> page = new Page<>();
79
+        page.setSize(pageSize == null ? 10 : pageSize);
80
+        page.setCurrent(pageNum == null ? 1 : pageNum);
81
+        List<TaBuilding> building = taBuildingMapper.buildingListSelect(page, name, code,startDate,buildingStatus,marketStatus,cityId,isMain);
82
+        page.setRecords(building);
83
+
84
+        return ResponseBean.success(page);
85
+    }
76
 
86
 
77
     @Override
87
     @Override
78
     public ResponseBean buildingSelectId(String id) {
88
     public ResponseBean buildingSelectId(String id) {

+ 3
- 0
src/main/java/com/huiju/estateagents/service/impl/TaFavorServiceImpl.java 查看文件

81
         if (typeOf.equals("card")) {
81
         if (typeOf.equals("card")) {
82
             taPersonMapper.setFieldIncrement(like,"like_num", 1);
82
             taPersonMapper.setFieldIncrement(like,"like_num", 1);
83
         }
83
         }
84
+        if (typeOf.equals(CommConstant.FAVOR_CONSULTANT)) {
85
+            taPersonMapper.setFieldIncrement(like,"like_num", 1);
86
+        }
84
 
87
 
85
         // 如果是资讯点赞, 则 +1
88
         // 如果是资讯点赞, 则 +1
86
         if(typeOf.equals(CommConstant.FAVOR_NEWS)) {
89
         if(typeOf.equals(CommConstant.FAVOR_NEWS)) {

+ 2
- 2
src/main/java/com/huiju/estateagents/service/impl/TaRecommendCustomerServiceImpl.java 查看文件

261
 
261
 
262
     @Override
262
     @Override
263
     public TaRecommendCustomer getCustomerDetail(String customerId){
263
     public TaRecommendCustomer getCustomerDetail(String customerId){
264
-        TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.getCustomerDetail(customerId);
265
-        String personId = taRecommendCustomer.getPersonId();
264
+        String personId = taRecommendCustomerMapper.getCustomerById(customerId).getPersonId();
265
+        TaRecommendCustomer taRecommendCustomer = taRecommendCustomerMapper.getCustomerDetail(customerId,personId);
266
         if(!StringUtils.isEmpty(personId)){
266
         if(!StringUtils.isEmpty(personId)){
267
             taRecommendCustomer.setVisitRecords(taPersonVisitRecordMapper.visitRecordByPersonId(personId));
267
             taRecommendCustomer.setVisitRecords(taPersonVisitRecordMapper.visitRecordByPersonId(personId));
268
             taRecommendCustomer.setVisitTimes(taPersonVisitRecordMapper.visitRecordByPersonId(personId).size());
268
             taRecommendCustomer.setVisitTimes(taPersonVisitRecordMapper.visitRecordByPersonId(personId).size());

+ 27
- 0
src/main/resources/mapper/TaBuildingMapper.xml 查看文件

30
         ORDER BY create_date DESC
30
         ORDER BY create_date DESC
31
     </select>
31
     </select>
32
 
32
 
33
+    <select id="buildingListSelect" resultType="com.huiju.estateagents.entity.TaBuilding">
34
+        SELECT * FROM ta_building
35
+        <where>
36
+            status > -1
37
+            and  ta_building.building_status = 1
38
+            <if test="Name != null and Name != ''">
39
+                and  (ta_building.name like concat('%',#{Name,jdbcType=VARCHAR},'%') or ta_building.building_name like concat('%',#{Name,jdbcType=VARCHAR},'%'))
40
+            </if>
41
+            <if test="Code != null and Code != ''">
42
+                and  ta_building.code like concat('%',#{Code,jdbcType=VARCHAR},'%')
43
+            </if>
44
+            <if test="startDate != null">
45
+                and  TO_DAYS(ta_building.opening_date ) = TO_DAYS(#{startDate})
46
+            </if>
47
+            <if test="marketStatus != null and marketStatus != ''">
48
+                and  ta_building.market_status =#{marketStatus}
49
+            </if>
50
+            <if test="cityId != null and cityId != ''">
51
+                and  ta_building.city_id =#{cityId}
52
+            </if>
53
+            <if test="isMain != null and isMain != ''">
54
+                and  ta_building.is_main = #{isMain}
55
+            </if>
56
+        </where>
57
+        ORDER BY create_date DESC
58
+    </select>
59
+
33
     <select id="buildingAll" resultType="com.huiju.estateagents.entity.TaBuilding">
60
     <select id="buildingAll" resultType="com.huiju.estateagents.entity.TaBuilding">
34
          SELECT * FROM ta_building
61
          SELECT * FROM ta_building
35
          where status > -1
62
          where status > -1

+ 5
- 5
src/main/resources/mapper/TaRecommendCustomerMapper.xml 查看文件

20
     </select>
20
     </select>
21
 
21
 
22
     <select id="getCustomerDetail" resultType="com.huiju.estateagents.entity.TaRecommendCustomer">
22
     <select id="getCustomerDetail" resultType="com.huiju.estateagents.entity.TaRecommendCustomer">
23
-        SELECT
23
+      SELECT
24
 	a.*,
24
 	a.*,
25
-	(select c.visit_time FROM ta_person_visit_record c where b.person_id = c.person_id ORDER BY c.visit_time desc LIMIT 1) as visitTime,
26
-	(SELECT SUM(d.visit_duration) FROM ta_person_visit_record d WHERE b.person_id = d.person_id) as duration
25
+	(select c.visit_time FROM ta_person_visit_record c where c.person_id = #{personId} ORDER BY c.visit_time desc LIMIT 1) as visitTime,
26
+	(SELECT SUM(d.visit_duration) FROM ta_person_visit_record d WHERE d.person_id= #{personId}) as duration
27
 FROM
27
 FROM
28
 	ta_recommend_customer a
28
 	ta_recommend_customer a
29
-	LEFT JOIN ta_customer_person b on a.customer_id = b.customer_id
30
-	LEFT JOIN ta_person_visit_record c ON b.person_id = c.person_id
29
+	LEFT JOIN ta_person_visit_record c ON a.person_id = c.person_id
31
 	where a.customer_id = #{customerId}
30
 	where a.customer_id = #{customerId}
31
+	GROUP BY a.customer_id
32
     </select>
32
     </select>
33
 
33
 
34
     <select id="getCustomerList" resultType="com.huiju.estateagents.entity.TaRecommendCustomer">
34
     <select id="getCustomerList" resultType="com.huiju.estateagents.entity.TaRecommendCustomer">