|
@ -32,9 +32,11 @@ import com.elink.esua.epdc.dto.epdc.form.EpdcUserGroupInviteFormDTO; |
|
|
import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; |
|
|
import com.elink.esua.epdc.dto.epdc.result.EpdcUserGroupInviteResultDTO; |
|
|
import com.elink.esua.epdc.dto.group.GroupDTO; |
|
|
import com.elink.esua.epdc.dto.group.GroupDTO; |
|
|
import com.elink.esua.epdc.dto.group.UserGroupDTO; |
|
|
import com.elink.esua.epdc.dto.group.UserGroupDTO; |
|
|
|
|
|
import com.elink.esua.epdc.dto.group.UserReviewDto; |
|
|
import com.elink.esua.epdc.dto.group.form.GroupAddUserFormDTO; |
|
|
import com.elink.esua.epdc.dto.group.form.GroupAddUserFormDTO; |
|
|
import com.elink.esua.epdc.dto.group.form.GroupUserFormDTO; |
|
|
import com.elink.esua.epdc.dto.group.form.GroupUserFormDTO; |
|
|
import com.elink.esua.epdc.dto.group.form.GroupUserRemoveOrQuitFormDTO; |
|
|
import com.elink.esua.epdc.dto.group.form.GroupUserRemoveOrQuitFormDTO; |
|
|
|
|
|
import com.elink.esua.epdc.dto.group.form.GroupUserReviewFormDTO; |
|
|
import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; |
|
|
import com.elink.esua.epdc.dto.group.result.GroupUserListResultDTO; |
|
|
import com.elink.esua.epdc.modules.async.NewsTask; |
|
|
import com.elink.esua.epdc.modules.async.NewsTask; |
|
|
import com.elink.esua.epdc.modules.feign.UserFeignClient; |
|
|
import com.elink.esua.epdc.modules.feign.UserFeignClient; |
|
@ -172,19 +174,19 @@ public class UserGroupServiceImpl extends BaseServiceImpl<UserGroupDao, UserGrou |
|
|
userGroupEntities.add(entity); |
|
|
userGroupEntities.add(entity); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 获取社群信息
|
|
|
|
|
|
GroupDTO groupDto = groupService.get(formDto.getGroupId()); |
|
|
|
|
|
// 组装发送消息内容
|
|
|
|
|
|
if (insertBatch(userGroupEntities)) { |
|
|
if (insertBatch(userGroupEntities)) { |
|
|
|
|
|
// 获取社群信息
|
|
|
|
|
|
GroupDTO groupDto = groupService.get(formDto.getGroupId()); |
|
|
|
|
|
// 组装发送消息内容
|
|
|
for (UserGroupEntity userGroupEntity: |
|
|
for (UserGroupEntity userGroupEntity: |
|
|
userGroupEntities) { |
|
|
userGroupEntities) { |
|
|
EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); |
|
|
EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); |
|
|
informationFormDTO.setContent(GroupNoticeConstant.NOTICE_GROUP_INVITED_CONTENT.replace("groupName", groupDto.getGroupName())); |
|
|
informationFormDTO.setContent(GroupNoticeConstant.NOTICE_GROUP_USER_INVITED_CONTENT.replace("groupName", groupDto.getGroupName())); |
|
|
informationFormDTO.setType(GroupNoticeConstant.NOTICE_TYPE_GROUP_NOTICE); |
|
|
informationFormDTO.setType(GroupNoticeConstant.NOTICE_TYPE_GROUP_NOTICE); |
|
|
informationFormDTO.setBusinessId(formDto.getGroupId()); |
|
|
informationFormDTO.setBusinessId(formDto.getGroupId()); |
|
|
informationFormDTO.setUserId(userGroupEntity.getUserId()); |
|
|
informationFormDTO.setUserId(userGroupEntity.getUserId()); |
|
|
informationFormDTO.setTitle(GroupNoticeConstant.NOTICE_GROUP_INVITED); |
|
|
informationFormDTO.setTitle(GroupNoticeConstant.NOTICE_GROUP_USER_INVITED); |
|
|
informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_INVITED); |
|
|
informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_USER_INVITED); |
|
|
|
|
|
|
|
|
// 发送通知
|
|
|
// 发送通知
|
|
|
newsTask.insertUserInformation(informationFormDTO); |
|
|
newsTask.insertUserInformation(informationFormDTO); |
|
@ -195,4 +197,50 @@ public class UserGroupServiceImpl extends BaseServiceImpl<UserGroupDao, UserGrou |
|
|
return new Result().error(); |
|
|
return new Result().error(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
|
public Result modifyGroupUsers(GroupUserReviewFormDTO formDto) { |
|
|
|
|
|
List<UserGroupEntity> userGroupEntities = new ArrayList<>(formDto.getUserReviewDtoList().size()); |
|
|
|
|
|
UserGroupEntity entity = null; |
|
|
|
|
|
for (UserReviewDto userReviewDto: |
|
|
|
|
|
formDto.getUserReviewDtoList()) { |
|
|
|
|
|
entity = new UserGroupEntity(); |
|
|
|
|
|
entity.setId(userReviewDto.getId()); |
|
|
|
|
|
entity.setState(userReviewDto.getState()); |
|
|
|
|
|
entity.setAuditOpinion(userReviewDto.getAuditOpinion()); |
|
|
|
|
|
|
|
|
|
|
|
userGroupEntities.add(entity); |
|
|
|
|
|
} |
|
|
|
|
|
if (updateBatchById(userGroupEntities)) { |
|
|
|
|
|
// 获取社群信息
|
|
|
|
|
|
GroupDTO groupDto = groupService.get(formDto.getGroupId()); |
|
|
|
|
|
// 组装发送消息内容
|
|
|
|
|
|
for (UserGroupEntity userGroupEntity: |
|
|
|
|
|
userGroupEntities) { |
|
|
|
|
|
EpdcInformationFormDTO informationFormDTO = new EpdcInformationFormDTO(); |
|
|
|
|
|
informationFormDTO.setType(GroupNoticeConstant.NOTICE_TYPE_AUDIT_NOTICE); |
|
|
|
|
|
informationFormDTO.setUserId(userGroupEntity.getUserId()); |
|
|
|
|
|
if (GroupUserStateEnum.GROUP_USER_STATE_AUDIT_NOT_PASSED.getValue().equals(userGroupEntity.getState())) { |
|
|
|
|
|
informationFormDTO.setTitle(GroupNoticeConstant.NOTICE_GROUP_USER_REVIEW_NOT_PASSED); |
|
|
|
|
|
informationFormDTO.setContent(GroupNoticeConstant.NOTICE_GROUP_USER_REVIEW_NOT_PASSED_CONTENT |
|
|
|
|
|
.replace("groupName", groupDto.getGroupName()) |
|
|
|
|
|
.replace("auditOpinion", userGroupEntity.getAuditOpinion())); |
|
|
|
|
|
informationFormDTO.setBusinessId(userGroupEntity.getId()); |
|
|
|
|
|
informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_USER_REVIEW_NOT_PASS); |
|
|
|
|
|
} else { |
|
|
|
|
|
informationFormDTO.setTitle(GroupNoticeConstant.NOTICE_GROUP_USER_REVIEW_PASSED); |
|
|
|
|
|
informationFormDTO.setContent(GroupNoticeConstant.NOTICE_GROUP_USER_REVIEW_PASSED_CONTENT |
|
|
|
|
|
.replace("groupName", groupDto.getGroupName())); |
|
|
|
|
|
informationFormDTO.setBusinessId(formDto.getGroupId()); |
|
|
|
|
|
informationFormDTO.setBusinessType(GroupNoticeConstant.NOTICE_BUSINESS_TYPE_GROUP_USER_REVIEW_PASSED); |
|
|
|
|
|
} |
|
|
|
|
|
// 发送通知
|
|
|
|
|
|
newsTask.insertUserInformation(informationFormDTO); |
|
|
|
|
|
} |
|
|
|
|
|
return new Result(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return new Result().error(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |