|
|
@@ -49,6 +49,8 @@ import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.secure.utils.SecureUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
+import org.springblade.stock.entity.StockGoods;
|
|
|
+import org.springblade.stock.feign.IStockGoodsClient;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
@@ -57,6 +59,7 @@ import org.springblade.client.vo.GoodsDescVO;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
@@ -83,6 +86,8 @@ public class GoodsDescController extends BladeController {
|
|
|
private IGoodsSpecificationService goodsSpecificationService;
|
|
|
|
|
|
private final IGoodsTypeService goodsDescType;
|
|
|
+
|
|
|
+ private final IStockGoodsClient stockGoodsClient;//库存接口
|
|
|
/**
|
|
|
* 详情
|
|
|
*/
|
|
|
@@ -376,6 +381,17 @@ public class GoodsDescController extends BladeController {
|
|
|
goodsDescs.forEach(e->{
|
|
|
GoodsOutExcel goodsOutExcel=new GoodsOutExcel();
|
|
|
BeanUtils.copyProperties(e,goodsOutExcel);
|
|
|
+ //查询库存
|
|
|
+ StockGoods stockGoods = new StockGoods();
|
|
|
+ stockGoods.setGoodsId(e.getId());
|
|
|
+ stockGoods.setTradeType("GN");
|
|
|
+ stockGoods.setItemType(e.getTypeno());
|
|
|
+ R<?> stock = stockGoodsClient.getStock(stockGoods);
|
|
|
+ if (stock.isSuccess()){
|
|
|
+ goodsOutExcel.setStorageQuantity((BigDecimal) stock.getData());
|
|
|
+ }else {
|
|
|
+ goodsOutExcel.setStorageQuantity(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
list.add(goodsOutExcel);
|
|
|
});
|
|
|
}
|