|
@@ -142,7 +142,7 @@ public class InboundItemService extends BaseService<InboundItem> {
|
|
|
.setCostAmt(outCostAmt);
|
|
.setCostAmt(outCostAmt);
|
|
|
outboundItemMapper.updateOutCost(outboundItemQuery);
|
|
outboundItemMapper.updateOutCost(outboundItemQuery);
|
|
|
|
|
|
|
|
- outCostAmtTotal.add(outCostAmt);
|
|
|
|
|
|
|
+ outCostAmtTotal = outCostAmtTotal.add(outCostAmt);
|
|
|
//修改存货批次明细
|
|
//修改存货批次明细
|
|
|
InventoryBatchQuery inventoryBatchQuery = new InventoryBatchQuery()
|
|
InventoryBatchQuery inventoryBatchQuery = new InventoryBatchQuery()
|
|
|
.setBatchId(inventoryBatchResponse.getBatchId())
|
|
.setBatchId(inventoryBatchResponse.getBatchId())
|
|
@@ -211,11 +211,11 @@ public class InboundItemService extends BaseService<InboundItem> {
|
|
|
|
|
|
|
|
BigDecimal inventoryCostTotal = BigDecimal.ZERO;
|
|
BigDecimal inventoryCostTotal = BigDecimal.ZERO;
|
|
|
for(InventoryBatchResponse inventoryBatchResponse1 : inventoryBatchList){
|
|
for(InventoryBatchResponse inventoryBatchResponse1 : inventoryBatchList){
|
|
|
- inventoryCostTotal.add(inventoryBatchResponse1.getCostAmt());
|
|
|
|
|
|
|
+ inventoryCostTotal = inventoryCostTotal.add(inventoryBatchResponse1.getCostAmt());
|
|
|
}
|
|
}
|
|
|
Inventory inventory = new Inventory()
|
|
Inventory inventory = new Inventory()
|
|
|
.setInvId(inventoryBatchQuery.getInvId())
|
|
.setInvId(inventoryBatchQuery.getInvId())
|
|
|
- .setCostPrice(inventoryCostTotal.divide(inventoryResponse.getInvQty()).setScale(2, BigDecimal.ROUND_HALF_UP))
|
|
|
|
|
|
|
+ .setCostPrice(inventoryCostTotal.divide(inventoryResponse.getInvQty(),BigDecimal.ROUND_HALF_UP))
|
|
|
.setCostAmt(inventoryCostTotal);
|
|
.setCostAmt(inventoryCostTotal);
|
|
|
inventoryMapper.updateCost(inventory);
|
|
inventoryMapper.updateCost(inventory);
|
|
|
return ResponseResultUtil.success(inventoryBatchQuery);
|
|
return ResponseResultUtil.success(inventoryBatchQuery);
|