|
|
@ -209,9 +209,9 @@ public class PurchasereturnRequestMainServiceImpl implements PurchasereturnReque |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void ifdetailQtyBigThanQty(BigDecimal detailQty, BigDecimal qty) { |
|
|
|
private void ifDetailQtyBigThanQty(BigDecimal detailQty, BigDecimal qty) { |
|
|
|
if (detailQty.compareTo(qty) > 0) { |
|
|
|
throw exception(QTY_EXCEPTION, "退货数量" + qty + "不能大于于收货数量" + detailQty); |
|
|
|
throw exception(QTY_EXCEPTION, "退货数量" + qty + "不能大于收货数量" + detailQty); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -336,6 +336,7 @@ public class PurchasereturnRequestMainServiceImpl implements PurchasereturnReque |
|
|
|
|
|
|
|
/** |
|
|
|
* 生成采购收货任务,不要改动事务传播方式,否则会有事务问题 |
|
|
|
* |
|
|
|
* @param mainDO 采购收货主 |
|
|
|
* @param detailDOList 采购收货子 |
|
|
|
*/ |
|
|
@ -363,6 +364,10 @@ public class PurchasereturnRequestMainServiceImpl implements PurchasereturnReque |
|
|
|
purchasereturnJobMainDO.setCreator(null); |
|
|
|
purchasereturnJobMainDO.setUpdateTime(null); |
|
|
|
purchasereturnJobMainDO.setUpdater(null); |
|
|
|
BusinesstypeDO businesstypeDO = jobUtils.selectDocumentSettingFromBusinessType("PurchaseReturnRequest"); |
|
|
|
purchasereturnJobMainDO.setBusinessType(businesstypeDO.getCode()); |
|
|
|
purchasereturnJobMainDO.setInInventoryStatuses(businesstypeDO.getInInventoryStatuses()); |
|
|
|
purchasereturnJobMainDO.setOutInventoryStatuses(businesstypeDO.getOutInventoryStatuses()); |
|
|
|
purchasereturnJobMainMapper.insert(purchasereturnJobMainDO); |
|
|
|
List<ExpectoutCreateReqVO> expectoutCreateReqVOList = new ArrayList<>(); |
|
|
|
List<PurchasereturnJobDetailDO> purchasereturnJobDetailDOList = new ArrayList<>(); |
|
|
@ -465,9 +470,9 @@ public class PurchasereturnRequestMainServiceImpl implements PurchasereturnReque |
|
|
|
PurchasereceiptRecordMainDO purchasereceiptRecordMainDO = purchasereceiptRecordMainMapper.selectById(purchasereceiptRecordDetailDO.getMasterId()); |
|
|
|
mainDo.setPpNumber(purchasereceiptRecordMainDO.getPpNumber()); |
|
|
|
mainDo.setAsnNumber(purchasereceiptRecordMainDO.getAsnNumber()); |
|
|
|
ifdetailQtyBigThanQty(purchasereceiptRecordDetailDO.getQty(), detailDo.getQty()); |
|
|
|
ifDetailQtyBigThanQty(purchasereceiptRecordDetailDO.getQty(), detailDo.getQty()); |
|
|
|
BigDecimal bigDecimal = validatorBalance(detailDo, mainDo); |
|
|
|
ifdetailQtyBigThanQty(detailDo.getQty(),bigDecimal); |
|
|
|
ifDetailQtyBigThanQty(detailDo.getQty(), bigDecimal); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -546,7 +551,7 @@ public class PurchasereturnRequestMainServiceImpl implements PurchasereturnReque |
|
|
|
PurchasereceiptRecordDetailDO purchasereceiptRecordDetailDO = purchasereceiptRecordMainService.selectPurchasereceiptExist(detailDo.getPoNumber(), mainDo.getSupplierCode(), mainDo.getPurchaseReceiptRecordNumber(), detailDo.getPoLine(), detailDo.getItemCode(), detailDo.getPackingNumber(), detailDo.getBatch()); |
|
|
|
PurchasereceiptRecordMainDO purchasereceiptRecordMainDO = purchasereceiptRecordMainMapper.selectById(purchasereceiptRecordDetailDO.getMasterId()); |
|
|
|
try { |
|
|
|
ifdetailQtyBigThanQty(purchasereceiptRecordDetailDO.getQty(), detailDo.getQty()); |
|
|
|
ifDetailQtyBigThanQty(purchasereceiptRecordDetailDO.getQty(), detailDo.getQty()); |
|
|
|
} catch (Exception ex) { |
|
|
|
message.append(ex.getMessage()).append(","); |
|
|
|
} |
|
|
@ -556,7 +561,7 @@ public class PurchasereturnRequestMainServiceImpl implements PurchasereturnReque |
|
|
|
try { |
|
|
|
BigDecimal bigDecimal = validatorBalance(detailDo, mainDo); |
|
|
|
try { |
|
|
|
ifdetailQtyBigThanQty(detailDo.getQty(),bigDecimal); |
|
|
|
ifDetailQtyBigThanQty(detailDo.getQty(), bigDecimal); |
|
|
|
} catch (Exception ex) { |
|
|
|
message.append(ex.getMessage()).append(","); |
|
|
|
} |
|
|
|