魏熙美 преди 6 години
родител
ревизия
aa09985be2

+ 5
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/UserVerifyController.java Целия файл

45
             @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "idCard", value = "身份证"),
45
             @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "idCard", value = "身份证"),
46
             @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "pageNum", value = "第几页"),
46
             @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "pageNum", value = "第几页"),
47
             @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "pageSize", value = "一页多少行"),
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
     public ResponseBean getAll(@RequestParam(value = "phone", required = false) String phone,
50
     public ResponseBean getAll(@RequestParam(value = "phone", required = false) String phone,
50
                                @RequestParam(value = "userName", required = false) String userName,
51
                                @RequestParam(value = "userName", required = false) String userName,
51
                                @RequestParam(value = "idCard", required = false) String idCard,
52
                                @RequestParam(value = "idCard", required = false) String idCard,
52
                                @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
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
         ResponseBean responseBean = new ResponseBean();
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
         return responseBean;
60
         return responseBean;
58
     }
61
     }
59
 
62
 

+ 1
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TaUserVerifyMapper.java Целия файл

30
      * @param idCard
30
      * @param idCard
31
      * @return
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
      * 根据 小区id 、 小区、期、栋、单元、楼层、户号 进行条件查询出 已审核通过的并且是业主
36
      * 根据 小区id 、 小区、期、栋、单元、楼层、户号 进行条件查询出 已审核通过的并且是业主

+ 2
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITaUserVerifyService.java Целия файл

17
      * @param idCard
17
      * @param idCard
18
      * @param pageNum
18
      * @param pageNum
19
      * @param pageSize
19
      * @param pageSize
20
+     * @param userElement
20
      * @return
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
 		
599
 		
600
 		for (TpBuildingOwnerInfo tpBuildingOwnerInfo : list){
600
 		for (TpBuildingOwnerInfo tpBuildingOwnerInfo : list){
601
 			//插入期/区数据
601
 			//插入期/区数据
602
-			if (!tpBuildingOwnerInfo.getPhaseName().equals(lastPhaseName)){
603
 				TpPhase tpPhase = new TpPhase();
602
 				TpPhase tpPhase = new TpPhase();
604
 				tpPhase.setName(tpBuildingOwnerInfo.getPhaseName());
603
 				tpPhase.setName(tpBuildingOwnerInfo.getPhaseName());
605
 				tpPhase.setCommunityId(communityId);
604
 				tpPhase.setCommunityId(communityId);
608
 				QueryWrapper<TpPhase> phaseQueryWrapper = new QueryWrapper<>();
607
 				QueryWrapper<TpPhase> phaseQueryWrapper = new QueryWrapper<>();
609
 				phaseQueryWrapper.eq("community_id", communityId);
608
 				phaseQueryWrapper.eq("community_id", communityId);
610
 				phaseQueryWrapper.eq("`NAME`", tpBuildingOwnerInfo.getPhaseName());
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
 				} else {
615
 				} else {
617
 					tpPhaseMapper.insert(tpPhase);
616
 					tpPhaseMapper.insert(tpPhase);
618
 					//重置Last
617
 					//重置Last
623
 					lastRoomNoName = "";
622
 					lastRoomNoName = "";
624
 					lastPhaseId = tpPhase.getId();
623
 					lastPhaseId = tpPhase.getId();
625
 				}
624
 				}
626
-			}
627
 			//插入楼栋数据
625
 			//插入楼栋数据
