From 6424521a768125e66b64a23d2094e05eb95b105f Mon Sep 17 00:00:00 2001 From: huanghongfa <huanghongfa123456> Date: 星期五, 08 十月 2021 11:30:14 +0800 Subject: [PATCH] bug修复 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActSocialOrgServiceImpl.java | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActSocialOrgServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActSocialOrgServiceImpl.java index 52a0420..a5d580a 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActSocialOrgServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActSocialOrgServiceImpl.java @@ -8,6 +8,7 @@ import com.panzhihua.common.model.vos.community.ComActSocialOrgVO; import com.panzhihua.common.model.vos.user.AdministratorsUserVO; import com.panzhihua.common.service.user.UserService; +import com.panzhihua.service_community.entity.ComActCommittee; import com.panzhihua.service_community.entity.ComActSocialOrg; import com.panzhihua.service_community.dao.ComActSocialOrgDao; import com.panzhihua.service_community.service.ComActSocialOrgService; @@ -53,6 +54,8 @@ administratorsUserVO.setPassword(comActSocialOrgVO.getPassword()); administratorsUserVO.setRoleId(comActSocialOrgVO.getRoleId()); administratorsUserVO.setCommunityId(comActSocialOrg.getCommunityId()); + administratorsUserVO.setName(comActSocialOrgVO.getContactName()); + administratorsUserVO.setPhone(comActSocialOrgVO.getContactPhone()); R r=userService.addUserBackstageProperty(administratorsUserVO); if(R.isOk(r)){ comActSocialOrg.setUserId(Long.parseLong(r.getData().toString())); @@ -60,6 +63,7 @@ this.comActSocialOrgDao.insert(comActSocialOrg); return R.ok(); } + return R.fail("账号或手机号已存在"); } return R.fail(); } @@ -69,6 +73,14 @@ if(comActSocialOrgVO!=null){ ComActSocialOrg comActSocialOrg=new ComActSocialOrg(); BeanUtils.copyProperties(comActSocialOrgVO,comActSocialOrg); + if(comActSocialOrgVO.getRoleId()!=null){ + ComActSocialOrg comPropertyBase=this.comActSocialOrgDao.selectById(comActSocialOrgVO.getId()); + AdministratorsUserVO administratorsUserVO=new AdministratorsUserVO(); + administratorsUserVO.setUserId(comPropertyBase.getUserId()); + administratorsUserVO.setRoleId(comActSocialOrgVO.getRoleId()); + administratorsUserVO.setLastLoginTime(DateUtil.date()); + this.userService.putUserBackstage(administratorsUserVO); + } this.comActSocialOrgDao.updateById(comActSocialOrg); return R.ok(); } @@ -84,12 +96,9 @@ AdministratorsUserVO administratorsUserVO=new AdministratorsUserVO(); administratorsUserVO.setUserId(comActSocialOrg.getUserId()); administratorsUserVO.setCommunityId(comActSocialOrg.getCommunityId()); - R r=userService.deleteUserBackstage(administratorsUserVO); - if(R.isOk(r)){ - this.comActSocialOrgDao.deleteById(id); - return R.ok(); - } - return R.fail("账号删除失败"); + userService.deleteUserBackstage(administratorsUserVO); + this.comActSocialOrgDao.deleteById(id); + return R.ok(); } } return R.fail("用户账号错误"); -- Gitblit v1.7.1