顾绍勇 преди 5 години
родител
ревизия
de93f0a53b

+ 2
- 1
src/main/java/com/huiju/estateagents/controller/TaHousingResourcesController.java Целия файл

415
                 return responseBean;
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
         } catch (Exception e) {
420
         } catch (Exception e) {
420
             logger.error("batchUpdateRaiseHeat -=- {}", e.toString());
421
             logger.error("batchUpdateRaiseHeat -=- {}", e.toString());
421
             responseBean.addError(e.getMessage());
422
             responseBean.addError(e.getMessage());

+ 14
- 15
src/main/java/com/huiju/estateagents/controller/TaPreselectionRecordController.java Целия файл

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
      * @return
193
      * @return
194
      * @author gushaoyong
194
      * @author gushaoyong
195
      */
195
      */
196
     @RequestMapping(value = "/wx/listPreselectionRecord", method = RequestMethod.GET)
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
         ResponseBean responseBean = new ResponseBean();
206
         ResponseBean responseBean = new ResponseBean();
208
         Integer orgId = getOrgId(request);
207
         Integer orgId = getOrgId(request);
209
         try {
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
         } catch (Exception e) {
210
         } catch (Exception e) {
212
             logger.error("listPreselectionRecord -=- {}", e);
211
             logger.error("listPreselectionRecord -=- {}", e);
213
             responseBean.addError(e.getMessage());
212
             responseBean.addError(e.getMessage());
256
                                                    HttpServletRequest request) {
255
                                                    HttpServletRequest request) {
257
         ResponseBean responseBean = new ResponseBean();
256
         ResponseBean responseBean = new ResponseBean();
258
         try {
257
         try {
259
-            responseBean = iTaPreselectionRecordService.batchDeletePreselectRecord(preselectionRecordList, getOrgId(request));
258
+            responseBean = iTaPreselectionRecordService.batchDeletePreselectRecord(preselectionRecordList, getOrgId(request), getUserId(request));
260
         } catch (Exception e) {
259
         } catch (Exception e) {
261
             e.printStackTrace();
260
             e.printStackTrace();
262
             logger.error("batchDeletePreselectRecord -=- {}", e.toString());
261
             logger.error("batchDeletePreselectRecord -=- {}", e.toString());

+ 1
- 0
src/main/java/com/huiju/estateagents/mapper/TaHousingResourcesMapper.java Целия файл

111
      */
111
      */
112
     Integer batchUpdateRaiseHeat(@Param("housingResourcesList") List<TaHousingResources> housingResourcesList,
112
     Integer batchUpdateRaiseHeat(@Param("housingResourcesList") List<TaHousingResources> housingResourcesList,
113
                                  @Param("raiseHeat") Integer raiseHeat,
113
                                  @Param("raiseHeat") Integer raiseHeat,
114
+                                 @Param("updateUser") Integer updateUser,
114
                                  @Param("salesBatchId") Integer salesBatchId,
115
                                  @Param("salesBatchId") Integer salesBatchId,
115
                                  @Param("orgId") Integer orgId);
116
                                  @Param("orgId") Integer orgId);
116
 
117
 

+ 4
- 3
src/main/java/com/huiju/estateagents/mapper/TaPreselectionRecordMapper.java Целия файл

33
      */
33
      */
34
     IPage<TaPreselectionRecordPO> listPreselectionRecord(IPage<TaPreselectionRecordPO> iPage,
34
     IPage<TaPreselectionRecordPO> listPreselectionRecord(IPage<TaPreselectionRecordPO> iPage,
35
                                                          @Param("orgId") Integer orgId,
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
      * 根据房源ID和用户ID获取预选记录
40
      * 根据房源ID和用户ID获取预选记录
62
      * @param orgId
62
      * @param orgId
63
      */
63
      */
64
     void batchDeletePreselectRecord(@Param("preselectionRecordList") List<TaPreselectionRecord> preselectionRecordList,
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
 
2
 
3
 import com.baomidou.mybatisplus.annotation.TableField;
3
 import com.baomidou.mybatisplus.annotation.TableField;
4
 import com.huiju.estateagents.entity.TaBuildingImg;
4
 import com.huiju.estateagents.entity.TaBuildingImg;
5
+import com.huiju.estateagents.entity.TaHousingResources;
5
 import com.huiju.estateagents.entity.TaPreselectionRecord;
6
 import com.huiju.estateagents.entity.TaPreselectionRecord;
6
 import lombok.Data;
7
 import lombok.Data;
7
 import lombok.EqualsAndHashCode;
8
 import lombok.EqualsAndHashCode;
103
      * 销售批次装填
104
      * 销售批次装填
104
      */
105
      */
105
     private String saleBatchStatus;
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
      * @param orgId
124
      * @param orgId
125
      * @return
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
      * @param personId
28
      * @param personId
29
      * @return
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
      *
54
      *
55
      * @param preselectionRecordList
55
      * @param preselectionRecordList
56
      * @param orgId
56
      * @param orgId
57
+     * @param userId
57
      * @return
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
         resourcesPO.setPreselectionBtn(true);
240
         resourcesPO.setPreselectionBtn(true);
241
         resourcesPO.setRaiseBtn(true);
241
         resourcesPO.setRaiseBtn(true);
242
         QueryWrapper<TaPreselection> taPreselectionQueryWrapper = new QueryWrapper<>();
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
         TaPreselection taPreselection = taPreselectionMapper.selectOne(taPreselectionQueryWrapper);
246
         TaPreselection taPreselection = taPreselectionMapper.selectOne(taPreselectionQueryWrapper);
247
-        if (null == taPreselection){
247
+        if (null == taPreselection) {
248
             resourcesPO.setPreselectionBtn(false);
248
             resourcesPO.setPreselectionBtn(false);
249
         }
249
         }
250
 
250
 
251
         //是否展示认筹按钮
251
         //是否展示认筹按钮
252
         QueryWrapper<TaRaise> taRaiseQueryWrapper = new QueryWrapper<>();
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
         TaRaise taRaise = taRaiseMapper.selectOne(taRaiseQueryWrapper);
256
         TaRaise taRaise = taRaiseMapper.selectOne(taRaiseQueryWrapper);
257
-        if (null == taRaise){
257
+        if (null == taRaise) {
258
             resourcesPO.setRaiseBtn(false);
258
             resourcesPO.setRaiseBtn(false);
259
         }
259
         }
260
 
260
 
588
     }
588
     }
589
 
589
 
590
     @Override
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
         ResponseBean responseBean = new ResponseBean();
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
             responseBean.addSuccess("success");
595
             responseBean.addSuccess("success");
595
         } else {
596
         } else {
596
             responseBean.addError("fail");
597
             responseBean.addError("fail");
639
                 TaHousingResources housingResources = new TaHousingResources();
640
                 TaHousingResources housingResources = new TaHousingResources();
640
                 housingResources.setHouseId(po.getHouseId());
641
                 housingResources.setHouseId(po.getHouseId());
641
                 housingResources.setHouseLockingStatus("locked");
642
                 housingResources.setHouseLockingStatus("locked");
643
+                housingResources.setUpdateUser(person.getUserId());
642
                 housingResources.setUpdateDate(LocalDateTime.now());
644
                 housingResources.setUpdateDate(LocalDateTime.now());
643
                 updateById(housingResources);
645
                 updateById(housingResources);
644
 
646
 
664
                 TaHousingResources housingResources = new TaHousingResources();
666
                 TaHousingResources housingResources = new TaHousingResources();
665
                 housingResources.setHouseId(po.getHouseId());
667
                 housingResources.setHouseId(po.getHouseId());
666
                 housingResources.setHouseLockingStatus("unlocked");
668
                 housingResources.setHouseLockingStatus("unlocked");
669
+                housingResources.setUpdateUser(person.getUserId());
667
                 housingResources.setUpdateDate(LocalDateTime.now());
670
                 housingResources.setUpdateDate(LocalDateTime.now());
668
                 updateById(housingResources);
671
                 updateById(housingResources);
669
 
672
 

+ 20
- 8
src/main/java/com/huiju/estateagents/service/impl/TaPreselectionRecordServiceImpl.java Целия файл

9
 import com.huiju.estateagents.bo.request.PresecretRecordRequestBO;
9
 import com.huiju.estateagents.bo.request.PresecretRecordRequestBO;
10
 import com.huiju.estateagents.common.CommConstant;
10
 import com.huiju.estateagents.common.CommConstant;
11
 import com.huiju.estateagents.common.DateUtils;
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
 import com.huiju.estateagents.mapper.TaApartmentImgMapper;
13
 import com.huiju.estateagents.mapper.TaApartmentImgMapper;
17
 import com.huiju.estateagents.mapper.TaBuildingImgMapper;
14
 import com.huiju.estateagents.mapper.TaBuildingImgMapper;
18
 import com.huiju.estateagents.mapper.TaHousingResourcesMapper;
15
 import com.huiju.estateagents.mapper.TaHousingResourcesMapper;
19
 import com.huiju.estateagents.mapper.TaPreselectionRecordMapper;
16
 import com.huiju.estateagents.mapper.TaPreselectionRecordMapper;
20
 import com.huiju.estateagents.po.TaHousingResourcesPO;
17
 import com.huiju.estateagents.po.TaHousingResourcesPO;
21
 import com.huiju.estateagents.po.TaPreselectionRecordPO;
18
 import com.huiju.estateagents.po.TaPreselectionRecordPO;
19
+import com.huiju.estateagents.service.ITaHousingResourcesService;
22
 import com.huiju.estateagents.service.ITaPreselectionRecordService;
20
 import com.huiju.estateagents.service.ITaPreselectionRecordService;
23
 import org.apache.commons.collections.CollectionUtils;
21
 import org.apache.commons.collections.CollectionUtils;
24
 import org.apache.commons.lang3.StringUtils;
22
 import org.apache.commons.lang3.StringUtils;
65
     @Autowired
63
     @Autowired
66
     private TaPersonServiceImpl taPersonService;
64
     private TaPersonServiceImpl taPersonService;
67
 
65
 
66
+    @Autowired
67
+    private ITaHousingResourcesService taHousingResourcesService;
68
+
69
+
68
     @Override
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
         logger.info("listPreselectionRecord 接收参数:pageNum:{},pageSize:{},orgId:{},personId:{}", pageNum, pageSize, orgId, personId);
72
         logger.info("listPreselectionRecord 接收参数:pageNum:{},pageSize:{},orgId:{},personId:{}", pageNum, pageSize, orgId, personId);
71
 
73
 
72
         IPage<TaPreselectionRecordPO> iPage = new Page<>(pageNum, pageSize);
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
         List<TaPreselectionRecordPO> poList = iPage.getRecords();
77
         List<TaPreselectionRecordPO> poList = iPage.getRecords();
76
         if (CollectionUtils.isEmpty(poList)) {
78
         if (CollectionUtils.isEmpty(poList)) {
96
             }
98
             }
97
             resultList.add(po);
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
         iPage.setRecords(resultList);
111
         iPage.setRecords(resultList);
100
         return iPage;
112
         return iPage;
101
     }
113
     }
225
     }
237
     }
226
 
238
 
227
     @Override
239
     @Override
228
-    public ResponseBean batchDeletePreselectRecord(List<TaPreselectionRecord> preselectionRecordList, Integer orgId) {
240
+    public ResponseBean batchDeletePreselectRecord(List<TaPreselectionRecord> preselectionRecordList, Integer orgId, Integer userId) {
229
         ResponseBean responseBean = new ResponseBean();
241
         ResponseBean responseBean = new ResponseBean();
230
 
242
 
231
-        taPreselectionRecordMapper.batchDeletePreselectRecord(preselectionRecordList, orgId);
243
+        taPreselectionRecordMapper.batchDeletePreselectRecord(preselectionRecordList, orgId, userId);
232
         responseBean.addSuccess("success");
244
         responseBean.addSuccess("success");
233
         return responseBean;
245
         return responseBean;
234
     }
246
     }

+ 2
- 1
src/main/resources/mapper/TaHousingResourcesMapper.xml Целия файл

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

+ 3
- 1
src/main/resources/mapper/TaRaiseRecordMapper.xml Целия файл

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