瀏覽代碼

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

# Conflicts:
#	src/main/java/com/huiju/estateagents/service/impl/TaHousingResourcesServiceImpl.java
傅行帆 5 年之前
父節點
當前提交
3ba263eac3

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

79
      * @return
79
      * @return
80
      */
80
      */
81
     @RequestMapping(value = "/admin/taHousingResources", method = RequestMethod.POST)
81
     @RequestMapping(value = "/admin/taHousingResources", method = RequestMethod.POST)
82
-    public ResponseBean taHousingResourcesAdd(@RequestBody TaHousingResources taHousingResources,HttpServletRequest request) {
82
+    public ResponseBean taHousingResourcesAdd(@RequestBody TaHousingResources taHousingResources, HttpServletRequest request) {
83
         ResponseBean responseBean = new ResponseBean();
83
         ResponseBean responseBean = new ResponseBean();
84
         try {
84
         try {
85
             taHousingResources.setOrgId(getOrgId(request));
85
             taHousingResources.setOrgId(getOrgId(request));
133
      */
133
      */
134
     @RequestMapping(value = "/admin/taHousingResources/{id}", method = RequestMethod.PUT)
134
     @RequestMapping(value = "/admin/taHousingResources/{id}", method = RequestMethod.PUT)
135
     public ResponseBean taHousingResourcesUpdate(@PathVariable Integer id,
135
     public ResponseBean taHousingResourcesUpdate(@PathVariable Integer id,
136
-                                                 @RequestBody TaHousingResources taHousingResources,HttpServletRequest request) {
136
+                                                 @RequestBody TaHousingResources taHousingResources, HttpServletRequest request) {
137
         ResponseBean responseBean = new ResponseBean();
137
         ResponseBean responseBean = new ResponseBean();
138
         try {
138
         try {
139
             taHousingResources.setHouseId(id);
139
             taHousingResources.setHouseId(id);
152
      * 修改户型
152
      * 修改户型
153
      */
153
      */
154
     @RequestMapping(value = "/admin/house/changeApartment", method = RequestMethod.PUT)
154
     @RequestMapping(value = "/admin/house/changeApartment", method = RequestMethod.PUT)
155
-    public ResponseBean houseApartment(@RequestBody TaHousingResources taHousingResources,HttpServletRequest request) {
155
+    public ResponseBean houseApartment(@RequestBody TaHousingResources taHousingResources, HttpServletRequest request) {
156
         ResponseBean responseBean = new ResponseBean();
156
         ResponseBean responseBean = new ResponseBean();
157
         try {
157
         try {
158
             List<TaHousingResources> houseIdList = taHousingResources.getHouseIdList();
158
             List<TaHousingResources> houseIdList = taHousingResources.getHouseIdList();
190
     /**
190
     /**
191
      * 获取房源列表
191
      * 获取房源列表
192
      *
192
      *
193
-     * @param pageNum      页码
194
-     * @param pageSize     分页大小
195
      * @param salesBatchId 销售批次ID
193
      * @param salesBatchId 销售批次ID
194
+     * @param startPrice   房源起始价格
195
+     * @param endPrice     房源结束价格
196
+     * @param apartmentId  户型ID
197
+     * @param request
196
      * @return
198
      * @return
197
      * @author gushaoyong
199
      * @author gushaoyong
198
      */
200
      */
199
     @RequestMapping(value = "/wx/listHousingResources", method = RequestMethod.GET)
201
     @RequestMapping(value = "/wx/listHousingResources", method = RequestMethod.GET)
200
-    public ResponseBean listHousingResources(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
201
-                                             @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
202
-                                             @RequestParam(value = "salesBatchId") String salesBatchId,
203
-                                             String startPrice, String endPrice, String apartmentId) {
202
+    public ResponseBean listHousingResources(@RequestParam(value = "salesBatchId") String salesBatchId,
203
+                                             String startPrice, String endPrice, String apartmentId,
204
+                                             HttpServletRequest request) {
204
         ResponseBean responseBean = new ResponseBean();
205
         ResponseBean responseBean = new ResponseBean();
206
+        Integer orgId = getOrgId(request);
207
+
205
         try {
208
         try {
206
-            responseBean.addSuccess(iTaHousingResourcesService.listHousingResources(pageNum, pageSize, salesBatchId, startPrice, endPrice, apartmentId));
209
+            responseBean.addSuccess(iTaHousingResourcesService.listHousingResources(orgId, salesBatchId, startPrice, endPrice, apartmentId));
207
         } catch (Exception e) {
210
         } catch (Exception e) {
208
             logger.error("listHousingResources -=- {}", e);
211
             logger.error("listHousingResources -=- {}", e);
209
             responseBean.addError(e.getMessage());
212
             responseBean.addError(e.getMessage());
211
         return responseBean;
214
         return responseBean;
212
     }
215
     }
213
 
216
 
217
+    /**
218
+     * 获取房源列表-后台管理端
219
+     *
220
+     * @param salesBatchId 销售批次ID
221
+     * @return
222
+     * @author gushaoyong
223
+     */
224
+    @RequestMapping(value = "/admin/listHousingResources", method = RequestMethod.GET)
225
+    public ResponseBean listHousingResourcesFormCms(@RequestParam(value = "salesBatchId") String salesBatchId,
226
+                                                    HttpServletRequest request) {
227
+        ResponseBean responseBean = new ResponseBean();
228
+        Integer orgId = getOrgId(request);
229
+
230
+        try {
231
+            responseBean.addSuccess(iTaHousingResourcesService.listHousingResources(orgId, salesBatchId, "", "", ""));
232
+        } catch (Exception e) {
233
+            logger.error("listHousingResourcesFormCms -=- {}", e);
234
+            responseBean.addError(e.getMessage());
235
+        }
236
+        return responseBean;
237
+    }
238
+
214
     /**
239
     /**
215
      * 获取某销售批次下所有房源户型
240
      * 获取某销售批次下所有房源户型
216
      *
241
      *
239
      */
264
      */
240
     @RequestMapping(value = "/wx/getHousingDetailById", method = RequestMethod.GET)
265
     @RequestMapping(value = "/wx/getHousingDetailById", method = RequestMethod.GET)
241
     public ResponseBean getHousingDetailById(@RequestParam(value = "houseId") String houseId,
266
     public ResponseBean getHousingDetailById(@RequestParam(value = "houseId") String houseId,
242
-                                             @RequestParam(value = "personId") String personId) {
267
+                                             @RequestParam(value = "personId") String personId,
268
+                                             HttpServletRequest request) {
243
         ResponseBean responseBean = new ResponseBean();
269
         ResponseBean responseBean = new ResponseBean();
244
         try {
270
         try {
245
             responseBean.addSuccess(iTaHousingResourcesService.getHousingDetailById(personId, houseId));
271
             responseBean.addSuccess(iTaHousingResourcesService.getHousingDetailById(personId, houseId));
257
      * @return
283
      * @return
258
      */
284
      */
259
     @RequestMapping(value = "/admin/house/checked", method = RequestMethod.PUT)
285
     @RequestMapping(value = "/admin/house/checked", method = RequestMethod.PUT)
260
-    public ResponseBean houseChecked(@RequestBody TaHousingResources taHousingResources,HttpServletRequest request) {
286
+    public ResponseBean houseChecked(@RequestBody TaHousingResources taHousingResources, HttpServletRequest request) {
261
         ResponseBean responseBean = new ResponseBean();
287
         ResponseBean responseBean = new ResponseBean();
262
         try {
288
         try {
263
             taHousingResources.setOrgId(getOrgId(request));
289
             taHousingResources.setOrgId(getOrgId(request));

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

71
      * @author gushaoyong
71
      * @author gushaoyong
72
      */
72
      */
73
     @RequestMapping(value = "/taPreselectionRecord", method = RequestMethod.POST)
73
     @RequestMapping(value = "/taPreselectionRecord", method = RequestMethod.POST)
74
-    public ResponseBean taPreselectionRecordAdd(@RequestBody TaPreselectionRecord taPreselectionRecord) {
74
+    public ResponseBean taPreselectionRecordAdd(@RequestBody TaPreselectionRecord taPreselectionRecord,HttpServletRequest request) {
75
         ResponseBean responseBean = new ResponseBean();
75
         ResponseBean responseBean = new ResponseBean();
76
-
76
+        Integer orgId = getOrgId(request);
77
         logger.info("taPreselectionRecordAdd 接收参数,taPreselectionRecord:{}", JSONObject.toJSONString(taPreselectionRecord));
77
         logger.info("taPreselectionRecordAdd 接收参数,taPreselectionRecord:{}", JSONObject.toJSONString(taPreselectionRecord));
78
 
78
 
79
+        taPreselectionRecord.setOrgId(orgId);
79
         try {
80
         try {
80
 
81
 
81
             // 校验参数
82
             // 校验参数
194
     @RequestMapping(value = "/wx/listPreselectionRecord", method = RequestMethod.GET)
195
     @RequestMapping(value = "/wx/listPreselectionRecord", method = RequestMethod.GET)
195
     public ResponseBean listPreselectionRecord(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
196
     public ResponseBean listPreselectionRecord(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
196
                                                @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
197
                                                @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
197
-                                               @RequestParam("personId") String personId) {
198
+                                               @RequestParam("personId") String personId,
199
+                                               HttpServletRequest request) {
198
         ResponseBean responseBean = new ResponseBean();
200
         ResponseBean responseBean = new ResponseBean();
199
-        try {
200
-            responseBean.addSuccess(iTaPreselectionRecordService.listPreselectionRecord(pageNum, pageSize, personId));
201
-        } catch (Exception e) {
202
-            logger.error("listPreselectionRecord -=- {}", e);
203
-            responseBean.addError(e.getMessage());
204
-        }
205
-        return responseBean;
206
-    }
201
+        Integer orgId = getOrgId(request);
207
 
202
 
208
-    /**
209
-     * 校验用户是否已经预选该房源
210
-     *
211
-     * @param personId 用户ID
212
-     * @param houseId  房源ID
213
-     * @return
214
-     * @author gushaoyong
215
-     */
216
-    @RequestMapping(value = "/wx/checkPreselect", method = RequestMethod.POST)
217
-    public ResponseBean checkPreselect(@RequestParam("personId") String personId,
218
-                                       @RequestParam("houseId") String houseId) {
219
-        ResponseBean responseBean = new ResponseBean();
220
         try {
203
         try {
221
-            responseBean.addSuccess(iTaPreselectionRecordService.checkPreselect(personId, houseId));
204
+            responseBean.addSuccess(iTaPreselectionRecordService.listPreselectionRecord(pageNum, pageSize, orgId, personId));
222
         } catch (Exception e) {
205
         } catch (Exception e) {
223
-            logger.error("checkPreselect -=- {}", e);
206
+            logger.error("listPreselectionRecord -=- {}", e);
224
             responseBean.addError(e.getMessage());
207
             responseBean.addError(e.getMessage());
225
         }
208
         }
226
         return responseBean;
209
         return responseBean;
227
     }
210
     }
228
 
211
 
229
     @RequestMapping(value = "/admin/taPreselectRecord", method = RequestMethod.GET)
212
     @RequestMapping(value = "/admin/taPreselectRecord", method = RequestMethod.GET)
230
-    public ResponseBean selectPreSelectRecordList(@RequestParam(value = "pageNum", defaultValue = "1")Integer pageNum,
231
-                                                  @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize,
232
-                                                  @RequestParam(value = "salesBatchId")String salesBatchId,
233
-                                                  @RequestParam(value = "houseId", required = false)Integer houseId,
213
+    public ResponseBean selectPreSelectRecordList(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
214
+                                                  @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
215
+                                                  @RequestParam(value = "salesBatchId") String salesBatchId,
216
+                                                  @RequestParam(value = "houseId", required = false) Integer houseId,
234
                                                   @RequestParam(value = "phone", required = false) String phone,
217
                                                   @RequestParam(value = "phone", required = false) String phone,
235
                                                   @RequestParam(value = "apartmentId", required = false) String apartmentId,
218
                                                   @RequestParam(value = "apartmentId", required = false) String apartmentId,
236
                                                   @RequestParam(value = "status", required = false) Integer status,
219
                                                   @RequestParam(value = "status", required = false) Integer status,
237
-                                                  HttpServletRequest request){
220
+                                                  HttpServletRequest request) {
238
         ResponseBean responseBean = new ResponseBean();
221
         ResponseBean responseBean = new ResponseBean();
239
         try {
222
         try {
240
             responseBean = iTaPreselectionRecordService.selectPreSelectRecordList(pageNum, pageSize, salesBatchId, houseId, getOrgId(request), phone, apartmentId, status);
223
             responseBean = iTaPreselectionRecordService.selectPreSelectRecordList(pageNum, pageSize, salesBatchId, houseId, getOrgId(request), phone, apartmentId, status);

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

26
     /**
26
     /**
27
      * 分页获取房源列表
27
      * 分页获取房源列表
28
      *
28
      *
29
-     * @param iPage
30
      * @param salesBatchId
29
      * @param salesBatchId
31
      * @param startPrice
30
      * @param startPrice
32
      * @param endPrice
31
      * @param endPrice
33
      * @param apartmentId
32
      * @param apartmentId
34
      * @return
33
      * @return
35
      */
34
      */
36
-    IPage<TaHousingResourcesPO> listHousingResources(IPage<TaHousingResourcesPO> iPage,
35
+    List<TaHousingResourcesPO> listHousingResources(@Param("orgId") Integer orgId,
37
                                                      @Param("salesBatchId") String salesBatchId,
36
                                                      @Param("salesBatchId") String salesBatchId,
38
                                                      @Param("startPrice") String startPrice,
37
                                                      @Param("startPrice") String startPrice,
39
                                                      @Param("endPrice") String endPrice,
38
                                                      @Param("endPrice") String endPrice,

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

30
      * @param personId
30
      * @param personId
31
      * @return
31
      * @return
32
      */
32
      */
33
-    IPage<TaPreselectionRecordPO> listPreselectionRecord(IPage<TaPreselectionRecordPO> iPage, @Param("personId") String personId);
33
+    IPage<TaPreselectionRecordPO> listPreselectionRecord(IPage<TaPreselectionRecordPO> iPage,
34
+                                                         @Param("orgId") Integer orgId,
35
+                                                         @Param("personId") String personId);
34
 
36
 
35
     /**
37
     /**
36
      * 根据房源ID和用户ID获取预选记录
38
      * 根据房源ID和用户ID获取预选记录

+ 3
- 5
src/main/java/com/huiju/estateagents/po/TaHousingResourcesPO.java 查看文件

19
 @Accessors(chain = true)
19
 @Accessors(chain = true)
20
 public class TaHousingResourcesPO extends TaHousingResources {
20
 public class TaHousingResourcesPO extends TaHousingResources {
21
 
21
 
22
-    /**
23
-     * 户型名称
24
-     */
25
-    private String apartmentName;
26
-
27
     private Double insideArea;
22
     private Double insideArea;
28
 
23
 
29
     private Double buildingArea;
24
     private Double buildingArea;
54
      */
49
      */
55
     @TableField(exist = false)
50
     @TableField(exist = false)
56
     private List<TaBuildingImg> buildingImgList;
51
     private List<TaBuildingImg> buildingImgList;
52
+
53
+    @TableField(exist = false)
54
+    private String termName;
57
 }
55
 }

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

83
      * 最后修改人
83
      * 最后修改人
84
      */
84
      */
85
     private String updateName;
85
     private String updateName;
86
+
87
+    /**
88
+     * 房源状态
89
+     */
90
+    private String housingStatus;
91
+
92
+    /**
93
+     * 销售批次装填
94
+     */
95
+    private String saleBatchStatus;
86
 }
96
 }

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

22
 
22
 
23
     /* 分页获取房源列表
23
     /* 分页获取房源列表
24
      *
24
      *
25
-     * @param pageNum      页码
26
-     * @param pageSize     分页大小
27
      * @param salesBatchId 销售批次ID
25
      * @param salesBatchId 销售批次ID
28
      * @param startPrice
26
      * @param startPrice
29
      * @param endPrice
27
      * @param endPrice
30
      * @param apartmentId
28
      * @param apartmentId
31
      * @return
29
      * @return
32
      */
30
      */
33
-    IPage<TaHousingResourcesPO> listHousingResources(Integer pageNum, Integer pageSize, String salesBatchId, String startPrice, String endPrice, String apartmentId);
31
+    List<TaHousingResourcesPO> listHousingResources(Integer orgId, String salesBatchId, String startPrice, String endPrice, String apartmentId);
34
 
32
 
35
     /**
33
     /**
36
      * 获取某销售批次下所有房源户型
34
      * 获取某销售批次下所有房源户型
43
     /**
41
     /**
44
      * 根据房源ID获取房源详情
42
      * 根据房源ID获取房源详情
45
      *
43
      *
46
-     * @param personId
47
-     * @param houseId
44
+     * @param personId 用户ID
45
+     * @param houseId  房源ID
48
      * @return
46
      * @return
49
      */
47
      */
50
-    TaHousingResourcesPO getHousingDetailById(String personId,String houseId);
48
+    TaHousingResourcesPO getHousingDetailById(String personId, String houseId);
51
 
49
 
52
     /**
50
     /**
53
      * 校验楼栋信息存不存在
51
      * 校验楼栋信息存不存在
52
+     *
54
      * @param taHousingResources
53
      * @param taHousingResources
55
      * @return
54
      * @return
56
      */
55
      */
58
 
57
 
59
     /**
58
     /**
60
      * 添加楼栋信息
59
      * 添加楼栋信息
60
+     *
61
      * @param taHousingResources
61
      * @param taHousingResources
62
      * @return
62
      * @return
63
      */
63
      */
65
 
65
 
66
     /**
66
     /**
67
      * 分页获取房源信息
67
      * 分页获取房源信息
68
+     *
68
      * @param salesBatchId
69
      * @param salesBatchId
69
      * @param buildingId
70
      * @param buildingId
70
      * @param pageNumber
71
      * @param pageNumber
84
 
85
 
85
     /**
86
     /**
86
      * 更新房源信息
87
      * 更新房源信息
88
+     *
87
      * @param taHousingResources
89
      * @param taHousingResources
88
      * @return
90
      * @return
89
      */
91
      */
91
 
93
 
92
     /**
94
     /**
93
      * 获取表格中的数据
95
      * 获取表格中的数据
96
+     *
94
      * @param file
97
      * @param file
95
      * @param salesBatchId
98
      * @param salesBatchId
96
      * @param buildingId
99
      * @param buildingId

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

21
      *
21
      *
22
      * @param pageNum
22
      * @param pageNum
23
      * @param pageSize
23
      * @param pageSize
24
+     * @param orgId
24
      * @param personId
25
      * @param personId
25
      * @return
26
      * @return
26
      */
27
      */
27
-    IPage<TaPreselectionRecordPO> listPreselectionRecord(Integer pageNum, Integer pageSize, String personId);
28
+    IPage<TaPreselectionRecordPO> listPreselectionRecord(Integer pageNum, Integer pageSize, Integer orgId, String personId);
28
 
29
 
29
     /**
30
     /**
30
      * 添加预选记录预选
31
      * 添加预选记录预选

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

66
 
66
 
67
     @Autowired
67
     @Autowired
68
     private TaBuildingRoomMapper taBuildingRoomMapper;
68
     private TaBuildingRoomMapper taBuildingRoomMapper;
69
-    
69
+
70
     @Autowired
70
     @Autowired
71
     private TaBuildingMapper taBuildingMapper;
71
     private TaBuildingMapper taBuildingMapper;
72
 
72
 
83
     /**
83
     /**
84
      * 分页获取房源列表
84
      * 分页获取房源列表
85
      *
85
      *
86
-     * @param pageNum      页码
87
-     * @param pageSize     分页大小
88
      * @param salesBatchId 销售批次ID
86
      * @param salesBatchId 销售批次ID
89
      * @param startPrice
87
      * @param startPrice
90
      * @param endPrice
88
      * @param endPrice
92
      * @return
90
      * @return
93
      */
91
      */
94
     @Override
92
     @Override
95
-    public IPage<TaHousingResourcesPO> listHousingResources(Integer pageNum, Integer pageSize, String salesBatchId, String startPrice, String endPrice, String apartmentId) {
96
-        logger.info("listHousingResources 接收参数:pageNum:{},pageSize:{},salesBatchId:{},startPrice:{},endPrice:{},apartmentId:{}",
97
-                pageNum, pageSize, salesBatchId, startPrice, endPrice, apartmentId);
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);
96
+
97
+        List<TaHousingResourcesPO> resourcesPOList =
98
+                taHousingResourcesMapper.listHousingResources(orgId, salesBatchId, startPrice, endPrice, apartmentId);
98
 
99
 
99
-        IPage<TaHousingResourcesPO> iPage = new Page<>(pageNum, pageSize);
100
-        return taHousingResourcesMapper.listHousingResources(iPage, salesBatchId, startPrice, endPrice, apartmentId);
100
+        return resourcesPOList;
101
     }
101
     }
102
 
102
 
103
     /**
103
     /**
167
         List<TaBuildingImg> taBuildingImgList = new ArrayList<>();
167
         List<TaBuildingImg> taBuildingImgList = new ArrayList<>();
168
         List<TaApartmentImg> buildingImg;
168
         List<TaApartmentImg> buildingImg;
169
         QueryWrapper<TaBuildingImg> buildingImgQueryWrapper;
169
         QueryWrapper<TaBuildingImg> buildingImgQueryWrapper;
170
-        QueryWrapper<TaApartmentImg>  apartmentImgQueryWrapper = new QueryWrapper<>();
170
+        QueryWrapper<TaApartmentImg> apartmentImgQueryWrapper = new QueryWrapper<>();
171
         apartmentImgQueryWrapper.eq("apartment_id", resourcesPO.getApartmentId());
171
         apartmentImgQueryWrapper.eq("apartment_id", resourcesPO.getApartmentId());
172
         buildingImg = taApartmentImgMapper.selectList(apartmentImgQueryWrapper);
172
         buildingImg = taApartmentImgMapper.selectList(apartmentImgQueryWrapper);
173
         for (TaApartmentImg apartmentImg : buildingImg) {
173
         for (TaApartmentImg apartmentImg : buildingImg) {
176
             buildingImgQueryWrapper.eq("img_type", CommConstant.BUILDING_IMG_APARMENT);
176
             buildingImgQueryWrapper.eq("img_type", CommConstant.BUILDING_IMG_APARMENT);
177
             taBuildingImgList = taBuildingImgMapper.selectList(buildingImgQueryWrapper);
177
             taBuildingImgList = taBuildingImgMapper.selectList(buildingImgQueryWrapper);
178
         }
178
         }
179
-        if(CollectionUtils.isNotEmpty(taBuildingImgList)){
179
+        if (CollectionUtils.isNotEmpty(taBuildingImgList)) {
180
             resourcesPO.setBuildingImgList(taBuildingImgList);
180
             resourcesPO.setBuildingImgList(taBuildingImgList);
181
         }
181
         }
182
 
182
 
194
         StringBuffer result = new StringBuffer();
194
         StringBuffer result = new StringBuffer();
195
         //校验期
195
         //校验期
196
         String termResult = checckedTerm(taHousingResources);
196
         String termResult = checckedTerm(taHousingResources);
197
-        result.append(termResult.equals("notExist") ? "期名" + taHousingResources.getTermName() + "不存在,会直接新建。" : termResult );
197
+        result.append(termResult.equals("notExist") ? "期名" + taHousingResources.getTermName() + "不存在,会直接新建。" : termResult);
198
         //校验栋
198
         //校验栋
199
         String blockResult = checkedBlock(taHousingResources);
199
         String blockResult = checkedBlock(taHousingResources);
200
-        result.append(blockResult.equals("notExist") ? "楼栋名" + taHousingResources.getBlockName() + "不存在,会直接新建。" : blockResult );
200
+        result.append(blockResult.equals("notExist") ? "楼栋名" + taHousingResources.getBlockName() + "不存在,会直接新建。" : blockResult);
201
         //校验单元
201
         //校验单元
202
         String unitResult = checkedUnit(taHousingResources);
202
         String unitResult = checkedUnit(taHousingResources);
203
-        result.append(unitResult.equals("notExist") ? "单元名" + taHousingResources.getUnitName() + "不存在,会直接新建。" : unitResult );
203
+        result.append(unitResult.equals("notExist") ? "单元名" + taHousingResources.getUnitName() + "不存在,会直接新建。" : unitResult);
204
         //校验楼层
204
         //校验楼层
205
         String floorResult = checkedFloor(taHousingResources);
205
         String floorResult = checkedFloor(taHousingResources);
206
-        result.append(floorResult.equals("notExist") ? "楼层名" + taHousingResources.getFloorName() + "不存在,会直接新建。" : floorResult );
206
+        result.append(floorResult.equals("notExist") ? "楼层名" + taHousingResources.getFloorName() + "不存在,会直接新建。" : floorResult);
207
         //校验房号
207
         //校验房号
208
         String roomResult = checkedRoom(taHousingResources);
208
         String roomResult = checkedRoom(taHousingResources);
209
-        result.append(roomResult.equals("notExist") ? "房号" + taHousingResources.getRoomName() + "不存在,会直接新建。" : roomResult );
209
+        result.append(roomResult.equals("notExist") ? "房号" + taHousingResources.getRoomName() + "不存在,会直接新建。" : roomResult);
210
         return result;
210
         return result;
211
     }
211
     }
212
 
212
 
230
         String roomResult = checkedRoom(taHousingResources);
230
         String roomResult = checkedRoom(taHousingResources);
231
 
231
 
232
         //创建期
232
         //创建期
233
-        if (!roomResult.equals("notExist")){
234
-            return ResponseBean.error("房间名" + taHousingResources.getRoomName() + "存在。请修改房间名!",ResponseBean.ERROR_UNAVAILABLE);
233
+        if (!roomResult.equals("notExist")) {
234
+            return ResponseBean.error("房间名" + taHousingResources.getRoomName() + "存在。请修改房间名!", ResponseBean.ERROR_UNAVAILABLE);
235
         }
235
         }
236
 
236
 
237
         //期不存在就添加
237
         //期不存在就添加
238
-        if (termResult.equals("notExist")){
238
+        if (termResult.equals("notExist")) {
239
             addTerm(taHousingResources);
239
             addTerm(taHousingResources);
240
         }
240
         }
241
 
241
 
242
         //楼栋不存在就添加
242
         //楼栋不存在就添加
243
-        if (blockResult.equals("notExist")){
243
+        if (blockResult.equals("notExist")) {
244
             addBlock(taHousingResources);
244
             addBlock(taHousingResources);
245
         }
245
         }
246
 
246
 
247
         //单元不存在就添加
247
         //单元不存在就添加
248
-        if (unitResult.equals("notExist")){
248
+        if (unitResult.equals("notExist")) {
249
             addUnit(taHousingResources);
249
             addUnit(taHousingResources);
250
         }
250
         }
251
 
251
 
252
         //楼层不存在就添加
252
         //楼层不存在就添加
253
-        if (floorResult.equals("notExist")){
253
+        if (floorResult.equals("notExist")) {
254
             addFloor(taHousingResources);
254
             addFloor(taHousingResources);
255
         }
255
         }
256
 
256
 
257
         //房间号不存在就添加
257
         //房间号不存在就添加
258
-        if (roomResult.equals("notExist")){
258
+        if (roomResult.equals("notExist")) {
259
             addRoom(taHousingResources);
259
             addRoom(taHousingResources);
260
         }
260
         }
261
-        
261
+
262
         // 获取楼盘名称
262
         // 获取楼盘名称
263
         TaBuilding taBuilding = taBuildingMapper.selectById(taHousingResources.getBuildingId());
263
         TaBuilding taBuilding = taBuildingMapper.selectById(taHousingResources.getBuildingId());
264
         taHousingResources.setBuildingName(taBuilding.getBuildingName());
264
         taHousingResources.setBuildingName(taBuilding.getBuildingName());
317
         taHousingResources.setFloorId(oldTaHousingResources.getFloorId());
317
         taHousingResources.setFloorId(oldTaHousingResources.getFloorId());
318
         taHousingResources.setRoomId(oldTaHousingResources.getRoomId());
318
         taHousingResources.setRoomId(oldTaHousingResources.getRoomId());
319
         //只允许编辑房间名
319
         //只允许编辑房间名
320
-        if (!oldTaHousingResources.getRoomName().equals(taHousingResources.getRoomName())){
320
+        if (!oldTaHousingResources.getRoomName().equals(taHousingResources.getRoomName())) {
321
             //校验房号
321
             //校验房号
322
             String roomResult = checkedRoom(taHousingResources);
322
             String roomResult = checkedRoom(taHousingResources);
323
 
323
 
324
             //房间号不存在就更新
324
             //房间号不存在就更新
325
-            if (roomResult.equals("notExist")){
325
+            if (roomResult.equals("notExist")) {
326
                 updateRoom(taHousingResources);
326
                 updateRoom(taHousingResources);
327
-            }else{
328
-                return ResponseBean.error("房间名" + taHousingResources.getRoomName() + "存在。请修改房间名!",ResponseBean.ERROR_UNAVAILABLE);
327
+            } else {
328
+                return ResponseBean.error("房间名" + taHousingResources.getRoomName() + "存在。请修改房间名!", ResponseBean.ERROR_UNAVAILABLE);
329
             }
329
             }
330
 
330
 
331
         }
331
         }
390
                 Integer heat = Integer.valueOf(String.valueOf(row.getCell(6).getNumericCellValue()).substring(0,1));
390
                 Integer heat = Integer.valueOf(String.valueOf(row.getCell(6).getNumericCellValue()).substring(0,1));
391
                 Integer status = row.getCell(7).getStringCellValue().trim().equals("是") ? 1 : 0;
391
                 Integer status = row.getCell(7).getStringCellValue().trim().equals("是") ? 1 : 0;
392
 
392
 
393
-                int currentRow = j+1;
394
-                if (StringUtils.isEmpty(termName)){
393
+                int currentRow = j + 1;
394
+                if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(termName)) {
395
                     responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
395
                     responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
396
                     return responseBean;
396
                     return responseBean;
397
                 }
397
                 }
398
-                if (StringUtils.isEmpty(blockName)){
398
+                if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(blockName)) {
399
                     responseBean.addError("第" + currentRow + "行" + "楼栋不能为空!");
399
                     responseBean.addError("第" + currentRow + "行" + "楼栋不能为空!");
400
                     return responseBean;
400
                     return responseBean;
401
                 }
401
                 }
402
-                if (StringUtils.isEmpty(unitName)){
402
+                if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(unitName)) {
403
                     responseBean.addError("第" + currentRow + "行" + "单元不能为空!");
403
                     responseBean.addError("第" + currentRow + "行" + "单元不能为空!");
404
                     return responseBean;
404
                     return responseBean;
405
                 }
405
                 }
406
-                if (StringUtils.isEmpty(floorName)){
406
+                if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(floorName)) {
407
                     responseBean.addError("第" + currentRow + "行" + "层不能为空!");
407
                     responseBean.addError("第" + currentRow + "行" + "层不能为空!");
408
                     return responseBean;
408
                     return responseBean;
409
                 }
409
                 }
410
-                if (StringUtils.isEmpty(roomName)){
410
+                if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(roomName)) {
411
                     responseBean.addError("第" + currentRow + "行" + "房号不能为空!");
411
                     responseBean.addError("第" + currentRow + "行" + "房号不能为空!");
412
                     return responseBean;
412
                     return responseBean;
413
                 }
413
                 }
414
 
414
 
415
                 String houseInfo = termName + blockName + unitName + floorName + roomName;
415
                 String houseInfo = termName + blockName + unitName + floorName + roomName;
416
-                if (temHousingList.contains(houseInfo)){
417
-                    logger.info("存在重复房源:{}",houseInfo);
418
-                    responseBean.addError("第"+ currentRow +"行存在重复房源");
416
+                if (temHousingList.contains(houseInfo)) {
417
+                    logger.info("存在重复房源:{}", houseInfo);
418
+                    responseBean.addError("第" + currentRow + "行存在重复房源");
419
                     return responseBean;
419
                     return responseBean;
420
                 }
420
                 }
421
 
421
 
451
             }
451
             }
452
         }
452
         }
453
         //构建分页
453
         //构建分页
454
-        Map<String,Object> data = new HashMap<String, Object>();
455
-        data.put("list",list);
456
-        data.put("total",list.size());
454
+        Map<String, Object> data = new HashMap<String, Object>();
455
+        data.put("list", list);
456
+        data.put("total", list.size());
457
 
457
 
458
         responseBean.addSuccess(data);
458
         responseBean.addSuccess(data);
459
         return responseBean;
459
         return responseBean;
605
 
605
 
606
     //校验房号
606
     //校验房号
607
     private String checkedRoom(TaHousingResources taHousingResources) {
607
     private String checkedRoom(TaHousingResources taHousingResources) {
608
-        if (StringUtils.isEmpty(taHousingResources.getRoomName())){
608
+        if (StringUtils.isEmpty(taHousingResources.getRoomName())) {
609
             return "请输入房号。";
609
             return "请输入房号。";
610
-        }else{
610
+        } else {
611
             //查询房号
611
             //查询房号
612
             TaBuildingRoom taBuildingRoom = selectRoom(taHousingResources);
612
             TaBuildingRoom taBuildingRoom = selectRoom(taHousingResources);
613
-            if (null != taBuildingRoom){
613
+            if (null != taBuildingRoom) {
614
                 taHousingResources.setRoomId(taBuildingRoom.getRoomId());
614
                 taHousingResources.setRoomId(taBuildingRoom.getRoomId());
615
                 return "房间名" + taHousingResources.getRoomName() + "存在。不允许保存,请修改!";
615
                 return "房间名" + taHousingResources.getRoomName() + "存在。不允许保存,请修改!";
616
-            }else{
616
+            } else {
617
                 return "notExist";
617
                 return "notExist";
618
             }
618
             }
619
         }
619
         }
622
     //查询房间号
622
     //查询房间号
623
     private TaBuildingRoom selectRoom(TaHousingResources taHousingResources) {
623
     private TaBuildingRoom selectRoom(TaHousingResources taHousingResources) {
624
         QueryWrapper<TaBuildingRoom> queryWrapper = new QueryWrapper<>();
624
         QueryWrapper<TaBuildingRoom> queryWrapper = new QueryWrapper<>();
625
-        queryWrapper.eq("org_id",taHousingResources.getOrgId());
626
-        queryWrapper.eq("status",CommConstant.STATUS_NORMAL);
627
-        queryWrapper.eq("building_id",taHousingResources.getBuildingId());
628
-        queryWrapper.eq("term_id",taHousingResources.getTermId());
629
-        queryWrapper.eq("block_id",taHousingResources.getBlockId());
630
-        queryWrapper.eq("unit_id",taHousingResources.getUnitId());
631
-        queryWrapper.eq("floor_id",taHousingResources.getFloorId());
632
-        queryWrapper.eq("room_name",taHousingResources.getRoomName());
625
+        queryWrapper.eq("org_id", taHousingResources.getOrgId());
626
+        queryWrapper.eq("status", CommConstant.STATUS_NORMAL);
627
+        queryWrapper.eq("building_id", taHousingResources.getBuildingId());
628
+        queryWrapper.eq("term_id", taHousingResources.getTermId());
629
+        queryWrapper.eq("block_id", taHousingResources.getBlockId());
630
+        queryWrapper.eq("unit_id", taHousingResources.getUnitId());
631
+        queryWrapper.eq("floor_id", taHousingResources.getFloorId());
632
+        queryWrapper.eq("room_name", taHousingResources.getRoomName());
633
         return taBuildingRoomMapper.selectOne(queryWrapper);
633
         return taBuildingRoomMapper.selectOne(queryWrapper);
634
     }
634
     }
635
 
635
 
636
     //校验楼层
636
     //校验楼层
637
     private String checkedFloor(TaHousingResources taHousingResources) {
637
     private String checkedFloor(TaHousingResources taHousingResources) {
638
-        if (StringUtils.isEmpty(taHousingResources.getFloorName())){
638
+        if (StringUtils.isEmpty(taHousingResources.getFloorName())) {
639
             return "请输入楼层名。";
639
             return "请输入楼层名。";
640
-        }else{
640
+        } else {
641
             QueryWrapper<TaBuildingFloor> queryWrapper = new QueryWrapper<>();
641
             QueryWrapper<TaBuildingFloor> queryWrapper = new QueryWrapper<>();
642
-            queryWrapper.eq("org_id",taHousingResources.getOrgId());
643
-            queryWrapper.eq("status",CommConstant.STATUS_NORMAL);
644
-            queryWrapper.eq("building_id",taHousingResources.getBuildingId());
645
-            queryWrapper.eq("term_id",taHousingResources.getTermId());
646
-            queryWrapper.eq("block_id",taHousingResources.getBlockId());
647
-            queryWrapper.eq("unit_id",taHousingResources.getUnitId());
648
-            queryWrapper.eq("floor_name",taHousingResources.getFloorName());
642
+            queryWrapper.eq("org_id", taHousingResources.getOrgId());
643
+            queryWrapper.eq("status", CommConstant.STATUS_NORMAL);
644
+            queryWrapper.eq("building_id", taHousingResources.getBuildingId());
645
+            queryWrapper.eq("term_id", taHousingResources.getTermId());
646
+            queryWrapper.eq("block_id", taHousingResources.getBlockId());
647
+            queryWrapper.eq("unit_id", taHousingResources.getUnitId());
648
+            queryWrapper.eq("floor_name", taHousingResources.getFloorName());
649
             TaBuildingFloor taBuildingFloor = taBuildingFloorMapper.selectOne(queryWrapper);
649
             TaBuildingFloor taBuildingFloor = taBuildingFloorMapper.selectOne(queryWrapper);
650
-            if (null != taBuildingFloor){
650
+            if (null != taBuildingFloor) {
651
                 taHousingResources.setFloorId(taBuildingFloor.getFloorId());
651
                 taHousingResources.setFloorId(taBuildingFloor.getFloorId());
652
                 return "楼层名" + taHousingResources.getFloorName() + "存在。";
652
                 return "楼层名" + taHousingResources.getFloorName() + "存在。";
653
-            }else{
653
+            } else {
654
                 return "notExist";
654
                 return "notExist";
655
             }
655
             }
656
         }
656
         }
658
 
658
 
659
     //校验单元
659
     //校验单元
660
     private String checkedUnit(TaHousingResources taHousingResources) {
660
     private String checkedUnit(TaHousingResources taHousingResources) {
661
-        if (StringUtils.isEmpty(taHousingResources.getUnitName())){
661
+        if (StringUtils.isEmpty(taHousingResources.getUnitName())) {
662
             return "请输入单元名。";
662
             return "请输入单元名。";
663
-        }else{
663
+        } else {
664
             QueryWrapper<TaBuildingUnit> queryWrapper = new QueryWrapper<>();
664
             QueryWrapper<TaBuildingUnit> queryWrapper = new QueryWrapper<>();
665
-            queryWrapper.eq("org_id",taHousingResources.getOrgId());
666
-            queryWrapper.eq("status",CommConstant.STATUS_NORMAL);
667
-            queryWrapper.eq("building_id",taHousingResources.getBuildingId());
668
-            queryWrapper.eq("term_id",taHousingResources.getTermId());
669
-            queryWrapper.eq("block_id",taHousingResources.getBlockId());
670
-            queryWrapper.eq("unit_name",taHousingResources.getUnitName());
665
+            queryWrapper.eq("org_id", taHousingResources.getOrgId());
666
+            queryWrapper.eq("status", CommConstant.STATUS_NORMAL);
667
+            queryWrapper.eq("building_id", taHousingResources.getBuildingId());
668
+            queryWrapper.eq("term_id", taHousingResources.getTermId());
669
+            queryWrapper.eq("block_id", taHousingResources.getBlockId());
670
+            queryWrapper.eq("unit_name", taHousingResources.getUnitName());
671
             TaBuildingUnit taBuildingUnit = taBuildingUnitMapper.selectOne(queryWrapper);
671
             TaBuildingUnit taBuildingUnit = taBuildingUnitMapper.selectOne(queryWrapper);
672
-            if (null != taBuildingUnit){
672
+            if (null != taBuildingUnit) {
673
                 taHousingResources.setUnitId(taBuildingUnit.getUnitId());
673
                 taHousingResources.setUnitId(taBuildingUnit.getUnitId());
674
                 return "单元名" + taHousingResources.getUnitName() + "存在。";
674
                 return "单元名" + taHousingResources.getUnitName() + "存在。";
675
-            }else{
675
+            } else {
676
                 return "notExist";
676
                 return "notExist";
677
             }
677
             }
678
         }
678
         }
680
 
680
 
681
     //校验楼盘
681
     //校验楼盘
682
     private String checkedBlock(TaHousingResources taHousingResources) {
682
     private String checkedBlock(TaHousingResources taHousingResources) {
683
-        if (StringUtils.isEmpty(taHousingResources.getBlockName())){
683
+        if (StringUtils.isEmpty(taHousingResources.getBlockName())) {
684
             return "请输入楼栋名。";
684
             return "请输入楼栋名。";
685
-        }else{
685
+        } else {
686
             QueryWrapper<TaBuildingBlock> queryWrapper = new QueryWrapper<>();
686
             QueryWrapper<TaBuildingBlock> queryWrapper = new QueryWrapper<>();
687
-            queryWrapper.eq("org_id",taHousingResources.getOrgId());
688
-            queryWrapper.eq("status",CommConstant.STATUS_NORMAL);
689
-            queryWrapper.eq("building_id",taHousingResources.getBuildingId());
690
-            queryWrapper.eq("term_id",taHousingResources.getTermId());
691
-            queryWrapper.eq("block_name",taHousingResources.getBlockName());
687
+            queryWrapper.eq("org_id", taHousingResources.getOrgId());
688
+            queryWrapper.eq("status", CommConstant.STATUS_NORMAL);
689
+            queryWrapper.eq("building_id", taHousingResources.getBuildingId());
690
+            queryWrapper.eq("term_id", taHousingResources.getTermId());
691
+            queryWrapper.eq("block_name", taHousingResources.getBlockName());
692
             TaBuildingBlock taBuildingBlock = taBuildingBlockMapper.selectOne(queryWrapper);
692
             TaBuildingBlock taBuildingBlock = taBuildingBlockMapper.selectOne(queryWrapper);
693
-            if (null != taBuildingBlock){
693
+            if (null != taBuildingBlock) {
694
                 taHousingResources.setBlockId(taBuildingBlock.getBlockId());
694
                 taHousingResources.setBlockId(taBuildingBlock.getBlockId());
695
                 return "楼栋名" + taHousingResources.getBlockName() + "存在。";
695
                 return "楼栋名" + taHousingResources.getBlockName() + "存在。";
696
-            }else{
696
+            } else {
697
                 return "notExist";
697
                 return "notExist";
698
             }
698
             }
699
         }
699
         }
701
 
701
 
702
     //校验期
702
     //校验期
703
     private String checckedTerm(TaHousingResources taHousingResources) {
703
     private String checckedTerm(TaHousingResources taHousingResources) {
704
-        if (StringUtils.isEmpty(taHousingResources.getTermName())){
704
+        if (StringUtils.isEmpty(taHousingResources.getTermName())) {
705
             return "请输入期名。";
705
             return "请输入期名。";
706
-        }else{
706
+        } else {
707
             QueryWrapper<TaBuildingTerm> queryWrapper = new QueryWrapper<>();
707
             QueryWrapper<TaBuildingTerm> queryWrapper = new QueryWrapper<>();
708
-            queryWrapper.eq("org_id",taHousingResources.getOrgId());
709
-            queryWrapper.eq("status",CommConstant.STATUS_NORMAL);
710
-            queryWrapper.eq("building_id",taHousingResources.getBuildingId());
711
-            queryWrapper.eq("term_name",taHousingResources.getTermName());
708
+            queryWrapper.eq("org_id", taHousingResources.getOrgId());
709
+            queryWrapper.eq("status", CommConstant.STATUS_NORMAL);
710
+            queryWrapper.eq("building_id", taHousingResources.getBuildingId());
711
+            queryWrapper.eq("term_name", taHousingResources.getTermName());
712
             TaBuildingTerm taBuildingTerm = taBuildingTermMapper.selectOne(queryWrapper);
712
             TaBuildingTerm taBuildingTerm = taBuildingTermMapper.selectOne(queryWrapper);
713
-            if (null != taBuildingTerm){
713
+            if (null != taBuildingTerm) {
714
                 taHousingResources.setTermId(taBuildingTerm.getTermId());
714
                 taHousingResources.setTermId(taBuildingTerm.getTermId());
715
                 return "期名" + taHousingResources.getTermName() + "存在。";
715
                 return "期名" + taHousingResources.getTermName() + "存在。";
716
-            }else{
716
+            } else {
717
                 return "notExist";
717
                 return "notExist";
718
             }
718
             }
719
         }
719
         }

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

56
     TaApartmentImgMapper taApartmentImgMapper;
56
     TaApartmentImgMapper taApartmentImgMapper;
57
 
57
 
58
     @Override
58
     @Override
59
-    public IPage<TaPreselectionRecordPO> listPreselectionRecord(Integer pageNum, Integer pageSize, String personId) {
60
-        logger.info("listPreselectionRecord 接收参数:pageNum:{},pageSize:{},personId:{}", pageNum, pageSize, personId);
59
+    public IPage<TaPreselectionRecordPO> listPreselectionRecord(Integer pageNum, Integer pageSize, Integer orgId, String personId) {
60
+        logger.info("listPreselectionRecord 接收参数:pageNum:{},pageSize:{},orgId:{},personId:{}", pageNum, pageSize, orgId, personId);
61
 
61
 
62
         IPage<TaPreselectionRecordPO> iPage = new Page<>(pageNum, pageSize);
62
         IPage<TaPreselectionRecordPO> iPage = new Page<>(pageNum, pageSize);
63
-        iPage = taPreselectionRecordMapper.listPreselectionRecord(iPage, personId);
63
+        iPage = taPreselectionRecordMapper.listPreselectionRecord(iPage, orgId, personId);
64
 
64
 
65
         List<TaPreselectionRecordPO> poList = iPage.getRecords();
65
         List<TaPreselectionRecordPO> poList = iPage.getRecords();
66
         if (CollectionUtils.isNotEmpty(poList)) {
66
         if (CollectionUtils.isNotEmpty(poList)) {
79
                     buildingImgQueryWrapper.eq("img_type", CommConstant.BUILDING_IMG_APARMENT);
79
                     buildingImgQueryWrapper.eq("img_type", CommConstant.BUILDING_IMG_APARMENT);
80
                     taBuildingImgList = taBuildingImgMapper.selectList(buildingImgQueryWrapper);
80
                     taBuildingImgList = taBuildingImgMapper.selectList(buildingImgQueryWrapper);
81
                     po.setBuildingImgList(taBuildingImgList);
81
                     po.setBuildingImgList(taBuildingImgList);
82
-                    resultList.add(po);
83
                 }
82
                 }
83
+                resultList.add(po);
84
             }
84
             }
85
             iPage.setRecords(resultList);
85
             iPage.setRecords(resultList);
86
         }
86
         }

+ 58
- 42
src/main/resources/mapper/TaHousingResourcesMapper.xml 查看文件

3
 <mapper namespace="com.huiju.estateagents.mapper.TaHousingResourcesMapper">
3
 <mapper namespace="com.huiju.estateagents.mapper.TaHousingResourcesMapper">
4
 
4
 
5
     <select id="listHousingResources" resultType="com.huiju.estateagents.po.TaHousingResourcesPO">
5
     <select id="listHousingResources" resultType="com.huiju.estateagents.po.TaHousingResourcesPO">
6
+        SELECT
7
+          *
8
+        FROM
9
+          (
6
         SELECT
10
         SELECT
7
             t.house_id,
11
             t.house_id,
8
             t.building_id,
12
             t.building_id,
17
             t.room_name,
21
             t.room_name,
18
             t.price,
22
             t.price,
19
             t.heat,
23
             t.heat,
24
+            t.real_heat,
20
             t.apartment_id,
25
             t.apartment_id,
21
             t.`status`,
26
             t.`status`,
22
             t.org_id,
27
             t.org_id,
23
             t2.inside_area,
28
             t2.inside_area,
24
             t2.building_area,
29
             t2.building_area,
25
-            t2.apartment_name
30
+            t2.apartment_name,
31
+            t3.term_id,
32
+            t4.term_name termName
26
         FROM
33
         FROM
27
-            ta_housing_resources t,
28
-            ta_building_apartment t2
34
+          ta_housing_resources t
35
+        LEFT JOIN ta_building_apartment t2 ON t.apartment_id = t2.apartment_id
36
+        LEFT JOIN ta_building_block t3 ON t.block_id = t3.block_id
37
+        LEFT JOIN ta_building_term t4 ON t3.term_id = t4.term_id
29
         WHERE
38
         WHERE
30
             t.sales_batch_id = #{salesBatchId}
39
             t.sales_batch_id = #{salesBatchId}
31
-        <if test="startPrice != null and startPrice != '' and endPrice != null and endPrice != ''">
32
-            AND ( t.price BETWEEN #{startPrice} AND #{endPrice} )
33
-        </if>
34
-        <if test="apartmentId != null and apartmentId != ''">
35
-            AND t.apartment_id = #{apartmentId}
36
-        </if>
37
-        AND t.apartment_id = t2.apartment_id
38
-        AND t.`status` = 1
39
-        AND t2.`status` = 1
40
-        ORDER BY t.create_date DESC
40
+            <if test="startPrice != null and startPrice != '' and endPrice != null and endPrice != ''">
41
+                AND ( t.price BETWEEN #{startPrice} AND #{endPrice} )
42
+            </if>
43
+            <if test="apartmentId != null and apartmentId != ''">
44
+                AND t.apartment_id = #{apartmentId}
45
+            </if>
46
+            AND t.org_id = #{orgId}
47
+            AND t.`status` = 1
48
+            AND t2.`status` = 1
49
+          ) t5
50
+        ORDER BY
51
+            t5.termName,
52
+            t5.block_name,
53
+            t5.unit_name,
54
+            t5.floor_name DESC,
55
+            t5.room_name
41
     </select>
56
     </select>
42
 
57
 
43
     <select id="listBuildApartmentBySalesBatchId" resultType="com.huiju.estateagents.entity.TaBuildingApartment">
58
     <select id="listBuildApartmentBySalesBatchId" resultType="com.huiju.estateagents.entity.TaBuildingApartment">
56
 
71
 
57
     <update id="updateForAddHeat" parameterType="java.lang.String">
72
     <update id="updateForAddHeat" parameterType="java.lang.String">
58
         UPDATE ta_housing_resources t
73
         UPDATE ta_housing_resources t
59
-        SET t.heat = t.heat + 1
74
+        SET t.real_heat = t.real_heat + 1
60
         WHERE
75
         WHERE
61
             t.house_id = #{houseId}
76
             t.house_id = #{houseId}
62
-            AND t.heat >= 0
77
+            AND t.real_heat >= 0
63
     </update>
78
     </update>
64
 
79
 
65
     <update id="updateForSubtractHeat" parameterType="java.lang.String">
80
     <update id="updateForSubtractHeat" parameterType="java.lang.String">
66
         UPDATE ta_housing_resources t
81
         UPDATE ta_housing_resources t
67
-        SET t.heat = t.heat - 1
82
+        SET t.real_heat = t.real_heat - 1
68
         WHERE
83
         WHERE
69
             t.house_id = #{houseId}
84
             t.house_id = #{houseId}
70
-            AND t.heat > 0
85
+            AND t.real_heat > 0
71
     </update>
86
     </update>
72
 
87
 
73
     <select id="getHousingDetailById" resultType="com.huiju.estateagents.po.TaHousingResourcesPO">
88
     <select id="getHousingDetailById" resultType="com.huiju.estateagents.po.TaHousingResourcesPO">
74
         SELECT
89
         SELECT
75
-        t.house_id,
76
-        t.building_id,
77
-        t.block_id,
78
-        t.block_name,
79
-        t.sales_batch_id,
80
-        t.unit_id,
81
-        t.unit_name,
82
-        t.floor_id,
83
-        t.floor_name,
84
-        t.room_id,
85
-        t.room_name,
86
-        t.price,
87
-        t.heat,
88
-        t.apartment_id,
89
-        t.`status`,
90
-        t.org_id,
91
-        t2.apartment_name,
92
-        t2.inside_area,
93
-        t2.building_area,
94
-        t3.preselection_start_time,
95
-        t3.preselection_end_time,
96
-        t3.`status` saleBatchStatus
90
+            t.house_id,
91
+            t.building_id,
92
+            t.block_id,
93
+            t.block_name,
94
+            t.sales_batch_id,
95
+            t.unit_id,
96
+            t.unit_name,
97
+            t.floor_id,
98
+            t.floor_name,
99
+            t.room_id,
100
+            t.room_name,
101
+            t.price,
102
+            t.heat,
103
+            t.real_heat,
104
+            t.apartment_id,
105
+            t.`status`,
106
+            t.org_id,
107
+            t2.apartment_name,
108
+            t2.inside_area,
109
+            t2.building_area,
110
+            t3.preselection_start_time,
111
+            t3.preselection_end_time,
112
+            t3.`status` saleBatchStatus
97
         FROM
113
         FROM
98
-        ta_housing_resources t,
99
-        ta_building_apartment t2,
100
-        ta_sales_batch t3
114
+            ta_housing_resources t,
115
+            ta_building_apartment t2,
116
+            ta_sales_batch t3
101
         WHERE
117
         WHERE
102
         t.house_id = #{houseId}
118
         t.house_id = #{houseId}
103
         AND t.apartment_id = t2.apartment_id
119
         AND t.apartment_id = t2.apartment_id

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

5
     <select id="listPreselectionRecord" resultType="com.huiju.estateagents.po.TaPreselectionRecordPO">
5
     <select id="listPreselectionRecord" resultType="com.huiju.estateagents.po.TaPreselectionRecordPO">
6
         SELECT
6
         SELECT
7
             t3.*,
7
             t3.*,
8
-            t4.building_name
8
+            t4.building_name,
9
+            t5.`status` saleBatchStatus
9
         FROM
10
         FROM
10
             (
11
             (
11
         SELECT
12
         SELECT
12
-            t.*,
13
+            t.preselection_record_id,
14
+            t.person_id,
15
+            t.org_id,
16
+            t.house_id,
17
+            t.`status`,
18
+            t.create_date,
13
             t2.block_name,
19
             t2.block_name,
14
             t2.unit_name,
20
             t2.unit_name,
15
             t2.floor_name,
21
             t2.floor_name,
16
             t2.room_name,
22
             t2.room_name,
17
             t2.price,
23
             t2.price,
18
             t2.apartment_id,
24
             t2.apartment_id,
19
-            t2.building_id buildingId
25
+            t2.building_id buildingId,
26
+            t2.`status` housingStatus,
27
+            t2.sales_batch_id saleBatchId
20
         FROM
28
         FROM
21
             ta_preselection_record t,
29
             ta_preselection_record t,
22
             ta_housing_resources t2
30
             ta_housing_resources t2
23
         WHERE
31
         WHERE
24
             t.person_id = #{personId}
32
             t.person_id = #{personId}
33
+            AND t.org_id = #{orgId}
25
             AND t.house_id = t2.house_id
34
             AND t.house_id = t2.house_id
26
         ORDER BY
35
         ORDER BY
27
             t.create_date DESC
36
             t.create_date DESC
28
             ) t3
37
             ) t3
29
             LEFT JOIN ta_building t4 ON t3.buildingId = t4.building_id
38
             LEFT JOIN ta_building t4 ON t3.buildingId = t4.building_id
39
+            LEFT JOIN ta_sales_batch t5 ON t3.saleBatchId = t5.sales_batch_id
30
     </select>
40
     </select>
31
 
41
 
32
     <select id="getRecordByPersonIdAndHouseId" resultType="com.huiju.estateagents.entity.TaPreselectionRecord">
42
     <select id="getRecordByPersonIdAndHouseId" resultType="com.huiju.estateagents.entity.TaPreselectionRecord">