dingxin пре 6 година
родитељ
комит
0e02625ac3
26 измењених фајлова са 976 додато и 117 уклоњено
  1. 0
    6
      CODE/smart-community/app-api/pom.xml
  2. 3
    3
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java
  3. 26
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java
  4. 4
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/vo/TaUserVO.java
  5. 15
    0
      CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java
  6. BIN
      CODE/smart-community/community-common/target/community-common-0.0.1.jar
  7. 4
    0
      CODE/smart-community/community-common/target/maven-archiver/pom.properties
  8. 32
    0
      CODE/smart-community/community-common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  9. 29
    0
      CODE/smart-community/community-common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
  10. 122
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/UserVerifyController.java
  11. 15
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TaUserVerifyMapper.java
  12. 4
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TaUser.java
  13. 26
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TaUserVerify.java
  14. 33
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITaUserVerifyService.java
  15. 1
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoServiceImpl.java
  16. 75
    0
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TaUserVerifyServiceImpl.java
  17. 25
    0
      CODE/smart-community/property-api/src/main/resources/mapper/TaUserVerifyMapper.xml
  18. 13
    13
      CODE/smart-community/property-api/src/main/resources/mapper/TpBuildingOwnerInfoMapper.xml
  19. 2
    11
      CODE/smart-community/property-api/src/test/java/com/community/huiju/DemoApplicationTests.java
  20. 2
    2
      VUECODE/smart-property-manage/src/api/buildingOwnerInfo.js
  21. 43
    0
      VUECODE/smart-property-manage/src/api/user.js
  22. 28
    1
      VUECODE/smart-property-manage/src/store/modules/user.js
  23. 212
    28
      VUECODE/smart-property-manage/src/views/building/add/index.vue
  24. 197
    3
      VUECODE/smart-property-manage/src/views/building/audit/index.vue
  25. 46
    46
      VUECODE/smart-property-manage/src/views/building/batch/batchImport.vue
  26. 19
    0
      VUECODE/smart-property-manage/src/views/building/index.vue

+ 0
- 6
CODE/smart-community/app-api/pom.xml Прегледај датотеку

@@ -195,12 +195,6 @@
195 195
             <groupId>mysql</groupId>
196 196
             <artifactId>mysql-connector-java</artifactId>
197 197
         </dependency>
198
-        <dependency>
199
-            <groupId>org.springframework</groupId>
200
-            <artifactId>spring-context</artifactId>
201
-            <version>5.1.5.RELEASE</version>
202
-            <scope>compile</scope>
203
-        </dependency>
204 198
 
205 199
 
206 200
     </dependencies>

+ 3
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java Прегледај датотеку

@@ -280,13 +280,13 @@ public class UserController extends BaseController {
280 280
         return responseBean;
281 281
     }
282 282
 
283
-    @RequestMapping(value = "/user/tenantAndRelation/delete", method = RequestMethod.DELETE)
283
+    @RequestMapping(value = "/user/tenantAndRelation/delete/{userVerifyId}", method = RequestMethod.DELETE)
284 284
     @ApiOperation(value = "业主删除 家属或者租客", notes = "业主删除 家属或者租客")
285 285
     @ApiImplicitParams({
286
-            @ApiImplicitParam(paramType = "form", dataTypeClass = Integer.class, name = "userVerifyId", value = "审核 id"),
286
+            @ApiImplicitParam(paramType = "path", dataTypeClass = Integer.class, name = "userVerifyId", value = "审核 id"),
287 287
             @ApiImplicitParam(paramType = "header",dataTypeClass = String.class,name = "X-Auth-Token",value = "Token")
288 288
     })
