|
@ -26,6 +26,7 @@ import com.elink.esua.epdc.commons.tools.redis.UserDetailRedis; |
|
|
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|
|
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; |
|
|
import com.elink.esua.epdc.commons.tools.security.user.UserDetail; |
|
|
import com.elink.esua.epdc.commons.tools.security.user.UserDetail; |
|
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|
|
|
|
|
import com.elink.esua.epdc.commons.tools.utils.DateUtils; |
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
import com.elink.esua.epdc.commons.tools.utils.TreeUtils; |
|
|
import com.elink.esua.epdc.commons.tools.utils.TreeUtils; |
|
|
import com.elink.esua.epdc.constant.ImgConstant; |
|
|
import com.elink.esua.epdc.constant.ImgConstant; |
|
@ -45,11 +46,14 @@ import com.elink.esua.epdc.dto.epdc.result.AreaCodeParentResultDTO; |
|
|
import com.elink.esua.epdc.dto.epdc.result.UserSysDeptAreaCodeResultDTO; |
|
|
import com.elink.esua.epdc.dto.epdc.result.UserSysDeptAreaCodeResultDTO; |
|
|
import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; |
|
|
import com.elink.esua.epdc.dto.epdc.result.UserSysDeptInfoResultDTO; |
|
|
import com.elink.esua.epdc.dto.form.DeptInfoFormDTO; |
|
|
import com.elink.esua.epdc.dto.form.DeptInfoFormDTO; |
|
|
|
|
|
import com.elink.esua.epdc.dto.management.form.*; |
|
|
|
|
|
import com.elink.esua.epdc.dto.management.result.GlobalResultDTO; |
|
|
import com.elink.esua.epdc.dto.result.DeptInfoResultDTO; |
|
|
import com.elink.esua.epdc.dto.result.DeptInfoResultDTO; |
|
|
import com.elink.esua.epdc.entity.AdminImgEntity; |
|
|
import com.elink.esua.epdc.entity.AdminImgEntity; |
|
|
import com.elink.esua.epdc.entity.SysDeptEntity; |
|
|
import com.elink.esua.epdc.entity.SysDeptEntity; |
|
|
import com.elink.esua.epdc.entity.SysDeptInfoEntity; |
|
|
import com.elink.esua.epdc.entity.SysDeptInfoEntity; |
|
|
import com.elink.esua.epdc.feign.AnalysisFeignClient; |
|
|
import com.elink.esua.epdc.feign.AnalysisFeignClient; |
|
|
|
|
|
import com.elink.esua.epdc.feign.CommunityManageFeignClient; |
|
|
import com.elink.esua.epdc.feign.GroupFeignClient; |
|
|
import com.elink.esua.epdc.feign.GroupFeignClient; |
|
|
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; |
|
|
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO; |
|
|
import com.elink.esua.epdc.rocketmq.producer.OrganizationModifyProducer; |
|
|
import com.elink.esua.epdc.rocketmq.producer.OrganizationModifyProducer; |
|
@ -67,6 +71,7 @@ import java.util.ArrayList; |
|
|
import java.util.HashMap; |
|
|
import java.util.HashMap; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 部门管理 |
|
|
* 部门管理 |
|
@ -83,6 +88,9 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit |
|
|
@Autowired |
|
|
@Autowired |
|
|
private GroupFeignClient groupFeignClient; |
|
|
private GroupFeignClient groupFeignClient; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private CommunityManageFeignClient communityManageFeignClient; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private UserDetailRedis userDetailRedis; |
|
|
private UserDetailRedis userDetailRedis; |
|
|
|
|
|
|
|
@ -146,6 +154,12 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit |
|
|
return sysDeptDTO; |
|
|
return sysDeptDTO; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public DeptInfoDTO getDeptInfoById(Long id) { |
|
|
|
|
|
SysDeptEntity entity = baseDao.getById(id); |
|
|
|
|
|
return ConvertUtils.sourceToTarget(entity, DeptInfoDTO.class); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private SysDeptDTO getDeptEntity(Long id) { |
|
|
private SysDeptDTO getDeptEntity(Long id) { |
|
|
SysDeptEntity entity = baseDao.getById(id); |
|
|
SysDeptEntity entity = baseDao.getById(id); |
|
|
SysDeptDTO sysDeptDTO = ConvertUtils.sourceToTarget(entity, SysDeptDTO.class); |
|
|
SysDeptDTO sysDeptDTO = ConvertUtils.sourceToTarget(entity, SysDeptDTO.class); |
|
@ -154,7 +168,7 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit |
|
|
AdminImgDTO gridDeptDto = adminImgService.getDtoByReference(ImgConstant.GRID_DEPT_FRAMEWORK, id.toString()); |
|
|
AdminImgDTO gridDeptDto = adminImgService.getDtoByReference(ImgConstant.GRID_DEPT_FRAMEWORK, id.toString()); |
|
|
AdminImgDTO gridAreaDto = adminImgService.getDtoByReference(ImgConstant.GRID_AREA_PARTITION, id.toString()); |
|
|
AdminImgDTO gridAreaDto = adminImgService.getDtoByReference(ImgConstant.GRID_AREA_PARTITION, id.toString()); |
|
|
SysDeptInfoDTO deptInfoByDeptID = sysDeptInfoService.getDeptInfoByDeptID(id.toString()); |
|
|
SysDeptInfoDTO deptInfoByDeptID = sysDeptInfoService.getDeptInfoByDeptID(id.toString()); |
|
|
if(deptInfoByDeptID!=null){ |
|
|
if (deptInfoByDeptID != null) { |
|
|
sysDeptDTO.setIntroduction(deptInfoByDeptID.getIntroduction()); |
|
|
sysDeptDTO.setIntroduction(deptInfoByDeptID.getIntroduction()); |
|
|
sysDeptDTO.setCommunityNum(deptInfoByDeptID.getCommunityNum()); |
|
|
sysDeptDTO.setCommunityNum(deptInfoByDeptID.getCommunityNum()); |
|
|
sysDeptDTO.setGridNum(deptInfoByDeptID.getGridNum()); |
|
|
sysDeptDTO.setGridNum(deptInfoByDeptID.getGridNum()); |
|
@ -164,16 +178,16 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit |
|
|
sysDeptDTO.setLatitude(deptInfoByDeptID.getLatitude()); |
|
|
sysDeptDTO.setLatitude(deptInfoByDeptID.getLatitude()); |
|
|
sysDeptDTO.setAcreage(deptInfoByDeptID.getAcreage()); |
|
|
sysDeptDTO.setAcreage(deptInfoByDeptID.getAcreage()); |
|
|
sysDeptDTO.setCommunityManNum(deptInfoByDeptID.getCommunityManNum()); |
|
|
sysDeptDTO.setCommunityManNum(deptInfoByDeptID.getCommunityManNum()); |
|
|
if(businessDto!=null){ |
|
|
if (businessDto != null) { |
|
|
sysDeptDTO.setDeptBusinessUrl(businessDto.getImgUrl()); |
|
|
sysDeptDTO.setDeptBusinessUrl(businessDto.getImgUrl()); |
|
|
} |
|
|
} |
|
|
if(partyDto!=null){ |
|
|
if (partyDto != null) { |
|
|
sysDeptDTO.setDeptPartyUrl(partyDto.getImgUrl()); |
|
|
sysDeptDTO.setDeptPartyUrl(partyDto.getImgUrl()); |
|
|
} |
|
|
} |
|
|
if(gridDeptDto!=null){ |
|
|
if (gridDeptDto != null) { |
|
|
sysDeptDTO.setGridDeptUrl(gridDeptDto.getImgUrl()); |
|
|
sysDeptDTO.setGridDeptUrl(gridDeptDto.getImgUrl()); |
|
|
} |
|
|
} |
|
|
if(gridAreaDto!=null){ |
|
|
if (gridAreaDto != null) { |
|
|
sysDeptDTO.setGridAreaUrl(gridAreaDto.getImgUrl()); |
|
|
sysDeptDTO.setGridAreaUrl(gridAreaDto.getImgUrl()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -197,16 +211,22 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit |
|
|
entity.setParentAreaCode(areaCodeArray[areaCodeArray.length - 2]); |
|
|
entity.setParentAreaCode(areaCodeArray[areaCodeArray.length - 2]); |
|
|
} |
|
|
} |
|
|
entity.setPids(getPidList(entity.getPid())); |
|
|
entity.setPids(getPidList(entity.getPid())); |
|
|
|
|
|
|
|
|
insert(entity); |
|
|
insert(entity); |
|
|
|
|
|
|
|
|
// 插入信息表
|
|
|
// 插入信息表
|
|
|
insertInfo(dto, entity); |
|
|
insertInfo(dto, entity); |
|
|
|
|
|
|
|
|
|
|
|
// 社区管理推送
|
|
|
|
|
|
sendInfo(dto, entity, 0); |
|
|
|
|
|
|
|
|
// 新建网格党支部时创建网格党员群
|
|
|
// 新建网格党支部时创建网格党员群
|
|
|
if (OrganizationTypeConstant.ORG_TYPE_GRID_PARTY.equals(dto.getTypeKey())) { |
|
|
if (OrganizationTypeConstant.ORG_TYPE_GRID_PARTY.equals(dto.getTypeKey())) { |
|
|
// 获取网格所有上级机构
|
|
|
// 获取网格所有上级机构
|
|
|
Result<CompleteDeptDTO> completeDeptDtoResult = this.getCompleteDept(entity.getId().toString()); |
|
|
Result<CompleteDeptDTO> completeDeptDtoResult = this.getCompleteDept(entity.getId().toString()); |
|
|
groupFeignClient.createPartyGroup(completeDeptDtoResult.getData()); |
|
|
groupFeignClient.createPartyGroup(completeDeptDtoResult.getData()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void insertInfo(SysDeptDTO dto, SysDeptEntity entity) { |
|
|
private void insertInfo(SysDeptDTO dto, SysDeptEntity entity) { |
|
@ -239,6 +259,109 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit |
|
|
adminImgService.insert(gridAreaImgEntity); |
|
|
adminImgService.insert(gridAreaImgEntity); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 推送处理 |
|
|
|
|
|
* |
|
|
|
|
|
* @param dto |
|
|
|
|
|
* @param entity |
|
|
|
|
|
* @param type 0:新增 1:编辑 2:删除 |
|
|
|
|
|
* @return void |
|
|
|
|
|
* @author zhy |
|
|
|
|
|
* @date 2022/12/8 10:56 |
|
|
|
|
|
*/ |
|
|
|
|
|
private void sendInfo(SysDeptDTO dto, SysDeptEntity entity, int type) { |
|
|
|
|
|
try { |
|
|
|
|
|
if (type == NumConstant.ZERO) { |
|
|
|
|
|
if (OrganizationTypeConstant.ORG_TYPE_COMMUNITY_PARTY.equals(dto.getTypeKey())) { |
|
|
|
|
|
CommunityAddFormDTO communityAddFormDTO = new CommunityAddFormDTO(); |
|
|
|
|
|
communityAddFormDTO.setUserMajorName("张三"); |
|
|
|
|
|
communityAddFormDTO.setUserMajorPhone("18888888888"); |
|
|
|
|
|
communityAddFormDTO.setCircleName(entity.getName()); |
|
|
|
|
|
communityAddFormDTO.setCircleHeadImage("https://epdc-yushan.elinkservice.cn/files-pro/20221208/5c744d6d73ca444fb4689dedfc9b5e0d.jpg"); |
|
|
|
|
|
communityAddFormDTO.setCircleDescribe(dto.getIntroduction()); |
|
|
|
|
|
communityAddFormDTO.setMapX(dto.getLatitude()); |
|
|
|
|
|
communityAddFormDTO.setMapY(dto.getLongitude()); |
|
|
|
|
|
communityAddFormDTO.setOldCircleId(entity.getId().toString()); |
|
|
|
|
|
communityAddFormDTO.setCreateTime(DateUtils.format(entity.getCreateDate(), DateUtils.DATE_TIME_PATTERN)); |
|
|
|
|
|
Result<GlobalResultDTO> result = communityManageFeignClient.addCommunity(communityAddFormDTO); |
|
|
|
|
|
communityManageHandle(result, dto, entity); |
|
|
|
|
|
|
|
|
|
|
|
} else if (OrganizationTypeConstant.ORG_TYPE_GRID_PARTY.equals(dto.getTypeKey())) { |
|
|
|
|
|
GridAddFormDTO gridAddFormDTO = new GridAddFormDTO(); |
|
|
|
|
|
gridAddFormDTO.setGridNum(entity.getName()); |
|
|
|
|
|
gridAddFormDTO.setCircleId(entity.getPid().intValue()); |
|
|
|
|
|
gridAddFormDTO.setCreateTime(entity.getCreateDate().toString()); |
|
|
|
|
|
gridAddFormDTO.setParentId(NumConstant.ZERO); |
|
|
|
|
|
gridAddFormDTO.setLevel(NumConstant.ONE); |
|
|
|
|
|
gridAddFormDTO.setGridDesc(dto.getIntroduction()); |
|
|
|
|
|
gridAddFormDTO.setOldGridId(entity.getId().toString()); |
|
|
|
|
|
Result<GlobalResultDTO> result = communityManageFeignClient.addGrid(gridAddFormDTO); |
|
|
|
|
|
communityManageHandle(result, dto, entity); |
|
|
|
|
|
} |
|
|
|
|
|
} else if (type == NumConstant.ONE) { |
|
|
|
|
|
SysDeptInfoDTO sysDeptInfoDTO = sysDeptInfoService.getDeptInfoByDeptID(dto.getId().toString()); |
|
|
|
|
|
if (sysDeptInfoDTO != null && sysDeptInfoDTO.getManageId() != null) { |
|
|
|
|
|
if (OrganizationTypeConstant.ORG_TYPE_COMMUNITY_PARTY.equals(dto.getTypeKey())) { |
|
|
|
|
|
CommunityUpdFormDTO communityUpdFormDTO = new CommunityUpdFormDTO(); |
|
|
|
|
|
communityUpdFormDTO.setCircleName(entity.getName()); |
|
|
|
|
|
communityUpdFormDTO.setCircleDescribe(dto.getIntroduction()); |
|
|
|
|
|
communityUpdFormDTO.setMapX(dto.getLatitude()); |
|
|
|
|
|
communityUpdFormDTO.setMapY(dto.getLongitude()); |
|
|
|
|
|
communityUpdFormDTO.setCircleId(sysDeptInfoDTO.getManageId().toString()); |
|
|
|
|
|
Result<GlobalResultDTO> result = communityManageFeignClient.updCommunity(communityUpdFormDTO); |
|
|
|
|
|
communityManageHandle(result, dto, entity); |
|
|
|
|
|
} else if (OrganizationTypeConstant.ORG_TYPE_GRID_PARTY.equals(dto.getTypeKey())) { |
|
|
|
|
|
GridUpdFormDTO gridUpdFormDTO = new GridUpdFormDTO(); |
|
|
|
|
|
gridUpdFormDTO.setGridNum(entity.getName()); |
|
|
|
|
|
gridUpdFormDTO.setGridDesc(dto.getIntroduction()); |
|
|
|
|
|
gridUpdFormDTO.setGridId(sysDeptInfoDTO.getManageId().toString()); |
|
|
|
|
|
Result<GlobalResultDTO> result = communityManageFeignClient.updGrid(gridUpdFormDTO); |
|
|
|
|
|
communityManageHandle(result, dto, entity); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} else if (type == NumConstant.TWO) { |
|
|
|
|
|
SysDeptInfoDTO sysDeptInfoDTO = sysDeptInfoService.getDeptInfoByDeptID(dto.getId().toString()); |
|
|
|
|
|
if (sysDeptInfoDTO != null && sysDeptInfoDTO.getManageId() != null) { |
|
|
|
|
|
if (OrganizationTypeConstant.ORG_TYPE_GRID_PARTY.equals(dto.getTypeKey())) { |
|
|
|
|
|
GridDelFormDTO gridDelFormDTO = new GridDelFormDTO(); |
|
|
|
|
|
gridDelFormDTO.setGridId(sysDeptInfoDTO.getManageId().toString()); |
|
|
|
|
|
Result<GlobalResultDTO> result = communityManageFeignClient.delGrid(gridDelFormDTO); |
|
|
|
|
|
communityManageHandle(result, dto, entity); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
log.error("推送社区管理接口失败:type>>" + type + "||type_key>>" + dto.getTypeKey() + "||id>>" + entity.getId()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void communityManageHandle(Result<GlobalResultDTO> result, SysDeptDTO dto, SysDeptEntity entity) { |
|
|
|
|
|
if (result.success()) { |
|
|
|
|
|
Object resultObject = result.getData().getResult(); |
|
|
|
|
|
Integer mId = null; |
|
|
|
|
|
if (resultObject != null) { |
|
|
|
|
|
mId = Integer.valueOf(resultObject.toString()); |
|
|
|
|
|
} |
|
|
|
|
|
SysDeptInfoDTO sysDeptInfoDTO = sysDeptInfoService.getDeptInfoByDeptID(entity.getId().toString()); |
|
|
|
|
|
// 表里没有直接插入
|
|
|
|
|
|
if (sysDeptInfoDTO == null) { |
|
|
|
|
|
// 插入信息表
|
|
|
|
|
|
SysDeptInfoEntity sysDeptInfoEntity = ConvertUtils.sourceToTarget(dto, SysDeptInfoEntity.class); |
|
|
|
|
|
sysDeptInfoEntity.setDeptId(entity.getId()); |
|
|
|
|
|
sysDeptInfoEntity.setManageId(mId); |
|
|
|
|
|
sysDeptInfoService.insert(sysDeptInfoEntity); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 更新信息表
|
|
|
|
|
|
SysDeptInfoDTO deptInfoDTO = ConvertUtils.sourceToTarget(dto, SysDeptInfoDTO.class); |
|
|
|
|
|
deptInfoDTO.setDeptId(sysDeptInfoDTO.getDeptId()); |
|
|
|
|
|
deptInfoDTO.setId(sysDeptInfoDTO.getId()); |
|
|
|
|
|
deptInfoDTO.setManageId(mId); |
|
|
|
|
|
sysDeptInfoService.update(deptInfoDTO); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void update(SysDeptDTO dto) { |
|
|
public void update(SysDeptDTO dto) { |
|
@ -268,6 +391,8 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit |
|
|
|
|
|
|
|
|
// 修改基本信息
|
|
|
// 修改基本信息
|
|
|
updatainfo(dto, entity); |
|
|
updatainfo(dto, entity); |
|
|
|
|
|
// 社区管理推送
|
|
|
|
|
|
sendInfo(dto, entity, 1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void updatainfo(SysDeptDTO dto, SysDeptEntity entity) { |
|
|
private void updatainfo(SysDeptDTO dto, SysDeptEntity entity) { |
|
@ -308,35 +433,35 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit |
|
|
} |
|
|
} |
|
|
//图片处理
|
|
|
//图片处理
|
|
|
AdminImgDTO businessDto = adminImgService.getDtoByReference(ImgConstant.DEPT_BUSINESS_CIRCULATION, entity.getId().toString()); |
|
|
AdminImgDTO businessDto = adminImgService.getDtoByReference(ImgConstant.DEPT_BUSINESS_CIRCULATION, entity.getId().toString()); |
|
|
if(businessDto == null){ |
|
|
if (businessDto == null) { |
|
|
adminImgService.insert(businessImgEntity); |
|
|
adminImgService.insert(businessImgEntity); |
|
|
}else{ |
|
|
} else { |
|
|
AdminImgDTO newBusinessDto = ConvertUtils.sourceToTarget(businessImgEntity, AdminImgDTO.class); |
|
|
AdminImgDTO newBusinessDto = ConvertUtils.sourceToTarget(businessImgEntity, AdminImgDTO.class); |
|
|
newBusinessDto.setId(businessDto.getId()); |
|
|
newBusinessDto.setId(businessDto.getId()); |
|
|
adminImgService.update(newBusinessDto); |
|
|
adminImgService.update(newBusinessDto); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
AdminImgDTO partyDto = adminImgService.getDtoByReference(ImgConstant.DEPT_PARTY_ORGANIZATION_STRUCTURE, entity.getId().toString()); |
|
|
AdminImgDTO partyDto = adminImgService.getDtoByReference(ImgConstant.DEPT_PARTY_ORGANIZATION_STRUCTURE, entity.getId().toString()); |
|
|
if(partyDto == null){ |
|
|
if (partyDto == null) { |
|
|
adminImgService.insert(partyImgEntity); |
|
|
adminImgService.insert(partyImgEntity); |
|
|
}else{ |
|
|
} else { |
|
|
AdminImgDTO newPartyDto = ConvertUtils.sourceToTarget(partyImgEntity, AdminImgDTO.class); |
|
|
AdminImgDTO newPartyDto = ConvertUtils.sourceToTarget(partyImgEntity, AdminImgDTO.class); |
|
|
newPartyDto.setId(partyDto.getId()); |
|
|
newPartyDto.setId(partyDto.getId()); |
|
|
adminImgService.update(newPartyDto); |
|
|
adminImgService.update(newPartyDto); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
AdminImgDTO gridDeptDto = adminImgService.getDtoByReference(ImgConstant.GRID_DEPT_FRAMEWORK, entity.getId().toString()); |
|
|
AdminImgDTO gridDeptDto = adminImgService.getDtoByReference(ImgConstant.GRID_DEPT_FRAMEWORK, entity.getId().toString()); |
|
|
if(gridDeptDto == null){ |
|
|
if (gridDeptDto == null) { |
|
|
adminImgService.insert(gridDeptImgEntity); |
|
|
adminImgService.insert(gridDeptImgEntity); |
|
|
}else{ |
|
|
} else { |
|
|
AdminImgDTO newGridDeptDto = ConvertUtils.sourceToTarget(gridDeptImgEntity, AdminImgDTO.class); |
|
|
AdminImgDTO newGridDeptDto = ConvertUtils.sourceToTarget(gridDeptImgEntity, AdminImgDTO.class); |
|
|
newGridDeptDto.setId(gridDeptDto.getId()); |
|
|
newGridDeptDto.setId(gridDeptDto.getId()); |
|
|
adminImgService.update(newGridDeptDto); |
|
|
adminImgService.update(newGridDeptDto); |
|
|
} |
|
|
} |
|
|
AdminImgDTO gridAreaDto = adminImgService.getDtoByReference(ImgConstant.GRID_AREA_PARTITION, entity.getId().toString()); |
|
|
AdminImgDTO gridAreaDto = adminImgService.getDtoByReference(ImgConstant.GRID_AREA_PARTITION, entity.getId().toString()); |
|
|
if(gridAreaDto == null){ |
|
|
if (gridAreaDto == null) { |
|
|
adminImgService.insert(gridAreaImgEntity); |
|
|
adminImgService.insert(gridAreaImgEntity); |
|
|
}else{ |
|
|
} else { |
|
|
AdminImgDTO newGridAreaDto = ConvertUtils.sourceToTarget(gridAreaImgEntity, AdminImgDTO.class); |
|
|
AdminImgDTO newGridAreaDto = ConvertUtils.sourceToTarget(gridAreaImgEntity, AdminImgDTO.class); |
|
|
newGridAreaDto.setId(gridAreaDto.getId()); |
|
|
newGridAreaDto.setId(gridAreaDto.getId()); |
|
|
adminImgService.update(newGridAreaDto); |
|
|
adminImgService.update(newGridAreaDto); |
|
@ -689,7 +814,7 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit |
|
|
* @param allParentNode 所有的上级机构节点 |
|
|
* @param allParentNode 所有的上级机构节点 |
|
|
* @param dataScopeDeptList 拥有数据权限的部门 |
|
|
* @param dataScopeDeptList 拥有数据权限的部门 |
|
|
* @param parentDeptIdList 上级部门id |
|
|
* @param parentDeptIdList 上级部门id |
|
|
* @return java.util.Map<java.lang.String , java.lang.Object> |
|
|
* @return java.util.Map<java.lang.String, java.lang.Object> |
|
|
* @author work@yujt.net.cn |
|
|
* @author work@yujt.net.cn |
|
|
* @date 2019/11/29 10:27 |
|
|
* @date 2019/11/29 10:27 |
|
|
*/ |
|
|
*/ |
|
@ -1181,4 +1306,32 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit |
|
|
return baseDao.getDeptInfoByName(gridName); |
|
|
return baseDao.getDeptInfoByName(gridName); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void beforeDelete(Long id) { |
|
|
|
|
|
SysDeptEntity entity = new SysDeptEntity(); |
|
|
|
|
|
SysDeptDTO dto = new SysDeptDTO(); |
|
|
|
|
|
entity.setId(id); |
|
|
|
|
|
dto.setId(id); |
|
|
|
|
|
// 社区管理推送
|
|
|
|
|
|
sendInfo(dto, entity, 2); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void sendManageDept() { |
|
|
|
|
|
List<SysDeptEntity> list = baseDao.getManageDept(); |
|
|
|
|
|
List<SysDeptEntity> community = list.stream().filter(item -> OrganizationTypeConstant.ORG_TYPE_COMMUNITY_PARTY.equals(item.getTypeKey())).collect(Collectors.toList()); |
|
|
|
|
|
List<SysDeptEntity> grid = list.stream().filter(item -> OrganizationTypeConstant.ORG_TYPE_GRID_PARTY.equals(item.getTypeKey())).collect(Collectors.toList()); |
|
|
|
|
|
log.info("本次推送社区管理信息数量community>>" + community.size() + "||grid>>" + grid.size()); |
|
|
|
|
|
community.forEach(entity -> { |
|
|
|
|
|
SysDeptDTO dto = ConvertUtils.sourceToTarget(entity, SysDeptDTO.class); |
|
|
|
|
|
// 社区管理推送
|
|
|
|
|
|
// sendInfo(dto, entity, 0);
|
|
|
|
|
|
}); |
|
|
|
|
|
grid.forEach(entity -> { |
|
|
|
|
|
SysDeptDTO dto = ConvertUtils.sourceToTarget(entity, SysDeptDTO.class); |
|
|
|
|
|
// 社区管理推送
|
|
|
|
|
|
// sendInfo(dto, entity, 0);
|
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|