|
|
@@ -3573,6 +3573,12 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
goods.setSelfSale("自营");
|
|
|
}
|
|
|
}
|
|
|
+ if (goods.getUuid() != null) {
|
|
|
+ Component component = componentDao.findByUuid(goods.getUuid());
|
|
|
+ if (component != null) {
|
|
|
+ goods.setAttach(component.getAttach());
|
|
|
+ }
|
|
|
+ }
|
|
|
return goods;
|
|
|
}
|
|
|
|
|
|
@@ -3645,10 +3651,30 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
} else {
|
|
|
goods.setSelfSale(StringConstant.SALE_SELF);
|
|
|
}
|
|
|
+ goods.setFrozen(getFrozenCount(goods.getBatchCode()));
|
|
|
}
|
|
|
return page;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取未发货前订单的库存数
|
|
|
+ * @param batchCode
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private int getFrozenCount(String batchCode) {
|
|
|
+ String statusStr = OrderStatus.TOBEPAID.getCodes() + SplitChar.HYPHEN + OrderStatus.TOBEDELIVER.getCodes();
|
|
|
+ List<Integer> statusList = new ArrayList<>();
|
|
|
+ for (String str : statusStr.split(SplitChar.HYPHEN)) {
|
|
|
+ statusList.add(Integer.valueOf(str));
|
|
|
+ }
|
|
|
+ List<OrderDetail> detailList = orderDetailDao.findByBatchInStatus(batchCode, statusList);
|
|
|
+ int stock = 0;
|
|
|
+ for (OrderDetail detail : detailList) {
|
|
|
+ stock += detail.getNumber();
|
|
|
+ }
|
|
|
+ return stock;
|
|
|
+ }
|
|
|
+
|
|
|
private void convertPageInfo(PageInfo info, GoodsFilter goodsFilter) {
|
|
|
if (!StringUtils.isEmpty(goodsFilter.getCode())) {
|
|
|
info.filter("code", goodsFilter.getCode());
|