md
This commit is contained in:
parent
fadf0771d2
commit
b25ff32110
@ -1644,7 +1644,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
* @param isNew
|
||||
* @throws EmisBizError
|
||||
*/
|
||||
private void calcWayBillCommonInfoByOms(EmisWaybill emisWaybillSave,boolean isNew) throws EmisBizError {
|
||||
private void calcWayBillCommonInfoByOms(EmisWaybill emisWaybillSave,EmisWaybill oldWaybill,boolean isNew) throws EmisBizError {
|
||||
|
||||
String orderSn = WaybillHelper.genOrderSn();
|
||||
emisWaybillSave.setBlGenSubbill("1");
|
||||
@ -1914,34 +1914,44 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
|
||||
|
||||
// 仓库收货/整柜提货 建立入仓预报单
|
||||
if( "1".equals(emisWaybillSave.getPickupMethod()) || "3".equals(emisWaybillSave.getPickupMethod()) ) {
|
||||
// 获取进仓单号
|
||||
try {
|
||||
// TAN-SMD-240603-01
|
||||
String YYMMDD = "yyMMdd";
|
||||
if("1".equals(emisWaybillSave.getPickupMethod()) || "3".equals(emisWaybillSave.getPickupMethod()) ) {
|
||||
|
||||
String wayhoustInNo = null;
|
||||
|
||||
// 旧进仓单号不变
|
||||
if(oldWaybill!=null){
|
||||
wayhoustInNo=oldWaybill.getWarehouseInNo();
|
||||
}
|
||||
|
||||
if(StringUtils.isEmpty(wayhoustInNo)) {
|
||||
// 获取进仓单号
|
||||
try {
|
||||
// TAN-SMD-240603-01
|
||||
String YYMMDD = "yyMMdd";
|
||||
// String hbKey = "TAN" + "-" + simpleName +"-"+ DateUtils.parseDateToStr(YYMMDD, new Date());
|
||||
String hbKey = "TAN" + "-" + simpleName +"-"+ DateUtils.parseDateToStr(YYMMDD, emisWaybillSave.getPickStartDate());
|
||||
Long lockNo = redissonService.addAndGetLong(hbKey, 1L);
|
||||
String wayhoustInNo = hbKey + "" + StringUtils.leftPad(String.valueOf(lockNo), 2, "0");
|
||||
emisWaybillSave.setIntoWarehouseBillCode(wayhoustInNo);
|
||||
String hbKey = "TAN" + "-" + simpleName + "-" + DateUtils.parseDateToStr(YYMMDD, emisWaybillSave.getPickStartDate());
|
||||
Long lockNo = redissonService.addAndGetLong(hbKey, 1L);
|
||||
wayhoustInNo = hbKey + "" + StringUtils.leftPad(String.valueOf(lockNo), 2, "0");
|
||||
emisWaybillSave.setIntoWarehouseBillCode(wayhoustInNo);
|
||||
|
||||
// 建立入仓预报信息
|
||||
EmisWarehouseIn emisWarehouseIn = new EmisWarehouseIn();
|
||||
emisWarehouseIn.setInNo(emisWaybillSave.getIntoWarehouseBillCode());
|
||||
emisWarehouseIn.setOrderSn(emisWaybillSave.getOrderSn());
|
||||
emisWarehouseIn.setCustomerCode(customerCode);
|
||||
emisWarehouseIn.setCustomerName(customerName);
|
||||
emisWarehouseIn.setEntryDate(emisWaybillSave.getPickStartDate());
|
||||
emisWarehouseIn.setConfirmStatus("0");
|
||||
emisWarehouseIn.setUsedStatus("0");
|
||||
emisWarehouseIn.setStatus("0");
|
||||
emisWarehouseIn.setBillCode(emisWaybillSave.getBillCode());
|
||||
emisWarehouseIn.setSerialNo(WaybillHelper.genSeqNo());
|
||||
// 建立入仓预报信息
|
||||
EmisWarehouseIn emisWarehouseIn = new EmisWarehouseIn();
|
||||
emisWarehouseIn.setInNo(emisWaybillSave.getIntoWarehouseBillCode());
|
||||
emisWarehouseIn.setOrderSn(emisWaybillSave.getOrderSn());
|
||||
emisWarehouseIn.setCustomerCode(customerCode);
|
||||
emisWarehouseIn.setCustomerName(customerName);
|
||||
emisWarehouseIn.setEntryDate(emisWaybillSave.getPickStartDate());
|
||||
emisWarehouseIn.setConfirmStatus("0");
|
||||
emisWarehouseIn.setUsedStatus("0");
|
||||
emisWarehouseIn.setStatus("0");
|
||||
emisWarehouseIn.setBillCode(emisWaybillSave.getBillCode());
|
||||
emisWarehouseIn.setSerialNo(WaybillHelper.genSeqNo());
|
||||
|
||||
emisWarehouseInMapper.insertEmisWarehouseIn(emisWarehouseIn);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
emisWarehouseInMapper.insertEmisWarehouseIn(emisWarehouseIn);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2952,7 +2962,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
}
|
||||
|
||||
// 公共计算部分
|
||||
calcWayBillCommonInfoByOms(emisWaybillSave,true);
|
||||
calcWayBillCommonInfoByOms(emisWaybillSave,null,true);
|
||||
|
||||
// 插入运单数据
|
||||
emisWaybillMapper.insertEmisWaybill(emisWaybillSave);
|
||||
@ -3203,7 +3213,7 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
// 公共计算部分
|
||||
emisWaybillSave.setId(oldEmisWaybill.getId());
|
||||
|
||||
calcWayBillCommonInfoByOms(emisWaybillSave,false);
|
||||
calcWayBillCommonInfoByOms(emisWaybillSave,oldEmisWaybill,false);
|
||||
|
||||
// 基础信息更新
|
||||
emisWaybillMapper.updateEmisWaybill(emisWaybillSave);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user