魏熙美 6 years ago
parent
commit
e571e7d0f5

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

878
         // 根据 审核id 查询 出审核的数据,里面有角色id
878
         // 根据 审核id 查询 出审核的数据,里面有角色id
879
         TaUserVerify userVerify = taUserVerifyMapper.selectByPrimaryKey(user.getUserVerifyId());
879
         TaUserVerify userVerify = taUserVerifyMapper.selectByPrimaryKey(user.getUserVerifyId());
880
 
880
 
881
+        userVO.setPhaseId(userVerify.getPhaseId());
882
+        userVO.setBuildingId(userVerify.getBuildingId());
883
+        userVO.setUnitId(userVerify.getUnitId());
884
+        userVO.setLevelId(userVerify.getLevelId());
885
+        userVO.setRoomNoId(userVerify.getRoomNoId());
886
+
881
         // 房产状态
887
         // 房产状态
882
         userVO.setVerifyStatus(userVerify.getVerifyStatus());
888
         userVO.setVerifyStatus(userVerify.getVerifyStatus());
883
 
889
 
913
             }
919
             }
914
         }
920
         }
915
 
921
 
922
+
916
         return userVO;
923
         return userVO;
917
     }
924
     }
918
 
925
 

+ 21
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TpRoomNoMapper.java View File

1
 package com.community.huiju.dao;
1
 package com.community.huiju.dao;
2
 
2
 
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
4
 import com.community.huiju.model.TpRoomNo;
5
 import com.community.huiju.model.TpRoomNo;
5
 import org.apache.ibatis.annotations.Mapper;
6
 import org.apache.ibatis.annotations.Mapper;
6
 import org.apache.ibatis.annotations.Param;
7
 import org.apache.ibatis.annotations.Param;
7
 import org.apache.ibatis.annotations.ResultType;
8
 import org.apache.ibatis.annotations.ResultType;
8
 import org.apache.ibatis.annotations.Select;
9
 import org.apache.ibatis.annotations.Select;
9
 
10
 
11
+import java.util.List;
12
+
10
 /**
13
 /**
11
  * <p>
14
  * <p>
12
  * 户号信息表 Mapper 接口
15
  * 户号信息表 Mapper 接口
39
             "and name = #{roomNoName}")
42
             "and name = #{roomNoName}")
40
     TpRoomNo selectCommunityIdAndAddressName(@Param("communityId") Integer communityId, @Param("phaseName") String phaseName, @Param("buildingName") String buildingName, @Param("unitName") String unitName, @Param("levelName") String levelName, @Param("roomNoName") String roomNoName);
43
     TpRoomNo selectCommunityIdAndAddressName(@Param("communityId") Integer communityId, @Param("phaseName") String phaseName, @Param("buildingName") String buildingName, @Param("unitName") String unitName, @Param("levelName") String levelName, @Param("roomNoName") String roomNoName);
41
 
44
 
45
+    /**
46
+     * 查询数据,分页
47
+     * @param pageNum
48
+     * @param pageSize
49
+     * @return
50
+     */
51
+    @ResultType(TpRoomNo.class)
52
+    @Select("select * from tp_room_no where community_id = #{communityId} limit #{pageNum},#{pageSize}")
53
+    List<TpRoomNo> selectCommunityIdList(@Param("communityId") Integer communityId, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
54
+
55
+    /**
56
+     * 查询数据,分页
57
+     * @param communityId
58
+     * @return
59
+     */
60
+    @ResultType(Long.class)
61
+    @Select("select count(1) from tp_room_no where community_id = #{communityId}")
62
+    Long selectCommunityIdCount(@Param("communityId") Integer communityId);
42
 
63
 
43
 }
64
 }

+ 29
- 64
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BillServiceImpl.java View File

337
                 billInvoice.setCommunityId(userElement.getCommunityId());
337
                 billInvoice.setCommunityId(userElement.getCommunityId());
338
                 billInvoice.setBillId(bill.getId());
338
                 billInvoice.setBillId(bill.getId());
339
 
339
 
340
-                // 根据 小区,期,栋,单元,楼层,房号 -》 查询房号id
341
-                // 因为和房间关联
342
-
343
-                /**
344
-                 * 需要知道这个房产的业主
345
-                 */
346
-                TaUserVerify userVerify = taUserVerifyMapper.selectCommunityAndAddressName(userElement.getCommunityId(), e.getPhase(), e.getBuilding(), e.getUnit(), e.getLevel(), e.getRoomNo());
347
-
348
-                TaUser ownerUser = null;
349
-                TpBuildingOwnerInfo buildingOwnerInfo = null;
350
-                if (null != userVerify) {
351
-                    // 业主个人信息
352
-                    ownerUser = taUserMapper.selectById(userVerify.getUserId());
353
-
354
-                    // 楼栋资料库
355
-                    buildingOwnerInfo = tpBuildingOwnerInfoMapper.selectCommunityIdAndAddress(userElement.getCommunityId(),
356
-                                                userVerify.getPhaseId(), userVerify.getBuildingId(), userVerify.getUnitId(),
357
-                                                userVerify.getLevelId(), userVerify.getRoomNoId(), ownerUser.getLoginName());
358
-                    if (null == buildingOwnerInfo) {
359
-                        throw new WisdomException("手机号为:" + ownerUser.getLoginName() + " 楼栋业主资料不存在!");
360
-                    }
361
-                    billInvoice.setBuildingOwnerInfoId(buildingOwnerInfo.getId());
362
-
363
-                }
364
-
365
                 /**
340
                 /**
366
                  * 查询房号
341
                  * 查询房号
367
                  */
