|
@ -27,6 +27,7 @@ import com.epmet.commons.rocketmq.messages.GroupAchievementMQMsg; |
|
|
import com.epmet.commons.tools.constant.*; |
|
|
import com.epmet.commons.tools.constant.*; |
|
|
import com.epmet.commons.tools.enums.AchievementTypeEnum; |
|
|
import com.epmet.commons.tools.enums.AchievementTypeEnum; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
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.exception.RenException; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.scan.param.ImgScanParamDTO; |
|
|
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.AchievementResultDTO; |
|
|
import com.epmet.resi.group.dto.member.result.GroupAchievementDTO; |
|
|
import com.epmet.resi.group.dto.member.result.GroupAchievementDTO; |
|
|
import com.epmet.resi.group.enums.SearchScopeTypeEnum; |
|
|
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.epmet.send.SendMqMsgUtil; |
|
|
import com.github.pagehelper.PageHelper; |
|
|
import com.github.pagehelper.PageHelper; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
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.TransactionSynchronizationAdapter; |
|
|
import org.springframework.transaction.support.TransactionSynchronizationManager; |
|
|
import org.springframework.transaction.support.TransactionSynchronizationManager; |
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
import java.text.SimpleDateFormat; |
|
|
import java.text.SimpleDateFormat; |
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
import java.util.concurrent.atomic.AtomicBoolean; |
|
|
import java.util.concurrent.atomic.AtomicBoolean; |
|
@ -120,7 +125,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
@Autowired |
|
|
@Autowired |
|
|
private ResiGroupOperationService resiGroupOperationService; |
|
|
private ResiGroupOperationService resiGroupOperationService; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Resource |
|
|
private EpmetUserFeignClient epmetUserFeignClient; |
|
|
private EpmetUserFeignClient epmetUserFeignClient; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
@ -144,10 +149,10 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
@Autowired |
|
|
@Autowired |
|
|
private ResiGroupMemberRedis resiGroupMemberRedis; |
|
|
private ResiGroupMemberRedis resiGroupMemberRedis; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Resource |
|
|
private GovOrgFeignClient govOrgFeignClient; |
|
|
private GovOrgFeignClient govOrgFeignClient; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Resource |
|
|
private EpmetMessageFeignClient epmetMessageFeignClient; |
|
|
private EpmetMessageFeignClient epmetMessageFeignClient; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
@ -181,6 +186,8 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private ResiGroupAchievementStatsService resiGroupAchievementStatsService; |
|
|
private ResiGroupAchievementStatsService resiGroupAchievementStatsService; |
|
|
|
|
|
@Resource |
|
|
|
|
|
private ResiPartyMemberOpenFeignClient resiPartyMemberOpenFeignClient; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PageData<ResiGroupDTO> page(Map<String, Object> params) { |
|
|
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()); |
|
|
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 = ""; |
|
|
String roleName = ""; |
|
|
if(NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag())){ |
|
|
if(NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag())){ |
|
|
roleName = ModuleConstant.PARTYMEMBER; |
|
|
roleName = ModuleConstant.PARTYMEMBER; |
|
@ -586,6 +606,8 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
resiGroupEntity.setState(GroupStateConstant.GROUP_UNDER_AUDITTING); |
|
|
resiGroupEntity.setState(GroupStateConstant.GROUP_UNDER_AUDITTING); |
|
|
resiGroupEntity.setVisitSwitch(StringUtils.isNotBlank(applyCreateGroupFormDTO.getVisitSwitch()) ? applyCreateGroupFormDTO.getVisitSwitch() : GroupStateConstant.CLOSED); |
|
|
resiGroupEntity.setVisitSwitch(StringUtils.isNotBlank(applyCreateGroupFormDTO.getVisitSwitch()) ? applyCreateGroupFormDTO.getVisitSwitch() : GroupStateConstant.CLOSED); |
|
|
resiGroupEntity.setGroupType(applyCreateGroupFormDTO.getGroupType()); |
|
|
resiGroupEntity.setGroupType(applyCreateGroupFormDTO.getGroupType()); |
|
|
|
|
|
resiGroupEntity.setPartyOrgId(applyCreateGroupFormDTO.getPartyOrgId()); |
|
|
|
|
|
resiGroupEntity.setPartyOrgPids(applyCreateGroupFormDTO.getPartyOrgPids()); |
|
|
return resiGroupEntity; |
|
|
return resiGroupEntity; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -1041,7 +1063,20 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
detail.setLeaderId(null); |
|
|
detail.setLeaderId(null); |
|
|
detail.setOperationId(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 |
|
|
@Override |
|
@ -1486,7 +1521,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@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.判断小组是否存在,判断是否已经在"待审核"状态
|
|
|
// 1.判断小组是否存在,判断是否已经在"待审核"状态
|
|
|
ResiGroupEntity group = resiGroupDao.selectById(groupId); |
|
|
ResiGroupEntity group = resiGroupDao.selectById(groupId); |
|
|
if (group == null) { |
|
|
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()); |
|
|
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.内容检查
|
|
|
// 3.内容检查
|
|
|
scanGroupEditContent(groupName, groupIntroduction, groupHeadPhoto); |
|
|
scanGroupEditContent(groupName, groupIntroduction, groupHeadPhoto); |
|
@ -1537,6 +1584,8 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
editRecord.setGroupName(groupName); |
|
|
editRecord.setGroupName(groupName); |
|
|
editRecord.setReadFlag(ReadFlagConstant.UN_READ); |
|
|
editRecord.setReadFlag(ReadFlagConstant.UN_READ); |
|
|
editRecord.setMessageText(messageText); |
|
|
editRecord.setMessageText(messageText); |
|
|
|
|
|
editRecord.setPartyOrgId(partyOrgId); |
|
|
|
|
|
editRecord.setPartyOrgPids(partyOrgPids); |
|
|
|
|
|
|
|
|
if (groupEditSubmitRecordDao.insert(editRecord) == 0) { |
|
|
if (groupEditSubmitRecordDao.insert(editRecord) == 0) { |
|
|
throw new RenException(EpmetErrorCode.GROUP_EDIT_ERROR.getCode(), EpmetErrorCode.GROUP_EDIT_ERROR.getMsg()); |
|
|
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 { |
|
|
} else { |
|
|
result.setGroupLeaderName(resiGroupRedis.getFullName(edit.getCreatedBy())); |
|
|
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; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -1863,4 +1922,37 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
public List<GroupDetailResultDTO> listGroupsByMember(String memberUserId, String gridId) { |
|
|
public List<GroupDetailResultDTO> listGroupsByMember(String memberUserId, String gridId) { |
|
|
return baseDao.listGroupsByMember(memberUserId, 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)); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|