|
@@ -25,8 +25,10 @@ import org.slf4j.Logger;
|
25
|
25
|
import org.slf4j.LoggerFactory;
|
26
|
26
|
import org.springframework.beans.factory.annotation.Autowired;
|
27
|
27
|
import org.springframework.stereotype.Service;
|
|
28
|
+import org.springframework.transaction.annotation.Transactional;
|
28
|
29
|
import org.springframework.web.multipart.MultipartFile;
|
29
|
30
|
|
|
31
|
+import java.math.BigDecimal;
|
30
|
32
|
import java.time.LocalDateTime;
|
31
|
33
|
import java.util.ArrayList;
|
32
|
34
|
import java.util.HashMap;
|
|
@@ -41,6 +43,7 @@ import java.util.Map;
|
41
|
43
|
* @author jobob
|
42
|
44
|
* @since 2020-02-10
|
43
|
45
|
*/
|
|
46
|
+@Transactional(rollbackFor = Exception.class)
|
44
|
47
|
@Service
|
45
|
48
|
public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResourcesMapper, TaHousingResources> implements ITaHousingResourcesService {
|
46
|
49
|
|
|
@@ -63,7 +66,7 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
63
|
66
|
|
64
|
67
|
@Autowired
|
65
|
68
|
private TaBuildingRoomMapper taBuildingRoomMapper;
|
66
|
|
-
|
|
69
|
+
|
67
|
70
|
@Autowired
|
68
|
71
|
private TaBuildingMapper taBuildingMapper;
|
69
|
72
|
|
|
@@ -80,8 +83,6 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
80
|
83
|
/**
|
81
|
84
|
* 分页获取房源列表
|
82
|
85
|
*
|
83
|
|
- * @param pageNum 页码
|
84
|
|
- * @param pageSize 分页大小
|
85
|
86
|
* @param salesBatchId 销售批次ID
|
86
|
87
|
* @param startPrice
|
87
|
88
|
* @param endPrice
|
|
@@ -89,12 +90,14 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
89
|
90
|
* @return
|
90
|
91
|
*/
|
91
|
92
|
@Override
|
92
|
|
- public IPage<TaHousingResourcesPO> listHousingResources(Integer pageNum, Integer pageSize, String salesBatchId, String startPrice, String endPrice, String apartmentId) {
|
93
|
|
- logger.info("listHousingResources 接收参数:pageNum:{},pageSize:{},salesBatchId:{},startPrice:{},endPrice:{},apartmentId:{}",
|
94
|
|
- 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);
|
95
|
99
|
|
96
|
|
- IPage<TaHousingResourcesPO> iPage = new Page<>(pageNum, pageSize);
|
97
|
|
- return taHousingResourcesMapper.listHousingResources(iPage, salesBatchId, startPrice, endPrice, apartmentId);
|
|
100
|
+ return resourcesPOList;
|
98
|
101
|
}
|
99
|
102
|
|
100
|
103
|
/**
|
|
@@ -164,7 +167,7 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
164
|
167
|
List<TaBuildingImg> taBuildingImgList = new ArrayList<>();
|
165
|
168
|
List<TaApartmentImg> buildingImg;
|
166
|
169
|
QueryWrapper<TaBuildingImg> buildingImgQueryWrapper;
|
167
|
|
- QueryWrapper<TaApartmentImg> apartmentImgQueryWrapper = new QueryWrapper<>();
|
|
170
|
+ QueryWrapper<TaApartmentImg> apartmentImgQueryWrapper = new QueryWrapper<>();
|
168
|
171
|
apartmentImgQueryWrapper.eq("apartment_id", resourcesPO.getApartmentId());
|
169
|
172
|
buildingImg = taApartmentImgMapper.selectList(apartmentImgQueryWrapper);
|
170
|
173
|
for (TaApartmentImg apartmentImg : buildingImg) {
|
|
@@ -173,7 +176,7 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
173
|
176
|
buildingImgQueryWrapper.eq("img_type", CommConstant.BUILDING_IMG_APARMENT);
|
174
|
177
|
taBuildingImgList = taBuildingImgMapper.selectList(buildingImgQueryWrapper);
|
175
|
178
|
}
|
176
|
|
- if(CollectionUtils.isNotEmpty(taBuildingImgList)){
|
|
179
|
+ if (CollectionUtils.isNotEmpty(taBuildingImgList)) {
|
177
|
180
|
resourcesPO.setBuildingImgList(taBuildingImgList);
|
178
|
181
|
}
|
179
|
182
|
|
|
@@ -191,19 +194,19 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
191
|
194
|
StringBuffer result = new StringBuffer();
|
192
|
195
|
//校验期
|
193
|
196
|
String termResult = checckedTerm(taHousingResources);
|
194
|
|
- result.append(termResult.equals("notExist") ? "期名" + taHousingResources.getTermName() + "不存在,会直接新建。" : termResult );
|
|
197
|
+ result.append(termResult.equals("notExist") ? "期名" + taHousingResources.getTermName() + "不存在,会直接新建。" : termResult);
|
195
|
198
|
//校验栋
|
196
|
199
|
String blockResult = checkedBlock(taHousingResources);
|
197
|
|
- result.append(blockResult.equals("notExist") ? "楼栋名" + taHousingResources.getBlockName() + "不存在,会直接新建。" : blockResult );
|
|
200
|
+ result.append(blockResult.equals("notExist") ? "楼栋名" + taHousingResources.getBlockName() + "不存在,会直接新建。" : blockResult);
|
198
|
201
|
//校验单元
|
199
|
202
|
String unitResult = checkedUnit(taHousingResources);
|
200
|
|
- result.append(unitResult.equals("notExist") ? "单元名" + taHousingResources.getUnitName() + "不存在,会直接新建。" : unitResult );
|
|
203
|
+ result.append(unitResult.equals("notExist") ? "单元名" + taHousingResources.getUnitName() + "不存在,会直接新建。" : unitResult);
|
201
|
204
|
//校验楼层
|
202
|
205
|
String floorResult = checkedFloor(taHousingResources);
|
203
|
|
- result.append(floorResult.equals("notExist") ? "楼层名" + taHousingResources.getFloorName() + "不存在,会直接新建。" : floorResult );
|
|
206
|
+ result.append(floorResult.equals("notExist") ? "楼层名" + taHousingResources.getFloorName() + "不存在,会直接新建。" : floorResult);
|
204
|
207
|
//校验房号
|
205
|
208
|
String roomResult = checkedRoom(taHousingResources);
|
206
|
|
- result.append(roomResult.equals("notExist") ? "房号" + taHousingResources.getRoomName() + "不存在,会直接新建。" : roomResult );
|
|
209
|
+ result.append(roomResult.equals("notExist") ? "房号" + taHousingResources.getRoomName() + "不存在,会直接新建。" : roomResult);
|
207
|
210
|
return result;
|
208
|
211
|
}
|
209
|
212
|
|
|
@@ -227,35 +230,35 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
227
|
230
|
String roomResult = checkedRoom(taHousingResources);
|
228
|
231
|
|
229
|
232
|
//创建期
|
230
|
|
- if (!roomResult.equals("notExist")){
|
231
|
|
- return ResponseBean.error("房间名" + taHousingResources.getRoomName() + "存在。请修改房间名!",ResponseBean.ERROR_UNAVAILABLE);
|
|
233
|
+ if (!roomResult.equals("notExist")) {
|
|
234
|
+ return ResponseBean.error("房间名" + taHousingResources.getRoomName() + "存在。请修改房间名!", ResponseBean.ERROR_UNAVAILABLE);
|
232
|
235
|
}
|
233
|
236
|
|
234
|
237
|
//期不存在就添加
|
235
|
|
- if (termResult.equals("notExist")){
|
|
238
|
+ if (termResult.equals("notExist")) {
|
236
|
239
|
addTerm(taHousingResources);
|
237
|
240
|
}
|
238
|
241
|
|
239
|
242
|
//楼栋不存在就添加
|
240
|
|
- if (blockResult.equals("notExist")){
|
|
243
|
+ if (blockResult.equals("notExist")) {
|
241
|
244
|
addBlock(taHousingResources);
|
242
|
245
|
}
|
243
|
246
|
|
244
|
247
|
//单元不存在就添加
|
245
|
|
- if (unitResult.equals("notExist")){
|
|
248
|
+ if (unitResult.equals("notExist")) {
|
246
|
249
|
addUnit(taHousingResources);
|
247
|
250
|
}
|
248
|
251
|
|
249
|
252
|
//楼层不存在就添加
|
250
|
|
- if (floorResult.equals("notExist")){
|
|
253
|
+ if (floorResult.equals("notExist")) {
|
251
|
254
|
addFloor(taHousingResources);
|
252
|
255
|
}
|
253
|
256
|
|
254
|
257
|
//房间号不存在就添加
|
255
|
|
- if (roomResult.equals("notExist")){
|
|
258
|
+ if (roomResult.equals("notExist")) {
|
256
|
259
|
addRoom(taHousingResources);
|
257
|
260
|
}
|
258
|
|
-
|
|
261
|
+
|
259
|
262
|
// 获取楼盘名称
|
260
|
263
|
TaBuilding taBuilding = taBuildingMapper.selectById(taHousingResources.getBuildingId());
|
261
|
264
|
taHousingResources.setBuildingName(taBuilding.getBuildingName());
|
|
@@ -314,15 +317,15 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
314
|
317
|
taHousingResources.setFloorId(oldTaHousingResources.getFloorId());
|
315
|
318
|
taHousingResources.setRoomId(oldTaHousingResources.getRoomId());
|
316
|
319
|
//只允许编辑房间名
|
317
|
|
- if (!oldTaHousingResources.getRoomName().equals(taHousingResources.getRoomName())){
|
|
320
|
+ if (!oldTaHousingResources.getRoomName().equals(taHousingResources.getRoomName())) {
|
318
|
321
|
//校验房号
|
319
|
322
|
String roomResult = checkedRoom(taHousingResources);
|
320
|
323
|
|
321
|
324
|
//房间号不存在就更新
|
322
|
|
- if (roomResult.equals("notExist")){
|
|
325
|
+ if (roomResult.equals("notExist")) {
|
323
|
326
|
updateRoom(taHousingResources);
|
324
|
|
- }else{
|
325
|
|
- return ResponseBean.error("房间名" + taHousingResources.getRoomName() + "存在。请修改房间名!",ResponseBean.ERROR_UNAVAILABLE);
|
|
327
|
+ } else {
|
|
328
|
+ return ResponseBean.error("房间名" + taHousingResources.getRoomName() + "存在。请修改房间名!", ResponseBean.ERROR_UNAVAILABLE);
|
326
|
329
|
}
|
327
|
330
|
|
328
|
331
|
}
|
|
@@ -337,10 +340,13 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
337
|
340
|
* 获取表格中的数据
|
338
|
341
|
*
|
339
|
342
|
* @param file
|
|
343
|
+ * @param salesBatchId
|
|
344
|
+ * @param buildingId
|
|
345
|
+ * @param orgId
|
340
|
346
|
* @return
|
341
|
347
|
*/
|
342
|
348
|
@Override
|
343
|
|
- public ResponseBean getExcelData(MultipartFile file) {
|
|
349
|
+ public ResponseBean getExcelData(MultipartFile file, Integer salesBatchId, String buildingId, Integer orgId) {
|
344
|
350
|
ResponseBean responseBean = new ResponseBean();
|
345
|
351
|
List<TaHousingResources> list = new ArrayList<>();
|
346
|
352
|
if (file == null) {
|
|
@@ -380,36 +386,53 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
380
|
386
|
String unitName = row.getCell(2).getStringCellValue().trim();
|
381
|
387
|
String floorName = row.getCell(3).getStringCellValue().trim();
|
382
|
388
|
String roomName = row.getCell(4).getStringCellValue().trim();
|
383
|
|
- String price = row.getCell(5).getStringCellValue().trim();
|
384
|
|
- String heat = row.getCell(6).getStringCellValue().trim();
|
|
389
|
+ BigDecimal price = BigDecimal.valueOf(row.getCell(5).getNumericCellValue());
|
|
390
|
+ Integer heat = Integer.valueOf(String.valueOf(row.getCell(6).getNumericCellValue()).substring(0,1));
|
385
|
391
|
Integer status = row.getCell(7).getStringCellValue().trim().equals("是") ? 1 : 0;
|
386
|
392
|
|
387
|
|
- int currentRow = j+1;
|
388
|
|
- if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(termName)){
|
|
393
|
+ int currentRow = j + 1;
|
|
394
|
+ if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(termName)) {
|
389
|
395
|
responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
|
390
|
396
|
return responseBean;
|
391
|
397
|
}
|
392
|
|
- if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(blockName)){
|
|
398
|
+ if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(blockName)) {
|
393
|
399
|
responseBean.addError("第" + currentRow + "行" + "楼栋不能为空!");
|
394
|
400
|
return responseBean;
|
395
|
401
|
}
|
396
|
|
- if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(unitName)){
|
|
402
|
+ if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(unitName)) {
|
397
|
403
|
responseBean.addError("第" + currentRow + "行" + "单元不能为空!");
|
398
|
404
|
return responseBean;
|
399
|
405
|
}
|
400
|
|
- if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(floorName)){
|
|
406
|
+ if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(floorName)) {
|
401
|
407
|
responseBean.addError("第" + currentRow + "行" + "层不能为空!");
|
402
|
408
|
return responseBean;
|
403
|
409
|
}
|
404
|
|
- if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(roomName)){
|
|
410
|
+ if (com.baomidou.mybatisplus.core.toolkit.StringUtils.isEmpty(roomName)) {
|
405
|
411
|
responseBean.addError("第" + currentRow + "行" + "房号不能为空!");
|
406
|
412
|
return responseBean;
|
407
|
413
|
}
|
408
|
414
|
|
409
|
415
|
String houseInfo = termName + blockName + unitName + floorName + roomName;
|
410
|
|
- if (temHousingList.contains(houseInfo)){
|
411
|
|
- logger.info("存在重复房源:{}",houseInfo);
|
412
|
|
- responseBean.addError("第"+ currentRow +"行存在重复房源");
|
|
416
|
+ if (temHousingList.contains(houseInfo)) {
|
|
417
|
+ logger.info("存在重复房源:{}", houseInfo);
|
|
418
|
+ responseBean.addError("第" + currentRow + "行存在重复房源");
|
|
419
|
+ return responseBean;
|
|
420
|
+ }
|
|
421
|
+
|
|
422
|
+ QueryWrapper<TaHousingResources> taHousingResourcesQueryWrapper = new QueryWrapper<>();
|
|
423
|
+ taHousingResourcesQueryWrapper.eq("sales_batch_id",salesBatchId);
|
|
424
|
+ taHousingResourcesQueryWrapper.eq("building_id",buildingId);
|
|
425
|
+ taHousingResourcesQueryWrapper.eq("org_id",orgId);
|
|
426
|
+ taHousingResourcesQueryWrapper.gt("status",CommConstant.STATUS_DELETE);
|
|
427
|
+ taHousingResourcesQueryWrapper.eq("term_name",termName);
|
|
428
|
+ taHousingResourcesQueryWrapper.eq("block_name",blockName);
|
|
429
|
+ taHousingResourcesQueryWrapper.eq("unit_name",unitName);
|
|
430
|
+ taHousingResourcesQueryWrapper.eq("floor_name",floorName);
|
|
431
|
+ taHousingResourcesQueryWrapper.eq("room_name",roomName);
|
|
432
|
+ TaHousingResources oldTaHouseingResources = taHousingResourcesMapper.selectOne(taHousingResourcesQueryWrapper);
|
|
433
|
+ if (null != oldTaHouseingResources){
|
|
434
|
+ logger.info("数据库存在重复房源:{}",houseInfo);
|
|
435
|
+ responseBean.addError("第"+ currentRow +"行与系统已录入房源"+ oldTaHouseingResources.getHouseId() +"重复");
|
413
|
436
|
return responseBean;
|
414
|
437
|
}
|
415
|
438
|
|
|
@@ -421,18 +444,50 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
421
|
444
|
taHousingResources.setUnitName(unitName);
|
422
|
445
|
taHousingResources.setFloorName(floorName);
|
423
|
446
|
taHousingResources.setRoomName(roomName);
|
|
447
|
+ taHousingResources.setPrice(price);
|
|
448
|
+ taHousingResources.setHeat(heat);
|
|
449
|
+ taHousingResources.setStatus(status);
|
424
|
450
|
list.add(taHousingResources);
|
425
|
451
|
}
|
426
|
452
|
}
|
427
|
453
|
//构建分页
|
428
|
|
- Map<String,Object> data = new HashMap<String, Object>();
|
429
|
|
- data.put("list",list);
|
430
|
|
- 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());
|
431
|
457
|
|
432
|
458
|
responseBean.addSuccess(data);
|
433
|
459
|
return responseBean;
|
434
|
460
|
}
|
435
|
461
|
|
|
462
|
+ /**
|
|
463
|
+ * 保存文件
|
|
464
|
+ *
|
|
465
|
+ * @param file
|
|
466
|
+ * @param salesBatchId
|
|
467
|
+ * @param buildingId
|
|
468
|
+ * @param orgId
|
|
469
|
+ * @return
|
|
470
|
+ */
|
|
471
|
+ @Override
|
|
472
|
+ public ResponseBean saveExcelValue(MultipartFile file, Integer salesBatchId, String buildingId, Integer orgId) {
|
|
473
|
+ ResponseBean responseBean = new ResponseBean();
|
|
474
|
+ responseBean = getExcelData(file, salesBatchId, buildingId, orgId);
|
|
475
|
+ if (responseBean.getCode() != ResponseBean.CODE_SUCCESS){
|
|
476
|
+ return responseBean;
|
|
477
|
+ }
|
|
478
|
+
|
|
479
|
+ //获取校验成功的数据
|
|
480
|
+ Map<String,Object> data = (Map<String,Object>)responseBean.getData();
|
|
481
|
+ List<TaHousingResources> list = (List<TaHousingResources>)data.get("list");
|
|
482
|
+ list.forEach(e -> {
|
|
483
|
+ e.setOrgId(orgId);
|
|
484
|
+ e.setSalesBatchId(salesBatchId);
|
|
485
|
+ e.setBuildingId(buildingId);
|
|
486
|
+ addHouseResources(e);
|
|
487
|
+ });
|
|
488
|
+ return ResponseBean.success(list);
|
|
489
|
+ }
|
|
490
|
+
|
436
|
491
|
//更新房号
|
437
|
492
|
private void updateRoom(TaHousingResources taHousingResources) {
|
438
|
493
|
TaBuildingRoom taBuildingRoom = new TaBuildingRoom();
|
|
@@ -550,15 +605,15 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
550
|
605
|
|
551
|
606
|
//校验房号
|
552
|
607
|
private String checkedRoom(TaHousingResources taHousingResources) {
|
553
|
|
- if (StringUtils.isEmpty(taHousingResources.getRoomName())){
|
|
608
|
+ if (StringUtils.isEmpty(taHousingResources.getRoomName())) {
|
554
|
609
|
return "请输入房号。";
|
555
|
|
- }else{
|
|
610
|
+ } else {
|
556
|
611
|
//查询房号
|
557
|
612
|
TaBuildingRoom taBuildingRoom = selectRoom(taHousingResources);
|
558
|
|
- if (null != taBuildingRoom){
|
|
613
|
+ if (null != taBuildingRoom) {
|
559
|
614
|
taHousingResources.setRoomId(taBuildingRoom.getRoomId());
|
560
|
615
|
return "房间名" + taHousingResources.getRoomName() + "存在。不允许保存,请修改!";
|
561
|
|
- }else{
|
|
616
|
+ } else {
|
562
|
617
|
return "notExist";
|
563
|
618
|
}
|
564
|
619
|
}
|
|
@@ -567,35 +622,35 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
567
|
622
|
//查询房间号
|
568
|
623
|
private TaBuildingRoom selectRoom(TaHousingResources taHousingResources) {
|
569
|
624
|
QueryWrapper<TaBuildingRoom> queryWrapper = new QueryWrapper<>();
|
570
|
|
- queryWrapper.eq("org_id",taHousingResources.getOrgId());
|
571
|
|
- queryWrapper.eq("status",CommConstant.STATUS_NORMAL);
|
572
|
|
- queryWrapper.eq("building_id",taHousingResources.getBuildingId());
|
573
|
|
- queryWrapper.eq("term_id",taHousingResources.getTermId());
|
574
|
|
- queryWrapper.eq("block_id",taHousingResources.getBlockId());
|
575
|
|
- queryWrapper.eq("unit_id",taHousingResources.getUnitId());
|
576
|
|
- queryWrapper.eq("floor_id",taHousingResources.getFloorId());
|
577
|
|
- 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());
|
578
|
633
|
return taBuildingRoomMapper.selectOne(queryWrapper);
|
579
|
634
|
}
|
580
|
635
|
|
581
|
636
|
//校验楼层
|
582
|
637
|
private String checkedFloor(TaHousingResources taHousingResources) {
|
583
|
|
- if (StringUtils.isEmpty(taHousingResources.getFloorName())){
|
|
638
|
+ if (StringUtils.isEmpty(taHousingResources.getFloorName())) {
|
584
|
639
|
return "请输入楼层名。";
|
585
|
|
- }else{
|
|
640
|
+ } else {
|
586
|
641
|
QueryWrapper<TaBuildingFloor> queryWrapper = new QueryWrapper<>();
|
587
|
|
- queryWrapper.eq("org_id",taHousingResources.getOrgId());
|
588
|
|
- queryWrapper.eq("status",CommConstant.STATUS_NORMAL);
|
589
|
|
- queryWrapper.eq("building_id",taHousingResources.getBuildingId());
|
590
|
|
- queryWrapper.eq("term_id",taHousingResources.getTermId());
|
591
|
|
- queryWrapper.eq("block_id",taHousingResources.getBlockId());
|
592
|
|
- queryWrapper.eq("unit_id",taHousingResources.getUnitId());
|
593
|
|
- 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());
|
594
|
649
|
TaBuildingFloor taBuildingFloor = taBuildingFloorMapper.selectOne(queryWrapper);
|
595
|
|
- if (null != taBuildingFloor){
|
|
650
|
+ if (null != taBuildingFloor) {
|
596
|
651
|
taHousingResources.setFloorId(taBuildingFloor.getFloorId());
|
597
|
652
|
return "楼层名" + taHousingResources.getFloorName() + "存在。";
|
598
|
|
- }else{
|
|
653
|
+ } else {
|
599
|
654
|
return "notExist";
|
600
|
655
|
}
|
601
|
656
|
}
|
|
@@ -603,21 +658,21 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
603
|
658
|
|
604
|
659
|
//校验单元
|
605
|
660
|
private String checkedUnit(TaHousingResources taHousingResources) {
|
606
|
|
- if (StringUtils.isEmpty(taHousingResources.getUnitName())){
|
|
661
|
+ if (StringUtils.isEmpty(taHousingResources.getUnitName())) {
|
607
|
662
|
return "请输入单元名。";
|
608
|
|
- }else{
|
|
663
|
+ } else {
|
609
|
664
|
QueryWrapper<TaBuildingUnit> queryWrapper = new QueryWrapper<>();
|
610
|
|
- queryWrapper.eq("org_id",taHousingResources.getOrgId());
|
611
|
|
- queryWrapper.eq("status",CommConstant.STATUS_NORMAL);
|
612
|
|
- queryWrapper.eq("building_id",taHousingResources.getBuildingId());
|
613
|
|
- queryWrapper.eq("term_id",taHousingResources.getTermId());
|
614
|
|
- queryWrapper.eq("block_id",taHousingResources.getBlockId());
|
615
|
|
- 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());
|
616
|
671
|
TaBuildingUnit taBuildingUnit = taBuildingUnitMapper.selectOne(queryWrapper);
|
617
|
|
- if (null != taBuildingUnit){
|
|
672
|
+ if (null != taBuildingUnit) {
|
618
|
673
|
taHousingResources.setUnitId(taBuildingUnit.getUnitId());
|
619
|
674
|
return "单元名" + taHousingResources.getUnitName() + "存在。";
|
620
|
|
- }else{
|
|
675
|
+ } else {
|
621
|
676
|
return "notExist";
|
622
|
677
|
}
|
623
|
678
|
}
|
|
@@ -625,20 +680,20 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
625
|
680
|
|
626
|
681
|
//校验楼盘
|
627
|
682
|
private String checkedBlock(TaHousingResources taHousingResources) {
|
628
|
|
- if (StringUtils.isEmpty(taHousingResources.getBlockName())){
|
|
683
|
+ if (StringUtils.isEmpty(taHousingResources.getBlockName())) {
|
629
|
684
|
return "请输入楼栋名。";
|
630
|
|
- }else{
|
|
685
|
+ } else {
|
631
|
686
|
QueryWrapper<TaBuildingBlock> queryWrapper = new QueryWrapper<>();
|
632
|
|
- queryWrapper.eq("org_id",taHousingResources.getOrgId());
|
633
|
|
- queryWrapper.eq("status",CommConstant.STATUS_NORMAL);
|
634
|
|
- queryWrapper.eq("building_id",taHousingResources.getBuildingId());
|
635
|
|
- queryWrapper.eq("term_id",taHousingResources.getTermId());
|
636
|
|
- 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());
|
637
|
692
|
TaBuildingBlock taBuildingBlock = taBuildingBlockMapper.selectOne(queryWrapper);
|
638
|
|
- if (null != taBuildingBlock){
|
|
693
|
+ if (null != taBuildingBlock) {
|
639
|
694
|
taHousingResources.setBlockId(taBuildingBlock.getBlockId());
|
640
|
695
|
return "楼栋名" + taHousingResources.getBlockName() + "存在。";
|
641
|
|
- }else{
|
|
696
|
+ } else {
|
642
|
697
|
return "notExist";
|
643
|
698
|
}
|
644
|
699
|
}
|
|
@@ -646,19 +701,19 @@ public class TaHousingResourcesServiceImpl extends ServiceImpl<TaHousingResource
|
646
|
701
|
|
647
|
702
|
//校验期
|
648
|
703
|
private String checckedTerm(TaHousingResources taHousingResources) {
|
649
|
|
- if (StringUtils.isEmpty(taHousingResources.getTermName())){
|
|
704
|
+ if (StringUtils.isEmpty(taHousingResources.getTermName())) {
|
650
|
705
|
return "请输入期名。";
|
651
|
|
- }else{
|
|
706
|
+ } else {
|
652
|
707
|
QueryWrapper<TaBuildingTerm> queryWrapper = new QueryWrapper<>();
|
653
|
|
- queryWrapper.eq("org_id",taHousingResources.getOrgId());
|
654
|
|
- queryWrapper.eq("status",CommConstant.STATUS_NORMAL);
|
655
|
|
- queryWrapper.eq("building_id",taHousingResources.getBuildingId());
|
656
|
|
- 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());
|
657
|
712
|
TaBuildingTerm taBuildingTerm = taBuildingTermMapper.selectOne(queryWrapper);
|
658
|
|
- if (null != taBuildingTerm){
|
|
713
|
+ if (null != taBuildingTerm) {
|
659
|
714
|
taHousingResources.setTermId(taBuildingTerm.getTermId());
|
660
|
715
|
return "期名" + taHousingResources.getTermName() + "存在。";
|
661
|
|
- }else{
|
|
716
|
+ } else {
|
662
|
717
|
return "notExist";
|
663
|
718
|
}
|
664
|
719
|
}
|