Browse Source

支部小组与党组织绑定

master
zhaoqifeng 3 years ago
parent
commit
1f545cd332
  1. 6
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupDTO.java
  2. 6
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyCreateGroupFormDTO.java
  3. 1
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java
  4. 1
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupDetailResult2DTO.java
  5. 2
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupDetailResultDTO.java
  6. 1
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionDetailResultDTO.java
  7. 13
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java
  8. 7
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java
  9. 17
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java
  10. 6
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java
  11. 6
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java
  12. 12
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java
  13. 102
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  14. 1
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/GroupEditSubmitRecordDao.xml
  15. 1
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml
  16. 15
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java
  17. 17
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java
  18. 6
      epmet-module/resi-partymember/resi-partymember-server/pom.xml
  19. 18
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java
  20. 12
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java
  21. 70
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java

6
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupDTO.java

@ -66,6 +66,12 @@ public class ResiGroupDTO implements Serializable {
*/
private String gridId;
/**
* 所属党组织
*/
private String partyOrgId;
private String partyOrgPids;
/**
* 状态审核通过 - approved 审核中 - under_auditting 审核未通过 - rejected 已屏蔽 - hidden 已关闭 - closed
Ps: 如果一个小组被拒绝当前小组的状态将永久停留在审核未通过

6
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/ApplyCreateGroupFormDTO.java

@ -17,6 +17,8 @@ public class ApplyCreateGroupFormDTO implements Serializable {
private static final long serialVersionUID = 1570620480398949075L;
public interface AddUserInternalGroup {
}
public interface AddPartyOrgGroup {
}
/**
* 添加用户操作的用户可见异常分组
* 该分组用于校验需要返回给前端错误信息提示的列需要继承CustomerClientShowGroup
@ -69,6 +71,10 @@ public class ApplyCreateGroupFormDTO implements Serializable {
@NotBlank(message = "app不能为空",groups ={AddUserInternalGroup.class})
private String app;
@NotBlank(message = "所属党组织不能为空",groups ={AddPartyOrgGroup.class})
private String partyOrgId;
private String partyOrgPids;
/**
* 小组是否允许参观:允许open;不允许closed
*/

1
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/EditGroupFormDTO.java

@ -35,5 +35,6 @@ public class EditGroupFormDTO {
@NotBlank(message = "组介绍不能为空", groups = { SubmitGroupEditVG.class })
@Length(max = 500, message = "组介绍长度不能超过500个字", groups = { SubmitGroupEditVG.class })
private String groupIntroduction;
private String partyOrgId;
}

1
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupDetailResult2DTO.java

@ -67,5 +67,6 @@ public class ApplyingGroupDetailResult2DTO implements Serializable {
* 未读已读标识 unread read
* */
private String readFlag;
private String partyOrgName;
}

2
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/ApplyingGroupDetailResultDTO.java

@ -77,4 +77,6 @@ public class ApplyingGroupDetailResultDTO implements Serializable {
* */
private String operationId;
private String partyOrgId;
}

1
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/result/GroupEditionDetailResultDTO.java

@ -39,4 +39,5 @@ public class GroupEditionDetailResultDTO implements Serializable {
* 群主的昵称 xx路-xx先生/女士
*/
private String groupLeaderName;
private String partyOrgName;
}

13
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java

@ -13,12 +13,14 @@ import com.epmet.resi.group.dto.topic.result.TopicInfoResultDTO;
import com.epmet.resi.group.dto.topic.result.*;
import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallbackFactory;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
@ -320,4 +322,15 @@ public interface ResiGroupOpenFeignClient {
*/
@PostMapping("/resi/group/group/list-groups-by-member")
Result<List<GroupDetailResultDTO>> listGroupsByMember(@RequestBody GroupsByMemberFormDTO formDTO);
/**
* 获取客户下支部小组根据所属党组织分组
*
* @Param
* @Return {@link Result<Map<String, List<IcPartyOrgTreeDTO>>>}
* @Author zhaoqifeng
* @Date 2022/8/16 14:04
*/
@PostMapping("/resi/group/group/getBranchGroupList")
Result<Map<String, List<IcPartyOrgTreeDTO>>> getBranchGroupList();
}

7
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java

@ -13,9 +13,11 @@ import com.epmet.resi.group.dto.topic.result.TopicInfoResultDTO;
import com.epmet.resi.group.dto.topic.result.*;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
@ -234,4 +236,9 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien
public Result<List<GroupDetailResultDTO>> listGroupsByMember(GroupsByMemberFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "listGroupsByMember", formDTO);
}
@Override
public Result<Map<String, List<IcPartyOrgTreeDTO>>> getBranchGroupList() {
return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getBranchGroupList", null);
}
}

