魏熙美 6 лет назад
Родитель
Сommit
aa09985be2

+ 5
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/UserVerifyController.java Просмотреть файл

@@ -45,15 +45,18 @@ public class UserVerifyController extends BaseController {
45 45
             @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "idCard", value = "身份证"),
46 46
             @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "pageNum", value = "第几页"),
47 47
             @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "pageSize", value = "一页多少行"),
48
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token"),
48 49
     })
49 50
     public ResponseBean getAll(@RequestParam(value = "phone", required = false) String phone,
50 51
                                @RequestParam(value = "userName", required = false) String userName,
51 52
                                @RequestParam(value = "idCard", required = false) String idCard,
52 53
                                @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
53
-                               @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
54
+                               @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
55
+                               HttpSession session) {
54 56
 
55 57
         ResponseBean responseBean = new ResponseBean();
56
-        responseBean = iTaUserVerifyService.selectAll(phone, userName, idCard, pageNum, pageSize);
58
+        UserElement userElement = getUserElement(session);
59
+        responseBean = iTaUserVerifyService.selectAll(phone, userName, idCard, pageNum, pageSize, userElement);
57 60
         return responseBean;
58 61
     }
59 62
 

+ 1
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TaUserVerifyMapper.java Просмотреть файл

@@ -30,7 +30,7 @@ public interface TaUserVerifyMapper extends BaseMapper<TaUserVerify> {
30 30
      * @param idCard
31 31
      * @return
32 32
      */
33
-    IPage<TaUserVerify> selectAllByPhoneAndUserNameAndIdCard(Page page, @Param("phone") String phone, @Param("userName") String userName, @Param("idCard") String idCard);
33
+    IPage<TaUserVerify> selectAllByPhoneAndUserNameAndIdCard(Page page, @Param("phone") String phone, @Param("userName") String userName, @Param("idCard") String idCard, @Param("communityId") Integer communityId);
34 34
 
35 35
     /**
36 36
      * 根据 小区id 、 小区、期、栋、单元、楼层、户号 进行条件查询出 已审核通过的并且是业主

+ 2
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITaUserVerifyService.java Просмотреть файл

@@ -17,9 +17,10 @@ public interface ITaUserVerifyService extends IService<TaUserVerify> {
17 17
      * @param idCard
18 18
      * @param pageNum
19 19
      * @param pageSize
20
+     * @param userElement
20 21
      * @return
21 22
      */
22
-    ResponseBean selectAll(String phone, String userName, String idCard, Integer pageNum, Integer pageSize);
23
+    ResponseBean selectAll(String phone, String userName, String idCard, Integer pageNum, Integer pageSize, UserElement userElement);
23 24
 
24 25
     /**
25 26
      * 审核 用户

+ 23
- 28
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingTreeServiceImpl.java Просмотреть файл

@@ -599,7 +599,6 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
599 599
 		
600 600
 		for (TpBuildingOwnerInfo tpBuildingOwnerInfo : list){
601 601
 			//插入期/区数据
602
-			if (!tpBuildingOwnerInfo.getPhaseName().equals(lastPhaseName)){
603 602
 				TpPhase tpPhase = new TpPhase();
604 603
 				tpPhase.setName(tpBuildingOwnerInfo.getPhaseName());
605 604
 				tpPhase.setCommunityId(communityId);
@@ -608,11 +607,11 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
608 607
 				QueryWrapper<TpPhase> phaseQueryWrapper = new QueryWrapper<>();
609 608
 				phaseQueryWrapper.eq("community_id", communityId);
610 609
 				phaseQueryWrapper.eq("`NAME`", tpBuildingOwnerInfo.getPhaseName());
611
-				TpPhase selectOne = tpPhaseMapper.selectOne(phaseQueryWrapper);
610
+				TpPhase selectPhase = tpPhaseMapper.selectOne(phaseQueryWrapper);
612 611
 				// 判断是否存在库里
613
-				if (null != selectOne) {
614
-					lastPhaseName = selectOne.getName();
615
-					lastPhaseId = selectOne.getId();
612
+				if (null != selectPhase) {
613
+					lastPhaseName = selectPhase.getName();
614
+					lastPhaseId = selectPhase.getId();
616 615
 				} else {
617 616
 					tpPhaseMapper.insert(tpPhase);
618 617
 					//重置Last
@@ -623,9 +622,7 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
623 622
 					lastRoomNoName = "";
624 623
 					lastPhaseId = tpPhase.getId();
625 624
 				}
626
-			}
627 625
 			//插入楼栋数据
628
-			if (!tpBuildingOwnerInfo.getBuildingName().equals(lastBuildingName)){
629 626
 				TpBuilding tpBuilding = new TpBuilding();
630 627
 				tpBuilding.setCommunityId(communityId);
631 628
 				tpBuilding.setPhaseId(lastPhaseId);
@@ -637,18 +634,17 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
637 634
 				buildingQueryWrapper.eq("community_id", communityId);
638 635
 				buildingQueryWrapper.eq("phase_id", lastPhaseId);
639 636
 				buildingQueryWrapper.eq("`name`", tpBuildingOwnerInfo.getBuildingName());
640
-				TpBuilding selectOne = tpBuildingMapper.selectOne(buildingQueryWrapper);
641
-				if (null != selectOne) {
642
-					lastBuildingName = selectOne.getName();
643
-					lastBuildingId = selectOne.getId();
637
+				TpBuilding selectBuilding = tpBuildingMapper.selectOne(buildingQueryWrapper);
638
+				if (null != selectBuilding) {
639
+					lastBuildingName = selectBuilding.getName();
640
+					lastBuildingId = selectBuilding.getId();
644 641
 				} else {
645 642
 					tpBuildingMapper.insert(tpBuilding);
646 643
 					lastBuildingName = tpBuildingOwnerInfo.getBuildingName();
647 644
 					lastBuildingId = tpBuilding.getId();
648 645
 				}
649
-			}
646
+
650 647
 			//插入单元信息
651
-			if (!tpBuildingOwnerInfo.getUnitName().equals(lastUnitName)){
652 648
 				TpUnit tpUnit = new TpUnit();
653 649
 				tpUnit.setCommunityId(communityId);
654 650
 				tpUnit.setPhaseId(lastPhaseId);
@@ -663,19 +659,19 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
663 659
 				unitQueryWrapper.eq("phase_id", lastPhaseId);
664 660
 				unitQueryWrapper.eq("building_id", lastBuildingId);
665 661
 				unitQueryWrapper.eq("`name`",tpBuildingOwnerInfo.getUnitName());
666
-				TpUnit selectOne = tpUnitMapper.selectOne(unitQueryWrapper);
662
+				TpUnit selectUnit = tpUnitMapper.selectOne(unitQueryWrapper);
667 663
 				// 校验是否存在库里
668
-				if (null != selectOne) {
669
-					lastUnitName = selectOne.getName();
670
-					lastUnitId = selectOne.getId();
664
+				if (null != selectUnit) {
665
+					lastUnitName = selectUnit.getName();
666
+					lastUnitId = selectUnit.getId();
671 667
 				} else {
672 668
 					tpUnitMapper.insert(tpUnit);
673 669
 					lastUnitName = tpBuildingOwnerInfo.getUnitName();
674 670
 					lastUnitId = tpUnit.getId();
675 671
 				}
676
-			}
672
+
677 673
 			//插入楼层信息
678
-			if (!tpBuildingOwnerInfo.getLevelName().equals(lastLevelName)){
674
+
679 675
 				TpLevel tpLevel = new TpLevel();
680 676
 				tpLevel.setCommunityId(communityId);
681 677
 				tpLevel.setPhaseId(lastPhaseId);
@@ -693,19 +689,18 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
693 689
 				levelQueryWrapper.eq("building_id", lastBuildingId);
694 690
 				levelQueryWrapper.eq("unit_id", lastUnitId);
695 691
 				levelQueryWrapper.eq("`name`", tpBuildingOwnerInfo.getLevelName());
696
-				TpLevel selectOne = tpLevelMapper.selectOne(levelQueryWrapper);
692
+				TpLevel selectLevel = tpLevelMapper.selectOne(levelQueryWrapper);
697 693
 				// 校验是否存在库里
698
-				if (null != selectOne) {
699
-					lastLevelName = selectOne.getName();
700
-					lastLevelId = selectOne.getId();
694
+				if (null != selectLevel) {
695
+					lastLevelName = selectLevel.getName();
696
+					lastLevelId = selectLevel.getId();
701 697
 				} else {
702 698
 					tpLevelMapper.insert(tpLevel);
703 699
 					lastLevelName = tpBuildingOwnerInfo.getLevelName();
704 700
 					lastLevelId = tpLevel.getId();
705 701
 				}
706
-			}
702
+
707 703
 			//插入房间号信息
708
-			if (!tpBuildingOwnerInfo.getRoomNoName().equals(lastRoomNoName)){
709 704
 				TpRoomNo tpRoomNo = new TpRoomNo();
710 705
 				tpRoomNo.setCommunityId(communityId);
711 706
 				tpRoomNo.setPhaseId(lastPhaseId);
@@ -726,11 +721,11 @@ public class BuildingTreeServiceImpl implements BuildingTreeServiceI {
726 721
 				roomNoQueryWrapper.eq("unit_id", lastUnitId);
727 722
 				roomNoQueryWrapper.eq("level_id", lastLevelId);
728 723
 				roomNoQueryWrapper.eq("`name`", tpBuildingOwnerInfo.getRoomNoName());
729
-				TpRoomNo selectOne = tpRoomNoMapper.selectOne(roomNoQueryWrapper);
730
-				if (null == selectOne) {
724
+				TpRoomNo selectRoomNo = tpRoomNoMapper.selectOne(roomNoQueryWrapper);
725
+				if (null == selectRoomNo) {
731 726
 					tpRoomNoMapper.insert(tpRoomNo);
732 727
 				}
733
-			}
728
+
734 729
 		}
735 730
 	}
736 731
 	//删除当前节点判断是否有审核通过的

+ 15
- 5
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TaUserVerifyServiceImpl.java Просмотреть файл

@@ -13,6 +13,7 @@ import com.community.huiju.exception.WisdomException;
13 13
 import com.community.huiju.feign.TaUserFeignService;
14 14
 import com.community.huiju.model.*;
15 15
 import com.community.huiju.service.ITaUserVerifyService;
16
+import lombok.extern.slf4j.Slf4j;
16 17
 import org.apache.commons.lang.StringUtils;
17 18
 import org.springframework.beans.factory.annotation.Autowired;
18 19
 import org.springframework.stereotype.Service;
@@ -28,6 +29,7 @@ import java.util.List;
28 29
  * @author weiximei
29 30
  */
30 31
 @Service
32
+@Slf4j
31 33
 public class TaUserVerifyServiceImpl extends ServiceImpl<TaUserVerifyMapper, TaUserVerify> implements ITaUserVerifyService {
32 34
 
33 35
     @Autowired
@@ -62,21 +64,23 @@ public class TaUserVerifyServiceImpl extends ServiceImpl<TaUserVerifyMapper, TaU
62 64
 
63 65
     @Autowired
64 66
     private MessageMapper tpmessageMapper;
67
+
65 68
     @Override
66
-    public ResponseBean selectAll(String phone, String userName, String idCard, Integer pageNum, Integer pageSize) {
69
+    public ResponseBean selectAll(String phone, String userName, String idCard, Integer pageNum, Integer pageSize, UserElement userElement) {
67 70
         ResponseBean responseBean = new ResponseBean();
68 71
 
69 72
         Page<TaUserVerify> page = new Page<>();
70 73
         page.setCurrent(pageNum);
71 74
         page.setSize(pageSize);
72 75
 
73
-        IPage<TaUserVerify> userVerifyIPage = taUserVerifyMapper.selectAllByPhoneAndUserNameAndIdCard(page, phone, userName, idCard);
76
+        IPage<TaUserVerify> userVerifyIPage = taUserVerifyMapper.selectAllByPhoneAndUserNameAndIdCard(page, phone, userName, idCard, userElement.getCommunityId());
74 77
         responseBean.addSuccess(userVerifyIPage);
75 78
 
76 79
         return responseBean;
77 80
     }
78 81
 
79 82
     @Override
83
+    @Transactional(rollbackFor = Exception.class)
80 84
     public ResponseBean auditUser(UserElement userElement, Integer userVerifyId, Boolean verifyStatus, String remark) {
81 85
         ResponseBean responseBean = new ResponseBean();
82 86
 
@@ -115,12 +119,18 @@ public class TaUserVerifyServiceImpl extends ServiceImpl<TaUserVerifyMapper, TaU
115 119
         userVerify.setVerifyName(user.getUserName());
116 120
         taUserVerifyMapper.updateById(userVerify);
117 121
 
118
-        // 推送海康
119
-        ResponseBean pushHKPerson = taUserFeignService.pushHKPerson(userVerify.getUserId());
120
-        if (!"0".equals(pushHKPerson.getCode())) {
122
+        try {
123
+            // 推送海康
124
+            ResponseBean pushHKPerson = taUserFeignService.pushHKPerson(userVerify.getUserId());
125
+            if (!"0".equals(pushHKPerson.getCode())) {
126
+                throw new WisdomException("设备推送失败!");
127
+            }
128
+        } catch (Exception e) {
129
+            log.info("设备推送失败!,人员id:{}", userVerify.getUserId());
121 130
             throw new WisdomException("设备推送失败!");
122 131
         }
123 132
 
133
+
124 134
         String[] messageArr= new messagePush().messagePushAll( );
125 135
         for (String count : messageArr) {
126 136
             Message message = new Message();

+ 3
- 0
CODE/smart-community/property-api/src/main/resources/mapper/TaUserVerifyMapper.xml Просмотреть файл

@@ -23,6 +23,9 @@
23 23
                 <if test="idCard != null and idCard != ''">
24 24
                     and tu.id_card like CONCAT('%',#{idCard},'%')
25 25
                 </if>
26
+                <if test="communityId != null and communityId != ''">
27
+                    and tav.community_id = #{communityId,jdbcType=INTEGER}
28
+                </if>
26 29
             </trim>
27 30
         </where>
28 31
     </select>

+ 2
- 2
VUECODE/smart-property-manage/src/router/index.js Просмотреть файл

@@ -28,7 +28,7 @@ export const constantRouterMap = [
28 28
     redirect: '/building/index',
29 29
     name: 'building',
30 30
     alwaysShow: true,
31
-    meta: { title: '主/楼栋', icon: 'zip' },
31
+    meta: { title: '主/楼栋', icon: 'zip' },
32 32
     children: [
33 33
       {
34 34
         path: '/building/buildingdata/index',
@@ -47,7 +47,7 @@ export const constantRouterMap = [
47 47
         path: '/building/index',
48 48
         component: () => import('@/views/building/index'),
49 49
         name: 'building-index',
50
-        meta: { title: '主资料库', icon: 'building' }
50
+        meta: { title: '主资料库', icon: 'building' }
51 51
       },
52 52
       {
53 53
         path: '/building/info/index',