From a973b5d8a87ddb3a707141f61961b4393fd8930c Mon Sep 17 00:00:00 2001 From: lijiaqi Date: Fri, 22 Nov 2024 13:59:05 +0800 Subject: [PATCH] =?UTF-8?q?feat(xingyun-sc):=20=E9=94=80=E5=94=AE=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=20BO=20=E5=92=8C=20DTO=20=E7=B1=BB=E4=B8=AD=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BE=9B=E5=BA=94=E5=95=86=E4=BF=A1=E6=81=AF=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在多个销售相关的 BO 和 DTO 类中添加供应商 ID 和供应商名称字段 - 更新数据库查询语句,加入供应商信息的查询 - 通过这些修改,可以在销售订单、出库单等业务对象中直接获取供应商信息,无需额外查询 --- .../xingyun/sc/bo/sale/GetSaleOrderBo.java | 14 ++++++++++++++ .../xingyun/sc/bo/sale/SaleOrderWithOutBo.java | 14 ++++++++++++++ .../xingyun/sc/bo/sale/SaleProductBo.java | 13 +++++++++++++ .../xingyun/sc/bo/sale/out/GetSaleOutSheetBo.java | 14 ++++++++++++++ .../sc/bo/sale/out/SaleOutSheetWithReturnBo.java | 15 +++++++++++++++ .../sc/bo/sale/returned/GetSaleReturnBo.java | 14 ++++++++++++++ .../xingyun/sc/dto/sale/SaleProductDto.java | 10 ++++++++++ .../resources/mappers/sale/SaleOrderMapper.xml | 7 ++++++- 8 files changed, 100 insertions(+), 1 deletion(-) diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/GetSaleOrderBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/GetSaleOrderBo.java index e3d0688..1f760f4 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/GetSaleOrderBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/GetSaleOrderBo.java @@ -341,6 +341,18 @@ public class GetSaleOrderBo extends BaseBo { @ApiModelProperty("库存数量") private Integer stockNum; + /** + * 供应商Id + */ + @ApiModelProperty(value = "供应商Id") + private String supplierId; + + /** + * 供应商名称 + */ + @ApiModelProperty(value = "供应商名称") + private String supplierName; + public OrderDetailBo(String scId, SaleOrderFullDto.OrderDetailDto dto) { this.scId = scId; @@ -372,6 +384,8 @@ public class GetSaleOrderBo extends BaseBo { this.spec = product.getSpec(); this.categoryName = product.getCategoryName(); this.brandName = product.getBrandName(); + this.supplierId = product.getSupplierId(); + this.supplierName = product.getSupplierName(); ProductStockService productStockService = ApplicationUtil.getBean( ProductStockService.class); diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/SaleOrderWithOutBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/SaleOrderWithOutBo.java index fc04847..189f6e1 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/SaleOrderWithOutBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/SaleOrderWithOutBo.java @@ -253,6 +253,18 @@ public class SaleOrderWithOutBo extends BaseBo { @JsonIgnore private String scId; + /** + * 供应商Id + */ + @ApiModelProperty(value = "供应商Id") + private String supplierId; + + /** + * 供应商名称 + */ + @ApiModelProperty(value = "供应商名称") + private String supplierName; + public DetailBo() { } @@ -292,6 +304,8 @@ public class SaleOrderWithOutBo extends BaseBo { this.spec = product.getSpec(); this.categoryName = product.getCategoryName(); this.brandName = product.getBrandName(); + this.supplierId = product.getSupplierId(); + this.supplierName = product.getSupplierName(); this.orderNum = dto.getOrderNum(); this.salePrice = dto.getOriPrice(); diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/SaleProductBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/SaleProductBo.java index 27a703e..23872d5 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/SaleProductBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/SaleProductBo.java @@ -98,6 +98,19 @@ public class SaleProductBo extends BaseBo { @JsonIgnore private String scId; + + /** + * 供应商Id + */ + @ApiModelProperty(value = "供应商Id") + private String supplierId; + + /** + * 供应商名称 + */ + @ApiModelProperty(value = "供应商名称") + private String supplierName; + public SaleProductBo(String scId, SaleProductDto dto) { this.scId = scId; diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/out/GetSaleOutSheetBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/out/GetSaleOutSheetBo.java index 96adc0a..fb55b86 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/out/GetSaleOutSheetBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/out/GetSaleOutSheetBo.java @@ -387,6 +387,18 @@ public class GetSaleOutSheetBo extends BaseBo { @JsonIgnore private String scId; + /** + * 供应商Id + */ + @ApiModelProperty(value = "供应商Id") + private String supplierId; + + /** + * 供应商名称 + */ + @ApiModelProperty(value = "供应商名称") + private String supplierName; + public OrderDetailBo(String scId, SaleOutSheetFullDto.SheetDetailDto dto) { this.scId = scId; @@ -418,6 +430,8 @@ public class GetSaleOutSheetBo extends BaseBo { this.spec = product.getSpec(); this.categoryName = product.getCategoryName(); this.brandName = product.getBrandName(); + this.supplierId = product.getSupplierId(); + this.supplierName = product.getSupplierName(); if (!StringUtil.isBlank(dto.getSaleOrderDetailId())) { SaleOrderDetailService saleOrderDetailService = ApplicationUtil.getBean( diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/out/SaleOutSheetWithReturnBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/out/SaleOutSheetWithReturnBo.java index c77bbb1..6d1eb46 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/out/SaleOutSheetWithReturnBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/out/SaleOutSheetWithReturnBo.java @@ -240,6 +240,19 @@ public class SaleOutSheetWithReturnBo extends BaseBo @JsonIgnore private String scId; + + /** + * 供应商Id + */ + @ApiModelProperty(value = "供应商Id") + private String supplierId; + + /** + * 供应商名称 + */ + @ApiModelProperty(value = "供应商名称") + private String supplierName; + public DetailBo(String scId, SaleOutSheetWithReturnDto.SheetDetailDto dto) { this.scId = scId; @@ -277,6 +290,8 @@ public class SaleOutSheetWithReturnBo extends BaseBo this.spec = product.getSpec(); this.categoryName = product.getCategoryName(); this.brandName = product.getBrandName(); + this.supplierId = product.getSupplierId(); + this.supplierName = product.getSupplierName(); this.outNum = dto.getOrderNum(); this.salePrice = dto.getOriPrice(); diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/returned/GetSaleReturnBo.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/returned/GetSaleReturnBo.java index baefdb1..d35c38e 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/returned/GetSaleReturnBo.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/bo/sale/returned/GetSaleReturnBo.java @@ -362,6 +362,18 @@ public class GetSaleReturnBo extends BaseBo { @JsonIgnore private String scId; + /** + * 供应商Id + */ + @ApiModelProperty(value = "供应商Id") + private String supplierId; + + /** + * 供应商名称 + */ + @ApiModelProperty(value = "供应商名称") + private String supplierName; + public ReturnDetailBo(String scId, SaleReturnFullDto.ReturnDetailDto dto) { this.scId = scId; @@ -394,6 +406,8 @@ public class GetSaleReturnBo extends BaseBo { this.spec = product.getSpec(); this.categoryName = product.getCategoryName(); this.brandName = product.getBrandName(); + this.supplierId = product.getSupplierId(); + this.supplierName = product.getSupplierName(); if (!StringUtil.isBlank(dto.getOutSheetDetailId())) { SaleOutSheetDetailLotService receiveSheetDetailService = ApplicationUtil.getBean( diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/sale/SaleProductDto.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/sale/SaleProductDto.java index a1b27b6..3657654 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/sale/SaleProductDto.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/dto/sale/SaleProductDto.java @@ -79,4 +79,14 @@ public class SaleProductDto implements BaseDto, Serializable { * 状态 */ private Boolean available; + + /** + * 供应商Id + */ + private String supplierId; + + /** + * 供应商名称 + */ + private String supplierName; } diff --git a/xingyun-sc/src/main/resources/mappers/sale/SaleOrderMapper.xml b/xingyun-sc/src/main/resources/mappers/sale/SaleOrderMapper.xml index 7dae355..9535458 100644 --- a/xingyun-sc/src/main/resources/mappers/sale/SaleOrderMapper.xml +++ b/xingyun-sc/src/main/resources/mappers/sale/SaleOrderMapper.xml @@ -92,6 +92,8 @@ + + @@ -167,12 +169,15 @@ g.unit, sale.price AS sale_price, g.sale_tax_rate, - g.available + g.available, + g.supplier_id, + s.name AS supplier_name FROM base_data_product AS g INNER JOIN base_data_product_sale AS sale ON sale.id = g.id 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