解决采购退货单丢失linkId导致空指针报错(增加提示)

This commit is contained in:
jishenghua
2024-06-14 22:27:13 +08:00
parent 40498cef8a
commit f8ea188267
2 changed files with 12 additions and 4 deletions

View File

@@ -551,11 +551,16 @@ public class DepotItemService {
BigDecimal preNumber = getPreItemByHeaderIdAndMaterial(linkStr, depotItem.getMaterialExtendId(), depotItem.getLinkId()).getOperNumber();
//除去此单据之外的已入库|已出库
BigDecimal realFinishNumber = getRealFinishNumber(currentSubType, depotItem.getMaterialExtendId(), depotItem.getLinkId(), preHeaderId, headerId, unitInfo, unit);
if (preNumber!=null && depotItem.getOperNumber().add(realFinishNumber).compareTo(preNumber) > 0) {
if (!systemConfigService.getOverLinkBillFlag()) {
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_CODE,
String.format(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_MSG, barCode));
if(preNumber!=null) {
if (depotItem.getOperNumber().add(realFinishNumber).compareTo(preNumber) > 0) {
if (!systemConfigService.getOverLinkBillFlag()) {
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_CODE,
String.format(ExceptionConstants.DEPOT_HEAD_NUMBER_NEED_EDIT_FAILED_MSG, barCode));
}
}
} else {
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_ITEM_PRE_BILL_IS_CHANGE_CODE,
ExceptionConstants.DEPOT_ITEM_PRE_BILL_IS_CHANGE_MSG);
}
}
}