289
-    public ResponseBean deleteTenantAndRelation(HttpSession session, @RequestParam("userVerifyId") Integer userVerifyId) {
289
+    public ResponseBean deleteTenantAndRelation(HttpSession session, @PathVariable("userVerifyId") Integer userVerifyId) {
290 290
         ResponseBean responseBean = new ResponseBean();
291 291
         UserElement userElement = getUserElement(session);
292 292
         responseBean = iTaUserService.deleteTenantAndRelation(userElement, userVerifyId);

+ 26
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java Прегледај датотеку

@@ -176,6 +176,15 @@ public class TaUserServiceImpl implements ITaUserService {
176 176
         TaUserVO taUserVO = new TaUserVO();
177 177
         BeanUtils.copyProperties(currentUser, taUserVO);
178 178
 
179
+        // 默认未绑定微信
180
+        taUserVO.setBindingWX(Constant.NO_BINDING_WX);
181
+
182
+        // 如果存在值,则已绑定微信
183
+        if (StringUtils.isNotBlank(currentUser.getOpenid())) {
184
+            taUserVO.setBindingWX(Constant.BINDING_WX);
185
+        }
186
+
187
+
179 188
         // 校验房产
180 189
         List<TaUserVerify> taUserVerifies = taUserVerifyMapper.selectByUserId(currentUser.getId());
181 190
         // 无关联房产
@@ -824,6 +833,9 @@ public class TaUserServiceImpl implements ITaUserService {
824 833
             return response;
825 834
         }
826 835
 
836
+        user.setUserVerifyId(userElement.getUserVerifyId());
837
+        user.setCommunityId(userElement.getCommunityId());
838
+
827 839
         // 查询 家属或者租客
828 840
         if (null != userId) {
829 841
             TaUserVerify todUserVerify = taUserVerifyMapper.selectCommunityAndAddress(userId, userElement.getCommunityId(), userElement.getPhaseId(), userElement.getBuildingId(), userElement.getUnitId(), userElement.getLevelId(), userElement.getRoomNoId());
@@ -833,11 +845,12 @@ public class TaUserServiceImpl implements ITaUserService {
833 845
                 return response;
834 846
             }
835 847
             TaUser todUser = taUserMapper.selectByPrimaryKey(userId);
848
+            todUser.setUserVerifyId(todUserVerify.getId());
849
+            todUser.setCommunityId(todUserVerify.getCommunityId());
836 850
             user = todUser;
837 851
         }
838 852
 
839
-        user.setUserVerifyId(userElement.getUserVerifyId());
840
-        user.setCommunityId(userElement.getCommunityId());
853
+
841 854
         TaUserVO userVO = new TaUserVO();
842 855
 
843 856
         // 根据用户id, 获取 用户的住址, 人脸是否认证, 角色
@@ -858,6 +871,17 @@ public class TaUserServiceImpl implements ITaUserService {
858 871
 
859 872
         BeanTools.copyProperties(user, userVO);
860 873
 
874
+        // 房产状态
875
+        userVO.setVerifyStatus(user.getVerifyStatus());
876
+
877
+        // 默认未绑定微信
878
+        userVO.setBindingWX(Constant.NO_BINDING_WX);
879
+
880
+        // 如果存在值,则已绑定微信
881
+        if (StringUtils.isNotBlank(user.getOpenid())) {
882
+            userVO.setBindingWX(Constant.BINDING_WX);
883
+        }
884
+
861 885
         /**
862 886
          * 获取楼栋信息,不能 根据 app用户表的楼栋资料库id 来获取,要根据当前登录的 房产id 来查询 app审核表  获取,用户 session 里面有 房产id
863 887
          */

+ 4
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/vo/TaUserVO.java Прегледај датотеку

@@ -34,7 +34,7 @@ public class TaUserVO {
34 34
     /** 性别 **/
35 35
     private String gender;
36 36
 
37
-    /** 认证状态 **/
37
+    /** 房产认证状态 **/
38 38
     private String verifyStatus;
39 39
 
40 40
     /** 角色 **/
@@ -87,4 +87,7 @@ public class TaUserVO {
87 87
 
88 88
     /**  户号id **/
89 89
     private Integer roomNoId;
90
+
91
+    /** 是否绑定了微信 **/
92
+    private Integer bindingWX;
90 93
 }

+ 15
- 0
CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java Прегледај датотеку

@@ -219,4 +219,19 @@ public class Constant {
219 219
      * 人员状态  无效
220 220
      */
221 221
     public static final String INVALID_STATUS = "0";
222
+
223
+    /** 已绑定微信 **/
224
+    public static final Integer BINDING_WX = 1;
225
+
226
+    /** 未绑定微信 **/
227
+    public static final Integer NO_BINDING_WX = 0;
228
+
229
+    /** 用户审核通过 **/
230
+    public static final String APPROVED = "1";
231
+
232
+    /** 用户审核不通过 **/
233
+    public static final String REJECTED = "2";
234
+
235
+    /** 用户待审核 **/
236
+    public static final String TO_AUDIT = "0";
222 237
 }

BIN
CODE/smart-community/community-common/target/community-common-0.0.1.jar Прегледај датотеку


+ 4
- 0
CODE/smart-community/community-common/target/maven-archiver/pom.properties Прегледај датотеку

@@ -0,0 +1,4 @@
1
+#Created by Apache Maven 3.3.9
2
+version=0.0.1
3
+groupId=com.community
4
+artifactId=community-common

+ 32
- 0
CODE/smart-community/community-common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst Прегледај датотеку

@@ -0,0 +1,32 @@
1
+com\community\commom\redis\RedisTemplate.class
2
+com\community\commom\redis\RedisConfiguration.class
3
+com\community\commom\utils\OssUtil.class
4
+com\community\commom\redis\SingleRedisTemplate.class
5
+com\community\commom\utils\EnumUtils.class
6
+com\community\commom\hk\HttpClientSSLUtils$2.class
7
+com\community\commom\redis\RedisJsonSerializer.class
8
+com\community\commom\uuid\IdGen.class
9
+com\community\commom\utils\BeanTools.class
10
+com\community\commom\hk\HttpClientSSLUtils.class
11
+com\community\commom\session\UserElement.class
12
+com\community\commom\utils\CommonUtils.class
13
+com\community\commom\redis\RedisSerializer.class
14
+com\community\commom\utils\StringConverter.class
15
+com\community\commom\mode\ResponseBean.class
16
+com\community\commom\utils\DESUtils.class
17
+com\community\commom\redis\FastJsonSerializer.class
18
+com\community\commom\utils\DateUtils.class
19
+com\community\commom\utils\HttpClientUtils.class
20
+com\community\commom\constant\Constant.class
21
+com\community\commom\utils\CookieUtil.class
22
+com\community\commom\mode\HkResponseBean.class
23
+com\community\commom\ailiyun\AESDecode.class
24
+com\community\commom\uuid\IdGen$IdGenHolder.class
25
+com\community\commom\utils\PayPriceUtils.class
26
+com\community\commom\hk\HttpClientSSLUtils$1.class
27
+com\community\commom\utils\MD5Utils.class
28
+com\community\commom\redis\RedisObjectSerializer.class
29
+com\community\commom\utils\QRCodeGeneratorUtils.class
30
+com\community\commom\redis\SerializationFailedException.class
31
+com\community\commom\hk\Digests.class
32
+com\community\commom\utils\AccountValidatorUtil.class

+ 29
- 0
CODE/smart-community/community-common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst Прегледај датотеку

@@ -0,0 +1,29 @@
1
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\redis\RedisJsonSerializer.java
2
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\ailiyun\AESDecode.java
3
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\hk\HttpClientSSLUtils.java
4
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\PayPriceUtils.java
5
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\DateUtils.java
6
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\HttpClientUtils.java
7
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\DESUtils.java
8
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\redis\RedisSerializer.java
9
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\BeanTools.java
10
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\OssUtil.java
11
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\redis\RedisObjectSerializer.java
12
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\EnumUtils.java
13
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\redis\RedisTemplate.java
14
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\mode\HkResponseBean.java
15
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\redis\SerializationFailedException.java
16
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\CommonUtils.java
17
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\MD5Utils.java
18
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\session\UserElement.java
19
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\redis\SingleRedisTemplate.java
20
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\hk\Digests.java
21
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\QRCodeGeneratorUtils.java
22
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\redis\RedisConfiguration.java
23
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\AccountValidatorUtil.java
24
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\uuid\IdGen.java
25
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\mode\ResponseBean.java
26
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\StringConverter.java
27
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\redis\FastJsonSerializer.java
28
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\constant\Constant.java
29
+E:\weiximei\smartCommunity\CODE\smart-community\community-common\src\main\java\com\community\commom\utils\CookieUtil.java

+ 122
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/controller/UserVerifyController.java Прегледај датотеку

@@ -0,0 +1,122 @@
1
+package com.community.huiju.controller;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.session.UserElement;
6
+import com.community.huiju.common.base.BaseController;
7
+import com.community.huiju.model.TaUser;
8
+import com.community.huiju.model.TaUserVerify;
9
+import com.community.huiju.model.TpBuildingOwnerInfo;
10
+import com.community.huiju.service.IBuildingOwnerInfoService;
11
+import com.community.huiju.service.ITaUserService;
12
+import com.community.huiju.service.ITaUserVerifyService;
13
+import com.google.common.collect.Maps;
14
+import io.swagger.annotations.Api;
15
+import io.swagger.annotations.ApiImplicitParam;
16
+import io.swagger.annotations.ApiImplicitParams;
17
+import io.swagger.annotations.ApiOperation;
18
+import org.springframework.beans.factory.annotation.Autowired;
19
+import org.springframework.cloud.context.config.annotation.RefreshScope;
20
+import org.springframework.web.bind.annotation.*;
21
+
22
+import javax.servlet.http.HttpSession;
23
+import java.util.Map;
24
+
25
+@RestController
26
+@RefreshScope
27
+@RequestMapping("/")
28
+@Api(value = "审核用户API", description = "审核用户API")
29
+public class UserVerifyController extends BaseController {
30
+
31
+    @Autowired
32
+    private ITaUserVerifyService iTaUserVerifyService;
33
+
34
+    @Autowired
35
+    private ITaUserService iTaUserService;
36
+
37
+    @Autowired
38
+    private IBuildingOwnerInfoService iBuildingOwnerInfoService;
39
+
40
+    @RequestMapping(value = "/user/verify/all", method = RequestMethod.GET)
41
+    @ApiOperation(value = "获取待审核的用户列表", notes = "获取待审核的用户列表")
42
+    @ApiImplicitParams({
43
+            @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "phone", value = "手机号"),
44
+            @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "userName", value = "用户名"),
45
+            @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "idCard", value = "身份证"),
46
+            @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "pageNum", value = "第几页"),
47
+            @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "pageSize", value = "一页多少行"),
48
+    })
49
+    public ResponseBean getAll(@RequestParam(value = "phone", required = false) String phone,
50
+                               @RequestParam(value = "userName", required = false) String userName,
51
+                               @RequestParam(value = "idCard", required = false) String idCard,
52
+                               @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
53
+                               @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
54
+
55
+        ResponseBean responseBean = new ResponseBean();
56
+        responseBean = iTaUserVerifyService.selectAll(phone, userName, idCard, pageNum, pageSize);
57
+        return responseBean;
58
+    }
59
+
60
+    @RequestMapping(value = "/user/verify/audit/{userVerifyId}", method = RequestMethod.PUT)
61
+    @ApiOperation(value = "审核用户", notes = "审核用户")
62
+    @ApiImplicitParams({
63
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token"),
64
+            @ApiImplicitParam(paramType = "path", dataTypeClass = String.class, name = "userVerifyId", value = "审核id"),
65
+            @ApiImplicitParam(paramType = "query", dataTypeClass = Boolean.class, name = "verifyStatus", value = "true通过;false不通过"),
66
+    })
67
+    public ResponseBean getAll(@PathVariable("userVerifyId") Integer userVerifyId,
68
+                               @RequestParam("verifyStatus") Boolean verifyStatus,
69
+                               HttpSession session) {
70
+
71
+        ResponseBean responseBean = new ResponseBean();
72
+        UserElement userElement = getUserElement(session);
73
+        responseBean = iTaUserVerifyService.auditUser(userElement, userVerifyId, verifyStatus);
74
+        return responseBean;
75
+    }
76
+
77
+    @RequestMapping(value = "/ta/user/has", method = RequestMethod.GET)
78
+    @ApiOperation(value = "校验移动端手机号是否注册以及业主", notes = "校验移动端手机号是否注册以及业主")
79
+    @ApiImplicitParams({
80
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "token"),
81
+            @ApiImplicitParam(paramType = "query", dataTypeClass = String.class, name = "ownerTel", value = "审核id"),
82
+    })
83
+    public ResponseBean getAll(@RequestParam("ownerTel") String ownerTel,
84
+                               @RequestParam("phaseId") Integer phaseId,
85
+                               @RequestParam("buildingId")Integer buildingId,
86
+                               @RequestParam("unitId")Integer unitId,
87
+                               @RequestParam("levelId")Integer levelId,
88
+                               @RequestParam("roomNoId")Integer roomNoId,
89
+                               HttpSession session) {
90
+
91
+        ResponseBean responseBean = new ResponseBean();
92
+        UserElement userElement = getUserElement(session);
93
+        QueryWrapper<TaUser> queryWrapper = new QueryWrapper<>();
94
+        queryWrapper.eq("login_name", ownerTel);
95
+        TaUser user = iTaUserService.getOne(queryWrapper);
96
+        if (null == user) {
97
+            responseBean.addError("未注册");
98
+            return responseBean;
99
+        }
100
+
101
+        Map<String, Object> map = Maps.newHashMap();
102
+        map.put("info", user);
103
+        // true 标识业主 false 非业主
104
+        map.put("boolRole", false);
105
+
106
+        QueryWrapper<TpBuildingOwnerInfo> buildingOwnerInfoQueryWrapper = new QueryWrapper<>();
107
+        buildingOwnerInfoQueryWrapper.eq("phase_id", phaseId);
108
+        buildingOwnerInfoQueryWrapper.eq("building_id", buildingId);
109
+        buildingOwnerInfoQueryWrapper.eq("unit_id", unitId);
110
+        buildingOwnerInfoQueryWrapper.eq("level_id", levelId);
111
+        buildingOwnerInfoQueryWrapper.eq("room_no_id", roomNoId);
112
+        buildingOwnerInfoQueryWrapper.eq("owner_tel", ownerTel);
113
+        TpBuildingOwnerInfo buildingOwnerInfo = iBuildingOwnerInfoService.getOne(buildingOwnerInfoQueryWrapper);
114
+        if (null == buildingOwnerInfo) {
115
+            map.put("boolRole", true);
116
+        }
117
+
118
+        responseBean.addSuccess(map);
119
+        return responseBean;
120
+    }
121
+
122
+}

