diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/adjust/cost/StockCostAdjustProductBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/adjust/cost/StockCostAdjustProductBo.java index a4a6295..1dfbba2 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/adjust/cost/StockCostAdjustProductBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/adjust/cost/StockCostAdjustProductBo.java @@ -81,6 +81,24 @@ public class StockCostAdjustProductBo extends BaseBo @ApiModelProperty("调价前成本价") private BigDecimal oriPrice; + /** + * 供应商id + */ + @ApiModelProperty("供应商id") + private String supplierId; + + /** + * 供应商编号 + */ + @ApiModelProperty("供应商编号") + private String supplierCode; + + /** + * 供应商名称 + */ + @ApiModelProperty("供应商名称") + private String supplierName; + public StockCostAdjustProductBo() { } @@ -96,5 +114,8 @@ public class StockCostAdjustProductBo extends BaseBo this.productId = dto.getId(); this.productCode = dto.getCode(); this.productName = dto.getName(); + this.supplierId = dto.getSupplierId(); + this.supplierCode = dto.getSupplierCode(); + this.supplierName = dto.getSupplierName(); } } diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/adjust/cost/StockCostAdjustSheetFullBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/adjust/cost/StockCostAdjustSheetFullBo.java index f692ab6..63956b4 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/adjust/cost/StockCostAdjustSheetFullBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/adjust/cost/StockCostAdjustSheetFullBo.java @@ -4,18 +4,17 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; import com.lframework.starter.common.constants.StringPool; import com.lframework.starter.common.utils.NumberUtil; +import com.lframework.starter.common.utils.ObjectUtil; import com.lframework.starter.common.utils.StringUtil; import com.lframework.starter.web.bo.BaseBo; import com.lframework.starter.web.common.utils.ApplicationUtil; import com.lframework.starter.web.utils.EnumUtil; -import com.lframework.xingyun.basedata.entity.Product; -import com.lframework.xingyun.basedata.entity.ProductBrand; -import com.lframework.xingyun.basedata.entity.ProductCategory; -import com.lframework.xingyun.basedata.entity.StoreCenter; +import com.lframework.xingyun.basedata.entity.*; import com.lframework.xingyun.basedata.service.product.ProductBrandService; import com.lframework.xingyun.basedata.service.product.ProductCategoryService; import com.lframework.xingyun.basedata.service.product.ProductService; import com.lframework.xingyun.basedata.service.storecenter.StoreCenterService; +import com.lframework.xingyun.basedata.service.supplier.SupplierService; import com.lframework.xingyun.sc.dto.stock.adjust.cost.StockCostAdjustSheetFullDto; import com.lframework.xingyun.sc.entity.ProductStock; import com.lframework.xingyun.sc.enums.StockCostAdjustSheetStatus; @@ -266,6 +265,24 @@ public class StockCostAdjustSheetFullBo extends BaseBo { @ApiModelProperty(hidden = true) private String scId; + /** + * 供应商id + */ + @ApiModelProperty("供应商id") + private String supplierId; + + /** + * 供应商编号 + */ + @ApiModelProperty("供应商编号") + private String supplierCode; + + /** + * 供应商名称 + */ + @ApiModelProperty("供应商名称") + private String supplierName; + public StockAdjustProductBo() { } @@ -101,5 +119,9 @@ public class StockAdjustProductBo extends BaseBo { ProductStock productStock = productStockService.getByProductIdAndScId(dto.getId(), this.scId); this.curStockNum = productStock == null ? 0 : productStock.getStockNum(); + + this.supplierId = dto.getSupplierId(); + this.supplierCode = dto.getSupplierCode(); + this.supplierName = dto.getSupplierName(); } } diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/adjust/stock/StockAdjustSheetFullBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/adjust/stock/StockAdjustSheetFullBo.java index 8955330..ae68b78 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/adjust/stock/StockAdjustSheetFullBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/adjust/stock/StockAdjustSheetFullBo.java @@ -3,19 +3,18 @@ package com.lframework.xingyun.sc.bo.stock.adjust.stock; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonIgnore; import com.lframework.starter.common.constants.StringPool; +import com.lframework.starter.common.utils.ObjectUtil; import com.lframework.starter.common.utils.StringUtil; import com.lframework.starter.web.annotations.convert.EnumConvert; import com.lframework.starter.web.bo.BaseBo; import com.lframework.starter.web.common.utils.ApplicationUtil; import com.lframework.starter.web.utils.EnumUtil; -import com.lframework.xingyun.basedata.entity.Product; -import com.lframework.xingyun.basedata.entity.ProductBrand; -import com.lframework.xingyun.basedata.entity.ProductCategory; -import com.lframework.xingyun.basedata.entity.StoreCenter; +import com.lframework.xingyun.basedata.entity.*; import com.lframework.xingyun.basedata.service.product.ProductBrandService; import com.lframework.xingyun.basedata.service.product.ProductCategoryService; import com.lframework.xingyun.basedata.service.product.ProductService; import com.lframework.xingyun.basedata.service.storecenter.StoreCenterService; +import com.lframework.xingyun.basedata.service.supplier.SupplierService; import com.lframework.xingyun.sc.dto.stock.adjust.stock.StockAdjustSheetFullDto; import com.lframework.xingyun.sc.entity.ProductStock; import com.lframework.xingyun.sc.entity.StockAdjustReason; @@ -269,6 +268,24 @@ public class StockAdjustSheetFullBo extends BaseBo { @ApiModelProperty(hidden = true) private Integer status; + /** + * 供应商id + */ + @ApiModelProperty("供应商id") + private String supplierId; + + /** + * 供应商编号 + */ + @ApiModelProperty("供应商编号") + private String supplierCode; + + /** + * 供应商名称 + */ + @ApiModelProperty("供应商名称") + private String supplierName; + public DetailBo(StockAdjustSheetFullDto.DetailDto dto, String scId, Integer status) { this.scId = scId; @@ -315,6 +332,16 @@ public class StockAdjustSheetFullBo extends BaseBo { this.scId); this.curStockNum = productStock == null ? 0 : productStock.getStockNum(); } + + + SupplierService supplierService = ApplicationUtil.getBean(SupplierService.class); + Supplier supplier = supplierService.findById(product.getSupplierId()); + + if (ObjectUtil.isNotNull(supplier)) { + this.supplierCode = supplier.getCode(); + this.supplierName = supplier.getName(); + this.supplierId = supplier.getId(); + } } } } diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/stock/adjust/cost/StockCostAdjustProductDto.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/stock/adjust/cost/StockCostAdjustProductDto.java index c39774e..533c520 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/stock/adjust/cost/StockCostAdjustProductDto.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/stock/adjust/cost/StockCostAdjustProductDto.java @@ -79,4 +79,18 @@ public class StockCostAdjustProductDto implements BaseDto, Serializable { * 调价前成本价 */ private BigDecimal oriPrice; + /** + * 供应商id + */ + private String supplierId; + + /** + * 供应商编号 + */ + private String supplierCode; + + /** + * 供应商名称 + */ + private String supplierName; } diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/stock/adjust/stock/StockAdjustProductDto.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/stock/adjust/stock/StockAdjustProductDto.java index b3efb21..9f06c8c 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/stock/adjust/stock/StockAdjustProductDto.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/stock/adjust/stock/StockAdjustProductDto.java @@ -2,6 +2,8 @@ package com.lframework.xingyun.sc.dto.stock.adjust.stock; import com.lframework.starter.web.dto.BaseDto; import java.io.Serializable; + +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @@ -68,4 +70,19 @@ public class StockAdjustProductDto implements BaseDto, Serializable { * 当前库存数量 */ private Integer curStockNum; + + /** + * 供应商id + */ + private String supplierId; + + /** + * 供应商编号 + */ + private String supplierCode; + + /** + * 供应商名称 + */ + private String supplierName; } diff --git a/xingyun-sc/src/main/resources/mappers/stock/adjust/StockAdjustSheetMapper.xml b/xingyun-sc/src/main/resources/mappers/stock/adjust/StockAdjustSheetMapper.xml index 4027e69..e1a166b 100644 --- a/xingyun-sc/src/main/resources/mappers/stock/adjust/StockAdjustSheetMapper.xml +++ b/xingyun-sc/src/main/resources/mappers/stock/adjust/StockAdjustSheetMapper.xml @@ -36,6 +36,9 @@ + + + @@ -81,11 +84,15 @@ g.sku_code, g.external_code, g.spec, - g.unit + g.unit, + g.supplier_id, + s.code AS supplier_code, + s.name AS supplier_name FROM base_data_product AS g LEFT JOIN base_data_product_category AS c ON c.id = g.category_id LEFT JOIN base_data_product_brand AS b ON b.id = g.brand_id LEFT JOIN recursion_mapping AS rm ON rm.node_id = c.id and rm.node_type = 2 + LEFT JOIN base_data_supplier AS s ON s.id = g.supplier_id