md
This commit is contained in:
parent
57772fe160
commit
c7e0953abf
@ -19,6 +19,7 @@ import com.xdadan.erp.oms.domain.exception.EmisBizError;
|
|||||||
import com.xdadan.erp.oms.domain.vo.AddressParseResult;
|
import com.xdadan.erp.oms.domain.vo.AddressParseResult;
|
||||||
import com.xdadan.erp.oms.service.*;
|
import com.xdadan.erp.oms.service.*;
|
||||||
import com.xdadan.erp.oms.service.svc.IApiwebSvc;
|
import com.xdadan.erp.oms.service.svc.IApiwebSvc;
|
||||||
|
import com.xdadan.erp.oms.service.svc.IRpcCommonSvc;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -48,10 +49,10 @@ public class Oms2cCommonController extends BaseController
|
|||||||
@Autowired
|
@Autowired
|
||||||
RedissonService redissonService;
|
RedissonService redissonService;
|
||||||
|
|
||||||
private IApiwebSvc iApiwebSvc;
|
private IRpcCommonSvc iRpcCommonSvc;
|
||||||
|
|
||||||
public Oms2cCommonController(IApiwebSvc iApiwebSvc) {
|
public Oms2cCommonController(IRpcCommonSvc iRpcCommonSvc) {
|
||||||
this.iApiwebSvc = iApiwebSvc;
|
this.iRpcCommonSvc = iRpcCommonSvc;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -61,7 +62,7 @@ public class Oms2cCommonController extends BaseController
|
|||||||
public AjaxResult realMatchWaybill(String useSiteCode,String prefix)
|
public AjaxResult realMatchWaybill(String useSiteCode,String prefix)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return this.iApiwebSvc.realMatchWaybill(useSiteCode,"T7080");
|
return this.iRpcCommonSvc.realMatchWaybill(useSiteCode,"T7080");
|
||||||
}catch (Exception ex){
|
}catch (Exception ex){
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
return AjaxResult.error(ex.getMessage());
|
return AjaxResult.error(ex.getMessage());
|
||||||
|
|||||||
@ -21,7 +21,8 @@ import com.xdadan.erp.oms.common.utils.DateUtils;
|
|||||||
import com.xdadan.erp.oms.domain.exception.EmisBizError;
|
import com.xdadan.erp.oms.domain.exception.EmisBizError;
|
||||||
import com.xdadan.erp.oms.domain.vo.*;
|
import com.xdadan.erp.oms.domain.vo.*;
|
||||||
import com.xdadan.erp.oms.service.*;
|
import com.xdadan.erp.oms.service.*;
|
||||||
import com.xdadan.erp.oms.service.svc.IApiwebSvc;
|
import com.xdadan.erp.oms.service.svc.IRpcWaybillSvc;
|
||||||
|
import com.xdadan.erp.oms.service.svc.IRpcWaybillSvc;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -57,10 +58,10 @@ public class Oms2cWaybillController extends BaseController
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IEmisTmsScanRecordService emisTmsScanRecordService;
|
private IEmisTmsScanRecordService emisTmsScanRecordService;
|
||||||
|
|
||||||
private IApiwebSvc iApiwebSvc;
|
private IRpcWaybillSvc iRpcWaybillSvc;
|
||||||
|
|
||||||
public Oms2cWaybillController(IApiwebSvc iApiwebSvc) {
|
public Oms2cWaybillController(IRpcWaybillSvc iRpcWaybillSvc) {
|
||||||
this.iApiwebSvc = iApiwebSvc;
|
this.iRpcWaybillSvc = iRpcWaybillSvc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -70,54 +71,14 @@ public class Oms2cWaybillController extends BaseController
|
|||||||
@RequestMapping(value = "/getWaybillDetail")
|
@RequestMapping(value = "/getWaybillDetail")
|
||||||
public AjaxResult getWaybillDetail(String billCode ,String orderSn)
|
public AjaxResult getWaybillDetail(String billCode ,String orderSn)
|
||||||
{
|
{
|
||||||
try {
|
return this.IRpcWaybillSvc.getWaybillDetail(billCode,orderSn);
|
||||||
WaybillOrder waybillOrder=null;
|
|
||||||
|
|
||||||
if(StringUtils.isEmpty(billCode) ){
|
|
||||||
return AjaxResult.error("参数错误");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!StringUtils.isEmpty(billCode) ){
|
|
||||||
waybillOrder = emisWaybillService.getWaybillDetailByBillCode(billCode);
|
|
||||||
if(waybillOrder==null){
|
|
||||||
return AjaxResult.error("运单不存在");
|
|
||||||
}
|
|
||||||
}else if(!StringUtils.isEmpty(orderSn)){
|
|
||||||
waybillOrder = emisWaybillService.getWaybillDetailByOrderSn(orderSn);
|
|
||||||
if(waybillOrder==null){
|
|
||||||
return AjaxResult.error("订单不存在");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取取件员电话
|
|
||||||
// if(!StringUtils.isEmpty(waybillOrder.getTakePieceEmployeeCode())){
|
|
||||||
// SysUser user= sysUserService.selectUserByUserName(waybillOrder.getTakePieceEmployeeCode());
|
|
||||||
// waybillOrder.setTakePieceEmployeePhone(user.getPhonenumber());
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 判断是否已经锁单
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return AjaxResult.success("获取成功",waybillOrder);
|
|
||||||
}
|
|
||||||
catch (Exception ex){
|
|
||||||
ex.printStackTrace();
|
|
||||||
// 返回子定义异常
|
|
||||||
if(ex instanceof EmisBizError){
|
|
||||||
return AjaxResult.error("("+((EmisBizError)ex).getErrorCode()+")"+ex.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
return AjaxResult.error("服务器异常,联系客服");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "客户运单实时下单", businessType = BusinessType.INSERT)
|
@Log(title = "客户运单实时下单", businessType = BusinessType.INSERT)
|
||||||
@PostMapping(value = "/realSubmitOrder")
|
@PostMapping(value = "/realSubmitOrder")
|
||||||
public AjaxResult realSubmitOrder(@Valid @RequestBody WaybillOrder waybillOrder,Integer isModify)
|
public AjaxResult realSubmitOrder(@Valid @RequestBody WaybillOrder waybillOrder,Integer isModify)
|
||||||
{
|
{
|
||||||
return this.iApiwebSvc.realSubmitOrderByOms(waybillOrder,isModify);
|
return this.IRpcWaybillSvc.realSubmitOrderByOms(waybillOrder,isModify);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -130,61 +91,9 @@ public class Oms2cWaybillController extends BaseController
|
|||||||
@PostMapping(value = "/preCalcWaybillFee")
|
@PostMapping(value = "/preCalcWaybillFee")
|
||||||
public AjaxResult preCalcWaybillFee(@RequestBody WaybillOrder waybillOrder)
|
public AjaxResult preCalcWaybillFee(@RequestBody WaybillOrder waybillOrder)
|
||||||
{
|
{
|
||||||
return this.iApiwebSvc.preCalcWaybillFee(waybillOrder);
|
return this.IRpcWaybillSvc.preCalcWaybillFee(waybillOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Log(title = "计算结算重量", businessType = BusinessType.OTHER)
|
|
||||||
@PostMapping(value = "/calcSetteldWeight")
|
|
||||||
public AjaxResult calcSetteldWeight(@RequestBody WaybillOrder waybillOrder)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
EmisWaybill emisWaybillSave = waybillOrder.toDb();
|
|
||||||
|
|
||||||
emisWaybillService.calcSettledWeight(emisWaybillSave);
|
|
||||||
|
|
||||||
JSONObject jObjRst = new JSONObject();
|
|
||||||
jObjRst.put("settlementWeight", emisWaybillSave.getSettlementWeight());
|
|
||||||
jObjRst.put("volumeWeight", emisWaybillSave.getVolumeWeight());
|
|
||||||
return AjaxResult.success("计算成功", jObjRst);
|
|
||||||
}
|
|
||||||
catch (Exception ex){
|
|
||||||
ex.printStackTrace();
|
|
||||||
// 返回子定义异常
|
|
||||||
if(ex instanceof EmisBizError){
|
|
||||||
return AjaxResult.error("("+((EmisBizError)ex).getErrorCode()+")"+ex.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
return AjaxResult.error("服务器异常,联系客服");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log(title = "计算体积重量", businessType = BusinessType.OTHER)
|
|
||||||
@PostMapping(value = "/calcVolumeWeight")
|
|
||||||
public AjaxResult calcVolumeWeight(@RequestBody WaybillOrder waybillOrder)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
EmisWaybill emisWaybillSave = waybillOrder.toDb();
|
|
||||||
|
|
||||||
emisWaybillService.calcVolumeWeight(emisWaybillSave);
|
|
||||||
|
|
||||||
JSONObject jObjRst = new JSONObject();
|
|
||||||
jObjRst.put("volumeWeight", emisWaybillSave.getVolumeWeight());
|
|
||||||
return AjaxResult.success("计算成功", jObjRst);
|
|
||||||
}
|
|
||||||
catch (Exception ex){
|
|
||||||
ex.printStackTrace();
|
|
||||||
// 返回子定义异常
|
|
||||||
if(ex instanceof EmisBizError){
|
|
||||||
return AjaxResult.error("("+((EmisBizError)ex).getErrorCode()+")"+ex.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
return AjaxResult.error("服务器异常,联系客服");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@JacksonFilter(include= {
|
@JacksonFilter(include= {
|
||||||
"id","orderSn","billCode","orderStatus","waybillStatus",
|
"id","orderSn","billCode","orderStatus","waybillStatus",
|
||||||
"orderType","sendDate","customerCode","customerName",
|
"orderType","sendDate","customerCode","customerName",
|
||||||
@ -231,14 +140,4 @@ public class Oms2cWaybillController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
String fileUploadDir = "./upload"+File.separator+DateUtils.datePath();
|
|
||||||
File saveDir = new File(fileUploadDir);
|
|
||||||
if(!saveDir.exists()){
|
|
||||||
saveDir.mkdirs();
|
|
||||||
}
|
|
||||||
// FileUtil.mkdir(fileUploadDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,28 +14,30 @@ import javax.validation.Valid;
|
|||||||
@FeignClient(name = "${service.provider.name}",url = "${service.provider.url}",configuration = {FeignErrorDecoder.class})
|
@FeignClient(name = "${service.provider.name}",url = "${service.provider.url}",configuration = {FeignErrorDecoder.class})
|
||||||
public interface IApiwebSvc {
|
public interface IApiwebSvc {
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 获取电子面单单号
|
// * 获取电子面单单号
|
||||||
*/
|
// */
|
||||||
@GetMapping(value = "/apiweb/common/realMatchWaybill")
|
// @GetMapping(value = "/apiweb/common/realMatchWaybill")
|
||||||
public AjaxResult realMatchWaybill(@RequestParam("useSiteCode")String useSiteCode, @RequestParam("prefix")String prefix);
|
// public AjaxResult realMatchWaybill(@RequestParam("useSiteCode")String useSiteCode, @RequestParam("prefix")String prefix);
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 运费试算
|
// * 运费试算
|
||||||
* @param waybillOrder
|
// * @param waybillOrder
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
@PostMapping(value = "/apiweb/emisWaybill/preCalcWaybillFee")
|
// @PostMapping(value = "/apiweb/emisWaybill/preCalcWaybillFee")
|
||||||
public AjaxResult preCalcWaybillFee(@RequestBody WaybillOrder waybillOrder);
|
// public AjaxResult preCalcWaybillFee(@RequestBody WaybillOrder waybillOrder);
|
||||||
|
//
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* OMS实时下单
|
// * OMS实时下单
|
||||||
* @param waybillOrder
|
// * @param waybillOrder
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
@PostMapping(value = "/apiweb/emisWaybill/realSubmitOrderByOms")
|
// @PostMapping(value = "/apiweb/emisWaybill/realSubmitOrderByOms")
|
||||||
public AjaxResult realSubmitOrderByOms(@RequestBody WaybillOrder waybillOrder, Integer isModify);
|
// public AjaxResult realSubmitOrderByOms(@RequestBody WaybillOrder waybillOrder, Integer isModify);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
}
|
}
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
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 = "IRpcCommonSvc",url = "${service.provider.url}",configuration = {FeignErrorDecoder.class})
|
||||||
|
public interface IRpcCommonSvc {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取电子面单单号
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/apiweb/common/realMatchWaybill")
|
||||||
|
public AjaxResult realMatchWaybill(@RequestParam("useSiteCode") String useSiteCode, @RequestParam("prefix") String prefix);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
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 = "IRpcWaybillSvc",url = "${service.provider.url}",configuration = {FeignErrorDecoder.class})
|
||||||
|
public interface IRpcWaybillSvc {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运费试算
|
||||||
|
* @param waybillOrder
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "/apiweb/emisWaybill/preCalcWaybillFee")
|
||||||
|
public AjaxResult preCalcWaybillFee(@RequestBody WaybillOrder waybillOrder);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OMS实时下单
|
||||||
|
* @param waybillOrder
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "/apiweb/emisWaybill/realSubmitOrderByOms")
|
||||||
|
public AjaxResult realSubmitOrderByOms(@RequestBody WaybillOrder waybillOrder,@RequestParam("isModify") Integer isModify);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取运单详情
|
||||||
|
* @param billCode
|
||||||
|
* @param orderSn
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "/apiweb/emisWaybill/getWaybillDetail")
|
||||||
|
public AjaxResult getWaybillDetail(@RequestParam("billCode")String billCode,@RequestParam("orderSn") String orderSn);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user