dingxin 6 vuotta sitten
vanhempi
commit
f8de63a9a1
19 muutettua tiedostoa jossa 3514 lisäystä ja 1976 poistoa
  1. 23
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/IBuildingOwnerInfoController.java
  2. 33
    16
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java
  3. 51
    6
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserVerifyController.java
  4. 0
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/WxLoginController.java
  5. 11
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaSysRoleMapper.java
  6. 1
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBuildingMapper.java
  7. 2
    3
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBuildingOwnerInfoMapper.java
  8. 25
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaUserVerify.java
  9. 1
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/IBuildingOwnerInfo.java
  10. 5
    4
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java
  11. 32
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TaUserVerifyServicel.java
  12. 15
    4
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoImpl.java
  13. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java
  14. 50
    30
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java
  15. 105
    8
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserVerifyServicelmpl.java
  16. 1
    1
      CODE/smart-community/app-api/src/main/resources/mapper/TaUserVerifyMapper.xml
  17. 6
    0
      CODE/smart-community/community-common/src/main/java/com/community/commom/mode/ResponseBean.java
  18. 1576
    949
      文档/MYSQL/smartCommunity.pdb
  19. 1576
    949
      文档/MYSQL/smartCommunity.pdm

+ 23
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/IBuildingOwnerInfoController.java Näytä tiedosto

@@ -54,4 +54,27 @@ public class IBuildingOwnerInfoController extends BaseController {
54 54
 
55 55
     }
56 56
 
57
+    @RequestMapping(value = "/building/has", method = RequestMethod.GET)
58
+    @ApiOperation(value = "根据 小区、期、楼栋、单元、楼层、户号", notes = "根据 小区、期、楼栋、单元、楼层、户号")
59
+    @ApiImplicitParams({
60
+            @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "phase", value = "期"),
61
+            @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "building", value = "楼栋"),
62
+            @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "unit", value = "单元"),
63
+            @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "level", value = "楼层"),
64
+            @ApiImplicitParam(paramType = "query", dataTypeClass = Integer.class, name = "roomNo", value = "户号"),
65
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
66
+    })
67
+    public ResponseBean hasBuilding(@RequestParam(value = "phase", required = false) String phase,
68
+                                   @RequestParam(value = "building",required = false) String building,
69
+                                   @RequestParam(value = "unit", required = false) String unit,
70
+                                   @RequestParam(value = "level", required = false) String level,
71
+                                   @RequestParam(value = "roomNo", required = false) String roomNo,
72
+                                   HttpSession session){
73
+
74
+        ResponseBean responseBean = new ResponseBean();
75
+        UserElement userElement = getUserElement(session);
76
+        responseBean = iBuildingOwnerInfo.hasBuild(userElement, phase, building, unit, level, roomNo);
77
+        return responseBean;
78
+    }
79
+
57 80
 }

+ 33
- 16
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java Näytä tiedosto

@@ -43,9 +43,8 @@ public class UserController extends BaseController {
43 43
     @ApiImplicitParams({
44 44
             @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "loginName(登陆名(手机号)) code(验证码)")
45 45
     })
