Commit ac955051 by fanjiaxin

推客分佣单入库

parent cc453a8c
Pipeline #75638 passed with stages
in 1 minute 2 seconds
...@@ -21,6 +21,7 @@ import org.springframework.stereotype.Service; ...@@ -21,6 +21,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
...@@ -68,22 +69,28 @@ public class CommissionOrderServiceImpl implements ICommissionOrderService { ...@@ -68,22 +69,28 @@ public class CommissionOrderServiceImpl implements ICommissionOrderService {
@Override @Override
public void doCommissionOrderSync(Long startTime, Long endTime) { public void doCommissionOrderSync(Long startTime, Long endTime) {
log.info("[op:doCommissionOrderSync] start update time range [{} ~ {}]", startTime, endTime);
WeChatCommissionOrderListVO listVO; WeChatCommissionOrderListVO listVO;
String nextKey = null; String nextKey = null;
List<WeChatCommissionOrderItemVO> dataList;
while (true) { while (true) {
listVO = weChatCommissionOrderListRequest.handle(startTime, endTime, nextKey, COMMISSION_ORDER_SYNC_PAGE_SIZE); listVO = weChatCommissionOrderListRequest.handle(startTime, endTime, nextKey, COMMISSION_ORDER_SYNC_PAGE_SIZE);
if (null == listVO || CollectionUtils.isEmpty(listVO.getList())) { if (null == listVO || CollectionUtils.isEmpty(listVO.getList())) {
log.info("[op:doCommissionOrderSync] listVO is empty");
return; return;
} }
dataList = listVO.getList();
log.info("[op:doCommissionOrderSync] list size:{}", dataList.size());
for (WeChatCommissionOrderItemVO itemVO : dataList) {
// 推客分佣单入库
doSyncCommissionOrder(itemVO.getOrder_id(), itemVO.getSku_id());
}
Boolean hasMore = listVO.getHas_more(); Boolean hasMore = listVO.getHas_more();
nextKey = listVO.getNext_key(); nextKey = listVO.getNext_key();
if(StringUtils.isBlank(nextKey) || (null != hasMore && !hasMore)){ if(StringUtils.isBlank(nextKey) || (null != hasMore && !hasMore)){
log.info("[op:doCommissionOrderSync] is not has more");
return; return;
} }
for (WeChatCommissionOrderItemVO itemVO : listVO.getList()) {
// 推客分佣单入库
doSyncCommissionOrder(itemVO.getOrder_id(), itemVO.getSku_id());
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment