|
|
@ -33,6 +33,7 @@ import com.epmet.dto.form.UserMessageFormDTO; |
|
|
|
import com.epmet.dto.form.UserResiInfoFormDTO; |
|
|
|
import com.epmet.dto.result.UserInfoOnEnterGridResultDTO; |
|
|
|
import com.epmet.dto.result.UserResiInfoResultDTO; |
|
|
|
import com.epmet.dto.result.UserRoleResultDTO; |
|
|
|
import com.epmet.feign.MessageFeignClient; |
|
|
|
import com.epmet.modules.constant.UserMessageConstant; |
|
|
|
import com.epmet.modules.feign.EpmetUserFeignClient; |
|
|
@ -217,13 +218,6 @@ public class GroupInvitationServiceImpl extends BaseServiceImpl<GroupInvitationD |
|
|
|
linkGroupInfoResultDTO.setGroupInfo(groupInfo); |
|
|
|
//4、记录用户邀请关系
|
|
|
|
this.saveUserInvitation(groupInvitationDTO,formDTO); |
|
|
|
UserEnterGridFormDTO userEnterGridFormDTO=new UserEnterGridFormDTO(); |
|
|
|
userEnterGridFormDTO.setCustomerId(groupInfo.getCustomerId()); |
|
|
|
userEnterGridFormDTO.setGridId(groupInfo.getGridId()); |
|
|
|
Result<UserInfoOnEnterGridResultDTO> result=resiGuideFeignClient.enterGrid(userEnterGridFormDTO); |
|
|
|
if(!result.success()){ |
|
|
|
logger.error("进入网格失败"+result.getMsg()); |
|
|
|
} |
|
|
|
return linkGroupInfoResultDTO; |
|
|
|
} |
|
|
|
|
|
|
@ -312,9 +306,31 @@ public class GroupInvitationServiceImpl extends BaseServiceImpl<GroupInvitationD |
|
|
|
public void accetInvitation(AccetInvitationFormDTO formDTO) { |
|
|
|
//1、申请是否有效
|
|
|
|
GroupInvitationDTO groupInvitationDTO=this.checkLinkValid(formDTO.getInvitationId()); |
|
|
|
//2、校验是否已经注册居民
|
|
|
|
//2、进入小组所在的网格
|
|
|
|
ResiGroupDTO resiGroupDTO = resiGroupService.get(groupInvitationDTO.getResiGroupId()); |
|
|
|
UserRoleDTO userRoleDTO=new UserRoleDTO(); |
|
|
|
if(null==resiGroupDTO){ |
|
|
|
logger.error(String.format("用户同意邀请进组,查询组信息失败。入参:userId【%s】、invitationId【%s】、groupId【%s】。",formDTO.getUserId(),formDTO.getInvitationId(),groupInvitationDTO.getResiGroupId())); |
|
|
|
throw new RenException(EpmetErrorCode.LOSE_EFFICACY.getCode()); |
|
|
|
} |
|
|
|
UserEnterGridFormDTO userEnterGridFormDTO=new UserEnterGridFormDTO(); |
|
|
|
userEnterGridFormDTO.setCustomerId(resiGroupDTO.getCustomerId()); |
|
|
|
userEnterGridFormDTO.setGridId(resiGroupDTO.getGridId()); |
|
|
|
Result<UserInfoOnEnterGridResultDTO> result=resiGuideFeignClient.enterGrid(userEnterGridFormDTO); |
|
|
|
if (!result.success() || null == result.getData()) { |
|
|
|
logger.error(String.format("用户同意邀请进组,进入网格失败。入参:userId【%s】、invitationId【%s】、groupId【%s】、customerId【%s】、gridId【%s】", |
|
|
|
formDTO.getUserId(), formDTO.getInvitationId(), |
|
|
|
groupInvitationDTO.getResiGroupId()), |
|
|
|
resiGroupDTO.getCustomerId(), resiGroupDTO.getGridId()); |
|
|
|
logger.error(String.format("用户同意邀请进组,进入网格失败。当前接口返回8000,调用enterGrid接口返回", result.toString())); |
|
|
|
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); |
|
|
|
} |
|
|
|
//3、校验是否已经注册居民
|
|
|
|
if(null==result.getData().getUserRoleList()||result.getData().getUserRoleList().size()==0){ |
|
|
|
logger.error(String.format("用户同意邀请进组失败,返回角色列表为空错误编码%s,错误提示%s",EpmetErrorCode.CANNOT_JOIN_GROUP.getCode(),EpmetErrorCode.CANNOT_JOIN_GROUP.getMsg())); |
|
|
|
throw new RenException(EpmetErrorCode.CANNOT_JOIN_GROUP.getCode()); |
|
|
|
} |
|
|
|
UserRoleDTO userRoleDTO=this.getUserRoleDTO(result.getData().getUserRoleList()); |
|
|
|
/*UserRoleDTO userRoleDTO=new UserRoleDTO(); |
|
|
|
if (null != resiGroupDTO) { |
|
|
|
//获取当前用户所有角色
|
|
|
|
userRoleDTO = resiGroupService.checkPartyMemberOrWarmHeated(formDTO.getApp(), |
|
|
@ -325,7 +341,7 @@ public class GroupInvitationServiceImpl extends BaseServiceImpl<GroupInvitationD |
|
|
|
logger.error(String.format("居民端用户【%s】同意邀请进组失败,错误码:%s,错误提示:%s",formDTO.getUserId(),EpmetErrorCode.CANNOT_JOIN_GROUP.getCode(),EpmetErrorCode.CANNOT_JOIN_GROUP.getMsg())); |
|
|
|
throw new RenException(EpmetErrorCode.CANNOT_JOIN_GROUP.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
}*/ |
|
|
|
//3、新增一条邀请入群、直接审核通过的入群记录
|
|
|
|
GroupMemeberOperationDTO groupMemeberOperation = new GroupMemeberOperationDTO(); |
|
|
|
groupMemeberOperation.setGroupId(resiGroupDTO.getId()); |
|
|
@ -354,6 +370,22 @@ public class GroupInvitationServiceImpl extends BaseServiceImpl<GroupInvitationD |
|
|
|
this.sendMessageToLeader(formDTO, resiGroupDTO,groupInvitationDTO); |
|
|
|
} |
|
|
|
|
|
|
|
private UserRoleDTO getUserRoleDTO(List<String> userRoleList) { |
|
|
|
UserRoleDTO userRoleDTO=new UserRoleDTO(); |
|
|
|
for (String roleKey : userRoleList) { |
|
|
|
if (EpmetRoleKeyConstant.PARTYMEMBER.equals(roleKey)) { |
|
|
|
userRoleDTO.setPartymemberFlag(NumConstant.ONE_STR); |
|
|
|
} |
|
|
|
if (EpmetRoleKeyConstant.WARMHEARTED.equals(roleKey)) { |
|
|
|
userRoleDTO.setWarmHeartedFlag(NumConstant.ONE_STR); |
|
|
|
} |
|
|
|
if (EpmetRoleKeyConstant.REGISTERED_RESI.equals(roleKey)) { |
|
|
|
userRoleDTO.setRegisteredResiFlag(NumConstant.ONE_STR); |
|
|
|
} |
|
|
|
} |
|
|
|
return userRoleDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @param formDTO 当前用户信息 |
|
|
|
* @param resiGroupDTO 群组信息 |
|
|
|