|
@@ -35,6 +35,8 @@ import java.time.format.DateTimeFormatter;
|
35
|
35
|
import java.util.*;
|
36
|
36
|
import java.util.logging.SimpleFormatter;
|
37
|
37
|
|
|
38
|
+import static com.community.commom.constant.Constant.OWNER;
|
|
39
|
+
|
38
|
40
|
/**
|
39
|
41
|
* 用户业务 实现
|
40
|
42
|
* @author weiximei
|
|
@@ -239,7 +241,7 @@ public class TaUserServiceImpl implements ITaUserService {
|
239
|
241
|
|
240
|
242
|
@Transactional(rollbackFor = Exception.class)
|
241
|
243
|
@Override
|
242
|
|
- public ResponseBean upDateloginName(Integer id, String paramets) {
|
|
244
|
+ public ResponseBean upDateloginName(Integer id, String paramets,Integer communityId) {
|
243
|
245
|
ResponseBean response = new ResponseBean();
|
244
|
246
|
|
245
|
247
|
JSONObject jsonObject = JSONObject.parseObject(paramets);
|
|
@@ -288,11 +290,11 @@ public class TaUserServiceImpl implements ITaUserService {
|
288
|
290
|
response.addError("验证码错误!");
|
289
|
291
|
return response;
|
290
|
292
|
}
|
291
|
|
-
|
292
|
|
-
|
293
|
293
|
TaUser taUser=new TaUser();
|
294
|
294
|
taUser.setLoginName(phone);
|
295
|
295
|
taUser.setId(userId);
|
|
296
|
+ taUser.setUpdateDate(new Date());
|
|
297
|
+ taUser.setUpdateUser(id);
|
296
|
298
|
taUserMapper.updateLongName(taUser);
|
297
|
299
|
response.addSuccess("修改成功");
|
298
|
300
|
AppkeyCache.setCache(user.getLoginName(),"null");
|
|
@@ -303,10 +305,10 @@ public class TaUserServiceImpl implements ITaUserService {
|
303
|
305
|
*/
|
304
|
306
|
|
305
|
307
|
// 修改楼栋信息资料库的手机号
|
306
|
|
- Map<String, Object> map = Maps.newHashMap();
|
307
|
|
- map.put("communityId", user.getCommunityId());
|
308
|
|
- map.put("userId", userId);
|
309
|
|
- TaSysUserRole taSysUserRole = taSysUserRoleMapper.selectByCommunityIdAndUserId(map);
|
|
308
|
+ Map<String, Object> roleMap = Maps.newHashMap();
|
|
309
|
+ roleMap.put("communityId", user.getCommunityId());
|
|
310
|
+ roleMap.put("userId", userId);
|
|
311
|
+ TaSysUserRole taSysUserRole = taSysUserRoleMapper.selectByCommunityIdAndUserId(roleMap);
|
310
|
312
|
// 1 业主 2 租客 3 家属
|
311
|
313
|
// 只允许业主修改
|
312
|
314
|
if (taSysUserRole.getRoleId().intValue() == 1) {
|
|
@@ -350,10 +352,24 @@ public class TaUserServiceImpl implements ITaUserService {
|
350
|
352
|
ResponseBean response = new ResponseBean();
|
351
|
353
|
|
352
|
354
|
TaUser taUser = taUserMapper.selectByPrimaryKey(user.getId());
|
|
355
|
+ HashMap map= new HashMap<>();
|
|
356
|
+ map.put("communityId",taUser.getCommunityId());
|
|
357
|
+ map.put("userId",taUser.getId());
|
|
358
|
+ TaSysUserRole TaSysUserRole= taSysUserRoleMapper.selectByCommunityIdAndUserId(map);
|
353
|
359
|
BeanTools.copyProperties(user, taUser);
|
354
|
|
-
|
355
|
|
- int result = taUserMapper.updateByPrimaryKeySelective(taUser);
|
356
|
|
-
|
|
360
|
+ int result = taUserMapper.updateByPrimaryKeySelective(taUser);
|
|
361
|
+ int VerifyStatus= Integer.parseInt(taUser.getVerifyStatus());
|
|
362
|
+ int Role= TaSysUserRole.getRoleId();
|
|
363
|
+ if (1==VerifyStatus &&1==Role) {
|
|
364
|
+ TpBuildingOwnerInfo TpBuildingOwnerInfo = new TpBuildingOwnerInfo();
|
|
365
|
+ TpBuildingOwnerInfo.setOwnerName(user.getUserName());
|
|
366
|
+ TpBuildingOwnerInfo.setGender(user.getGender());
|
|
367
|
+ TpBuildingOwnerInfo.setOwnerTel(user.getLoginName());
|
|
368
|
+ TpBuildingOwnerInfo.setUpdateDate(new Date());
|
|
369
|
+ TpBuildingOwnerInfo.setUpdateUser(taUser.getId());
|
|
370
|
+ TpBuildingOwnerInfo.setId(taUser.getBuildingOwnerInfoId());
|
|
371
|
+ tpBuildingOwnerInfoMapper.updateByPrimaryKeySelective(TpBuildingOwnerInfo);
|
|
372
|
+ }
|
357
|
373
|
if (result > 0){
|
358
|
374
|
response.addSuccess("修改成功!");
|
359
|
375
|
}else {
|