|
|
@@ -607,10 +607,12 @@ public class InventoryService extends BaseService<Inventory> {
|
|
|
inOutRecordVO.setPriceInto(outboundItemCostResponses.get(0).getCostPrice());
|
|
|
//金额
|
|
|
inOutRecordVO.setIntoAmt(outboundItemCostResponses.get(0).getCostPrice().multiply(inOutRecordVO.getIntoQty()).abs());
|
|
|
- } else {
|
|
|
- //当前销售退货单无法获取源出库单数据
|
|
|
- throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.UNABLE_TO_OBTAIN_SOURCE_DATA.getMessage());
|
|
|
}
|
|
|
+ //todo 2024年5月31日16:00:21 编辑的情况 先删后加 所以此处查不到数据 在删除的时候赋值
|
|
|
+// else {
|
|
|
+// //当前销售退货单无法获取源出库单数据
|
|
|
+// throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.UNABLE_TO_OBTAIN_SOURCE_DATA.getMessage());
|
|
|
+// }
|
|
|
}
|
|
|
//endregion
|
|
|
|
|
|
@@ -640,6 +642,7 @@ public class InventoryService extends BaseService<Inventory> {
|
|
|
}
|
|
|
//region 库存存在
|
|
|
else {
|
|
|
+ //todo 2024年5月31日16:00:21 编辑的情况 先删后加 所以此处查不到数据 在删除的时候赋值
|
|
|
//region 根据源出库单明细Id 去出库成本里去查价格
|
|
|
if (inOutRecordVO.getSOutItemId() != null) {
|
|
|
List<OutboundItemCostResponse> outboundItemCostResponses = outboundItemCostMapper.selectByCond(new OutboundItemCostQuery().setOutItemId(inOutRecordVO.getSOutItemId()));
|
|
|
@@ -649,10 +652,12 @@ public class InventoryService extends BaseService<Inventory> {
|
|
|
//金额
|
|
|
inOutRecordVO.setIntoAmt(outboundItemCostResponses.get(0).getCostPrice().multiply(inOutRecordVO.getIntoQty()).abs());
|
|
|
|
|
|
- } else {
|
|
|
- //当前销售退货单无法获取源出库单数据
|
|
|
- throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.UNABLE_TO_OBTAIN_SOURCE_DATA.getMessage());
|
|
|
}
|
|
|
+ //todo 2024年5月31日16:00:21 编辑的情况 先删后加 所以此处查不到数据 在删除的时候赋值
|
|
|
+// else {
|
|
|
+// //当前销售退货单无法获取源出库单数据
|
|
|
+// throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.UNABLE_TO_OBTAIN_SOURCE_DATA.getMessage());
|
|
|
+// }
|
|
|
}
|
|
|
//endregion
|
|
|
|
|
|
@@ -702,7 +707,7 @@ public class InventoryService extends BaseService<Inventory> {
|
|
|
)
|
|
|
public void operatingUpdateInventory(List<InOutRecordVO> inOutRecordVOList) {
|
|
|
//先删后加
|
|
|
- this.deleteInventory(inOutRecordVOList);
|
|
|
+ inOutRecordVOList = this.deleteInventory(inOutRecordVOList);
|
|
|
//新建
|
|
|
inOutRecordVOList = this.operatingInsertInventory(inOutRecordVOList);
|
|
|
//入库
|
|
|
@@ -1107,7 +1112,7 @@ public class InventoryService extends BaseService<Inventory> {
|
|
|
@Transactional(
|
|
|
rollbackFor = {Exception.class}
|
|
|
)
|
|
|
- public void deleteInventory(List<InOutRecordVO> inOutRecordVOList) {
|
|
|
+ public List<InOutRecordVO> deleteInventory(List<InOutRecordVO> inOutRecordVOList) {
|
|
|
for (InOutRecordVO inOutRecordVO : inOutRecordVOList) {
|
|
|
//region 校验库存 根据sku,仓库,非标号查询
|
|
|
InventoryResponse inventoryResponse = inventoryMapper.selectByOther(new InventoryQuery()
|
|
|
@@ -1165,6 +1170,10 @@ public class InventoryService extends BaseService<Inventory> {
|
|
|
inventoryBatch.setCostAmt(inventoryBatchResponse.getInvQty().multiply(outboundItemCostResponse.getCostPrice()));
|
|
|
inventoryBatchMapper.updateAmtAndQty(inventoryBatch);
|
|
|
}
|
|
|
+ //出库单价
|
|
|
+ inOutRecordVO.setPriceInto(outboundItemCostResponses.get(0).getCostPrice());
|
|
|
+ //金额
|
|
|
+ inOutRecordVO.setIntoAmt(outboundItemCostResponses.get(0).getCostPrice().multiply(inOutRecordVO.getIntoQty()).abs());
|
|
|
}
|
|
|
//endregion
|
|
|
|
|
|
@@ -1194,8 +1203,8 @@ public class InventoryService extends BaseService<Inventory> {
|
|
|
outboundItemCostMapper.deleteData(inOutRecordVO.getBiznisItemId());
|
|
|
}
|
|
|
//endregion
|
|
|
-
|
|
|
}
|
|
|
+ return inOutRecordVOList;
|
|
|
}
|
|
|
|
|
|
/**
|