diff --git a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/api/hainandianxin/HaiNanDianXinApi.java b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/api/hainandianxin/HaiNanDianXinApi.java index 08968ebcff..e3002c41c6 100644 --- a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/api/hainandianxin/HaiNanDianXinApi.java +++ b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/api/hainandianxin/HaiNanDianXinApi.java @@ -314,6 +314,7 @@ public class HaiNanDianXinApi { */ @Data public static class OrderProdInst { + public String prodNo; // 产品编码 public String prodName; // 产品名称 public String prodInstAct; // 产品动作:ADD/DEL/EDIT } diff --git a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/api/strategy/HaiNanDxApiDealStrategy.java b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/api/strategy/HaiNanDxApiDealStrategy.java index 211af123b7..b3c2e0e320 100644 --- a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/api/strategy/HaiNanDxApiDealStrategy.java +++ b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/api/strategy/HaiNanDxApiDealStrategy.java @@ -54,7 +54,7 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy { return ApiDealResp.failed("商品下架或者不存在"); } SuperiorApiDO superiorApi = superiorApiService.getSuperiorApi(param.getSuperiorApiId()); - final SuperiorProductConfigDO skuConfigVO = superiorProductConfigService.getById(param.getSuperiorProductConfigId()); + final SuperiorProductConfigDO skuConfigVO = superiorProductConfigService.getById(param.getSuperiorProductConfigId()); if (skuConfigVO == null) { return ApiDealResp.failed("商品对接上游配置不存在"); } @@ -93,7 +93,11 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy { createParam.setBusiScenarioCode(configs.getString("ApiPrefix_busiScenarioCode")); createParam.setOrderType(configs.getString("ApiPrefix_orderType")); 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); @@ -102,8 +106,6 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy { } - - // 0、占用号码 lianTongZhanHao // 1、提交资料 lianTongSubmitUserInfo // 2、提交预订单 得到token lianTongPreOrderSync @@ -113,16 +115,32 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy { try { logVO.setParam(JSON.toJSONString(createParam)); HaiNanDianXinApi.HaiNanResponseInfo responseInfo - = apiHaiNanDXService.synOrderInfo(logVO, haokaSuperiorApiId,createParam); + = apiHaiNanDXService.synOrderInfo(logVO, haokaSuperiorApiId, createParam); HaiNanDianXinApi.SynOrderInfoResponse data = responseInfo.getData(); if (data == null) { // 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.setSupplierOrderStatusDesc("上游接口返回信息为空"); + superApiResponse.setSupplierOrderStatusDesc(msg); return ApiDealResp.ok(superApiResponse); } - if (!"1000".equals(data.getResultCode()) ) { + if (!"1000".equals(data.getResultCode())) { // return ApiDealResp.failed(responseInfo.getErrMsg()); superApiResponse.setOrderStatusCode("0"); @@ -149,7 +167,7 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy { return ApiDealResp.failed("商品下架或者不存在"); } SuperiorApiDO superiorApi = superiorApiService.getSuperiorApi(param.getSuperiorApiId()); - final SuperiorProductConfigDO skuConfigVO = superiorProductConfigService.getById(param.getSuperiorProductConfigId()); + final SuperiorProductConfigDO skuConfigVO = superiorProductConfigService.getById(param.getSuperiorProductConfigId()); if (skuConfigVO == null) { return ApiDealResp.failed("商品对接上游配置不存在"); } @@ -160,9 +178,9 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy { queryParam.setQueryType("1"); queryParam.setOrderCode(param.getSupplierOrderId()); - HaiNanDianXinApi.HaiNanResponseInfo responseInfo = apiHaiNanDXService.queryOrderInfo(logVO, haokaSuperiorApiId,queryParam); + HaiNanDianXinApi.HaiNanResponseInfo responseInfo = apiHaiNanDXService.queryOrderInfo(logVO, haokaSuperiorApiId, queryParam); - String data = responseInfo.getData(); + String data = responseInfo.getData(); if (data == null) { logVO.setResponse(JSON.toJSONString(responseInfo)); return ApiDealResp.failed(responseInfo.getErrMsg()); @@ -170,7 +188,7 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy { JSONArray jsonArray = JSON.parseArray(data); - if (null==jsonArray){ + if (null == jsonArray) { // return ApiDealResp.failed("上游接口返回信息为空"); orderApiQueryResp.setOrderStatusCode("0"); @@ -179,7 +197,7 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy { } JSONObject jsonObject = jsonArray.getJSONObject(0); - if (null==jsonObject){ + if (null == jsonObject) { // return ApiDealResp.failed("上游接口返回信息为空"); orderApiQueryResp.setOrderStatusCode("0"); @@ -195,7 +213,7 @@ public class HaiNanDxApiDealStrategy implements ApiDealStrategy { orderApiQueryResp.setOrderStatusCode("470"); JSONObject orderLogisticInfo = jsonObject.getJSONObject("orderLogisticInfo"); - if (orderLogisticInfo!=null){ + if (orderLogisticInfo != null) { // 物流编号 logisticNbr String logisticNbr = orderLogisticInfo.getString("logisticNbr"); orderApiQueryResp.setTrackingNumber(logisticNbr);