|
@@ -32,6 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
+import java.util.function.Function;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -237,7 +238,14 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
sql.setPager(pager);
|
|
sql.setPager(pager);
|
|
dao.execute(sql);
|
|
dao.execute(sql);
|
|
List<Map> list = sql.getList(Map.class).stream().map(map -> {
|
|
List<Map> list = sql.getList(Map.class).stream().map(map -> {
|
|
- getNameById(map);
|
|
|
|
|
|
+ getNameById(map);
|
|
|
|
+
|
|
|
|
+ String str = (String) map.get("role_amount");
|
|
|
|
+ if(str!=null&&str.contains("[") && str.contains("]")){
|
|
|
|
+ //去掉字符串中的‘[]’
|
|
|
|
+ map.put("role_amount", str.replaceAll("\\[|\\]", ""));
|
|
|
|
+ }
|
|
|
|
+
|
|
//去除‘null’字符串
|
|
//去除‘null’字符串
|
|
if ("null".equals(map.get("add_corp_user_id"))) {
|
|
if ("null".equals(map.get("add_corp_user_id"))) {
|
|
map.put("add_corp_user_id", null);
|
|
map.put("add_corp_user_id", null);
|
|
@@ -335,6 +343,12 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public void createSendMsgTask(SendMsgTaskDTO dto) {
|
|
public void createSendMsgTask(SendMsgTaskDTO dto) {
|
|
|
|
+ //校验游戏id的超父不为2的不让发消息,cp方未提供此功能
|
|
|
|
+ Map<Long, GameDTO> parentGameMap = getParentGameMap();
|
|
|
|
+ GameDTO gameDTO = parentGameMap.get(dto.getGameId());
|
|
|
|
+ if(gameDTO!=null && gameDTO.getSuperGameId()!=2){
|
|
|
|
+ throw new BaseException(gameDTO.getGameName()+">该游戏不支持发送消息");
|
|
|
|
+ }
|
|
//获取当前用户id
|
|
//获取当前用户id
|
|
Long sysUserId = SecurityUtil.getUserId();
|
|
Long sysUserId = SecurityUtil.getUserId();
|
|
//构建发送消息dto
|
|
//构建发送消息dto
|
|
@@ -573,16 +587,16 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
return new Page<>(sendMsgTaskList.getRecords(),sendMsgTaskList.getTotal(),sendMsgTaskList.getSize(),sendMsgTaskList.getCurrent(),sendMsgTaskList.getPages());
|
|
return new Page<>(sendMsgTaskList.getRecords(),sendMsgTaskList.getTotal(),sendMsgTaskList.getSize(),sendMsgTaskList.getCurrent(),sendMsgTaskList.getPages());
|
|
}
|
|
}
|
|
//查询所有游戏名称map key为游戏id,value为游戏名称
|
|
//查询所有游戏名称map key为游戏id,value为游戏名称
|
|
- Map<Long, String> gameMap = getParentGameMap();
|
|
|
|
|
|
+ Map<Long, GameDTO> gameMap = getParentGameMap();
|
|
|
|
|
|
//查询创建人id key为创建人id,value为创建人名称
|
|
//查询创建人id key为创建人id,value为创建人名称
|
|
Map<Long, String> userMap = getCreateByNameMap(sendMsgTaskList);
|
|
Map<Long, String> userMap = getCreateByNameMap(sendMsgTaskList);
|
|
|
|
|
|
//循环遍历获取游戏名称, 获取创建人名称
|
|
//循环遍历获取游戏名称, 获取创建人名称
|
|
sendMsgTaskList.getRecords().forEach(item -> {
|
|
sendMsgTaskList.getRecords().forEach(item -> {
|
|
- String gameName = gameMap.get(item.getGameId());
|
|
|
|
- if (gameName != null){
|
|
|
|
- item.setGameName(gameName);
|
|
|
|
|
|
+ GameDTO gameDTO = gameMap.get(item.getGameId());
|
|
|
|
+ if (gameDTO!=null && gameDTO.getGameName() != null){
|
|
|
|
+ item.setGameName(gameDTO.getGameName());
|
|
}
|
|
}
|
|
String userName = userMap.get(item.getCreateBy());
|
|
String userName = userMap.get(item.getCreateBy());
|
|
if (userName != null){
|
|
if (userName != null){
|
|
@@ -613,14 +627,14 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
/**
|
|
/**
|
|
* 获取游戏列表
|
|
* 获取游戏列表
|
|
*/
|
|
*/
|
|
- private Map<Long, String> getParentGameMap(){
|
|
|
|
|
|
+ private Map<Long, GameDTO> getParentGameMap(){
|
|
Sql sql = Sqls.create(getGameSql());
|
|
Sql sql = Sqls.create(getGameSql());
|
|
sql.setCallback(Sqls.callback.entities());
|
|
sql.setCallback(Sqls.callback.entities());
|
|
sql.setEntity(dao.getEntity(GameDTO.class));
|
|
sql.setEntity(dao.getEntity(GameDTO.class));
|
|
dao.execute(sql);
|
|
dao.execute(sql);
|
|
List<GameDTO> gameDtoList = sql.getList(GameDTO.class);
|
|
List<GameDTO> gameDtoList = sql.getList(GameDTO.class);
|
|
//将游戏拼成map key为游戏id,value为游戏名称
|
|
//将游戏拼成map key为游戏id,value为游戏名称
|
|
- return gameDtoList.stream().collect(Collectors.toMap(GameDTO::getId, GameDTO::getGameName));
|
|
|
|
|
|
+ return gameDtoList.stream().collect(Collectors.toMap(GameDTO::getId, Function.identity()));
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|