+ 15
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/TaUserVerifyMapper.java Прегледај датотеку

@@ -1,8 +1,13 @@
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;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
4 6
 import com.community.huiju.model.TaUserVerify;
5 7
 import org.apache.ibatis.annotations.Mapper;
8
+import org.apache.ibatis.annotations.Param;
9
+
10
+import java.util.List;
6 11
 
7 12
 /**
8 13
  * <p>
@@ -15,4 +20,14 @@ import org.apache.ibatis.annotations.Mapper;
15 20
 @Mapper
16 21
 public interface TaUserVerifyMapper extends BaseMapper<TaUserVerify> {
17 22
 
23
+    /**
24
+     * 根据 手机号 、用户名、身份证
25
+     * @param page
26
+     * @param phone
27
+     * @param userName
28
+     * @param idCard
29
+     * @return
30
+     */
31
+    IPage<TaUserVerify> selectAllByPhoneAndUserNameAndIdCard(Page page, @Param("phone") String phone, @Param("userName") String userName, @Param("idCard") String idCard);
32
+
18 33
 }

+ 4
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TaUser.java Прегледај датотеку

@@ -130,5 +130,9 @@ public class TaUser implements Serializable {
130 130
      */
131 131
     private String faceStatus;
132 132
 
133
+    /**
134
+     * 身份证号
135
+     */
136
+    private String idCard;
133 137
 
134 138
 }

+ 26
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/model/TaUserVerify.java Прегледај датотеку

@@ -1,6 +1,7 @@
1 1
 package com.community.huiju.model;
2 2
 
3 3
 import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableField;
4 5
 import com.baomidou.mybatisplus.annotation.TableId;
5 6
 import lombok.Data;
6 7
 import lombok.EqualsAndHashCode;
@@ -107,5 +108,30 @@ public class TaUserVerify implements Serializable {
107 108
      */
108 109
     private String verifyName;
109 110
 
111
+    // =============================================
112
+
113
+    /**
114
+     * 手机号
115
+     */
116
+    @TableField(exist = false)
117
+    private String phone;
118
+
119
+    /**
120
+     * 用户姓名
121
+     */
122
+    @TableField(exist = false)
123
+    private String userName;
124
+
125
+    /**
126
+     * 身份证
127
+     */
128
+    @TableField(exist = false)
129
+    private String idCard;
130
+
131
+    /**
132
+     * 性别 1:男   2:女
133
+     */
134
+    @TableField(exist = false)
135
+    private String gender;
110 136
 
111 137
 }

+ 33
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/ITaUserVerifyService.java Прегледај датотеку

@@ -0,0 +1,33 @@
1
+package com.community.huiju.service;
2
+
3
+import com.baomidou.mybatisplus.extension.service.IService;
4
+import com.community.commom.mode.ResponseBean;
5
+import com.community.commom.session.UserElement;
6
+import com.community.huiju.model.TaUserVerify;
7
+
8
+/**
9
+ * 审核 业务
10
+ */
11
+public interface ITaUserVerifyService extends IService<TaUserVerify> {
12
+
13
+    /**
14
+     * 查询 所有审核数据
15
+     * @param phone
16
+     * @param userName
17
+     * @param idCard
18
+     * @param pageNum
19
+     * @param pageSize
20
+     * @return
21
+     */
22
+    ResponseBean selectAll(String phone, String userName, String idCard, Integer pageNum, Integer pageSize);
23
+
24
+    /**
25
+     * 审核 用户
26
+     * @param userElement
27
+     * @param userVerifyId
28
+     * @param verifyStatus
29
+     * @return
30
+     */
31
+    ResponseBean auditUser(UserElement userElement, Integer userVerifyId, Boolean verifyStatus);
32
+
33
+}

+ 1
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoServiceImpl.java Прегледај датотеку

@@ -878,7 +878,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
878 878
                         buildingOwnerInfo.getBuildingName() +
879 879
                         buildingOwnerInfo.getUnitName() +
880 880
                         buildingOwnerInfo.getLevelName() +
881
-                        buildingOwnerInfo.getRoleName();
881
+                        buildingOwnerInfo.getRoomNoName();
882 882
 
883 883
                 cell = row.createCell(0);
884 884
                 cell.setCellValue(address);

+ 75
- 0
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TaUserVerifyServiceImpl.java Прегледај датотеку

