|
@@ -30,7 +30,10 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author tianhua
|
|
@@ -134,28 +137,10 @@ public class GamePolicyConfigServiceImpl extends ServiceImpl<GamePolicyConfigMap
|
|
|
GameSupper gameSupper = gameSupperService.getById(vo.getSuperGameId());
|
|
|
GameDTO game = gameService.getById(vo.getSuperGameId());
|
|
|
String superGameName = null == gameSupper ? (null == game ? null : game.getName()) : gameSupper.getName();
|
|
|
- //告警人员名称
|
|
|
- StringBuilder userNameStr = new StringBuilder();
|
|
|
- if (StringUtils.isNotBlank(vo.getUserIds())) {
|
|
|
- String[] userIds = vo.getUserIds().split(",");
|
|
|
- for (int i = 0; i < userIds.length; i++) {
|
|
|
- userNameStr.append(sysUserRpc.getById(Long.valueOf(userIds[i])).getData().getNickname());
|
|
|
- if (i != userIds.length -1) {
|
|
|
- userNameStr.append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //排除标签名称
|
|
|
- StringBuilder tagNameStr = new StringBuilder();
|
|
|
- if (StringUtils.isNotBlank(vo.getTagIds())) {
|
|
|
- String[] tagIds = vo.getTagIds().split(",");
|
|
|
- for (int i = 0; i < tagIds.length; i++) {
|
|
|
- tagNameStr.append(ExcludeTagsEnum.getTagName(Integer.valueOf(tagIds[i])));
|
|
|
- if (i != tagIds.length -1) {
|
|
|
- tagNameStr.append(",");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ List<Long> userIds = StringUtils.isNotBlank(vo.getUserIds()) ?
|
|
|
+ Arrays.stream(vo.getUserIds().split(",")).map(Long::valueOf).collect(Collectors.toList()) : null;
|
|
|
+ List<Long> tagIds = StringUtils.isNotBlank(vo.getTagIds()) ?
|
|
|
+ Arrays.stream(vo.getTagIds().split(",")).map(Long::valueOf).collect(Collectors.toList()) : null;
|
|
|
return GamePolicyConfigListVO.builder()
|
|
|
.id(vo.getId())
|
|
|
.superGameId(vo.getSuperGameId())
|
|
@@ -166,8 +151,8 @@ public class GamePolicyConfigServiceImpl extends ServiceImpl<GamePolicyConfigMap
|
|
|
.time(StringUtils.isBlank(time) ? null : Long.valueOf(time))
|
|
|
.timeCondition(StringUtils.isBlank(timeCondition) ? null : timeCondition)
|
|
|
.configExplain(vo.getConfigExplain())
|
|
|
- .userNameStr(StringUtils.isBlank(userNameStr.toString()) ? null : userNameStr.toString())
|
|
|
- .tagsNameStr(StringUtils.isBlank(tagNameStr.toString()) ? null : tagNameStr.toString())
|
|
|
+ .userNameStr(userIds)
|
|
|
+ .tagsNameStr(tagIds)
|
|
|
.createBy(vo.getCreateBy())
|
|
|
.createName(sysUserRpc.getById(vo.getCreateBy()).getData().getNickname())
|
|
|
.createTime(vo.getCreateTime())
|