|
|
@@ -156,7 +156,7 @@ public class InboundOtherService extends BaseService<Inbound> {
|
|
|
.setIntoAmt(BigDecimal.ZERO);
|
|
|
}
|
|
|
//成本单价
|
|
|
- inboundItemVO.setCostPrice(inboundItemVO.getCostPrice());
|
|
|
+ inboundItemVO.setCostPrice(inboundItemVO.getPriceInto());
|
|
|
//成本金额
|
|
|
inboundItemVO.setCostAmt((inboundItemVO.getIntoingQty().add(inboundItemVO.getIntoQty())).multiply(inboundItemVO.getPriceInto()).setScale(2, BigDecimal.ROUND_HALF_UP));
|
|
|
//库存数量 已入库-出库
|
|
|
@@ -257,20 +257,13 @@ public class InboundOtherService extends BaseService<Inbound> {
|
|
|
InboundResponse inboundResponse = inboundMapper.selectById(inboundVO.getIntoId());
|
|
|
BigDecimal sumIntoQty = inboundVO.getItemList().stream().map(InboundItemVO::getIntoQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(6, BigDecimal.ROUND_HALF_UP);
|
|
|
BigDecimal sumIntoAmt = inboundVO.getItemList().stream().map(InboundItemVO::getIntoAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
- BigDecimal sumIntoingQty = inboundVO.getItemList().stream().map(InboundItemVO::getIntoingQty).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(6, BigDecimal.ROUND_HALF_UP);
|
|
|
- BigDecimal sumIntoingAmt = inboundVO.getItemList().stream().map(InboundItemVO::getIntoAmt).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
inboundVO.setIntoQty(sumIntoQty);
|
|
|
inboundVO.setIntoAmt(sumIntoAmt);
|
|
|
- inboundVO.setIntoingQty(inboundResponse.getIntoingQty().subtract(sumIntoingQty));
|
|
|
- inboundVO.setIntoingAmt(inboundResponse.getIntoingAmt().subtract(sumIntoingAmt));
|
|
|
- //已入库数量==入库中数量 入库完成
|
|
|
- if (inboundVO.getIntoQty().compareTo(inboundVO.getIntoingQty()) == 0) {
|
|
|
- //已入库
|
|
|
- inboundVO.setIntoStatus(Constant.IntoStatus.YIRUKU.getName());
|
|
|
- } else {
|
|
|
- //入库中
|
|
|
- inboundVO.setIntoStatus(Constant.IntoStatus.RUKUZHONG.getName());
|
|
|
- }
|
|
|
+ inboundVO.setIntoingQty(inboundResponse.getIntoingQty().subtract(sumIntoQty));
|
|
|
+ inboundVO.setIntoingAmt(inboundResponse.getIntoingAmt().subtract(sumIntoAmt));
|
|
|
+ //入库状态
|
|
|
+ String intoStatus = this.setIntoStatus(inboundVO.getIntoingQty(), inboundVO.getIntoQty());
|
|
|
+ inboundVO.setIntoStatus(intoStatus);
|
|
|
//实体转换
|
|
|
Inbound inbound = inboundConvert.convertToPo(inboundVO);
|
|
|
//修改
|