@@ -0,0 +1,75 @@
1
+package com.community.huiju.service.impl;
2
+
3
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4
+import com.baomidou.mybatisplus.core.metadata.IPage;
5
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7
+import com.community.commom.constant.Constant;
8
+import com.community.commom.mode.ResponseBean;
9
+import com.community.commom.session.UserElement;
10
+import com.community.huiju.dao.TaUserMapper;
11
+import com.community.huiju.dao.TaUserVerifyMapper;
12
+import com.community.huiju.dao.UserMapper;
13
+import com.community.huiju.model.TaUser;
14
+import com.community.huiju.model.TaUserVerify;
15
+import com.community.huiju.model.User;
16
+import com.community.huiju.service.ITaUserVerifyService;
17
+import org.apache.commons.lang.StringUtils;
18
+import org.springframework.beans.factory.annotation.Autowired;
19
+import org.springframework.stereotype.Service;
20
+
21
+import java.util.List;
22
+
23
+/**
24
+ * 审核 业务实现
25
+ *
26
+ * @author weiximei
27
+ */
28
+@Service
29
+public class TaUserVerifyServiceImpl extends ServiceImpl<TaUserVerifyMapper, TaUserVerify> implements ITaUserVerifyService {
30
+
31
+    @Autowired
32
+    private TaUserVerifyMapper taUserVerifyMapper;
33
+
34
+    @Autowired
35
+    private UserMapper userMapper;
36
+
37
+    @Override
38
+    public ResponseBean selectAll(String phone, String userName, String idCard, Integer pageNum, Integer pageSize) {
39
+        ResponseBean responseBean = new ResponseBean();
40
+
41
+        Page<TaUserVerify> page = new Page<>();
42
+        page.setCurrent(pageNum);
43
+        page.setSize(pageSize);
44
+
45
+        IPage<TaUserVerify> userVerifyIPage = taUserVerifyMapper.selectAllByPhoneAndUserNameAndIdCard(page, phone, userName, idCard);
46
+        responseBean.addSuccess(userVerifyIPage);
47
+
48
+        return responseBean;
49
+    }
50
+
51
+    @Override
52
+    public ResponseBean auditUser(UserElement userElement, Integer userVerifyId, Boolean verifyStatus) {
53
+        ResponseBean responseBean = new ResponseBean();
54
+
55
+        TaUserVerify userVerify = taUserVerifyMapper.selectById(userVerifyId);
56
+        if (null == userVerify) {
57
+            responseBean.addError("审核数据不存在!");
58
+            return responseBean;
59
+        }
60
+
61
+        if (!Constant.TO_AUDIT.equals(userVerify.getVerifyStatus())) {
62
+            responseBean.addError("审核状态错误!");
63
+            return responseBean;
64
+        }
65
+
66
+        User user = userMapper.selectById(userElement.getId());
67
+        String status = verifyStatus == true ? Constant.APPROVED : Constant.REJECTED;
68
+        userVerify.setVerifyStatus(status);
69
+        userVerify.setVerifyName(user.getUserName());
70
+
71
+        taUserVerifyMapper.updateById(userVerify);
72
+        responseBean.addSuccess("操作成功!");
73
+        return responseBean;
74
+    }
75
+}

+ 25
- 0
CODE/smart-community/property-api/src/main/resources/mapper/TaUserVerifyMapper.xml Прегледај датотеку

@@ -2,4 +2,29 @@
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 <mapper namespace="com.community.huiju.dao.TaUserVerifyMapper">
4 4
 
5
+    <select id="selectAllByPhoneAndUserNameAndIdCard" resultType="com.community.huiju.model.TaUserVerify" >
6
+        select
7
+            tav.*,
8
+            tu.user_name as userName,
9
+            tu.login_name as phone,
10
+            tu.id_card as idCard,
11
+            tu.gender as gender
12
+        from
13
+          ta_user_verify tav LEFT JOIN ta_user tu on tav.user_id = tu.id
14
+        <where>
15
+            <trim suffixOverrides="and | or">
16
+                tav.verify_status = 0
17
+                <if test="phone != null and phone != ''">
18
+                    and tu.login_name like CONCAT('%',#{phone},'%')
19
+                </if>
20
+                <if test="userName != null and userName != ''">
21
+                    and tu.user_name like CONCAT('%',#{userName},'%')
22
+                </if>
23
+                <if test="idCard != null and idCard != ''">
24
+                    and tu.id_card like CONCAT('%',#{idCard},'%')
25
+                </if>
26
+            </trim>
27
+        </where>
28
+    </select>
29
+
5 30
 </mapper>

+ 13
- 13
CODE/smart-community/property-api/src/main/resources/mapper/TpBuildingOwnerInfoMapper.xml Прегледај датотеку

@@ -61,22 +61,22 @@
61 61
     <select id="selectListByParams" resultType="com.community.huiju.model.TpBuildingOwnerInfo">
62 62
         SELECT
63 63
             t.id,
64
-            t.community_id,
65
-            t.owner_tel,
66
-            t.owner_name,
67
-            t.id_card,
68
-            r.description as role_name,
69
-            u.verify_status,
70
-            m.user_name AS update_name,
71
-            t.update_date
64
+            t.community_id as communityId,
65
+            t.owner_tel as ownerTel,
66
+            t.owner_name as ownerName,
67
+            t.id_card as idCard,
68
+            r.description as roleName,
69
+            u.verify_status as verifyStatus,
70
+            m.user_name AS updateName,
71
+            t.update_date as updateDate
72 72
         FROM
73 73
             tp_building_owner_info t
74
-            LEFT JOIN ta_user_verify u ON t.id = u.room_no_id
74
+            LEFT JOIN ta_user_verify u ON t.room_no_id = u.room_no_id
75 75
             LEFT JOIN ta_sys_role r ON u.role_id = r.id
76 76
             LEFT JOIN tp_user m ON t.update_user = m.id
77 77
         WHERE
78
-            t.owner_status = 1
79
-        and t.community_id=#{tpBuildingOwnerInfo.communityId,jdbcType=INTEGER}
78
+
79
+        t.community_id=#{tpBuildingOwnerInfo.communityId,jdbcType=INTEGER}
80 80
         <if test="tpBuildingOwnerInfo.phaseId != null and tpBuildingOwnerInfo.phaseId != ''">
81 81
             and t.phase_id = #{tpBuildingOwnerInfo.phaseId,jdbcType=INTEGER}
82 82
         </if>
@@ -89,8 +89,8 @@
89 89
         <if test="tpBuildingOwnerInfo.levelId != null and tpBuildingOwnerInfo.levelId != ''">
90 90
             and t.level_id = #{tpBuildingOwnerInfo.levelId,jdbcType=INTEGER}
91 91
         </if>
92
-        <if test="tpBuildingOwnerInfo.id != null and tpBuildingOwnerInfo.id != ''">
93
-            and t.id = #{tpBuildingOwnerInfo.id,jdbcType=INTEGER}
92
+        <if test="tpBuildingOwnerInfo.roomNoId != null and tpBuildingOwnerInfo.roomNoId != ''">
93
+            and t.room_no_id = #{tpBuildingOwnerInfo.roomNoId,jdbcType=INTEGER}
94 94
         </if>
95 95
         <if test="tpBuildingOwnerInfo.ownerName != null and tpBuildingOwnerInfo.ownerName != ''">
96 96
             and t.owner_name like concat('%',#{tpBuildingOwnerInfo.ownerName,jdbcType=VARCHAR},'%')

+ 2
- 11
CODE/smart-community/property-api/src/test/java/com/community/huiju/DemoApplicationTests.java Прегледај датотеку

@@ -1,22 +1,13 @@
1 1
 package com.community.huiju;
2 2
 
3
-import com.alibaba.fastjson.JSONObject;
4
-import com.community.huiju.dao.ToCommunitiesMapper;
5
-import com.community.huiju.dao.TaUserMapper;
6
-import com.community.huiju.dao.TpBuildingOwnerInfoMapper;
7
-import com.community.huiju.dao.TpSysRoleMapper;
8
-import com.community.huiju.model.TpBuildingOwnerInfo;
9
-import com.community.huiju.model.TpSysRole;
10
-import com.google.common.collect.Maps;
3
+
11 4
 import org.junit.Test;
12 5
 import org.junit.runner.RunWith;
13
-import org.springframework.beans.factory.annotation.Autowired;
14 6
 import org.springframework.boot.test.context.SpringBootTest;
15 7
 import org.springframework.test.context.junit4.SpringRunner;
16 8
 
17 9
 import java.time.Instant;
18
-import java.util.List;
19
-import java.util.Map;
10
+
20 11
 
21 12
 @RunWith(SpringRunner.class)
22 13
 @SpringBootTest

+ 2
- 2
VUECODE/smart-property-manage/src/api/buildingOwnerInfo.js Прегледај датотеку

@@ -54,8 +54,8 @@ export function buildingList(data) {
54 54
       phaseId: data.phaseId,
55 55
       buildingId: data.buildingId,
56 56
       unitId: data.unitId,
57
-      lelevelIdvel: data.levelId,
58
-      id: data.roomNoId,
57
+      levelId: data.levelId,
58
+      roomNoId: data.roomNoId,
59 59
       ownerName: data.ownerName,
60 60
       ownerTel: data.ownerTel,
61 61
       idCard: data.idCard,

+ 43
- 0
VUECODE/smart-property-manage/src/api/user.js Прегледај датотеку

@@ -79,3 +79,46 @@ export function upDateStatus(data) {
79 79
     }
80 80
   })
81 81
 }
82
+
83
+// 获取审核列表
84
+export function userVerifyAll(data) {
85
+  return request({
86
+    url: '/user/verify/all',
87
+    method: 'get',
88
+    params: {
89
+      phone: data.phone,
90
+      userName: data.userName,
91
+      idCard: data.idCard,
92
+      pageNum: data.pageNum,
93
+      pageSize: data.pageSize
94
+    }
95
+  })
96
+}
97
+
98
+// 审核用户
99
+export function userVerifyAudit(data) {
100
+  return request({
101
+    url: '/user/verify/audit/' + data.userVerifyId,
102
+    method: 'put',
103
+    params: {
104
+      verifyStatus: data.verifyStatus
105
+    }
106
+  })
107
+}
108
+
109
+// 校验移动端手机号是否注册以及业主
110
+export function taUserHas(data) {
111
+  return request({
112
+    url: '/ta/user/has',
113
+    method: 'get',
114
+    params: {
115
+      ownerTel: data.ownerTel,
116
+      phaseId: data.phaseId,
117
+      buildingId: data.buildingId,
118
+      unitId: data.unitId,
119
+      levelId: data.levelId,
120
+      roomNoId: data.roomNoId
121
+    }
122
+  })
123
+}
124
+

+ 28
- 1
VUECODE/smart-property-manage/src/store/modules/user.js Прегледај датотеку

@@ -1,6 +1,6 @@
1 1
 import { login, logOut, getInfo, sendCode, getPermission } from '@/api/login'
2 2
 import { getToken, setToken, removeToken } from '@/utils/auth'
3
-import { employeesList, userRoleById, addUser, selectUser, upDate, upDateStatus } from '@/api/user'
3
+import { employeesList, userRoleById, addUser, selectUser, upDate, upDateStatus, userVerifyAll, userVerifyAudit, taUserHas } from '@/api/user'
4 4
 
5 5
 const user = {
6 6
   state: {
@@ -174,6 +174,33 @@ const user = {
174 174
           reject(error)
175 175
         })
176 176
       })
177
+    },
178
+    UserVerifyAll({ commit }, data) { // 审核用户列表
179
+      return new Promise((resolve, reject) => {
180
+        userVerifyAll(data).then(response => {
181
+          resolve(response)
182
+        }).catch(error => {
183
+          reject(error)
184
+        })
185
+      })
186
+    },
187
+    UserVerifyAudit({ commit }, data) { // 审核用户
188
+      return new Promise((resolve, reject) => {
189
+        userVerifyAudit(data).then(response => {
190
+          resolve(response)
191
+        }).catch(error => {
192
+          reject(error)
193
+        })
194
+      })
195
+    },
196
+    TaUserHas({ commit }, data) { // 校验移动端手机号是否注册以及业主
197
+      return new Promise((resolve, reject) => {
198
+        taUserHas(data).then(response => {
199
+          resolve(response)
200
+        }).catch(error => {
201
+          reject(error)
202
+        })
203
+      })
177 204
     }
