是否自动生产
This commit is contained in:
parent
76b19ef413
commit
ce51488359
|
|
@ -92,7 +92,7 @@ public class HaokaUpdateOrderSchedule {
|
|||
//18 开卡失败 -460
|
||||
//19 证件不合格待重传 -200
|
||||
//20 订单终止 0
|
||||
pageReqVO.setStatus(Lists.newArrayList(450L,460L,470L,500L,550L)); // 已经完成/取消/删除的订单,不需要再从上游同步,这里过滤掉
|
||||
pageReqVO.setStatus(Lists.newArrayList(460L,470L,500L,550L)); // 已经完成/取消/删除的订单,不需要再从上游同步,这里过滤掉
|
||||
|
||||
while ((long) pageNo * pageSize < total) {
|
||||
pageNo += 1;
|
||||
|
|
|
|||
|
|
@ -101,15 +101,27 @@ public class GuangZhouDxApiDealStrategy implements ApiDealStrategy {
|
|||
}
|
||||
|
||||
String supplierOrderId = apiGuangZhouDXService.createOrder(logVO, haokaSuperiorApiId,createParam);
|
||||
|
||||
OrderApiCreateResp superApiResponse = new OrderApiCreateResp();
|
||||
if (StringUtils.isEmpty(supplierOrderId)){
|
||||
return ApiDealResp.failed("广州电信同步订单接口:没有返回订单信息");
|
||||
// return ApiDealResp.failed("广州电信同步订单接口:没有返回订单信息");
|
||||
superApiResponse.setOrderStatusCode("470");
|
||||
superApiResponse.setSupplierOrderStatusDesc("广州电信同步订单接口:没有返回订单信息");
|
||||
return ApiDealResp.ok(superApiResponse);
|
||||
}
|
||||
|
||||
OrderApiCreateResp orderApiCreateResp = new OrderApiCreateResp();
|
||||
orderApiCreateResp.setSupplierOrderId(supplierOrderId);
|
||||
orderApiCreateResp.setOrderCreateResponse(supplierOrderId);
|
||||
// OrderApiCreateResp orderApiCreateResp = new OrderApiCreateResp();
|
||||
// orderApiCreateResp.setSupplierOrderId(supplierOrderId);
|
||||
// orderApiCreateResp.setOrderCreateResponse(supplierOrderId);
|
||||
//
|
||||
// return ApiDealResp.ok(orderApiCreateResp);
|
||||
//
|
||||
|
||||
return ApiDealResp.ok(orderApiCreateResp);
|
||||
superApiResponse.setOrderStatusCode("470");
|
||||
superApiResponse.setSupplierOrderId(supplierOrderId);
|
||||
// superApiResponse.setSupplierOrderStatusDesc(data.getCodeMessage());
|
||||
superApiResponse.setOrderCreateResponse(supplierOrderId);
|
||||
return ApiDealResp.ok(superApiResponse);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -168,14 +180,12 @@ public class GuangZhouDxApiDealStrategy implements ApiDealStrategy {
|
|||
if (StringUtils.isNotEmpty(string)) {
|
||||
orderApiQueryResp.setSupplierOrderStatusDesc(string);
|
||||
}
|
||||
String dataOrderInfoStatusID = dataOrderInfoStatus.getString("单状态ID");
|
||||
// todo 转换本地订单状态
|
||||
// if (StringUtils.isNotEmpty(string)){
|
||||
// orderApiQueryResp.setSupplierOrderStatusDesc(string);
|
||||
// }
|
||||
String dataOrderInfoStatusID = dataOrderInfoStatus.getString("订单状态ID");
|
||||
orderApiQueryResp.setSupplierOrderStatusDesc(dataOrderInfoStatusID);
|
||||
}
|
||||
}
|
||||
|
||||
orderApiQueryResp.setOrderStatusCode("470");
|
||||
//- 物流信息--配送公司
|
||||
{
|
||||
JSONObject jsonObject = dataOrderInfo.getJSONObject("订单配送方式");
|
||||
|
|
@ -185,6 +195,7 @@ public class GuangZhouDxApiDealStrategy implements ApiDealStrategy {
|
|||
{
|
||||
String string = jsonObject.getString("配送公司");
|
||||
if (StringUtils.isNotEmpty(string)) {
|
||||
orderApiQueryResp.setOrderStatusCode("550");
|
||||
orderApiQueryResp.setTrackingCompany(string);
|
||||
}
|
||||
}
|
||||
|
|
@ -203,6 +214,7 @@ public class GuangZhouDxApiDealStrategy implements ApiDealStrategy {
|
|||
{
|
||||
String string = jsonObject.getString("运单号");
|
||||
if (StringUtils.isNotEmpty(string)) {
|
||||
orderApiQueryResp.setOrderStatusCode("550");
|
||||
orderApiQueryResp.setTrackingNumber(string);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,19 +109,33 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
// 2、提交预订单 得到token lianTongPreOrderSync
|
||||
// 3、用 token提交正式订单 lianTongOrderSyncV2
|
||||
|
||||
|
||||
OrderApiCreateResp superApiResponse = new OrderApiCreateResp();
|
||||
try {
|
||||
logVO.setParam(JSON.toJSONString(createParam));
|
||||
HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.SynOrderInfoResponse> responseInfo
|
||||
= apiHaiNanDXService.synOrderInfo(logVO, haokaSuperiorApiId,createParam);
|
||||
HaiNanDianXinApi.SynOrderInfoResponse data = responseInfo.getData();
|
||||
if (data == null) {
|
||||
return ApiDealResp.failed(responseInfo.getErrMsg());
|
||||
// return ApiDealResp.failed(responseInfo.getErrMsg());
|
||||
|
||||
superApiResponse.setOrderStatusCode("0");
|
||||
superApiResponse.setSupplierOrderStatusDesc("上游接口返回信息为空");
|
||||
return ApiDealResp.ok(superApiResponse);
|
||||
}
|
||||
if (!"1000".equals(data.getResultCode()) ) {
|
||||
// return ApiDealResp.failed(responseInfo.getErrMsg());
|
||||
|
||||
superApiResponse.setOrderStatusCode("0");
|
||||
superApiResponse.setSupplierOrderStatusDesc(data.getCodeMessage());
|
||||
return ApiDealResp.ok(superApiResponse);
|
||||
}
|
||||
|
||||
OrderApiCreateResp orderApiCreateResp = new OrderApiCreateResp();
|
||||
orderApiCreateResp.setOrderCreateResponse(JSON.toJSONString(responseInfo));
|
||||
return ApiDealResp.ok(orderApiCreateResp);
|
||||
|
||||
superApiResponse.setOrderStatusCode("470");
|
||||
superApiResponse.setSupplierOrderId(data.getOrderCode());
|
||||
superApiResponse.setSupplierOrderStatusDesc(data.getCodeMessage());
|
||||
superApiResponse.setOrderCreateResponse(JSON.toJSONString(responseInfo));
|
||||
return ApiDealResp.ok(superApiResponse);
|
||||
} catch (UnirestException e) {
|
||||
return ApiDealResp.failed(e.getMessage());
|
||||
}
|
||||
|
|
@ -156,7 +170,6 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
JSONArray jsonArray = JSON.parseArray(data);
|
||||
|
||||
OrderApiCreateResp superApiResponse = new OrderApiCreateResp();
|
||||
if (null==jsonArray){
|
||||
// return ApiDealResp.failed("上游接口返回信息为空");
|
||||
|
||||
|
|
@ -167,17 +180,20 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
|
||||
JSONObject jsonObject = jsonArray.getJSONObject(0);
|
||||
if (null==jsonObject){
|
||||
return ApiDealResp.failed("上游接口返回信息为空");
|
||||
// return ApiDealResp.failed("上游接口返回信息为空");
|
||||
|
||||
orderApiQueryResp.setOrderStatusCode("0");
|
||||
orderApiQueryResp.setSupplierOrderStatusDesc("上游接口返回信息为空");
|
||||
return ApiDealResp.ok(orderApiQueryResp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// todo 转换本地订单状态
|
||||
// orderApiQueryResp.setOrderStatusCode();
|
||||
String statusCd = jsonObject.getString("statusCd");
|
||||
String statusName = jsonObject.getString("statusName");
|
||||
orderApiQueryResp.setSupplierOrderStatusDesc(statusName);
|
||||
|
||||
orderApiQueryResp.setOrderStatusCode("470");
|
||||
|
||||
JSONObject orderLogisticInfo = jsonObject.getJSONObject("orderLogisticInfo");
|
||||
if (orderLogisticInfo!=null){
|
||||
// 物流编号 logisticNbr
|
||||
|
|
@ -186,6 +202,7 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
|||
// 物流公司
|
||||
String logisticCompany = orderLogisticInfo.getString("logisticCompany");
|
||||
orderApiQueryResp.setTrackingCompany(logisticCompany);
|
||||
orderApiQueryResp.setOrderStatusCode("550");
|
||||
}
|
||||
|
||||
orderApiQueryResp.setData(responseInfo);
|
||||
|
|
|
|||
Loading…
Reference in New Issue