628
-			if (!tpBuildingOwnerInfo.getBuildingName().equals(lastBuildingName)){
629
 				TpBuilding tpBuilding = new TpBuilding();
626
 				TpBuilding tpBuilding = new TpBuilding();
630
 				tpBuilding.setCommunityId(communityId);
627
 				tpBuilding.setCommunityId(communityId);
631
 				tpBuilding.setPhaseId(lastPhaseId);
628
 				tpBuilding.setPhaseId(lastPhaseId);
637
 				buildingQueryWrapper.eq("community_id", communityId);
634
 				buildingQueryWrapper.eq("community_id", communityId);
638
 				buildingQueryWrapper.eq("phase_id", lastPhaseId);
635
 				buildingQueryWrapper.eq("phase_id", lastPhaseId);
639
 				buildingQueryWrapper.eq("`name`", tpBuildingOwnerInfo.getBuildingName());
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
 				} else {
641
 				} else {
645
 					tpBuildingMapper.insert(tpBuilding);
642
 					tpBuildingMapper.insert(tpBuilding);
646
 					lastBuildingName = tpBuildingOwnerInfo.getBuildingName();
643
 					lastBuildingName = tpBuildingOwnerInfo.getBuildingName();
647
 					lastBuildingId = tpBuilding.getId();
644
 					lastBuildingId = tpBuilding.getId();
648
 				}
645
 				}
649
-			}
646
+
650
 			//插入单元信息
647
 			//插入单元信息
651
-			if (!tpBuildingOwnerInfo.getUnitName().equals(lastUnitName)){
652
 				TpUnit tpUnit = new TpUnit();
648
 				TpUnit tpUnit = new TpUnit();
653
 				tpUnit.setCommunityId(communityId);
649
 				tpUnit.setCommunityId(communityId);
654
 				tpUnit.setPhaseId(lastPhaseId);
650
 				tpUnit.setPhaseId(lastPhaseId);
663
 				unitQueryWrapper.eq("phase_id", lastPhaseId);
659
 				unitQueryWrapper.eq("phase_id", lastPhaseId);
664
 				unitQueryWrapper.eq("building_id", lastBuildingId);
660
 				unitQueryWrapper.eq("building_id", lastBuildingId);
665
 				unitQueryWrapper.eq("`name`",tpBuildingOwnerInfo.getUnitName());
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
 				} else {
667
 				} else {
672
 					tpUnitMapper.insert(tpUnit);
668
 					tpUnitMapper.insert(tpUnit);
673
 					lastUnitName = tpBuildingOwnerInfo.getUnitName();
669
 					lastUnitName = tpBuildingOwnerInfo.getUnitName();
674
 					lastUnitId = tpUnit.getId();
670
 					lastUnitId = tpUnit.getId();
675
 				}
671
 				}
676
-			}
672
+
677
 			//插入楼层信息
673
 			//插入楼层信息
678
-			if (!tpBuildingOwnerInfo.getLevelName().equals(lastLevelName)){
674
+
679
 				TpLevel tpLevel = new TpLevel();
675
 				TpLevel tpLevel = new TpLevel();
680
 				tpLevel.setCommunityId(communityId);
676
 				tpLevel.setCommunityId(communityId);
681
 				tpLevel.setPhaseId(lastPhaseId);
677
 				tpLevel.setPhaseId(lastPhaseId);
693
 				levelQueryWrapper.eq("building_id", lastBuildingId);
689
 				levelQueryWrapper.eq("building_id", lastBuildingId);
694
 				levelQueryWrapper.eq("unit_id", lastUnitId);
690
 				levelQueryWrapper.eq("unit_id", lastUnitId);
695
 				levelQueryWrapper.eq("`name`", tpBuildingOwnerInfo.getLevelName());
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
 				} else {
697
 				} else {
702
 					tpLevelMapper.insert(tpLevel);
698
 					tpLevelMapper.insert(tpLevel);
703
 					lastLevelName = tpBuildingOwnerInfo.getLevelName();
699
 					lastLevelName = tpBuildingOwnerInfo.getLevelName();
704
 					lastLevelId = tpLevel.getId();
700
 					lastLevelId = tpLevel.getId();
705
 				}
701
 				}
706
-			}
702
+
707
 			//插入房间号信息
703
 			//插入房间号信息
