|
@@ -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;
|
|
@@ -533,18 +534,48 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
|
533
|
534
|
for (int j = 3; j <= lastRowNum; j++) {
|
534
|
535
|
Row row = sheet.getRow(j);
|
535
|
536
|
TpBuildingOwnerInfo tpBuildingOwnerInfo = new TpBuildingOwnerInfo();
|
536
|
|
- String building = row.getCell(0).getStringCellValue();
|
537
|
|
- String unit = row.getCell(1).getStringCellValue();
|
538
|
|
- String level = row.getCell(2).getStringCellValue();
|
539
|
|
- String roomNo = row.getCell(3).getStringCellValue();
|
540
|
|
- String ownerName = row.getCell(4).getStringCellValue();
|
541
|
|
- String ownerTel = row.getCell(5).getStringCellValue();
|
|
537
|
+ String phase = row.getCell(0).getStringCellValue().trim();
|
|
538
|
+ String building = row.getCell(1).getStringCellValue().trim();
|
|
539
|
+ String unit = row.getCell(2).getStringCellValue().trim();
|
|
540
|
+ String level = row.getCell(3).getStringCellValue().trim();
|
|
541
|
+ String roomNo = row.getCell(4).getStringCellValue().trim();
|
|
542
|
+ String ownerName = row.getCell(5).getStringCellValue().trim();
|
|
543
|
+ String ownerTel = row.getCell(6).getStringCellValue().trim();
|
|
544
|
+ int currentRow = j+1;
|
|
545
|
+ if (StringUtils.isEmpty(phase)){
|
|
546
|
+ responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
|
|
547
|
+ return responseBean;
|
|
548
|
+ }
|
|
549
|
+ if (StringUtils.isEmpty(building)){
|
|
550
|
+ responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
|
|
551
|
+ return responseBean;
|
|
552
|
+ }
|
|
553
|
+ if (StringUtils.isEmpty(unit)){
|
|
554
|
+ responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
|
|
555
|
+ return responseBean;
|
|
556
|
+ }
|
|
557
|
+ if (StringUtils.isEmpty(level)){
|
|
558
|
+ responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
|
|
559
|
+ return responseBean;
|
|
560
|
+ }
|
|
561
|
+ if (StringUtils.isEmpty(roomNo)){
|
|
562
|
+ responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
|
|
563
|
+ return responseBean;
|
|
564
|
+ }
|
|
565
|
+ if (StringUtils.isEmpty(ownerName)){
|
|
566
|
+ responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
|
|
567
|
+ return responseBean;
|
|
568
|
+ }
|
|
569
|
+ if (StringUtils.isEmpty(ownerTel)){
|
|
570
|
+ responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
|
|
571
|
+ return responseBean;
|
|
572
|
+ }
|
542
|
573
|
//校验手机号码
|
543
|
574
|
if (!AccountValidatorUtil.isPhone(ownerTel)){
|
544
|
575
|
responseBean.addError("请输入正确手机号:" + ownerTel);
|
545
|
576
|
return responseBean;
|
546
|
577
|
}
|
547
|
|
- String buildingInfo = building + unit + level + roomNo;
|
|
578
|
+ String buildingInfo = phase + building + unit + level + roomNo;
|
548
|
579
|
if (temBuildingList.contains(buildingInfo)){
|
549
|
580
|
logger.info("存在重复房源:{}",buildingInfo);
|
550
|
581
|
responseBean.addError("存在重复房源:"+ buildingInfo);
|
|
@@ -559,6 +590,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
|
559
|
590
|
temBuildingList.add(buildingInfo);
|
560
|
591
|
temTelList.add(ownerTel);
|
561
|
592
|
//构建数据
|
|
593
|
+ tpBuildingOwnerInfo.setPhase(phase);
|
562
|
594
|
tpBuildingOwnerInfo.setBuilding(building);
|
563
|
595
|
tpBuildingOwnerInfo.setUnit(unit);
|
564
|
596
|
tpBuildingOwnerInfo.setLevel(level);
|