瀏覽代碼

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

张延森 5 年之前
父節點
當前提交
7b9b98575a

+ 5
- 0
src/main/java/com/huiju/estateagents/common/CommConstant.java 查看文件

518
      */
518
      */
519
     public static final String EVENT_H5 = "h5";
519
     public static final String EVENT_H5 = "h5";
520
 
520
 
521
+    /**
522
+     * 房源分享
523
+     */
524
+    public static final String HOUSE = "house";
525
+
521
     /**
526
     /**
522
      * 系统参数  通知消息次时间间隔
527
      * 系统参数  通知消息次时间间隔
523
      */
528
      */

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

380
                 case CommConstant.EVENT_H5:
380
                 case CommConstant.EVENT_H5:
381
                     e.setDrainageShareNum(shareNum);
381
                     e.setDrainageShareNum(shareNum);
382
                     break;
382
                     break;
383
+                case CommConstant.HOUSE:
384
+                    e.setHouseShareNum(shareNum);
385
+                    break;
383
             }
386
             }
384
         });
387
         });
385
         result.setRecords(taConsultantInfos);
388
         result.setRecords(taConsultantInfos);

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

167
     /**
167
     /**
168
      * 取消房源预选
168
      * 取消房源预选
169
      *
169
      *
170
-     * @param personId 用户ID
171
      * @return
170
      * @return
172
      */
171
      */
173
     @RequestMapping(value = "/wx/taPreselectionRecordCancel", method = RequestMethod.DELETE)
172
     @RequestMapping(value = "/wx/taPreselectionRecordCancel", method = RequestMethod.DELETE)
