|
@@ -81,6 +81,8 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
|
|
item.setProductSpec(productInfo.getSpec());
|
|
item.setProductSpec(productInfo.getSpec());
|
|
item.setProductClassifyId(productInfo.getProductClassifyId());
|
|
item.setProductClassifyId(productInfo.getProductClassifyId());
|
|
item.setProductDefinition(productInfo.getDefinition());
|
|
item.setProductDefinition(productInfo.getDefinition());
|
|
|
|
+ //赋值结存单价
|
|
|
|
+ item.setUnitPrice(productInfo.getUnitPrice());
|
|
});
|
|
});
|
|
//赋值产品分类
|
|
//赋值产品分类
|
|
productClassifyService.attributeAssign(stockVos, StockVo::getProductClassifyId, (item, productClassify) -> {
|
|
productClassifyService.attributeAssign(stockVos, StockVo::getProductClassifyId, (item, productClassify) -> {
|
|
@@ -358,10 +360,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
|
|
//判断传操作的库存是否为空 空赋值0
|
|
//判断传操作的库存是否为空 空赋值0
|
|
stock.setQuantity(BigDecimal.ZERO);
|
|
stock.setQuantity(BigDecimal.ZERO);
|
|
}
|
|
}
|
|
- if (ObjectUtil.isEmpty(stock.getFrozenQuantity())) {
|
|
|
|
- //判断传操作的冻结库存是否为空 空赋值0
|
|
|
|
- stock.setFrozenQuantity(BigDecimal.ZERO);
|
|
|
|
- }
|
|
|
|
newStocks.setQuantity(stock.getQuantity());
|
|
newStocks.setQuantity(stock.getQuantity());
|
|
|
|
|
|
//合并库存数量
|
|
//合并库存数量
|
|
@@ -369,7 +367,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
|
|
//用来存储操作数据
|
|
//用来存储操作数据
|
|
if (ObjectUtil.isNotEmpty(oldStocks)) {
|
|
if (ObjectUtil.isNotEmpty(oldStocks)) {
|
|
BigDecimal quantity = oldStocks.getQuantity();
|
|
BigDecimal quantity = oldStocks.getQuantity();
|
|
- BigDecimal oldFrozenQuantity = oldStocks.getFrozenQuantity();
|
|
|
|
if (type == 1) {
|
|
if (type == 1) {
|
|
//入库库存相加
|
|
//入库库存相加
|
|
quantity = quantity.add(stock.getQuantity());
|
|
quantity = quantity.add(stock.getQuantity());
|
|
@@ -379,10 +376,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
|
|
if (quantity.compareTo(BigDecimal.ZERO) < 0) {
|
|
if (quantity.compareTo(BigDecimal.ZERO) < 0) {
|
|
throw new ServiceException("库存不足无法出库");
|
|
throw new ServiceException("库存不足无法出库");
|
|
}
|
|
}
|
|
- oldFrozenQuantity = oldFrozenQuantity.subtract(stock.getFrozenQuantity());
|
|
|
|
- if (oldFrozenQuantity.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
|
- throw new ServiceException("冻结库存不足无法出库");
|
|
|
|
- }
|
|
|
|
} else if (type == 3) {
|
|
} else if (type == 3) {
|
|
//维多利亚入库增加冻结库存
|
|
//维多利亚入库增加冻结库存
|
|
String victoriatouristJson = oldStocks.getVictoriatouristJson();
|
|
String victoriatouristJson = oldStocks.getVictoriatouristJson();
|
|
@@ -397,7 +390,6 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
|
|
}
|
|
}
|
|
newStocks.setId(oldStocks.getId());
|
|
newStocks.setId(oldStocks.getId());
|
|
newStocks.setQuantity(quantity);
|
|
newStocks.setQuantity(quantity);
|
|
- newStocks.setFrozenQuantity(oldFrozenQuantity);
|
|
|
|
} else if (type == 2) {
|
|
} else if (type == 2) {
|
|
ProductInfo productInfo = productInfoService.getById(stock.getProductId());
|
|
ProductInfo productInfo = productInfoService.getById(stock.getProductId());
|
|
if (productInfo == null) {
|
|
if (productInfo == null) {
|