|
|
|
@ -1014,13 +1014,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// 重新计算总额
|
|
|
|
inventory.setAmounts(inventory.getQuantity() * inventory.getPrice()); |
|
|
|
|
|
|
|
if (Integer.compare(inventory.getQuantity(), 0) != 0) { |
|
|
|
// 重新计算单价
|
|
|
|
BigDecimal decimal = BigDecimal.valueOf(inventory.getAmounts() / inventory.getQuantity()); |
|
|
|
Double price = decimal.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
|
|
|
inventory.setPrice(price); |
|
|
|
} |
|
|
|
|
|
|
|
// 修改库存记录
|
|
|
|
materialMapper.updateInventory(inventory); |
|
|
|
|
|
|
|
@ -1118,12 +1111,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// 重新计算总额
|
|
|
|
inventory.setAmounts(inventory.getQuantity() * inventory.getPrice()); |
|
|
|
|
|
|
|
if (Integer.compare(inventory.getQuantity(), 0) != 0) { |
|
|
|
// 重新计算单价
|
|
|
|
BigDecimal decimal = BigDecimal.valueOf(inventory.getAmounts() / inventory.getQuantity()); |
|
|
|
Double price = decimal.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
|
|
|
inventory.setPrice(price); |
|
|
|
} |
|
|
|
// 修改库存记录
|
|
|
|
materialMapper.updateInventory(inventory); |
|
|
|
|
|
|
|
@ -1178,12 +1165,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// 设置新库存
|
|
|
|
inventory.setQuantity(inventory.getQuantity() - residue - 1); |
|
|
|
|
|
|
|
if (Integer.compare(inventory.getQuantity(), 0) != 0) { |
|
|
|
// 重新计算单价
|
|
|
|
BigDecimal decimal = BigDecimal.valueOf(inventory.getAmounts() / inventory.getQuantity()); |
|
|
|
Double price = decimal.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
|
|
|
inventory.setPrice(price); |
|
|
|
} |
|
|
|
//更新库存
|
|
|
|
materialMapper.updateInventory(inventory); |
|
|
|
|
|
|
|
@ -1427,12 +1408,6 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
// 重新设置总额
|
|
|
|
inventory.setAmounts(inventory.getAmounts() - inventory_quantity * inventory.getPrice()); |
|
|
|
|
|
|
|
if (Integer.compare(materialAndPlace.getQuantity(), 0) != 0) { |
|
|
|
// 重新计算单价
|
|
|
|
BigDecimal decimal = BigDecimal.valueOf(inventory.getAmounts() / inventory.getQuantity()); |
|
|
|
Double price = decimal.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
|
|
|
inventory.setPrice(price); |
|
|
|
} |
|
|
|
// 修改库存数量
|
|
|
|
materialMapper.updateInventory(inventory); |
|
|
|
placeMapper.updateMaterialAndPlace(materialAndPlace); |
|
|
|
@ -1463,12 +1438,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
inventory.setQuantity(inventory.getQuantity() - surplus_redundant); |
|
|
|
// 设置当前总额
|
|
|
|
inventory.setAmounts(inventory.getPrice() * inventory.getQuantity()); |
|
|
|
if (Integer.compare(inventory.getQuantity(), 0) != 0) { |
|
|
|
// 设置当前单价
|
|
|
|
BigDecimal decimal = BigDecimal.valueOf(inventory.getAmounts() / inventory.getQuantity()); |
|
|
|
Double price = decimal.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); |
|
|
|
inventory.setPrice(price); |
|
|
|
} |
|
|
|
|
|
|
|
// 修改库存数量
|
|
|
|
materialMapper.updateInventory(inventory); |
|
|
|
placeMapper.updateMaterialAndPlace(materialAndPlace); |
|
|
|
@ -3561,8 +3531,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { |
|
|
|
Double price = 0.0; |
|
|
|
// 数量
|
|
|
|
Integer count = 0; |
|
|
|
for (int i = 0; i < minList.size(); i++) { |
|
|
|
ApplicationOutRecordMin recordMin = minList.get(i); |
|
|
|
for (ApplicationOutRecordMin recordMin : minList) { |
|
|
|
count += recordMin.getQuantity(); |
|
|
|
// 获取当前出库物料
|
|
|
|
Inventory materialById = materialMapper.findInventoryById(recordMin.getMid()); |
|
|
|
|