708
-			if (!tpBuildingOwnerInfo.getRoomNoName().equals(lastRoomNoName)){
709
 				TpRoomNo tpRoomNo = new TpRoomNo();
704
 				TpRoomNo tpRoomNo = new TpRoomNo();
710
 				tpRoomNo.setCommunityId(communityId);
705
 				tpRoomNo.setCommunityId(communityId);
711
 				tpRoomNo.setPhaseId(lastPhaseId);
706
 				tpRoomNo.setPhaseId(lastPhaseId);
726
 				roomNoQueryWrapper.eq("unit_id", lastUnitId);
721
 				roomNoQueryWrapper.eq("unit_id", lastUnitId);
727
 				roomNoQueryWrapper.eq("level_id", lastLevelId);
722
 				roomNoQueryWrapper.eq("level_id", lastLevelId);
728
 				roomNoQueryWrapper.eq("`name`", tpBuildingOwnerInfo.getRoomNoName());
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
 					tpRoomNoMapper.insert(tpRoomNo);
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
 import com.community.huiju.feign.TaUserFeignService;
13
 import com.community.huiju.feign.TaUserFeignService;
14
 import com.community.huiju.model.*;
14
 import com.community.huiju.model.*;
15
 import com.community.huiju.service.ITaUserVerifyService;
15
 import com.community.huiju.service.ITaUserVerifyService;
16
+import lombok.extern.slf4j.Slf4j;
16
 import org.apache.commons.lang.StringUtils;
17
 import org.apache.commons.lang.StringUtils;
17
 import org.springframework.beans.factory.annotation.Autowired;
18
 import org.springframework.beans.factory.annotation.Autowired;
18
 import org.springframework.stereotype.Service;
19
 import org.springframework.stereotype.Service;
28
  * @author weiximei
29
  * @author weiximei
29
  */
30
  */
30
 @Service
31
 @Service
32
+@Slf4j
31
 public class TaUserVerifyServiceImpl extends ServiceImpl<TaUserVerifyMapper, TaUserVerify> implements ITaUserVerifyService {
33
 public class TaUserVerifyServiceImpl extends ServiceImpl<TaUserVerifyMapper, TaUserVerify> implements ITaUserVerifyService {
32
 
34
 
33
     @Autowired
35
     @Autowired
62
 
64
 
63
     @Autowired
65
     @Autowired
64
     private MessageMapper tpmessageMapper;
66
     private MessageMapper tpmessageMapper;
67
+
65
     @Override
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
         ResponseBean responseBean = new ResponseBean();
70
         ResponseBean responseBean = new ResponseBean();
68
 
71
 
69
         Page<TaUserVerify> page = new Page<>();
72
         Page<TaUserVerify> page = new Page<>();
70
         page.setCurrent(pageNum);
73
         page.setCurrent(pageNum);
71
         page.setSize(pageSize);
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
         responseBean.addSuccess(userVerifyIPage);
77
         responseBean.addSuccess(userVerifyIPage);
75
 
78
 
76
         return responseBean;
79
         return responseBean;
77
     }
80
     }
78
 
81
 
79
     @Override
82
     @Override
83
+    @Transactional(rollbackFor = Exception.class)
80
     public ResponseBean auditUser(UserElement userElement, Integer userVerifyId, Boolean verifyStatus, String remark) {
84
     public ResponseBean auditUser(UserElement userElement, Integer userVerifyId, Boolean verifyStatus, String remark) {
81
         ResponseBean responseBean = new ResponseBean();
85
         ResponseBean responseBean = new ResponseBean();
82
 
86
 
115
         userVerify.setVerifyName(user.getUserName());
119
         userVerify.setVerifyName(user.getUserName());
116
         taUserVerifyMapper.updateById(userVerify);
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
             throw new WisdomException("设备推送失败!");
130
             throw new WisdomException("设备推送失败!");
122
         }
131
         }
123
 
132
 
133
+
124
         String[] messageArr= new messagePush().messagePushAll( );
134
         String[] messageArr= new messagePush().messagePushAll( );
125
         for (String count : messageArr) {
135
         for (String count : messageArr) {
126
             Message message = new Message();
136
             Message message = new Message();

+ 3
- 0
CODE/smart-community/property-api/src/main/resources/mapper/TaUserVerifyMapper.xml Целия файл

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

+ 2
- 2
VUECODE/smart-property-manage/src/router/index.js Целия файл

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