diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/GroupMemberConstant.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/GroupMemberConstant.java index fdd709ca73..15761d2eac 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/GroupMemberConstant.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/GroupMemberConstant.java @@ -13,7 +13,8 @@ public interface GroupMemberConstant { /** * 删除组成员时对应话题操作日志表设置默认的屏蔽理由 */ - String DELETE_MEMBER_REASON = "删除组成员,屏蔽该成员话题"; + String DELETE_MEMBER_REASON = "删除组员,屏蔽他的话题及评论"; String SLIENT_SUCCESS = "禁言成功"; + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ExitGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ExitGroupServiceImpl.java index cff7457c7b..186531756b 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ExitGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ExitGroupServiceImpl.java @@ -1,5 +1,8 @@ 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.exception.RenException; 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.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovIssueOpenFeignClient; +import com.epmet.modules.constant.GroupMemberConstant; import com.epmet.modules.group.dao.ResiGroupDao; import com.epmet.modules.group.dao.ResiGroupStatisticalDao; 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.entity.ResiTopicOperationEntity; 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.member.GroupMemeberOperationDTO; import lombok.extern.slf4j.Slf4j; @@ -85,7 +90,7 @@ public class ExitGroupServiceImpl implements ExitGroupService { //2.判断是否屏蔽本小组内历史话题 List delIdList = new ArrayList<>(); - if ("yes".equals(formDTO.getShieldFlag())) { + if (Constant.YES.equals(formDTO.getShieldFlag())) { //2-1.查询当前被删除人员发表过的话题还未成为议题的并且只是谈论中的数据 List topicIdList = resiTopicDao.selectIdList(formDTO.getGroupId(), formDTO.getUserId()); //2-2.查询当前未成为议题的话题但是提交了转议题申请的话题 @@ -104,8 +109,8 @@ public class ExitGroupServiceImpl implements ExitGroupService { List list = new ArrayList<>(); delIdList.forEach(d->{ ResiTopicOperationEntity entity = new ResiTopicOperationEntity(); - entity.setOperationType("hidden"); - entity.setOperationReason("组员删除,话题屏蔽"); + entity.setOperationType(TopicConstant.HIDDEN); + entity.setOperationReason(GroupMemberConstant.DELETE_MEMBER_REASON); entity.setTopicId(d); list.add(entity); }); @@ -119,7 +124,7 @@ public class ExitGroupServiceImpl implements ExitGroupService { int count = delIdList.size(); //3.判断是否屏蔽本小组内历史评论 - if ("yes".equals(formDTO.getShieldFlag())) { + if (Constant.YES.equals(formDTO.getShieldFlag())) { //3-1.查询别人的话题但自己评论过的话题Id List commetTopicList = resiTopicCommentDao.selectTopicIds(formDTO.getGroupId(), formDTO.getUserId()); delIdList.addAll(commetTopicList); @@ -148,7 +153,7 @@ public class ExitGroupServiceImpl implements ExitGroupService { entity.setGroupId(formDTO.getGroupId()); entity.setMemberUserId(formDTO.getUserId()); entity.setShieldFlag(formDTO.getShieldFlag()); - entity.setLeaveType("0"); + entity.setLeaveType(NumConstant.ZERO_STR); if (exitGroupRecordDao.insert(entity) < NumConstant.ONE) { throw new RenException(String.format("新增退群记录表数据操作失败,小组Id【%s】被修改人Id【%s】", formDTO.getGroupId(), formDTO.getUserId())); } @@ -157,7 +162,7 @@ public class ExitGroupServiceImpl implements ExitGroupService { //5-1.获取被删人员当前网格居民端角色信息 ResiGroupEntity groupEntity = resiGroupDao.selectById(formDTO.getGroupId()); UserRoleFormDTO dto = new UserRoleFormDTO(); - dto.setApp("resi"); + dto.setApp(AppClientConstant.APP_RESI); dto.setUserId(formDTO.getUserId()); dto.setCustomerId(formDTO.getCustomerId()); dto.setGridId(groupEntity.getGridId()); @@ -175,10 +180,10 @@ public class ExitGroupServiceImpl implements ExitGroupService { statisticalEntity.setTotalTopics(statisticalEntity.getTotalTopics()-count); statisticalEntity.setTotalNormalMemebers(statisticalEntity.getTotalNormalMemebers() - 1); roleList.forEach(r -> { - if ("partymember".equals(r.getRoleKey())) {//党员总数减一 + if (EpmetRoleKeyConstant.PARTYMEMBER.equals(r.getRoleKey())) {//党员总数减一 statisticalEntity.setTotalPartyMembers(statisticalEntity.getTotalPartyMembers() - 1); } - if ("warmhearted".equals(r.getRoleKey())) {//热心居民总数减一 + if (EpmetRoleKeyConstant.WARMHEARTED.equals(r.getRoleKey())) {//热心居民总数减一 statisticalEntity.setTotalEarnestMemebers(statisticalEntity.getTotalEarnestMemebers() - 1); } }); diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 4f0190f4ab..d40b355596 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -931,20 +931,17 @@ public class ResiTopicServiceImpl extends BaseServiceImpl