ordersMapper.updateById(updateObj);
This commit is contained in:
parent
f765fd9579
commit
91a6ad43aa
|
@ -314,6 +314,7 @@ public class HaiNanDianXinApi {
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public static class OrderProdInst {
|
public static class OrderProdInst {
|
||||||
|
public String prodNo; // 产品编码
|
||||||
public String prodName; // 产品名称
|
public String prodName; // 产品名称
|
||||||
public String prodInstAct; // 产品动作:ADD/DEL/EDIT
|
public String prodInstAct; // 产品动作:ADD/DEL/EDIT
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
||||||
return ApiDealResp.failed("商品下架或者不存在");
|
return ApiDealResp.failed("商品下架或者不存在");
|
||||||
}
|
}
|
||||||
SuperiorApiDO superiorApi = superiorApiService.getSuperiorApi(param.getSuperiorApiId());
|
SuperiorApiDO superiorApi = superiorApiService.getSuperiorApi(param.getSuperiorApiId());
|
||||||
final SuperiorProductConfigDO skuConfigVO = superiorProductConfigService.getById(param.getSuperiorProductConfigId());
|
final SuperiorProductConfigDO skuConfigVO = superiorProductConfigService.getById(param.getSuperiorProductConfigId());
|
||||||
if (skuConfigVO == null) {
|
if (skuConfigVO == null) {
|
||||||
return ApiDealResp.failed("商品对接上游配置不存在");
|
return ApiDealResp.failed("商品对接上游配置不存在");
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,11 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
||||||
createParam.setBusiScenarioCode(configs.getString("ApiPrefix_busiScenarioCode"));
|
createParam.setBusiScenarioCode(configs.getString("ApiPrefix_busiScenarioCode"));
|
||||||
createParam.setOrderType(configs.getString("ApiPrefix_orderType"));
|
createParam.setOrderType(configs.getString("ApiPrefix_orderType"));
|
||||||
HaiNanDianXinApi.OrderProdInst orderProdInst = new HaiNanDianXinApi.OrderProdInst();
|
HaiNanDianXinApi.OrderProdInst orderProdInst = new HaiNanDianXinApi.OrderProdInst();
|
||||||
orderProdInst.setProdName(configs.getString("ApiPrefix_prodNo"));
|
String string = configs.getString("ApiPrefix_prodNo");
|
||||||
|
orderProdInst.setProdNo(string);
|
||||||
|
|
||||||
|
orderProdInst.setProdName(configs.getString("ApiPrefix_prodName"));
|
||||||
|
orderProdInst.setProdInstAct(configs.getString("ApiPrefix_prodInstAct"));
|
||||||
createParam.setOrderProdInst(orderProdInst);
|
createParam.setOrderProdInst(orderProdInst);
|
||||||
|
|
||||||
|
|
||||||
|
@ -102,8 +106,6 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 0、占用号码 lianTongZhanHao
|
// 0、占用号码 lianTongZhanHao
|
||||||
// 1、提交资料 lianTongSubmitUserInfo
|
// 1、提交资料 lianTongSubmitUserInfo
|
||||||
// 2、提交预订单 得到token lianTongPreOrderSync
|
// 2、提交预订单 得到token lianTongPreOrderSync
|
||||||
|
@ -113,16 +115,32 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
||||||
try {
|
try {
|
||||||
logVO.setParam(JSON.toJSONString(createParam));
|
logVO.setParam(JSON.toJSONString(createParam));
|
||||||
HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.SynOrderInfoResponse> responseInfo
|
HaiNanDianXinApi.HaiNanResponseInfo<HaiNanDianXinApi.SynOrderInfoResponse> responseInfo
|
||||||
= apiHaiNanDXService.synOrderInfo(logVO, haokaSuperiorApiId,createParam);
|
= apiHaiNanDXService.synOrderInfo(logVO, haokaSuperiorApiId, createParam);
|
||||||
HaiNanDianXinApi.SynOrderInfoResponse data = responseInfo.getData();
|
HaiNanDianXinApi.SynOrderInfoResponse data = responseInfo.getData();
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
// return ApiDealResp.failed(responseInfo.getErrMsg());
|
// return ApiDealResp.failed(responseInfo.getErrMsg());
|
||||||
|
String msg = "";
|
||||||
|
if (StringUtils.isNotEmpty(responseInfo.getErrMsg())) {
|
||||||
|
msg = msg + responseInfo.getErrMsg();
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(responseInfo.getMessage())) {
|
||||||
|
msg = msg + responseInfo.getMessage();
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(responseInfo.getReason())) {
|
||||||
|
msg = msg + responseInfo.getReason();
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(responseInfo.getReferenceError())) {
|
||||||
|
msg = msg + responseInfo.getReferenceError();
|
||||||
|
}
|
||||||
|
if (StringUtils.isEmpty( msg) ){
|
||||||
|
msg = "上游接口返回信息为空";
|
||||||
|
}
|
||||||
|
|
||||||
superApiResponse.setOrderStatusCode("0");
|
superApiResponse.setOrderStatusCode("0");
|
||||||
superApiResponse.setSupplierOrderStatusDesc("上游接口返回信息为空");
|
superApiResponse.setSupplierOrderStatusDesc(msg);
|
||||||
return ApiDealResp.ok(superApiResponse);
|
return ApiDealResp.ok(superApiResponse);
|
||||||
}
|
}
|
||||||
if (!"1000".equals(data.getResultCode()) ) {
|
if (!"1000".equals(data.getResultCode())) {
|
||||||
// return ApiDealResp.failed(responseInfo.getErrMsg());
|
// return ApiDealResp.failed(responseInfo.getErrMsg());
|
||||||
|
|
||||||
superApiResponse.setOrderStatusCode("0");
|
superApiResponse.setOrderStatusCode("0");
|
||||||
|
@ -149,7 +167,7 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
||||||
return ApiDealResp.failed("商品下架或者不存在");
|
return ApiDealResp.failed("商品下架或者不存在");
|
||||||
}
|
}
|
||||||
SuperiorApiDO superiorApi = superiorApiService.getSuperiorApi(param.getSuperiorApiId());
|
SuperiorApiDO superiorApi = superiorApiService.getSuperiorApi(param.getSuperiorApiId());
|
||||||
final SuperiorProductConfigDO skuConfigVO = superiorProductConfigService.getById(param.getSuperiorProductConfigId());
|
final SuperiorProductConfigDO skuConfigVO = superiorProductConfigService.getById(param.getSuperiorProductConfigId());
|
||||||
if (skuConfigVO == null) {
|
if (skuConfigVO == null) {
|
||||||
return ApiDealResp.failed("商品对接上游配置不存在");
|
return ApiDealResp.failed("商品对接上游配置不存在");
|
||||||
}
|
}
|
||||||
|
@ -160,9 +178,9 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
||||||
queryParam.setQueryType("1");
|
queryParam.setQueryType("1");
|
||||||
queryParam.setOrderCode(param.getSupplierOrderId());
|
queryParam.setOrderCode(param.getSupplierOrderId());
|
||||||
|
|
||||||
HaiNanDianXinApi.HaiNanResponseInfo<String> responseInfo = apiHaiNanDXService.queryOrderInfo(logVO, haokaSuperiorApiId,queryParam);
|
HaiNanDianXinApi.HaiNanResponseInfo<String> responseInfo = apiHaiNanDXService.queryOrderInfo(logVO, haokaSuperiorApiId, queryParam);
|
||||||
|
|
||||||
String data = responseInfo.getData();
|
String data = responseInfo.getData();
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
logVO.setResponse(JSON.toJSONString(responseInfo));
|
logVO.setResponse(JSON.toJSONString(responseInfo));
|
||||||
return ApiDealResp.failed(responseInfo.getErrMsg());
|
return ApiDealResp.failed(responseInfo.getErrMsg());
|
||||||
|
@ -170,7 +188,7 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
||||||
|
|
||||||
JSONArray jsonArray = JSON.parseArray(data);
|
JSONArray jsonArray = JSON.parseArray(data);
|
||||||
|
|
||||||
if (null==jsonArray){
|
if (null == jsonArray) {
|
||||||
// return ApiDealResp.failed("上游接口返回信息为空");
|
// return ApiDealResp.failed("上游接口返回信息为空");
|
||||||
|
|
||||||
orderApiQueryResp.setOrderStatusCode("0");
|
orderApiQueryResp.setOrderStatusCode("0");
|
||||||
|
@ -179,7 +197,7 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject jsonObject = jsonArray.getJSONObject(0);
|
JSONObject jsonObject = jsonArray.getJSONObject(0);
|
||||||
if (null==jsonObject){
|
if (null == jsonObject) {
|
||||||
// return ApiDealResp.failed("上游接口返回信息为空");
|
// return ApiDealResp.failed("上游接口返回信息为空");
|
||||||
|
|
||||||
orderApiQueryResp.setOrderStatusCode("0");
|
orderApiQueryResp.setOrderStatusCode("0");
|
||||||
|
@ -195,7 +213,7 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy {
|
||||||
orderApiQueryResp.setOrderStatusCode("470");
|
orderApiQueryResp.setOrderStatusCode("470");
|
||||||
|
|
||||||
JSONObject orderLogisticInfo = jsonObject.getJSONObject("orderLogisticInfo");
|
JSONObject orderLogisticInfo = jsonObject.getJSONObject("orderLogisticInfo");
|
||||||
if (orderLogisticInfo!=null){
|
if (orderLogisticInfo != null) {
|
||||||
// 物流编号 logisticNbr
|
// 物流编号 logisticNbr
|
||||||
String logisticNbr = orderLogisticInfo.getString("logisticNbr");
|
String logisticNbr = orderLogisticInfo.getString("logisticNbr");
|
||||||
orderApiQueryResp.setTrackingNumber(logisticNbr);
|
orderApiQueryResp.setTrackingNumber(logisticNbr);
|
||||||
|
|
Loading…
Reference in New Issue