Browse Source

社区推送

master
zhangyuan 3 years ago
parent
commit
cc022c33e2
  1. 10
      epdc-cloud-admin/pom.xml
  2. 26
      epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java
  3. 2
      epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java
  4. 5
      epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysDeptInfoEntity.java
  5. 14
      epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysDeptService.java
  6. 181
      epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java
  7. 18
      epdc-cloud-admin/src/main/resources/mapper/SysDeptDao.xml
  8. 2
      epdc-cloud-client-yushan
  9. 2
      epdc-cloud-commons-yushan

10
epdc-cloud-admin/pom.xml

@ -180,15 +180,15 @@
<docker.tag>dev</docker.tag> <docker.tag>dev</docker.tag>
<spring.redis.index>8</spring.redis.index> <spring.redis.index>8</spring.redis.index>
<spring.redis.host>r-m5eh5czgb1nucti6azpd.redis.rds.aliyuncs.com</spring.redis.host> <spring.redis.host>r-v0l694084401a044pd.redis.rds.aliyuncs.com</spring.redis.host>
<spring.redis.port>10001</spring.redis.port> <spring.redis.port>6379</spring.redis.port>
<spring.redis.password>elink!888</spring.redis.password> <spring.redis.password>CJ!redis@elink</spring.redis.password>
<!-- nacos --> <!-- nacos -->
<nacos.register-enabled>false</nacos.register-enabled> <nacos.register-enabled>false</nacos.register-enabled>
<nacos.server-addr>115.29.142.202:8848</nacos.server-addr> <nacos.server-addr>47.104.92.53:8848</nacos.server-addr>
<nacos.ip></nacos.ip> <nacos.ip></nacos.ip>
<nacos.namespace>8831513c-2f72-42e8-899f-eb6c2c5ae110</nacos.namespace> <nacos.namespace>33672684-31a6-4550-9586-7f0317b85196</nacos.namespace>
<spring.zipkin.base-url>http://localhost:9411</spring.zipkin.base-url> <spring.zipkin.base-url>http://localhost:9411</spring.zipkin.base-url>
<!--小程序配置--> <!--小程序配置-->

26
epdc-cloud-admin/src/main/java/com/elink/esua/epdc/controller/SysDeptController.java

@ -25,6 +25,8 @@ import com.elink.esua.epdc.dto.epdc.form.UserSysDeptAreaCodeFormDTO;
import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO; import com.elink.esua.epdc.dto.epdc.form.UserSysDeptInfoFormDTO;
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.CommunityAddFormDTO;
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.optimize.modules.deptlevel.service.OptSysDeptService; import com.elink.esua.epdc.optimize.modules.deptlevel.service.OptSysDeptService;
import com.elink.esua.epdc.service.SysDeptService; import com.elink.esua.epdc.service.SysDeptService;
@ -121,7 +123,7 @@ public class SysDeptController {
public Result delete(@PathVariable("id") Long id) { public Result delete(@PathVariable("id") Long id) {
//效验数据 //效验数据
AssertUtils.isNull(id, "id"); AssertUtils.isNull(id, "id");
// sysDeptService.delete(id); sysDeptService.beforeDelete(id);
sysDeptService.deleteBatchIds(Arrays.asList(new Long[]{id})); sysDeptService.deleteBatchIds(Arrays.asList(new Long[]{id}));
return new Result(); return new Result();
} }
@ -432,4 +434,26 @@ public class SysDeptController {
return new Result<AllDeptDTO>().ok(data); return new Result<AllDeptDTO>().ok(data);
} }
@GetMapping("deptinfo/{id}")
@ApiOperation("信息")
public Result<DeptInfoDTO> getDeptInfo(@PathVariable("id") Long id) {
DeptInfoDTO data = sysDeptService.getDeptInfoById(id);
return new Result<DeptInfoDTO>().ok(data);
}
/**
* 推送社区管理信息
*
* @param
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author zhy
* @date 2022/12/9 10:31
*/
@PostMapping("manage/sendManageDept")
public Result sendManageDept() {
sysDeptService.sendManageDept();
return new Result();
}
} }

2
epdc-cloud-admin/src/main/java/com/elink/esua/epdc/dao/SysDeptDao.java

@ -240,4 +240,6 @@ public interface SysDeptDao extends BaseDao<SysDeptEntity> {
*/ */
AllDeptDTO getDeptInfoByName(@Param("gridName") String gridName); AllDeptDTO getDeptInfoByName(@Param("gridName") String gridName);
List<SysDeptEntity> getManageDept();
} }

5
epdc-cloud-admin/src/main/java/com/elink/esua/epdc/entity/SysDeptInfoEntity.java

@ -88,4 +88,9 @@ public class SysDeptInfoEntity extends BaseEpdcEntity {
*/ */
private Integer communityManNum; private Integer communityManNum;
/**
* 社区管理第三方ID
*/
private Integer manageId;
} }

14
epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/SysDeptService.java

@ -37,6 +37,8 @@ public interface SysDeptService extends BaseService<SysDeptEntity> {
SysDeptDTO get(Long id); SysDeptDTO get(Long id);
DeptInfoDTO getDeptInfoById(Long id);
void save(SysDeptDTO dto); void save(SysDeptDTO dto);
void update(SysDeptDTO dto); void update(SysDeptDTO dto);
@ -326,4 +328,16 @@ public interface SysDeptService extends BaseService<SysDeptEntity> {
*/ */
AllDeptDTO getAllDeptInfoByName(String gridName); AllDeptDTO getAllDeptInfoByName(String gridName);
/**
* 删除前处理
*
* @param id
* @return void
* @author zhy
* @date 2022/12/8 14:20
*/
void beforeDelete(Long id);
void sendManageDept();
} }

181
epdc-cloud-admin/src/main/java/com/elink/esua/epdc/service/impl/SysDeptServiceImpl.java

@ -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);
});
}
} }

18
epdc-cloud-admin/src/main/resources/mapper/SysDeptDao.xml

@ -403,6 +403,24 @@
AND (grid.name = #{gridName} or grid.id = #{gridName}) AND (grid.name = #{gridName} or grid.id = #{gridName})
</select> </select>
<select id="getManageDept" resultType="com.elink.esua.epdc.entity.SysDeptEntity">
SELECT
*
FROM
(
SELECT
d.*,
i.MANAGE_ID
FROM
sys_dept d
LEFT JOIN sys_dept_info i ON d.id = i.DEPT_ID
WHERE
d.del_flag = '0'
AND d.type_key IN ( 'community_party', 'grid_party' )) t
WHERE
t.MANAGE_ID IS NULL
</select>
<select id="deptInfo" resultType="com.elink.esua.epdc.dto.result.DeptInfoResultDTO"> <select id="deptInfo" resultType="com.elink.esua.epdc.dto.result.DeptInfoResultDTO">
SELECT SELECT
d.id, d.id,

2
epdc-cloud-client-yushan

@ -1 +1 @@
Subproject commit 982b1ff01e69e7cb48180e3d68c94664605ae73e Subproject commit 288df6a33da8e6e1fbaa9bfcce58895bd689a773

2
epdc-cloud-commons-yushan

@ -1 +1 @@
Subproject commit 5b077ffda98e46ce47e9c5540dabbc50f092968d Subproject commit 47f2b25521879a947fc3ead1302b9e4fc39431d7
Loading…
Cancel
Save