342
                  */
369
                 if (null == tpRoomNo) {
344
                 if (null == tpRoomNo) {
370
                     throw new WisdomException("房产:" + e.getPhase() + e.getBuilding() + e.getUnit() + e.getLevel() + e.getRoomNo() + " 不存在!请核对!");
345
                     throw new WisdomException("房产:" + e.getPhase() + e.getBuilding() + e.getUnit() + e.getLevel() + e.getRoomNo() + " 不存在!请核对!");
371
                 }
346
                 }
372
-                if (null != ownerUser) {
373
-                    billInvoice.setTaUserId(ownerUser.getId());
374
-                }
375
                 billInvoice.setRoomNoId(tpRoomNo.getId());
347
                 billInvoice.setRoomNoId(tpRoomNo.getId());
376
                 billInvoice.setBillInvoiceExplain(e.getBillExplain());
348
                 billInvoice.setBillInvoiceExplain(e.getBillExplain());
377
                 billInvoice.setPayPrice(e.getPayPrice());
349
                 billInvoice.setPayPrice(e.getPayPrice());
448
         int lastRowNum = sheetAt.getLastRowNum();
420
         int lastRowNum = sheetAt.getLastRowNum();
449
 
421
 
450
         // 从第7行开始读取
422
         // 从第7行开始读取
