From d99a56e37cf9109b46ee68d34a06594ef5615ed3 Mon Sep 17 00:00:00 2001
From: 张天森 <1292933220@qq.com>
Date: 星期四, 10 十一月 2022 16:06:05 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/huacheng_test' into huacheng_test
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActSocialOrgServiceImpl.java | 61 ++++++++++++++++++++++--------
1 files changed, 45 insertions(+), 16 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 a5d580a..a55482d 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,9 +8,11 @@
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.dao.ComActDAO;
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.model.dos.ComActDO;
import com.panzhihua.service_community.service.ComActSocialOrgService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
@@ -32,6 +34,8 @@
private ComActSocialOrgDao comActSocialOrgDao;
@Resource
private UserService userService;
+@Resource
+private ComActDAO comActDAO;
@Override
public R pageList(CommonPage commonPage) {
return R.ok(comActSocialOrgDao.pageList(new Page(commonPage.getPage(),commonPage.getSize()),commonPage));
@@ -39,7 +43,7 @@
@Override
public R selectById(Long id) {
- return null;
+ return R.ok(comActSocialOrgDao.detail(id));
}
@Override
@@ -52,9 +56,28 @@
administratorsUserVO.setType(3);
administratorsUserVO.setAccount(comActSocialOrgVO.getAccount());
administratorsUserVO.setPassword(comActSocialOrgVO.getPassword());
- administratorsUserVO.setRoleId(comActSocialOrgVO.getRoleId());
- administratorsUserVO.setCommunityId(comActSocialOrg.getCommunityId());
- administratorsUserVO.setName(comActSocialOrgVO.getContactName());
+ //根据roleId判断是普通社会组织还是定制三社
+ if(comActSocialOrgVO.getRoleId()==null){
+ administratorsUserVO.setSocialType(2);
+ administratorsUserVO.setRoleId(777777777L);
+ comActSocialOrg.setIsSociety(1);
+ Long affiliatedUnit = comActSocialOrg.getAffiliatedUnit();
+ Integer affiliatedUnitType = comActSocialOrg.getAffiliatedUnitType();
+ if (affiliatedUnitType.equals(2)) {
+ administratorsUserVO.setCommunityId(affiliatedUnit);
+ ComActDO comActDO = comActDAO.selectById(affiliatedUnit);
+ comActSocialOrg.setStreetId(comActDO.getStreetId());
+ }
+ administratorsUserVO.setName(comActSocialOrgVO.getCorporationName());
+ } else {
+ administratorsUserVO.setRoleId(comActSocialOrgVO.getRoleId());
+ if(comActSocialOrg.getCommunityId()!=null){
+ administratorsUserVO.setCommunityId(comActSocialOrg.getCommunityId());
+ ComActDO comActDO = comActDAO.selectById(comActSocialOrg.getCommunityId());
+ comActSocialOrg.setStreetId(comActDO.getStreetId());
+ }
+ administratorsUserVO.setName(comActSocialOrgVO.getContactName());
+ }
administratorsUserVO.setPhone(comActSocialOrgVO.getContactPhone());
R r=userService.addUserBackstageProperty(administratorsUserVO);
if(R.isOk(r)){
@@ -71,18 +94,24 @@
@Override
public R update(ComActSocialOrgVO comActSocialOrgVO) {
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();
+ ComActSocialOrg comActSocialOrg=new ComActSocialOrg();
+ BeanUtils.copyProperties(comActSocialOrgVO,comActSocialOrg);
+ AdministratorsUserVO administratorsUserVO=new AdministratorsUserVO();
+ if(comActSocialOrgVO.getRoleId() == null) {
+ administratorsUserVO.setRoleId(777777777L);
+ } else {
+ administratorsUserVO.setRoleId(comActSocialOrgVO.getRoleId());
+ }
+ ComActSocialOrg comPropertyBase=this.comActSocialOrgDao.selectById(comActSocialOrgVO.getId());
+ administratorsUserVO.setUserId(comPropertyBase.getUserId());
+ administratorsUserVO.setLastLoginTime(DateUtil.date());
+ administratorsUserVO.setAccount(comActSocialOrgVO.getAccount());
+ administratorsUserVO.setPassword(comActSocialOrgVO.getPassword());
+ Integer status = comActSocialOrgVO.getStatus();
+ administratorsUserVO.setStatus(status.equals(0) ? 2 : 1);
+ this.userService.putUserBackstage(administratorsUserVO);
+ this.comActSocialOrgDao.updateById(comActSocialOrg);
+ return R.ok();
}
return R.fail();
}
--
Gitblit v1.7.1