178 205
   }
179 206
 }

+ 212
- 28
VUECODE/smart-property-manage/src/views/building/add/index.vue Прегледај датотеку

@@ -1,27 +1,83 @@
1 1
 <template>
2 2
   <div class="root">
3
-    <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="100px" class="add-ruleForm">
4
-      <el-form-item label="期/区" prop="phase">
5
-        <el-input v-model="ruleForm.phase"/>
3
+    <el-form ref="ruleForm" :model="listQuery" :rules="rules" label-width="100px" class="add-ruleForm">
4
+      <el-form-item label="期/区" prop="phaseId">
5
+        <el-select v-model="listQuery.phaseId" placeholder="期/区" @change="buildSelectChange(0)">
6
+          <!--<el-option label="选择楼栋" value="-1" />-->
7
+          <el-option
8
+            v-for="item in phaseList"
9
+            :key="item.id"
10
+            :label="item.name"
11
+            :value="item.id"/>
12
+        </el-select>
6 13
       </el-form-item>
7
-      <el-form-item label="栋" prop="building">
8
-        <el-input v-model="ruleForm.building"/>
14
+      <el-form-item label="栋" prop="buildingId">
15
+        <el-select v-model="listQuery.buildingId" placeholder="栋" @change="buildSelectChange(1)">
16
+          <!--<el-option label="选择楼栋" value="-1" />-->
17
+          <el-option
18
+            v-for="item in buildingList"
19
+            :key="item.id"
20
+            :label="item.name"
21
+            :value="item.id"/>
22
+        </el-select>
9 23
       </el-form-item>
10
-      <el-form-item label="单元" prop="unit">
11
-        <el-input v-model="ruleForm.unit"/>
24
+      <el-form-item label="单元" prop="unitId">
25
+        <el-select v-model="listQuery.unitId" placeholder="单元" @change="buildSelectChange(2)">
26
+          <!--<el-option label="选择单元" value="-1" />-->
27
+          <el-option
28
+            v-for="item in unitList"
29
+            :key="item.id"
30
+            :label="item.name"
31
+            :value="item.id"/>
32
+        </el-select>
12 33
       </el-form-item>
13
-      <el-form-item label="楼层" prop="level">
14
-        <el-input v-model="ruleForm.level"/>
34
+      <el-form-item label="楼层" prop="levelId">
35
+        <el-select v-model="listQuery.levelId" placeholder="楼层" @change="buildSelectChange(3)">
36
+          <!--<el-option label="选择楼层" value="-1" />-->
37
+          <el-option
38
+            v-for="item in levelList"
39
+            :key="item.id"
40
+            :label="item.name"
41
+            :value="item.id"/>
42
+        </el-select>
15 43
       </el-form-item>
16
-      <el-form-item label="户号" prop="roomNo">
17
-        <el-input v-model="ruleForm.roomNo"/>
44
+      <el-form-item label="户号" prop="roomNoId">
45
+        <el-select v-model="listQuery.roomNoId" placeholder="户号">
46
+          <!--<el-option label="选择户号" value="-1" />-->
47
+          <el-option
48
+            v-for="item in roomNoList"
49
+            :key="item.id"
50
+            :label="item.name"
51
+            :value="item.id"/>
52
+        </el-select>
18 53
       </el-form-item>
19
-      <el-form-item label="业主姓名" prop="ownerName">
20
-        <el-input v-model="ruleForm.ownerName"/>
54
+      <el-form-item label="手机号" prop="ownerTel" placeholder="手机号">
55
+        <el-input v-model="listQuery.ownerTel" @blur="taUserHas('ruleForm')"/>
21 56
       </el-form-item>