174
-    public ResponseBean taPreselectionRecordCancel(@RequestParam("personId") String personId,
175
-                                                   @RequestParam("houseId") String houseId) {
173
+    public ResponseBean taPreselectionRecordCancel(@RequestParam("houseId") String houseId,
174
+                                                   @RequestParam("personId") String personId) {
176
         ResponseBean responseBean = new ResponseBean();
175
         ResponseBean responseBean = new ResponseBean();
177
         try {
176
         try {
178
             responseBean = iTaPreselectionRecordService.taPreselectionRecordCancel(personId, houseId);
177
             responseBean = iTaPreselectionRecordService.taPreselectionRecordCancel(personId, houseId);

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

32
 
32
 
33
     private Integer drainageShareNum;
33
     private Integer drainageShareNum;
34
 
34
 
35
+    private Integer houseShareNum;
36
+
35
     private Integer buildingTypeId;
37
     private Integer buildingTypeId;
36
 
38
 
37
     private String priceType;
39
     private String priceType;

+ 1
- 10
src/main/java/com/huiju/estateagents/service/ITaPreselectionRecordService.java 查看文件

38
     /**
38
     /**
39
      * 取消预选
39
      * 取消预选
40
      *
40
      *
41
-     * @param personId 用户ID
41
+     * @param personId
42
      * @param houseId  房源ID
42
      * @param houseId  房源ID
43
      * @return
43
      * @return
44
      */
44
      */
45
     ResponseBean taPreselectionRecordCancel(String personId, String houseId);
45
     ResponseBean taPreselectionRecordCancel(String personId, String houseId);
46
 
46
 
47
-    /**
48
-     * 校验用户是否预选
49
-     *
50
-     * @param personId 用户ID
51
-     * @param houseId  房源ID
52
-     * @return
53
-     */
54
-    TaPreselectionRecord checkPreselect(String personId, String houseId);
55
-
56
     ResponseBean selectPreSelectRecordList(Integer pageNum, Integer pageSize, String salesBatchId, Integer houseId, Integer orgId, String phone, String apartmentId, Integer status);
47
     ResponseBean selectPreSelectRecordList(Integer pageNum, Integer pageSize, String salesBatchId, Integer houseId, Integer orgId, String phone, String apartmentId, Integer status);
57
 
48
 
58
 }
49
 }

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

161
 
161
 
162
         // 获取该用户是否预选房源信息
162
         // 获取该用户是否预选房源信息
163
         TaPreselectionRecord taPreselectionRecord = taPreselectionRecordMapper.getRecordByPersonIdAndHouseId(personId, houseId);
163
         TaPreselectionRecord taPreselectionRecord = taPreselectionRecordMapper.getRecordByPersonIdAndHouseId(personId, houseId);
164
-        if (taPreselectionRecord != null && taPreselectionRecord.getStatus() == 1) {
164
+        if (taPreselectionRecord != null) {
165
             resourcesPO.setIsPreselect(true);
165
             resourcesPO.setIsPreselect(true);
166
         } else {
166
         } else {
167
             resourcesPO.setIsPreselect(false);
167
             resourcesPO.setIsPreselect(false);

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

99
         // 校验用户是否已经预选房源
99
         // 校验用户是否已经预选房源
100
         TaPreselectionRecord record = taPreselectionRecordMapper
100
         TaPreselectionRecord record = taPreselectionRecordMapper
101
                 .getRecordByPersonIdAndHouseId(taPreselectionRecord.getPersonId(), taPreselectionRecord.getHouseId());
101
                 .getRecordByPersonIdAndHouseId(taPreselectionRecord.getPersonId(), taPreselectionRecord.getHouseId());
102
-        if (record != null && 1 == record.getStatus()) {
102
+        if (record != null) {
103
             responseBean.addError("已预选过此房源,请到选房记录中查看。");
103
             responseBean.addError("已预选过此房源,请到选房记录中查看。");
104
             return responseBean;
104
             return responseBean;
105
         }
105
         }
152
         ResponseBean responseBean = new ResponseBean<>();
152
         ResponseBean responseBean = new ResponseBean<>();
153
         // 校验是否已经取消
153
         // 校验是否已经取消
154
         TaPreselectionRecord preselectionRecord = taPreselectionRecordMapper.getRecordByPersonIdAndHouseId(personId, houseId);
154
         TaPreselectionRecord preselectionRecord = taPreselectionRecordMapper.getRecordByPersonIdAndHouseId(personId, houseId);
155
-        if (preselectionRecord == null || 1 != preselectionRecord.getStatus()) {
155
+        if (preselectionRecord == null) {
156
             responseBean.addError("未预选过此房源,或已取消预选此房源");
156
             responseBean.addError("未预选过此房源,或已取消预选此房源");
157
             return responseBean;
157
             return responseBean;
158
         }
158
         }
181
         return responseBean;
181
         return responseBean;
182
     }
182
     }
183
 
183
 
184
-    @Override
185
-    public TaPreselectionRecord checkPreselect(String personId, String houseId) {
186
-        logger.info("checkPreselect 接收参数:personId:{},houseId:{}", personId, houseId);
187
-
188
-        return taPreselectionRecordMapper.getRecordByPersonIdAndHouseId(personId, houseId);
189
-    }
190
-
191
     @Override
184
     @Override
192
     public ResponseBean selectPreSelectRecordList(Integer pageNum, Integer pageSize, String salesBatchId, Integer houseId, Integer orgId, String phone, String apartmentId, Integer status) {
185
     public ResponseBean selectPreSelectRecordList(Integer pageNum, Integer pageSize, String salesBatchId, Integer houseId, Integer orgId, String phone, String apartmentId, Integer status) {
193
         Page page = new Page(pageNum, pageSize);
186
         Page page = new Page(pageNum, pageSize);

+ 22
- 9
src/main/resources/mapper/TaHousingResourcesMapper.xml 查看文件

57
             AND t.`status` > 0
57
             AND t.`status` > 0
58
           ) t5
58
           ) t5
59
         ORDER BY
59
         ORDER BY
60
-            REPLACE ( CONVERT ( t5.termName USING ascii ), '?', '' ) + 0,
61
-            REPLACE ( CONVERT ( t5.block_name USING ascii ), '?', '' ) + 0,
62
-            REPLACE ( CONVERT ( t5.unit_name USING ascii ), '?', '' ) + 0,
63
-            REPLACE ( CONVERT ( t5.floor_name USING ascii ), '?', '' ) + 0 desc ,
64
-            REPLACE ( CONVERT ( t5.room_name USING ascii ), '?', '' ) + 0
60
+            ( SELECT num_char_extract ( t5.termName, 2 ) ),
61
+            ( SELECT num_char_extract ( t5.block_name, 2 ) ),
62
+            ( SELECT num_char_extract ( t5.unit_name, 2 ) ),
63
+            ( SELECT num_char_extract ( t5.floor_name, 2 ) ) DESC,
64
+            ( SELECT num_char_extract ( t5.room_name, 2 ) )
65
     </select>
65
     </select>
66
 
66
 
67
     <select id="listBuildApartmentBySalesBatchId" resultType="com.huiju.estateagents.entity.TaBuildingApartment">
67
     <select id="listBuildApartmentBySalesBatchId" resultType="com.huiju.estateagents.entity.TaBuildingApartment">
68
-        SELECT
68
+	    SELECT
69
             t3.apartment_id,
69
             t3.apartment_id,
70
             t3.apartment_name,
70
             t3.apartment_name,
71
             t3.apartment_type,
71
             t3.apartment_type,
72
             t3.inside_area,
72
             t3.inside_area,
73
-            t3.building_area
73
+            t3.building_area,
74
+            t2.apartment_id
75
+        FROM
76
+            (
77
+        SELECT
78
+            t.sales_batch_id,
79
+            t.apartment_id
74
         FROM
80
         FROM
75
-            ( SELECT t.sales_batch_id, t.apartment_id FROM ta_housing_resources t WHERE t.sales_batch_id = #{salesBatchId} and t.apartment_id is not null GROUP BY t.apartment_id ) t2
81
+            ta_housing_resources t
82
+        WHERE
83
+            t.sales_batch_id = #{salesBatchId}
84
+            AND t.`status` > 0
85
+            AND t.apartment_id IS NOT NULL
86
+        GROUP BY
87
+            t.apartment_id
88
+            ) t2
76
             LEFT JOIN ta_building_apartment t3 ON t2.apartment_id = t3.apartment_id
89
             LEFT JOIN ta_building_apartment t3 ON t2.apartment_id = t3.apartment_id
77
         ORDER BY
90
         ORDER BY
78
-	      t3.apartment_name
91
+            t3.apartment_name
79
     </select>
92
     </select>
80
 
93
 
81
     <update id="updateForAddHeat" parameterType="java.lang.String">
94
     <update id="updateForAddHeat" parameterType="java.lang.String">

+ 1
- 1
src/main/resources/mapper/TaPersonVisitRecordMapper.xml 查看文件

347
             '2' as building_name,
347
             '2' as building_name,
348
             '3' as address,
348
             '3' as address,
349
             1 as building_type_id,
349
             1 as building_type_id,
350
-			t.tagert_type as eventType,
350
+			left(t.tagert_type,5) as eventType,
351
 			t.create_date as visit_time
351
 			t.create_date as visit_time
352
             from ta_share t
352
             from ta_share t
353
             left join ta_sales_batch g on t.be_share = g.sales_batch_id
353
             left join ta_sales_batch g on t.be_share = g.sales_batch_id

+ 8
- 6
src/main/resources/mapper/TaPreselectionRecordMapper.xml 查看文件

16
             t.house_id,
16
             t.house_id,
17
             t.`status`,
17
             t.`status`,
18
             t.create_date,
18
             t.create_date,
19
+            t2.term_name,
19
             t2.block_name,
20
             t2.block_name,
20
             t2.unit_name,
21
             t2.unit_name,
21
             t2.floor_name,
22
             t2.floor_name,
32
             t.person_id = #{personId}
33
             t.person_id = #{personId}
33
             AND t.org_id = #{orgId}
34
             AND t.org_id = #{orgId}
34
             AND t.house_id = t2.house_id
35
             AND t.house_id = t2.house_id
35
-        ORDER BY
36
-            t.create_date DESC
37
             ) t3
36
             ) t3
38
             LEFT JOIN ta_building t4 ON t3.buildingId = t4.building_id
37
             LEFT JOIN ta_building t4 ON t3.buildingId = t4.building_id
39
             LEFT JOIN ta_sales_batch t5 ON t3.saleBatchId = t5.sales_batch_id
38
             LEFT JOIN ta_sales_batch t5 ON t3.saleBatchId = t5.sales_batch_id
39
+         ORDER BY
40
+            t3.create_date DESC
40
     </select>
41
     </select>
41
 
42
 
42
     <select id="getRecordByPersonIdAndHouseId" resultType="com.huiju.estateagents.entity.TaPreselectionRecord">
43
     <select id="getRecordByPersonIdAndHouseId" resultType="com.huiju.estateagents.entity.TaPreselectionRecord">
47
         WHERE
48
         WHERE
48
             t.person_id = #{personId}
49
             t.person_id = #{personId}
49
             AND t.house_id = #{houseId}
50
             AND t.house_id = #{houseId}
51
+            AND t.status = 1
50
     </select>
52
     </select>
51
 
53
 
52
     <select id="selectPreSelectRecordList" resultType="com.huiju.estateagents.po.TaPreselectionRecordPO">
54
     <select id="selectPreSelectRecordList" resultType="com.huiju.estateagents.po.TaPreselectionRecordPO">
53
         select t.house_id,
55
         select t.house_id,
54
-        a.block_id as blockName,
55
-        a.unit_id as unitName,
56
-        a.floor_id as floorName,
57
-        a.room_id as roomName,
56
+        a.block_name,
57
+        a.unit_name,
58
+        a.floor_name,
59
+        a.room_name,
58
         a.apartment_id,
60
         a.apartment_id,
59
         b.nickname as nameOrnick,
61
         b.nickname as nameOrnick,
60
         b.`name`,
62
         b.`name`,

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

25
         when e.building_name != null || e.building_name != '' then e.building_name
25
         when e.building_name != null || e.building_name != '' then e.building_name
26
         when f.news_name != null || f.news_name != '' then f.news_name
26
         when f.news_name != null || f.news_name != '' then f.news_name
27
         when g.`name` != null || g.`name` != '' then g.`name`
27
         when g.`name` != null || g.`name` != '' then g.`name`
28
+        when h.sales_batch_name != null || h.sales_batch_name != '' then h.sales_batch_name
28
         else '空'
29
         else '空'
29
         end as shareTitle,t.create_date
30
         end as shareTitle,t.create_date
30
-
31
         from ta_share_count t
31
         from ta_share_count t
32
         left join ta_building_dynamic a on t.be_share = a.dynamic_id and t.tagert_type = 'activity'
32
         left join ta_building_dynamic a on t.be_share = a.dynamic_id and t.tagert_type = 'activity'
33
         left join ta_help_activity b on t.be_share = b.help_activity_id and t.tagert_type = 'help'
33
         left join ta_help_activity b on t.be_share = b.help_activity_id and t.tagert_type = 'help'
35
         LEFT JOIN ta_drainage d on t.be_share = d.drainage_id and t.tagert_type = 'h5'
35
         LEFT JOIN ta_drainage d on t.be_share = d.drainage_id and t.tagert_type = 'h5'
36
         left join ta_building e on t.be_share = e.building_id and t.tagert_type = 'project'
36
         left join ta_building e on t.be_share = e.building_id and t.tagert_type = 'project'
37
         LEFT JOIN ta_news f on t.be_share = f.news_id and t.tagert_type = 'news'
37
         LEFT JOIN ta_news f on t.be_share = f.news_id and t.tagert_type = 'news'
38
+        LEFT JOIN ta_sales_batch h on t.be_share = h.sales_batch_id and t.tagert_type like CONCAT('house' , '%')
38
         left JOIN ta_person g on t.be_share = g.person_id and t.tagert_type = 'consultant'
39
         left JOIN ta_person g on t.be_share = g.person_id and t.tagert_type = 'consultant'
39
         where t.person_id = #{personId}
40
         where t.person_id = #{personId}
40
         <if test="shareType != null and shareType != ''">
41
         <if test="shareType != null and shareType != ''">
41
-            and t.tagert_type = #{shareType}
42
+            and (t.tagert_type = #{shareType} || t.tagert_type like CONCAT(#{shareType} , '%'))
42
         </if>
43
         </if>
43
         <if test="shareTitle != null and shareTitle != ''">
44
         <if test="shareTitle != null and shareTitle != ''">
44
             and
45
             and
49
                 d.`name` like CONCAT('%', #{shareTitle} , '%') or
50
                 d.`name` like CONCAT('%', #{shareTitle} , '%') or
50
                 e.building_name like CONCAT('%', #{shareTitle} , '%') or
51
                 e.building_name like CONCAT('%', #{shareTitle} , '%') or
51
                 f.news_name like CONCAT('%', #{shareTitle} , '%') or
52
                 f.news_name like CONCAT('%', #{shareTitle} , '%') or
52
-                g.`name` like CONCAT('%', #{shareTitle} , '%')
53
+                g.`name` like CONCAT('%', #{shareTitle} , '%') or
54
+                h.sales_batch_name like CONCAT('%', #{shareTitle} , '%')
53
             )
55
             )
54
         </if>
56
         </if>
55
         order by t.create_date desc
57
         order by t.create_date desc