diff --git a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/controller/admin/api/HaokaApiHaiNanDXController.java b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/controller/admin/api/HaokaApiHaiNanDXController.java index 7c9bf7511c..d4e5c1a7ab 100644 --- a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/controller/admin/api/HaokaApiHaiNanDXController.java +++ b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/controller/admin/api/HaokaApiHaiNanDXController.java @@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.*; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Tag(name = "API----------上游接口-------海南电信") +@Tag(name = "API---上游接口---海南电信") @RestController @RequestMapping("/haoka/api/hainan-dx") @Validated diff --git a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/controller/admin/api/HaokaApiLianTongController.java b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/controller/admin/api/HaokaApiLianTongController.java index c60a3061c6..b8928d49e7 100644 --- a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/controller/admin/api/HaokaApiLianTongController.java +++ b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/controller/admin/api/HaokaApiLianTongController.java @@ -19,7 +19,7 @@ import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Tag(name = "API----------上游接口-------联通-集团") +@Tag(name = "API---上游接口---联通-集团") @RestController @RequestMapping("/haoka/api/lian-tong") @Validated diff --git a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/controller/admin/api/HaokaGuangZhouDXController.java b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/controller/admin/api/HaokaGuangZhouDXController.java index 3bd6672c82..9d0da4e0a7 100644 --- a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/controller/admin/api/HaokaGuangZhouDXController.java +++ b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/controller/admin/api/HaokaGuangZhouDXController.java @@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RestController; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Tag(name = "API----------上游接口-------广州电信") +@Tag(name = "API---上游接口---广州电信") @RestController @RequestMapping("/haoka/api/guangzhou-dx") @Validated diff --git a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/controller/admin/api/HaokaHuNanDXController.java b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/controller/admin/api/HaokaHuNanDXController.java index 1db757f3ec..618a8a2e74 100644 --- a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/controller/admin/api/HaokaHuNanDXController.java +++ b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/controller/admin/api/HaokaHuNanDXController.java @@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -@Tag(name = "API----------上游接口-------湖南电信") +@Tag(name = "API---上游接口---湖南电信") @RestController @RequestMapping("/haoka/api/hunan-dx") @Validated diff --git a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/api/ApiDealServiceImpl.java b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/api/ApiDealServiceImpl.java index 5a0c0a7da9..0dcd424969 100644 --- a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/api/ApiDealServiceImpl.java +++ b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/api/ApiDealServiceImpl.java @@ -22,17 +22,7 @@ public class ApiDealServiceImpl implements ApiDealStrategyService { @Resource protected SuperiorApiLogService superiorApiLogService; - private ApiDealStrategy getApiDealStrategy(Long productId) { - OnSaleProductPreOrderRespVO onSaleProductPreOrder = onSaleProductService.getOnSaleProductPreOrder(productId); - if (onSaleProductPreOrder == null) { - return null; - } - ApiFrom apiFrom = onSaleProductPreOrder.getApiFrom(); - if (apiFrom == null) { - return null; - } - return this.getApiDealStrategy(apiFrom); - } + @Override public ApiDealResp createOrder(final SuperiorApiLogSaveReqVO logVO, OrderApiCreateParam param) { @@ -40,12 +30,28 @@ public class ApiDealServiceImpl implements ApiDealStrategyService { logVO.setHaokaOrderId(param.getId()); logVO.setHaokaProductId(param.getProductId()); try { - ApiDealStrategy apiDealStrategy = this.getApiDealStrategy(param.getProductId()); - if (apiDealStrategy == null) { - String noneService = "NoneService"; + OnSaleProductPreOrderRespVO onSaleProductPreOrder = onSaleProductService.getOnSaleProductPreOrder(param.getProductId()); + if (onSaleProductPreOrder == null) { + String msg = "关联上级产品不存在"; logVO.setSuccess(false); - logVO.setErrorInfo(noneService); - return ApiDealResp.failed(noneService); + logVO.setErrorInfo(msg); + return ApiDealResp.failed(msg); + } + ApiFrom apiFrom = onSaleProductPreOrder.getApiFrom(); + if (apiFrom == null) { + String msg = "产品上游接口不存在"; + logVO.setSuccess(false); + logVO.setErrorInfo(msg); + return ApiDealResp.failed(msg); + } + + + ApiDealStrategy apiDealStrategy = this.getApiDealStrategy(apiFrom); + if (apiDealStrategy == null) { + String msg = "NoneService"; + logVO.setSuccess(false); + logVO.setErrorInfo(msg); + return ApiDealResp.failed(msg); } ApiDealResp respApiDealResp = apiDealStrategy.createOrder(param); if (!respApiDealResp.getIsSupport()){ @@ -73,7 +79,21 @@ public class ApiDealServiceImpl implements ApiDealStrategyService { logVO.setHaokaOrderId(param.getId()); logVO.setHaokaProductId(param.getProductId()); try { - ApiDealStrategy apiDealStrategy = this.getApiDealStrategy(param.getProductId()); + OnSaleProductPreOrderRespVO onSaleProductPreOrder = onSaleProductService.getOnSaleProductPreOrder(param.getProductId()); + if (onSaleProductPreOrder == null) { + String msg = "关联上级产品不存在"; + logVO.setSuccess(false); + logVO.setErrorInfo(msg); + return ApiDealResp.failed(msg); + } + ApiFrom apiFrom = onSaleProductPreOrder.getApiFrom(); + if (apiFrom == null) { + String msg = "产品上游接口不存在"; + logVO.setSuccess(false); + logVO.setErrorInfo(msg); + return ApiDealResp.failed(msg); + } + ApiDealStrategy apiDealStrategy = this.getApiDealStrategy(apiFrom); if (apiDealStrategy == null) { logVO.setSuccess(false); String noneService = "NoneService"; diff --git a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/api/strategy/LianTongApiDealStrategy.java b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/api/strategy/LianTongApiDealStrategy.java index 23d9764900..5c21269892 100644 --- a/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/api/strategy/LianTongApiDealStrategy.java +++ b/yudao-module-haoka/yudao-module-haoka-biz/src/main/java/cn/iocoder/yudao/module/haoka/service/api/strategy/LianTongApiDealStrategy.java @@ -65,7 +65,7 @@ public class LianTongApiDealStrategy implements ApiDealStrategy { KingNumStateChangeResponse stateChangeResponse = apiLianTongService.lianTongZhanHao(stateChangeRequest); logVO.setResponse(JSON.toJSONString(stateChangeResponse)); if (!"0".equals(stateChangeResponse.getRspCode())) { - return ApiDealResp.failed(stateChangeResponse.getRspCode()); + return ApiDealResp.failed(stateChangeResponse.getRspDesc()); } // 1、提交资料 lianTongSubmitUserInfo