17
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java

@ -34,12 +34,14 @@ import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO;
import com.epmet.resi.group.dto.member.form.ResiIdentityFormDTO;
import com.epmet.resi.group.dto.member.result.AchievementResultDTO;
import com.epmet.resi.group.enums.SearchScopeTypeEnum;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -399,7 +401,7 @@ public class ResiGroupController {
@PostMapping("submit-edit")
public Result submitGroupEdit(@RequestBody EditGroupFormDTO form, @LoginUser TokenDto tokenDto){
ValidatorUtils.validateEntity(form, EditGroupFormDTO.SubmitGroupEditVG.class);
resiGroupService.submitGroupEdit(form.getGroupId(), form.getGroupName(), form.getGroupHeadPhoto(), form.getGroupIntroduction(), tokenDto.getUserId());
resiGroupService.submitGroupEdit(form.getGroupId(), form.getGroupName(), form.getGroupHeadPhoto(), form.getGroupIntroduction(), tokenDto.getUserId(), form.getPartyOrgId());
return new Result();
}
@ -649,4 +651,17 @@ public class ResiGroupController {
List<GroupDetailResultDTO> groups = resiGroupService.listGroupsByMember(userId, gridId);
return new Result<List<GroupDetailResultDTO>>().ok(groups);
}
/**
* 获取客户下支部小组根据所属党组织分组
*
* @Param tokenDto
* @Return {@link Result< Map< String, List< IcPartyOrgTreeDTO>>>}
* @Author zhaoqifeng
* @Date 2022/8/16 14:02
*/
@PostMapping("getBranchGroupList")
public Result<Map<String, List<IcPartyOrgTreeDTO>>> getBranchGroupList(@LoginUser TokenDto tokenDto) {
return new Result<Map<String, List<IcPartyOrgTreeDTO>>>().ok(resiGroupService.getBranchGroupList(tokenDto.getCustomerId()));
}
}

6
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/GroupEditSubmitRecordEntity.java

