浏览代码

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

傅行帆 5 年前
父节点
当前提交
b0c5923374

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

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

+ 20
- 1
src/main/java/com/huiju/estateagents/controller/TaSalesBatchController.java 查看文件

8
 import com.huiju.estateagents.common.CommConstant;
8
 import com.huiju.estateagents.common.CommConstant;
9
 import com.huiju.estateagents.entity.TaMiniapp;
9
 import com.huiju.estateagents.entity.TaMiniapp;
10
 import com.huiju.estateagents.entity.TaSalesBatch;
10
 import com.huiju.estateagents.entity.TaSalesBatch;
11
+import com.huiju.estateagents.entity.TaShareContent;
11
 import com.huiju.estateagents.service.IMiniAppService;
12
 import com.huiju.estateagents.service.IMiniAppService;
12
 import com.huiju.estateagents.service.ITaMiniappService;
13
 import com.huiju.estateagents.service.ITaMiniappService;
13
 import com.huiju.estateagents.service.ITaSalesBatchService;
14
 import com.huiju.estateagents.service.ITaSalesBatchService;
15
+import com.huiju.estateagents.service.TaShareContentService;
14
 import io.swagger.models.auth.In;
16
 import io.swagger.models.auth.In;
15
 import org.slf4j.Logger;
17
 import org.slf4j.Logger;
16
 import org.slf4j.LoggerFactory;
18
 import org.slf4j.LoggerFactory;
45
     @Autowired
47
     @Autowired
46
     public IMiniAppService miniAppService;
48
     public IMiniAppService miniAppService;
47
 
49
 
50
+    @Autowired
51
+    private TaShareContentService taShareContentService;
52
+
48
     /**
53
     /**
49
      * 分页查询列表
54
      * 分页查询列表
50
      *
55
      *
83
     public ResponseBean taSalesBatchAdd(@RequestBody TaSalesBatch taSalesBatch, HttpServletRequest request) {
88
     public ResponseBean taSalesBatchAdd(@RequestBody TaSalesBatch taSalesBatch, HttpServletRequest request) {
84
         ResponseBean responseBean = new ResponseBean();
89
         ResponseBean responseBean = new ResponseBean();
85
         try {
90
         try {
86
-            taSalesBatch.setOrgId(getOrgId(request));
91
+            Integer orgId = getOrgId(request);
92
+
93
+            taSalesBatch.setOrgId(orgId);
87
             taSalesBatch.setCreateDate(LocalDateTime.now());
94
             taSalesBatch.setCreateDate(LocalDateTime.now());
88
             taSalesBatch.setUpdateTime(LocalDateTime.now());
95
             taSalesBatch.setUpdateTime(LocalDateTime.now());
89
             iTaSalesBatchService.save(taSalesBatch);
96
             iTaSalesBatchService.save(taSalesBatch);
95
             ResponseBean taMiniappQrcode = miniAppService.getQrCode(CommConstant.HOUSE_QRCODE.replace("#0", taSalesBatch.getSalesBatchId().toString()).replace("#1", "house"), taMiniapp.getMiniappId());
102
             ResponseBean taMiniappQrcode = miniAppService.getQrCode(CommConstant.HOUSE_QRCODE.replace("#0", taSalesBatch.getSalesBatchId().toString()).replace("#1", "house"), taMiniapp.getMiniappId());
96
             taSalesBatch.setQrCode(String.valueOf(taMiniappQrcode.getData()));
103
             taSalesBatch.setQrCode(String.valueOf(taMiniappQrcode.getData()));
97
             iTaSalesBatchService.updateById(taSalesBatch);
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
             responseBean.addSuccess(taSalesBatch);
117
             responseBean.addSuccess(taSalesBatch);
99
         } catch (Exception e) {
118
         } catch (Exception e) {
100
             e.printStackTrace();
119
             e.printStackTrace();

+ 7
- 4
src/main/java/com/huiju/estateagents/mapper/TaHousingResourcesMapper.java 查看文件

31
      * @param startPrice
31
      * @param startPrice
32
      * @param endPrice
32
      * @param endPrice
33
      * @param apartmentId
33
      * @param apartmentId
34
+     * @param type         为1只展示已发布的房源
34
      * @return
35
      * @return
35
      */
36
      */
36
     List<TaHousingResourcesPO> listHousingResources(@Param("orgId") Integer orgId,
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
 
77
 
76
     /**
78
     /**
77
      * 分页获取数据
79
      * 分页获取数据
80
+     *
78
      * @param pg
81
      * @param pg
79
      * @param salesBatchId
82
      * @param salesBatchId
80
      * @param buildingId
83
      * @param buildingId

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

26
      * @param startPrice
26
      * @param startPrice
27
      * @param endPrice
27
      * @param endPrice
28
      * @param apartmentId
28
      * @param apartmentId
29
+     * @param type  为1只展示已发布的房源
29
      * @return
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
 
105
 
105
     /**
106
     /**
106
      * 保存文件
107
      * 保存文件
108
+     *
107
      * @param file
109
      * @param file
108
      * @param salesBatchId
110
      * @param salesBatchId
109
      * @param buildingId
111
      * @param buildingId

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

87
      * @param startPrice
87
      * @param startPrice
88
      * @param endPrice
88
      * @param endPrice
89
      * @param apartmentId
89
      * @param apartmentId
90
+     * @param type
90
      * @return
91
      * @return
91
      */
92
      */
92
     @Override
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
         startPrice = StringUtils.isEmpty(startPrice) ? null : startPrice;
98
         startPrice = StringUtils.isEmpty(startPrice) ? null : startPrice;
98
         endPrice = StringUtils.isEmpty(endPrice) ? null : endPrice;
99
         endPrice = StringUtils.isEmpty(endPrice) ? null : endPrice;
99
 
100
 
100
         List<TaHousingResourcesPO> resourcesPOList =
101
         List<TaHousingResourcesPO> resourcesPOList =
101
-                taHousingResourcesMapper.listHousingResources(orgId, salesBatchId, startPrice, endPrice, apartmentId);
102
+                taHousingResourcesMapper.listHousingResources(orgId, salesBatchId, startPrice, endPrice, apartmentId, type);
102
 
103
 
103
         return resourcesPOList;
104
         return resourcesPOList;
104
     }
