Quellcode durchsuchen

国内贸易销售订单明细导入导出修改

lazhaoqian vor 3 Jahren
Ursprung
Commit
ee2d0670b2

+ 6 - 0
blade-service/blade-client/pom.xml

@@ -119,6 +119,12 @@
                 </exclusion>
             </exclusions>
         </dependency>
+        <dependency>
+            <groupId>org.springblade</groupId>
+            <artifactId>blade-stock-api</artifactId>
+            <version>2.8.2.RELEASE</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>
 
 

+ 16 - 0
blade-service/blade-client/src/main/java/org/springblade/client/goods/controller/GoodsDescController.java

@@ -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);
 			});
 		}

+ 11 - 1
blade-service/blade-client/src/main/java/org/springblade/client/goods/excel/GoodsOutExcel.java

@@ -4,8 +4,11 @@ import com.alibaba.excel.annotation.ExcelProperty;
 import com.alibaba.excel.annotation.write.style.ColumnWidth;
 import com.alibaba.excel.annotation.write.style.ContentRowHeight;
 import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.math.BigDecimal;
+
 @Data
 @ColumnWidth(25)
 @HeadRowHeight(20)
@@ -20,7 +23,14 @@ public class GoodsOutExcel
 
 	@ExcelProperty("规格型号")
 	private String typeno;
-
+	/**
+	 * 库存数量
+	 */
+	@ExcelProperty("库存")
+	private BigDecimal storageQuantity;
+	/**
+	 * 数量
+	 */
 	@ExcelProperty("数量")
 	private String number;
 }

+ 18 - 2
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/excel/OrderItemsExcel.java

@@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth;
 import com.alibaba.excel.annotation.write.style.ContentRowHeight;
 import com.alibaba.excel.annotation.write.style.HeadRowHeight;
 import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -23,11 +24,26 @@ public class OrderItemsExcel   implements Serializable {
 	/**
 	 * 商品编码
 	 */
-	@ExcelProperty(value = "商品编码")
+	@ExcelProperty(value = "大字")
 	private String code;
 	/**
+	 * 花纹
+	 */
+	@ExcelProperty("花纹")
+	private String brandItem;
+	/**
+	 * 规格型号
+	 */
+	@ExcelProperty("规格型号")
+	private String typeno;
+	/**
+	 * 库存数量
+	 */
+	@ExcelProperty("库存")
+	private BigDecimal storageQuantity;
+	/**
 	 * 订货数量
 	 */
-	@ExcelProperty(value = "订货数量")
+	@ExcelProperty(value = "数量")
 	private BigDecimal orderQuantity;
 }