顾绍勇 5 年之前
父節點
當前提交
de93f0a53b

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

@@ -415,7 +415,8 @@ public class TaHousingResourcesController extends BaseController {
415 415
                 return responseBean;
416 416
             }
417 417
 
418
-            responseBean = iTaHousingResourcesService.batchUpdateRaiseHeat(housingResources.getHouseIdList(), housingResources.getHeat(), housingResources.getSalesBatchId(), getOrgId(request));
418
+            responseBean = iTaHousingResourcesService.batchUpdateRaiseHeat(housingResources.getHouseIdList(), housingResources.getHeat(),
419
+                    housingResources.getSalesBatchId(), getOrgId(request), getUserId(request));
419 420
         } catch (Exception e) {
420 421
             logger.error("batchUpdateRaiseHeat -=- {}", e.toString());
421 422
             responseBean.addError(e.getMessage());

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

@@ -187,27 +187,26 @@ public class TaPreselectionRecordController extends BaseController {
187 187
     /**
188 188
      * 获取当前用户预选记录
189 189
      *
190
-     * @param pageNumber  页码
191
-     * @param pageSize 分页大小
192
-     * @param personId 用户ID
190
+     * @param pageNumber 页码
191
+     * @param pageSize   分页大小
192
+     * @param personId   用户ID
193 193
      * @return
194 194
      * @author gushaoyong
195 195
      */
196 196
     @RequestMapping(value = "/wx/listPreselectionRecord", method = RequestMethod.GET)
197
-    public ResponseBean listPreselectionRecord(
198
-                                                @RequestParam(value = "buildingId", required = false) String buildingId,
199
-                                                @RequestParam(value = "salesBtchId", required = false) Integer salesBtchId,
200
-                                                @RequestParam(value = "apartmentId", required = false) String apartmentId,
201
-                                                @RequestParam(value = "houseLockingStatus", required = false) String houseLockingStatus,
202
-                                                @RequestParam(value = "customerLocked", required = false) String customerLocked,
203
-                                                @RequestParam(value = "pageNumber", defaultValue = "1") Integer pageNumber,
204
-                                                @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
205
-                                                @RequestParam("personId") String personId,
206
-                                                HttpServletRequest request) {
197
+    public ResponseBean listPreselectionRecord(@RequestParam(value = "buildingId", required = false) String buildingId,
198
+                                               @RequestParam(value = "salesBtchId", required = false) Integer salesBtchId,
199
+                                               @RequestParam(value = "apartmentId", required = false) String apartmentId,
200
+                                               @RequestParam(value = "houseLockingStatus", required = false) String houseLockingStatus,
201
+                                               @RequestParam(value = "customerLocked", required = false) String customerLocked,
202
+                                               @RequestParam(value = "pageNumber", defaultValue = "1") Integer pageNumber,
203
+                                               @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
204
+                                               @RequestParam("personId") String personId,
205
+                                               HttpServletRequest request) {
207 206
         ResponseBean responseBean = new ResponseBean();
208 207
         Integer orgId = getOrgId(request);
209 208
         try {
210
-            responseBean.addSuccess(iTaPreselectionRecordService.listPreselectionRecord(pageNumber, pageSize, orgId, personId,buildingId,salesBtchId,apartmentId,houseLockingStatus,customerLocked));
209
+            responseBean.addSuccess(iTaPreselectionRecordService.listPreselectionRecord(pageNumber, pageSize, orgId, personId, buildingId, salesBtchId, apartmentId, houseLockingStatus, customerLocked));
211 210
         } catch (Exception e) {
212 211
             logger.error("listPreselectionRecord -=- {}", e);
213 212
             responseBean.addError(e.getMessage());
@@ -256,7 +255,7 @@ public class TaPreselectionRecordController extends BaseController {
256 255
                                                    HttpServletRequest request) {
257 256
         ResponseBean responseBean = new ResponseBean();
258 257
         try {
259
-            responseBean = iTaPreselectionRecordService.batchDeletePreselectRecord(preselectionRecordList, getOrgId(request));
258
+            responseBean = iTaPreselectionRecordService.batchDeletePreselectRecord(preselectionRecordList, getOrgId(request), getUserId(request));
260 259
         } catch (Exception e) {
261 260
             e.printStackTrace();
262 261
             logger.error("batchDeletePreselectRecord -=- {}", e.toString());

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

@@ -111,6 +111,7 @@ public interface TaHousingResourcesMapper extends BaseMapper<TaHousingResources>
111 111
      */
112 112
     Integer batchUpdateRaiseHeat(@Param("housingResourcesList") List<TaHousingResources> housingResourcesList,
113 113
                                  @Param("raiseHeat") Integer raiseHeat,
114
+                                 @Param("updateUser") Integer updateUser,
114 115
                                  @Param("salesBatchId") Integer salesBatchId,
115 116
                                  @Param("orgId") Integer orgId);
116 117
 

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

@@ -33,8 +33,8 @@ public interface TaPreselectionRecordMapper extends BaseMapper<TaPreselectionRec
33 33
      */
34 34
     IPage<TaPreselectionRecordPO> listPreselectionRecord(IPage<TaPreselectionRecordPO> iPage,
35 35
                                                          @Param("orgId") Integer orgId,
36
-                                                         @Param("personId") String personId,@Param("buildingId") String buildingId,@Param("salesBtchId") Integer salesBtchId,
37
-                                                         @Param("apartmentId") String apartmentId,@Param("houseLockingStatus") String houseLockingStatus,@Param("customerLocked") String customerLocked);
36
+                                                         @Param("personId") String personId, @Param("buildingId") String buildingId, @Param("salesBtchId") Integer salesBtchId,
37
+                                                         @Param("apartmentId") String apartmentId, @Param("houseLockingStatus") String houseLockingStatus, @Param("customerLocked") String customerLocked);
38 38
 
39 39
     /**
40 40
      * 根据房源ID和用户ID获取预选记录
@@ -62,5 +62,6 @@ public interface TaPreselectionRecordMapper extends BaseMapper<TaPreselectionRec
62 62
      * @param orgId
63 63
      */
64 64
     void batchDeletePreselectRecord(@Param("preselectionRecordList") List<TaPreselectionRecord> preselectionRecordList,
65
-                                    @Param("orgId") Integer orgId);
65
+                                    @Param("orgId") Integer orgId,
66
+                                    @Param("userId") Integer userId);
66 67
 }

+ 7
- 0
src/main/java/com/huiju/estateagents/po/TaPreselectionRecordPO.java 查看文件

@@ -2,6 +2,7 @@ package com.huiju.estateagents.po;
2 2
 
3 3
 import com.baomidou.mybatisplus.annotation.TableField;
4 4
 import com.huiju.estateagents.entity.TaBuildingImg;
5
+import com.huiju.estateagents.entity.TaHousingResources;
5 6
 import com.huiju.estateagents.entity.TaPreselectionRecord;
6 7
 import lombok.Data;
7 8
 import lombok.EqualsAndHashCode;
@@ -103,4 +104,10 @@ public class TaPreselectionRecordPO extends TaPreselectionRecord {
103 104
      * 销售批次装填
104 105
      */
105 106
     private String saleBatchStatus;
107
+
108
+    /**
109
+     * 房源信息
110
+     */
111
+    @TableField(exist = false)
112
+    private TaHousingResources housingInfo;
106 113
 }

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

@@ -124,7 +124,7 @@ public interface ITaHousingResourcesService extends IService<TaHousingResources>
124 124
      * @param orgId
125 125
      * @return
126 126
      */
127
-    ResponseBean batchUpdateRaiseHeat(List<TaHousingResources> housingResourcesList, Integer raiseHeat, Integer salesBatchId, Integer orgId);
127
+    ResponseBean batchUpdateRaiseHeat(List<TaHousingResources> housingResourcesList, Integer raiseHeat, Integer salesBatchId, Integer orgId, Integer updateUser);
128 128
 
129 129
     /**
130 130
      * 根据认筹记录查询房源信息

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

@@ -28,7 +28,7 @@ public interface ITaPreselectionRecordService extends IService<TaPreselectionRec
28 28
      * @param personId
29 29
      * @return
30 30
      */
31
-    IPage<TaPreselectionRecordPO> listPreselectionRecord(Integer pageNum, Integer pageSize, Integer orgId, String personId,String buildingId,Integer salesBtchId,String apartmentId,String houseLockingStatus,String customerLocked);
31
+    IPage<TaPreselectionRecordPO> listPreselectionRecord(Integer pageNum, Integer pageSize, Integer orgId, String personId, String buildingId, Integer salesBtchId, String apartmentId, String houseLockingStatus, String customerLocked);
32 32
 
33 33
     /**
34 34
      * 添加预选记录预选
@@ -54,8 +54,9 @@ public interface ITaPreselectionRecordService extends IService<TaPreselectionRec
54 54
      *
55 55
      * @param preselectionRecordList
56 56
      * @param orgId
57
+     * @param userId
57 58
      * @return
58 59
      */
59
-    ResponseBean batchDeletePreselectRecord(List<TaPreselectionRecord> preselectionRecordList, Integer orgId);
60
+    ResponseBean batchDeletePreselectRecord(List<TaPreselectionRecord> preselectionRecordList, Integer orgId, Integer userId);
60 61
 
61 62
 }

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

@@ -240,21 +240,21 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
240 240
         resourcesPO.setPreselectionBtn(true);
241 241
         resourcesPO.setRaiseBtn(true);
242 242
         QueryWrapper<TaPreselection> taPreselectionQueryWrapper = new QueryWrapper<>();
243
-        taPreselectionQueryWrapper.eq("sales_batch_id",salesBatchId);
244
-        taPreselectionQueryWrapper.eq("org_id",orgId);
245
-        taPreselectionQueryWrapper.eq("status",CommConstant.STATUS_NORMAL);
243
+        taPreselectionQueryWrapper.eq("sales_batch_id", salesBatchId);
244
+        taPreselectionQueryWrapper.eq("org_id", orgId);
245
+        taPreselectionQueryWrapper.eq("status", CommConstant.STATUS_NORMAL);
246 246
         TaPreselection taPreselection = taPreselectionMapper.selectOne(taPreselectionQueryWrapper);
247
-        if (null == taPreselection){
247
+        if (null == taPreselection) {
248 248
             resourcesPO.setPreselectionBtn(false);
249 249
         }
250 250
 
251 251
         //是否展示认筹按钮
252 252
         QueryWrapper<TaRaise> taRaiseQueryWrapper = new QueryWrapper<>();
253
-        taRaiseQueryWrapper.eq("sales_batch_id",salesBatchId);
254
-        taRaiseQueryWrapper.eq("org_id",orgId);
255
-        taRaiseQueryWrapper.eq("status",CommConstant.STATUS_NORMAL);
253
+        taRaiseQueryWrapper.eq("sales_batch_id", salesBatchId);
254
+        taRaiseQueryWrapper.eq("org_id", orgId);
255
+        taRaiseQueryWrapper.eq("status", CommConstant.STATUS_NORMAL);
256 256
         TaRaise taRaise = taRaiseMapper.selectOne(taRaiseQueryWrapper);
257
-        if (null == taRaise){
257
+        if (null == taRaise) {
258 258
             resourcesPO.setRaiseBtn(false);
259 259
         }
260 260
 
@@ -588,9 +588,10 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
588 588
     }
589 589
 
590 590
     @Override
591
-    public ResponseBean batchUpdateRaiseHeat(List<TaHousingResources> housingResourcesList, Integer raiseHeat, Integer salesBatchId, Integer orgId) {
591
+    public ResponseBean batchUpdateRaiseHeat(List<TaHousingResources> housingResourcesList, Integer raiseHeat,
592
+                                             Integer salesBatchId, Integer orgId, Integer updateUser) {
592 593
         ResponseBean responseBean = new ResponseBean();
593
-        if (taHousingResourcesMapper.batchUpdateRaiseHeat(housingResourcesList, raiseHeat, salesBatchId, orgId) > 0) {
594
+        if (taHousingResourcesMapper.batchUpdateRaiseHeat(housingResourcesList, raiseHeat, updateUser, salesBatchId, orgId) > 0) {
594 595
             responseBean.addSuccess("success");
595 596
         } else {
596 597
             responseBean.addError("fail");
@@ -639,6 +640,7 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
639 640
                 TaHousingResources housingResources = new TaHousingResources();
640 641
                 housingResources.setHouseId(po.getHouseId());
641 642
                 housingResources.setHouseLockingStatus("locked");
643
+                housingResources.setUpdateUser(person.getUserId());
642 644
                 housingResources.setUpdateDate(LocalDateTime.now());
643 645
                 updateById(housingResources);
644 646
 
@@ -664,6 +666,7 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
664 666
                 TaHousingResources housingResources = new TaHousingResources();
665 667
                 housingResources.setHouseId(po.getHouseId());
666 668
                 housingResources.setHouseLockingStatus("unlocked");
669
+                housingResources.setUpdateUser(person.getUserId());
667 670
                 housingResources.setUpdateDate(LocalDateTime.now());
668 671
                 updateById(housingResources);
669 672
 

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

@@ -9,16 +9,14 @@ import com.huiju.estateagents.base.ResponseBean;
9 9
 import com.huiju.estateagents.bo.request.PresecretRecordRequestBO;
10 10
 import com.huiju.estateagents.common.CommConstant;
11 11
 import com.huiju.estateagents.common.DateUtils;
12
-import com.huiju.estateagents.entity.TaApartmentImg;
13
-import com.huiju.estateagents.entity.TaBuildingImg;
14
-import com.huiju.estateagents.entity.TaPerson;
15
-import com.huiju.estateagents.entity.TaPreselectionRecord;
12
+import com.huiju.estateagents.entity.*;
16 13
 import com.huiju.estateagents.mapper.TaApartmentImgMapper;
17 14
 import com.huiju.estateagents.mapper.TaBuildingImgMapper;
18 15
 import com.huiju.estateagents.mapper.TaHousingResourcesMapper;
19 16
 import com.huiju.estateagents.mapper.TaPreselectionRecordMapper;
20 17
 import com.huiju.estateagents.po.TaHousingResourcesPO;
21 18
 import com.huiju.estateagents.po.TaPreselectionRecordPO;
19
+import com.huiju.estateagents.service.ITaHousingResourcesService;
22 20
 import com.huiju.estateagents.service.ITaPreselectionRecordService;
23 21
 import org.apache.commons.collections.CollectionUtils;
24 22
 import org.apache.commons.lang3.StringUtils;
@@ -65,12 +63,16 @@ public class TaPreselectionRecordServiceImpl extends ServiceImpl<TaPreselectionR
65 63
     @Autowired
66 64
     private TaPersonServiceImpl taPersonService;
67 65
 
66
+    @Autowired
67
+    private ITaHousingResourcesService taHousingResourcesService;
68
+
69
+
68 70
     @Override
69
-    public IPage<TaPreselectionRecordPO> listPreselectionRecord(Integer pageNum, Integer pageSize, Integer orgId, String personId,String buildingId,Integer salesBtchId,String apartmentId,String houseLockingStatus,String customerLocked) {
71
+    public IPage<TaPreselectionRecordPO> listPreselectionRecord(Integer pageNum, Integer pageSize, Integer orgId, String personId, String buildingId, Integer salesBtchId, String apartmentId, String houseLockingStatus, String customerLocked) {
70 72
         logger.info("listPreselectionRecord 接收参数:pageNum:{},pageSize:{},orgId:{},personId:{}", pageNum, pageSize, orgId, personId);
71 73
 
72 74
         IPage<TaPreselectionRecordPO> iPage = new Page<>(pageNum, pageSize);
73
-        iPage = taPreselectionRecordMapper.listPreselectionRecord(iPage, orgId, personId,buildingId,salesBtchId,apartmentId,houseLockingStatus,customerLocked);
75
+        iPage = taPreselectionRecordMapper.listPreselectionRecord(iPage, orgId, personId, buildingId, salesBtchId, apartmentId, houseLockingStatus, customerLocked);
74 76
 
75 77
         List<TaPreselectionRecordPO> poList = iPage.getRecords();
76 78
         if (CollectionUtils.isEmpty(poList)) {
@@ -96,6 +98,16 @@ public class TaPreselectionRecordServiceImpl extends ServiceImpl<TaPreselectionR
96 98
             }
97 99
             resultList.add(po);
98 100
         }
101
+
102
+        // 获取房源信息
103
+        resultList.stream().forEach(record -> {
104
+            QueryWrapper<TaHousingResources> housingQueryWrapper = new QueryWrapper<>();
105
+            housingQueryWrapper.eq("org_id", record.getOrgId());
106
+            housingQueryWrapper.eq("house_id", record.getHouseId());
107
+            housingQueryWrapper.ne("status", -1);
108
+            record.setHousingInfo(taHousingResourcesService.getOne(housingQueryWrapper));
109
+        });
110
+
99 111
         iPage.setRecords(resultList);
100 112
         return iPage;
101 113
     }
@@ -225,10 +237,10 @@ public class TaPreselectionRecordServiceImpl extends ServiceImpl<TaPreselectionR
225 237
     }
226 238
 
227 239
     @Override
228
-    public ResponseBean batchDeletePreselectRecord(List<TaPreselectionRecord> preselectionRecordList, Integer orgId) {
240
+    public ResponseBean batchDeletePreselectRecord(List<TaPreselectionRecord> preselectionRecordList, Integer orgId, Integer userId) {
229 241
         ResponseBean responseBean = new ResponseBean();
230 242
 
231
-        taPreselectionRecordMapper.batchDeletePreselectRecord(preselectionRecordList, orgId);
243
+        taPreselectionRecordMapper.batchDeletePreselectRecord(preselectionRecordList, orgId, userId);
232 244
         responseBean.addSuccess("success");
233 245
         return responseBean;
234 246
     }

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

@@ -226,7 +226,8 @@
226 226
 
227 227
     <update id="batchUpdateRaiseHeat">
228 228
         UPDATE ta_housing_resources t
229
-        SET t.heat = #{raiseHeat}
229
+        SET t.heat = #{raiseHeat},
230
+        t.update_user = #{updateUser}
230 231
         WHERE
231 232
         t.org_id = #{orgId}
232 233
         AND t.sales_batch_id = #{salesBatchId}

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

@@ -6,12 +6,14 @@
6 6
         SELECT
7 7
             t.*,
8 8
             t4.apartment_name,
9
-            t2.raise_record_id
9
+            t2.raise_record_id,
10
+            t5.user_name updateName
10 11
         FROM
11 12
             ta_housing_resources t
12 13
             LEFT JOIN ta_raise_house t2 ON t.house_id = t2.house_id
13 14
             LEFT JOIN ta_raise_record t3 ON t2.raise_record_id = t3.raise_record_id
14 15
             LEFT JOIN ta_building_apartment t4 ON t.apartment_id = t4.apartment_id
16
+            LEFT JOIN ta_user t5 ON t5.user_id = t.update_user
15 17
         WHERE
16 18
             t.org_id = #{bo.orgId}
17 19
             AND t.`status` != - 1