调整 运力
This commit is contained in:
+13
-4
@@ -477,9 +477,11 @@ public class WaybillServiceImpl extends BaseServiceImpl<WaybillMapper, Waybill>
|
|||||||
waybill.setLoadingNo(null);
|
waybill.setLoadingNo(null);
|
||||||
waybill.setMasterNo(null);
|
waybill.setMasterNo(null);
|
||||||
waybill.setMileageRemark(null);
|
waybill.setMileageRemark(null);
|
||||||
// 新建(含复制后提交)不沿用源单据状态,与纯新增一致
|
|
||||||
waybill.setBusinessStatus(null);
|
|
||||||
}
|
}
|
||||||
|
// 新建若已带业务状态(如复制提交)则在过程校正后回写,保证与原运单一致
|
||||||
|
String preservedBusinessStatus = created
|
||||||
|
? TransportBusinessSupport.trimToNull(waybill.getBusinessStatus())
|
||||||
|
: null;
|
||||||
// 无过程快照时按项目回填;再按接单设置决定 pending / running
|
// 无过程快照时按项目回填;再按接单设置决定 pending / running
|
||||||
fillProjectProcessConfig(waybill);
|
fillProjectProcessConfig(waybill);
|
||||||
prepare(waybill);
|
prepare(waybill);
|
||||||
@@ -489,6 +491,9 @@ public class WaybillServiceImpl extends BaseServiceImpl<WaybillMapper, Waybill>
|
|||||||
clearDriverAcceptRecord(waybill);
|
clearDriverAcceptRecord(waybill);
|
||||||
}
|
}
|
||||||
applyDriverAcceptBusinessStatus(waybill);
|
applyDriverAcceptBusinessStatus(waybill);
|
||||||
|
if (Func.isNotEmpty(preservedBusinessStatus)) {
|
||||||
|
waybill.setBusinessStatus(preservedBusinessStatus);
|
||||||
|
}
|
||||||
fillCustomerName(waybill);
|
fillCustomerName(waybill);
|
||||||
if (created && Func.isEmpty(waybill.getWaybillNo())) {
|
if (created && Func.isEmpty(waybill.getWaybillNo())) {
|
||||||
waybill.setWaybillNo(nextCode());
|
waybill.setWaybillNo(nextCode());
|
||||||
@@ -738,13 +743,17 @@ public class WaybillServiceImpl extends BaseServiceImpl<WaybillMapper, Waybill>
|
|||||||
target.setFreightJson(source.getFreightJson());
|
target.setFreightJson(source.getFreightJson());
|
||||||
target.setAttachmentsJson(source.getAttachmentsJson());
|
target.setAttachmentsJson(source.getAttachmentsJson());
|
||||||
target.setRemark(source.getRemark());
|
target.setRemark(source.getRemark());
|
||||||
// 复制后状态与新增一致:先置空,再按过程配置校正为 pending/running
|
// 复制后业务状态与原运单保持一致
|
||||||
target.setBusinessStatus(null);
|
String sourceBusinessStatus = source.getBusinessStatus();
|
||||||
|
target.setBusinessStatus(sourceBusinessStatus);
|
||||||
target.setWaybillNo(nextCode());
|
target.setWaybillNo(nextCode());
|
||||||
clearDriverAcceptRecord(target);
|
clearDriverAcceptRecord(target);
|
||||||
fillProjectProcessConfig(target);
|
fillProjectProcessConfig(target);
|
||||||
prepare(target);
|
prepare(target);
|
||||||
applyDriverAcceptBusinessStatus(target);
|
applyDriverAcceptBusinessStatus(target);
|
||||||
|
if (Func.isNotEmpty(sourceBusinessStatus)) {
|
||||||
|
target.setBusinessStatus(sourceBusinessStatus);
|
||||||
|
}
|
||||||
validate(target);
|
validate(target);
|
||||||
save(target);
|
save(target);
|
||||||
return detail(target.getId());
|
return detail(target.getId());
|
||||||
|
|||||||
Reference in New Issue
Block a user