diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/take/plan/QueryTakeStockPlanProductBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/take/plan/QueryTakeStockPlanProductBo.java index f0826a5..9350338 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/take/plan/QueryTakeStockPlanProductBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/take/plan/QueryTakeStockPlanProductBo.java @@ -1,13 +1,16 @@ package com.lframework.xingyun.sc.bo.stock.take.plan; +import com.lframework.starter.common.utils.ObjectUtil; import com.lframework.starter.web.bo.BaseBo; import com.lframework.starter.web.common.utils.ApplicationUtil; 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.Supplier; 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.supplier.SupplierService; import com.lframework.xingyun.sc.dto.stock.take.plan.QueryTakeStockPlanProductDto; import com.lframework.xingyun.sc.entity.TakeStockConfig; import com.lframework.xingyun.sc.service.stock.take.TakeStockConfigService; @@ -77,6 +80,24 @@ public class QueryTakeStockPlanProductBo extends BaseBo { @JsonIgnore private String planId; + + /** + * 供应商id + */ + @ApiModelProperty("供应商id") + private String supplierId; + + /** + * 供应商编号 + */ + @ApiModelProperty("供应商编号") + private String supplierCode; + + /** + * 供应商名称 + */ + @ApiModelProperty("供应商名称") + private String supplierName; + public DetailBo(TakeStockPlanFullDto.DetailDto dto, String planId) { this.planId = planId; @@ -274,6 +292,15 @@ public class TakeStockPlanFullBo extends BaseBo { this.diffNum = this.oriTakeNum - this.stockNum; } } + + + 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/bo/stock/take/pre/GetPreTakeStockSheetBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/take/pre/GetPreTakeStockSheetBo.java index b0ef8da..9384369 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/take/pre/GetPreTakeStockSheetBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/take/pre/GetPreTakeStockSheetBo.java @@ -2,16 +2,15 @@ package com.lframework.xingyun.sc.bo.stock.take.pre; import com.fasterxml.jackson.annotation.JsonFormat; import com.lframework.starter.common.constants.StringPool; +import com.lframework.starter.common.utils.ObjectUtil; import com.lframework.starter.web.bo.BaseBo; import com.lframework.starter.web.common.utils.ApplicationUtil; -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.take.pre.PreTakeStockSheetFullDto; import io.swagger.annotations.ApiModelProperty; import java.time.LocalDateTime; @@ -165,6 +164,24 @@ public class GetPreTakeStockSheetBo extends BaseBo { @ApiModelProperty("抽盘数量") private Integer randNum; + /** + * 供应商id + */ + @ApiModelProperty("供应商id") + private String supplierId; + + /** + * 供应商编号 + */ + @ApiModelProperty("供应商编号") + private String supplierCode; + + /** + * 供应商名称 + */ + @ApiModelProperty("供应商名称") + private String supplierName; + public SheetDetailBo(PreTakeStockSheetFullDto.SheetDetailDto dto) { super(dto); @@ -192,6 +209,14 @@ public class GetPreTakeStockSheetBo extends BaseBo { this.externalCode = product.getExternalCode(); this.spec = product.getSpec(); this.unit = product.getUnit(); + + 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/bo/stock/take/pre/PreTakeStockProductBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/take/pre/PreTakeStockProductBo.java index afd5983..67a6215 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/take/pre/PreTakeStockProductBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/take/pre/PreTakeStockProductBo.java @@ -62,6 +62,25 @@ public class PreTakeStockProductBo extends BaseBo { @ApiModelProperty("单位") private String unit; + + /** + * 供应商id + */ + @ApiModelProperty("供应商id") + private String supplierId; + + /** + * 供应商编号 + */ + @ApiModelProperty("供应商编号") + private String supplierCode; + + /** + * 供应商名称 + */ + @ApiModelProperty("供应商名称") + private String supplierName; + public PreTakeStockProductBo() { } diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/take/pre/QueryPreTakeStockSheetProductBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/take/pre/QueryPreTakeStockSheetProductBo.java index d1d286d..13e81d7 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/take/pre/QueryPreTakeStockSheetProductBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/take/pre/QueryPreTakeStockSheetProductBo.java @@ -1,14 +1,17 @@ package com.lframework.xingyun.sc.bo.stock.take.pre; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.lframework.starter.common.utils.ObjectUtil; import com.lframework.starter.web.bo.BaseBo; import com.lframework.starter.web.common.utils.ApplicationUtil; 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.Supplier; 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.supplier.SupplierService; import com.lframework.xingyun.sc.dto.stock.take.pre.QueryPreTakeStockSheetProductDto; import com.lframework.xingyun.sc.entity.ProductStock; import com.lframework.xingyun.sc.entity.TakeStockConfig; @@ -94,6 +97,24 @@ public class QueryPreTakeStockSheetProductBo extends BaseBo { @ApiModelProperty("盘点任务ID") private String planId; + /** + * 供应商id + */ + @ApiModelProperty("供应商id") + private String supplierId; + + /** + * 供应商编号 + */ + @ApiModelProperty("供应商编号") + private String supplierCode; + + /** + * 供应商名称 + */ + @ApiModelProperty("供应商名称") + private String supplierName; + public SheetDetailBo(TakeStockSheetFullDto.SheetDetailDto dto, String planId) { this.planId = planId; @@ -346,6 +363,14 @@ public class TakeStockSheetFullBo extends BaseBo { this.planId, this.productId); this.stockNum = planDetail.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/bo/stock/take/sheet/TakeStockSheetProductBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/take/sheet/TakeStockSheetProductBo.java index 98035bb..0c9f269 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/take/sheet/TakeStockSheetProductBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/stock/take/sheet/TakeStockSheetProductBo.java @@ -91,6 +91,24 @@ public class TakeStockSheetProductBo extends BaseBo { @JsonIgnore private String scId; + /** + * 供应商id + */ + @ApiModelProperty("供应商id") + private String supplierId; + + /** + * 供应商编号 + */ + @ApiModelProperty("供应商编号") + private String supplierCode; + + /** + * 供应商名称 + */ + @ApiModelProperty("供应商名称") + private String supplierName; + public TakeStockSheetProductBo(TakeStockSheetProductDto dto, String planId, String scId) { this.planId = planId; diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/stock/take/pre/PreTakeStockProductDto.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/stock/take/pre/PreTakeStockProductDto.java index 577264a..0f3af7c 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/stock/take/pre/PreTakeStockProductDto.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/stock/take/pre/PreTakeStockProductDto.java @@ -2,6 +2,8 @@ package com.lframework.xingyun.sc.dto.stock.take.pre; import com.lframework.starter.web.dto.BaseDto; import java.io.Serializable; + +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @@ -63,4 +65,20 @@ public class PreTakeStockProductDto implements BaseDto, Serializable { * 单位 */ private String unit; + + + /** + * 供应商id + */ + private String supplierId; + + /** + * 供应商编号 + */ + private String supplierCode; + + /** + * 供应商名称 + */ + private String supplierName; } diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/stock/take/sheet/TakeStockSheetProductDto.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/stock/take/sheet/TakeStockSheetProductDto.java index b154ad6..aaa0af0 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/stock/take/sheet/TakeStockSheetProductDto.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/stock/take/sheet/TakeStockSheetProductDto.java @@ -2,6 +2,8 @@ package com.lframework.xingyun.sc.dto.stock.take.sheet; import com.lframework.starter.web.dto.BaseDto; import java.io.Serializable; + +import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @@ -63,4 +65,19 @@ public class TakeStockSheetProductDto implements BaseDto, Serializable { * 单位 */ private String unit; + + /** + * 供应商id + */ + private String supplierId; + + /** + * 供应商编号 + */ + private String supplierCode; + + /** + * 供应商名称 + */ + private String supplierName; } diff --git a/xingyun-sc/src/main/resources/mappers/stock/take/PreTaskStockSheetMapper.xml b/xingyun-sc/src/main/resources/mappers/stock/take/PreTaskStockSheetMapper.xml index 9a90eec..68b1b26 100644 --- a/xingyun-sc/src/main/resources/mappers/stock/take/PreTaskStockSheetMapper.xml +++ b/xingyun-sc/src/main/resources/mappers/stock/take/PreTaskStockSheetMapper.xml @@ -51,6 +51,9 @@ + + + @@ -114,11 +117,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