|
@@ -2,7 +2,8 @@ package com.zanxiang.game.data.serve.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.zanxiang.game.data.serve.pojo.dto.*;
|
|
|
-import com.zanxiang.game.data.serve.pojo.vo.GameDataDayVO;
|
|
|
+import com.zanxiang.game.module.base.pojo.params.SendMsgTaskResultParam;
|
|
|
+import com.zanxiang.game.module.base.pojo.vo.SendMsgResultVo;
|
|
|
import com.zanxiang.game.module.base.pojo.vo.SendMsgVo;
|
|
|
import com.zanxiang.erp.base.ErpServer;
|
|
|
import com.zanxiang.erp.base.rpc.ISysUserRpc;
|
|
@@ -592,6 +593,80 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询发送消息任务结果
|
|
|
+ * @param msgTaskResultDto msgTaskResultDto
|
|
|
+ * @return Page<SendMsgResultVo>
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public Page<SendMsgResultVo> getSendMsgResultList(MsgTaskResultDto msgTaskResultDto) {
|
|
|
+ try {
|
|
|
+ SendMsgTaskResultParam param = new SendMsgTaskResultParam();
|
|
|
+ param.setTaskId(msgTaskResultDto.getTaskId());
|
|
|
+ param.setPageNum(msgTaskResultDto.getPageNum());
|
|
|
+ param.setPageSize(msgTaskResultDto.getPageSize());
|
|
|
+ PageUtil<SendMsgResultVo> sendMsgTaskResultList = sendMsgRpc.getSendMsgTaskResultList(param);
|
|
|
+ if(CollectionUtils.isEmpty(sendMsgTaskResultList.getRecords())){
|
|
|
+ return new Page<>(sendMsgTaskResultList.getRecords(),sendMsgTaskResultList.getTotal(),sendMsgTaskResultList.getSize(),sendMsgTaskResultList.getCurrent(),sendMsgTaskResultList.getPages());
|
|
|
+ }
|
|
|
+ //取角色id变成list
|
|
|
+ List<String> roleId = sendMsgTaskResultList.getRecords().stream().
|
|
|
+ map(SendMsgResultVo::getRoleId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ SendMsgResultVo sendMsgResultVo = sendMsgTaskResultList.getRecords().get(0);
|
|
|
+ Criteria cri = Cnd.cri();
|
|
|
+ //拼接游戏ID
|
|
|
+ cri.where().andInStrList("role_id", roleId);
|
|
|
+ cri.where().andEquals("parent_id", sendMsgResultVo.getGameId());
|
|
|
+
|
|
|
+ //补齐参数
|
|
|
+ Sql sql = Sqls.create(getTaskResultSql() + cri);
|
|
|
+ sql.setCallback(Sqls.callback.entities());
|
|
|
+ sql.setEntity(dao.getEntity(TaskResultDto.class));
|
|
|
+ dao.execute(sql);
|
|
|
+ List<TaskResultDto> list = sql.getList(TaskResultDto.class);
|
|
|
+ //拼成map key为角色id
|
|
|
+ HashMap<String, TaskResultDto> taskResultMap = new HashMap<>();
|
|
|
+ list.forEach(item -> {
|
|
|
+ taskResultMap.put(item.getRoleId(), item);
|
|
|
+ });
|
|
|
+ sendMsgTaskResultList.getRecords().forEach(item -> {
|
|
|
+ TaskResultDto taskResultDto = taskResultMap.get(item.getRoleId());
|
|
|
+ if(taskResultDto!=null){
|
|
|
+ item.setGameName(taskResultDto.getGameName());
|
|
|
+ item.setRoleName(taskResultDto.getRoleName());
|
|
|
+ item.setRoleCreateTime(taskResultDto.getCreateTime());
|
|
|
+ item.setServerName(taskResultDto.getServerName());
|
|
|
+ item.setRoleVip(taskResultDto.getRoleVip());
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return new Page<>(sendMsgTaskResultList.getRecords(),sendMsgTaskResultList.getTotal(),sendMsgTaskResultList.getSize(),sendMsgTaskResultList.getCurrent(),sendMsgTaskResultList.getPages());
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("查询发送消息任务结果失败", e);
|
|
|
+ throw new BaseException("查询发送消息任务结果失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 补充查询发送消息任务结果sql
|
|
|
+ * @return String
|
|
|
+ */
|
|
|
+ private String getTaskResultSql() {
|
|
|
+ return """
|
|
|
+ select
|
|
|
+ a.role_name,
|
|
|
+ a.role_id,
|
|
|
+ a.server_name,
|
|
|
+ a.create_time,
|
|
|
+ a.role_vip,
|
|
|
+ b.game_name
|
|
|
+ from dm_game_order.t_game_user_role a
|
|
|
+ left join dm_game_order.t_game b on a.source_system= b.source_system and a.game_id = b.id
|
|
|
+ """;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 查询游戏sql
|