傅行帆 6 years ago
parent
commit
d16e583008

+ 3
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/ImageServiceimpl.java View File

@@ -6,6 +6,9 @@ import org.springframework.stereotype.Service;
6 6
 import org.springframework.web.multipart.MultipartFile;
7 7
 
8 8
 import java.io.ByteArrayInputStream;
9
+import java.io.File;
10
+import java.io.FileInputStream;
11
+import java.io.FileNotFoundException;
9 12
 import java.io.IOException;
10 13
 import java.util.Date;
11 14
 

+ 23
- 33
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoServiceImpl.java View File

@@ -556,7 +556,6 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
556 556
             return responseBean;
557 557
         } else {
558 558
             List<String> temBuildingList = new ArrayList<String>();
559
-            List<String> temTelList = new ArrayList<String>();
560 559
             //获取一个sheet也就是一个工作簿
561 560
             Sheet sheet = workbook.getSheetAt(0);
562 561
             int lastRowNum = sheet.getLastRowNum();
@@ -564,40 +563,32 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
564 563
             for (int j = 3; j <= lastRowNum; j++) {
565 564
                 Row row = sheet.getRow(j);
566 565
                 TpBuildingOwnerInfo tpBuildingOwnerInfo = new TpBuildingOwnerInfo();
567
-                String phase = row.getCell(0).getStringCellValue().trim();
568
-                String building = row.getCell(1).getStringCellValue().trim();
569
-                String unit = row.getCell(2).getStringCellValue().trim();
570
-                String level = row.getCell(3).getStringCellValue().trim();
571
-                String roomNo = row.getCell(4).getStringCellValue().trim();
572
-                String ownerName = row.getCell(5).getStringCellValue().trim();
573
-                String ownerTel = row.getCell(6).getStringCellValue().trim();
566
+                String buildingInfo = row.getCell(0).getStringCellValue().trim();
567
+                String roomNoId = row.getCell(1).getStringCellValue().trim();
568
+                String ownerName = row.getCell(2).getStringCellValue().trim();
569
+                String ownerTel = row.getCell(3).getStringCellValue().trim();
570
+                String ownerRole = row.getCell(4).getStringCellValue().trim();
574 571
                 int currentRow = j+1;
575
-                if (StringUtils.isEmpty(phase)){
576
-                    responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
572
+                if (StringUtils.isEmpty(buildingInfo)){
573
+                    responseBean.addError("第" + currentRow + "行" + "房产信息不能为空!");
577 574
                     return responseBean;
578 575
                 }
579
-                if (StringUtils.isEmpty(building)){
580
-                    responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
576
+                if (StringUtils.isEmpty(roomNoId)){
577
+                    responseBean.addError("第" + currentRow + "行" + "房产ID不能为空!");
581 578
                     return responseBean;
582 579
                 }
583
-                if (StringUtils.isEmpty(unit)){
584
-                    responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
585
-                    return responseBean;
586
-                }
587
-                if (StringUtils.isEmpty(level)){
588
-                    responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
589
-                    return responseBean;
590
-                }
591
-                if (StringUtils.isEmpty(roomNo)){
592
-                    responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
580
+                //房产ID不为空的情况下检查房产是否存在
581
+                TpBuildingOwnerInfo checkOwnerInfo =tpBuildingOwnerInfoMapper.selectById(roomNoId);
582
+                if (null == checkOwnerInfo){
583
+                    responseBean.addError("第" + currentRow + "行" + "房产ID不存在!");
593 584
                     return responseBean;
594 585
                 }
595 586
                 if (StringUtils.isEmpty(ownerName)){
596
-                    responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
587
+                    responseBean.addError("第" + currentRow + "行" + "姓名不能为空!");
597 588
                     return responseBean;
598 589
                 }
599 590
                 if (StringUtils.isEmpty(ownerTel)){
600
-                    responseBean.addError("第" + currentRow + "行" + "期/区不能为空!");
591
+                    responseBean.addError("第" + currentRow + "行" + "手机号不能为空!");
601 592
                     return responseBean;
602 593
                 }
603 594
                 //校验手机号码
@@ -605,20 +596,19 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
605 596
                     responseBean.addError("第"+ currentRow +"行请输入正确手机号:" + ownerTel);
606 597
                     return responseBean;
607 598
                 }
608
-                String buildingInfo = phase + building + unit + level + roomNo;
609
-                if (temBuildingList.contains(buildingInfo)){
610
-                    logger.info("存在重复房源:{}",buildingInfo);
611
-                    responseBean.addError("第"+ currentRow +"行存在重复房源");
599
+                if (StringUtils.isEmpty(ownerRole)){
600
+                    responseBean.addError("第" + currentRow + "行" + "身份不能为空!");
612 601
                     return responseBean;
613 602
                 }
614
-                if (temTelList.contains(ownerTel)){
615
-                    logger.info("存在重复手机号:{}",ownerTel);
616
-                    responseBean.addError("第"+ currentRow +"行存在重复手机号");
603
+    
604
+                if (temBuildingList.contains(roomNoId)){
605
+                    logger.info("存在重复房源:{}",roomNoId);
606
+                    responseBean.addError("第"+ currentRow +"行存在重复房源");
617 607
                     return responseBean;
618 608
                 }
609
+                
619 610
                 //把数据塞入temList校验是否有重复的数据
620
-                temBuildingList.add(buildingInfo);
621
-                temTelList.add(ownerTel);
611
+                temBuildingList.add(roomNoId);
622 612
                 //构建数据
623 613
                 tpBuildingOwnerInfo.setPhaseName(phase);
624 614
                 tpBuildingOwnerInfo.setBuildingName(building);

+ 1
- 1
VUECODE/smart-property-manage/src/views/building/buildingdata/BuildingBatchImport.vue View File

@@ -4,7 +4,7 @@
4 4
     <el-form :inline="true" :model="listQuery" class="form-listQuery">
5 5
       <el-form-item>
6 6
         <el-upload :on-preview="handlePreview" :on-change="handleChange" :before-upload="beforeUpload" :limit="1" :on-exceed="handleExceed" class="upload-demo" action="" multiple>
7
-          <a href="http://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/%E6%A5%BC%E6%A0%8B%E5%BA%93%E6%A8%A1%E6%9D%BF.xlsx?Expires=1548327771"><el-button style="margin-left: 10px;" size="large" type="primary">下载模板</el-button></a>
7
+          <a href="http://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/%E6%A5%BC%E6%A0%8B%E5%BA%93%E6%A8%A1%E6%9D%BF.xlsx?Expires=1556098137"><el-button style="margin-left: 10px;" size="large" type="primary">下载模板</el-button></a>
8 8
           <el-button slot="trigger" size="large" type="primary">选取文件并预览</el-button>
9 9
           <el-button style="margin-left: 10px;" size="large" type="success" @click="submitUpload">提交</el-button>
10 10
           <el-button style="margin-left: 10px;" size="large" type="success" @click="dialogBuildingIndex">取消</el-button>

+ 441
- 381
文档/MYSQL/smartCommunity.pdb
File diff suppressed because it is too large
View File


+ 441
- 381
文档/MYSQL/smartCommunity.pdm
File diff suppressed because it is too large
View File