|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.enums.SqlMethod;
|
6
|
6
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
7
|
7
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
8
|
8
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
|
9
|
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
9
|
10
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
10
|
11
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
11
|
12
|
import com.community.commom.constant.Constant;
|
|
@@ -509,18 +510,48 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
|
509
|
510
|
for (int j = 3; j <= lastRowNum; j++) {
|
510
|
511
|
Row row = sheet.getRow(j);
|
511
|
512
|
TpBuildingOwnerInfo tpBuildingOwnerInfo = new TpBuildingOwnerInfo();
|
512
|
|
- String building = row.getCell(0).getStringCellValue();
|
513
|
|
- String unit = row.getCell(1).getStringCellValue();
|
514
|
|
- String level = row.getCell(2).getStringCellValue();
|
515
|
|
- String roomNo = row.getCell(3).getStringCellValue();
|
516
|
|
- String ownerName = row.getCell(4).getStringCellValue();
|
517
|
|
- String ownerTel = row.getCell(5).getStringCellValue();
|
|
513
|
+ String phase = row.getCell(0).getStringCellValue().trim();
|
|
514
|
+ String building = row.getCell(1).getStringCellValue().trim();
|
|
515
|
+ String unit = row.getCell(2).getStringCellValue().trim();
|
|
516
|
+ String level = row.getCell(3).getStringCellValue().trim();
|
|
517
|
+ String roomNo = row.getCell(4).getStringCellValue().trim();
|
|
518
|
+ String ownerName = row.getCell(5).getStringCellValue().trim();
|
|
519
|
+ String ownerTel = row.getCell(6).getStringCellValue().trim();
|
|
520
|
+ int currentRow = j+1;
|
|
521
|
+ if (StringUtils.isEmpty(phase)){
|
|
522
|
+ responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
|
|
523
|
+ return responseBean;
|
|
524
|
+ }
|
|
525
|
+ if (StringUtils.isEmpty(building)){
|
|
526
|
+ responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
|
|
527
|
+ return responseBean;
|
|
528
|
+ }
|
|
529
|
+ if (StringUtils.isEmpty(unit)){
|
|
530
|
+ responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
|
|
531
|
+ return responseBean;
|
|
532
|
+ }
|
|
533
|
+ if (StringUtils.isEmpty(level)){
|
|
534
|
+ responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
|
|
535
|
+ return responseBean;
|
|
536
|
+ }
|
|
537
|
+ if (StringUtils.isEmpty(roomNo)){
|
|
538
|
+ responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
|
|
539
|
+ return responseBean;
|
|
540
|
+ }
|
|
541
|
+ if (StringUtils.isEmpty(ownerName)){
|
|
542
|
+ responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
|
|
543
|
+ return responseBean;
|
|
544
|
+ }
|
|
545
|
+ if (StringUtils.isEmpty(ownerTel)){
|
|
546
|
+ responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
|
|
547
|
+ return responseBean;
|
|
548
|
+ }
|
518
|
549
|
//校验手机号码
|
519
|
550
|
if (!AccountValidatorUtil.isPhone(ownerTel)){
|
520
|
551
|
responseBean.addError("请输入正确手机号:" + ownerTel);
|
521
|
552
|
return responseBean;
|
522
|
553
|
}
|
523
|
|
- String buildingInfo = building + unit + level + roomNo;
|
|
554
|
+ String buildingInfo = phase + building + unit + level + roomNo;
|
524
|
555
|
if (temBuildingList.contains(buildingInfo)){
|
525
|
556
|
logger.info("存在重复房源:{}",buildingInfo);
|
526
|
557
|
responseBean.addError("存在重复房源:"+ buildingInfo);
|
|
@@ -535,6 +566,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
|
535
|
566
|
temBuildingList.add(buildingInfo);
|
536
|
567
|
temTelList.add(ownerTel);
|
537
|
568
|
//构建数据
|
|
569
|
+ tpBuildingOwnerInfo.setPhase(phase);
|
538
|
570
|
tpBuildingOwnerInfo.setBuilding(building);
|
539
|
571
|
tpBuildingOwnerInfo.setUnit(unit);
|
540
|
572
|
tpBuildingOwnerInfo.setLevel(level);
|