|
@@ -1,7 +1,8 @@
|
|
|
package com.zanxiang.game.data.serve.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
-import com.zangxiang.game.base.pojo.vo.SendMsgVo;
|
|
|
+import com.zanxiang.game.data.serve.pojo.vo.GameDataDayVO;
|
|
|
+import com.zanxiang.game.module.base.pojo.vo.SendMsgVo;
|
|
|
import com.zanxiang.erp.base.ErpServer;
|
|
|
import com.zanxiang.erp.base.rpc.ISysUserRpc;
|
|
|
import com.zanxiang.erp.security.util.SecurityUtil;
|
|
@@ -12,8 +13,11 @@ import com.zanxiang.game.data.serve.pojo.dto.SendMsgTaskDto;
|
|
|
import com.zanxiang.game.data.serve.pojo.enums.OrderByEnum;
|
|
|
import com.zanxiang.game.data.serve.service.IRoleManageService;
|
|
|
import com.zanxiang.game.data.serve.utils.Page;
|
|
|
+import com.zanxiang.game.module.base.ServerInfo;
|
|
|
import com.zanxiang.game.module.base.pojo.dto.SendMsgDto;
|
|
|
-import com.zanxiang.game.module.base.rpc.SendMsgRpc;
|
|
|
+import com.zanxiang.game.module.base.pojo.params.SendMsgTaskParam;
|
|
|
+import com.zanxiang.game.module.base.rpc.ICPSendMsgRpc;
|
|
|
+import com.zanxiang.game.module.base.util.PageUtil;
|
|
|
import com.zanxiang.module.util.exception.BaseException;
|
|
|
import com.zanxiang.module.util.pojo.ResultVO;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -29,7 +33,6 @@ import org.nutz.dao.sql.Sql;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import javax.validation.Valid;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -48,8 +51,8 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
|
@DubboReference(providedBy = ErpServer.SERVER_DUBBO_NAME)
|
|
|
private ISysUserRpc sysUserRpc;
|
|
|
|
|
|
- @DubboReference
|
|
|
- private SendMsgRpc sendMsgRpc;
|
|
|
+ @DubboReference(providedBy = ServerInfo.SERVER_DUBBO_NAME)
|
|
|
+ private ICPSendMsgRpc sendMsgRpc;
|
|
|
|
|
|
|
|
|
|
|
@@ -338,13 +341,10 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
|
public void createSendMsgTask(SendMsgTaskDto dto) {
|
|
|
|
|
|
validation(dto);
|
|
|
-
|
|
|
|
|
|
Long sysUserId = SecurityUtil.getUserId();
|
|
|
-
|
|
|
|
|
|
SendMsgDto sendMsgDto = buildSendMsgDto(dto, sysUserId);
|
|
|
-
|
|
|
|
|
|
ResultVO<Boolean> booleanResultVO = sendMsgRpc.sendMsg(sendMsgDto);
|
|
|
if (!booleanResultVO.isSuccess()) {
|
|
@@ -379,7 +379,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
|
|
|
|
List<String> roleIdList = roleList.stream()
|
|
|
.map(map -> Optional.ofNullable(map.get("role_id")).map(Object::toString).orElse(null))
|
|
|
- .collect(Collectors.toList());
|
|
|
+ .toList();
|
|
|
|
|
|
SendMsgDto sendMsgDto = new SendMsgDto();
|
|
|
|
|
@@ -588,8 +588,44 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
|
*/
|
|
|
@Override
|
|
|
public Page<SendMsgVo> getSendMsgTaskList(MsgTaskDto dto) {
|
|
|
-
|
|
|
- return null;
|
|
|
+ try {
|
|
|
+ SendMsgTaskParam sendMsgTaskParam = new SendMsgTaskParam();
|
|
|
+ sendMsgTaskParam.setGameId(dto.getGameId());
|
|
|
+ sendMsgTaskParam.setPageNum(dto.getPageNum());
|
|
|
+ sendMsgTaskParam.setPageSize(dto.getPageSize());
|
|
|
+ PageUtil<SendMsgVo> sendMsgTaskList = sendMsgRpc.getSendMsgTaskList(sendMsgTaskParam);
|
|
|
+
|
|
|
+ Sql sql = Sqls.create(getGameSql());
|
|
|
+ sql.setCallback(Sqls.callback.entities());
|
|
|
+ sql.setEntity(dao.getEntity(GameDataDayVO.class));
|
|
|
+ dao.execute(sql);
|
|
|
+ sendMsgTaskList.getRecords().forEach(item -> {
|
|
|
+ String game = "";
|
|
|
+ item.setGameName(game);
|
|
|
+ });
|
|
|
+ return new Page<>(sendMsgTaskList.getRecords(),sendMsgTaskList.getTotal(),sendMsgTaskList.getSize(),sendMsgTaskList.getCurrent(),sendMsgTaskList.getPages());
|
|
|
+ }catch (Exception exception){
|
|
|
+ log.error("获取发送消息任务列表失败", exception);
|
|
|
+ throw new BaseException("获取发送消息任务列表失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 查询游戏sql
|
|
|
+ * @return String
|
|
|
+ */
|
|
|
+ private String getGameSql() {
|
|
|
+ return """
|
|
|
+ SELECT
|
|
|
+ -- 游戏名称、游戏类型、父游戏id、超父游戏id
|
|
|
+ source_system,
|
|
|
+ id,
|
|
|
+ game_name,
|
|
|
+ classify,
|
|
|
+ parent_id,
|
|
|
+ super_game_id
|
|
|
+ FROM dm_game_order.t_game
|
|
|
+ """;
|
|
|
}
|
|
|
|
|
|
|