|
@@ -124,7 +124,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
|
* @create: 2021-07-15
|
|
|
*/
|
|
|
@Override
|
|
|
- public Result synchronousAccountTransactionDetails(String startDate,String endDate) {
|
|
|
+ public Result synchronousAccountTransactionDetails(String startDate, String endDate) {
|
|
|
log.info("开始同步账号交易流水");
|
|
|
Result result = new Result();
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
|
|
@@ -136,9 +136,9 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
|
accountIdList.stream().forEach(str -> {
|
|
|
if (!str.isEmpty()) {
|
|
|
//查询账号下充值的交易流水
|
|
|
- JSONObject jsonObject = queryAccountTransactionDetails(str, RECHARGE, 1, 1000, startDate,endDate);
|
|
|
+ JSONObject jsonObject = queryAccountTransactionDetails(str, RECHARGE, 1, 1000, startDate, endDate);
|
|
|
int code = (int) jsonObject.get("code");
|
|
|
- if(code!=0){
|
|
|
+ if (code != 0) {
|
|
|
result.setMessage((String) jsonObject.get("message"));
|
|
|
log.info((String) jsonObject.get("message"));
|
|
|
return;
|
|
@@ -162,7 +162,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
|
//查询其他页数据
|
|
|
if (total_page > 1) {
|
|
|
for (int i = 2; i <= total_page; i++) {
|
|
|
- JSONObject jo = queryAccountTransactionDetails(str, RECHARGE, i, 1000, startDate,endDate);
|
|
|
+ JSONObject jo = queryAccountTransactionDetails(str, RECHARGE, i, 1000, startDate, endDate);
|
|
|
JSONObject accountData = (JSONObject) jo.get("data");
|
|
|
List<Object> rechargeList = (List<Object>) accountData.get("list");
|
|
|
rechargeList.stream().forEach(transactionDetails -> {
|
|
@@ -178,10 +178,10 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
|
}
|
|
|
|
|
|
//查询账号下转账的交易流水
|
|
|
- JSONObject transferJsonObject = queryAccountTransactionDetails(str, TRANSFER, 1, 1000, startDate,endDate);
|
|
|
+ JSONObject transferJsonObject = queryAccountTransactionDetails(str, TRANSFER, 1, 1000, startDate, endDate);
|
|
|
JSONObject transferData = (JSONObject) transferJsonObject.get("data");
|
|
|
int code1 = (int) jsonObject.get("code");
|
|
|
- if(code1!=0){
|
|
|
+ if (code1 != 0) {
|
|
|
result.setMessage((String) jsonObject.get("message"));
|
|
|
log.info((String) jsonObject.get("message"));
|
|
|
return;
|
|
@@ -203,7 +203,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
|
//查询其他页数据
|
|
|
if (transferTotalPage > 1) {
|
|
|
for (int i = 2; i <= transferTotalPage; i++) {
|
|
|
- JSONObject jo = queryAccountTransactionDetails(str, TRANSFER, i, 1000, startDate,endDate);
|
|
|
+ JSONObject jo = queryAccountTransactionDetails(str, TRANSFER, i, 1000, startDate, endDate);
|
|
|
JSONObject accountData = (JSONObject) jo.get("data");
|
|
|
List<Object> rechargeList = (List<Object>) accountData.get("list");
|
|
|
rechargeList.stream().forEach(transactionDetails -> {
|
|
@@ -246,7 +246,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
|
* @create: 2021-07-15
|
|
|
*/
|
|
|
@Override
|
|
|
- public Result synchronousAccountTransactionDay(String startDate,String endDate) {
|
|
|
+ public Result synchronousAccountTransactionDay(String startDate, String endDate) {
|
|
|
log.info("开始同步账号日流水");
|
|
|
Result result = new Result();
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
|
|
@@ -260,18 +260,18 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
|
accountIdList.stream().forEach(str -> {
|
|
|
if (!str.isEmpty()) {
|
|
|
//查询账号下充值的交易流水
|
|
|
- JSONObject jsonObject = queryAccountTransactionDay(str, 1, 1000, startDate,endDate);
|
|
|
- JSONObject data=null;
|
|
|
- int code=1;
|
|
|
- if(jsonObject!=null){
|
|
|
- data = (JSONObject) jsonObject.get("data");
|
|
|
- code = (int) jsonObject.get("code");
|
|
|
- }else {
|
|
|
+ JSONObject jsonObject = queryAccountTransactionDay(str, 1, 1000, startDate, endDate);
|
|
|
+ JSONObject data = null;
|
|
|
+ int code = 1;
|
|
|
+ if (jsonObject != null) {
|
|
|
+ data = (JSONObject) jsonObject.get("data");
|
|
|
+ code = (int) jsonObject.get("code");
|
|
|
+ } else {
|
|
|
log.info("返回数据jsonObject为null:");
|
|
|
}
|
|
|
- if(code!=0){
|
|
|
+ if (code != 0) {
|
|
|
result.setMessage((String) jsonObject.get("message"));
|
|
|
- log.info("返回数据:"+jsonObject.toJSONString()+":"+str);
|
|
|
+ log.info("返回数据:" + jsonObject.toJSONString() + ":" + str);
|
|
|
}
|
|
|
if (data != null) {
|
|
|
List<Object> dataList = (List<Object>) data.get("list");
|
|
@@ -280,9 +280,9 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
|
//保存第一页数据
|
|
|
dataList.stream().forEach(ob -> {
|
|
|
TransactionDay transactionDay = JSONObject.toJavaObject((JSON) ob, TransactionDay.class);
|
|
|
- List<String> advertiserIdList = ctopAccountTransactionDayMapper.getAdvertiserIdByDate(transactionDay.getDate(),transactionDay.getAdvertiserId());
|
|
|
+ List<String> advertiserIdList = ctopAccountTransactionDayMapper.getAdvertiserIdByDate(transactionDay.getDate(), transactionDay.getAdvertiserId());
|
|
|
//订单号不存在
|
|
|
- if (advertiserIdList.isEmpty() || advertiserIdList.size()<=0) {
|
|
|
+ if (advertiserIdList.isEmpty() || advertiserIdList.size() <= 0) {
|
|
|
transactionDetailsList.add(transactionDay);
|
|
|
}
|
|
|
|
|
@@ -292,15 +292,15 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
|
//查询其他页数据
|
|
|
if (total_page > 1) {
|
|
|
for (int i = 2; i <= total_page; i++) {
|
|
|
- JSONObject jo = queryAccountTransactionDay(str, i, 1000, startDate,endDate);
|
|
|
+ JSONObject jo = queryAccountTransactionDay(str, i, 1000, startDate, endDate);
|
|
|
JSONObject accountData = (JSONObject) jo.get("data");
|
|
|
List<Object> rechargeList = (List<Object>) accountData.get("list");
|
|
|
rechargeList.stream().forEach(obj -> {
|
|
|
TransactionDay transactionDay = JSONObject.toJavaObject((JSON) obj, TransactionDay.class);
|
|
|
- List<String> advertiserIdList = ctopAccountTransactionDayMapper.getAdvertiserIdByDate(transactionDay.getDate(),transactionDay.getAdvertiserId());
|
|
|
+ List<String> advertiserIdList = ctopAccountTransactionDayMapper.getAdvertiserIdByDate(transactionDay.getDate(), transactionDay.getAdvertiserId());
|
|
|
|
|
|
//订单号不存在
|
|
|
- if (advertiserIdList.isEmpty() || advertiserIdList.size()<=0) {
|
|
|
+ if (advertiserIdList.isEmpty() || advertiserIdList.size() <= 0) {
|
|
|
transactionDetailsList.add(transactionDay);
|
|
|
}
|
|
|
});
|
|
@@ -338,7 +338,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
|
* @create: 2021-07-14
|
|
|
*/
|
|
|
@Override
|
|
|
- public JSONObject queryAccountTransactionDetails(String AccountId, String transaction_type, int pageNum, int pageSize, String startDate,String endDate) {
|
|
|
+ public JSONObject queryAccountTransactionDetails(String AccountId, String transaction_type, int pageNum, int pageSize, String startDate, String endDate) {
|
|
|
// 请求参数
|
|
|
Map data = new HashMap() {
|
|
|
{
|
|
@@ -362,22 +362,22 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
|
* @create: 2021-07-14
|
|
|
*/
|
|
|
@Override
|
|
|
- public JSONObject queryAccountTransactionDay(String AccountId, int pageNum, int pageSize,String startDate,String endDate) {
|
|
|
+ public JSONObject queryAccountTransactionDay(String AccountId, int pageNum, int pageSize, String startDate, String endDate) {
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
|
|
|
Calendar ca = Calendar.getInstance();
|
|
|
ca.setTime(new Date());
|
|
|
ca.add(Calendar.DATE, -1);
|
|
|
- // 请求参数
|
|
|
- Map data = new HashMap() {
|
|
|
- {
|
|
|
- put("advertiser_id", AccountId);
|
|
|
- put("start_date", startDate);
|
|
|
- put("end_date", endDate);
|
|
|
- put("page", pageNum);
|
|
|
- put("page_size", pageSize);
|
|
|
- }
|
|
|
- };
|
|
|
- return sendHttpRequest(data, ACCOUNT_TRANSACTION_DAY_URL);
|
|
|
+ // 请求参数
|
|
|
+ Map data = new HashMap() {
|
|
|
+ {
|
|
|
+ put("advertiser_id", AccountId);
|
|
|
+ put("start_date", startDate);
|
|
|
+ put("end_date", endDate);
|
|
|
+ put("page", pageNum);
|
|
|
+ put("page_size", pageSize);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ return sendHttpRequest(data, ACCOUNT_TRANSACTION_DAY_URL);
|
|
|
|
|
|
|
|
|
}
|