Bläddra i källkod

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

# Conflicts:
#	src/main/java/com/huiju/estateagents/service/impl/TaHousingResourcesServiceImpl.java
傅行帆 5 år sedan
förälder
incheckning
3ba263eac3

+ 38
- 12
src/main/java/com/huiju/estateagents/controller/TaHousingResourcesController.java Visa fil

@@ -79,7 +79,7 @@ public class TaHousingResourcesController extends BaseController {
79 79
      * @return
80 80
      */
81 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 83
         ResponseBean responseBean = new ResponseBean();
84 84
         try {
85 85
             taHousingResources.setOrgId(getOrgId(request));
@@ -133,7 +133,7 @@ public class TaHousingResourcesController extends BaseController {
133 133
      */
134 134
     @RequestMapping(value = "/admin/taHousingResources/{id}", method = RequestMethod.PUT)
135 135
     public ResponseBean taHousingResourcesUpdate(@PathVariable Integer id,
136
-                                                 @RequestBody TaHousingResources taHousingResources,HttpServletRequest request) {
136
+                                                 @RequestBody TaHousingResources taHousingResources, HttpServletRequest request) {
137 137
         ResponseBean responseBean = new ResponseBean();
138 138
         try {
139 139
             taHousingResources.setHouseId(id);
@@ -152,7 +152,7 @@ public class TaHousingResourcesController extends BaseController {
152 152
      * 修改户型
153 153
      */
154 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 156
         ResponseBean responseBean = new ResponseBean();
157 157
         try {
158 158
             List<TaHousingResources> houseIdList = taHousingResources.getHouseIdList();
@@ -190,20 +190,23 @@ public class TaHousingResourcesController extends BaseController {
190 190
     /**
191 191
      * 获取房源列表
192 192
      *
193
-     * @param pageNum      页码
194
-     * @param pageSize     分页大小
195 193
      * @param salesBatchId 销售批次ID
194
+     * @param startPrice   房源起始价格
195
+     * @param endPrice     房源结束价格
196
+     * @param apartmentId  户型ID
197
+     * @param request
196 198
      * @return
197 199
      * @author gushaoyong
198 200
      */
199 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 205
         ResponseBean responseBean = new ResponseBean();
206
+        Integer orgId = getOrgId(request);
207
+
205 208
         try {
206
-            responseBean.addSuccess(iTaHousingResourcesService.listHousingResources(pageNum, pageSize, salesBatchId, startPrice, endPrice, apartmentId));
209
+            responseBean.addSuccess(iTaHousingResourcesService.listHousingResources(orgId, salesBatchId, startPrice, endPrice, apartmentId));
207 210
         } catch (Exception e) {
208 211
             logger.error("listHousingResources -=- {}", e);
209 212
             responseBean.addError(e.getMessage());
@@ -211,6 +214,28 @@ public class TaHousingResourcesController extends BaseController {
211 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,7 +264,8 @@ public class TaHousingResourcesController extends BaseController {
239 264
      */
240 265
     @RequestMapping(value = "/wx/getHousingDetailById", method = RequestMethod.GET)
241 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 269
         ResponseBean responseBean = new ResponseBean();
244 270
         try {
245 271
             responseBean.addSuccess(iTaHousingResourcesService.getHousingDetailById(personId, houseId));
@@ -257,7 +283,7 @@ public class TaHousingResourcesController extends BaseController {
257 283
      * @return
258 284
      */
259 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 287
         ResponseBean responseBean = new ResponseBean();
262 288
         try {
263 289
             taHousingResources.setOrgId(getOrgId(request));

+ 13
- 30
src/main/java/com/huiju/estateagents/controller/TaPreselectionRecordController.java Visa fil

@@ -71,11 +71,12 @@ public class TaPreselectionRecordController extends BaseController {
71 71
      * @author gushaoyong
72 72
      */
73 73
     @RequestMapping(value = "/taPreselectionRecord", method = RequestMethod.POST)
74
-    public ResponseBean taPreselectionRecordAdd(@RequestBody TaPreselectionRecord taPreselectionRecord) {
74
+    public ResponseBean taPreselectionRecordAdd(@RequestBody TaPreselectionRecord taPreselectionRecord,HttpServletRequest request) {
75 75
         ResponseBean responseBean = new ResponseBean();
76
-
76
+        Integer orgId = getOrgId(request);
77 77
         logger.info("taPreselectionRecordAdd 接收参数,taPreselectionRecord:{}", JSONObject.toJSONString(taPreselectionRecord));
78 78
 
79
+        taPreselectionRecord.setOrgId(orgId);
79 80
         try {
80 81
 
81 82
             // 校验参数
@@ -194,47 +195,29 @@ public class TaPreselectionRecordController extends BaseController {
194 195
     @RequestMapping(value = "/wx/listPreselectionRecord", method = RequestMethod.GET)
195 196
     public ResponseBean listPreselectionRecord(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
196 197
                                                @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
197
-                                               @RequestParam("personId") String personId) {
198
+                                               @RequestParam("personId") String personId,
199
+                                               HttpServletRequest request) {
198 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 203
         try {
221
-            responseBean.addSuccess(iTaPreselectionRecordService.checkPreselect(personId, houseId));
204
+            responseBean.addSuccess(iTaPreselectionRecordService.listPreselectionRecord(pageNum, pageSize, orgId, personId));
222 205
         } catch (Exception e) {
223
-            logger.error("checkPreselect -=- {}", e);
206
+            logger.error("listPreselectionRecord -=- {}", e);
224 207
             responseBean.addError(e.getMessage());
225 208
         }
226 209
         return responseBean;
227 210
     }
228 211
 
229 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 217
                                                   @RequestParam(value = "phone", required = false) String phone,
235 218
                                                   @RequestParam(value = "apartmentId", required = false) String apartmentId,
236 219
                                                   @RequestParam(value = "status", required = false) Integer status,
237
-                                                  HttpServletRequest request){
220
+                                                  HttpServletRequest request) {
238 221
         ResponseBean responseBean = new ResponseBean();
239 222
         try {
240 223
             responseBean = iTaPreselectionRecordService.selectPreSelectRecordList(pageNum, pageSize, salesBatchId, houseId, getOrgId(request), phone, apartmentId, status);

+ 1
- 2
src/main/java/com/huiju/estateagents/mapper/TaHousingResourcesMapper.java Visa fil

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

+ 3
- 1
src/main/java/com/huiju/estateagents/mapper/TaPreselectionRecordMapper.java Visa fil

@@ -30,7 +30,9 @@ public interface TaPreselectionRecordMapper extends BaseMapper<TaPreselectionRec
30 30
      * @param personId
31 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 38
      * 根据房源ID和用户ID获取预选记录

+ 3
- 5
src/main/java/com/huiju/estateagents/po/TaHousingResourcesPO.java Visa fil

@@ -19,11 +19,6 @@ import java.util.List;
19 19
 @Accessors(chain = true)
20 20
 public class TaHousingResourcesPO extends TaHousingResources {
21 21
 
22
-    /**
23
-     * 户型名称
24
-     */
25
-    private String apartmentName;
26
-
27 22
     private Double insideArea;
28 23
 
29 24
     private Double buildingArea;
@@ -54,4 +49,7 @@ public class TaHousingResourcesPO extends TaHousingResources {
54 49
      */
55 50
     @TableField(exist = false)
56 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 Visa fil

@@ -83,4 +83,14 @@ public class TaPreselectionRecordPO extends TaPreselectionRecord {
83 83
      * 最后修改人
84 84
      */
85 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 Visa fil

@@ -22,15 +22,13 @@ public interface ITaHousingResourcesService extends IService<TaHousingResources>
22 22
 
23 23
     /* 分页获取房源列表
24 24
      *
25
-     * @param pageNum      页码
26
-     * @param pageSize     分页大小
27 25
      * @param salesBatchId 销售批次ID
28 26
      * @param startPrice
29 27
      * @param endPrice
30 28
      * @param apartmentId
31 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,14 +41,15 @@ public interface ITaHousingResourcesService extends IService<TaHousingResources>
43 41
     /**
44 42
      * 根据房源ID获取房源详情
45 43
      *
46
-     * @param personId
47
-     * @param houseId
44
+     * @param personId 用户ID
45
+     * @param houseId  房源ID
48 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 53
      * @param taHousingResources
55 54
      * @return
56 55
      */
@@ -58,6 +57,7 @@ public interface ITaHousingResourcesService extends IService<TaHousingResources>
58 57
 
59 58
     /**
60 59
      * 添加楼栋信息
60
+     *
61 61
      * @param taHousingResources
62 62
      * @return
63 63
      */
@@ -65,6 +65,7 @@ public interface ITaHousingResourcesService extends IService<TaHousingResources>
65 65
 
66 66
     /**
67 67
      * 分页获取房源信息
68
+     *
68 69
      * @param salesBatchId
69 70
      * @param buildingId
70 71
      * @param pageNumber
@@ -84,6 +85,7 @@ public interface ITaHousingResourcesService extends IService<TaHousingResources>
84 85
 
85 86
     /**
86 87
      * 更新房源信息
88
+     *
87 89
      * @param taHousingResources
88 90
      * @return
89 91
      */
@@ -91,6 +93,7 @@ public interface ITaHousingResourcesService extends IService<TaHousingResources>
91 93
 
92 94
     /**
93 95
      * 获取表格中的数据
96
+     *
94 97
      * @param file
95 98
      * @param salesBatchId
96 99
      * @param buildingId

+ 2
- 1
src/main/java/com/huiju/estateagents/service/ITaPreselectionRecordService.java Visa fil

@@ -21,10 +21,11 @@ public interface ITaPreselectionRecordService extends IService<TaPreselectionRec
21 21
      *
22 22
      * @param pageNum
23 23
      * @param pageSize
24
+     * @param orgId
24 25
      * @param personId
25 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 Visa fil

@@ -66,7 +66,7 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
66 66
 
67 67
     @Autowired
68 68
     private TaBuildingRoomMapper taBuildingRoomMapper;
69
-    
69
+
70 70
     @Autowired
71 71
     private TaBuildingMapper taBuildingMapper;
72 72
 
@@ -83,8 +83,6 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
83 83
     /**
84 84
      * 分页获取房源列表
85 85
      *
86
-     * @param pageNum      页码
87
-     * @param pageSize     分页大小
88 86
      * @param salesBatchId 销售批次ID
89 87
      * @param startPrice
90 88
      * @param endPrice
@@ -92,12 +90,14 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
92 90
      * @return
93 91
      */
94 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,7 +167,7 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
167 167
         List<TaBuildingImg> taBuildingImgList = new ArrayList<>();
168 168
         List<TaApartmentImg> buildingImg;
169 169
         QueryWrapper<TaBuildingImg> buildingImgQueryWrapper;
170
-        QueryWrapper<TaApartmentImg>  apartmentImgQueryWrapper = new QueryWrapper<>();
170
+        QueryWrapper<TaApartmentImg> apartmentImgQueryWrapper = new QueryWrapper<>();
171 171
         apartmentImgQueryWrapper.eq("apartment_id", resourcesPO.getApartmentId());
172 172
         buildingImg = taApartmentImgMapper.selectList(apartmentImgQueryWrapper);
173 173
         for (TaApartmentImg apartmentImg : buildingImg) {
@@ -176,7 +176,7 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
176 176
             buildingImgQueryWrapper.eq("img_type", CommConstant.BUILDING_IMG_APARMENT);
177 177
             taBuildingImgList = taBuildingImgMapper.selectList(buildingImgQueryWrapper);
178 178
         }
179
-        if(CollectionUtils.isNotEmpty(taBuildingImgList)){
179
+        if (CollectionUtils.isNotEmpty(taBuildingImgList)) {
180 180
             resourcesPO.setBuildingImgList(taBuildingImgList);
181 181
         }
182 182
 
@@ -194,19 +194,19 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
194 194
         StringBuffer result = new StringBuffer();
195 195
         //校验期
196 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 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 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 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 208
         String roomResult = checkedRoom(taHousingResources);
209
-        result.append(roomResult.equals("notExist") ? "房号" + taHousingResources.getRoomName() + "不存在,会直接新建。" : roomResult );
209
+        result.append(roomResult.equals("notExist") ? "房号" + taHousingResources.getRoomName() + "不存在,会直接新建。" : roomResult);
210 210
         return result;
211 211
     }
212 212
 
@@ -230,35 +230,35 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
230 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 239
             addTerm(taHousingResources);
240 240
         }
241 241
 
242 242
         //楼栋不存在就添加
243
-        if (blockResult.equals("notExist")){
243
+        if (blockResult.equals("notExist")) {
244 244
             addBlock(taHousingResources);
245 245
         }
246 246
 
247 247
         //单元不存在就添加
248
-        if (unitResult.equals("notExist")){
248
+        if (unitResult.equals("notExist")) {
249 249
             addUnit(taHousingResources);
250 250
         }
251 251
 
252 252
         //楼层不存在就添加
253
-        if (floorResult.equals("notExist")){
253
+        if (floorResult.equals("notExist")) {
254 254
             addFloor(taHousingResources);
255 255
         }
256 256
 
257 257
         //房间号不存在就添加
258
-        if (roomResult.equals("notExist")){
258
+        if (roomResult.equals("notExist")) {
259 259
             addRoom(taHousingResources);
260 260
         }
261
-        
261
+
262 262
         // 获取楼盘名称
263 263
         TaBuilding taBuilding = taBuildingMapper.selectById(taHousingResources.getBuildingId());
264 264
         taHousingResources.setBuildingName(taBuilding.getBuildingName());
@@ -317,15 +317,15 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
317 317
         taHousingResources.setFloorId(oldTaHousingResources.getFloorId());
318 318
         taHousingResources.setRoomId(oldTaHousingResources.getRoomId());
319 319
         //只允许编辑房间名
320
-        if (!oldTaHousingResources.getRoomName().equals(taHousingResources.getRoomName())){
320
+        if (!oldTaHousingResources.getRoomName().equals(taHousingResources.getRoomName())) {
321 321
             //校验房号
322 322
             String roomResult = checkedRoom(taHousingResources);
323 323
 
324 324
             //房间号不存在就更新
325
-            if (roomResult.equals("notExist")){
325
+            if (roomResult.equals("notExist")) {
326 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,32 +390,32 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
390 390
                 Integer heat = Integer.valueOf(String.valueOf(row.getCell(6).getNumericCellValue()).substring(0,1));
391 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 395
                     responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
396 396
                     return responseBean;
397 397
                 }
398
-                if (StringUtils.isEmpty(blockName)){
398
+                if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(blockName)) {
399 399
                     responseBean.addError("第" + currentRow + "行" + "楼栋不能为空!");
400 400
                     return responseBean;
401 401
                 }
402
-                if (StringUtils.isEmpty(unitName)){
402
+                if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(unitName)) {
403 403
                     responseBean.addError("第" + currentRow + "行" + "单元不能为空!");
404 404
                     return responseBean;
405 405
                 }
406
-                if (StringUtils.isEmpty(floorName)){
406
+                if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(floorName)) {
407 407
                     responseBean.addError("第" + currentRow + "行" + "层不能为空!");
408 408
                     return responseBean;
409 409
                 }
410
-                if (StringUtils.isEmpty(roomName)){
410
+                if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(roomName)) {
411 411
                     responseBean.addError("第" + currentRow + "行" + "房号不能为空!");
412 412
                     return responseBean;
413 413
                 }
414 414
 
415 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 419
                     return responseBean;
420 420
                 }
421 421
 
@@ -451,9 +451,9 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
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 458
         responseBean.addSuccess(data);
459 459
         return responseBean;
@@ -605,15 +605,15 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
605 605
 
606 606
     //校验房号
607 607
     private String checkedRoom(TaHousingResources taHousingResources) {
608
-        if (StringUtils.isEmpty(taHousingResources.getRoomName())){
608
+        if (StringUtils.isEmpty(taHousingResources.getRoomName())) {
609 609
             return "请输入房号。";
610
-        }else{
610
+        } else {
611 611
             //查询房号
612 612
             TaBuildingRoom taBuildingRoom = selectRoom(taHousingResources);
613
-            if (null != taBuildingRoom){
613
+            if (null != taBuildingRoom) {
614 614
                 taHousingResources.setRoomId(taBuildingRoom.getRoomId());
615 615
                 return "房间名" + taHousingResources.getRoomName() + "存在。不允许保存,请修改!";
616
-            }else{
616
+            } else {
617 617
                 return "notExist";
618 618
             }
619 619
         }
@@ -622,35 +622,35 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
622 622
     //查询房间号
623 623
     private TaBuildingRoom selectRoom(TaHousingResources taHousingResources) {
624 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 633
         return taBuildingRoomMapper.selectOne(queryWrapper);
634 634
     }
635 635
 
636 636
     //校验楼层
637 637
     private String checkedFloor(TaHousingResources taHousingResources) {
638
-        if (StringUtils.isEmpty(taHousingResources.getFloorName())){
638
+        if (StringUtils.isEmpty(taHousingResources.getFloorName())) {
639 639
             return "请输入楼层名。";
640
-        }else{
640
+        } else {
641 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 649
             TaBuildingFloor taBuildingFloor = taBuildingFloorMapper.selectOne(queryWrapper);
650
-            if (null != taBuildingFloor){
650
+            if (null != taBuildingFloor) {
651 651
                 taHousingResources.setFloorId(taBuildingFloor.getFloorId());
652 652
                 return "楼层名" + taHousingResources.getFloorName() + "存在。";
653
-            }else{
653
+            } else {
654 654
                 return "notExist";
655 655
             }
656 656
         }
@@ -658,21 +658,21 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
658 658
 
659 659
     //校验单元
660 660
     private String checkedUnit(TaHousingResources taHousingResources) {
661
-        if (StringUtils.isEmpty(taHousingResources.getUnitName())){
661
+        if (StringUtils.isEmpty(taHousingResources.getUnitName())) {
662 662
             return "请输入单元名。";
663
-        }else{
663
+        } else {
664 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 671
             TaBuildingUnit taBuildingUnit = taBuildingUnitMapper.selectOne(queryWrapper);
672
-            if (null != taBuildingUnit){
672
+            if (null != taBuildingUnit) {
673 673
                 taHousingResources.setUnitId(taBuildingUnit.getUnitId());
674 674
                 return "单元名" + taHousingResources.getUnitName() + "存在。";
675
-            }else{
675
+            } else {
676 676
                 return "notExist";
677 677
             }
678 678
         }
@@ -680,20 +680,20 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
680 680
 
681 681
     //校验楼盘
682 682
     private String checkedBlock(TaHousingResources taHousingResources) {
683
-        if (StringUtils.isEmpty(taHousingResources.getBlockName())){
683
+        if (StringUtils.isEmpty(taHousingResources.getBlockName())) {
684 684
             return "请输入楼栋名。";
685
-        }else{
685
+        } else {
686 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 692
             TaBuildingBlock taBuildingBlock = taBuildingBlockMapper.selectOne(queryWrapper);
693
-            if (null != taBuildingBlock){
693
+            if (null != taBuildingBlock) {
694 694
                 taHousingResources.setBlockId(taBuildingBlock.getBlockId());
695 695
                 return "楼栋名" + taHousingResources.getBlockName() + "存在。";
696
-            }else{
696
+            } else {
697 697
                 return "notExist";
698 698
             }
699 699
         }
@@ -701,19 +701,19 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
701 701
 
702 702
     //校验期
703 703
     private String checckedTerm(TaHousingResources taHousingResources) {
704
-        if (StringUtils.isEmpty(taHousingResources.getTermName())){
704
+        if (StringUtils.isEmpty(taHousingResources.getTermName())) {
705 705
             return "请输入期名。";
706
-        }else{
706
+        } else {
707 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 712
             TaBuildingTerm taBuildingTerm = taBuildingTermMapper.selectOne(queryWrapper);
713
-            if (null != taBuildingTerm){
713
+            if (null != taBuildingTerm) {
714 714
                 taHousingResources.setTermId(taBuildingTerm.getTermId());
715 715
                 return "期名" + taHousingResources.getTermName() + "存在。";
716
-            }else{
716
+            } else {
717 717
                 return "notExist";
718 718
             }
719 719
         }

+ 4
- 4
src/main/java/com/huiju/estateagents/service/impl/TaPreselectionRecordServiceImpl.java Visa fil

@@ -56,11 +56,11 @@ public class TaPreselectionRecordServiceImpl extends ServiceImpl<TaPreselectionR
56 56
     TaApartmentImgMapper taApartmentImgMapper;
57 57
 
58 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 62
         IPage<TaPreselectionRecordPO> iPage = new Page<>(pageNum, pageSize);
63
-        iPage = taPreselectionRecordMapper.listPreselectionRecord(iPage, personId);
63
+        iPage = taPreselectionRecordMapper.listPreselectionRecord(iPage, orgId, personId);
64 64
 
65 65
         List<TaPreselectionRecordPO> poList = iPage.getRecords();
66 66
         if (CollectionUtils.isNotEmpty(poList)) {
@@ -79,8 +79,8 @@ public class TaPreselectionRecordServiceImpl extends ServiceImpl<TaPreselectionR
79 79
                     buildingImgQueryWrapper.eq("img_type", CommConstant.BUILDING_IMG_APARMENT);
80 80
                     taBuildingImgList = taBuildingImgMapper.selectList(buildingImgQueryWrapper);
81 81
                     po.setBuildingImgList(taBuildingImgList);
82
-                    resultList.add(po);
83 82
                 }
83
+                resultList.add(po);
84 84
             }
85 85
             iPage.setRecords(resultList);
86 86
         }

+ 58
- 42
src/main/resources/mapper/TaHousingResourcesMapper.xml Visa fil

@@ -3,6 +3,10 @@
3 3
 <mapper namespace="com.huiju.estateagents.mapper.TaHousingResourcesMapper">
4 4
 
5 5
     <select id="listHousingResources" resultType="com.huiju.estateagents.po.TaHousingResourcesPO">
6
+        SELECT
7
+          *
8
+        FROM
9
+          (
6 10
         SELECT
7 11
             t.house_id,
8 12
             t.building_id,
@@ -17,27 +21,38 @@
17 21
             t.room_name,
18 22
             t.price,
19 23
             t.heat,
24
+            t.real_heat,
20 25
             t.apartment_id,
21 26
             t.`status`,
22 27
             t.org_id,
23 28
             t2.inside_area,
24 29
             t2.building_area,
25
-            t2.apartment_name
30
+            t2.apartment_name,
31
+            t3.term_id,
32
+            t4.term_name termName
26 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 38
         WHERE
30 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 56
     </select>
42 57
 
43 58
     <select id="listBuildApartmentBySalesBatchId" resultType="com.huiju.estateagents.entity.TaBuildingApartment">
@@ -56,48 +71,49 @@
56 71
 
57 72
     <update id="updateForAddHeat" parameterType="java.lang.String">
58 73
         UPDATE ta_housing_resources t
59
-        SET t.heat = t.heat + 1
74
+        SET t.real_heat = t.real_heat + 1
60 75
         WHERE
61 76
             t.house_id = #{houseId}
62
-            AND t.heat >= 0
77
+            AND t.real_heat >= 0
63 78
     </update>
64 79
 
65 80
     <update id="updateForSubtractHeat" parameterType="java.lang.String">
66 81
         UPDATE ta_housing_resources t
67
-        SET t.heat = t.heat - 1
82
+        SET t.real_heat = t.real_heat - 1
68 83
         WHERE
69 84
             t.house_id = #{houseId}
70
-            AND t.heat > 0
85
+            AND t.real_heat > 0
71 86
     </update>
72 87
 
73 88
     <select id="getHousingDetailById" resultType="com.huiju.estateagents.po.TaHousingResourcesPO">
74 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 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 117
         WHERE
102 118
         t.house_id = #{houseId}
103 119
         AND t.apartment_id = t2.apartment_id

+ 13
- 3
src/main/resources/mapper/TaPreselectionRecordMapper.xml Visa fil

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