@ -52,6 +52,12 @@ public class GroupEditSubmitRecordEntity extends BaseEpmetEntity {
*/
private String gridId;
/**
* 所属党组织
*/
private String partyOrgId;
private String partyOrgPids;
/**
* 头像
*/

6
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/entity/ResiGroupEntity.java

@ -62,6 +62,12 @@ public class ResiGroupEntity extends BaseEpmetEntity {
*/
private String gridId;
/**
* 所属党组织
*/
private String partyOrgId;
private String partyOrgPids;
/**
* 状态审核通过 - approved 审核中 - under_auditting 审核未通过 - rejected 已屏蔽 - hidden 已关闭 - closed
Ps: 如果一个小组被拒绝当前小组的状态将永久停留在审核未通过

12
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/ResiGroupService.java

@ -30,6 +30,7 @@ import com.epmet.resi.group.dto.group.form.*;
import com.epmet.resi.group.dto.group.result.*;
import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO;
import com.epmet.resi.group.dto.member.result.AchievementResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import java.util.HashMap;
import java.util.List;
@ -310,7 +311,7 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
GroupDetailResultDTO getGroupDetail(String groupId);
void submitGroupEdit(String groupId, String groupName, String groupHeadPhoto, String groupIntroduction, String editUserId);
void submitGroupEdit(String groupId, String groupName, String groupHeadPhoto, String groupIntroduction, String editUserId, String partyOrgId);
/**
* @Description 工作端 查询组变更待审核列表
@ -471,4 +472,13 @@ public interface ResiGroupService extends BaseService<ResiGroupEntity> {
* @date 2021.09.08 13:59:31
*/
List<GroupDetailResultDTO> listGroupsByMember(String memberUserId, String gridId);
/**
* 获取客户下支部小组根据所属党组织分组
* @Param customerId
* @Return {@link Map< String, List<IcPartyOrgTreeDTO>>}
* @Author zhaoqifeng
* @Date 2022/8/15 16:49
*/
Map<String, List<IcPartyOrgTreeDTO>> getBranchGroupList(String customerId);
}

102
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java

@ -27,6 +27,7 @@ import com.epmet.commons.rocketmq.messages.GroupAchievementMQMsg;
import com.epmet.commons.tools.constant.*;
import com.epmet.commons.tools.enums.AchievementTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
@ -83,6 +84,9 @@ import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO;
import com.epmet.resi.group.dto.member.result.AchievementResultDTO;
import com.epmet.resi.group.dto.member.result.GroupAchievementDTO;
import com.epmet.resi.group.enums.SearchScopeTypeEnum;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO;
import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient;
import com.epmet.send.SendMqMsgUtil;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
@ -97,6 +101,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionSynchronizationAdapter;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
@ -120,7 +125,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
@Autowired
private ResiGroupOperationService resiGroupOperationService;
@Autowired
@Resource
private EpmetUserFeignClient epmetUserFeignClient;
@Autowired
@ -144,10 +149,10 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
@Autowired
private ResiGroupMemberRedis resiGroupMemberRedis;
@Autowired
@Resource
private GovOrgFeignClient govOrgFeignClient;
@Autowired
@Resource
private EpmetMessageFeignClient epmetMessageFeignClient;
@Autowired
@ -181,6 +186,8 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
@Autowired
private ResiGroupAchievementStatsService resiGroupAchievementStatsService;
@Resource
private ResiPartyMemberOpenFeignClient resiPartyMemberOpenFeignClient;
@Override
public PageData<ResiGroupDTO> page(Map<String, Object> params) {
@ -457,6 +464,19 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
throw new RenException(EpmetErrorCode.CANNOT_CREATE_GROUP.getCode());
}
}
if (StringUtils.isNotBlank(applyCreateGroupFormDTO.getPartyOrgId())) {
Result<Map<String, IcPartyOrgDTO>> partyOrgResult = resiPartyMemberOpenFeignClient.getPartyOrgList();
if (!partyOrgResult.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取党组织信息失败", "获取党组织信息失败");
}
if (partyOrgResult.getData().containsKey(applyCreateGroupFormDTO.getPartyOrgId())) {
applyCreateGroupFormDTO.setPartyOrgPids(partyOrgResult.getData().get(applyCreateGroupFormDTO.getPartyOrgId()).getOrgPids().concat(StrConstant.COLON).concat(applyCreateGroupFormDTO.getPartyOrgId()));
} else {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所选党组织不存在", "所选党组织不存在");
}
}
String roleName = "";
if(NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag())){
roleName = ModuleConstant.PARTYMEMBER;
@ -586,6 +606,8 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
resiGroupEntity.setState(GroupStateConstant.GROUP_UNDER_AUDITTING);
resiGroupEntity.setVisitSwitch(StringUtils.isNotBlank(applyCreateGroupFormDTO.getVisitSwitch()) ? applyCreateGroupFormDTO.getVisitSwitch() : GroupStateConstant.CLOSED);
resiGroupEntity.setGroupType(applyCreateGroupFormDTO.getGroupType());
resiGroupEntity.setPartyOrgId(applyCreateGroupFormDTO.getPartyOrgId());
resiGroupEntity.setPartyOrgPids(applyCreateGroupFormDTO.getPartyOrgPids());
return resiGroupEntity;
}
@ -1041,7 +1063,20 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
detail.setLeaderId(null);
detail.setOperationId(null);
return new Result<ApplyingGroupDetailResult2DTO>().ok(ConvertUtils.sourceToTarget(detail, ApplyingGroupDetailResult2DTO.class));
ApplyingGroupDetailResult2DTO result = ConvertUtils.sourceToTarget(detail, ApplyingGroupDetailResult2DTO.class);
if (StringUtils.isNotBlank(detail.getPartyOrgId())) {
Result<Map<String, IcPartyOrgDTO>> partyOrgResult = resiPartyMemberOpenFeignClient.getPartyOrgList();
if (!partyOrgResult.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取党组织信息失败", "获取党组织信息失败");
}
if (partyOrgResult.getData().containsKey(detail.getPartyOrgId())) {
result.setPartyOrgName(partyOrgResult.getData().get(detail.getPartyOrgId()).getPartyOrgName());
}
}
return new Result<ApplyingGroupDetailResult2DTO>().ok(result);
}
@Override
@ -1486,7 +1521,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
}
@Override
public void submitGroupEdit(String groupId, String groupName, String groupHeadPhoto, String groupIntroduction, String editUserId) {
public void submitGroupEdit(String groupId, String groupName, String groupHeadPhoto, String groupIntroduction, String editUserId, String partyOrgId) {
// 1.判断小组是否存在,判断是否已经在"待审核"状态
ResiGroupEntity group = resiGroupDao.selectById(groupId);
if (group == null) {
@ -1518,6 +1553,18 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
// 达到最大编辑次数了
throw new RenException(EpmetErrorCode.GROUP_EDIT_NUM_LIMITED.getCode(), EpmetErrorCode.GROUP_EDIT_NUM_LIMITED.getMsg());
}
String partyOrgPids = null;
if (StringUtils.isNotBlank(partyOrgId)) {
Result<Map<String, IcPartyOrgDTO>> partyOrgResult = resiPartyMemberOpenFeignClient.getPartyOrgList();
if (!partyOrgResult.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取党组织信息失败", "获取党组织信息失败");
}
if (partyOrgResult.getData().containsKey(partyOrgId)) {
partyOrgPids = partyOrgResult.getData().get(partyOrgId).getOrgPids().concat(StrConstant.COLON).concat(partyOrgId);
} else {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "所选党组织不存在", "所选党组织不存在");
}
}
// 3.内容检查
scanGroupEditContent(groupName, groupIntroduction, groupHeadPhoto);
@ -1537,6 +1584,8 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
editRecord.setGroupName(groupName);
editRecord.setReadFlag(ReadFlagConstant.UN_READ);
editRecord.setMessageText(messageText);
editRecord.setPartyOrgId(partyOrgId);
editRecord.setPartyOrgPids(partyOrgPids);
if (groupEditSubmitRecordDao.insert(editRecord) == 0) {
throw new RenException(EpmetErrorCode.GROUP_EDIT_ERROR.getCode(), EpmetErrorCode.GROUP_EDIT_ERROR.getMsg());
@ -1713,6 +1762,16 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
} else {
result.setGroupLeaderName(resiGroupRedis.getFullName(edit.getCreatedBy()));
}
if (StringUtils.isNotBlank(edit.getPartyOrgId())) {
Result<Map<String, IcPartyOrgDTO>> partyOrgResult = resiPartyMemberOpenFeignClient.getPartyOrgList();
if (!partyOrgResult.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取党组织信息失败", "获取党组织信息失败");
}
if (partyOrgResult.getData().containsKey(edit.getPartyOrgId())) {
result.setPartyOrgName(partyOrgResult.getData().get(edit.getPartyOrgId()).getPartyOrgName());
}
}
return result;
}
@ -1863,4 +1922,37 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
public List<GroupDetailResultDTO> listGroupsByMember(String memberUserId, String gridId) {
return baseDao.listGroupsByMember(memberUserId, gridId);
}
/**
* 获取客户下支部小组根据所属党组织分组
*
* @param customerId
* @Param customerId
* @Return {@link Map< String, List<IcPartyOrgTreeDTO >>}
* @Author zhaoqifeng
* @Date 2022/8/15 16:49
*/
@Override
public Map<String, List<IcPartyOrgTreeDTO>> getBranchGroupList(String customerId) {
LambdaQueryWrapper<ResiGroupEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ResiGroupEntity::getCustomerId, customerId);
wrapper.eq(ResiGroupEntity::getGroupType, ModuleConstant.GROUP_TYPE_BRANCH);
List<ResiGroupEntity> entityList = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(entityList)) {
return Collections.emptyMap();
}
List<IcPartyOrgTreeDTO> list = entityList.stream().filter(i -> StringUtils.isNotBlank(i.getPartyOrgId())).map(item -> {
IcPartyOrgTreeDTO dto = new IcPartyOrgTreeDTO();
dto.setId(item.getId());
dto.setOrgPids(item.getPartyOrgPids());
dto.setPid(item.getPartyOrgId());
dto.setPartyOrgType(ModuleConstant.GROUP_TYPE_BRANCH);
dto.setPartyOrgName(item.getGroupName());
return dto;
}).collect(Collectors.toList());
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyMap();
}
return list.stream().collect(Collectors.groupingBy(IcPartyOrgTreeDTO::getPid));
}
}

