盘点确认数量不一致时,更新库存
This commit is contained in:
parent
acc7afcd13
commit
22fdaa6df3
|
|
@ -13,7 +13,8 @@ public enum StockUpdateReasonEnum {
|
||||||
KITTING_UPDATE("备料拣选更新"),
|
KITTING_UPDATE("备料拣选更新"),
|
||||||
CONFIRM_UPDATE("站台确认更新"),
|
CONFIRM_UPDATE("站台确认更新"),
|
||||||
CONFIRM_DELETE("站台处理箱料错误"),
|
CONFIRM_DELETE("站台处理箱料错误"),
|
||||||
CLC_NO_PLAN_UPDATE("直接物料非计划领料回库更新");
|
CLC_NO_PLAN_UPDATE("直接物料非计划领料回库更新"),
|
||||||
|
INV_CONFIRM("盘点确认数量不一致更新");
|
||||||
|
|
||||||
StockUpdateReasonEnum(String reason) {
|
StockUpdateReasonEnum(String reason) {
|
||||||
this.reason = reason;
|
this.reason = reason;
|
||||||
|
|
|
||||||
|
|
@ -3400,6 +3400,19 @@ public class TaskController {
|
||||||
.apply("goods_related ->> '$.goodsId' = {0}" + MYSQL_JSON_CI, confirmRequest.getGoodsId())
|
.apply("goods_related ->> '$.goodsId' = {0}" + MYSQL_JSON_CI, confirmRequest.getGoodsId())
|
||||||
.eq(Stock::getVehicleId, confirmRequest.getVehicleId())
|
.eq(Stock::getVehicleId, confirmRequest.getVehicleId())
|
||||||
.last("limit 1"));
|
.last("limit 1"));
|
||||||
|
// 更新库存数量
|
||||||
|
if (existStock != null && existStock.getGoodsRelated() != null) {
|
||||||
|
if (confirmRequest.getConfirmNum().compareTo(existStock.getGoodsRelated().getRemainNum()) != 0) {
|
||||||
|
Stock originStock = BeanUtil.copyProperties(existStock, Stock.class);
|
||||||
|
BigDecimal quantityBefore = originStock.getGoodsRelated().getRemainNum();
|
||||||
|
StockDetailInfo goodsDetail = existStock.getGoodsRelated();
|
||||||
|
// 更新库存
|
||||||
|
goodsDetail.setRemainNum(confirmRequest.getConfirmNum());
|
||||||
|
existStock.setGoodsRelated(goodsDetail);
|
||||||
|
stockService.updateById(existStock);
|
||||||
|
stockUpdateRecordService.addStockUpdateRecord(originStock, existStock, StockUpdateReasonEnum.INV_CONFIRM.getReason(), confirmRequest.getUserName(), quantityBefore);
|
||||||
|
}
|
||||||
|
}
|
||||||
// 保存盘点记录
|
// 保存盘点记录
|
||||||
List<InventoryHistory> historyList = new ArrayList<>();
|
List<InventoryHistory> historyList = new ArrayList<>();
|
||||||
for (InventoryList inventoryList : currentGoodsInvList) {
|
for (InventoryList inventoryList : currentGoodsInvList) {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,14 @@
|
||||||
package com.wms.entity.app.dto.extend;
|
package com.wms.entity.app.dto.extend;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class StockDetailInfo {
|
public class StockDetailInfo {
|
||||||
/**
|
/**
|
||||||
* 物料编号
|
* 物料编号
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user