Commit 1cd3da8f by 徐康

麦咖啡订单推送

parent 52e2aa37
......@@ -2550,6 +2550,7 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
public BaseResponse mcCafePushOrder(McCafeQueryOrderVo queryOrderVo) {
executor.submit(() -> {
Long lastCreateTime = DateUtil.convert2Date(queryOrderVo.getStartDate(), "yyyy-MM-dd HH:mm:ss").getTime()/1000;
for(int i=1;;i++) {
OrderConditionsReq orderConditionsReq = new OrderConditionsReq();
orderConditionsReq.setPartnerId(mcCafePartnerId);
......@@ -2566,12 +2567,28 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
}
BaseDownLoadResponse<List<OrderInfoReqs>> response = orderDownLoadSdkService.queryOrderByConditions(orderConditionsReq, LogThreadLocal.getTrackingNo());
AppLogUtil.infoLog("queryOrderByConditions:"+ JSON.toJSONString(response),null,null);
if(CollectionUtils.isEmpty(response.getResult())) {
if("50002".equals(response.getCode())) {
AppLogUtil.infoLog("麦咖啡重置退单查询: 重置前: "+i+" "+JSON.toJSONString(orderConditionsReq),null,null);
i=1;
orderConditionsReq.setStartTimestamp(lastCreateTime);
AppLogUtil.infoLog("麦咖啡重置退单查询: 重置后: "+i+" "+JSON.toJSONString(orderConditionsReq),null,null);
continue;
} else if(!ResponseConstant.SUCCESS_RESPONSE_CODE_STR.equals(response.getCode())) {
AppLogUtil.infoLog("麦咖啡历史订单查询异常: "+JSON.toJSONString(queryOrderVo),null,null);
break;
}
if(ResponseConstant.SUCCESS_RESPONSE_CODE_STR.equals(response.getCode()) && CollectionUtils.isEmpty(response.getResult())) {
AppLogUtil.infoLog("麦咖啡历史订单查询结束: "+JSON.toJSONString(queryOrderVo),null,null);
break;
}
RestTemplate client = new RestTemplate();
for(OrderInfoReqs orderInfoReqs : response.getResult()) {
try {
String createTime = DateUtil.convert2String(new Date(Long.valueOf(orderInfoReqs.getCreateTime())), "yyyy-MM-dd HH:mm:ss");
Long createTimeStamp = DateUtil.convert2Date(createTime, "yyyy-MM-dd HH:mm:ss").getTime()/1000;
if(createTimeStamp > lastCreateTime) {
lastCreateTime = createTimeStamp;
}
McCafePushOrderDto mcCafePushOrderDto = convert2McCafePushOrderInfo(orderInfoReqs);
AppLogUtil.infoLog("订单推送入参: "+JSON.toJSONString(mcCafePushOrderDto),null,null);
......
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