🔀 合并编辑保存以库为准
This commit is contained in:
+14
-2
@@ -1068,10 +1068,11 @@ public class WaybillServiceImpl extends BaseServiceImpl<WaybillMapper, Waybill>
|
||||
waybill.setMasterNo(null);
|
||||
waybill.setMileageRemark(null);
|
||||
}
|
||||
// 新建若已带业务状态(如复制提交已完成)则在过程校正后回写,保证与原运单一致
|
||||
// 新建若已带业务状态(如复制提交已完成)则在过程校正后回写,保证与原运单一致;
|
||||
// 编辑保存只改资料,business_status 以库里的值为准,请求体里的值不回写
|
||||
String preservedBusinessStatus = created
|
||||
? TransportBusinessSupport.trimToNull(waybill.getBusinessStatus())
|
||||
: null;
|
||||
: editPreservedBusinessStatus(oldRecord);
|
||||
if (isCompletedBusinessStatus(preservedBusinessStatus)) {
|
||||
preservedBusinessStatus = "completed";
|
||||
}
|
||||
@@ -1093,6 +1094,17 @@ public class WaybillServiceImpl extends BaseServiceImpl<WaybillMapper, Waybill>
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑保存要回写的业务状态:取库里的值。
|
||||
* 草稿返回 null —— submit 即正式提交,草稿须由过程校正提升为待执行 / 进行中。
|
||||
*/
|
||||
private String editPreservedBusinessStatus(Waybill oldRecord) {
|
||||
String currentStatus = oldRecord == null
|
||||
? null
|
||||
: TransportBusinessSupport.trimToNull(oldRecord.getBusinessStatus());
|
||||
return STATUS_DRAFT.equals(currentStatus) ? null : currentStatus;
|
||||
}
|
||||
|
||||
private void fillCustomerName(Waybill waybill) {
|
||||
if (Func.isNotEmpty(waybill.getContractId())) {
|
||||
ContractManage contract = contractManageService.getById(waybill.getContractId());
|
||||
|
||||
Reference in New Issue
Block a user