|
@@ -131,14 +131,25 @@ public class AppUserAgentController extends BaseController
|
|
|
@Anonymous
|
|
|
@PostMapping("/updateConfig")
|
|
|
@ApiOperation(value = "修改代理配置", notes = "修改代理配置")
|
|
|
- public HttpRet addAgent(@RequestBody AppUserAgentDTO appUserAgent)
|
|
|
+ public HttpRet updateConfig(@RequestBody AppUserAgentDTO appUserAgent)
|
|
|
{
|
|
|
if(appUserAgent == null){
|
|
|
return HttpRet.fail("代理数据为空。");
|
|
|
}
|
|
|
|
|
|
+ if(appUserAgent.getLiveRate() == null || appUserAgent.getLiveRate() > 100){
|
|
|
+ return HttpRet.fail("直播佣金参数异常。");
|
|
|
+ }
|
|
|
+
|
|
|
+ if(appUserAgent.getDividendGuaranteeRate() == null || appUserAgent.getDividendGuaranteeRate() > 100){
|
|
|
+ return HttpRet.fail("保底分红参数异常。");
|
|
|
+ }
|
|
|
+
|
|
|
AppUserAgent dbUserAgent = new AppUserAgent();
|
|
|
BeanUtils.copyProperties(appUserAgent, dbUserAgent);
|
|
|
+ appUserAgent.setUserId(null);
|
|
|
+ appUserAgent.setPid(null);
|
|
|
+ appUserAgent.setTopId(null);
|
|
|
dbUserAgent.setUpdateTime(new Date());
|
|
|
appUserAgentService.updateAppUserAgent(dbUserAgent);
|
|
|
|
|
@@ -149,10 +160,16 @@ public class AppUserAgentController extends BaseController
|
|
|
/* if(commission.getPid() == null){
|
|
|
commission.setPid(appUserAgent.getPid());
|
|
|
}*/
|
|
|
+ if(commission.getGameId() == null){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
commission.setPid(appUserAgent.getPid());
|
|
|
commission.setUserId(dbUserAgent.getUserId());
|
|
|
appGameCommissionService.insertAppGameCommission(commission);
|
|
|
}else{
|
|
|
+ commission.setUserId(null);
|
|
|
+ commission.setPid(null);
|
|
|
+ commission.setGameId(null);
|
|
|
appGameCommissionService.updateAppGameCommission(commission);
|
|
|
}
|
|
|
}
|