|
@ -1,5 +1,8 @@ |
|
|
package com.epmet.modules.group.service.impl; |
|
|
package com.epmet.modules.group.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
|
|
|
import com.epmet.commons.tools.constant.Constant; |
|
|
|
|
|
import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
@ -7,6 +10,7 @@ import com.epmet.dto.form.UserRoleFormDTO; |
|
|
import com.epmet.dto.result.UserRoleResultDTO; |
|
|
import com.epmet.dto.result.UserRoleResultDTO; |
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
import com.epmet.feign.GovIssueOpenFeignClient; |
|
|
import com.epmet.feign.GovIssueOpenFeignClient; |
|
|
|
|
|
import com.epmet.modules.constant.GroupMemberConstant; |
|
|
import com.epmet.modules.group.dao.ResiGroupDao; |
|
|
import com.epmet.modules.group.dao.ResiGroupDao; |
|
|
import com.epmet.modules.group.dao.ResiGroupStatisticalDao; |
|
|
import com.epmet.modules.group.dao.ResiGroupStatisticalDao; |
|
|
import com.epmet.modules.group.entity.ResiGroupEntity; |
|
|
import com.epmet.modules.group.entity.ResiGroupEntity; |
|
@ -21,6 +25,7 @@ import com.epmet.modules.topic.dao.ResiTopicCommentDao; |
|
|
import com.epmet.modules.topic.dao.ResiTopicDao; |
|
|
import com.epmet.modules.topic.dao.ResiTopicDao; |
|
|
import com.epmet.modules.topic.entity.ResiTopicOperationEntity; |
|
|
import com.epmet.modules.topic.entity.ResiTopicOperationEntity; |
|
|
import com.epmet.modules.topic.service.ResiTopicOperationService; |
|
|
import com.epmet.modules.topic.service.ResiTopicOperationService; |
|
|
|
|
|
import com.epmet.resi.group.constant.TopicConstant; |
|
|
import com.epmet.resi.group.dto.group.form.ExitGroupFormDTO; |
|
|
import com.epmet.resi.group.dto.group.form.ExitGroupFormDTO; |
|
|
import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO; |
|
|
import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
@ -85,7 +90,7 @@ public class ExitGroupServiceImpl implements ExitGroupService { |
|
|
|
|
|
|
|
|
//2.判断是否屏蔽本小组内历史话题
|
|
|
//2.判断是否屏蔽本小组内历史话题
|
|
|
List<String> delIdList = new ArrayList<>(); |
|
|
List<String> delIdList = new ArrayList<>(); |
|
|
if ("yes".equals(formDTO.getShieldFlag())) { |
|
|
if (Constant.YES.equals(formDTO.getShieldFlag())) { |
|
|
//2-1.查询当前被删除人员发表过的话题还未成为议题的并且只是谈论中的数据
|
|
|
//2-1.查询当前被删除人员发表过的话题还未成为议题的并且只是谈论中的数据
|
|
|
List<String> topicIdList = resiTopicDao.selectIdList(formDTO.getGroupId(), formDTO.getUserId()); |
|
|
List<String> topicIdList = resiTopicDao.selectIdList(formDTO.getGroupId(), formDTO.getUserId()); |
|
|
//2-2.查询当前未成为议题的话题但是提交了转议题申请的话题
|
|
|
//2-2.查询当前未成为议题的话题但是提交了转议题申请的话题
|
|
@ -104,8 +109,8 @@ public class ExitGroupServiceImpl implements ExitGroupService { |
|
|
List<ResiTopicOperationEntity> list = new ArrayList<>(); |
|
|
List<ResiTopicOperationEntity> list = new ArrayList<>(); |
|
|
delIdList.forEach(d->{ |
|
|
delIdList.forEach(d->{ |
|
|
ResiTopicOperationEntity entity = new ResiTopicOperationEntity(); |
|
|
ResiTopicOperationEntity entity = new ResiTopicOperationEntity(); |
|
|
entity.setOperationType("hidden"); |
|
|
entity.setOperationType(TopicConstant.HIDDEN); |
|
|
entity.setOperationReason("组员删除,话题屏蔽"); |
|
|
entity.setOperationReason(GroupMemberConstant.DELETE_MEMBER_REASON); |
|
|
entity.setTopicId(d); |
|
|
entity.setTopicId(d); |
|
|
list.add(entity); |
|
|
list.add(entity); |
|
|
}); |
|
|
}); |
|
@ -119,7 +124,7 @@ public class ExitGroupServiceImpl implements ExitGroupService { |
|
|
int count = delIdList.size(); |
|
|
int count = delIdList.size(); |
|
|
|
|
|
|
|
|
//3.判断是否屏蔽本小组内历史评论
|
|
|
//3.判断是否屏蔽本小组内历史评论
|
|
|
if ("yes".equals(formDTO.getShieldFlag())) { |
|
|
if (Constant.YES.equals(formDTO.getShieldFlag())) { |
|
|
//3-1.查询别人的话题但自己评论过的话题Id
|
|
|
//3-1.查询别人的话题但自己评论过的话题Id
|
|
|
List<String> commetTopicList = resiTopicCommentDao.selectTopicIds(formDTO.getGroupId(), formDTO.getUserId()); |
|
|
List<String> commetTopicList = resiTopicCommentDao.selectTopicIds(formDTO.getGroupId(), formDTO.getUserId()); |
|
|
delIdList.addAll(commetTopicList); |
|
|
delIdList.addAll(commetTopicList); |
|
@ -148,7 +153,7 @@ public class ExitGroupServiceImpl implements ExitGroupService { |
|
|
entity.setGroupId(formDTO.getGroupId()); |
|
|
entity.setGroupId(formDTO.getGroupId()); |
|
|
entity.setMemberUserId(formDTO.getUserId()); |
|
|
entity.setMemberUserId(formDTO.getUserId()); |
|
|
entity.setShieldFlag(formDTO.getShieldFlag()); |
|
|
entity.setShieldFlag(formDTO.getShieldFlag()); |
|
|
entity.setLeaveType("0"); |
|
|
entity.setLeaveType(NumConstant.ZERO_STR); |
|
|
if (exitGroupRecordDao.insert(entity) < NumConstant.ONE) { |
|
|
if (exitGroupRecordDao.insert(entity) < NumConstant.ONE) { |
|
|
throw new RenException(String.format("新增退群记录表数据操作失败,小组Id【%s】被修改人Id【%s】", formDTO.getGroupId(), formDTO.getUserId())); |
|
|
throw new RenException(String.format("新增退群记录表数据操作失败,小组Id【%s】被修改人Id【%s】", formDTO.getGroupId(), formDTO.getUserId())); |
|
|
} |
|
|
} |
|
@ -157,7 +162,7 @@ public class ExitGroupServiceImpl implements ExitGroupService { |
|
|
//5-1.获取被删人员当前网格居民端角色信息
|
|
|
//5-1.获取被删人员当前网格居民端角色信息
|
|
|
ResiGroupEntity groupEntity = resiGroupDao.selectById(formDTO.getGroupId()); |
|
|
ResiGroupEntity groupEntity = resiGroupDao.selectById(formDTO.getGroupId()); |
|
|
UserRoleFormDTO dto = new UserRoleFormDTO(); |
|
|
UserRoleFormDTO dto = new UserRoleFormDTO(); |
|
|
dto.setApp("resi"); |
|
|
dto.setApp(AppClientConstant.APP_RESI); |
|
|
dto.setUserId(formDTO.getUserId()); |
|
|
dto.setUserId(formDTO.getUserId()); |
|
|
dto.setCustomerId(formDTO.getCustomerId()); |
|
|
dto.setCustomerId(formDTO.getCustomerId()); |
|
|
dto.setGridId(groupEntity.getGridId()); |
|
|
dto.setGridId(groupEntity.getGridId()); |
|
@ -175,10 +180,10 @@ public class ExitGroupServiceImpl implements ExitGroupService { |
|
|
statisticalEntity.setTotalTopics(statisticalEntity.getTotalTopics()-count); |
|
|
statisticalEntity.setTotalTopics(statisticalEntity.getTotalTopics()-count); |
|
|
statisticalEntity.setTotalNormalMemebers(statisticalEntity.getTotalNormalMemebers() - 1); |
|
|
statisticalEntity.setTotalNormalMemebers(statisticalEntity.getTotalNormalMemebers() - 1); |
|
|
roleList.forEach(r -> { |
|
|
roleList.forEach(r -> { |
|
|
if ("partymember".equals(r.getRoleKey())) {//党员总数减一
|
|
|
if (EpmetRoleKeyConstant.PARTYMEMBER.equals(r.getRoleKey())) {//党员总数减一
|
|
|
statisticalEntity.setTotalPartyMembers(statisticalEntity.getTotalPartyMembers() - 1); |
|
|
statisticalEntity.setTotalPartyMembers(statisticalEntity.getTotalPartyMembers() - 1); |
|
|
} |
|
|
} |
|
|
if ("warmhearted".equals(r.getRoleKey())) {//热心居民总数减一
|
|
|
if (EpmetRoleKeyConstant.WARMHEARTED.equals(r.getRoleKey())) {//热心居民总数减一
|
|
|
statisticalEntity.setTotalEarnestMemebers(statisticalEntity.getTotalEarnestMemebers() - 1); |
|
|
statisticalEntity.setTotalEarnestMemebers(statisticalEntity.getTotalEarnestMemebers() - 1); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|