22
-      <el-form-item label="业主手机号" prop="ownerTel">
23
-        <el-input v-model="ruleForm.ownerTel"/>
57
+      <el-form-item label="身份" prop="roleId">
58
+        <el-select v-model="listQuery.roleId" placeholder="身份">
59
+          <el-option :disabled="roleDisabled" label="业主" value="1" />
60
+          <el-option label="租客" value="2" />
61
+          <el-option label="家属" value="3" />
62
+        </el-select>
24 63
       </el-form-item>
64
+      <el-form-item v-if="isRegistered" label="姓名" placeholder="姓名">
65
+        <el-input v-model="listQuery.ownerName"/>
66
+      </el-form-item>
67
+      <div v-else>
68
+        <el-form-item label="注册状态:" >
69
+          <span style="margin-left: 100px;">已注册</span>
70
+        </el-form-item>
71
+        <el-form-item label="姓名:" >
72
+          <span style="margin-left: 100px;">{{ userName }}</span>
73
+        </el-form-item>
74
+        <el-form-item label="性别:" >
75
+          <span style="margin-left: 100px;">{{ gender }}</span>
76
+        </el-form-item>
77
+        <el-form-item label="身份证号:" >
78
+          <span style="margin-left: 100px;">{{ idCard }}</span>
79
+        </el-form-item>
80
+      </div>
25 81
       <el-form-item>
26 82
         <el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button>
27 83
         <el-button @click="resetForm('ruleForm')">重置</el-button>
