|
@@ -161,6 +161,71 @@ public class AppUserAgentController extends BaseController
|
|
|
return HttpRet.success("修改成功", appUserAgent);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * 获取代理成员设置
|
|
|
+ */
|
|
|
+ @Anonymous
|
|
|
+ @PostMapping(value = "/getUserAgentByUserId")
|
|
|
+ @ApiOperation(value = "获取代理配置", notes = "获取代理配置")
|
|
|
+ public HttpRet<AppUserAgentVO> getUserAgentByUserId()
|
|
|
+ {
|
|
|
+
|
|
|
+ Long userId = SecurityUtils.getUserId();
|
|
|
+
|
|
|
+ AppUserAgent userAgent = new AppUserAgent();
|
|
|
+ userAgent.setUserId(userId);
|
|
|
+ List<AppUserAgent> userAgents = appUserAgentService.selectAppUserAgentList(userAgent);
|
|
|
+
|
|
|
+ if(userAgents == null || userAgents.isEmpty()){
|
|
|
+ return HttpRet.fail("代理信息不存在。");
|
|
|
+ }
|
|
|
+
|
|
|
+ AppUserAgent appUserAgent = userAgents.get(0);
|
|
|
+
|
|
|
+ AppUserAgentVO appUserAgentVO = new AppUserAgentVO();
|
|
|
+ BeanUtils.copyProperties(appUserAgent, appUserAgentVO);
|
|
|
+
|
|
|
+ AppGameCommission appGameCommission = new AppGameCommission();
|
|
|
+ appGameCommission.setPid(appUserAgent.getPid());
|
|
|
+ appGameCommission.setUserId(appUserAgent.getUserId());
|
|
|
+ List<AppGameCommission> gameCommissions = appGameCommissionService.selectAppGameCommissionList(appGameCommission);
|
|
|
+ Map<Long, List<AppGameCommission>> idGameMap;
|
|
|
+ if(gameCommissions != null && !gameCommissions.isEmpty()){
|
|
|
+ idGameMap = gameCommissions.stream().collect(Collectors.groupingBy(AppGameCommission::getGameId));
|
|
|
+ }else{
|
|
|
+ idGameMap = new HashMap<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ List<AppGameCommissionVO> gameCommissionVOList = new ArrayList<>();
|
|
|
+
|
|
|
+ List<AppGame> gameList = appGameService.selectAppGameList(new AppGame());
|
|
|
+ if(gameList != null && !gameList.isEmpty()){
|
|
|
+ for (int i = 0; i < gameList.size(); i++) {
|
|
|
+ AppGame appGame = gameList.get(i);
|
|
|
+
|
|
|
+
|
|
|
+ AppGameCommissionVO appGameCommissionVO = new AppGameCommissionVO();
|
|
|
+ if(idGameMap.containsKey(appGame.getId())){
|
|
|
+ AppGameCommission gameCommission = idGameMap.get(appGame.getId()).get(0);
|
|
|
+ BeanUtils.copyProperties(gameCommission, appGameCommissionVO);
|
|
|
+ }else{
|
|
|
+ appGameCommissionVO.setGameRate(0L);
|
|
|
+ }
|
|
|
+
|
|
|
+ appGameCommissionVO.setGameId(appGame.getId());
|
|
|
+ appGameCommissionVO.setGameName(appGame.getName());
|
|
|
+ appGameCommissionVO.setLogoUrl(appGame.getLogoUrl());
|
|
|
+ appGameCommissionVO.setGamePath(appGame.getGamePath());
|
|
|
+
|
|
|
+ gameCommissionVOList.add(appGameCommissionVO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ appUserAgentVO.setCommissions(gameCommissionVOList);
|
|
|
+
|
|
|
+ return HttpRet.success("查询成功", appUserAgentVO);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
* 获取代理成员设置
|
|
|
*/
|