|
@@ -13,6 +13,9 @@ import com.doudian.open.api.buyin_colonelActivityDetail.BuyinColonelActivityDeta
|
|
|
import com.doudian.open.api.buyin_colonelActivityDetail.BuyinColonelActivityDetailResponse;
|
|
|
import com.doudian.open.api.buyin_colonelActivityDetail.data.BuyinColonelActivityDetailData;
|
|
|
import com.doudian.open.api.buyin_colonelActivityDetail.param.BuyinColonelActivityDetailParam;
|
|
|
+import com.doudian.open.api.buyin_colonelMultiSettlementOrders.BuyinColonelMultiSettlementOrdersRequest;
|
|
|
+import com.doudian.open.api.buyin_colonelMultiSettlementOrders.BuyinColonelMultiSettlementOrdersResponse;
|
|
|
+import com.doudian.open.api.buyin_colonelMultiSettlementOrders.param.BuyinColonelMultiSettlementOrdersParam;
|
|
|
import com.doudian.open.api.buyin_decryptContactInfo.BuyinDecryptContactInfoRequest;
|
|
|
import com.doudian.open.api.buyin_decryptContactInfo.BuyinDecryptContactInfoResponse;
|
|
|
import com.doudian.open.api.buyin_decryptContactInfo.data.BuyinDecryptContactInfoData;
|
|
@@ -255,7 +258,7 @@ public class BytedanceServiceImpl implements IBytedanceService {
|
|
|
@Override
|
|
|
public void addBytedanceInstituteOrderColonel(String startTime, String endTime, String cursor) {
|
|
|
AccessToken accessToken = tokenService.getAccessToken(1L);
|
|
|
-
|
|
|
+ cursor = Check.isNull(cursor) ? "0" : cursor;
|
|
|
BuyinInstituteOrderColonelRequest request = new BuyinInstituteOrderColonelRequest();
|
|
|
BuyinInstituteOrderColonelParam param = request.getParam();
|
|
|
param.setSize(200L);
|
|
@@ -266,7 +269,7 @@ public class BytedanceServiceImpl implements IBytedanceService {
|
|
|
BuyinInstituteOrderColonelResponse response = request.execute(accessToken);
|
|
|
System.out.println(response);
|
|
|
if (Check.isNull(response) || !"10000".equals(response.getCode())) {
|
|
|
- log.error("\n【请求接口】: {}\n【请求参数】:{}\n【响应数据】:{}", "/buyin/colonelActivityDetail;(获取团长活动详情)", param, response);
|
|
|
+ log.error("\n【请求接口】: {}\n【请求参数】:{}\n【响应数据】:{}", "/buyin/instituteOrderColonel;(查询团长订单)", param, response);
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -276,13 +279,26 @@ public class BytedanceServiceImpl implements IBytedanceService {
|
|
|
cursor = data.getCursor();
|
|
|
if (Check.isNotNull(orders) && orders.size() > 0) {
|
|
|
List<BytedanceOrderList> list = new ArrayList<>();
|
|
|
- BytedanceOrderList orderList = new BytedanceOrderList();
|
|
|
for (OrdersItem order : orders) {
|
|
|
+ BytedanceOrderList orderList = new BytedanceOrderList();
|
|
|
BeanUtils.copyProperties(order, orderList);
|
|
|
- orderList.setUpdateTime(DateUtils.strDateToInt(order.getUpdateTime()));
|
|
|
- orderList.setPaySuccessTime(DateUtils.strDateToInt(order.getPaySuccessTime()));
|
|
|
- orderList.setRefundTime(DateUtils.strDateToInt(order.getRefundTime()));
|
|
|
- orderList.setSettleTime(DateUtils.strDateToInt(order.getSettleTime()));
|
|
|
+ orderList.setOrderId(Long.valueOf(order.getOrderId()));
|
|
|
+ if (Check.isNotNull(order.getUpdateTime())) {
|
|
|
+ orderList.setUpdateTime(DateUtils.strDateTimsToInt(order.getUpdateTime()));
|
|
|
+ }
|
|
|
+ if (Check.isNotNull(order.getPaySuccessTime())) {
|
|
|
+ orderList.setPaySuccessTime(DateUtils.strDateTimsToInt(order.getPaySuccessTime()));
|
|
|
+ }
|
|
|
+ if (Check.isNotNull(order.getRefundTime())) {
|
|
|
+ orderList.setRefundTime(DateUtils.strDateTimsToInt(order.getRefundTime()));
|
|
|
+ }
|
|
|
+ if (Check.isNotNull(order.getSettleTime())) {
|
|
|
+ orderList.setSettleTime(DateUtils.strDateTimsToInt(order.getSettleTime()));
|
|
|
+ }
|
|
|
+ if (Check.isNotNull(order.getIsTrusteeship())) {
|
|
|
+ orderList.setIsTrusteeship(order.getIsTrusteeship() ? "1" : "0");
|
|
|
+ }
|
|
|
+
|
|
|
ColonelOrderInfo colonelInfo = order.getColonelOrderInfo();
|
|
|
if (Check.isNotNull(colonelInfo)) {
|
|
|
orderList.setColonelCommissionRate(colonelInfo.getCommissionRate());
|
|
@@ -308,19 +324,35 @@ public class BytedanceServiceImpl implements IBytedanceService {
|
|
|
}
|
|
|
list.add(orderList);
|
|
|
}
|
|
|
-
|
|
|
bytedanceMapper.replaceBatchOrders(list);
|
|
|
-
|
|
|
int size = orders.size();
|
|
|
if (size >= 200) {
|
|
|
addBytedanceInstituteOrderColonel(startTime, endTime, cursor);
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
+ public void addBytedanceMultiSettlementOrders(String startTime, String endTime, String cursor) {
|
|
|
+ AccessToken accessToken = tokenService.getAccessToken(1L);
|
|
|
+ cursor = Check.isNull(cursor) ? "0" : cursor;
|
|
|
+ BuyinColonelMultiSettlementOrdersRequest request = new BuyinColonelMultiSettlementOrdersRequest();
|
|
|
+ BuyinColonelMultiSettlementOrdersParam param = request.getParam();
|
|
|
+ param.setSize(100L);
|
|
|
+ param.setCursor(cursor);
|
|
|
+ param.setTimeType("settle");//查询时间类型。settle: 结算时间); update:更新时间(默认)
|
|
|
+ param.setStartTime(startTime.concat(" 00:00:00"));
|
|
|
+ param.setEndTime(endTime.concat(" 23:59:59"));
|
|
|
+ BuyinColonelMultiSettlementOrdersResponse response = request.execute(accessToken);
|
|
|
+
|
|
|
+ System.out.println(response);
|
|
|
+ if (Check.isNull(response) || !"10000".equals(response.getCode())) {
|
|
|
+ log.error("\n【请求接口】: {}\n【请求参数】:{}\n【响应数据】:{}", "/buyin/colonelMultiSettlementOrders;(团长分次结算订单)", param, response);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ com.doudian.open.api.buyin_colonelMultiSettlementOrders.data.Data data = response.getData();
|
|
|
}
|
|
|
|
|
|
/**
|