魏熙美 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,6 +878,12 @@ public class TaUserServiceImpl implements ITaUserService {
878 878
         // 根据 审核id 查询 出审核的数据,里面有角色id
879 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 888
         userVO.setVerifyStatus(userVerify.getVerifyStatus());
883 889
 
@@ -913,6 +919,7 @@ public class TaUserServiceImpl implements ITaUserService {
913 919
             }
914 920
         }
915 921
 
922
+
916 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,12 +1,15 @@
1 1
 package com.community.huiju.dao;
2 2
 
3 3
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
4 5
 import com.community.huiju.model.TpRoomNo;
5 6
 import org.apache.ibatis.annotations.Mapper;
6 7
 import org.apache.ibatis.annotations.Param;
7 8
 import org.apache.ibatis.annotations.ResultType;
8 9
 import org.apache.ibatis.annotations.Select;
9 10
 
11
+import java.util.List;
12
+
10 13
 /**
11 14
  * <p>
12 15
  * 户号信息表 Mapper 接口
@@ -39,5 +42,23 @@ public interface TpRoomNoMapper extends BaseMapper<TpRoomNo> {
39 42
             "and name = #{roomNoName}")
40 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,31 +337,6 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
337 337
                 billInvoice.setCommunityId(userElement.getCommunityId());
338 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,9 +344,6 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
369 344
                 if (null == tpRoomNo) {
370 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 347
                 billInvoice.setRoomNoId(tpRoomNo.getId());
376 348
                 billInvoice.setBillInvoiceExplain(e.getBillExplain());
377 349
                 billInvoice.setPayPrice(e.getPayPrice());
@@ -448,52 +420,49 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
448 420
         int lastRowNum = sheetAt.getLastRowNum();
449 421
 
450 422
         // 从第7行开始读取
451
-        for (int i= 6; i<= lastRowNum; i++) {
423
+        for (int i= 6; i< lastRowNum; i++) {
424
+            int currentRow = i + 1;
452 425
             Row row = sheetAt.getRow(i);
453 426
             Cell cell = getCell(row.getCell(0));
454 427
             if (null == cell) {
455
-                throw new WisdomException("第" + i+1 + "行 期/区 不能为空");
428
+                throw new WisdomException("第" + currentRow + "行 期/区 不能为空");
456 429
             }
457 430
             String phase = cell.getStringCellValue().trim();
458 431
             cell = getCell(row.getCell(1));
459 432
             if (null == cell) {
460
-                throw new WisdomException("第" + i+1 + "行 楼栋 不能为空");
433
+                throw new WisdomException("第" + currentRow + "行 楼栋 不能为空");
461 434
             }
462 435
             String building = cell.getStringCellValue().trim();
463 436
             cell = getCell(row.getCell(2));
464 437
             if (null == cell) {
465
-                throw new WisdomException("第" + i+1 + "行 单元 不能为空");
438
+                throw new WisdomException("第" + currentRow + "行 单元 不能为空");
466 439
             }
467 440
             String unit = cell.getStringCellValue().trim();
468 441
             cell = getCell(row.getCell(3));
469 442
             if (null == cell) {
470
-                throw new WisdomException("第" + i+1 + "行 楼层 不能为空");
443
+                throw new WisdomException("第" + currentRow + "行 楼层 不能为空");
471 444
             }
472 445
             String level = cell.getStringCellValue().trim();
473 446
             cell = getCell(row.getCell(4));
474 447
             if (null == cell) {
475
-                throw new WisdomException("第" + i+1 + "行 房号 不能为空");
448
+                throw new WisdomException("第" + currentRow + "行 房号 不能为空");
476 449
             }
477 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 455
             String billExplain = null;
487 456
             if (null != cell) {
488 457
                 billExplain = cell.getStringCellValue().trim();
489 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 464
             if (null == cell) {
496
-                throw new WisdomException("第" + i+1 + "行 金额 不能为空");
465
+                throw new WisdomException("第" + currentRow + "行 金额 不能为空");
497 466
             }
498 467
             String money = cell.getStringCellValue().trim();
499 468
 
@@ -504,7 +473,7 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
504 473
             temp.setLevel(level);
505 474
             temp.setUnit(unit);
506 475
             temp.setRoomNo(roomNo);
507
-            temp.setOwnerName(ownerName);
476
+            // temp.setOwnerName(ownerName);
508 477
             temp.setBillExplain(billExplain);
509 478
 
510 479
 
@@ -636,17 +605,13 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
636 605
         // 创建列
637 606
         HSSFCell cell = null;
638 607
 
639
-        Integer pageNum = 1;
608
+        Integer pageNum = 0;
640 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 617
         // 行数 默认从 第 6 行开始
@@ -656,29 +621,29 @@ public class BillServiceImpl extends ServiceImpl<BillMapper, Bill> implements IB
656 621
 
657 622
         if (records.size() > 0) {
658 623
             do {
659
-                TpBuildingOwnerInfo buildingOwnerInfo = records.get(index);
624
+                TpRoomNo tpRoomNo = records.get(index);
660 625
                 row = sheet.createRow(currentRow);
661 626
                 cell = row.createCell(0);
662
-                cell.setCellValue(buildingOwnerInfo.getPhaseName());
627
+                cell.setCellValue(tpRoomNo.getPhaseName());
663 628
                 cell = row.createCell(1);
664
-                cell.setCellValue(buildingOwnerInfo.getBuildingName());
629
+                cell.setCellValue(tpRoomNo.getBuildingName());
665 630
                 cell = row.createCell(2);
666
-                cell.setCellValue(buildingOwnerInfo.getUnitName());
631
+                cell.setCellValue(tpRoomNo.getUnitName());
667 632
                 cell = row.createCell(3);
668
-                cell.setCellValue(buildingOwnerInfo.getLevelName());
633
+                cell.setCellValue(tpRoomNo.getLevelName());
669 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 636
                 currentRow ++;
674 637
                 index ++;
675 638
                 if (index == records.size()) {
676 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 649
         responseBean.addSuccess(workbook);

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

@@ -1,6 +1,5 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3
-import com.alibaba.fastjson.JSON;
4 3
 import com.alibaba.fastjson.JSONObject;
5 4
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
6 5
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -11,7 +10,6 @@ import com.community.commom.constant.Constant;
11 10
 import com.community.commom.mode.ResponseBean;
12 11
 import com.community.commom.session.UserElement;
13 12
 import com.community.commom.utils.AccountValidatorUtil;
14
-import com.community.commom.utils.BeanTools;
15 13
 
16 14
 import com.community.huiju.common.base.messagePush;
17 15
 import com.community.huiju.common.code.ICode;
@@ -22,9 +20,7 @@ import com.community.huiju.model.*;
22 20
 
23 21
 import com.community.huiju.service.IBillInvoiceService;
24 22
 import com.community.huiju.service.IBuildingOwnerInfoService;
25
-import com.community.huiju.service.ITaUserService;
26 23
 import com.google.common.collect.Maps;
27
-import org.apache.commons.collections.CollectionUtils;
28 24
 
29 25
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
30 26
 import org.apache.poi.ss.usermodel.*;
@@ -43,8 +39,7 @@ import java.io.IOException;
43 39
 import java.io.InputStream;
44 40
 import java.time.LocalDateTime;
45 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,14 +226,9 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
231 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 231
         // 开始匹配 APP 端用户表
240
-        // 查询 APP 端
241
-        TaUser appUser = getByLoginName(tpBuildingOwnerInfo.getOwnerTel());
242 232
         if (null == appUser) {
243 233
             // 如果 APP端 没有这个用户,则自动注册一个
244 234
             TaUser taUser = new TaUser();
@@ -255,6 +245,16 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
255 245
             taUserMapper.updateById(taUser);
256 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 258
         // 更新 APP 端用户姓名
259 259
         appUser.setUserName(tpBuildingOwnerInfo.getOwnerName());
260 260
         appUser.setCreateDate(LocalDateTime.now());
@@ -311,7 +311,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
311 311
         String[] messageArr= new messagePush().messagePushAll( );
312 312
         for (String count : messageArr) {
313 313
             Message message = new Message();
314
-            message.setCommunityId(userVerify.getCommunityId());
314
+            message.setCommunityId(taUserVerify.getCommunityId());
315 315
             message.setMessageType("9");
316 316
             message.setAdviceType("1");
317 317
             message.setModelType("1");
@@ -452,12 +452,14 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
452 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 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 463
             if (null == taUser){
462 464
                 //插入新用户并审核通过
463 465
                 addNewUser(tpBuildingOwnerInfo,userElement);
@@ -471,20 +473,31 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
471 473
     }
472 474
     
473 475
     private void checkUserVerify(TaUser taUser, TpBuildingOwnerInfo tpBuildingOwnerInfo, UserElement userElement) {
476
+
474 477
         //有用户的情况下查看是否有申请的房产
475 478
         QueryWrapper<TaUserVerify> queryWrapper = new QueryWrapper<>();
476 479
         queryWrapper.eq("community_id",userElement.getCommunityId());
477 480
         queryWrapper.eq("user_id",taUser.getId());
478 481
         List<TaUserVerify> verifyList = taUserVerifyMapper.selectList(queryWrapper);
482
+        AtomicInteger rows = new AtomicInteger();
479 483
         if (verifyList.size() > 0){
480 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 492
                     e.setVerifyStatus("1");
483 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 503
         saveVerifyData(taUser.getId(),tpBuildingOwnerInfo,userElement);
@@ -520,6 +533,16 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
520 533
         }else if (tpBuildingOwnerInfo.getRoleName().equals("租客")){
521 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 546
         taUserVerify.setPhaseId(tpBuildingOwnerInfo.getPhaseId());
524 547
         taUserVerify.setPhaseName(tpBuildingOwnerInfo.getPhaseName());
525 548
         taUserVerify.setBuildingId(tpBuildingOwnerInfo.getBuildingId());
@@ -528,12 +551,27 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
528 551
         taUserVerify.setUnitName(tpBuildingOwnerInfo.getUnitName());
529 552
         taUserVerify.setLevelId(tpBuildingOwnerInfo.getLevelId());
530 553
         taUserVerify.setLevelName(tpBuildingOwnerInfo.getLevelName());
531
-        taUserVerify.setRoomNoId(tpBuildingOwnerInfo.getId());
554
+        taUserVerify.setRoomNoId(tpBuildingOwnerInfo.getRoomNoId());
532 555
         taUserVerify.setRoomNoName(tpBuildingOwnerInfo.getRoomNoName());
533 556
         taUserVerify.setVerifyStatus("1");
534 557
         taUserVerify.setCreateDate(LocalDateTime.now());
535 558
         taUserVerify.setVerifyName(userElement.getUserName());
536 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 577
     @Override
@@ -634,8 +672,8 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
634 672
                     return responseBean;
635 673
                 }
636 674
                 //房产ID不为空的情况下检查房产是否存在
637
-                TpBuildingOwnerInfo checkOwnerInfo =tpBuildingOwnerInfoMapper.selectById(roomNoId);
638
-                if (null == checkOwnerInfo){
675
+                TpRoomNo tpRoomNo = tpRoomNoMapper.selectById(roomNoId);
676
+                if (null == tpRoomNo){
639 677
                     responseBean.addError("第" + currentRow + "行" + "房产ID不存在!");
640 678
                     return responseBean;
641 679
                 }
@@ -657,18 +695,30 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
657 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 704
                 //把数据塞入temList校验是否有重复的数据
667 705
                 temBuildingList.add(roomNoId);
668 706
                 //构建数据
707
+                TpBuildingOwnerInfo checkOwnerInfo = new TpBuildingOwnerInfo();
708
+                checkOwnerInfo.setId(null);
669 709
                 checkOwnerInfo.setRoleName(ownerRole);
670 710
                 checkOwnerInfo.setOwnerName(ownerName);
671 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 722
                 list.add(checkOwnerInfo);
673 723
             }
674 724
         }
@@ -907,16 +957,13 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
907 957
         // 创建列
908 958
         XSSFCell cell = null;
909 959
 
910
-        Integer pageNum = 1;
960
+        Integer pageNum = 0;
911 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 969
         // 行数 默认从 第 3 行开始
@@ -934,13 +981,13 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
934 981
 
935 982
         if (records.size() > 0) {
936 983
             do {
937
-                TpBuildingOwnerInfo buildingOwnerInfo = records.get(index);
984
+                TpRoomNo tpRoomNo = records.get(index);
938 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 992
                 cell = row.createCell(0);
946 993
                 cell.setCellType(Cell.CELL_TYPE_STRING);
@@ -948,7 +995,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
948 995
                 cell.setCellStyle(cellStyle);
949 996
                 cell = row.createCell(1);
950 997
                 cell.setCellType(Cell.CELL_TYPE_STRING);
951
-                cell.setCellValue(buildingOwnerInfo.getId());
998
+                cell.setCellValue(tpRoomNo.getId());
952 999
                 cell.setCellStyle(cellStyle);
953 1000
                 cell = row.createCell(2);
954 1001
                 cell.setCellType(Cell.CELL_TYPE_STRING);
@@ -964,11 +1011,13 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
964 1011
                 index ++;
965 1012
                 if (index == records.size()) {
966 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 1023
         responseBean.addSuccess(workbook);

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

@@ -61,6 +61,10 @@
61 61
     <select id="selectListByParams" resultType="com.community.huiju.model.TpBuildingOwnerInfo">
62 62
         SELECT
63 63
             t.id,
64
+            t.phase_name,
65
+            t.building_name,
66
+            t.unit_name,
67
+            t.level_name,
64 68
             t.room_no_name,
65 69
             u.id as userVerifyId,
66 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,9 +49,9 @@
49 49
           width="180">
50 50
           <template slot-scope="scope">{{ showAddress(scope.row) }}</template>
51 51
         </el-table-column>
52
-        <el-table-column
53
-          prop="ownerName"
54
-          label="户主姓名"/>
52
+        <!--<el-table-column-->
53
+          <!--prop="ownerName"-->
54
+          <!--label="户主姓名"/>-->
55 55
         <el-table-column
56 56
           prop="billExplain"
57 57
           align="center"

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

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

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

@@ -82,7 +82,9 @@
82 82
       </el-table-column>
83 83
       <el-table-column prop="ownerTel" label="手机号" align="center" />
84 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 88
       <el-table-column prop="roleName" label="身份" align="center" />
87 89
       <el-table-column prop="verifyStatus" label="审核状态" align="center" >
88 90
         <template slot-scope="scope">