|
|
@@ -454,29 +454,29 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
Goods goods = findGoodsByBatchCode(batchCode);
|
|
|
if (goods == null) {
|
|
|
GoodsHistory history = goodsHistoryDao.findNewByBatchCode(batchCode);
|
|
|
- if(history.getSourceId() == null) {
|
|
|
- productStandardPutOnInfoService.updateAvailableQty(history.getStandprodid(), number);
|
|
|
- }
|
|
|
+// if(history.getSourceId() == null) {
|
|
|
+// productStandardPutOnInfoService.updateAvailableQty(history.getStandprodid(), number);
|
|
|
+// }
|
|
|
}else {
|
|
|
//更新相应标准上架和标准产品信息
|
|
|
- ResultMap resultMap = productStandardPutOnInfoService.updateOnSaleQty(goods, NumberUtil.add(goods.getReserve(), number));
|
|
|
- if(resultMap.getCode() != CodeType.OK.code()) {
|
|
|
- return resultMap;
|
|
|
+// ResultMap resultMap = productStandardPutOnInfoService.updateOnSaleQty(goods, NumberUtil.add(goods.getReserve(), number));
|
|
|
+// if(resultMap.getCode() != CodeType.OK.code()) {
|
|
|
+// return resultMap;
|
|
|
+// }
|
|
|
+ Double reserve = goods.getReserve() + number;
|
|
|
+ goods.setReserve(reserve);
|
|
|
+ // 检查是否大于最小发货量
|
|
|
+ if (reserve.doubleValue() >= goods.getMinBuyQty().doubleValue()) {
|
|
|
+ goods.setStatus(Status.AVAILABLE.value());
|
|
|
}
|
|
|
- }
|
|
|
- Double reserve = goods.getReserve() + number;
|
|
|
- goods.setReserve(reserve);
|
|
|
- // 检查是否大于最小发货量
|
|
|
- if (reserve.doubleValue() >= goods.getMinBuyQty().doubleValue()) {
|
|
|
- goods.setStatus(Status.AVAILABLE.value());
|
|
|
- }
|
|
|
|
|
|
- goodsDao.modifyReserve(goods.getBatchCode(), goods.getUuid(), goods.getReserve(), goods.getStatus().intValue());
|
|
|
- // 每次批次保存同时保存一遍历史信息
|
|
|
- GoodsHistory goodsHistory = goodsHistoryService.initByGoods(goods, GoodsHistory.OperateType.ReleaseReserve);
|
|
|
- goodsHistoryService.save(goodsHistory);
|
|
|
- // 更新器件属性的库存
|
|
|
- updateComponentTradeInfos(goods.getUuid());
|
|
|
+ goodsDao.modifyReserve(goods.getBatchCode(), goods.getUuid(), goods.getReserve(), goods.getStatus().intValue());
|
|
|
+ // 每次批次保存同时保存一遍历史信息
|
|
|
+ GoodsHistory goodsHistory = goodsHistoryService.initByGoods(goods, GoodsHistory.OperateType.ReleaseReserve);
|
|
|
+ goodsHistoryService.save(goodsHistory);
|
|
|
+ // 更新器件属性的库存
|
|
|
+ updateComponentTradeInfos(goods.getUuid());
|
|
|
+ }
|
|
|
return ResultMap.success(goods);
|
|
|
}
|
|
|
|