Pārlūkot izejas kodu

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

傅行帆 5 gadus atpakaļ
vecāks
revīzija
b0c5923374

+ 2
- 2
src/main/java/com/huiju/estateagents/controller/TaHousingResourcesController.java Parādīt failu

@@ -225,7 +225,7 @@ public class TaHousingResourcesController extends BaseController {
225 225
                 orgId, salesBatchId, startPrice, endPrice, apartmentId);
226 226
 
227 227
         try {
228
-            responseBean.addSuccess(iTaHousingResourcesService.listHousingResources(orgId, salesBatchId, startPrice, endPrice, apartmentId));
228
+            responseBean.addSuccess(iTaHousingResourcesService.listHousingResources(orgId, salesBatchId, startPrice, endPrice, apartmentId, 1));
229 229
         } catch (Exception e) {
230 230
             logger.error("listHousingResources -=- {}", e);
231 231
             responseBean.addError(e.getMessage());
@@ -247,7 +247,7 @@ public class TaHousingResourcesController extends BaseController {
247 247
         Integer orgId = getOrgId(request);
248 248
 
249 249
         try {
250
-            responseBean.addSuccess(iTaHousingResourcesService.listHousingResources(orgId, salesBatchId, "", "", ""));
250
+            responseBean.addSuccess(iTaHousingResourcesService.listHousingResources(orgId, salesBatchId, "", "", "", 0));
251 251
         } catch (Exception e) {
252 252
             logger.error("listHousingResourcesFormCms -=- {}", e);
253 253
             responseBean.addError(e.getMessage());

+ 20
- 1
src/main/java/com/huiju/estateagents/controller/TaSalesBatchController.java Parādīt failu

@@ -8,9 +8,11 @@ import com.huiju.estateagents.base.ResponseBean;
8 8
 import com.huiju.estateagents.common.CommConstant;
9 9
 import com.huiju.estateagents.entity.TaMiniapp;
10 10
 import com.huiju.estateagents.entity.TaSalesBatch;
11
+import com.huiju.estateagents.entity.TaShareContent;
11 12
 import com.huiju.estateagents.service.IMiniAppService;
12 13
 import com.huiju.estateagents.service.ITaMiniappService;
13 14
 import com.huiju.estateagents.service.ITaSalesBatchService;
15
+import com.huiju.estateagents.service.TaShareContentService;
14 16
 import io.swagger.models.auth.In;
15 17
 import org.slf4j.Logger;
16 18
 import org.slf4j.LoggerFactory;
@@ -45,6 +47,9 @@ public class TaSalesBatchController extends BaseController {
45 47
     @Autowired
46 48
     public IMiniAppService miniAppService;
47 49
 
50
+    @Autowired
51
+    private TaShareContentService taShareContentService;
52
+
48 53
     /**
49 54
      * 分页查询列表
50 55
      *
@@ -83,7 +88,9 @@ public class TaSalesBatchController extends BaseController {
83 88
     public ResponseBean taSalesBatchAdd(@RequestBody TaSalesBatch taSalesBatch, HttpServletRequest request) {
84 89
         ResponseBean responseBean = new ResponseBean();
85 90
         try {
86
-            taSalesBatch.setOrgId(getOrgId(request));
91
+            Integer orgId = getOrgId(request);
92
+
93
+            taSalesBatch.setOrgId(orgId);
87 94
             taSalesBatch.setCreateDate(LocalDateTime.now());
88 95
             taSalesBatch.setUpdateTime(LocalDateTime.now());
89 96
             iTaSalesBatchService.save(taSalesBatch);
@@ -95,6 +102,18 @@ public class TaSalesBatchController extends BaseController {
95 102
             ResponseBean taMiniappQrcode = miniAppService.getQrCode(CommConstant.HOUSE_QRCODE.replace("#0", taSalesBatch.getSalesBatchId().toString()).replace("#1", "house"), taMiniapp.getMiniappId());
96 103
             taSalesBatch.setQrCode(String.valueOf(taMiniappQrcode.getData()));
97 104
             iTaSalesBatchService.updateById(taSalesBatch);
105
+
106
+            // 设置默认分享设置
107
+            TaShareContent shareContent = new TaShareContent();
108
+            shareContent.setOrgId(orgId);
109
+            shareContent.setTargetId(taSalesBatch.getSalesBatchId().toString());
110
+            shareContent.setShareContentTitle("诚挚邀您在线选房购房~");
111
+            shareContent.setShareContentImg(taSalesBatch.getAerialViewImg());
112
+            shareContent.setShareContentType("house");
113
+            shareContent.setStatus(1);
114
+            shareContent.setCreateDate(LocalDateTime.now());
115
+            taShareContentService.save(shareContent);
116
+
98 117
             responseBean.addSuccess(taSalesBatch);
99 118
         } catch (Exception e) {
100 119
             e.printStackTrace();

+ 7
- 4
src/main/java/com/huiju/estateagents/mapper/TaHousingResourcesMapper.java Parādīt failu

@@ -31,13 +31,15 @@ public interface TaHousingResourcesMapper extends BaseMapper<TaHousingResources>
31 31
      * @param startPrice
32 32
      * @param endPrice
33 33
      * @param apartmentId
34
+     * @param type         为1只展示已发布的房源
34 35
      * @return
35 36
      */
36 37
     List<TaHousingResourcesPO> listHousingResources(@Param("orgId") Integer orgId,
37
-                                                     @Param("salesBatchId") String salesBatchId,
38
-                                                     @Param("startPrice") String startPrice,
39
-                                                     @Param("endPrice") String endPrice,
40
-                                                     @Param("apartmentId") String apartmentId);
38
+                                                    @Param("salesBatchId") String salesBatchId,
39
+                                                    @Param("startPrice") String startPrice,
40
+                                                    @Param("endPrice") String endPrice,
41
+                                                    @Param("apartmentId") String apartmentId,
42
+                                                    @Param("type") Integer type);
41 43
 
42 44
     /**
43 45
      * 获取某销售批次下所有房源户型
@@ -75,6 +77,7 @@ public interface TaHousingResourcesMapper extends BaseMapper<TaHousingResources>
75 77
 
76 78
     /**
77 79
      * 分页获取数据
80
+     *
78 81
      * @param pg
79 82
      * @param salesBatchId
80 83
      * @param buildingId

+ 3
- 1
src/main/java/com/huiju/estateagents/service/ITaHousingResourcesService.java Parādīt failu

@@ -26,9 +26,10 @@ public interface ITaHousingResourcesService extends IService<TaHousingResources>
26 26
      * @param startPrice
27 27
      * @param endPrice
28 28
      * @param apartmentId
29
+     * @param type  为1只展示已发布的房源
29 30
      * @return
30 31
      */
31
-    List<TaHousingResourcesPO> listHousingResources(Integer orgId, String salesBatchId, String startPrice, String endPrice, String apartmentId);
32
+    List<TaHousingResourcesPO> listHousingResources(Integer orgId, String salesBatchId, String startPrice, String endPrice, String apartmentId, Integer type);
32 33
 
33 34
     /**
34 35
      * 获取某销售批次下所有房源户型
@@ -104,6 +105,7 @@ public interface ITaHousingResourcesService extends IService<TaHousingResources>
104 105
 
105 106
     /**
106 107
      * 保存文件
108
+     *
107 109
      * @param file
108 110
      * @param salesBatchId
109 111
      * @param buildingId

+ 5
- 4
src/main/java/com/huiju/estateagents/service/impl/TaHousingResourcesServiceImpl.java Parādīt failu

@@ -87,18 +87,19 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
87 87
      * @param startPrice
88 88
      * @param endPrice
89 89
      * @param apartmentId
90
+     * @param type
90 91
      * @return
91 92
      */
92 93
     @Override
93
-    public List<TaHousingResourcesPO> listHousingResources(Integer orgId, String salesBatchId, String startPrice, String endPrice, String apartmentId) {
94
-        logger.info("listHousingResources 接收参数:orgId:{},salesBatchId:{},startPrice:{},endPrice:{},apartmentId:{}",
95
-                orgId, salesBatchId, startPrice, endPrice, apartmentId);
94
+    public List<TaHousingResourcesPO> listHousingResources(Integer orgId, String salesBatchId, String startPrice, String endPrice, String apartmentId, Integer type) {
95
+        logger.info("listHousingResources 接收参数:orgId:{},salesBatchId:{},startPrice:{},endPrice:{},apartmentId:{},type:{}",
96
+                orgId, salesBatchId, startPrice, endPrice, apartmentId, type);
96 97
 
97 98
         startPrice = StringUtils.isEmpty(startPrice) ? null : startPrice;
98 99
         endPrice = StringUtils.isEmpty(endPrice) ? null : endPrice;
99 100
 
100 101
         List<TaHousingResourcesPO> resourcesPOList =
101
-                taHousingResourcesMapper.listHousingResources(orgId, salesBatchId, startPrice, endPrice, apartmentId);
102
+                taHousingResourcesMapper.listHousingResources(orgId, salesBatchId, startPrice, endPrice, apartmentId, type);
102 103
 
103 104
         return resourcesPOList;
104 105
     }

+ 10
- 2
src/main/resources/mapper/TaHousingResourcesMapper.xml Parādīt failu

@@ -54,6 +54,7 @@
54 54
         LEFT JOIN ta_building_block t3 ON t.block_id = t3.block_id
55 55
         WHERE
56 56
             t.sales_batch_id = #{salesBatchId}
57
+            AND t.org_id = #{orgId}
57 58
             <choose>
58 59
                 <when test=" endPrice != null and startPrice == null">
59 60
                     AND t.price &lt;= #{endPrice}
@@ -70,8 +71,15 @@
70 71
             <if test="apartmentId != null and apartmentId != ''">
71 72
                 AND t.apartment_id = #{apartmentId}
72 73
             </if>
73
-            AND t.org_id = #{orgId}
74
-            AND t.`status` > 0
74
+            <choose>
75
+                <when test="type == 1">
76
+                    AND t.`status` > 0
77
+                </when>
78
+                <otherwise>
79
+                    AND t.`status` > -1
80
+                </otherwise>
81
+            </choose>
82
+
75 83
           ) t5
76 84
         ORDER BY
77 85
             t5.termNamePre,

+ 6
- 3
src/main/resources/mapper/TaPreselectionRecordMapper.xml Parādīt failu

@@ -52,6 +52,7 @@
52 52
     </select>
53 53
 
54 54
     <select id="selectPreSelectRecordList" resultType="com.huiju.estateagents.po.TaPreselectionRecordPO">
55
+        select * from (
55 56
         select t.house_id,
56 57
         a.block_name,
57 58
         a.unit_name,
@@ -68,17 +69,18 @@
68 69
         t.building_id,
69 70
         t.sales_batch_id,
70 71
         e.apartment_name,
72
+        b.person_id,
71 73
         (select name from ta_person t where (t.user_id = t.update_user || t.person_id = t.update_user)) as updateName
72 74
         from ta_preselection_record t
73 75
         left join ta_housing_resources a on t.house_id = a.house_id
74 76
         left join ta_person b on t.person_id = b.person_id
75 77
         LEFT JOIN ta_building_apartment e ON a.apartment_id = e.apartment_id
76 78
         where b.org_id = #{orgId} and a.sales_batch_id = #{salesBatchId}
77
-        <if test="houseId != null and houseId !=''">
78
-          and t.house_id = #{houseId}
79
+        <if test="houseId != null and houseId !=''">and t.house_id = #{houseId}
79 80
         </if>
80 81
         <if test="phone != null and phone != ''">
81
-          and b.phone = #{phone}
82
+            and b.
83
+            phone = #{phone}
82 84
         </if>
83 85
         <if test="apartmentId != null and apartmentId != ''">
84 86
           and a.apartment_id = #{apartmentId}
@@ -86,6 +88,7 @@
86 88
         <if test="status != null">
87 89
           and t.status = #{status}
88 90
         </if>
91
+        order by t.create_date desc) t group by t.house_id, t.person_id
89 92
     </select>
90 93
 
91 94
 </mapper>

+ 10
- 9
src/main/resources/mapper/TaRecommendCustomerMapper.xml Parādīt failu

@@ -111,13 +111,13 @@ FROM
111 111
         SELECT
112 112
         a.*,
113 113
         a.customer_id AS customerId,
114
-        if(b.NAME  = null, d.name, b.name) as consultantName,
115
-        if(b.tel  = null, d.tel, b.tel) AS consultTel,
114
+        IFNULL(d.user_name, b.name) as consultantName,
115
+        IFNULL(d.phone, b.tel) as consultTel,
116 116
         c.building_name as intentionName
117 117
         FROM
118 118
         ta_recommend_customer a
119 119
         LEFT JOIN ta_person b ON a.realty_consultant = b.person_id
120
-        LEFT JOIN ta_person d on a.realty_consultant = d.user_id
120
+        LEFT JOIN ta_user d on a.realty_consultant = d.user_id
121 121
         LEFT JOIN ta_building c ON a.building_id = c.building_id
122 122
         <where>
123 123
             a.status > 0
@@ -135,10 +135,10 @@ FROM
135 135
                 and a.phone like concat(concat("%",#{tel}),"%")
136 136
             </if>
137 137
             <if test="consultName != null and consultName !=''">
138
-                and b.name like CONCAT('%',#{consultName}, '%')
138
+                and IFNULL(d.user_name, b.name) like CONCAT('%',#{consultName}, '%')
139 139
             </if>
140 140
             <if test="consultTel != null and consultTel !=''">
141
-                and b.tel = #{consultTel}
141
+                and IFNULL(d.phone, b.tel) = #{consultTel}
142 142
             </if>
143 143
             <if test="entryType != null and entryType !=''">
144 144
                 and a.entry_type = #{entryType}
@@ -377,11 +377,12 @@ FROM
377 377
         a.phone as phone,
378 378
         c.building_name as intentionName,
379 379
         if(a.sex = 1, '男',if(a.sex = 2, '女', '未知')) as sex,
380
-        b.NAME AS consultantName,
381
-        b.tel AS consultTel
380
+        IFNULL(d.user_name, b.name) as consultantName,
381
+        IFNULL(d.phone, b.tel) as consultTel
382 382
         FROM
383 383
         ta_recommend_customer a
384 384
         LEFT JOIN ta_person b ON a.realty_consultant = b.person_id
385
+        LEFT JOIN ta_user d on a.realty_consultant = d.user_id
385 386
         LEFT JOIN ta_building c ON a.building_id = c.building_id
386 387
         <where>
387 388
             a.status > 0
@@ -399,10 +400,10 @@ FROM
399 400
                 and a.phone like concat(concat("%",#{tel}),"%")
400 401
             </if>
401 402
             <if test="consultName != null and consultName !=''">
402
-                and b.name like CONCAT('%',#{consultName}, '%')
403
+                and IFNULL(d.user_name, b.name) like CONCAT('%',#{consultName}, '%')
403 404
             </if>
404 405
             <if test="consultTel != null and consultTel !=''">
405
-                and b.tel = #{consultTel}
406
+                and IFNULL(d.phone, b.tel) = #{consultTel}
406 407
             </if>
407 408
             <if test="entryType != null and entryType !=''">
408 409
                 and a.entry_type = #{entryType}

+ 3
- 1
src/main/resources/mapper/TaShareCountMapper.xml Parādīt failu

@@ -66,6 +66,7 @@
66 66
                 when d.`name` != null || d.name != '' then d.`name`
67 67
                 when e.building_name != null || e.building_name != '' then e.building_name
68 68
                 when f.news_name != null || f.news_name != '' then f.news_name
69
+                when h.sales_batch_name != null || h.sales_batch_name !='' then h.sales_batch_name
69 70
                 when a.`name` != null || a.`name` != '' then a.`name`
70 71
                 else '空'
71 72
                 end as shareTitle,
@@ -82,7 +83,7 @@
82 83
                 LEFT JOIN ta_drainage d on t.target_id = d.drainage_id and t.target_type = 'h5_share'
83 84
                 left join ta_building e on t.target_id = e.building_id and t.target_type = 'building_share'
84 85
                 LEFT JOIN ta_news f on t.target_id = f.news_id and t.target_type = 'news_share'
85
-
86
+                left join ta_sales_batch h on t.target_id = h.sales_batch_id and t.target_type = 'house_share'
86 87
         LEFT JOIN ta_person a ON t.share_person = a.person_id
87 88
         LEFT JOIN ta_person y on t.share_person = y.user_id
88 89
         LEFT JOIN ta_person z ON t.person_id = z.person_id
@@ -104,6 +105,7 @@
104 105
             e.building_name like CONCAT('%', #{shareTitle} , '%') or
105 106
             f.news_name like CONCAT('%', #{shareTitle} , '%') or
106 107
             a.`name` like CONCAT('%', #{shareTitle} , '%')
108
+            h.sales_batch_name like like CONCAT('%', #{shareTitle} , '%')
107 109
             )
108 110
         </if>
109 111
         GROUP BY

+ 8
- 1
src/main/resources/mapper/TaSharePersonFromMapper.xml Parādīt failu

@@ -39,7 +39,14 @@
39 39
             and c.person_Type = #{personType}
40 40
         </if>
41 41
         <if test="sceneType != null and sceneType != ''">
42
-            and b.scene_type = #{sceneType}
42
+            <choose>
43
+                <when test="sceneType == 'share'">
44
+                    and b.scene_type like CONCAT('%', #{sceneType})
45
+                </when>
46
+                <otherwise>
47
+                    and b.scene_type = #{sceneType}
48
+                </otherwise>
49
+            </choose>
43 50
         </if>
44 51
         <if test="phone != null and phone != ''">
45 52
             and c.phone = #{phone}