dingxin преди 6 години
родител
ревизия
c2130413a9
променени са 19 файла, в които са добавени 350 реда и са изтрити 45 реда
  1. 31
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/common/perproties/LoginCodePerproties.java
  2. 38
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/LoginCodeController.java
  3. 3
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java
  4. 58
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaUserVerifyMapper.java
  5. 19
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBuildingOwnerInfoMapper.java
  6. 2
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java
  7. 9
    6
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoImpl.java
  8. 5
    5
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/FaceServicelimpl.java
  9. 14
    10
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java
  10. 13
    8
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java
  11. 91
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserVerifyServicelmpl.java
  12. 11
    0
      CODE/smart-community/app-api/src/main/resources/application.yml
  13. 4
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TaUserVerifyMapper.xml
  14. 2
    2
      CODE/smart-community/property-api/src/main/java/com/community/huiju/common/base/QRCode.java
  15. 26
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/common/perproties/QRCodePerproties.java
  16. 8
    7
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoServiceImpl.java
  17. 6
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpActivityServiceImpl.java
  18. 4
    0
      CODE/smart-community/property-api/src/main/resources/application.yml
  19. 6
    0
      VUECODE/smart-property-manage/src/views/building/edi/index.vue

+ 31
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/common/perproties/LoginCodePerproties.java Целия файл

@@ -0,0 +1,31 @@
1
+package com.community.huiju.common.perproties;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+import org.springframework.boot.context.properties.ConfigurationProperties;
7
+import org.springframework.stereotype.Component;
8
+
9
+import java.util.Map;
10
+
11
+/**
12
+ * 登陆的状态跳转url配置
13
+ * @author weiximei
14
+ */
15
+@ConfigurationProperties(prefix = "login-code-perproties")
16
+@Component
17
+@Data
18
+@AllArgsConstructor
19
+@NoArgsConstructor
20
+public class LoginCodePerproties {
21
+
22
+    private Map<String, String> loginCode;
23
+
24
+    public Map<String, String> getLoginCode() {
25
+        return loginCode;
26
+    }
27
+
28
+    public void setLoginCode(Map<String, String> loginCode) {
29
+        this.loginCode = loginCode;
30
+    }
31
+}

+ 38
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/LoginCodeController.java Целия файл

@@ -0,0 +1,38 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.community.commom.mode.ResponseBean;
4
+import com.community.huiju.common.perproties.LoginCodePerproties;
5
+import com.google.common.collect.Maps;
6
+import io.swagger.annotations.Api;
7
+import org.springframework.beans.factory.annotation.Autowired;
8
+import org.springframework.cloud.context.config.annotation.RefreshScope;
9
+import org.springframework.web.bind.annotation.RequestMapping;
10
+import org.springframework.web.bind.annotation.RequestMethod;
11
+import org.springframework.web.bind.annotation.RequestParam;
12
+import org.springframework.web.bind.annotation.RestController;
13
+
14
+import java.util.Map;
15
+
16
+/**
17
+ * @author weiximei
18
+ */
19
+@RestController
20
+@RefreshScope
21
+@RequestMapping("/")
22
+@Api(value = "根据code获取url API", description = "根据code获取url API")
23
+public class LoginCodeController {
24
+
25
+    @Autowired
26
+    private LoginCodePerproties loginCodePerproties;
27
+
28
+    @RequestMapping(value = "/url", method = RequestMethod.GET)
29
+    public ResponseBean getUrl(@RequestParam String code) {
30
+        ResponseBean responseBean = new ResponseBean();
31
+        String url = loginCodePerproties.getLoginCode().get(code);
32
+        Map<String, String> map = Maps.newHashMap();
33
+        map.put("url", url);
34
+        responseBean.addSuccess(map);
35
+        return responseBean;
36
+    }
37
+
38
+}

+ 3
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java Целия файл

@@ -218,13 +218,14 @@ public class UserController extends BaseController {
218 218
     @ApiImplicitParams({
219 219
             @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
220 220
             @ApiImplicitParam(paramType = "query",dataType = "String",name = "userId",value = "租客或者家属的ID(可选值)"),
221
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "userVerifyId",value = "审核id,只有在 userId 参数生效才有效")
221 222
     })
222 223
     @RequestMapping(value = "/user/info",method = RequestMethod.GET)