105
     }

+ 10
- 2
src/main/resources/mapper/TaHousingResourcesMapper.xml 查看文件

54
         LEFT JOIN ta_building_block t3 ON t.block_id = t3.block_id
54
         LEFT JOIN ta_building_block t3 ON t.block_id = t3.block_id
55
         WHERE
55
         WHERE
56
             t.sales_batch_id = #{salesBatchId}
56
             t.sales_batch_id = #{salesBatchId}
57
+            AND t.org_id = #{orgId}
57
             <choose>
58
             <choose>
58
                 <when test=" endPrice != null and startPrice == null">
59
                 <when test=" endPrice != null and startPrice == null">
59
                     AND t.price &lt;= #{endPrice}
60
                     AND t.price &lt;= #{endPrice}
70
             <if test="apartmentId != null and apartmentId != ''">
71
             <if test="apartmentId != null and apartmentId != ''">
71
                 AND t.apartment_id = #{apartmentId}
72
                 AND t.apartment_id = #{apartmentId}
72
             </if>
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
           ) t5
83
           ) t5
76
         ORDER BY
84
         ORDER BY
77
             t5.termNamePre,
85
             t5.termNamePre,

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

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

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

111
         SELECT
111
         SELECT
112
         a.*,
112
         a.*,
113
         a.customer_id AS customerId,
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
         c.building_name as intentionName
116
         c.building_name as intentionName
117
         FROM
117
         FROM
118
         ta_recommend_customer a
118
         ta_recommend_customer a
119
         LEFT JOIN ta_person b ON a.realty_consultant = b.person_id
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
         LEFT JOIN ta_building c ON a.building_id = c.building_id
121
         LEFT JOIN ta_building c ON a.building_id = c.building_id
122
         <where>
122
         <where>
123
             a.status > 0
123
             a.status > 0
135
                 and a.phone like concat(concat("%",#{tel}),"%")
135
                 and a.phone like concat(concat("%",#{tel}),"%")
136
             </if>
136
             </if>
137
             <if test="consultName != null and consultName !=''">
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
             </if>
139
             </if>
140
             <if test="consultTel != null and consultTel !=''">
140
             <if test="consultTel != null and consultTel !=''">
141
-                and b.tel = #{consultTel}
141
+                and IFNULL(d.phone, b.tel) = #{consultTel}
142
             </if>
142
             </if>
143
             <if test="entryType != null and entryType !=''">
143
             <if test="entryType != null and entryType !=''">
144
                 and a.entry_type = #{entryType}
144
                 and a.entry_type = #{entryType}
377
         a.phone as phone,
377
         a.phone as phone,
378
         c.building_name as intentionName,
378
         c.building_name as intentionName,
379
         if(a.sex = 1, '男',if(a.sex = 2, '女', '未知')) as sex,
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
         FROM
382
         FROM
383
         ta_recommend_customer a
383
         ta_recommend_customer a
384
         LEFT JOIN ta_person b ON a.realty_consultant = b.person_id
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
         LEFT JOIN ta_building c ON a.building_id = c.building_id
386
         LEFT JOIN ta_building c ON a.building_id = c.building_id
386
         <where>
387
         <where>
387
             a.status > 0
388
             a.status > 0
399
                 and a.phone like concat(concat("%",#{tel}),"%")
400
                 and a.phone like concat(concat("%",#{tel}),"%")
400
             </if>
401
             </if>
401
             <if test="consultName != null and consultName !=''">
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
             </if>
404
             </if>
404
             <if test="consultTel != null and consultTel !=''">
405
             <if test="consultTel != null and consultTel !=''">
405
-                and b.tel = #{consultTel}
406
+                and IFNULL(d.phone, b.tel) = #{consultTel}
406
             </if>
407
             </if>
407
             <if test="entryType != null and entryType !=''">
408
             <if test="entryType != null and entryType !=''">
408
                 and a.entry_type = #{entryType}
409
                 and a.entry_type = #{entryType}

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

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

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

39
             and c.person_Type = #{personType}
39
             and c.person_Type = #{personType}
40
         </if>
40
         </if>
41
         <if test="sceneType != null and sceneType != ''">
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
         </if>
50
         </if>
44
         <if test="phone != null and phone != ''">
51
         <if test="phone != null and phone != ''">
45
             and c.phone = #{phone}
52
             and c.phone = #{phone}