|
|
|
@ -125,13 +125,19 @@ public class ShipmentRollServiceImpl extends ServiceImpl<ShipmentRollMapper, Shi |
|
|
|
saleQty = saleQty.add(detail.getSaleQty()); |
|
|
|
} |
|
|
|
// 获得 箱子 卷数 |
|
|
|
BigDecimal num = saleQty.divide(new BigDecimal(value), 0, RoundingMode.UP); |
|
|
|
BigDecimal num = saleQty.divide(new BigDecimal(value), 0, RoundingMode.UP); |
|
|
|
// 获得该物料已经扫描多少卷 |
|
|
|
Integer count = lambdaQuery() |
|
|
|
.eq(ShipmentRoll::getShipmentId, shipmentRollVo.getShipmentId()) |
|
|
|
.eq(ShipmentRoll::getPartNo, rollData.getPartNo()) |
|
|
|
//.eq(ShipmentRoll::getBoxNo, shipmentRollVo.getBoxNo()) |
|
|
|
.eq(ShipmentRoll::getSite, shipmentRollVo.getSite()).count(); |
|
|
|
//查询已经扫描的卷数量 |
|
|
|
List<ShipmentRoll> scannedRolls = lambdaQuery() |
|
|
|
.eq(ShipmentRoll::getShipmentId, shipmentRollVo.getShipmentId()) |
|
|
|
.eq(ShipmentRoll::getPartNo, rollData.getPartNo()) |
|
|
|
//.eq(ShipmentRoll::getBoxNo, shipmentRollVo.getBoxNo()) |
|
|
|
.eq(ShipmentRoll::getSite, shipmentRollVo.getSite()).list(); |
|
|
|
BigDecimal needRollNum = num.subtract(new BigDecimal(count)); |
|
|
|
if (BigDecimal.ZERO.compareTo(needRollNum) == 0){ |
|
|
|
throw new RuntimeException("该物料已满足发货数量,无法再次添加!"); |
|
|
|
|