223
-    public ResponseBean getUserInfo(@RequestParam(value = "userId",required = false) Integer userId,
224
+    public ResponseBean getUserInfo(@RequestParam(value = "userId",required = false) Integer userId, @RequestParam(value = "userVerifyId", required = false) Integer userVerifyId,
224 225
                                     HttpSession session){
225 226
         ResponseBean response = new ResponseBean();
226 227
         UserElement userElement = getUserElement(session);
227
-        response = iTaUserService.getUserInfo(userElement,userId);
228
+        response = iTaUserService.getUserInfo(userElement,userId, userVerifyId);
228 229
         if ("1".equals(response.getCode())) {
229 230
             // 清空 session
230 231
             removeUserElement(session);

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

@@ -4,6 +4,8 @@ package com.community.huiju.dao;
4 4
 import com.community.huiju.model.TaUserVerify;
5 5
 import org.apache.ibatis.annotations.Mapper;
6 6
 import org.apache.ibatis.annotations.Param;
7
+import org.apache.ibatis.annotations.ResultMap;
8
+import org.apache.ibatis.annotations.Select;
7 9
 
8 10
 import java.util.List;
9 11
 
@@ -29,14 +31,68 @@ public interface TaUserVerifyMapper {
29 31
     List<TaUserVerify> selectByUserId(@Param("userId") Integer userId);
30 32
 
31 33
     /**
32
-     * 根据 用户id、小区id 、 小区、期、栋、单元、楼层、户号 进行条件查询
34
+     * 根据 用户id、小区id 、 期、栋、单元、楼层、户号、审核状态  进行条件查询
33 35
      * @param communityId
34 36
      * @param phaseId
35 37
      * @param buildingId
36 38
      * @param unitId
37 39
      * @param levelId
38 40
      * @param roomNoId
41
+     * @param verifyStatus
39 42
      * @return
40 43
      */
41
-    TaUserVerify selectCommunityAndAddress(Integer userId,Integer communityId,Integer phaseId,Integer buildingId, Integer unitId,Integer levelId,Integer roomNoId);
44
+    List<TaUserVerify> selectCommunityAndAddress(@Param("userId") Integer userId,
45
+                                           @Param("communityId") Integer communityId,
46
+                                           @Param("phaseId") Integer phaseId,
47
+                                           @Param("buildingId") Integer buildingId,
48
+                                           @Param("unitId") Integer unitId,
49
+                                           @Param("levelId") Integer levelId,
50
+                                           @Param("roomNoId") Integer roomNoId,
51
+                                           @Param("verifyStatus") Integer verifyStatus);
52
+
53
+    /**
54
+     * 根据 小区id 、 期、栋、单元、楼层、户号, 角色id(业主), 审核通过(值为1) 进行条件查询
55
+     * @param communityId
56
+     * @param phaseId
57
+     * @param buildingId
58
+     * @param unitId
59
+     * @param levelId
60
+     * @param roomNoId
61
+     * @return
62
+     */
63
+    @ResultMap("BaseResultMap")
64
+    @Select("select * from ta_user_verify where community_id=#{communityId}" +
65
+            " and phase_id=#{phaseId} and building_id=#{buildingId}" +
66
+            " and unit_id=#{unitId} and level_id=#{levelId}" +
67
+            " and room_no_id=#{roomNoId} and role_id=1 and verify_status=1")
68
+    TaUserVerify selectCommunityAndAddressAndRoleId(@Param("communityId") Integer communityId,
69
+                                                    @Param("phaseId") Integer phaseId,
70
+                                                    @Param("buildingId") Integer buildingId,
71
+                                                    @Param("unitId") Integer unitId,
72
+                                                    @Param("levelId") Integer levelId,
73
+                                                    @Param("roomNoId") Integer roomNoId);
74
+
75
+
76
+    /**
77
+     * 根据 用户id、小区id 、 期、栋、单元、楼层、户号、审核状态(不等于2)  进行条件查询
78
+     * @param communityId
79
+     * @param phaseId
80
+     * @param buildingId
81
+     * @param unitId
82
+     * @param levelId
83
+     * @param roomNoId
84
+     * @return
85
+     */
86
+    @ResultMap("BaseResultMap")
87
+    @Select("select * from ta_user_verify where user_id=#{userId} and community_id=#{communityId}" +
88
+            " and phase_id=#{phaseId} and building_id=#{buildingId}" +
89
+            " and unit_id=#{unitId} and level_id=#{levelId}" +
90
+            " and room_no_id=#{roomNoId} and verify_status != 2")
91
+    List<TaUserVerify> selectCommunityAndAddressAndNotVerifyStatus2(@Param("userId") Integer userId,
92
+                                           @Param("communityId") Integer communityId,
93
+                                           @Param("phaseId") Integer phaseId,
94
+                                           @Param("buildingId") Integer buildingId,
95
+                                           @Param("unitId") Integer unitId,
96
+                                           @Param("levelId") Integer levelId,
97
+                                           @Param("roomNoId") Integer roomNoId);
42 98
 }

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

@@ -44,9 +44,27 @@ public interface TpBuildingOwnerInfoMapper {
44 44
     @ResultMap("BaseResultMap")
45 45
     @Select("select * from tp_building_owner_info where community_id=#{communityId}" +
46 46
             " and phase_id=#{phaseId} and building_id=#{buildingId} and unit_id=#{unitId}" +
47
-            " and level_id=#{levelId} and room_no_id=#{roomNoId} and verify_status=1")
47
+            " and level_id=#{levelId} and room_no_id=#{roomNoId}")
48 48
     TpBuildingOwnerInfo selectCommunityIdAndAddress(@Param("communityId") Integer communityId, @Param("phaseId") Integer phaseId,
49 49
                                                     @Param("buildingId") Integer building, @Param("unitId") Integer unitId,
50 50
                                                     @Param("levelId") Integer level, @Param("roomNoId") Integer roomNoId);
51 51
 
52
+    /*
53
+     * 根据 小区,期,楼栋,单元,楼层,户号, 手机号
54
+     * @param communityId
55
+     * @param phase
56
+     * @param building
57
+     * @param unit
58
+     * @param level
59
+     * @param roomNo
60
+     * @return
61
+     */
62
+    @ResultMap("BaseResultMap")
63
+    @Select("select * from tp_building_owner_info where community_id=#{communityId}" +
64
+            " and phase_id=#{phaseId} and building_id=#{buildingId} and unit_id=#{unitId}" +
65
+            " and level_id=#{levelId} and room_no_id=#{roomNoId} and owner_tel=#{phone}")
66
+    TpBuildingOwnerInfo selectCommunityAndAddressAndPhone(@Param("communityId") Integer communityId, @Param("phaseId") Integer phaseId,
67
+                                                          @Param("buildingId") Integer buildingId, @Param("unitId") Integer unitId,
68
+                                                          @Param("levelId") Integer levelId, @Param("roomNoId") Integer roomNoId,
69
+                                                          @Param("phone") String phone);
52 70
 }

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

@@ -134,9 +134,10 @@ public interface ITaUserService {
134 134
      *
135 135
      * @param userElement 当前用户
136 136
      * @param userId      被查询用户, 一般是业主情况下有效, 查的是下面的家属或者租客
137
+     * @param userVerifyId  审核id 只有在 userId 参数存在的情况才有效
137 138
      * @return
138 139
      */
139
-    ResponseBean getUserInfo(UserElement userElement, Integer userId);
140
+    ResponseBean getUserInfo(UserElement userElement, Integer userId, Integer userVerifyId);
140 141
 
141 142
     /**
142 143
      * 游客登录

+ 9
- 6
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoImpl.java Целия файл

@@ -25,6 +25,9 @@ import java.util.Map;
25 25
 @Service
26 26
 public class BuildingOwnerInfoImpl implements IBuildingOwnerInfo {
27 27
 
28
+    @Autowired
29
+    private TaUserMapper taUserMapper;
30
+
28 31
     /**
29 32
      * 栋
30 33
      */
@@ -94,19 +97,19 @@ public class BuildingOwnerInfoImpl implements IBuildingOwnerInfo {
94 97
     public ResponseBean hasBuild(UserElement userElement,  Integer phaseId, Integer buildingId, Integer unitId, Integer levelId, Integer roomNoId) {
95 98
         ResponseBean responseBean = new ResponseBean();
96 99
         // 1.检验该用户关联有没有这个 户号
97
-        TaUserVerify taUserVerify = taUserVerifyMapper.selectCommunityAndAddress(userElement.getId(),userElement.getCommunityId(), phaseId, buildingId, unitId, levelId, roomNoId);
98
-        if (null != taUserVerify) {
100
+        List<TaUserVerify> taUserVerify = taUserVerifyMapper.selectCommunityAndAddress(userElement.getId(),userElement.getCommunityId(), phaseId, buildingId, unitId, levelId, roomNoId, 1);
101
+        if (null != taUserVerify && taUserVerify.size() > 0) {
99 102
             responseBean.addError("您已关联此房产,无法再次关联!");
100 103
             return responseBean;
101 104
         }
102 105
 
103 106
         Map<String,Object> result = Maps.newHashMap();
104 107
 
105
-        // TODO 楼栋资料库查询有变动
106 108
         // 2.检验这个户号是否关联了 户主
107
-        TpBuildingOwnerInfo tpBuildingOwnerInfo = tpBuildingOwnerInfoMapper.selectCommunityIdAndAddress(userElement.getCommunityId(), phaseId, buildingId, unitId, levelId, roomNoId);
108
-        if (null != tpBuildingOwnerInfo) {
109
-            result.put("ownerName",tpBuildingOwnerInfo.getOwnerName());
109
+        TaUserVerify ownerUserVerify = taUserVerifyMapper.selectCommunityAndAddressAndRoleId(userElement.getCommunityId(), phaseId, buildingId, unitId, levelId, roomNoId);
110
+        if (null != ownerUserVerify) {
111
+            TaUser user = taUserMapper.selectByPrimaryKey(ownerUserVerify.getUserId());
112
+            result.put("ownerName",user.getUserName());
110 113
             result.put("roleName", "OWNER");
111 114
             responseBean.addSuccess(result);
112 115
             return responseBean;

+ 5
- 5
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/FaceServicelimpl.java Целия файл

@@ -217,16 +217,16 @@ public class FaceServicelimpl implements FaceServiceI {
217 217
      */
218 218
     public TaUserVerify getTaFaceParentId(UserElement userElement, Integer otherUserId) {
219 219
         // 根据 家属/租客 的id, 和 当前的房产信息进行查询是否有值,有值就说明是 家属/租客
220
-        TaUserVerify todUserVerify = taUserVerifyMapper.selectCommunityAndAddress(otherUserId, userElement.getCommunityId(), userElement.getPhaseId(), userElement.getBuildingId(), userElement.getUnitId(), userElement.getLevelId(), userElement.getRoomNoId());
220
+        List<TaUserVerify> todUserVerify = taUserVerifyMapper.selectCommunityAndAddress(otherUserId, userElement.getCommunityId(), userElement.getPhaseId(), userElement.getBuildingId(), userElement.getUnitId(), userElement.getLevelId(), userElement.getRoomNoId(), 1);
221 221
         // 判断 家属或者租客 属不属于这个业主的下面
222
-        if (null == todUserVerify) {
223
-            throw new WisdomException("您输入的家属或租户ID有误");
222
+        if (null == todUserVerify || todUserVerify.size() == 0) {
223
+            throw new WisdomException("您输入的家属或租户ID有误或审核未通过!");
224 224
         }
225
-        if (!Constant.VERIFY_STATUS.equals(todUserVerify.getVerifyStatus())) {
225
+        if (!Constant.VERIFY_STATUS.equals(todUserVerify.get(0).getVerifyStatus())) {
226 226
             throw new WisdomException("用户房产审核未通过!");
227 227
         }
228 228
 
229
-        return todUserVerify;
229
+        return todUserVerify.get(0);
230 230
     }
231 231
 
232 232
     /**

+ 14
- 10
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Целия файл

@@ -604,8 +604,10 @@ public class SocialServiceImpl implements SocialServiceI {
604 604
         ResponseBean response= new ResponseBean();
605 605
         JSONObject object= JSONObject.parseObject(paramets);
606 606
         JSONArray array= object.getJSONArray("imgArr");
607
-        String[]	reply= array.toArray(new String[]{});
608
-
607
+        String[] reply = null;
608
+        if (null!=array) {
609
+            reply= array.toArray(new String[]{});
610
+        }
609 611
         TpTransactionReply tpTransactionReply= JSONObject.parseObject(paramets,TpTransactionReply.class);
610 612
         tpTransactionReply.setCommunityId(userElement.getCommunityId());
611 613
         tpTransactionReply.setTaUserId(userElement.getId());
@@ -621,14 +623,16 @@ public class SocialServiceImpl implements SocialServiceI {
621 623
         tpTransactionReply.setCreateDate(new Date());
622 624
         tpTransactionReplyMapper.insert(tpTransactionReply);
623 625
 
624
-        for (String img:reply){
625
-            TdImages tdImages= new TdImages();
626
-            tdImages.setImageUrl(img);
627
-            tdImages.setType("reply");
628
-            tdImages.setUuid(tpTransactionReply.getId());
629
-            tdImages.setCreateTime(new Date());
630
-            tdImages.setCreateUser(userElement.getId());
631
-            tdImagesMapper.insert(tdImages);
626
+        if (null!=array) {
627
+            for (String img : reply) {
628
+                TdImages tdImages = new TdImages();
629
+                tdImages.setImageUrl(img);
630
+                tdImages.setType("reply");
631
+                tdImages.setUuid(tpTransactionReply.getId());
632
+                tdImages.setCreateTime(new Date());
633
+                tdImages.setCreateUser(userElement.getId());
634
+                tdImagesMapper.insert(tdImages);
635
+            }
632 636
         }
633 637
         response.addSuccess("成功");
634 638
         return response;

+ 13
- 8
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java Целия файл

@@ -812,7 +812,7 @@ public class TaUserServiceImpl implements ITaUserService {
812 812
     }
813 813
 
814 814
     @Override
815
-    public ResponseBean getUserInfo(UserElement userElement, Integer userId) {
815
+    public ResponseBean getUserInfo(UserElement userElement, Integer userId, Integer userVerifyId) {
816 816
 
817 817
         ResponseBean response = new ResponseBean();
818 818
 
@@ -838,15 +838,20 @@ public class TaUserServiceImpl implements ITaUserService {
838 838
 
839 839
         // 查询 家属或者租客
840 840
         if (null != userId) {
841
-            TaUserVerify todUserVerify = taUserVerifyMapper.selectCommunityAndAddress(userId, userElement.getCommunityId(), userElement.getPhaseId(), userElement.getBuildingId(), userElement.getUnitId(), userElement.getLevelId(), userElement.getRoomNoId());
841
+            List<TaUserVerify> todUserVerify = taUserVerifyMapper.selectCommunityAndAddress(userId, userElement.getCommunityId(), userElement.getPhaseId(), userElement.getBuildingId(), userElement.getUnitId(), userElement.getLevelId(), userElement.getRoomNoId(), null);
842 842
             // 判断 家属或者租客 属不属于这个业主的下面
843
-            if (null == todUserVerify) {
843
+            if (null == todUserVerify || todUserVerify.size() == 0) {
844
+                response.addError("您的下面没有该家属或者租客!");
845
+                return response;
846
+            }
847
+            boolean anyMatch = todUserVerify.stream().anyMatch(e -> e.getId().intValue() == userVerifyId.intValue());
848
+            if (!anyMatch) {
844 849
                 response.addError("您的下面没有该家属或者租客!");
845 850
                 return response;
846 851
             }
847 852
             TaUser todUser = taUserMapper.selectByPrimaryKey(userId);
848
-            todUser.setUserVerifyId(todUserVerify.getId());
849
-            todUser.setCommunityId(todUserVerify.getCommunityId());
853
+            todUser.setUserVerifyId(userVerifyId);
854
+            todUser.setCommunityId(userElement.getCommunityId());
850 855
             user = todUser;
851 856
         }
852 857
 
@@ -1062,9 +1067,9 @@ public class TaUserServiceImpl implements ITaUserService {
1062 1067
 
1063 1068
         TaUserVO userVO = new TaUserVO();
1064 1069
         BeanTools.copyProperties(user, userVO);
1065
-        TaUserVerify userVerify = taUserVerifyMapper.selectCommunityAndAddress(user.getId(), userElement.getCommunityId(), userElement.getPhaseId(), userElement.getBuildingId(), userElement.getUnitId(), userElement.getLevelId(), userElement.getRoomNoId());
1066
-        if (null != userVerify) {
1067
-            TaFace face = taFaceMapper.getByUserVerifyId(userVerify.getId());
1070
+        List<TaUserVerify> userVerifyList = taUserVerifyMapper.selectCommunityAndAddress(user.getId(), userElement.getCommunityId(), userElement.getPhaseId(), userElement.getBuildingId(), userElement.getUnitId(), userElement.getLevelId(), userElement.getRoomNoId(), 1);
1071
+        if (null != userVerifyList && userVerifyList.size() > 0) {
1072
+            TaFace face = taFaceMapper.getByUserVerifyId(userVerifyList.get(0).getId());
1068 1073
             if (null == face) {
1069 1074
                 userVO.setFace("register");
1070 1075
             } else {

+ 91
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserVerifyServicelmpl.java Целия файл

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
5 5
 import com.community.commom.mode.ResponseBean;
6 6
 import com.community.commom.session.UserElement;
7 7
 import com.community.huiju.dao.*;
8
+import com.community.huiju.exception.WisdomException;
8 9
 import com.community.huiju.model.*;
9 10
 import com.community.huiju.service.TaUserVerifyServicel;
10 11
 import com.community.huiju.vo.TaUserVO;
@@ -12,6 +13,7 @@ import lombok.extern.slf4j.Slf4j;
12 13
 import org.springframework.beans.factory.annotation.Autowired;
13 14
 import org.springframework.stereotype.Service;
14 15
 
16
+import java.time.LocalDateTime;
15 17
 import java.util.Date;
16 18
 import java.util.List;
17 19
 
@@ -103,6 +105,16 @@ public class TaUserVerifyServicelmpl implements TaUserVerifyServicel {
103 105
         String roleName = jsonObject.getString("roleName");
104 106
         TaSysRole sysRole = taSysRoleMapper.selectByRoleName(roleName);
105 107
 
108
+        // 校验该用户是否已经提交了一个当前房产的审核, 包含 待审核和已审核通过
109
+        List<TaUserVerify> userVerifyList = taUserVerifyMapper.selectCommunityAndAddressAndNotVerifyStatus2(userElement.getId(), userElement.getCommunityId(),
110
+                userElement.getPhaseId(), userElement.getBuildingId(), userElement.getUnitId(),
111
+                userElement.getLevelId(), userElement.getRoomNoId());
112
+        if (null != userVerifyList && userVerifyList.size() > 0) {
113
+            responseBean.addError("您已提交了这个房产的审核!请等待业主或者物业审核后,在进行下一步操作!");
114
+            return responseBean;
115
+        }
116
+
117
+
106 118
         // 查询 期/栋/单元/楼层/户号 -> 设置 相应 id 和 name
107 119
         TpPhase phase = tpPhaseMapper.selectByPrimaryKey(taUserVerify.getPhaseId());
108 120
         TpBuilding building = tpBuildingMapper.selectByPrimaryKey(taUserVerify.getBuildingId());
@@ -223,10 +235,89 @@ public class TaUserVerifyServicelmpl implements TaUserVerifyServicel {
223 235
             userVerify.setVerifyStatus(userVerifyStatus);
224 236
             userVerify.setRemark(remark);
225 237
             taUserVerifyMapper.updateByPrimaryKeySelective(userVerify);
238
+
239
+            // 获取这个被审核的用户
240
+            TaUser user = taUserMapper.selectByPrimaryKey(userVerify.getUserId());
241
+
242
+            // 往楼栋资料库插入数据
243
+            // 校验楼栋信息表
244
+            TpBuildingOwnerInfo selectBuild = getBuildingInfo(userElement, user.getLoginName());
245
+            if (null == selectBuild) {
246
+                // 插入楼栋信息数据
247
+                insertTpBuildingOwnerInfo(userElement, user, null);
248
+            }
249
+
226 250
             responseBean.addSuccess("操作成功!");
227 251
             return responseBean;
228 252
         }
229 253
         responseBean.addError("操作失败!");
230 254
         return responseBean;
231 255
     }
256
+
257
+    /**
258
+     * 查询 楼栋信息
259
+     *      根据小区Id, 栋,单元,楼层,房号, 手机号
260
+     * @param userElement
261
+     * @param phone
262
+     * @return
263
+     */
264
+    private TpBuildingOwnerInfo getBuildingInfo(UserElement userElement, String phone) {
265
+
266
+        TpBuildingOwnerInfo selectBuild = tpBuildingOwnerInfoMapper.selectCommunityAndAddressAndPhone(userElement.getCommunityId(),
267
+                userElement.getPhaseId(), userElement.getBuildingId(), userElement.getUnitId(), userElement.getLevelId(),
268
+                userElement.getRoomNoId(), phone);
269
+
270
+        return selectBuild;
271
+    }
272
+
273
+    /**
274
+     * 插入 楼栋资料库
275
+     *
276
+     * @param userElement
277
+     * @param user
278
+     * @param userId 创建人
279
+     */
280
+    private TpBuildingOwnerInfo insertTpBuildingOwnerInfo (UserElement userElement, TaUser user, Integer userId) {
281
+        TpBuildingOwnerInfo tpBuildingOwnerInfo = new TpBuildingOwnerInfo();
282
+        // 查询 期/楼栋/单元/层/户号
283
+        TpPhase phase = tpPhaseMapper.selectByPrimaryKey(userElement.getPhaseId());
284
+        TpBuilding building = tpBuildingMapper.selectByPrimaryKey(userElement.getBuildingId());
285
+        TpUnit unit = tpUnitMapper.selectByPrimaryKey(userElement.getUnitId());
286
+        TpLevel level = tpLevelMapper.selectByPrimaryKey(userElement.getLevelId());
287
+        TpRoomNo roomNo = tpRoomNoMapper.selectByPrimaryKey(userElement.getRoomNoId());
288
+
289
+
290
+        // 主键是自增的, 所以设置为 null
291
+        tpBuildingOwnerInfo.setId(null);
292
+        tpBuildingOwnerInfo.setPhaseId(phase.getId());
293
+        tpBuildingOwnerInfo.setPhaseName(phase.getName());
294
+        tpBuildingOwnerInfo.setBuildingId(building.getId());
295
+        tpBuildingOwnerInfo.setBuildingName(building.getName());
296
+        tpBuildingOwnerInfo.setUnitId(unit.getId());
297
+        tpBuildingOwnerInfo.setUnitName(unit.getName());
298
+        tpBuildingOwnerInfo.setLevelId(level.getId());
299
+        tpBuildingOwnerInfo.setLevelName(level.getName());
300
+        tpBuildingOwnerInfo.setRoomNoId(roomNo.getId());
301
+        tpBuildingOwnerInfo.setRoomNoName(roomNo.getName());
302
+        tpBuildingOwnerInfo.setOwnerName(user.getUserName());
303
+        tpBuildingOwnerInfo.setOwnerTel(user.getLoginName());
304
+        tpBuildingOwnerInfo.setGender(user.getGender());
305
+        // tpBuildingOwnerInfo.setUpdateUser(userId);
306
+        tpBuildingOwnerInfo.setUpdateDate(new Date());
307
+        tpBuildingOwnerInfo.setCreateDate(new Date());
308
+        // tpBuildingOwnerInfo.setCreateUser(userId);
309
+        tpBuildingOwnerInfo.setVerifyStatus("1");
310
+        tpBuildingOwnerInfo.setPairStatus("1");
311
+
312
+        // 添加的时候, 默认是当前操作的小区
313
+        tpBuildingOwnerInfo.setCommunityId(userElement.getCommunityId());
314
+
315
+        int row = tpBuildingOwnerInfoMapper.insertSelective(tpBuildingOwnerInfo);
316
+        if (row <= 0) {
317
+            log.error("添加操作! 楼栋业主信息表 失败!");
318
+            throw new WisdomException("操作失败!");
319
+        }
320
+        return tpBuildingOwnerInfo;
321
+    }
322
+
232 323
 }

+ 11
- 0
CODE/smart-community/app-api/src/main/resources/application.yml Целия файл

@@ -29,3 +29,14 @@ welcome:
29 29
   communityId: 83
30 30
   url: http://127.0.0.1:8823/push/face
31 31
 
32
+# 登陆的状态跳转url配置
33
+login-code-perproties:
34
+  login-code:
35
+    1000: url # 无关联房产
36
+    1001: url # 关联一个审核通过的房产
37
+    1002: url # 关联一个待审核房产
38
+    1003: url # 关联一个审核未通过房产
39
+    1004: url  # 有多个关联房产
40
+    1005: url # 该房产,暂无审核通过的业主!
41
+    1006: url # 无关联账号!
42
+    1007: url # 未注册!

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

@@ -260,5 +260,9 @@
260 260
     and unit_id = #{unitId,jdbcType=INTEGER}
261 261
     and level_id = #{levelId,jdbcType=INTEGER}
262 262
     and room_no_id = #{roomNoId,jdbcType=INTEGER}
263
+    <if test="verifyStatus != null and verifyStatus != ''">
264
+      and verify_status = #{verifyStatus}
265
+    </if>
266
+
263 267
   </select>
264 268
 </mapper>

+ 2
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/common/base/QRCode.java Целия файл

@@ -36,9 +36,9 @@ public class QRCode {
36 36
      * @throws WriterException
37 37
      * @throws IOException
38 38
      */
39
-    public static InputStream encode(String tpActivityId) throws WriterException, IOException {
39
+    public static InputStream encode(String url, String tpActivityId) throws WriterException, IOException {
40 40
         // 内容
41
-        String content = "http://jhhhhh?activeId=" + tpActivityId;
41
+        String content = url + tpActivityId;
42 42
         // 图像宽度
43 43
         int width = 200;
44 44
         // 图像高度

+ 26
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/common/perproties/QRCodePerproties.java Целия файл

@@ -0,0 +1,26 @@
1
+package com.community.huiju.common.perproties;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+import lombok.NoArgsConstructor;
6
+import org.springframework.boot.context.properties.ConfigurationProperties;
7
+import org.springframework.stereotype.Component;
8
+
9
+/**
10
+ * version V1.0
11
+ * class_name: $METHOD_NAME$
12
+ * param: $METHOD_PARAM$
13
+ * describe: TODO
14
+ * creat_user:fannaixi
15
+ * creat_time: 2019/4/12
16
+ **/
17
+@Data
18
+@AllArgsConstructor
19
+@NoArgsConstructor
20
+@ConfigurationProperties(prefix = "qr-code")
21
+@Component
22
+public class QRCodePerproties {
23
+
24
+    private String url;
25
+
26
+}

+ 8
- 7
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoServiceImpl.java Целия файл

@@ -734,16 +734,17 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
734 734
     @Transactional(rollbackFor = Exception.class)
735 735
     public ResponseBean deleteIds(List<Integer> ids, Integer propertyUserId) {
736 736
 
737
+        /**
738
+         * 楼栋资料删除的是 审核表里面的数据
739
+         */
740
+
737 741
         ResponseBean responseBean = new ResponseBean();
738 742
         ids.stream().forEach(e->{
739
-            TpBuildingOwnerInfo buildingOwnerInfo = tpBuildingOwnerInfoMapper.selectById(e);
740
-            if ("1".equals(buildingOwnerInfo.getVerifyStatus())) {
741
-                throw new WisdomException("不能删除已认证的楼栋资料!");
742
-                /**
743
-                 * 批量删除的时候,只要存在一个已认证的楼栋资料, 就停止删除!
744
-                 */
743
+            TaUserVerify userVerify = taUserVerifyMapper.selectById(e);
744
+            if ("1".equals(userVerify.getVerifyStatus())) {
745
+                throw new WisdomException("不能删除已审核的资料!");
745 746
             }
746
-            tpBuildingOwnerInfoMapper.deleteById(buildingOwnerInfo.getId());
747
+            taUserVerifyMapper.deleteById(e);
747 748
         });
748 749
 
749 750
         responseBean.addSuccess("操作成功!");

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

@@ -11,6 +11,7 @@ import com.community.commom.mode.ResponseBean;
11 11
 import com.community.commom.session.UserElement;
12 12
 import com.community.commom.utils.BeanTools;
13 13
 import com.community.huiju.common.base.QRCode;
14
+import com.community.huiju.common.perproties.QRCodePerproties;
14 15
 import com.community.huiju.dao.MessageMapper;
15 16
 import com.community.huiju.dao.TaUserMapper;
16 17
 import com.community.huiju.dao.TdImagesMapper;
@@ -70,6 +71,10 @@ public class TpActivityServiceImpl extends ServiceImpl<TpActivityMapper, TpActiv
70 71
 
71 72
     @Autowired
72 73
     private ImageServiceI imageServiceI;
74
+
75
+    @Autowired
76
+    private QRCodePerproties qrCodePerproties;
77
+
73 78
     @Override
74 79
     public ResponseBean listQuery(String parameter, UserElement userElement) {
75 80
         ResponseBean responseBean = new ResponseBean();
@@ -340,7 +345,7 @@ public class TpActivityServiceImpl extends ServiceImpl<TpActivityMapper, TpActiv
340 345
 
341 346
         if (radio==1){
342 347
             try {
343
-                InputStream inputStream= QRCode.encode(tpActivity.getId()+"");
348
+                InputStream inputStream= QRCode.encode(qrCodePerproties.getUrl(), tpActivity.getId()+"");
344 349
                 String codeUrl= imageServiceI.getImageUrl(inputStream);
345 350
                 TdImages tdImages= new TdImages();
346 351
                 tdImages.setImageUrl(codeUrl);

+ 4
- 0
CODE/smart-community/property-api/src/main/resources/application.yml Целия файл

@@ -11,3 +11,7 @@ mybatis-plus:
11 11
   configuration:
12 12
     log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用
13 13
   mapper-locations: classpath:mapper/*.xml
14
+
15
+# 二维码生成地址
16
+qr-code:
17
+  url: http://jhhhhh?activeId=

+ 6
- 0
VUECODE/smart-property-manage/src/views/building/edi/index.vue Целия файл

@@ -4,6 +4,12 @@
4 4
       <el-form-item label="手机号" prop="ownerTel" placeholder="手机号">
5 5
         <span>{{ ownerTel }}</span>
6 6
       </el-form-item>
7
+      <el-form-item>
8
+        <span style="color: #99a9bf;">
9
+          若想修改业主登录手机号,需要业主自己登录APP在个人中心修改。或者联系荟房网络运营人员核实后修改,因为此手机号可能在其他社区在用。
10
+          若想修改成员为其他成员的手机号,请删除此成员后添加新成员。
11
+        </span>
12
+      </el-form-item>
7 13
       <el-form-item label="身份" prop="roleId">
8 14
         <el-select v-model="listQuery.roleId" placeholder="身份">
9 15
           <el-option :disabled="roleDisabled" label="业主" value="1" />