md
This commit is contained in:
parent
5181720e7c
commit
4ae1e80cfd
@ -24,11 +24,9 @@ import com.xdadan.erp.common.core.domain.entity.SysUser;
|
||||
import com.xdadan.erp.common.core.page.TableDataInfo;
|
||||
import com.xdadan.erp.common.enums.BusinessType;
|
||||
import com.xdadan.erp.common.utils.DateUtils;
|
||||
import com.xdadan.erp.common.utils.ServletUtils;
|
||||
import com.xdadan.erp.common.utils.idgen.UUID;
|
||||
import com.xdadan.erp.emis.domain.EmisTmsScanRecord;
|
||||
import com.xdadan.erp.emis.domain.EmisTransProduct;
|
||||
import com.xdadan.erp.emis.domain.EmisWaybill;
|
||||
import com.xdadan.erp.emis.domain.EmisWaybillFeeitem;
|
||||
import com.xdadan.erp.emis.domain.*;
|
||||
import com.xdadan.erp.emis.domain.enumtype.ScanType;
|
||||
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||
import com.xdadan.erp.emis.domain.vo.FeeItem;
|
||||
@ -221,6 +219,60 @@ public class WaybillController extends BaseController
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Log(title = "API实时下单", businessType = BusinessType.INSERT)
|
||||
@PostMapping(value = "/realMatchOrderApi")
|
||||
public AjaxResult realMatchOrderApi(@RequestBody EmisWaybill emisWaybillSave)
|
||||
{
|
||||
try {
|
||||
String appKey=ServletUtils.getHeaderValue("appKey");
|
||||
String sign=ServletUtils.getHeaderValue("sign");
|
||||
|
||||
emisWaybillService.realMatchOrderApi(emisWaybillSave,true);
|
||||
// 下单成功,查询下单数据
|
||||
EmisWaybill newBill = emisBaseService.getWaybillByBillCode(emisWaybillSave.getBillCode());
|
||||
|
||||
JSONObject jObjOut = new JSONObject();
|
||||
// 集包地,目的网点
|
||||
String packageWdjc="";
|
||||
try {
|
||||
EmisSite destSite = emisBaseService.getSiteByCode(newBill.getDispatchUnderlingSiteCode());
|
||||
packageWdjc=destSite.getSizeCode3();
|
||||
}catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
// 三段码 山东淄博-越南胡志明
|
||||
String threeCodeNum = newBill.getSendSiteName()+"-"+newBill.getDispatchUnderlingSiteName();
|
||||
|
||||
jObjOut.put("billCode",newBill.getBillCode());
|
||||
jObjOut.put("packageWdjc",packageWdjc);
|
||||
jObjOut.put("threeCodeNum",threeCodeNum);
|
||||
|
||||
jObjOut.put("sendCountryName",newBill.getSendCountryName());
|
||||
jObjOut.put("destCountryName",newBill.getReceiveCountryName());
|
||||
jObjOut.put("transLineTypeName",newBill.getTransLineTypeName());
|
||||
jObjOut.put("productTypeName",newBill.getProductTypeName());
|
||||
jObjOut.put("timeType",newBill.getTimeType());
|
||||
return AjaxResult.success("下单成功", jObjOut);
|
||||
}
|
||||
catch (DuplicateKeyException e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error("运单号重复");
|
||||
}
|
||||
catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
String msg="下单失败";
|
||||
// 返回子定义异常
|
||||
if(ex instanceof EmisBizError){
|
||||
msg=((EmisBizError)ex).getErrorCode()+":"+ex.getMessage();
|
||||
}
|
||||
return AjaxResult.error(msg);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Log(title = "OMS实时下单", businessType = BusinessType.INSERT)
|
||||
@PostMapping(value = "/realSubmitOrderByOms")
|
||||
public AjaxResult realSubmitOrderByOms(@Valid @RequestBody WaybillOrder waybillOrder, Integer isModify)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user