1
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/GroupEditSubmitRecordDao.xml

@ -95,6 +95,7 @@
GROUP_NAME,
GROUP_HEAD_PHOTO,
GROUP_INTRODUCTION,
PARTY_ORG_ID,
CREATED_BY,
GRID_ID
FROM

1
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml

@ -354,6 +354,7 @@
gro.GROUP_NAME AS groupName,
gro.GROUP_HEAD_PHOTO AS groupHeadPhoto,
gro.GROUP_INTRODUCTION AS groupIntroduction,
gro.PARTY_ORG_ID AS partyOrgId,
oper.READ_FLAG AS readFlag,
oper.MESSAGE_TEXT AS messageText,
oper.CREATED_TIME AS createdTime,

15
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java

@ -1,11 +1,9 @@
package com.epmet.resi.partymember.feign;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO;
import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO;
import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO;
@ -20,6 +18,7 @@ import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
@ -135,4 +134,14 @@ public interface ResiPartyMemberOpenFeignClient {
@PostMapping("/resi/partymember/icPartyOrg/branchlist")
public Result<List<OptionResultDTO>> branchlist();
/**
* 获取客户下支部列表
* @Param tokenDto
* @Return {@link Result<Map<String, IcPartyOrgDTO>>}
* @Author zhaoqifeng
* @Date 2022/8/15 16:00
*/
@PostMapping("/resi/partymember/icPartyOrg/getPartyOrgList")
Result<Map<String, IcPartyOrgDTO>> getPartyOrgList();
}

