Browse Source

Merge remote-tracking branch 'origin/dev_group0329' into dev_temp

master
yinzuomei 4 years ago
parent
commit
61ee86dce8
  1. 3
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/GroupMemberConstant.java
  2. 21
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ExitGroupServiceImpl.java
  3. 25
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java

3
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 = "禁言成功"; String SLIENT_SUCCESS = "禁言成功";
} }

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

25
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<ResiTopicDao, ResiTopi
private Result verifyLeader(ResiTopicEntity topic,String userId){ private Result verifyLeader(ResiTopicEntity topic,String userId){
if(null != topic){ if(null != topic){
ResiGroupMemberDTO leaderVerify = resiGroupMemberDao.selectLeaderMember(topic.getGroupId()); ResiGroupMemberDTO leaderVerify = resiGroupMemberDao.selectLeaderMember(topic.getGroupId());
if(null != leaderVerify){ if (null == leaderVerify) {
//1.2判断是否是组长 throw new RenException(String.format("没有找到该组组长,groupId=%s", topic.getGroupId()));
if(!StringUtils.equals(leaderVerify.getCustomerUserId(),userId)){ }
//非组长,无权限进行操作 //1.2判断是否是组长
logger.error(ModuleConstant.NO_TEAMLEADER_AUTH); if (!StringUtils.equals(leaderVerify.getCustomerUserId(), userId)) {
throw new RenException(ModuleConstant.NO_TEAMLEADER_AUTH); //非组长,无权限进行操作
}else{ logger.error(ModuleConstant.NO_TEAMLEADER_AUTH);
//是组长 throw new RenException(ModuleConstant.NO_TEAMLEADER_AUTH);
return new Result(); } else {
} //是组长
}else{ return new Result();
//未找到当前用户的成员信息
logger.error(ModuleConstant.NOT_BELONG_TO_CURRENT_GROUP);
throw new RenException(ModuleConstant.NOT_BELONG_TO_CURRENT_GROUP);
} }
}else{ }else{
//未能识别该话题基本信息 //未能识别该话题基本信息

Loading…
Cancel
Save