Преглед изворни кода

修复 修改楼栋资料的时候 分 已认证和为认证情况,

weiximei пре 6 година
родитељ
комит
61fa34f897

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

@@ -44,9 +44,10 @@ public class BuildingOwnerInfoController extends BaseController {
44 44
                     "pageNum第几页;pageSize 一页多少行;")
45 45
     })
46 46
     @RequestMapping(value = "/building/list", method = RequestMethod.POST)
47
-    public ResponseBean getList(@RequestBody String parameter){
47
+    public ResponseBean getList(@RequestBody String parameter, HttpSession session){
48 48
         ResponseBean responseBean = new ResponseBean();
49
-        responseBean = iBuildingOwnerInfoService.listQuery(parameter);
49
+        UserElement userElement = getUserElement(session);
50
+        responseBean = iBuildingOwnerInfoService.listQuery(parameter, userElement);
50 51
         return responseBean;
51 52
     }
52 53
 

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

@@ -30,7 +30,6 @@ public class User implements Serializable {
30 30
     /**
31 31
      * 小区id, 这字段作废不使用
32 32
      */
33
-    @Deprecated
34 33
     private Integer communityId;
35 34
 
36 35
     /**

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

@@ -26,9 +26,10 @@ public interface IBuildingOwnerInfoService extends IService<TpBuildingOwnerInfo>
26 26
     /**
27 27
      * 根据条件查询
28 28
      * @param parameter
29
+     * @param userElement 用户登陆后的信息
29 30
      * @return
30 31
      */
31
-    ResponseBean listQuery(String parameter);
32
+    ResponseBean listQuery(String parameter, UserElement userElement);
32 33
 
33 34
     /**
34 35
      * 修改 楼栋业主信息

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

@@ -80,7 +80,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
80 80
     public static final Logger logger = LoggerFactory.getLogger(BuildingOwnerInfoServiceImpl.class);
81 81
     
82 82
     @Override
83
-    public ResponseBean listQuery(String parameter) {
83
+    public ResponseBean listQuery(String parameter, UserElement userElement) {
84 84
 
85 85
         ResponseBean responseBean = new ResponseBean();
86 86
 
@@ -93,6 +93,8 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
93 93
         Page<TpBuildingOwnerInfo> page = new Page(pageNum,pageSize);
94 94
 
95 95
         Map<String, Object> map = Maps.newHashMap();
96
+        // 小区Id
97
+        map.put("community_id", userElement.getCommunityId());
96 98
         // 栋
97 99
         map.put("building", tpBuildingOwnerInfo.getBuilding());
98 100
         // 单元
@@ -144,6 +146,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
144 146
         }
145 147
 
146 148
         // 物业端的用户,也就是正在操作的物业人员
149
+        // 物业端用户小区Id不使用! 小区 Id 获取请使用 userElement
147 150
         User user = userMapper.selectById(userElement.getId());
148 151
 
149 152
         /**
@@ -184,8 +187,7 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
184 187
             return responseBean;
185 188
         }
186 189
 
187
-        // 开始修改手机号操作!
188
-
190
+        // 开始更新楼栋资料
189 191
         BeanTools.copyProperties(tpBuildingOwnerInfo, oldTpBuildingOwnerInfo);
190 192
 
191 193
         oldTpBuildingOwnerInfo.setUpdateDate(LocalDateTime.now());
@@ -197,15 +199,29 @@ public class BuildingOwnerInfoServiceImpl extends ServiceImpl<TpBuildingOwnerInf
197 199
             throw new WisdomException("操作失败!");
198 200
         }
199 201
 
200
-        // 修改 APP 端业主用户的手机号信息!
202
+        /**
203
+         * APP 端这里, 如果楼栋资料库是已认证和已关联的! 那么就不允许修改手机号
204
+         */
205
+
201 206
         // 开始匹配 APP 端用户表
202 207
         // 查询 APP 端业主
203
-        TaUser appOwnerUser = getByIdAndCommunityId(tpBuildingOwnerInfo.getOwnerTel(), tpBuildingOwnerInfo.getCommunityId());
204
-        if (null != appOwnerUser) {
205
-            // 修改手机号
206
-            appOwnerUser.setLoginName(tpBuildingOwnerInfo.getOwnerTel());
208
+        TaUser appOwnerUser = getByIdAndCommunityId(tpBuildingOwnerInfo.getOwnerTel(), oldTpBuildingOwnerInfo.getCommunityId());
209
+        if (null != appOwnerUser
210
+                && !"1".equals(oldTpBuildingOwnerInfo.getVerifyStatus())
211
+                && !"1".equals(oldTpBuildingOwnerInfo.getPairStatus())) {
212
+            // 修改APP端信息
213
+            appOwnerUser.setUserName(tpBuildingOwnerInfo.getOwnerName());
214
+            appOwnerUser.setVerifyStatus("1");
215
+            appOwnerUser.setBuildingOwnerInfoId(tpBuildingOwnerInfo.getId());
207 216
             row = taUserMapper.updateById(appOwnerUser);
208 217
 
218
+            // 更新 楼栋业主信息表 的认证,关联状态
219
+            // 认证状态  0 是未认证    1是认证通过   2是已作废
220
+            oldTpBuildingOwnerInfo.setVerifyStatus("1");
221
+            // 关联状态   0 未关联  1 是已关联
222
+            oldTpBuildingOwnerInfo.setPairStatus("1");
223
+            row = tpBuildingOwnerInfoMapper.updateById(oldTpBuildingOwnerInfo);
224
+
209 225
             // 更新APP端用户的角色身份为 业主
210 226
             updateAppRole(tpBuildingOwnerInfo.getCommunityId(), appOwnerUser.getId(), Constant.OWNER_ID);
211 227
         }