17
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java

@ -2,10 +2,9 @@ package com.epmet.resi.partymember.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeDTO;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partymember.IcPartyMemberDTO;
import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO;
import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO;
@ -17,6 +16,7 @@ import com.epmet.resi.partymember.dto.partymember.result.WarnAndPartyAuditResult
import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient;
import java.util.List;
import java.util.Map;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
@ -101,4 +101,17 @@ public class ResiPartyMemberOpenFeignClientFallback implements ResiPartyMemberOp
public Result<List<OptionResultDTO>> branchlist() {
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "branchlist", null);
}
/**
* 获取客户下支部列表
*
* @Param tokenDto
* @Return {@link Result< Map<String, IcPartyOrgDTO>>}
* @Author zhaoqifeng
* @Date 2022/8/15 16:00
*/
@Override
public Result<Map<String, IcPartyOrgDTO>> getPartyOrgList() {
return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "getPartyOrgList", null);
}
}

6
epmet-module/resi-partymember/resi-partymember-server/pom.xml

@ -123,6 +123,12 @@
<artifactId>epmet-commons-rocketmq</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>resi-group-client</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>

18
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java

@ -110,6 +110,12 @@ public class IcPartyOrgController {
return icPartyOrgService.getSearchTreelist(formDTO);
}
@PostMapping("getOrgTreeHaveGroup")
public Result<List<IcPartyOrgTreeDTO>> getOrgTreeHaveGroup(@LoginUser TokenDto tokenDto,PartyOrgTreeListDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<List<IcPartyOrgTreeDTO>>().ok(icPartyOrgService.getOrgTreeHaveGroup(formDTO));
}
/**
* @describe: 当前登录用户所属行政组织及下级的党组织只限支部
* @author wangtong
@ -137,4 +143,16 @@ public class IcPartyOrgController {
return icPartyOrgService.getParentOrgList(formDTO);
}
/**
* 获取客户下支部列表
* @Param tokenDto
* @Return {@link Result<Map<String, IcPartyOrgDTO>>}
* @Author zhaoqifeng
* @Date 2022/8/15 16:00
*/
@PostMapping("getPartyOrgList")
public Result<Map<String, IcPartyOrgDTO>> getPartyOrgList(@LoginUser TokenDto tokenDto){
return new Result<Map<String, IcPartyOrgDTO>>().ok(icPartyOrgService.getPartyOrgList(tokenDto));
}
}

12
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java

