|
@@ -335,30 +335,45 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
|
|
|
|
Long sysUserId = SecurityUtil.getUserId();
|
|
|
|
|
|
+
|
|
|
+ SendMsgDto sendMsgDto = buildSendMsgDto(dto, sysUserId);
|
|
|
+
|
|
|
+
|
|
|
+ ResultVO<Boolean> booleanResultVO = sendMsgRpc.sendMsg(sendMsgDto);
|
|
|
+ if (!booleanResultVO.isSuccess()) {
|
|
|
+ throw new BaseException(booleanResultVO.getMsg());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private SendMsgDto buildSendMsgDto(SendMsgTaskDto dto, Long sysUserId) {
|
|
|
|
|
|
List<Map> roleList = getRoleList(dto.getRoleRechargeRankingDTO());
|
|
|
+
|
|
|
|
|
|
List<String> roleIdList = roleList.stream()
|
|
|
.map(map -> Optional.ofNullable(map.get("role_id")).map(Object::toString).orElse(null))
|
|
|
- .collect(Collectors.toList());
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
SendMsgDto sendMsgDto = new SendMsgDto();
|
|
|
sendMsgDto.setMsg(dto.getSendContent());
|
|
|
- sendMsgDto.setRoles(roleIdList);
|
|
|
+
|
|
|
+
|
|
|
+ sendMsgDto.setRoles(dto.getRoleIds());
|
|
|
sendMsgDto.setCreateBy(sysUserId);
|
|
|
- if(CollectionUtils.isNotEmpty(roleList)){
|
|
|
- String gameName = (String) roleList.get(0).get("role_reg_parent_game_name");
|
|
|
+
|
|
|
+ if (!roleList.isEmpty()) {
|
|
|
+ String gameName = roleList.get(0).get("role_reg_parent_game_name").toString();
|
|
|
sendMsgDto.setGameName(gameName);
|
|
|
}
|
|
|
+
|
|
|
RoleRechargeRankingDTO roleRechargeRankingDTO = dto.getRoleRechargeRankingDTO();
|
|
|
sendMsgDto.setSendConditionJson(JSON.toJSONString(roleRechargeRankingDTO));
|
|
|
|
|
|
-
|
|
|
- ResultVO<Boolean> booleanResultVO = sendMsgRpc.sendMsg(sendMsgDto);
|
|
|
- if (!booleanResultVO.isSuccess()) {
|
|
|
- throw new BaseException(booleanResultVO.getMsg());
|
|
|
- }
|
|
|
+ return sendMsgDto;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
|
|
|
* 获取角色列表
|
|
|
* @param dto
|