|
@@ -9,6 +9,8 @@ import com.zanxiang.common.enums.StatusEnum;
|
|
|
import com.zanxiang.common.exception.ParamNullException;
|
|
|
import com.zanxiang.common.utils.StringUtils;
|
|
|
import com.zanxiang.common.utils.bean.BeanUtils;
|
|
|
+import com.zanxiang.manage.domain.dto.GameCategoryDTO;
|
|
|
+import com.zanxiang.manage.domain.dto.GameDTO;
|
|
|
import com.zanxiang.manage.domain.params.GameAnalogPayParam;
|
|
|
import com.zanxiang.manage.domain.params.GamePayWayListParam;
|
|
|
import com.zanxiang.manage.domain.params.GamePayWayParam;
|
|
@@ -49,6 +51,12 @@ public class GamePayWayServiceImpl extends ServiceImpl<GamePayWayMapper, GamePay
|
|
|
@Autowired
|
|
|
private GameStrategyService gameStrategyService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private GameCategoryService gameCategoryService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private GameService gameService;
|
|
|
+
|
|
|
@Override
|
|
|
public List<GamePayWayVO> getByGameId(Long gameId) {
|
|
|
List<GamePayWay> gamePayWayList = super.list(new LambdaQueryWrapper<GamePayWay>()
|
|
@@ -80,17 +88,30 @@ public class GamePayWayServiceImpl extends ServiceImpl<GamePayWayMapper, GamePay
|
|
|
|
|
|
@Override
|
|
|
public IPage<GamePayWayListVO> list(GamePayWayListParam param) {
|
|
|
+ Map<Long, GameCategoryDTO> gameCategoryMap = gameCategoryService.gameCategoryMap();
|
|
|
+ Map<Long, GameDTO> gameMap = gameService.gameMap();
|
|
|
return super.page(param.toPage(), new LambdaQueryWrapper<GamePayWay>()
|
|
|
.eq(param.getGameId() != null, GamePayWay::getGameId, param.getGameId())
|
|
|
.eq(param.getPayWayId() != null, GamePayWay::getPayWayId, param.getPayWayId())
|
|
|
- .eq(param.getStatus() != null, GamePayWay::getStatus, param.getStatus())).convert(this::toVO);
|
|
|
+ .eq(param.getStatus() != null, GamePayWay::getStatus, param.getStatus()))
|
|
|
+ .convert(gamePayWay -> this.toVO(gameMap, gameCategoryMap, gamePayWay));
|
|
|
}
|
|
|
|
|
|
- private GamePayWayListVO toVO(GamePayWay gamePayWay) {
|
|
|
+ private GamePayWayListVO toVO(Map<Long, GameDTO> gameMap, Map<Long, GameCategoryDTO> gameCategoryMap, GamePayWay gamePayWay) {
|
|
|
if (gamePayWay == null) {
|
|
|
return null;
|
|
|
}
|
|
|
- return BeanUtils.copy(gamePayWay, GamePayWayListVO.class);
|
|
|
+ GamePayWayListVO gamePayWayListVO = BeanUtils.copy(gamePayWay, GamePayWayListVO.class);
|
|
|
+ GameDTO gameDTO = gameMap.get(gamePayWayListVO.getGameId());
|
|
|
+ if (gameDTO != null) {
|
|
|
+ gamePayWayListVO.setGameName(gameDTO.getName());
|
|
|
+ GameCategoryDTO gameCategoryDTO = gameCategoryMap.get(gameDTO.getCategory());
|
|
|
+ if (gameCategoryDTO != null) {
|
|
|
+ gamePayWayListVO.setGameCategoryId(gameCategoryDTO.getId());
|
|
|
+ gamePayWayListVO.setGameCategory(gameCategoryDTO.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return gamePayWayListVO;
|
|
|
}
|
|
|
|
|
|
/**
|