|
@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|
|
|
|
|
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
@ -157,7 +158,7 @@ public class GroupServiceImpl extends BaseServiceImpl<GroupDao, GroupEntity> imp |
|
|
|
|
|
|
|
|
// 组装发送消息内容
|
|
|
// 组装发送消息内容
|
|
|
EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); |
|
|
EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); |
|
|
informationFormDTO.setContent("社群:《".concat(entity.getGroupName()).concat("》")); |
|
|
informationFormDTO.setContent("《".concat(entity.getGroupName()).concat("》")); |
|
|
informationFormDTO.setType(GroupNoticeConstant.NOTICE_TYPE_AUDIT_NOTICE); |
|
|
informationFormDTO.setType(GroupNoticeConstant.NOTICE_TYPE_AUDIT_NOTICE); |
|
|
informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_NOT_PASSED_OR_DISBAND); |
|
|
informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_NOT_PASSED_OR_DISBAND); |
|
|
informationFormDTO.setBusinessId(dto.getId()); |
|
|
informationFormDTO.setBusinessId(dto.getId()); |
|
@ -256,4 +257,43 @@ public class GroupServiceImpl extends BaseServiceImpl<GroupDao, GroupEntity> imp |
|
|
return new Result<List<GroupUserListResultDTO>>().ok(data); |
|
|
return new Result<List<GroupUserListResultDTO>>().ok(data); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public Result modifyMemberState(GroupUserRemoveOrQuitFormDTO formDto) { |
|
|
|
|
|
// 获取成员信息
|
|
|
|
|
|
UserGroupDTO userGroupDto = userGroupService.getGroupUserInfo(formDto.getGroupId(), formDto.getOperatorId(), GroupUserStateEnum.GROUP_USER_STATE_EXAMINATION_PASSED.getValue()); |
|
|
|
|
|
// 获取群主信息
|
|
|
|
|
|
UserGroupDTO lordGroupDto = userGroupService.getLordInfoByGroupId(formDto.getGroupId()); |
|
|
|
|
|
// 获取社群信息
|
|
|
|
|
|
GroupEntity groupEntity = baseDao.selectById(formDto.getGroupId()); |
|
|
|
|
|
|
|
|
|
|
|
// 组装发送消息内容
|
|
|
|
|
|
EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); |
|
|
|
|
|
informationFormDTO.setContent("《".concat(groupEntity.getGroupName()).concat("》")); |
|
|
|
|
|
informationFormDTO.setType(GroupNoticeConstant.NOTICE_TYPE_GROUP_NOTICE); |
|
|
|
|
|
informationFormDTO.setBusinessId(formDto.getGroupId()); |
|
|
|
|
|
if (GroupUserStateEnum.GROUP_USER_STATE_REMOVED.getValue().equals(formDto.getState())) { |
|
|
|
|
|
// 移除社群成员
|
|
|
|
|
|
if (!NumConstant.ONE_STR.equals(userGroupDto.getLordFlag())) { |
|
|
|
|
|
return new Result().error("操作失败,只有群主可以删除社群成员"); |
|
|
|
|
|
} |
|
|
|
|
|
informationFormDTO.setUserId(formDto.getUserId()); |
|
|
|
|
|
informationFormDTO.setTitle(GroupNoticeConstant.NOTICE_GROUP_REMOVED_MEMBER); |
|
|
|
|
|
informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_REMOVED_MEMBER); |
|
|
|
|
|
} else if (GroupUserStateEnum.GROUP_USER_STATE_RETIRED.getValue().equals(formDto.getState())){ |
|
|
|
|
|
// 退出社群
|
|
|
|
|
|
if (NumConstant.ONE_STR.equals(userGroupDto.getLordFlag())) { |
|
|
|
|
|
return new Result().error("操作失败,群主不可以退出社群"); |
|
|
|
|
|
} |
|
|
|
|
|
informationFormDTO.setUserId(lordGroupDto.getUserId()); |
|
|
|
|
|
informationFormDTO.setTitle(userGroupDto.getNickname().concat(GroupNoticeConstant.NOTICE_GROUP_QUIT)); |
|
|
|
|
|
informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_QUIT); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 更新社群成员状态
|
|
|
|
|
|
userGroupService.modifyMemberState(formDto); |
|
|
|
|
|
// 发送通知
|
|
|
|
|
|
newsTask.insertUserInformation(informationFormDTO); |
|
|
|
|
|
return new Result(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |