diff --git a/emis-oms-biz-web/src/main/java/com/xdadan/erp/oms/web/Oms2cCommonController.java b/emis-oms-biz-web/src/main/java/com/xdadan/erp/oms/web/Oms2cCommonController.java index 099a7b2..a9468d2 100644 --- a/emis-oms-biz-web/src/main/java/com/xdadan/erp/oms/web/Oms2cCommonController.java +++ b/emis-oms-biz-web/src/main/java/com/xdadan/erp/oms/web/Oms2cCommonController.java @@ -18,7 +18,7 @@ import com.xdadan.erp.oms.common.utils.DateUtils; import com.xdadan.erp.oms.domain.exception.EmisBizError; import com.xdadan.erp.oms.domain.vo.AddressParseResult; import com.xdadan.erp.oms.service.*; -import com.xdadan.erp.oms.service.svc.IApiwebSvc; +import com.xdadan.erp.oms.service.svc.IApiwebCommonSvc; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -48,10 +48,10 @@ public class Oms2cCommonController extends BaseController @Autowired RedissonService redissonService; - private IApiwebSvc iApiwebSvc; + private IApiwebCommonSvc iApiwebCommonSvc; - public Oms2cCommonController(IApiwebSvc iApiwebSvc) { - this.iApiwebSvc = iApiwebSvc; + public Oms2cCommonController(IApiwebCommonSvc iApiwebCommonSvc) { + this.iApiwebCommonSvc = iApiwebCommonSvc; } /** @@ -61,7 +61,7 @@ public class Oms2cCommonController extends BaseController public AjaxResult realMatchWaybill(String useSiteCode,String prefix) { try { - return this.iApiwebSvc.realMatchWaybill(useSiteCode,"T7080"); + return this.iApiwebCommonSvc.realMatchWaybill(useSiteCode,"T7080"); }catch (Exception ex){ ex.printStackTrace(); return AjaxResult.error(ex.getMessage()); diff --git a/emis-oms-biz-web/src/main/java/com/xdadan/erp/oms/web/Oms2cWaybillController.java b/emis-oms-biz-web/src/main/java/com/xdadan/erp/oms/web/Oms2cWaybillController.java index 176b7c6..e92c2cc 100644 --- a/emis-oms-biz-web/src/main/java/com/xdadan/erp/oms/web/Oms2cWaybillController.java +++ b/emis-oms-biz-web/src/main/java/com/xdadan/erp/oms/web/Oms2cWaybillController.java @@ -21,6 +21,7 @@ import com.xdadan.erp.oms.common.utils.DateUtils; import com.xdadan.erp.oms.domain.exception.EmisBizError; import com.xdadan.erp.oms.domain.vo.*; import com.xdadan.erp.oms.service.*; +import com.xdadan.erp.oms.service.svc.IApiwebWaybillSvc; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -56,6 +57,13 @@ public class Oms2cWaybillController extends BaseController @Autowired private IEmisTmsScanRecordService emisTmsScanRecordService; + private IApiwebWaybillSvc iApiwebWaybillSvc; + + public Oms2cWaybillController(IApiwebWaybillSvc iApiwebWaybillSvc) { + this.iApiwebWaybillSvc = iApiwebWaybillSvc; + } + + /** * 获取电子运单信息 */ @@ -145,30 +153,16 @@ public class Oms2cWaybillController extends BaseController } + /** + * 使用远程调用注意:统一使用api中心进行运费试算 + * @param waybillOrder + * @return + */ @Log(title = "运费试算", businessType = BusinessType.OTHER) @PostMapping(value = "/preCalcWaybillFee") public AjaxResult preCalcWaybillFee(@RequestBody WaybillOrder waybillOrder) { -// try { -// EmisWaybill emisWaybillSave = waybillOrder.toDb(); -// List estList=emisWaybillService.preCalcWaybillFee(emisWaybillSave); -// return AjaxResult.success("试算成功", estList); -// } -// catch(EmisBizError ex){ -// ex.printStackTrace(); -// return AjaxResult.error("("+ex.getErrorCode()+")"+ex.getMessage()); -// } -// catch (Exception ex){ -// ex.printStackTrace(); -// // 返回子定义异常 -// if(ex instanceof EmisBizError){ -// return AjaxResult.error("("+((EmisBizError)ex).getErrorCode()+")"+ex.getMessage()); -// } -// -// return AjaxResult.error("服务器异常,联系客服"); -// } - - return null; + return iApiwebWaybillSvc.preCalcWaybillFee(waybillOrder); } diff --git a/emis-oms-biz/src/main/java/com/xdadan/erp/oms/service/svc/IApiwebSvc.java b/emis-oms-biz/src/main/java/com/xdadan/erp/oms/service/svc/IApiwebCommonSvc.java similarity index 80% rename from emis-oms-biz/src/main/java/com/xdadan/erp/oms/service/svc/IApiwebSvc.java rename to emis-oms-biz/src/main/java/com/xdadan/erp/oms/service/svc/IApiwebCommonSvc.java index f728754..30fe75e 100644 --- a/emis-oms-biz/src/main/java/com/xdadan/erp/oms/service/svc/IApiwebSvc.java +++ b/emis-oms-biz/src/main/java/com/xdadan/erp/oms/service/svc/IApiwebCommonSvc.java @@ -6,9 +6,8 @@ import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; -//@FeignClient(name = "${service.provider.name}",url = "${service.provider.url}",fallback = ProviderClientFallback.class) @FeignClient(name = "${service.provider.name}",url = "${service.provider.url}",configuration = {FeignErrorDecoder.class}) -public interface IApiwebSvc { +public interface IApiwebCommonSvc { /** * 获取电子面单单号 @@ -16,4 +15,5 @@ public interface IApiwebSvc { @GetMapping(value = "/apiweb/common/realMatchWaybill") public AjaxResult realMatchWaybill(@RequestParam("useSiteCode")String useSiteCode, @RequestParam("prefix")String prefix); + } \ No newline at end of file diff --git a/emis-oms-biz/src/main/java/com/xdadan/erp/oms/service/svc/IApiwebWaybillSvc.java b/emis-oms-biz/src/main/java/com/xdadan/erp/oms/service/svc/IApiwebWaybillSvc.java new file mode 100644 index 0000000..b90884e --- /dev/null +++ b/emis-oms-biz/src/main/java/com/xdadan/erp/oms/service/svc/IApiwebWaybillSvc.java @@ -0,0 +1,18 @@ +package com.xdadan.erp.oms.service.svc; + + +import com.xdadan.erp.oms.common.core.domain.AjaxResult; +import com.xdadan.erp.oms.domain.vo.WaybillOrder; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; + +@FeignClient(name = "${service.provider.name}",url = "${service.provider.url}",configuration = {FeignErrorDecoder.class}) +public interface IApiwebWaybillSvc { + + @PostMapping(value = "/apiweb/emisWaybill/preCalcWaybillFee") + public AjaxResult preCalcWaybillFee(@RequestBody WaybillOrder waybillOrder); + +} \ No newline at end of file