@ -108,7 +108,7 @@ public interface IcPartyOrgService extends BaseService<IcPartyOrgEntity> {
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO>>
*/
Result<List<IcPartyOrgTreeDTO>> getSearchTreelist(PartyOrgTreeListDTO formDTO);
List<IcPartyOrgTreeDTO> getOrgTreeHaveGroup(PartyOrgTreeListDTO formDTO);
/**
* @describe: 上级党组织列表
* @author wangtong
@ -117,4 +117,14 @@ public interface IcPartyOrgService extends BaseService<IcPartyOrgEntity> {
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO>>
*/
Result<List<IcPartyOrgTreeDTO>> getParentOrgList(GetParentOrgFormDTO formDTO);
/**
* 获取客户下支部列表
*
* @Param tokenDto
* @Return {@link Map<String, IcPartyOrgDTO>}
* @Author zhaoqifeng
* @Date 2022/8/15 15:52
*/
Map<String, IcPartyOrgDTO> getPartyOrgList(TokenDto tokenDto);
}

70
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java

@ -1,9 +1,11 @@
package com.epmet.modules.partyOrg.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.PartyOrgTypeEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -23,6 +25,7 @@ import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
import com.epmet.modules.partyOrg.service.IcPartyOrgService;
import com.epmet.modules.partymember.dao.IcPartyMemberDao;
import com.epmet.modules.partymember.entity.IcPartyMemberEntity;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.GetParentOrgFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO;
@ -35,10 +38,10 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 党组织表
@ -54,6 +57,8 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Resource
private ResiGroupOpenFeignClient resiGroupOpenFeignClient;
@Override
@ -217,9 +222,28 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
@Override
public Result<List<IcPartyOrgTreeDTO>> getTreelist(PartyOrgTreeListDTO formDTO) {
List<IcPartyOrgTreeDTO> list = baseDao.getTreelist(formDTO);
Result<Map<String, List<IcPartyOrgTreeDTO>>> groupResult = resiGroupOpenFeignClient.getBranchGroupList();
if (!groupResult.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询支部小组错误", "查询支部小组错误");
}
for (IcPartyOrgTreeDTO org : list) {
getChildren(org, groupResult.getData());
}
return new Result<List<IcPartyOrgTreeDTO>>().ok(build(list));
}
private void getChildren(IcPartyOrgTreeDTO dto, Map<String, List<IcPartyOrgTreeDTO>> map) {
if (NumConstant.FIVE_STR.equals(dto.getPartyOrgType())) {
if (map.containsKey(dto.getId())) {
dto.setChildren(map.get(dto.getId()));
}
} else {
for (IcPartyOrgTreeDTO org : dto.getChildren()) {
getChildren(org, map);
}
}
}
@Override
public Result<List<BranchlistTreeDTO>> branchlist(TokenDto tokenDto) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
@ -244,6 +268,21 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
return new Result<List<IcPartyOrgTreeDTO>>().ok(build(list));
}
@Override
public List<IcPartyOrgTreeDTO> getOrgTreeHaveGroup(PartyOrgTreeListDTO formDTO) {
List<IcPartyOrgTreeDTO> list = baseDao.getSearchTreelist(formDTO);
Result<Map<String, List<IcPartyOrgTreeDTO>>> groupResult = resiGroupOpenFeignClient.getBranchGroupList();
if (!groupResult.success()) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询支部小组错误", "查询支部小组错误");
}
for (IcPartyOrgTreeDTO org : list) {
getChildren(org, groupResult.getData());
}
return list;
}
@Override
public Result<List<IcPartyOrgTreeDTO>> getParentOrgList(GetParentOrgFormDTO formDTO) {
Result<CustomerAgencyDTO> agencyDTOResult = govOrgOpenFeignClient.getAgencyById(formDTO.getAgencyId());
@ -270,6 +309,29 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
return new Result<List<IcPartyOrgTreeDTO>>().ok(list);
}
/**
* 获取客户下支部列表
*
* @param tokenDto
* @Param tokenDto
* @Return {@link Map<String, IcPartyOrgDTO>}
* @Author zhaoqifeng
* @Date 2022/8/15 15:52
*/
@Override
public Map<String, IcPartyOrgDTO> getPartyOrgList(TokenDto tokenDto) {
LambdaQueryWrapper<IcPartyOrgEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcPartyOrgEntity::getCustomerId, tokenDto.getCustomerId());
wrapper.eq(IcPartyOrgEntity::getPartyOrgType, NumConstant.FIVE_STR);
List<IcPartyOrgEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyMap();
}
List<IcPartyOrgDTO> result = ConvertUtils.sourceToTarget(list, IcPartyOrgDTO.class);
return result.stream().collect(Collectors.toMap(IcPartyOrgDTO::getId, Function.identity()));
}
/**
* 构建树节点
*/

Loading…
Cancel
Save