md
This commit is contained in:
parent
844332de62
commit
a9b7a58822
@ -258,16 +258,6 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
|||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public int draftSubmitOrder(EmisWaybill emisWaybillSave,boolean isOms) throws EmisBizError {
|
public int draftSubmitOrder(EmisWaybill emisWaybillSave,boolean isOms) throws EmisBizError {
|
||||||
boolean isNew = true;
|
|
||||||
EmisWaybill emisWaybillOld = null;
|
|
||||||
|
|
||||||
// 下单网点
|
|
||||||
String sendSiteCode=emisWaybillSave.getSendSiteCode();
|
|
||||||
// 非OMS方式使用员工所属网点
|
|
||||||
if(!isOms){
|
|
||||||
sendSiteCode=SecurityUtils.getLoginUser().getUser().getOwnerSiteCode();
|
|
||||||
emisWaybillSave.setSendSiteCode(sendSiteCode);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果没有单号就生成单号,如果有单号需要判断是否重复
|
// 如果没有单号就生成单号,如果有单号需要判断是否重复
|
||||||
if( !StringUtils.isEmpty(emisWaybillSave.getBillCode()) ) {
|
if( !StringUtils.isEmpty(emisWaybillSave.getBillCode()) ) {
|
||||||
@ -275,15 +265,30 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
|||||||
if (isExists) {
|
if (isExists) {
|
||||||
throw new EmisBizError(EmisBizErrorType.EXISTS, "运单号重复");
|
throw new EmisBizError(EmisBizErrorType.EXISTS, "运单号重复");
|
||||||
}
|
}
|
||||||
}else{
|
|
||||||
// 生成新的运单号
|
|
||||||
String waybillNo = emisElectronicSitePagService.realMatchWaybill(sendSiteCode,"T7080");
|
|
||||||
emisWaybillSave.setBillCode(waybillNo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 转换草稿数据到真实数据
|
// 转换草稿数据到真实数据
|
||||||
cvtWaybillDraftToReal(emisWaybillSave,isOms);
|
cvtWaybillDraftToReal(emisWaybillSave,isOms);
|
||||||
|
|
||||||
|
String sendSiteCode=null;
|
||||||
|
// 生成运单
|
||||||
|
if(!isOms){
|
||||||
|
sendSiteCode=SecurityUtils.getLoginUser().getUser().getOwnerSiteCode();
|
||||||
|
emisWaybillSave.setSendSiteCode(sendSiteCode);
|
||||||
|
}else{
|
||||||
|
sendSiteCode=emisWaybillSave.getSendSiteCode();
|
||||||
|
emisWaybillSave.setSendSiteCode(sendSiteCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(StringUtils.isEmpty(sendSiteCode)){
|
||||||
|
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1, "寄件地址不在网点服务区");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(StringUtils.isEmpty(emisWaybillSave.getBillCode()) ) {
|
||||||
|
// 生成新的运单号
|
||||||
|
String waybillNo = emisElectronicSitePagService.realMatchWaybill(sendSiteCode, "T7080");
|
||||||
|
emisWaybillSave.setBillCode(waybillNo);
|
||||||
|
}
|
||||||
|
|
||||||
// 开始下单
|
// 开始下单
|
||||||
if(!isOms) {
|
if(!isOms) {
|
||||||
@ -303,6 +308,9 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
|||||||
*/
|
*/
|
||||||
private void cvtWaybillDraftToReal(EmisWaybill emisWaybillSave,Boolean isOms) throws EmisBizError {
|
private void cvtWaybillDraftToReal(EmisWaybill emisWaybillSave,Boolean isOms) throws EmisBizError {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 货物名称必填
|
// 货物名称必填
|
||||||
if(StringUtils.isEmpty(emisWaybillSave.getGoodsInfo())){
|
if(StringUtils.isEmpty(emisWaybillSave.getGoodsInfo())){
|
||||||
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1, "产品名称不能为空");
|
throw new EmisBizError(EmisBizErrorType.PARAM_ERROR1, "产品名称不能为空");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user