|
@@ -82,9 +82,10 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
for (String account : split) {
|
|
for (String account : split) {
|
|
//分页查询第一页数据
|
|
//分页查询第一页数据
|
|
JSONObject agentAccountList = selectAgentAdvertiser(1, 2000, account);
|
|
JSONObject agentAccountList = selectAgentAdvertiser(1, 2000, account);
|
|
- if (!Integer.valueOf(agentAccountList.get("code").toString()).equals(0)){
|
|
|
|
- log.info("代理商:{}拉取账户异常--{}",account,agentAccountList);
|
|
|
|
- };
|
|
|
|
|
|
+ if (!Integer.valueOf(agentAccountList.get("code").toString()).equals(0)) {
|
|
|
|
+ log.info("代理商:{}拉取账户异常--{}", account, agentAccountList);
|
|
|
|
+ }
|
|
|
|
+ ;
|
|
|
|
|
|
JSONObject data = (JSONObject) agentAccountList.get("data");
|
|
JSONObject data = (JSONObject) agentAccountList.get("data");
|
|
//dataList.addAll((List) data.get("list"));
|
|
//dataList.addAll((List) data.get("list"));
|
|
@@ -266,9 +267,10 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private IUserAllocationService userAllocationService;
|
|
private IUserAllocationService userAllocationService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public Result synchronousAccountTransactionDay(String startDate, String endDate) {
|
|
public Result synchronousAccountTransactionDay(String startDate, String endDate) {
|
|
- log.info("开始同步账号日流水---日期{}---{}",startDate,endDate);
|
|
|
|
|
|
+ log.info("开始同步账号日流水---日期{}---{}", startDate, endDate);
|
|
Result result = new Result();
|
|
Result result = new Result();
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
|
|
Calendar ca = Calendar.getInstance();
|
|
Calendar ca = Calendar.getInstance();
|
|
@@ -277,7 +279,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
|
|
|
|
try {
|
|
try {
|
|
List<Long> list = new ArrayList<>();
|
|
List<Long> list = new ArrayList<>();
|
|
- list.add(13590893L);
|
|
|
|
|
|
+ /* list.add(13590893L);
|
|
list.add(13740894L);
|
|
list.add(13740894L);
|
|
list.add(13980885L);
|
|
list.add(13980885L);
|
|
list.add(14160885L);
|
|
list.add(14160885L);
|
|
@@ -330,7 +332,11 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
list.add(13980885L);
|
|
list.add(13980885L);
|
|
list.add(14160885L);
|
|
list.add(14160885L);
|
|
list.add(14310885L);
|
|
list.add(14310885L);
|
|
-
|
|
|
|
|
|
+ list.add(16140887L);
|
|
|
|
+ list.add(12690885L);
|
|
|
|
+ list.add(14670885L);
|
|
|
|
+ list.add(12690885L);
|
|
|
|
+ */
|
|
|
|
|
|
|
|
|
|
List<String> accountIdList = userAllocationService.getAccountListByProjectV2(list);
|
|
List<String> accountIdList = userAllocationService.getAccountListByProjectV2(list);
|
|
@@ -362,9 +368,9 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
TransactionDay transactionDay = JSONObject.toJavaObject((JSON) ob, TransactionDay.class);
|
|
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.size() > 1){
|
|
|
|
|
|
+ if (advertiserIdList.size() > 1) {
|
|
ctopAccountTransactionDayMapper.deleteAccountTransactionById(advertiserIdList.get(0));
|
|
ctopAccountTransactionDayMapper.deleteAccountTransactionById(advertiserIdList.get(0));
|
|
- log.info("----------->删除重复数据。accountId:{},date:{}",transactionDay.getAdvertiserId(),transactionDay.getDate());
|
|
|
|
|
|
+ log.info("----------->删除重复数据。accountId:{},date:{}", transactionDay.getAdvertiserId(), transactionDay.getDate());
|
|
}
|
|
}
|
|
//订单号不存在
|
|
//订单号不存在
|
|
if (advertiserIdList.isEmpty() || advertiserIdList.size() <= 0) {
|
|
if (advertiserIdList.isEmpty() || advertiserIdList.size() <= 0) {
|
|
@@ -384,7 +390,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
TransactionDay transactionDay = JSONObject.toJavaObject((JSON) obj, TransactionDay.class);
|
|
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.size() > 1){
|
|
|
|
|
|
+ if (advertiserIdList.size() > 1) {
|
|
ctopAccountTransactionDayMapper.deleteAccountTransactionById(advertiserIdList.get(0));
|
|
ctopAccountTransactionDayMapper.deleteAccountTransactionById(advertiserIdList.get(0));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -417,14 +423,16 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
|
|
|
|
|
|
|
|
return result;
|
|
return result;
|
|
- } /**
|
|
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
* 同步账户日流水
|
|
* 同步账户日流水
|
|
*
|
|
*
|
|
* @author zzy
|
|
* @author zzy
|
|
* @create: 2021-07-15
|
|
* @create: 2021-07-15
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public void synchronousAccountTransactionDayNew(String startDate, String endDate,int page, int pageSize) {
|
|
|
|
|
|
+ public void synchronousAccountTransactionDayNew(String startDate, String endDate, int page, int pageSize) {
|
|
|
|
|
|
List<TransactionDay> list = new ArrayList<>();
|
|
List<TransactionDay> list = new ArrayList<>();
|
|
List<String> accountIdList = ctopAgentAccountMapper.getAllAccountId();
|
|
List<String> accountIdList = ctopAgentAccountMapper.getAllAccountId();
|
|
@@ -436,7 +444,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
|
|
|
|
for (String accountId : accountIdList) {
|
|
for (String accountId : accountIdList) {
|
|
page = 1;
|
|
page = 1;
|
|
- log.info("同步头条账户流水信息{}:开始时间{},结束时间{},第{}页" ,accountId,startDate,endDate,page);
|
|
|
|
|
|
+ log.info("同步头条账户流水信息{}:开始时间{},结束时间{},第{}页", accountId, startDate, endDate, page);
|
|
|
|
|
|
JSONObject jsonObject = queryAccountTransactionDay(accountId, page, 1000, startDate, endDate);
|
|
JSONObject jsonObject = queryAccountTransactionDay(accountId, page, 1000, startDate, endDate);
|
|
JSONObject data = null;
|
|
JSONObject data = null;
|
|
@@ -462,7 +470,7 @@ public class AgentManagementServiceImpl implements AgentManagementService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
ctopAccountTransactionDayMapper.replaceAccountTransactionDay(list);
|
|
ctopAccountTransactionDayMapper.replaceAccountTransactionDay(list);
|
|
- log.info("获取头条账户:{}流水信息{}条" ,accountId,list.size());
|
|
|
|
|
|
+ log.info("获取头条账户:{}流水信息{}条", accountId, list.size());
|
|
page++;
|
|
page++;
|
|
int totalPage = jsonObject.getJSONObject("data").getJSONObject("page_info").getInteger("total_page");
|
|
int totalPage = jsonObject.getJSONObject("data").getJSONObject("page_info").getInteger("total_page");
|
|
if (page <= totalPage) {
|
|
if (page <= totalPage) {
|