@@ -34,29 +90,40 @@
34 90
 export default {
35 91
   data() {
36 92
     return {
37
-      ruleForm: {
38
-        phase: '',
39
-        building: '',
40
-        unit: '',
41
-        level: '',
42
-        roomNo: '',
93
+      listQuery: {
94
+        phaseId: '',
95
+        buildingId: '',
96
+        unitId: '',
97
+        levelId: '',
98
+        roomNoId: '',
43 99
         ownerName: '',
44
-        ownerTel: ''
100
+        ownerTel: '',
101
+        roleId: ''
45 102
       },
103
+      isRegistered: true, // true 未注册 false 注册
104
+      roleDisabled: false, // 是否禁用业主下拉选项
105
+      phaseList: [], // 期 集合
106
+      buildingList: [], // seletc 楼栋集合
107
+      unitList: [], // seletc 单元集合
108
+      levelList: [], // seletc 层 集合
109
+      roomNoList: [], //  seletc 户号集合
110
+      userName: '', // 用户姓名
111
+      gender: '', // 性别
112
+      idCard: '', // 身份证
46 113
       rules: {
47
-        phase: [
114
+        phaseId: [
48 115
           { required: true, message: '请输入期/区', trigger: 'blur' }
49 116
         ],
50
-        building: [
117
+        buildingId: [
51 118
           { required: true, message: '请输入楼栋', trigger: 'blur' }
52 119
         ],
53
-        unit: [
120
+        unitId: [
54 121
           { required: true, message: '请输入单元', trigger: 'blur' }
55 122
         ],
56
-        level: [
123
+        levelId: [
57 124
           { required: true, message: '请输入楼层', trigger: 'blur' }
58 125
         ],
59
-        roomNo: [
126
+        roomNoId: [
60 127
           { required: true, message: '请输入户号', trigger: 'blur' }
61 128
         ],
62 129
         ownerName: [
@@ -65,10 +132,14 @@ export default {
65 132
         ownerTel: [
66 133
           { required: true, message: '请输入手机号', trigger: 'blur' },
67 134
           { min: 11, max: 11, required: true, message: '请输入11位手机号', trigger: 'blur' }
68
-        ],
135
+        ]
69 136
       }
70 137
     }
71 138
   },
139
+  mounted() {
140
+    // 获取期
141
+    this.getPhase()
142
+  },
72 143
   methods: {
73 144
     submitForm(formName) { // 提交
74 145
       this.$refs[formName].validate((valid) => {
@@ -81,6 +152,12 @@ export default {
81 152
       })
82 153
     },
83 154
     resetForm(formName) { // 重置
155
+      // 重置为未注册
156
+      this.isRegistered = true
157
+      // 重置为非业主
158
+      this.roleDisabled = false
159
+
160
+      console.log(this.isRegistered)
84 161
       this.$refs[formName].resetFields()
85 162
     },
86 163
     addBuilding() {
@@ -107,6 +184,113 @@ export default {
107 184
         loading.close()
108 185
         console.log('error AddBuilding')
109 186
       })
187
+    },
188
+    getPhase() { // 获取期
189
+      this.listQuery.phaseId = ''
190
+      this.$store.dispatch('GetPhaseList', this.listQuery).then((res) => {
191
+        this.phaseList = res.data
192
+      }).catch(() => {
193
+        console.log('error phase BuildingAddress')
194
+      })
195
+    },
196
+    getBuild() { // 获取楼栋
197
+      this.listQuery.buildingId = ''
198
+      this.$store.dispatch('GetBuildingList', this.listQuery).then((res) => {
199
+        this.buildingList = res.data
200
+      }).catch(() => {
201
+        console.log('error building BuildingAddress')
202
+      })
203
+    },
204
+    getUnit() { // 获取单元
205
+      this.listQuery.unitId = ''
206
+      this.$store.dispatch('GetUnitList', this.listQuery).then((res) => {
207
+        this.unitList = res.data
208
+      }).catch(() => {
209
+        console.log('error unit BuildingAddress')
210
+      })
211
+    },
212
+    getLevel() { // 获取楼层
213
+      this.listQuery.levelId = ''
214
+      this.$store.dispatch('GetLevelList', this.listQuery).then((res) => {
215
+        this.levelList = res.data
216
+      }).catch(() => {
217
+        console.log('error level BuildingAddress')
218
+      })
219
+    },
220
+    getRoomNo() { // 获取户号
221
+      this.listQuery.roomNoId = ''
222
+      this.$store.dispatch('GetRoomNoList', this.listQuery).then((res) => {
223
+        this.roomNoList = res.data
224
+      }).catch(() => {
225
+        console.log('error roomNo BuildingAddress')
226
+      })
227
+    },
228
+    buildSelectChange(value) { // select 的 change
229
+      switch (value) {
230
+        case 0: // 查询栋
231
+          this.buildingList = []
232
+          this.unitList = []
233
+          this.levelList = []
234
+          this.roomNoList = []
235
+          this.listQuery.buildingId = ''
236
+          this.listQuery.unitId = ''
237
+          this.listQuery.levelId = ''
238
+          this.listQuery.roomNoId = ''
239
+          this.getBuild()
240
+          break
241
+        case 1: // 查询 单元
242
+          this.unitList = []
243
+          this.levelList = []
244
+          this.roomNoList = []
245
+          this.listQuery.unitId = ''
246
+          this.listQuery.levelId = ''
247
+          this.listQuery.roomNoId = ''
248
+          this.getUnit()
249
+          break
250
+        case 2: // 查询 楼层
251
+          this.levelList = []
252
+          this.roomNoList = []
253
+          this.listQuery.levelId = ''
254
+          this.listQuery.roomNoId = ''
255
+          this.getLevel()
256
+          break
257
+        case 3: // 查询 户号
258
+          this.roomNoList = []
259
+          this.listQuery.roomNoId = ''
260
+          this.getRoomNo()
261
+          break
262
+      }
263
+    },
264
+    taUserHas(formName) { // 校验移动端手机号是否注册以及业主
265
+      this.$refs[formName].validate((valid) => {
266
+        if (valid) {
267
+          this.$store.dispatch('TaUserHas', this.listQuery).then((res) => {
268
+            const resCode = res.code
269
+            if (resCode === '1') {
270
+              // 未注册
271
+              this.isRegistered = true
272
+              return
273
+            }
274
+            // 已经注册
275
+            this.isRegistered = false
276
+            const resData = res.data
277
+            if (resData.boolRole === true) {
278
+              // 表示已经是业主
279
+              this.roleDisabled = true
280
+            }
281
+            // 展示注册信息
282
+            const resInfo = resData.info
283
+            this.userName = resInfo.userName
284
+            this.idCard = resInfo.idCard
285
+            this.gender = resInfo.gender === '1' ? '男' : '女'
286
+          }).catch(() => {
287
+            console.log('TaUserHas error')
288
+          })
289
+        } else {
290
+          console.log('error 校验号码')
291
+          return false
292
+        }
293
+      })
110 294
     }
111 295
   }
112 296
 }

+ 197
- 3
VUECODE/smart-property-manage/src/views/building/audit/index.vue Прегледај датотеку

@@ -1,15 +1,209 @@
1 1
 <template>
2 2
   <div id="root">
3
-    审核资料
3
+    <el-form :inline="true" :model="formInline" class="demo-form-inline">
4
+      <el-form-item label="手机号">
5
+        <el-input v-model="formInline.phone" placeholder="手机号"/>
6
+      </el-form-item>
7
+      <el-form-item label="姓名">
8
+        <el-input v-model="formInline.userName" placeholder="姓名"/>
9
+      </el-form-item>
10
+      <el-form-item label="身份证">
11
+        <el-input v-model="formInline.idCard" placeholder="身份证"/>
12
+      </el-form-item>
13
+      <el-form-item>
14
+        <el-button type="info" @click="clear">清空</el-button>
15
+        <el-button type="primary" @click="queryList">查询</el-button>
16
+      </el-form-item>
17
+    </el-form>
18
+    <span style="color: #99a9bf; font-size: 13px; margin-left: 20px;">注意,审核后无法修改审核结果,请仔细确认</span>
19
+    <el-table
20
+      ref="multipleTable"
21
+      :data="tableData"
22
+      border
23
+      tooltip-effect="dark"
24
+      style="width: 100%"
25
+      @selection-change="handleSelectionChange">
26
+      <el-table-column
27
+        align="center"
28
+        type="selection"
29
+        width="55"/>
30
+      <el-table-column
31
+        align="center"
32
+        prop="userName"
33
+        label="姓名"/>
34
+      <el-table-column
35
+        align="center"
36
+        prop="phone"
37
+        label="手机号"/>
38
+      <el-table-column
39
+        align="center"
40
+        prop="idCard"
41
+        label="身份证"/>
42
+      <el-table-column
43
+        align="center"
44
+        prop="gender"
45
+        label="性别">
46
+        <template slot-scope="scope">{{ scope.row.gender === '1' ? '男' : '女' }}</template>
47
+      </el-table-column>
48
+      <el-table-column
49
+        align="center"
50
+        prop="address"
51
+        label="房产">
52
+        <template slot-scope="scope">{{ scope.row.phaseName + scope.row.buildingName + scope.row.unitName + scope.row.levelName + scope.row.roomNoName }}</template>
53
+      </el-table-column>
54
+      <el-table-column
55
+        align="center"
56
+        prop="userRole"
57
+        label="角色">
58
+        <template slot-scope="scope">{{ showRoleName(scope.row.roleId) }}</template>
59
+      </el-table-column>
60
+      <el-table-column
61
+        align="center"
62
+        prop="createDate"
63
+        label="提交时间">
64
+        <template slot-scope="scope">{{ formatDate(scope.row.createDate) }}</template>
65
+      </el-table-column>
66
+      <el-table-column
67
+        align="center"
68
+        label="操作">
69
+        <template slot-scope="scope">
70
+          <el-button type="primary" @click="userVerifyAudit(scope.row.id,true)">通过</el-button>
71
+          <el-button type="danger" @click="userVerifyAudit(scope.row.id,false)">不通过</el-button>
72
+        </template>
73
+      </el-table-column>
74
+    </el-table>
75
+
76
+    <!-- 分页 -->
77
+    <div class="footer-page">
78
+      <el-pagination
79
+        :current-page="formInline.pageNum"
80
+        :page-sizes="[100, 200, 300, 400]"
81
+        :page-size="formInline.pageSize"
82
+        :total="total"
83
+        layout="total, sizes, prev, pager, next, jumper"
84
+        @size-change="handleSizeChange"
85
+        @current-change="handleCurrentChange"/>
86
+    </div>
4 87
   </div>
5 88
 </template>
6 89
 
7 90
 <script>
8 91
 export default {
9
-  name: 'Audit'
92
+  name: 'Audit',
93
+  data() {
94
+    return {
95
+      formInline: {
96
+        phone: '',
97
+        userVerifyId: '',
98
+        verifyStatus: true,
99
+        userName: '',
100
+        idCard: '',
101
+        pageNum: 1,
102
+        pageSize: 10
103
+      },
104
+      total: 0, // 总数
105
+      tableData: [] // 数据体
106
+    }
107
+  },
108
+  mounted() {
109
+    this.getData()
110
+  },
111
+  methods: {
112
+    clear() { // 清空
113
+      this.formInline.pageNum = 1
114
+      this.formInline.pageSize = 10
115
+      this.formInline.userName = ''
116
+      this.formInline.phone = ''
117
+      this.formInline.idCard = ''
118
+      this.getData()
119
+    },
120
+    queryList() { // 查询
121
+      this.formInline.pageNum = 1
122
+      this.formInline.pageSize = 10
123
+      this.getData()
124
+    },
125
+    handleSelectionChange(val) { // 选择
126
+      this.multipleSelection = val
127
+    },
128
+    handleSizeChange(val) {
129
+      console.log(`每页 ${val} 条`)
130
+    },
131
+    handleCurrentChange(val) {
132
+      console.log(`当前页: ${val}`)
133
+    },
134
+    getData() {
135
+      this.$store.dispatch('UserVerifyAll', this.formInline).then((res) => {
136
+        const resCode = res.code
137
+        if (resCode === '0') {
138
+          const resData = res.data
139
+          this.tableData = resData.records
140
+          this.formInline.pageNum = resData.pageNum
141
+          this.formInline.pageSize = resData.pageSize
142
+          this.total = resData.total
143
+        }
144
+      }).catch(() => {
145
+        console.log('UserVerifyAll error')
146
+      })
147
+    },
148
+    userVerifyAudit(verifyId,vstatus){
149
+      this.formInline.userVerifyId = verifyId
150
+      this.formInline.verifyStatus = vstatus
151
+      this.$store.dispatch('UserVerifyAudit', this.formInline).then((res) => {
152
+        const resCode = res.code
153
+        if (resCode === '0') {
154
+          this.$message({
155
+            message: res.message,
156
+            type: 'success'
157
+          })
158
+          this.getData()
159
+          return
160
+        }
161
+        this.$message.error(res.message)
162
+      }).catch(() => {
163
+        console.log('UserVerifyAudit error')
164
+      })
165
+    },
166
+    showRoleName(roleId) {
167
+      let str = ''
168
+      switch (roleId) {
169
+        case 1:
170
+          str = '业主'
171
+          break
172
+        case 2:
173
+          str = '租客'
174
+          break
175
+        case 3:
176
+          str = '家属'
177
+          break
178
+      }
179
+
180
+      return str
181
+    },
182
+    formatDate(val) {
183
+      if (val === null) {
184
+        return ''
185
+      }
186
+      var value = new Date(val)
187
+      var year = value.getFullYear()
188
+      var month = value.getMonth() + 1
189
+      var day = value.getDate()
190
+      // var hour = value.getHours()
191
+      // var minutes = value.getMinutes()
192
+      // var seconds = value.getSeconds()
193
+      // return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
194
+      return year + '-' + month + '-' + day
195
+    }
196
+  }
10 197
 }
11 198
 </script>
12 199
 
13 200
 <style scoped>
14
-
201
+.demo-form-inline {
202
+  margin-top: 20px;
203
+  margin-left: 20px;
204
+}
205
+.footer-page {
206
+  display: flex;
207
+  justify-content: flex-end;
208
+}
15 209
 </style>

+ 46
- 46
VUECODE/smart-property-manage/src/views/building/batch/batchImport.vue Прегледај датотеку

@@ -3,7 +3,7 @@
3 3
   <div class="root">
4 4
     <el-form :inline="true" :model="listQuery" class="form-listQuery">
5 5
       <el-form-item>
6
-        <el-upload :on-preview="handlePreview" :on-change="handleChange" :before-upload="beforeUpload" :limit="1" :on-exceed="handleExceed" class="upload-demo" action="" multiple>
6
+        <el-upload :on-change="handleChange" :before-upload="beforeUpload" :limit="1" class="upload-demo" action="" multiple>
7 7
           <!-- <a href="http://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/%E6%A5%BC%E6%A0%8B%E5%BA%93%E6%A8%A1%E6%9D%BF.xlsx?Expires=1548327771"></a> -->
8 8
           <el-button style="margin-left: 10px;" size="large" type="primary" @click="exportExcel">下载模板-小区</el-button>
9 9
           <el-button slot="trigger" size="large" type="primary">选取文件并预览</el-button>
@@ -45,7 +45,7 @@
45 45
 </template>
46 46
 
47 47
 <script>
48
-import { mapState, mapActions } from "vuex";
48
+import { mapState, mapActions } from 'vuex'
49 49
 export default {
50 50
   data() {
51 51
     return {
@@ -59,93 +59,93 @@ export default {
59 59
     }
60 60
   },
61 61
   computed: {
62
-    ...mapState("batchImport", {
62
+    ...mapState('batchImport', {
63 63
       temlist: s => s.temlist,
64 64
       total: s => s.total
65 65
     })
66 66
   },
67 67
   created() {
68
-    console.log(mapActions);
68
+    console.log(mapActions)
69 69
   },
70 70
   methods: {
71
-    ...mapActions("batchImport", [
72
-      "UploadBuildingExcel",
73
-      "SubmitBuildingExcel"
71
+    ...mapActions('batchImport', [
72
+      'UploadBuildingExcel',
73
+      'SubmitBuildingExcel'
74 74
     ]),
75 75
     handleSizeChange(val) {
76
-      this.listQuery.pageSize = val;
77
-      this.getList();
78
-      console.log(`每页 ${val} 条`);
76
+      this.listQuery.pageSize = val
77
+      this.getList()
78
+      console.log(`每页 ${val} 条`)
79 79
     },
80 80
     handleCurrentChange(val) {
81
-      this.listQuery.pageNum = val;
82
-      this.getList();
83
-      console.log(`当前页: ${val}`);
81
+      this.listQuery.pageNum = val
82
+      this.getList()
83
+      console.log(`当前页: ${val}`)
84 84
     },
85 85
     dialogBatchImport() {
86
-      this.$router.push({ name: "batch-import" });
86
+      this.$router.push({ name: 'batch-import' })
87 87
     },
88 88
     beforeUpload(file) {
89
-      const extension = file.name.split(".")[1] === "xls";
90
-      const extension2 = file.name.split(".")[1] === "xlsx";
89
+      const extension = file.name.split('.')[1] === 'xls'
90
+      const extension2 = file.name.split('.')[1] === 'xlsx'
91 91
       if (!extension && !extension2) {
92
-        this.$message.warning("上传文件只能是 xls、xlsx格式!");
93
-        return;
92
+        this.$message.warning('上传文件只能是 xls、xlsx格式!')
93
+        return
94 94
       }
95
-      this.files = file;
96
-      return false; // 返回false不会自动上传
95
+      this.files = file
96
+      return false // 返回false不会自动上传
97 97
     },
98 98
     handleChange(file) {
99
-      const fileName = file.name;
100
-      if (fileName === "") {
101
-        this.$message.warning("请选择要上传的文件!");
102
-        return false;
99
+      const fileName = file.name
100
+      if (fileName === '') {
101
+        this.$message.warning('请选择要上传的文件!')
102
+        return false
103 103
       }
104 104
       this.UploadBuildingExcel(file)
105 105
         .then(response => {
106
-          if (response.code === "1") {
107
-            this.$message.warning(response.message);
106
+          if (response.code === '1') {
107
+            this.$message.warning(response.message)
108 108
           }
109
-          if (response.code === "0") {
110
-            this.$message.success("上传成功");
111
-            this.getList();
109
+          if (response.code === '0') {
110
+            this.$message.success('上传成功')
111
+            this.getList()
112 112
           }
113 113
         })
114 114
         .catch(() => {
115
-          console.log("upload error");
116
-        });
115
+          console.log('upload error')
116
+        })
117 117
     },
118 118
     submitUpload() {
119 119
       if (this.files === null) {
120
-        this.$message.warning("没有需要提交的文件");
121
-        return false;
120
+        this.$message.warning('没有需要提交的文件')
121
+        return false
122 122
       }
123
-      let file = {
123
+      const file = {
124 124
         raw: this.files
125
-      };
125
+      }
126 126
       this.SubmitBuildingExcel(file)
127 127
         .then(response => {
128
-          if (response.code === "1") {
129
-            this.$message.warning(response.message);
128
+          if (response.code === '1') {
129
+            this.$message.warning(response.message)
130 130
           }
131
-          if (response.code === "0") {
132
-            this.$message.success("提交成功");
133
-            this.dialogBuildingIndex();
131
+          if (response.code === '0') {
132
+            this.$message.success('提交成功')
133
+            this.dialogBuildingIndex()
134 134
           }
135 135
         })
136 136
         .catch(() => {
137
-          console.log("upload error");
138
-        });
137
+          console.log('upload error')
138
+        })
139 139
     },
140 140
     getList() {
141 141
       this.list = this.temlist.slice(
142 142
         (this.listQuery.pageNum - 1) * this.listQuery.pageSize,
143 143
         this.listQuery.pageNum * this.listQuery.pageSize
144
-      );
145
-      console.log(this.list);
144
+      )
145
+      console.log(this.list)
146 146
     },
147 147
     dialogBuildingIndex() {
148
-      this.$router.push({ name: "building-index" });
148
+      this.$router.push({ name: 'building-index' })
149 149
     },
150 150
     exportExcel() {
151 151
       this.$store.dispatch('BuildingDownloadExcel').then(res => {
@@ -161,7 +161,7 @@ export default {
161 161
       })
162 162
     }
163 163
   }
164
-};
164
+}
165 165
 </script>
166 166
 
167 167
 <style scoped>

+ 19
- 0
VUECODE/smart-property-manage/src/views/building/index.vue Прегледај датотеку

@@ -356,6 +356,9 @@ export default {
356 356
       })
357 357
     },
358 358
     formatDate(val) {
359
+      if (val === null) {
360
+        return ''
361
+      }
359 362
       var value = new Date(val)
360 363
       var year = value.getFullYear()
361 364
       var month = value.getMonth() + 1
@@ -365,6 +368,22 @@ export default {
365 368
       // var seconds = value.getSeconds()
366 369
       // return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
367 370
       return year + '-' + month + '-' + day
371
+    },
372
+    showRoleName(roleId) {
373
+      let str = ''
374
+      switch (roleId) {
375
+        case 1:
376
+          str = '业主'
377
+          break
378
+        case 2:
379
+          str = '租客'
380
+          break
381
+        case 3:
382
+          str = '家属'
383
+          break
384
+      }
385
+
386
+      return str
368 387
     }
369 388
   }
370 389
 }