451
-        for (int i= 6; i<= lastRowNum; i++) {
423
+        for (int i= 6; i< lastRowNum; i++) {
424
+            int currentRow = i + 1;
452
             Row row = sheetAt.getRow(i);
425
             Row row = sheetAt.getRow(i);
453
             Cell cell = getCell(row.getCell(0));
426
             Cell cell = getCell(row.getCell(0));
454
             if (null == cell) {
427
             if (null == cell) {
455
-                throw new WisdomException("第" + i+1 + "行 期/区 不能为空");
428
+                throw new WisdomException("第" + currentRow + "行 期/区 不能为空");
456
             }
429
             }
457
             String phase = cell.getStringCellValue().trim();
430
             String phase = cell.getStringCellValue().trim();
458
             cell = getCell(row.getCell(1));
431
             cell = getCell(row.getCell(1));
459
             if (null == cell) {
432
             if (null == cell) {
460
-                throw new WisdomException("第" + i+1 + "行 楼栋 不能为空");
433
+                throw new WisdomException("第" + currentRow + "行 楼栋 不能为空");
461
             }
434
             }
462
             String building = cell.getStringCellValue().trim();
435
             String building = cell.getStringCellValue().trim();
463
             cell = getCell(row.getCell(2));
436
             cell = getCell(row.getCell(2));
464
             if (null == cell) {
437
             if (null == cell) {
465
-                throw new WisdomException("第" + i+1 + "行 单元 不能为空");
438
+                throw new WisdomException("第" + currentRow + "行 单元 不能为空");
466
             }
439
             }
467
             String unit = cell.getStringCellValue().trim();
440
             String unit = cell.getStringCellValue().trim();
468
             cell = getCell(row.getCell(3));
441
             cell = getCell(row.getCell(3));
469
             if (null == cell) {
442
             if (null == cell) {
470
-                throw new WisdomException("第" + i+1 + "行 楼层 不能为空");
443
+                throw new WisdomException("第" + currentRow + "行 楼层 不能为空");
471
             }
444
             }
472
             String level = cell.getStringCellValue().trim();
445
             String level = cell.getStringCellValue().trim();
473
             cell = getCell(row.getCell(4));
446
             cell = getCell(row.getCell(4));
474
             if (null == cell) {
447
             if (null == cell) {
475
-                throw new WisdomException("第" + i+1 + "行 房号 不能为空");
448
+                throw new WisdomException("第" + currentRow + "行 房号 不能为空");
476
             }
449
             }
477
             String roomNo = cell.getStringCellValue().trim();
450
             String roomNo = cell.getStringCellValue().trim();
478
-            cell = getCell(row.getCell(5));
479
-            if (null == cell) {
480
-                throw new WisdomException("第" + i+1 + "行 业主姓名 不能为空");
481
-            }
482
-            String ownerName = cell.getStringCellValue().trim();
451
+
483
 
452
 
484
             // 收费说明可以为空
453
             // 收费说明可以为空
485
-            cell = getCell(row.getCell(6));
454
+            cell = getCell(row.getCell(5));
486
             String billExplain = null;
455
             String billExplain = null;
487
             if (null != cell) {
456
             if (null != cell) {
488
                 billExplain = cell.getStringCellValue().trim();
457
                 billExplain = cell.getStringCellValue().trim();
489
                 if (billExplain.length() > 100) {
458
                 if (billExplain.length() > 100) {
490
-                    throw new WisdomException("第" + i+1 + "行 收费说明超出100字,请精简到100字以内");
459
+                    throw new WisdomException("第" + currentRow + "行 收费说明超出100字,请精简到100字以内");
491
                 }
460
                 }
492
             }
461
             }
493
 
462
 
494
-            cell = getCell(row.getCell(7));
463
+            cell = getCell(row.getCell(6));
495
             if (null == cell) {
464
             if (null == cell) {
496
-                throw new WisdomException("第" + i+1 + "行 金额 不能为空");
465
+                throw new WisdomException("第" + currentRow + "行 金额 不能为空");
497
             }
466
             }
498
             String money = cell.getStringCellValue().trim();
467
             String money = cell.getStringCellValue().trim();
499
 
468
 
504
             temp.setLevel(level);
473
             temp.setLevel(level);
505
             temp.setUnit(unit);
474
             temp.setUnit(unit);
506
             temp.setRoomNo(roomNo);
475
             temp.setRoomNo(roomNo);
507
-            temp.setOwnerName(ownerName);
476
+            // temp.setOwnerName(ownerName);
508
             temp.setBillExplain(billExplain);
477
             temp.setBillExplain(billExplain);
509
 
478
 
510
 
479
 
636
         // 创建列
605
         // 创建列
637
         HSSFCell cell = null;
606
         HSSFCell cell = null;
638
 
607
 
639
-        Integer pageNum = 1;
608
+        Integer pageNum = 0;
640
         Integer pageSize = 10;
609
         Integer pageSize = 10;
641
-        Page<TpBuildingOwnerInfo> page = new Page(pageNum,pageSize);
642
         // 分页查询
610
         // 分页查询
643
-        QueryWrapper<TpBuildingOwnerInfo> buildingOwnerInfoQueryWrapper = new QueryWrapper<>();
644
-        buildingOwnerInfoQueryWrapper.eq("community_id", userElement.getCommunityId());
645
-        buildingOwnerInfoQueryWrapper.groupBy("phase_id", "building_id", "unit_id", "level_id", "room_no_id");
646
-        IPage<TpBuildingOwnerInfo> infoIPage = tpBuildingOwnerInfoMapper.selectPage(page, buildingOwnerInfoQueryWrapper);
647
-        List<TpBuildingOwnerInfo> records = infoIPage.getRecords();
611
+
612
+        List<TpRoomNo> records = tpRoomNoMapper.selectCommunityIdList(userElement.getCommunityId(), pageNum * pageSize, pageSize);
648
         // 总页数
613
         // 总页数
649
-        Long pages = infoIPage.getPages();
614
+        Long pages = tpRoomNoMapper.selectCommunityIdCount(userElement.getCommunityId());
650
 
615
 
651
 
616
 
652
         // 行数 默认从 第 6 行开始
617
         // 行数 默认从 第 6 行开始
656
 
621
 
657
         if (records.size() > 0) {
622
         if (records.size() > 0) {
658
             do {
623
             do {
659
-                TpBuildingOwnerInfo buildingOwnerInfo = records.get(index);
624
+                TpRoomNo tpRoomNo = records.get(index);
660
                 row = sheet.createRow(currentRow);
625
                 row = sheet.createRow(currentRow);
661
                 cell = row.createCell(0);
626
                 cell = row.createCell(0);
662
-                cell.setCellValue(buildingOwnerInfo.getPhaseName());
627
+                cell.setCellValue(tpRoomNo.getPhaseName());
663
                 cell = row.createCell(1);
628
                 cell = row.createCell(1);
664
-                cell.setCellValue(buildingOwnerInfo.getBuildingName());
629
+                cell.setCellValue(tpRoomNo.getBuildingName());
665
                 cell = row.createCell(2);
630
                 cell = row.createCell(2);
666
-                cell.setCellValue(buildingOwnerInfo.getUnitName());
631
+                cell.setCellValue(tpRoomNo.getUnitName());
667
                 cell = row.createCell(3);
632
                 cell = row.createCell(3);
668
-                cell.setCellValue(buildingOwnerInfo.getLevelName());
633
+                cell.setCellValue(tpRoomNo.getLevelName());
669
                 cell = row.createCell(4);
634
                 cell = row.createCell(4);
670
-                cell.setCellValue(buildingOwnerInfo.getRoomNoName());
671
-                cell = row.createCell(5);
672
-                cell.setCellValue(buildingOwnerInfo.getOwnerName() + "");
635
+                cell.setCellValue(tpRoomNo.getName());
673
                 currentRow ++;
636
                 currentRow ++;
674
                 index ++;
637
                 index ++;
675
                 if (index == records.size()) {
638
                 if (index == records.size()) {
676
                     index = 0;
639
                     index = 0;
677
-                    page = new Page(infoIPage.getCurrent() + 1,pageSize);
678
-                    infoIPage = tpBuildingOwnerInfoMapper.selectPage(page, buildingOwnerInfoQueryWrapper);
679
-                    records = infoIPage.getRecords();
640
+                    pageNum ++;
641
+                    records = tpRoomNoMapper.selectCommunityIdList(userElement.getCommunityId(), pageNum * pageSize, pageSize);
642
+                }
643
+                if (records.isEmpty()) {
644
+                    break;
680
                 }
645
                 }
681
-            } while (infoIPage.getCurrent() <= pages);
646
+            } while (pageNum <= pages);
682
         }
647
         }
683
 
648
 
684
         responseBean.addSuccess(workbook);
649
         responseBean.addSuccess(workbook);

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

1
 package com.community.huiju.service.impl;
1
 package com.community.huiju.service.impl;
2
 
2
 
3
-import com.alibaba.fastjson.JSON;
4
 import com.alibaba.fastjson.JSONObject;
3
 import com.alibaba.fastjson.JSONObject;
5
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
6
 import com.baomidou.mybatisplus.core.metadata.IPage;
5
 import com.baomidou.mybatisplus.core.metadata.IPage;
11
 import com.community.commom.mode.ResponseBean;
10
 import com.community.commom.mode.ResponseBean;
12
 import com.community.commom.session.UserElement;
11
 import com.community.commom.session.UserElement;
13
 import com.community.commom.utils.AccountValidatorUtil;
12
 import com.community.commom.utils.AccountValidatorUtil;
14
-import com.community.commom.utils.BeanTools;
15
 
13
 
16
 import com.community.huiju.common.base.messagePush;
14
 import com.community.huiju.common.base.messagePush;
17
 import com.community.huiju.common.code.ICode;
15
 import com.community.huiju.common.code.ICode;
22
 
20
 
23
 import com.community.huiju.service.IBillInvoiceService;
21
 import com.community.huiju.service.IBillInvoiceService;
24
 import com.community.huiju.service.IBuildingOwnerInfoService;
22
 import com.community.huiju.service.IBuildingOwnerInfoService;
25
-import com.community.huiju.service.ITaUserService;
26
 import com.google.common.collect.Maps;
23
 import com.google.common.collect.Maps;
27
-import org.apache.commons.collections.CollectionUtils;
28
 
24
 
29
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
25
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
30
 import org.apache.poi.ss.usermodel.*;
26
 import org.apache.poi.ss.usermodel.*;
43
 import java.io.InputStream;
39
 import java.io.InputStream;
44
 import java.time.LocalDateTime;
40
 import java.time.LocalDateTime;
45
 import java.util.*;
41
 import java.util.*;
46
-import java.util.regex.Pattern;
47
-import java.util.stream.Collectors;
42
+import java.util.concurrent.atomic.AtomicInteger;
48
 
43
 
49
 
44
 
50
 /**
45
 /**
231
             return responseBean;
226
             return responseBean;
232
         }
227
         }
233
 
228
 
234
-        // 插入楼栋资料库
235
-        tpBuildingOwnerInfo = insertTpBuildingOwnerInfo(tpBuildingOwnerInfo.getPhaseId(), tpBuildingOwnerInfo.getBuildingId(), tpBuildingOwnerInfo.getUnitId(),
236
-                tpBuildingOwnerInfo.getLevelId(), tpBuildingOwnerInfo.getRoomNoId(), userElement.getCommunityId(), userElement.getId(),
237
-                tpBuildingOwnerInfo.getGender(), tpBuildingOwnerInfo.getOwnerName(), tpBuildingOwnerInfo.getOwnerTel());
229
+        TaUser appUser = getByLoginName(tpBuildingOwnerInfo.getOwnerTel());
238
 
230
 
239
         // 开始匹配 APP 端用户表
231
         // 开始匹配 APP 端用户表
240
-        // 查询 APP 端
241
-        TaUser appUser = getByLoginName(tpBuildingOwnerInfo.getOwnerTel());
242
         if (null == appUser) {
232
         if (null == appUser) {
243
             // 如果 APP端 没有这个用户,则自动注册一个
233
             // 如果 APP端 没有这个用户,则自动注册一个
244
             TaUser taUser = new TaUser();
234
             TaUser taUser = new TaUser();
255
             taUserMapper.updateById(taUser);
245
             taUserMapper.updateById(taUser);
256
             appUser = taUser;
246
             appUser = taUser;
257
         }
247
         }
248
+
249
+        // 设置 用户性别 和 用户姓名
250
+        tpBuildingOwnerInfo.setGender(appUser.getGender());
251
+        tpBuildingOwnerInfo.setOwnerName(appUser.getUserName());
252
+
253
+        // 插入楼栋资料库
254
+        tpBuildingOwnerInfo = insertTpBuildingOwnerInfo(tpBuildingOwnerInfo.getPhaseId(), tpBuildingOwnerInfo.getBuildingId(), tpBuildingOwnerInfo.getUnitId(),
255
+                tpBuildingOwnerInfo.getLevelId(), tpBuildingOwnerInfo.getRoomNoId(), userElement.getCommunityId(), userElement.getId(),
256
+                tpBuildingOwnerInfo.getGender(), tpBuildingOwnerInfo.getOwnerName(), tpBuildingOwnerInfo.getOwnerTel());
257
+
258
         // 更新 APP 端用户姓名
258
         // 更新 APP 端用户姓名
259
         appUser.setUserName(tpBuildingOwnerInfo.getOwnerName());
259
         appUser.setUserName(tpBuildingOwnerInfo.getOwnerName());
260
         appUser.setCreateDate(LocalDateTime.now());
260
         appUser.setCreateDate(LocalDateTime.now());
311
         String[] messageArr= new messagePush().messagePushAll( );
311
         String[] messageArr= new messagePush().messagePushAll( );
312
         for (String count : messageArr) {
312
         for (String count : messageArr) {
313
             Message message = new Message();
313
             Message message = new Message();
314
-            message.setCommunityId(userVerify.getCommunityId());
314
+            message.setCommunityId(taUserVerify.getCommunityId());
315
             message.setMessageType("9");
315
             message.setMessageType("9");
316
             message.setAdviceType("1");
316
             message.setAdviceType("1");
317
             message.setModelType("1");
317
             message.setModelType("1");
452
         List<TpBuildingOwnerInfo> list = (List<TpBuildingOwnerInfo>) map.get("list");
452
         List<TpBuildingOwnerInfo> list = (List<TpBuildingOwnerInfo>) map.get("list");
453
         
453
         
454
         //批量插入
454
         //批量插入
455
-        tpBuildingOwnerInfoMapper.batchInsert(list);
455
+        // tpBuildingOwnerInfoMapper.batchInsert(list);
456
         
456
         
457
         //构造数据
457
         //构造数据
458
         for (TpBuildingOwnerInfo tpBuildingOwnerInfo : list){
458
         for (TpBuildingOwnerInfo tpBuildingOwnerInfo : list){
459
             //根据手机号查询这个手机号是否注册
459
             //根据手机号查询这个手机号是否注册
460
-            TaUser taUser = taUserMapper.selectByTel(tpBuildingOwnerInfo.getOwnerTel());
460
+            QueryWrapper<TaUser> queryWrapper = new QueryWrapper<>();
461
+            queryWrapper.eq("login_name", tpBuildingOwnerInfo.getOwnerTel());
462
+            TaUser taUser = taUserMapper.selectOne(queryWrapper);
461
             if (null == taUser){
463
             if (null == taUser){
462
                 //插入新用户并审核通过
464
                 //插入新用户并审核通过
463
                 addNewUser(tpBuildingOwnerInfo,userElement);
465
                 addNewUser(tpBuildingOwnerInfo,userElement);
471
     }
473
     }
472
     
474
     
473
     private void checkUserVerify(TaUser taUser, TpBuildingOwnerInfo tpBuildingOwnerInfo, UserElement userElement) {
475
     private void checkUserVerify(TaUser taUser, TpBuildingOwnerInfo tpBuildingOwnerInfo, UserElement userElement) {
476
+
474
         //有用户的情况下查看是否有申请的房产
477
         //有用户的情况下查看是否有申请的房产
475
         QueryWrapper<TaUserVerify> queryWrapper = new QueryWrapper<>();
478
         QueryWrapper<TaUserVerify> queryWrapper = new QueryWrapper<>();
476
         queryWrapper.eq("community_id",userElement.getCommunityId());
479
         queryWrapper.eq("community_id",userElement.getCommunityId());
477
         queryWrapper.eq("user_id",taUser.getId());
480
         queryWrapper.eq("user_id",taUser.getId());
478
         List<TaUserVerify> verifyList = taUserVerifyMapper.selectList(queryWrapper);
481
         List<TaUserVerify> verifyList = taUserVerifyMapper.selectList(queryWrapper);
482
+        AtomicInteger rows = new AtomicInteger();
479
         if (verifyList.size() > 0){
483
         if (verifyList.size() > 0){
480
             verifyList.stream().forEach(e -> {
484
             verifyList.stream().forEach(e -> {
481
-                if (e.getRoomNoId().equals(tpBuildingOwnerInfo.getId()) && e.getVerifyStatus().equals("0")){
485
+                if (e.getVerifyStatus().equals("0") &&
486
+                    e.getPhaseId().intValue() == tpBuildingOwnerInfo.getPhaseId().intValue()
487
+                        && e.getBuildingId().intValue() == tpBuildingOwnerInfo.getBuildingId().intValue()
488
+                        && e.getUnitId().intValue() == tpBuildingOwnerInfo.getUnitId().intValue()
489
+                        && e.getLevelId().intValue() == tpBuildingOwnerInfo.getLevelId().intValue()
490
+                        && e.getRoomNoId().intValue() == tpBuildingOwnerInfo.getRoomNoId().intValue() ){
491
+
482
                     e.setVerifyStatus("1");
492
                     e.setVerifyStatus("1");
483
                     e.setVerifyName(userElement.getUserName());
493
                     e.setVerifyName(userElement.getUserName());
484
-                    taUserVerifyMapper.updateById(e);
494
+                    rows.set(taUserVerifyMapper.updateById(e));
485
                 }
495
                 }
486
             });
496
             });
487
-            return;
497
+            if (rows.get() > 0) {
498
+                return;
499
+            }
500
+
488
         }
501
         }
489
         //插入一条房产数据
502
         //插入一条房产数据
490
         saveVerifyData(taUser.getId(),tpBuildingOwnerInfo,userElement);
503
         saveVerifyData(taUser.getId(),tpBuildingOwnerInfo,userElement);
520
         }else if (tpBuildingOwnerInfo.getRoleName().equals("租客")){
533
         }else if (tpBuildingOwnerInfo.getRoleName().equals("租客")){
521
             taUserVerify.setRoleId(2);
534
             taUserVerify.setRoleId(2);
522
         }
535
         }
536
+
537
+        // TODO 是否只允许一个房产中只有一个角色?还是说多个角色?排除业主角色
538
+        TaUserVerify boolUserVerify = taUserVerifyMapper.selectCommunityAndAddressAndRoleId(userId, userElement.getCommunityId(), tpBuildingOwnerInfo.getPhaseId(),
539
+                tpBuildingOwnerInfo.getBuildingId(), tpBuildingOwnerInfo.getUnitId(),
540
+                tpBuildingOwnerInfo.getLevelId(), tpBuildingOwnerInfo.getRoomNoId(), taUserVerify.getRoleId());
541
+        // 表示这个用户在这个房产中已经有了这个角色, 就不进行插入
542
+        if (null != boolUserVerify) {
543
+            return;
544
+        }
545
+
523
         taUserVerify.setPhaseId(tpBuildingOwnerInfo.getPhaseId());
546
         taUserVerify.setPhaseId(tpBuildingOwnerInfo.getPhaseId());
524
         taUserVerify.setPhaseName(tpBuildingOwnerInfo.getPhaseName());
547
         taUserVerify.setPhaseName(tpBuildingOwnerInfo.getPhaseName());
525
         taUserVerify.setBuildingId(tpBuildingOwnerInfo.getBuildingId());
548
         taUserVerify.setBuildingId(tpBuildingOwnerInfo.getBuildingId());
528
         taUserVerify.setUnitName(tpBuildingOwnerInfo.getUnitName());
551
         taUserVerify.setUnitName(tpBuildingOwnerInfo.getUnitName());
529
         taUserVerify.setLevelId(tpBuildingOwnerInfo.getLevelId());
552
         taUserVerify.setLevelId(tpBuildingOwnerInfo.getLevelId());
530
         taUserVerify.setLevelName(tpBuildingOwnerInfo.getLevelName());
553
         taUserVerify.setLevelName(tpBuildingOwnerInfo.getLevelName());
531
-        taUserVerify.setRoomNoId(tpBuildingOwnerInfo.getId());
554
+        taUserVerify.setRoomNoId(tpBuildingOwnerInfo.getRoomNoId());
532
         taUserVerify.setRoomNoName(tpBuildingOwnerInfo.getRoomNoName());
555
         taUserVerify.setRoomNoName(tpBuildingOwnerInfo.getRoomNoName());
533
         taUserVerify.setVerifyStatus("1");
556
         taUserVerify.setVerifyStatus("1");
534
         taUserVerify.setCreateDate(LocalDateTime.now());
557
         taUserVerify.setCreateDate(LocalDateTime.now());
535
         taUserVerify.setVerifyName(userElement.getUserName());
558
         taUserVerify.setVerifyName(userElement.getUserName());
536
         taUserVerifyMapper.insert(taUserVerify);
559
         taUserVerifyMapper.insert(taUserVerify);
560
+
561
+        TaUser taUser = taUserMapper.selectById(userId);
562
+
563
+
564
+        // 通过后,需要往楼栋资料库写入数据
565
+        tpBuildingOwnerInfo.setCommunityId(userElement.getCommunityId());
566
+        tpBuildingOwnerInfo.setIdCard(taUser.getIdCard());
567
+        tpBuildingOwnerInfo.setGender(taUser.getGender());
568
+        tpBuildingOwnerInfo.setPairStatus("1");
569
+        tpBuildingOwnerInfo.setVerifyStatus("1");
570
+        tpBuildingOwnerInfo.setCreateDate(LocalDateTime.now());
571
+        tpBuildingOwnerInfo.setCreateUser(userElement.getId());
572
+        tpBuildingOwnerInfo.setTaUserVerifyId(taUserVerify.getId());
573
+
574
+        tpBuildingOwnerInfoMapper.insert(tpBuildingOwnerInfo);
537
     }
575
     }
538
     
576
     
539
     @Override
577
     @Override
634
                     return responseBean;
672
                     return responseBean;
635
                 }
673
                 }
636
                 //房产ID不为空的情况下检查房产是否存在
674
                 //房产ID不为空的情况下检查房产是否存在
637
-                TpBuildingOwnerInfo checkOwnerInfo =tpBuildingOwnerInfoMapper.selectById(roomNoId);
638
-                if (null == checkOwnerInfo){
675
+                TpRoomNo tpRoomNo = tpRoomNoMapper.selectById(roomNoId);
676
+                if (null == tpRoomNo){
639
                     responseBean.addError("第" + currentRow + "行" + "房产ID不存在!");
677
                     responseBean.addError("第" + currentRow + "行" + "房产ID不存在!");
640
                     return responseBean;
678
                     return responseBean;
641
                 }
679
                 }
657
                     return responseBean;
695
                     return responseBean;
658
                 }
696
                 }
659
     
697
     
660
-                if (temBuildingList.contains(roomNoId)){
661
-                    logger.info("存在重复房源:{}",roomNoId);
662
-                    responseBean.addError("第"+ currentRow +"行存在重复房源");
663
-                    return responseBean;
664
-                }
698
+//                if (temBuildingList.contains(roomNoId)){
699
+//                    logger.info("存在重复房源:{}",roomNoId);
700
+//                    responseBean.addError("第"+ currentRow +"行存在重复房源");
701
+//                    return responseBean;
702
+//                }
665
                 
703
                 
666
                 //把数据塞入temList校验是否有重复的数据
704
                 //把数据塞入temList校验是否有重复的数据
667
                 temBuildingList.add(roomNoId);
705
                 temBuildingList.add(roomNoId);
668
                 //构建数据
706
                 //构建数据
707
+                TpBuildingOwnerInfo checkOwnerInfo = new TpBuildingOwnerInfo();
708
+                checkOwnerInfo.setId(null);
669
                 checkOwnerInfo.setRoleName(ownerRole);
709
                 checkOwnerInfo.setRoleName(ownerRole);
670
                 checkOwnerInfo.setOwnerName(ownerName);
710
                 checkOwnerInfo.setOwnerName(ownerName);
671
                 checkOwnerInfo.setOwnerTel(ownerTel);
711
                 checkOwnerInfo.setOwnerTel(ownerTel);
712
+                checkOwnerInfo.setPhaseId(tpRoomNo.getPhaseId());
713
+                checkOwnerInfo.setPhaseName(tpRoomNo.getPhaseName());
714
+                checkOwnerInfo.setBuildingId(tpRoomNo.getBuildingId());
715
+                checkOwnerInfo.setBuildingName(tpRoomNo.getBuildingName());
716
+                checkOwnerInfo.setUnitId(tpRoomNo.getUnitId());
717
+                checkOwnerInfo.setUnitName(tpRoomNo.getUnitName());
718
+                checkOwnerInfo.setLevelId(tpRoomNo.getLevelId());
719
+                checkOwnerInfo.setLevelName(tpRoomNo.getLevelName());
720
+                checkOwnerInfo.setRoomNoId(tpRoomNo.getId());
721
+                checkOwnerInfo.setRoomNoName(tpRoomNo.getName());
672
                 list.add(checkOwnerInfo);
722
                 list.add(checkOwnerInfo);
673
             }
723
             }
674
         }
724
         }
907
         // 创建列
957
         // 创建列
908
         XSSFCell cell = null;
958
         XSSFCell cell = null;
909
 
959
 
910
-        Integer pageNum = 1;
960
+        Integer pageNum = 0;
911
         Integer pageSize = 10;
961
         Integer pageSize = 10;
912
-        Page<TpBuildingOwnerInfo> page = new Page(pageNum,pageSize);
962
+
913
         // 分页查询
963
         // 分页查询
914
-        QueryWrapper<TpBuildingOwnerInfo> buildingOwnerInfoQueryWrapper = new QueryWrapper<>();
915
-        buildingOwnerInfoQueryWrapper.eq("community_id", userElement.getCommunityId());
916
-        IPage<TpBuildingOwnerInfo> infoIPage = tpBuildingOwnerInfoMapper.selectPage(page, buildingOwnerInfoQueryWrapper);
917
-        List<TpBuildingOwnerInfo> records = infoIPage.getRecords();
964
+        List<TpRoomNo> records = tpRoomNoMapper.selectCommunityIdList(userElement.getCommunityId(),pageNum * pageSize, pageSize);
918
         // 总页数
965
         // 总页数
919
-        Long pages = infoIPage.getPages();
966
+        Long pages = tpRoomNoMapper.selectCommunityIdCount(userElement.getCommunityId());
920
 
967
 
921
 
968
 
922
         // 行数 默认从 第 3 行开始
969
         // 行数 默认从 第 3 行开始
934
 
981
 
935
         if (records.size() > 0) {
982
         if (records.size() > 0) {
936
             do {
983
             do {
937
-                TpBuildingOwnerInfo buildingOwnerInfo = records.get(index);
984
+                TpRoomNo tpRoomNo = records.get(index);
938
                 row = sheet.createRow(currentRow);
985
                 row = sheet.createRow(currentRow);
939
-                String address = buildingOwnerInfo.getPhaseName() +
940
-                        buildingOwnerInfo.getBuildingName() +
941
-                        buildingOwnerInfo.getUnitName() +
942
-                        buildingOwnerInfo.getLevelName() +
943
-                        buildingOwnerInfo.getRoomNoName();
986
+                String address = tpRoomNo.getPhaseName() +
987
+                        tpRoomNo.getBuildingName() +
988
+                        tpRoomNo.getUnitName() +
989
+                        tpRoomNo.getLevelName() +
990
+                        tpRoomNo.getName();
944
 
991
 
945
                 cell = row.createCell(0);
992
                 cell = row.createCell(0);
946
                 cell.setCellType(Cell.CELL_TYPE_STRING);
993
                 cell.setCellType(Cell.CELL_TYPE_STRING);
948
                 cell.setCellStyle(cellStyle);
995
                 cell.setCellStyle(cellStyle);
949
                 cell = row.createCell(1);
996
                 cell = row.createCell(1);
950
                 cell.setCellType(Cell.CELL_TYPE_STRING);
997
                 cell.setCellType(Cell.CELL_TYPE_STRING);
951
-                cell.setCellValue(buildingOwnerInfo.getId());
998
+                cell.setCellValue(tpRoomNo.getId());
952
                 cell.setCellStyle(cellStyle);
999
                 cell.setCellStyle(cellStyle);
953
                 cell = row.createCell(2);
1000
                 cell = row.createCell(2);
954
                 cell.setCellType(Cell.CELL_TYPE_STRING);
1001
                 cell.setCellType(Cell.CELL_TYPE_STRING);
964
                 index ++;
1011
                 index ++;
965
                 if (index == records.size()) {
1012
                 if (index == records.size()) {
966
                     index = 0;
1013
                     index = 0;
967
-                    page = new Page(infoIPage.getCurrent() + 1,pageSize);
968
-                    infoIPage = tpBuildingOwnerInfoMapper.selectPage(page, buildingOwnerInfoQueryWrapper);
969
-                    records = infoIPage.getRecords();
1014
+                    pageNum ++;
1015
+                    records = tpRoomNoMapper.selectCommunityIdList(userElement.getCommunityId(),pageNum * pageSize, pageSize);
1016
+                }
1017
+                if (records.isEmpty()) {
1018
+                    break;
970
                 }
1019
                 }
971
-            } while (infoIPage.getCurrent() <= pages);
1020
+            } while (pageNum <= pages);
972
         }
1021
         }
973
 
1022
 
974
         responseBean.addSuccess(workbook);
1023
         responseBean.addSuccess(workbook);

+ 4
- 0
CODE/smart-community/property-api/src/main/resources/mapper/TpBuildingOwnerInfoMapper.xml View File

61
     <select id="selectListByParams" resultType="com.community.huiju.model.TpBuildingOwnerInfo">
61
     <select id="selectListByParams" resultType="com.community.huiju.model.TpBuildingOwnerInfo">
62
         SELECT
62
         SELECT
63
             t.id,
63
             t.id,
64
+            t.phase_name,
65
+            t.building_name,
66
+            t.unit_name,
67
+            t.level_name,
64
             t.room_no_name,
68
             t.room_no_name,
65
             u.id as userVerifyId,
69
             u.id as userVerifyId,
66
             t.community_id as communityId,
70
             t.community_id as communityId,

BIN
CODE/smart-community/property-api/src/main/resources/缴费单模板.xls View File


+ 3
- 3
VUECODE/smart-property-manage/src/views/bill/add/index.vue View File

49
           width="180">
49
           width="180">
50
           <template slot-scope="scope">{{ showAddress(scope.row) }}</template>
50
           <template slot-scope="scope">{{ showAddress(scope.row) }}</template>
51
         </el-table-column>
51
         </el-table-column>
52
-        <el-table-column
53
-          prop="ownerName"
54
-          label="户主姓名"/>
52
+        <!--<el-table-column-->
53
+          <!--prop="ownerName"-->
54
+          <!--label="户主姓名"/>-->
55
         <el-table-column
55
         <el-table-column
56
           prop="billExplain"
56
           prop="billExplain"
57
           align="center"
57
           align="center"

+ 3
- 3
VUECODE/smart-property-manage/src/views/bill/edi/index.vue View File

48
           width="180">
48
           width="180">
49
           <template slot-scope="scope">{{ showAddress(scope.row) }}</template>
49
           <template slot-scope="scope">{{ showAddress(scope.row) }}</template>
50
         </el-table-column>
50
         </el-table-column>
51
-        <el-table-column
52
-          prop="ownerName"
53
-          label="户主姓名"/>
51
+        <!--<el-table-column-->
52
+          <!--prop="ownerName"-->
53
+          <!--label="户主姓名"/>-->
54
         <el-table-column
54
         <el-table-column
55
           prop="billInvoiceExplain"
55
           prop="billInvoiceExplain"
56
           align="center"
56
           align="center"

+ 3
- 1
VUECODE/smart-property-manage/src/views/building/index.vue View File

82
       </el-table-column>
82
       </el-table-column>
83
       <el-table-column prop="ownerTel" label="手机号" align="center" />
83
       <el-table-column prop="ownerTel" label="手机号" align="center" />
84
       <el-table-column prop="idCard" label="身份证号" align="center" />
84
       <el-table-column prop="idCard" label="身份证号" align="center" />
85
-      <el-table-column prop="roomNoName" label="房间号" align="center" />
85
+      <el-table-column prop="roomNoName" label="房间号" align="center">
86
+        <template slot-scope="scope">{{ scope.row.phaseName + scope.row.buildingName + scope.row.unitName + scope.row.levelName + scope.row.roomNoName }}</template>
87
+      </el-table-column>
86
       <el-table-column prop="roleName" label="身份" align="center" />
88
       <el-table-column prop="roleName" label="身份" align="center" />
87
       <el-table-column prop="verifyStatus" label="审核状态" align="center" >
89
       <el-table-column prop="verifyStatus" label="审核状态" align="center" >
88
         <template slot-scope="scope">
90
         <template slot-scope="scope">