ordersMapper.updateById(updateObj);

This commit is contained in:
Owen 2025-01-13 09:47:10 +08:00
parent f765fd9579
commit 91a6ad43aa
2 changed files with 32 additions and 13 deletions

View File

@ -314,6 +314,7 @@ public class HaiNanDianXinApi {
*/
@Data
public static class OrderProdInst {
public String prodNo; // 产品编码
public String prodName; // 产品名称
public String prodInstAct; // 产品动作ADD/DEL/EDIT
}

View File

@ -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<HaiNanDianXinApi.SynOrderInfoResponse> 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<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) {
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);