|
|
@ -79,6 +79,7 @@ public interface ItemAccountsMapper extends BaseMapperX<ItemAccountsDO> { |
|
|
|
TransactionDO transactionDO = new TransactionDO(); |
|
|
|
transactionDO.setQty(outQty); |
|
|
|
transactionDO.setType(outLocation.getType()); |
|
|
|
transactionDO.setInventoryAction(TransactionEnum.OUTOUT.getCode()); |
|
|
|
list.add(transactionDO); |
|
|
|
BigDecimal subtractOutQty = qtyNew.subtract(outQty);//差几个零件
|
|
|
|
if (inQty.compareTo(BigDecimal.ZERO) > 0 && inQty.compareTo(subtractOutQty) >= 0) {//账内库存在且大于0足够差额
|
|
|
@ -89,6 +90,7 @@ public interface ItemAccountsMapper extends BaseMapperX<ItemAccountsDO> { |
|
|
|
TransactionDO transactionDO1 = new TransactionDO(); |
|
|
|
transactionDO1.setQty(subtractOutQty); |
|
|
|
transactionDO1.setType(inLocation.getType()); |
|
|
|
transactionDO1.setInventoryAction(TransactionEnum.INOUT.getCode()); |
|
|
|
list.add(transactionDO1); |
|
|
|
} |
|
|
|
if (inQty.compareTo(BigDecimal.ZERO) > 0 && inQty.compareTo(subtractOutQty) < 0) {//账内库存在且不足差额需要清空账内
|
|
|
@ -98,6 +100,7 @@ public interface ItemAccountsMapper extends BaseMapperX<ItemAccountsDO> { |
|
|
|
TransactionDO transactionDO0 = new TransactionDO(); |
|
|
|
transactionDO0.setQty(inQty); |
|
|
|
transactionDO0.setType(inLocation.getType()); |
|
|
|
transactionDO0.setInventoryAction(TransactionEnum.INOUT.getCode()); |
|
|
|
list.add(transactionDO0); |
|
|
|
BigDecimal subtractInQty = subtractOutQty.subtract(inQty);//减去之后的数量
|
|
|
|
if (newQty.compareTo(BigDecimal.ZERO) > 0 && newQty.compareTo(subtractInQty) >= 0) {//新到货存在且足够差额
|
|
|
@ -108,6 +111,7 @@ public interface ItemAccountsMapper extends BaseMapperX<ItemAccountsDO> { |
|
|
|
TransactionDO transactionDO2 = new TransactionDO(); |
|
|
|
transactionDO2.setQty(subtractInQty); |
|
|
|
transactionDO2.setType(newLocation.getType()); |
|
|
|
transactionDO2.setInventoryAction(TransactionEnum.NEWOUT.getCode()); |
|
|
|
list.add(transactionDO2); |
|
|
|
} else { |
|
|
|
throw exception(COUNT_IS_HAVA); |
|
|
@ -122,6 +126,7 @@ public interface ItemAccountsMapper extends BaseMapperX<ItemAccountsDO> { |
|
|
|
TransactionDO transactionDO3 = new TransactionDO(); |
|
|
|
transactionDO3.setQty(subtractOutQty); |
|
|
|
transactionDO3.setType(newLocation.getType()); |
|
|
|
transactionDO3.setInventoryAction(TransactionEnum.NEWOUT.getCode()); |
|
|
|
list.add(transactionDO3); |
|
|
|
} else { |
|
|
|
throw exception(COUNT_IS_HAVA); |
|
|
@ -137,6 +142,7 @@ public interface ItemAccountsMapper extends BaseMapperX<ItemAccountsDO> { |
|
|
|
TransactionDO transactionDO4 = new TransactionDO(); |
|
|
|
transactionDO4.setQty(qtyNew); |
|
|
|
transactionDO4.setType(inLocation.getType()); |
|
|
|
transactionDO4.setInventoryAction(TransactionEnum.INOUT.getCode()); |
|
|
|
list.add(transactionDO4); |
|
|
|
} |
|
|
|
if (inQty.compareTo(BigDecimal.ZERO) > 0 && inQty.compareTo(qtyNew) < 0) {//账内库存在且不足差额清空
|
|
|
@ -146,6 +152,7 @@ public interface ItemAccountsMapper extends BaseMapperX<ItemAccountsDO> { |
|
|
|
TransactionDO transactionDO5 = new TransactionDO(); |
|
|
|
transactionDO5.setQty(inQty); |
|
|
|
transactionDO5.setType(inLocation.getType()); |
|
|
|
transactionDO5.setInventoryAction(TransactionEnum.INOUT.getCode()); |
|
|
|
list.add(transactionDO5); |
|
|
|
BigDecimal subtractInQty = qtyNew.subtract(inQty);//减去之后的数量
|
|
|
|
if (newQty.compareTo(BigDecimal.ZERO) > 0 && newQty.compareTo(subtractInQty) >= 0) {//新到货存在且足够差额
|
|
|
@ -156,6 +163,7 @@ public interface ItemAccountsMapper extends BaseMapperX<ItemAccountsDO> { |
|
|
|
TransactionDO transactionDO6 = new TransactionDO(); |
|
|
|
transactionDO6.setQty(subtractInQty); |
|
|
|
transactionDO6.setType(newLocation.getType()); |
|
|
|
transactionDO6.setInventoryAction(TransactionEnum.NEWOUT.getCode()); |
|
|
|
list.add(transactionDO6); |
|
|
|
} else { |
|
|
|
throw exception(COUNT_IS_HAVA); |
|
|
@ -170,6 +178,7 @@ public interface ItemAccountsMapper extends BaseMapperX<ItemAccountsDO> { |
|
|
|
TransactionDO transactionDO7 = new TransactionDO(); |
|
|
|
transactionDO7.setQty(qtyNew); |
|
|
|
transactionDO7.setType(newLocation.getType()); |
|
|
|
transactionDO7.setInventoryAction(TransactionEnum.NEWOUT.getCode()); |
|
|
|
list.add(transactionDO7); |
|
|
|
} else { |
|
|
|
throw exception(COUNT_IS_HAVA); |
|
|
@ -184,6 +193,7 @@ public interface ItemAccountsMapper extends BaseMapperX<ItemAccountsDO> { |
|
|
|
TransactionDO transactionDO8 = new TransactionDO(); |
|
|
|
transactionDO8.setQty(qtyNew); |
|
|
|
transactionDO8.setType(outLocation.getType()); |
|
|
|
transactionDO8.setInventoryAction(TransactionEnum.INOUT.getCode()); |
|
|
|
list.add(transactionDO8); |
|
|
|
} |
|
|
|
} else {//非领用出库
|
|
|
|