|
@@ -10,6 +10,7 @@ import com.zanxiang.erp.security.util.SecurityUtil;
|
|
|
import com.zanxiang.game.module.manage.pojo.dto.GameDTO;
|
|
|
import com.zanxiang.game.module.manage.pojo.params.GameAdPolicyAddOrUpdateParam;
|
|
|
import com.zanxiang.game.module.manage.pojo.params.GameAdPolicyBatchOperationParam;
|
|
|
+import com.zanxiang.game.module.manage.pojo.params.GameAdPolicyBatchStartParam;
|
|
|
import com.zanxiang.game.module.manage.pojo.params.GameAdPolicyListParam;
|
|
|
import com.zanxiang.game.module.manage.pojo.vo.GameAdPolicyListVO;
|
|
|
import com.zanxiang.game.module.manage.pojo.vo.GameAdRuleConditionVO;
|
|
@@ -65,7 +66,8 @@ public class GameAdMonitorServiceImpl extends ServiceImpl<GameAdMonitorMapper, G
|
|
|
.eq(GameAdMonitor::getGameId, param.getGameId())
|
|
|
.eq(GameAdMonitor::getMediaType, param.getMediaType())
|
|
|
.eq(GameAdMonitor::getRuleDimension, param.getRuleDimension())
|
|
|
- .eq(GameAdMonitor::getEffectiveScope, StringUtils.join(param.getEffectiveScope().toArray(), "-"))
|
|
|
+ .eq(GameAdMonitor::getEffectiveScope, StringUtils.join(CollectionUtils.isEmpty(param.getEffectiveScope())
|
|
|
+ ? null : param.getEffectiveScope().toArray(), "-"))
|
|
|
.eq(GameAdMonitor::getAlarmType, param.getAlarmType())
|
|
|
.eq(GameAdMonitor::getAlarmFrequency, param.getAlarmFrequency())
|
|
|
.eq(GameAdMonitor::getAlarmCount, param.getAlarmCount())
|
|
@@ -87,7 +89,8 @@ public class GameAdMonitorServiceImpl extends ServiceImpl<GameAdMonitorMapper, G
|
|
|
.gameId(param.getGameId())
|
|
|
.mediaType(param.getMediaType())
|
|
|
.ruleDimension(param.getRuleDimension())
|
|
|
- .effectiveScope(StringUtils.join(param.getEffectiveScope().toArray(), "-"))
|
|
|
+ .effectiveScope(StringUtils.join(CollectionUtils.isEmpty(param.getEffectiveScope())
|
|
|
+ ? null : param.getEffectiveScope().toArray(), "-"))
|
|
|
.isStart(param.getIsStart())
|
|
|
.alarmType(param.getAlarmType())
|
|
|
.alarmFrequency(param.getAlarmFrequency())
|
|
@@ -140,7 +143,6 @@ public class GameAdMonitorServiceImpl extends ServiceImpl<GameAdMonitorMapper, G
|
|
|
//当前操作人员
|
|
|
Long sysUserId = SecurityUtil.getUserId();
|
|
|
return update(new LambdaUpdateWrapper<GameAdMonitor>()
|
|
|
- .set(param.getIsStart() != null, GameAdMonitor::getIsStart, param.getIsStart())
|
|
|
.set(GameAdMonitor::getAccountWhitelist, StringUtils.join(CollectionUtils.isEmpty(param.getAccountWhitelist()) ?
|
|
|
null : param.getAccountWhitelist().toArray(), "-"))
|
|
|
.set(param.getAccountValidTime() != null, GameAdMonitor::getAccountValidTime, param.getAdValidTime())
|
|
@@ -153,6 +155,19 @@ public class GameAdMonitorServiceImpl extends ServiceImpl<GameAdMonitorMapper, G
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public boolean batchStart(GameAdPolicyBatchStartParam param) {
|
|
|
+ //当前操作人员
|
|
|
+ Long sysUserId = SecurityUtil.getUserId();
|
|
|
+ return update(new LambdaUpdateWrapper<GameAdMonitor>()
|
|
|
+ .set(GameAdMonitor::getIsStart, param.getIsStart())
|
|
|
+ .set(GameAdMonitor::getUpdateBy, sysUserId)
|
|
|
+ .set(GameAdMonitor::getUpdateTime, LocalDateTime.now())
|
|
|
+ .in(GameAdMonitor::getId, param.getIds())
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
private GameAdPolicyListVO toVO(GameAdMonitor vo) {
|
|
|
GameDTO game = gameService.getById(vo.getId());
|
|
|
List<GameAdRuleConditionVO> ruleConditionVOList = JsonUtil.toObj(vo.getRuleCondition(), List.class);
|
|
@@ -165,8 +180,9 @@ public class GameAdMonitorServiceImpl extends ServiceImpl<GameAdMonitorMapper, G
|
|
|
.gameName(game == null ? null : game.getName())
|
|
|
.mediaType(vo.getMediaType())
|
|
|
.ruleDimension(vo.getRuleDimension())
|
|
|
- .effectiveScope(Arrays.stream(vo.getEffectiveScope().split("-")).
|
|
|
- map(Long::valueOf).collect(Collectors.toList()))
|
|
|
+ .effectiveScope(StringUtils.isBlank(vo.getEffectiveScope()) ? null :
|
|
|
+ Arrays.stream(vo.getEffectiveScope().split("-"))
|
|
|
+ .map(Long::valueOf).collect(Collectors.toList()))
|
|
|
.isStart(vo.getIsStart())
|
|
|
.alarmType(vo.getAlarmType())
|
|
|
.alarmFrequency(vo.getAlarmFrequency())
|