46
-    @RequestMapping(value = "/user/login/{communityId}",method = RequestMethod.POST)
46
+    @RequestMapping(value = "/user/login",method = RequestMethod.POST)
47 47
     public ResponseBean login(@RequestBody String parameter,
48
-                              @PathVariable(value = "communityId") String communityId,
49 48
                               HttpSession session){
50 49
         JSONObject jsonObject = JSONObject.parseObject(parameter);
51 50
         ResponseBean responseBean = iTaUserService.login(jsonObject.getString("loginName"),jsonObject.getString("code"));
@@ -56,6 +55,36 @@ public class UserController extends BaseController {
56 55
         return responseBean;
57 56
 
58 57
     }
58
+
59
+    @ApiOperation(value = "注册", notes = "注册")
60
+    @ApiImplicitParams({
61
+            @ApiImplicitParam(paramType = "body",dataType = "String",name = "parameter",value = "userName用户姓名;idCard身份证;gender性别(1:男  2:女);loginName手机号;code验证码")
62
+    })
63
+    @RequestMapping(value = "/user/register",method = RequestMethod.POST)
64
+    public ResponseBean register(@RequestBody String parameter) {
65
+        ResponseBean responseBean = new ResponseBean();
66
+        responseBean = iTaUserService.register(parameter);
67
+        return responseBean;
68
+    }
69
+
70
+    @ApiOperation(value = "登录 绑定 房产", notes = "绑定选中的当前房产,进行登录 (在APP登录后,选择房产的时候),还可以用于切换房产登录")
71
+    @ApiImplicitParams({
72
+            @ApiImplicitParam(paramType = "path",dataTypeClass = String.class, name = "userVerifyId",value = "审核 id"),
73
+            @ApiImplicitParam(paramType = "header",dataTypeClass = String.class, name = "X-Auth-Token",value = "Token")
74
+    })
75
+    @RequestMapping(value = "/user/binding/login/{userVerifyId}",method = RequestMethod.POST)
76
+    public ResponseBean login(@PathVariable("userVerifyId") Integer userVerifyId,
77
+                              HttpSession session){
78
+        UserElement userElement = getUserElement(session);
79
+        ResponseBean responseBean = iTaUserService.bindingLoginAndHouse(userElement, userVerifyId);
80
+        TaUserVO userVO = (TaUserVO) responseBean.getData();
81
+        if (null != userVO) {
82
+            setUserElement(userVO, session);
83
+        }
84
+        return responseBean;
85
+
86
+    }
87
+
59 88
     @ApiOperation(value = "修改手机号", notes = "修改手机号")
60 89
     @ApiImplicitParams({
61 90
             @ApiImplicitParam(paramType = "body",dataType = "String",name = "paramets",value = "phone:登陆(手机号),code:(手机验证码),otherUserId:(租客或者家属ID,空为业主本人)"),
@@ -76,11 +105,9 @@ public class UserController extends BaseController {
76 105
     })
77 106
     @RequestMapping(value = "/roomUserList", method = RequestMethod.GET)
78 107
     public ResponseBean accessTicket(HttpSession session){
79
-        UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
80
-        Integer userId = userElement.getId();
81 108
         ResponseBean responseBean = new ResponseBean();
82
-        List<TaUser> taUserList = iTaUserService.getAllRoomUserList(userId);
83
-        responseBean.addSuccess(taUserList);
109
+        UserElement userElement = getUserElement(session);
110
+        responseBean = iTaUserService.getAllRoomUserList(userElement);
84 111
         return responseBean;
85 112
     }
86 113
     @ApiOperation(value = "修改用户名和性别和身份证", notes = "修改用户名和性别和身份证")
@@ -249,14 +276,4 @@ public class UserController extends BaseController {
249 276
         return responseBean;
250 277
     }
251 278
 
252
-    @ApiOperation(value = "查看当前用户所有关联房产",notes = "查看当前用户所有关联房产")
253
-    @ApiImplicitParams({
254
-            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
255
-    })
256
-    @RequestMapping(value ="/userhouse" ,method = RequestMethod.GET)
257
-    public ResponseBean userHouseList(HttpSession session){
258
-        UserElement userElement= getUserElement(session);
259
-        ResponseBean responseBean= iTaUserService.userHouseList(userElement);
260
-        return responseBean;
261
-    }
262 279
 }

+ 51
- 6
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserVerifyController.java Näytä tiedosto

@@ -9,10 +9,7 @@ import io.swagger.annotations.ApiImplicitParam;
9 9
 import io.swagger.annotations.ApiImplicitParams;
10 10
 import io.swagger.annotations.ApiOperation;
11 11
 import org.springframework.beans.factory.annotation.Autowired;
12
-import org.springframework.web.bind.annotation.PathVariable;
13
-import org.springframework.web.bind.annotation.RequestMapping;
14
-import org.springframework.web.bind.annotation.RequestMethod;
15
-import org.springframework.web.bind.annotation.RestController;
12
+import org.springframework.web.bind.annotation.*;
16 13
 
17 14
 import javax.servlet.http.HttpSession;
18 15
 
@@ -30,15 +27,63 @@ public class UserVerifyController extends BaseController {
30 27
     private TaUserVerifyServicel taUserVerifyServicel;
31 28
 
32 29
     @RequestMapping(value = "/user/verify/{userVerifyId}", method = RequestMethod.GET)
33
-    @ApiOperation(value = "获取当前 一个待审核或审核不通过房产")
30
+    @ApiOperation(value = "获取当前 一个待审核或审核不通过房产", notes = "获取当前 一个待审核或审核不通过房产")
34 31
     @ApiImplicitParams({
32
+            @ApiImplicitParam(paramType = "path", dataTypeClass = Integer.class, name = "userVerifyId", value = "审核房产 id"),
35 33
             @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
36 34
     })
37 35
     public ResponseBean getUserVerify(HttpSession session, @PathVariable("userVerifyId") Integer userVerifyId) {
38 36
         UserElement userElement = getUserElement(session);
39
-        ResponseBean responseBean = taUserVerifyServicel.getList(userElement, userVerifyId);
37
+        ResponseBean responseBean = taUserVerifyServicel.getToAuditNotApproved(userElement, userVerifyId);
40 38
         return responseBean;
41 39
     }
42 40
 
41
+    @RequestMapping(value = "/user/verify/add", method = RequestMethod.POST)
42
+    @ApiOperation(value = "添加一个审核的房产", notes = "添加一个审核的房产")
43
+    @ApiImplicitParams({
44
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token"),
45
+            @ApiImplicitParam(paramType = "body", dataTypeClass = String.class, name = "parameter", value = "roleName角色名称;phase期;building楼栋;unit单元;level楼层;roomNo户号")
46
+    })
47
+    public ResponseBean addUserVerify(@RequestBody String parameter, HttpSession session) {
48
+        ResponseBean responseBean = new ResponseBean();
49
+        UserElement userElement = getUserElement(session);
50
+        responseBean = taUserVerifyServicel.addUserVerify(userElement, parameter);
51
+        return responseBean;
52
+    }
53
+
54
+    @RequestMapping(value = "/user/verify/delete/{userVerifyId}", method = RequestMethod.DELETE)
55
+    @ApiOperation(value = "删除一个审核的房产", notes = "删除一个审核的房产")
56
+    @ApiImplicitParams({
57
+            @ApiImplicitParam(paramType = "path", dataTypeClass = Integer.class, name = "userVerifyId", value = "审核房产 id"),
58
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
59
+    })
60
+    public ResponseBean deleteUserVerify(@PathVariable("userVerifyId") Integer userVerifyId, HttpSession session) {
61
+        ResponseBean responseBean = new ResponseBean();
62
+        UserElement userElement = getUserElement(session);
63
+        responseBean = taUserVerifyServicel.deleteUserVerify(userVerifyId);
64
+        return responseBean;
65
+    }
66
+
67
+    @RequestMapping(value = "/current_user/verify/delete/{userVerifyId}", method = RequestMethod.DELETE)
68
+    @ApiOperation(value = "删除当前用户 关联的房产", notes = "删除当前用户 关联的房产")
69
+    @ApiImplicitParams({
70
+            @ApiImplicitParam(paramType = "path", dataTypeClass = Integer.class, name = "userVerifyId", value = "审核房产 id"),
71
+            @ApiImplicitParam(paramType = "header", dataTypeClass = String.class, name = "X-Auth-Token", value = "Token")
72
+    })
73
+    public ResponseBean deleteCurrentUserVerify(@PathVariable("userVerifyId") Integer userVerifyId, HttpSession session) {
74
+        ResponseBean responseBean = new ResponseBean();
75
+        UserElement userElement = getUserElement(session);
76
+        responseBean = taUserVerifyServicel.deleteCurrentUserVerify(userElement, userVerifyId);
77
+        return responseBean;
78
+    }
79
+
80
+    @RequestMapping(value = "/user/verify/list", method = RequestMethod.GET)
81
+    @ApiOperation(value = "获取 当前用户关联的房产列表", notes = "获取 当前用户关联的房产列表")
82
+    public ResponseBean getByCurrentUser(HttpSession session) {
83
+        ResponseBean responseBean = new ResponseBean();
84
+        UserElement userElement = getUserElement(session);
85
+        responseBean = taUserVerifyServicel.getByCurrentUser(userElement);
86
+        return responseBean;
87
+    }
43 88
 
44 89
 }

+ 0
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/WxLoginController.java Näytä tiedosto

@@ -8,7 +8,6 @@ import org.springframework.cloud.context.config.annotation.RefreshScope;
8 8
 import org.springframework.util.StringUtils;
9 9
 import org.springframework.web.bind.annotation.PathVariable;
10 10
 import org.springframework.web.bind.annotation.RequestMapping;
11
-import org.springframework.web.bind.annotation.ResponseBody;
12 11
 import org.springframework.web.bind.annotation.RestController;
13 12
 
14 13
 import javax.servlet.http.HttpServletRequest;

+ 11
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TaSysRoleMapper.java Näytä tiedosto

@@ -3,6 +3,8 @@ package com.community.huiju.dao;
3 3
 
4 4
 import com.community.huiju.model.TaSysRole;
5 5
 import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.ResultMap;
7
+import org.apache.ibatis.annotations.Select;
6 8
 
7 9
 import java.util.List;
8 10
 
@@ -22,4 +24,13 @@ public interface TaSysRoleMapper {
22 24
 
23 25
     TaSysRole findRoleByUserId(Integer userId);
24 26
 
27
+    /**
28
+     * 根据 角色名称 查询
29
+     * @param roleName
30
+     * @return
31
+     */
32
+    @ResultMap("BaseResultMap")
33
+    @Select("select * from ta_sys_role where role_name=#{roleName}")
34
+    TaSysRole selectByRoleName(String roleName);
35
+
25 36
 }

+ 1
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBuildingMapper.java Näytä tiedosto

@@ -32,4 +32,5 @@ public interface TpBuildingMapper {
32 32
      */
33 33
     List<TpBuilding> selectByAddress(Integer communityId,String phase,String building, String unit,String level,String roomNo);
34 34
 
35
+
35 36
 }

+ 2
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBuildingOwnerInfoMapper.java Näytä tiedosto

@@ -31,8 +31,6 @@ public interface TpBuildingOwnerInfoMapper {
31 31
     //根据手机号查询当前信息
32 32
     TpBuildingOwnerInfo selectOwnerTel(@Param("ownerTel")String ownerTel);
33 33
 
34
-    @Select("select * from tp_building_owner_info where owner_tel=#{ownerTel}")
35
-    List<TpBuildingOwnerInfo> sellectHouseList(@Param("ownerTel") String ownerTel);
36 34
 
37 35
     /**
38 36
      * 查询当前房产所在的小区
@@ -53,8 +51,9 @@ public interface TpBuildingOwnerInfoMapper {
53 51
     @ResultMap("BaseResultMap")
54 52
     @Select("select * from tp_building_owner_info where community_id=#{communityId}" +
55 53
             " and phase=#{phase} and building=#{building} and unit=#{unit}" +
56
-            " and level=#{level} and room_no=#{roomNo}")
54
+            " and level=#{level} and room_no=#{roomNo} and verify_status=1")
57 55
     TpBuildingOwnerInfo selectCommunityIdAndAddress(@Param("communityId") Integer communityId, @Param("phase") String phase,
58 56
                                                     @Param("building") String building, @Param("unit") String unit,
59 57
                                                     @Param("level") String level, @Param("roomNo") String roomNo);
58
+
60 59
 }

+ 25
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TaUserVerify.java Näytä tiedosto

@@ -42,6 +42,15 @@ public class TaUserVerify {
42 42
      */
43 43
     private String ownerName;
44 44
 
45
+    /**
46
+     * 小区名称
47
+     */
48
+    private String communityName;
49
+
50
+    /**
51
+     * 小区 省市区
52
+     */
53
+    private String communityAddress;
45 54
 
46 55
     public Integer getId() {
47 56
         return id;
@@ -154,4 +163,20 @@ public class TaUserVerify {
154 163
     public void setVerifyName(String verifyName) {
155 164
         this.verifyName = verifyName;
156 165
     }
166
+
167
+    public String getCommunityName() {
168
+        return communityName;
169
+    }
170
+
171
+    public void setCommunityName(String communityName) {
172
+        this.communityName = communityName;
173
+    }
174
+
175
+    public String getCommunityAddress() {
176
+        return communityAddress;
177
+    }
178
+
179
+    public void setCommunityAddress(String communityAddress) {
180
+        this.communityAddress = communityAddress;
181
+    }
157 182
 }

+ 1
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/IBuildingOwnerInfo.java Näytä tiedosto

@@ -26,7 +26,6 @@ public interface IBuildingOwnerInfo {
26 26
 
27 27
     /**
28 28
      * 根据 小区/期/楼栋/单元/楼层/户号
29
-     * @param communityId
30 29
      * @param phase
31 30
      * @param building
32 31
      * @param unit
@@ -34,6 +33,6 @@ public interface IBuildingOwnerInfo {
34 33
      * @param roomNo
35 34
      * @return
36 35
      */
37
-    ResponseBean hasBuild(UserElement userElement,Integer communityId, String phase, String building, String unit, String level, String roomNo);
36
+    ResponseBean hasBuild(UserElement userElement,String phase, String building, String unit, String level, String roomNo);
38 37
 
39 38
 }

+ 5
- 4
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java Näytä tiedosto

@@ -50,10 +50,10 @@ public interface ITaUserService {
50 50
 
51 51
     /**
52 52
      * 获取房屋成员列表
53
-     * @param parentId
53
+     * @param userElement
54 54
      * @return
55 55
      */
56
-    List<TaUser> getAllRoomUserList(Integer parentId);
56
+    ResponseBean getAllRoomUserList(UserElement userElement);
57 57
 
58 58
     /**
59 59
      * 修改用户
@@ -130,9 +130,10 @@ public interface ITaUserService {
130 130
     ResponseBean addWelcomeUser(UserElement userElement,TaUser user);
131 131
 
132 132
     /**
133
-     * 查看当前用户所有关联房产
133
+     * 绑定选中的当前房产,进行登录 (在APP登录后,选择房产的时候), 还可以用于切换房产登录
134 134
      * @param userElement
135
+     * @param userVerifyId
135 136
      * @return
136 137
      */
137
-    ResponseBean userHouseList(UserElement userElement);
138
+    ResponseBean bindingLoginAndHouse(UserElement userElement, Integer userVerifyId);
138 139
 }

+ 32
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TaUserVerifyServicel.java Näytä tiedosto

@@ -10,11 +10,41 @@ import com.community.commom.session.UserElement;
10 10
 public interface TaUserVerifyServicel {
11 11
 
12 12
     /**
13
-     * 查询 app端用户审核表 的数据
13
+     * 获取当前 一个待审核或审核不通过房产 的数据
14 14
      * @param userElement
15 15
      * @param userVerifyId
16 16
      * @return
17 17
      */
18
-    ResponseBean getList(UserElement userElement, Integer userVerifyId);
18
+    ResponseBean getToAuditNotApproved(UserElement userElement, Integer userVerifyId);
19
+
20
+    /**
21
+     * 添加 一个审核房产
22
+     * @param userElement
23
+     * @param parameter
24
+     * @return
25
+     */
26
+    ResponseBean addUserVerify(UserElement userElement, String parameter);
27
+
28
+    /**
29
+     * 根据id 删除 审核表
30
+     * @param userVerifyId
31
+     * @return
32
+     */
33
+    ResponseBean deleteUserVerify(Integer userVerifyId);
34
+
35
+    /**
36
+     * 获取 当前用户绑定的房产列表
37
+     * @param userElement
38
+     * @return
39
+     */
40
+    ResponseBean getByCurrentUser(UserElement userElement);
41
+
42
+    /**
43
+     * 根据房产id  删除当前用户的房产
44
+     * @param userElement
45
+     * @param userVerifyId
46
+     * @return
47
+     */
48
+    ResponseBean deleteCurrentUserVerify(UserElement userElement, Integer userVerifyId);
19 49
 
20 50
 }

+ 15
- 4
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/BuildingOwnerInfoImpl.java Näytä tiedosto

@@ -32,6 +32,9 @@ public class BuildingOwnerInfoImpl implements IBuildingOwnerInfo {
32 32
     @Autowired
33 33
     private TpBuildingMapper tpBuildingMapper;
34 34
 
35
+    @Autowired
36
+    private TpBuildingOwnerInfoMapper tpBuildingOwnerInfoMapper;
37
+
35 38
     @Autowired
36 39
     private TaUserVerifyMapper taUserVerifyMapper;
37 40
 
@@ -45,19 +48,27 @@ public class BuildingOwnerInfoImpl implements IBuildingOwnerInfo {
45 48
     }
46 49
 
47 50
     @Override
48
-    public ResponseBean hasBuild(UserElement userElement, Integer communityId, String phase, String building, String unit, String level, String roomNo) {
51
+    public ResponseBean hasBuild(UserElement userElement,  String phase, String building, String unit, String level, String roomNo) {
49 52
         ResponseBean responseBean = new ResponseBean();
50 53
         // 1.检验该用户关联有没有这个 户号
51
-        // 2.检验这个户号是否关联了 户主
52
-        TaUserVerify taUserVerify = taUserVerifyMapper.selectCommunityAndAddress(userElement.getId(),communityId, phase, building, unit, level, roomNo);
54
+        TaUserVerify taUserVerify = taUserVerifyMapper.selectCommunityAndAddress(userElement.getId(),userElement.getCommunityId(), phase, building, unit, level, roomNo);
53 55
         if (null != taUserVerify) {
54 56
             responseBean.addError("您已关联此房产,无法再次关联!");
55 57
             return responseBean;
56 58
         }
57 59
 
58
-        // TODO 查询出这个户号的业主
60
+        Map<String,Object> result = Maps.newHashMap();
59 61
 
62
+        // 2.检验这个户号是否关联了 户主
63
+        TpBuildingOwnerInfo tpBuildingOwnerInfo = tpBuildingOwnerInfoMapper.selectCommunityIdAndAddress(userElement.getCommunityId(), phase, building, unit, level, roomNo);
64
+        if (null != tpBuildingOwnerInfo) {
65
+            result.put("ownerName",tpBuildingOwnerInfo.getOwnerName());
66
+            result.put("roleName", "OWNER");
67
+            responseBean.addSuccess(result);
68
+            return responseBean;
69
+        }
60 70
 
71
+        responseBean.addError("该房产,暂无审核通过的业主!");
61 72
         return responseBean;
62 73
     }
63 74
 }

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Näytä tiedosto

@@ -90,7 +90,7 @@ public class SocialServiceImpl implements SocialServiceI {
90 90
 
91 91
     @Autowired
92 92
     private  TpTransactionLikeMapper tpTransactionLikeMapper;
93
-
93
+    
94 94
     @Override
95 95
     @Transactional
96 96
     public TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId, Integer userId) {

+ 50
- 30
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java Näytä tiedosto

@@ -136,27 +136,7 @@ public class TaUserServiceImpl implements ITaUserService {
136 136
              * 登陆成功后这个 审核id 会存 session
137 137
              */
138 138
 
139
-            // 设置 这个审核id (这个要返给前端)
140
-            taUserVO.setUserVerifyId(userVerify.getId());
141
-
142
-            // 认证状态  0 是未审核   1是审核通过   2是审核不通过
143
-            String verifyStatus = userVerify.getVerifyStatus();
144
-            // 有一个审核通过的房产
145
-            if ("1".equals(verifyStatus)) {
146
-                // 设置 userVO 信息
147
-                setUserVoProperties(userVerify.getCommunityId(), taUserVO);
148
-
149
-                taUserVO.setAddressBuilding(userVerify.getPhase() + userVerify.getBuilding() + userVerify.getUnit() + userVerify.getLevel() + userVerify.getRoomNo());
150
-                TaSysRole taSysRole = taSysRoleMapper.selectByPrimaryKey(userVerify.getRoleId());
151
-                taUserVO.setRole(taSysRole.getRoleName());
152
-
153
-                response.addSuccess(UserVerifyEnum.A_AUDIT_REAL_ESTATE.getCode(),taUserVO);
154
-                return response;
155
-            }
156
-            String resultCode = "0".equals(verifyStatus) ? UserVerifyEnum.A_TO_AUDIT_REAL_ESTATE.getCode() :
157
-                                "2".equals(verifyStatus) ? UserVerifyEnum.A_AUDIT_FAILED_REAL_ESTATE.getCode() : "500";
158
-            response.addSuccess(resultCode, taUserVO);
159
-            return response;
139
+            return checkHouse(response, taUserVO, userVerify);
160 140
         } else if (taUserVerifies.size() >= 2) {
161 141
             BeanUtils.copyProperties(currentUser, taUserVO);
162 142
             response.addSuccess(UserVerifyEnum.A_MULTIPLE_REAL_ESTATE.getCode(), taUserVO);
@@ -353,8 +333,9 @@ public class TaUserServiceImpl implements ITaUserService {
353 333
     }
354 334
 
355 335
     @Override
356
-    public List<TaUser> getAllRoomUserList(Integer parentId) {
357
-        List<TaUser> taUserList = taUserMapper.selectUserListByParentId(parentId);
336
+    public ResponseBean getAllRoomUserList(UserElement userElement) {
337
+        ResponseBean responseBean = new ResponseBean();
338
+        List<TaUser> taUserList = taUserMapper.selectUserListByParentId(userElement.getId());
358 339
         taUserList.stream().forEach(e->{
359 340
             // 角色
360 341
             TaSysRole taSysRole = taSysRoleMapper.findRoleByUserId(e.getId());
@@ -362,7 +343,8 @@ public class TaUserServiceImpl implements ITaUserService {
362 343
             e.setRole(taSysRole.getId());
363 344
         });
364 345
 
365
-        return taUserList;
346
+        responseBean.addSuccess(taUserList);
347
+        return responseBean;
366 348
     }
367 349
 
368 350
     @Transactional(rollbackFor = Exception.class)
@@ -980,11 +962,49 @@ public class TaUserServiceImpl implements ITaUserService {
980 962
     }
981 963
 
982 964
     @Override
983
-    public ResponseBean userHouseList(UserElement userElement) {
984
-        ResponseBean response= new ResponseBean();
985
-        /*根据手机号会查询所有小区的多套房产*/
986
-        List<TpBuildingOwnerInfo> tpBuildingOwnerInfo  = tpBuildingOwnerInfoMapper.sellectHouseList(userElement.getLoginName());
987
-        response.addSuccess(tpBuildingOwnerInfo);
988
-        return response;
965
+    public ResponseBean bindingLoginAndHouse(UserElement userElement, Integer userVerifyId) {
966
+        ResponseBean responseBean = new ResponseBean();
967
+        TaUserVO taUserVO = new TaUserVO();
968
+        TaUserVerify userVerify = taUserVerifyMapper.selectByPrimaryKey(userVerifyId);
969
+        if (null != userVerify) {
970
+            if (userElement.getId().intValue() != userVerify.getUserId().intValue()) {
971
+                throw new WisdomException("您未绑定该房产!");
972
+            }
973
+            TaUser currentUser = taUserMapper.selectByPrimaryKey(userElement.getId());
974
+            BeanUtils.copyProperties(currentUser, taUserVO);
975
+            return checkHouse(responseBean, taUserVO, userVerify);
976
+        }
977
+        throw new WisdomException("该房产不存在!");
978
+    }
979
+
980
+    /**
981
+     * 校验 房产的状态
982
+     * @param responseBean
983
+     * @param taUserVO
984
+     * @param userVerify
985
+     * @return
986
+     */
987
+    private ResponseBean checkHouse(ResponseBean responseBean, TaUserVO taUserVO, TaUserVerify userVerify) {
988
+        // 设置 这个审核id (这个要返给前端)
989
+        taUserVO.setUserVerifyId(userVerify.getId());
990
+
991
+        // 认证状态  0 是未审核   1是审核通过   2是审核不通过
992
+        String verifyStatus = userVerify.getVerifyStatus();
993
+        // 有一个审核通过的房产
994
+        if ("1".equals(verifyStatus)) {
995
+            // 设置 userVO 信息
996
+            setUserVoProperties(userVerify.getCommunityId(), taUserVO);
997
+
998
+            taUserVO.setAddressBuilding(userVerify.getPhase() + userVerify.getBuilding() + userVerify.getUnit() + userVerify.getLevel() + userVerify.getRoomNo());
999
+            TaSysRole taSysRole = taSysRoleMapper.selectByPrimaryKey(userVerify.getRoleId());
1000
+            taUserVO.setRole(taSysRole.getRoleName());
1001
+
1002
+            responseBean.addSuccess(UserVerifyEnum.A_AUDIT_REAL_ESTATE.getCode(),taUserVO);
1003
+            return responseBean;
1004
+        }
1005
+        String resultCode = "0".equals(verifyStatus) ? UserVerifyEnum.A_TO_AUDIT_REAL_ESTATE.getCode() :
1006
+                "2".equals(verifyStatus) ? UserVerifyEnum.A_AUDIT_FAILED_REAL_ESTATE.getCode() : "500";
1007
+        responseBean.addSuccess(resultCode, taUserVO);
1008
+        return responseBean;
989 1009
     }
990 1010
 }

+ 105
- 8
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserVerifyServicelmpl.java Näytä tiedosto

@@ -1,20 +1,18 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3 3
 
4
+import com.alibaba.fastjson.JSONObject;
4 5
 import com.community.commom.mode.ResponseBean;
5 6
 import com.community.commom.session.UserElement;
6
-import com.community.huiju.dao.TaSysRoleMapper;
7
-import com.community.huiju.dao.TaUserVerifyMapper;
8
-import com.community.huiju.dao.ToCommunitiesMapper;
9
-import com.community.huiju.dao.TpBuildingOwnerInfoMapper;
10
-import com.community.huiju.model.TaSysRole;
11
-import com.community.huiju.model.TaUserVerify;
12
-import com.community.huiju.model.TpBuildingOwnerInfo;
7
+import com.community.huiju.dao.*;
8
+import com.community.huiju.model.*;
13 9
 import com.community.huiju.service.TaUserVerifyServicel;
10
+import com.community.huiju.vo.TaUserVO;
14 11
 import lombok.extern.slf4j.Slf4j;
15 12
 import org.springframework.beans.factory.annotation.Autowired;
16 13
 import org.springframework.stereotype.Service;
17 14
 
15
+import java.util.Date;
18 16
 import java.util.List;
19 17
 
20 18
 /**
@@ -38,8 +36,11 @@ public class TaUserVerifyServicelmpl implements TaUserVerifyServicel {
38 36
     @Autowired
39 37
     private TpBuildingOwnerInfoMapper tpBuildingOwnerInfoMapper;
40 38
 
39
+    @Autowired
40
+    private SysNationMapper sysNationMapper;
41
+
41 42
     @Override
42
-    public ResponseBean getList(UserElement userElement, Integer userVerifyId) {
43
+    public ResponseBean getToAuditNotApproved(UserElement userElement, Integer userVerifyId) {
43 44
         ResponseBean responseBean = new ResponseBean();
44 45
         TaUserVerify taUserVerify = taUserVerifyMapper.selectByPrimaryKey(userVerifyId);
45 46
         TaSysRole taSysRole = taSysRoleMapper.selectByPrimaryKey(taUserVerify.getRoleId());
@@ -53,4 +54,100 @@ public class TaUserVerifyServicelmpl implements TaUserVerifyServicel {
53 54
         responseBean.addSuccess(taUserVerify);
54 55
         return responseBean;
55 56
     }
57
+
58
+    @Override
59
+    public ResponseBean addUserVerify(UserElement userElement, String parameter) {
60
+        ResponseBean responseBean = new ResponseBean();
61
+
62
+        JSONObject jsonObject = JSONObject.parseObject(parameter);
63
+        TaUserVerify taUserVerify = jsonObject.toJavaObject(TaUserVerify.class);
64
+
65
+        // 通过 角色名称 查询出角色的id
66
+        String roleName = jsonObject.getString("roleName");
67
+        TaSysRole sysRole = taSysRoleMapper.selectByRoleName(roleName);
68
+
69
+        taUserVerify.setRoleId(sysRole.getId());
70
+        taUserVerify.setCommunityId(userElement.getCommunityId());
71
+        taUserVerify.setUserId(userElement.getId());
72
+        taUserVerify.setVerifyStatus("0");
73
+        taUserVerify.setCreateDate(new Date());
74
+
75
+        int rows = taUserVerifyMapper.insertSelective(taUserVerify);
76
+        if (rows <= 0) {
77
+            responseBean.addError("操作失败!");
78
+            return responseBean;
79
+        }
80
+
81
+        responseBean.addSuccess(taUserVerify);
82
+        return responseBean;
83
+    }
84
+
85
+    @Override
86
+    public ResponseBean deleteUserVerify(Integer userVerifyId) {
87
+        ResponseBean responseBean = new ResponseBean();
88
+
89
+        TaUserVerify userVerify = taUserVerifyMapper.selectByPrimaryKey(userVerifyId);
90
+        if ("1".equals(userVerify.getVerifyStatus())) {
91
+            responseBean.addError("已审核通过的房产,无法删除!");
92
+            return responseBean;
93
+        }
94
+
95
+        taUserVerifyMapper.deleteByPrimaryKey(userVerifyId);
96
+        responseBean.addSuccess("操作成功!");
97
+        return responseBean;
98
+    }
99
+
100
+    @Override
101
+    public ResponseBean getByCurrentUser(UserElement userElement) {
102
+        ResponseBean responseBean = new ResponseBean();
103
+
104
+        List<TaUserVerify> userVerifyList = taUserVerifyMapper.selectByUserId(userElement.getId());
105
+        userVerifyList.forEach(e -> {
106
+            // 角色
107
+            TaSysRole taSysRole = taSysRoleMapper.selectByPrimaryKey(e.getRoleId());
108
+            e.setRoleName(taSysRole.getRoleName());
109
+            // 小区名称 、省市区
110
+            setUserVoProperties(e.getCommunityId(), e);
111
+        });
112
+
113
+        responseBean.addSuccess(userVerifyList);
114
+        return responseBean;
115
+    }
116
+
117
+    /**
118
+     * 设置 TaUserVO 的一些信息
119
+     *
120
+     *      小区,省市区
121
+     *
122
+     * @param communityId
123
+     * @param taUserVerify
124
+     */
125
+    private void setUserVoProperties(Integer communityId, TaUserVerify taUserVerify) {
126
+        // 获取小区
127
+        ToCommunities toCommunities = toCommunitiesMapper.selectByPrimaryKey(communityId);
128
+        // 省
129
+        SysNation province = sysNationMapper.selectByPrimaryKey(toCommunities.getProvinceId());
130
+        // 市
131
+        SysNation city = sysNationMapper.selectByPrimaryKey(toCommunities.getCityId());
132
+        // 区
133
+        SysNation district = sysNationMapper.selectByPrimaryKey(toCommunities.getDistrictId());
134
+
135
+        taUserVerify.setCommunityAddress(province.getProvince()+""+city.getCity()+""+district.getDistrict() + toCommunities.getCommunityName());
136
+        taUserVerify.setCommunityName(toCommunities.getCommunityName());
137
+    }
138
+
139
+    @Override
140
+    public ResponseBean deleteCurrentUserVerify(UserElement userElement, Integer userVerifyId) {
141
+        ResponseBean responseBean = new ResponseBean();
142
+
143
+        TaUserVerify userVerify = taUserVerifyMapper.selectByPrimaryKey(userVerifyId);
144
+        if (userElement.getUserVerifyId()  == userVerify.getId()) {
145
+            responseBean.addError("无法删除当前登录的房产!");
146
+            return responseBean;
147
+        }
148
+
149
+        taUserVerifyMapper.deleteByPrimaryKey(userVerifyId);
150
+        responseBean.addSuccess("操作成功!");
151
+        return responseBean;
152
+    }
56 153
 }

+ 1
- 1
CODE/smart-community/app-api/src/main/resources/mapper/TaUserVerifyMapper.xml Näytä tiedosto

@@ -191,6 +191,6 @@
191 191
     and building = #{building,jdbcType=VARCHAR}
192 192
     and unit = #{unit,jdbcType=VARCHAR}
193 193
     and level = #{level,jdbcType=VARCHAR}
194
-    and roomNo = #{room_no,jdbcType=VARCHAR}
194
+    and room_no = #{roomNo,jdbcType=VARCHAR}
195 195
   </select>
196 196
 </mapper>

+ 6
- 0
CODE/smart-community/community-common/src/main/java/com/community/commom/mode/ResponseBean.java Näytä tiedosto

@@ -47,6 +47,12 @@ public class ResponseBean<T> implements Serializable {
47 47
         this.data = data;
48 48
     }
49 49
 
50
+    public void addSuccess(String code, String message, T data) {
51
+        this.code = code;
52
+        this.message = message;
53
+        this.data = data;
54
+    }
55
+
50 56
     public void addSuccess(T data) {
51 57
         this.code = "0";
52 58
         this.message = "成功";

+ 1576
- 949
文档/MYSQL/smartCommunity.pdb
File diff suppressed because it is too large
Näytä tiedosto


+ 1576
- 949
文档/MYSQL/smartCommunity.pdm
File diff suppressed because it is too large
Näytä tiedosto