Parcourir la source

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

张延森 il y a 5 ans
Parent
révision
7b9b98575a

+ 5
- 0
src/main/java/com/huiju/estateagents/common/CommConstant.java Voir le fichier

@@ -518,6 +518,11 @@ public class CommConstant {
518 518
      */
519 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 Voir le fichier

@@ -380,6 +380,9 @@ public class TaPersonVisitRecordController extends BaseController {
380 380
                 case CommConstant.EVENT_H5:
381 381
                     e.setDrainageShareNum(shareNum);
382 382
                     break;
383
+                case CommConstant.HOUSE:
384
+                    e.setHouseShareNum(shareNum);
385
+                    break;
383 386
             }
384 387
         });
385 388
         result.setRecords(taConsultantInfos);

+ 2
- 3
src/main/java/com/huiju/estateagents/controller/TaPreselectionRecordController.java Voir le fichier

@@ -167,12 +167,11 @@ public class TaPreselectionRecordController extends BaseController {
167 167
     /**
168 168
      * 取消房源预选
169 169
      *
170
-     * @param personId 用户ID
171 170
      * @return
172 171
      */
173 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 175
         ResponseBean responseBean = new ResponseBean();
177 176
         try {
178 177
             responseBean = iTaPreselectionRecordService.taPreselectionRecordCancel(personId, houseId);

+ 2
- 0
src/main/java/com/huiju/estateagents/entity/TaConsultantInfo.java Voir le fichier

@@ -32,6 +32,8 @@ public class TaConsultantInfo {
32 32
 
33 33
     private Integer drainageShareNum;
34 34
 
35
+    private Integer houseShareNum;
36
+
35 37
     private Integer buildingTypeId;
36 38
 
37 39
     private String priceType;

+ 1
- 10
src/main/java/com/huiju/estateagents/service/ITaPreselectionRecordService.java Voir le fichier

@@ -38,21 +38,12 @@ public interface ITaPreselectionRecordService extends IService<TaPreselectionRec
38 38
     /**
39 39
      * 取消预选
40 40
      *
41
-     * @param personId 用户ID
41
+     * @param personId
42 42
      * @param houseId  房源ID
43 43
      * @return
44 44
      */
45 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 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 Voir le fichier

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

+ 2
- 9
src/main/java/com/huiju/estateagents/service/impl/TaPreselectionRecordServiceImpl.java Voir le fichier

@@ -99,7 +99,7 @@ public class TaPreselectionRecordServiceImpl extends ServiceImpl<TaPreselectionR
99 99
         // 校验用户是否已经预选房源
100 100
         TaPreselectionRecord record = taPreselectionRecordMapper
101 101
                 .getRecordByPersonIdAndHouseId(taPreselectionRecord.getPersonId(), taPreselectionRecord.getHouseId());
102
-        if (record != null && 1 == record.getStatus()) {
102
+        if (record != null) {
103 103
             responseBean.addError("已预选过此房源,请到选房记录中查看。");
104 104
             return responseBean;
105 105
         }
@@ -152,7 +152,7 @@ public class TaPreselectionRecordServiceImpl extends ServiceImpl<TaPreselectionR
152 152
         ResponseBean responseBean = new ResponseBean<>();
153 153
         // 校验是否已经取消
154 154
         TaPreselectionRecord preselectionRecord = taPreselectionRecordMapper.getRecordByPersonIdAndHouseId(personId, houseId);
155
-        if (preselectionRecord == null || 1 != preselectionRecord.getStatus()) {
155
+        if (preselectionRecord == null) {
156 156
             responseBean.addError("未预选过此房源,或已取消预选此房源");
157 157
             return responseBean;
158 158
         }
@@ -181,13 +181,6 @@ public class TaPreselectionRecordServiceImpl extends ServiceImpl<TaPreselectionR
181 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 184
     @Override
192 185
     public ResponseBean selectPreSelectRecordList(Integer pageNum, Integer pageSize, String salesBatchId, Integer houseId, Integer orgId, String phone, String apartmentId, Integer status) {
193 186
         Page page = new Page(pageNum, pageSize);

+ 22
- 9
src/main/resources/mapper/TaHousingResourcesMapper.xml Voir le fichier

@@ -57,25 +57,38 @@
57 57
             AND t.`status` > 0
58 58
           ) t5
59 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 65
     </select>
66 66
 
67 67
     <select id="listBuildApartmentBySalesBatchId" resultType="com.huiju.estateagents.entity.TaBuildingApartment">
68
-        SELECT
68
+	    SELECT
69 69
             t3.apartment_id,
70 70
             t3.apartment_name,
71 71
             t3.apartment_type,
72 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 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 89
             LEFT JOIN ta_building_apartment t3 ON t2.apartment_id = t3.apartment_id
77 90
         ORDER BY
78
-	      t3.apartment_name
91
+            t3.apartment_name
79 92
     </select>
80 93
 
81 94
     <update id="updateForAddHeat" parameterType="java.lang.String">

+ 1
- 1
src/main/resources/mapper/TaPersonVisitRecordMapper.xml Voir le fichier

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

+ 8
- 6
src/main/resources/mapper/TaPreselectionRecordMapper.xml Voir le fichier

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

+ 5
- 3
src/main/resources/mapper/TaShareCountMapper.xml Voir le fichier

@@ -25,9 +25,9 @@
25 25
         when e.building_name != null || e.building_name != '' then e.building_name
26 26
         when f.news_name != null || f.news_name != '' then f.news_name
27 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 29
         else '空'
29 30
         end as shareTitle,t.create_date
30
-
31 31
         from ta_share_count t
32 32
         left join ta_building_dynamic a on t.be_share = a.dynamic_id and t.tagert_type = 'activity'
33 33
         left join ta_help_activity b on t.be_share = b.help_activity_id and t.tagert_type = 'help'
@@ -35,10 +35,11 @@
35 35
         LEFT JOIN ta_drainage d on t.be_share = d.drainage_id and t.tagert_type = 'h5'
36 36
         left join ta_building e on t.be_share = e.building_id and t.tagert_type = 'project'
37 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 39
         left JOIN ta_person g on t.be_share = g.person_id and t.tagert_type = 'consultant'
39 40
         where t.person_id = #{personId}
40 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 43
         </if>
43 44
         <if test="shareTitle != null and shareTitle != ''">
44 45
             and
@@ -49,7 +50,8 @@
49 50
                 d.`name` like CONCAT('%', #{shareTitle} , '%') or
50 51
                 e.building_name like CONCAT('%', #{shareTitle} , '%') or
51 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 56
         </if>
55 57
         order by t.create_date desc