|
@@ -337,7 +337,6 @@ public class LogisticsInfoServiceImpl extends ServiceImpl<LogisticsInfoMapper, L
|
|
|
stockChangeDto.setDefaultRemarks("采购入库");
|
|
|
stockChangeDto.setTypeEnum(InTypeEnum.PURCHASE);
|
|
|
stockChangeDto.setChangeDetailsList(list);
|
|
|
-
|
|
|
List<StockJournal> stockJournals = stockService.changeQuantity(stockChangeDto);
|
|
|
|
|
|
// 修改入库数量
|
|
@@ -354,19 +353,22 @@ public class LogisticsInfoServiceImpl extends ServiceImpl<LogisticsInfoMapper, L
|
|
|
|
|
|
for (LogisticsDetails logisticsDetail : logisticsDetails) {
|
|
|
|
|
|
- // 发货数量
|
|
|
- BigDecimal shipmentQuantity = logisticsDetail.getShipmentQuantity();
|
|
|
-
|
|
|
// 入库数量
|
|
|
BigDecimal receiptQuantity = logisticsDetail.getReceiptQuantity();
|
|
|
|
|
|
// 本次入库数量
|
|
|
BigDecimal bigDecimal = ObjectUtil.defaultIfNull(collect.get(logisticsDetail.getId()), BigDecimal.ZERO);
|
|
|
|
|
|
- int compareTo = receiptQuantity.add(bigDecimal).compareTo(shipmentQuantity);
|
|
|
+ // 入库数量加本次入库数量 与 发货数量对比
|
|
|
+ int compareTo = receiptQuantity.add(bigDecimal).compareTo(logisticsDetail.getShipmentQuantity());
|
|
|
+
|
|
|
+ // 入库数量加本次入库数量 大于 发货数量
|
|
|
if (compareTo > 0) {
|
|
|
throw new ServiceException("入库数量不能超过发货数量");
|
|
|
- } else if (compareTo < 0) {
|
|
|
+ }
|
|
|
+
|
|
|
+ // 入库数量加本次入库数量 小于 发货数量,本次采购入库未完成
|
|
|
+ if (compareTo < 0) {
|
|
|
completeFlag = false;
|
|
|
}
|
|
|
|