From 15dd0d8e18b614700e99c905abe03f184afe6bc0 Mon Sep 17 00:00:00 2001 From: lijiaqi Date: Tue, 26 Nov 2024 09:15:17 +0800 Subject: [PATCH] =?UTF-8?q?feat(stock):=20=E6=B7=BB=E5=8A=A0=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E4=BE=9B=E5=BA=94=E5=95=86=E4=BF=A1=E6=81=AF-=20?= =?UTF-8?q?=E5=9C=A8=E5=A4=9A=E4=B8=AA=20BO=20=E5=92=8C=20DTO=20=E4=B8=AD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BE=9B=E5=BA=94=E5=95=86=20ID=E3=80=81?= =?UTF-8?q?=E7=BC=96=E5=8F=B7=E5=92=8C=E5=90=8D=E7=A7=B0=E5=AD=97=E6=AE=B5?= =?UTF-8?q?-=20=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2=E6=98=A0=E5=B0=84?= =?UTF-8?q?=E6=96=87=E4=BB=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E4=BF=A1=E6=81=AF=E7=9A=84=E6=9F=A5=E8=AF=A2=20-=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E9=AB=98=E5=8F=AF=E7=BB=B4=E6=8A=A4=E6=80=A7=E5=92=8C?= =?UTF-8?q?=E5=8F=AF=E8=AF=BB=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plan/QueryTakeStockPlanProductBo.java | 30 ++++++++++++++++ .../stock/take/plan/TakeStockPlanFullBo.java | 35 ++++++++++++++++--- .../take/pre/GetPreTakeStockSheetBo.java | 33 ++++++++++++++--- .../stock/take/pre/PreTakeStockProductBo.java | 19 ++++++++++ .../pre/QueryPreTakeStockSheetProductBo.java | 30 ++++++++++++++++ .../take/sheet/TakeStockSheetFullBo.java | 33 ++++++++++++++--- .../take/sheet/TakeStockSheetProductBo.java | 18 ++++++++++ .../take/pre/PreTakeStockProductDto.java | 18 ++++++++++ .../take/sheet/TakeStockSheetProductDto.java | 17 +++++++++ .../stock/take/PreTaskStockSheetMapper.xml | 9 ++++- .../stock/take/TakeStockSheetMapper.xml | 9 ++++- 11 files changed, 237 insertions(+), 14 deletions(-) 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