|
@@ -136,30 +136,16 @@ public class EtlKuaishouReportAccountHourlyServiceImpl extends ServiceImpl<EtlKu
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Result<Object> getMaxChargeAccountIdByUser(String userId) {
|
|
public Result<Object> getMaxChargeAccountIdByUser(String userId) {
|
|
- Long accountId = etlDailyAccountMapper.getMaxChargeAccountId(userId);
|
|
|
|
- if (Check.isNull(accountId)) {
|
|
|
|
- accountId = etlDailyAccountMapper.getMaxCharge();
|
|
|
|
|
|
+ JSONObject obj = etlDailyAccountMapper.getMaxChargeAccountId(userId);
|
|
|
|
+ if (Check.isNull(obj)) {
|
|
|
|
+ obj = etlDailyAccountMapper.getMaxChargeAccountId(null);
|
|
}
|
|
}
|
|
- return Result.ok(accountId);
|
|
|
|
|
|
+ return Result.ok(obj.getLong("accountId"));
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Result<Object> getMaxChargeAccountId(Long accountId, String userId) {
|
|
|
|
- if (Check.isNull(accountId)) {
|
|
|
|
- accountId = etlDailyAccountMapper.getMaxChargeAccountId(userId);
|
|
|
|
- if (Check.isNull(accountId)) {
|
|
|
|
- accountId = etlDailyAccountMapper.getMaxCharge();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ public Result<Object> getMaxChargeAccountId(Long accountId) {
|
|
JSONObject obj = new JSONObject();
|
|
JSONObject obj = new JSONObject();
|
|
- CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
|
|
- if (Check.isNull(oauthToken)) {
|
|
|
|
- return Result.error("未获取到账户信息,accountId:" + accountId);
|
|
|
|
- }
|
|
|
|
- JSONObject fundJson = iKuaishouInterfaceService.fundGet(oauthToken);
|
|
|
|
- if (!Check.isNull(fundJson)) {
|
|
|
|
- obj.put("totalBalance", fundJson.getBigDecimal("balance")); // 余额
|
|
|
|
- }
|
|
|
|
UserAllocation userAllocation = allocationMapper.getUserAllocation(accountId);
|
|
UserAllocation userAllocation = allocationMapper.getUserAllocation(accountId);
|
|
if (!Check.isNull(userAllocation)) {
|
|
if (!Check.isNull(userAllocation)) {
|
|
obj.put("accountName", userAllocation.getAuthName());
|
|
obj.put("accountName", userAllocation.getAuthName());
|
|
@@ -169,6 +155,19 @@ public class EtlKuaishouReportAccountHourlyServiceImpl extends ServiceImpl<EtlKu
|
|
Integer counts = kuaiShouCreativeMapper.getRejectedCountsforAccountId(accountId);
|
|
Integer counts = kuaiShouCreativeMapper.getRejectedCountsforAccountId(accountId);
|
|
obj.put("rejectedCounts", counts);
|
|
obj.put("rejectedCounts", counts);
|
|
obj.put("accountId", accountId);
|
|
obj.put("accountId", accountId);
|
|
|
|
+ CtopOauthToken oauthToken = oauthTokenService.getTokenByAccountId(accountId);
|
|
|
|
+ if (Check.isNull(oauthToken)) {
|
|
|
|
+ Result result = new Result();
|
|
|
|
+ result.setResult(obj);
|
|
|
|
+ result.setSuccess(false);
|
|
|
|
+ result.setCode(500);
|
|
|
|
+ result.setMessage("未获取到账户信息");
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+ JSONObject fundJson = iKuaishouInterfaceService.fundGet(oauthToken);
|
|
|
|
+ if (!Check.isNull(fundJson)) {
|
|
|
|
+ obj.put("totalBalance", fundJson.getBigDecimal("balance")); // 余额
|
|
|
|
+ }
|
|
return Result.ok(obj);
|
|
return Result.ok(obj);
|
|
}
|
|
}
|
|
}
|
|
}
|