This commit is contained in:
linfso 2024-05-26 00:45:35 +08:00
parent 81d0882447
commit 62b01cdfbc
2 changed files with 52 additions and 37 deletions

View File

@ -135,7 +135,7 @@ public class EmisWaybillController extends BaseController
// @PreAuthorize("@ss.hasPermi('emis:emisWaybill:add')") // @PreAuthorize("@ss.hasPermi('emis:emisWaybill:add')")
@Log(title = "运单实时下单", businessType = BusinessType.INSERT) @Log(title = "运单实时下单", businessType = BusinessType.INSERT)
@PostMapping(value = "/realSubmitOrder") @PostMapping(value = "/realSubmitOrder")
public AjaxResult realSubmitOrder(@Valid @RequestBody WaybillOrder waybillOrder) public AjaxResult realSubmitOrder(@Valid @RequestBody WaybillOrder waybillOrder,Integer isModify)
{ {
try { try {
@ -290,8 +290,6 @@ public class EmisWaybillController extends BaseController
startPage(); startPage();
log.debug("====>isTopSite:"+getLoginUser().getUser().isTopSite());
log.debug("====>ownerSiteCode:"+getLoginUser().getUser().getOwnerSiteCode());
if(!(getLoginUser().getUser().isTopSite())){ if(!(getLoginUser().getUser().isTopSite())){
emisWaybill.getParams().put("innerQuery","1"); emisWaybill.getParams().put("innerQuery","1");
emisWaybill.getParams().put("currentSiteCode",getLoginUser().getUser().getOwnerSiteCode()); emisWaybill.getParams().put("currentSiteCode",getLoginUser().getUser().getOwnerSiteCode());

View File

@ -291,14 +291,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
} }
/** private void calcWayBillCommonInfo(EmisWaybill emisWaybillSave) throws EmisBizError {
* 新增下单
* @param emisWaybillSave
*/
private void addWayBill(EmisWaybill emisWaybillSave) throws EmisBizError {
//补齐数据
emisWaybillSave.preInsert();
String orderSn = WaybillHelper.genOrderSn(); String orderSn = WaybillHelper.genOrderSn();
@ -310,9 +303,16 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
emisWaybillSave.setRegisterManCode(getCurrentUser().getEmpCode()); emisWaybillSave.setRegisterManCode(getCurrentUser().getEmpCode());
emisWaybillSave.setRegisterDate(new Date()); emisWaybillSave.setRegisterDate(new Date());
// 发件网点 // 发件网点
emisWaybillSave.setSendSiteCode(getCurrentUser().getOwnerSiteCode()); String sendSiteCode=emisWaybillSave.getSendSiteCode();
emisWaybillSave.setSendSiteName(getCurrentUser().getOwnerSiteName()); if(StringUtils.isEmpty(sendSiteCode)){
sendSiteCode = getCurrentUser().getOwnerSiteCode();
}
EmisSite sendSite = getSiteByCode(sendSiteCode);
emisWaybillSave.setSendSiteCode(sendSite.getSiteCode());
emisWaybillSave.setSendSiteName(sendSite.getSiteName());
// 派件网点 // 派件网点
emisWaybillSave.setDispatchSiteCode(emisWaybillSave.getDispatchUnderlingSiteCode()); emisWaybillSave.setDispatchSiteCode(emisWaybillSave.getDispatchUnderlingSiteCode());
@ -322,6 +322,8 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
emisWaybillSave.setWaybillStatus("0"); emisWaybillSave.setWaybillStatus("0");
// 目的网点3段码 // 目的网点3段码
String destSite3Code = ""; String destSite3Code = "";
EmisSite destSite=getSiteByCode(emisWaybillSave.getDispatchUnderlingSiteCode()); EmisSite destSite=getSiteByCode(emisWaybillSave.getDispatchUnderlingSiteCode());
if(destSite!=null){ if(destSite!=null){
@ -335,7 +337,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
destName=destination.getDestName(); destName=destination.getDestName();
} }
String thirdCode="["+getCurrentUser().getOwnerSiteName()+'-'+destName+"]["+destSite3Code+"]"; String thirdCode="["+emisWaybillSave.getSendSiteName()+'-'+destName+"]["+destSite3Code+"]";
emisWaybillSave.setThirdCode(thirdCode); emisWaybillSave.setThirdCode(thirdCode);
// 下单时间 // 下单时间
@ -503,6 +505,18 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
emisWaybillSave.setBillCodeSub(sb.toString()); emisWaybillSave.setBillCodeSub(sb.toString());
} }
}
/**
* 新增下单
* @param emisWaybillSave
*/
private void addWayBill(EmisWaybill emisWaybillSave) throws EmisBizError {
// 公共计算部分
calcWayBillCommonInfo(emisWaybillSave);
//补齐数据
emisWaybillSave.preInsert(); emisWaybillSave.preInsert();
emisWaybillMapper.insertEmisWaybill(emisWaybillSave); emisWaybillMapper.insertEmisWaybill(emisWaybillSave);
@ -536,9 +550,12 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
} }
private void updateWayBill(EmisWaybill emisWaybillSave){ private void updateWayBill(EmisWaybill emisWaybillSave) throws EmisBizError {
emisWaybillSave.preUpdate();
// 公共计算部分
calcWayBillCommonInfo(emisWaybillSave);
emisWaybillSave.preUpdate();
// 基础信息更新 // 基础信息更新
emisWaybillMapper.updateEmisWaybill(emisWaybillSave); emisWaybillMapper.updateEmisWaybill(emisWaybillSave);