|
@@ -456,13 +456,13 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
Map<Integer, Goods> idTempGoodsMap = tempGoodsList.stream().collect(Collectors.toMap(Goods::getId, g -> g));
|
|
|
List<GoodsProcurement> goodsProcurements = new ArrayList<>();
|
|
|
for (Integer goodsId : goodsIds) {
|
|
|
- Goods tempGoods = goodsDao.lock(goodsId);
|
|
|
+ Goods tempGoods = idTempGoodsMap.get(goodsId);
|
|
|
List<Goods> childGoods = new ArrayList<>();
|
|
|
if(StringUtils.isBlank(tempGoods.getComplementGoodsIdList())){
|
|
|
childGoods.add(tempGoods);
|
|
|
}else{
|
|
|
List<Integer> complementGoodsIds = Arrays.stream(tempGoods.getComplementGoodsIdList().split(",")).map(s -> Integer.valueOf(s)).collect(Collectors.toList());
|
|
|
- childGoods = goodsDao.getGoodies(complementGoodsIds);
|
|
|
+ childGoods = goodsDao.lockGoods(complementGoodsIds);
|
|
|
}
|
|
|
for (Goods goods : childGoods) {
|
|
|
GoodsProcurement goodsProcurement = null;
|