From 1fe802ca6f1c6be3c1870d50283589ebe70c25e2 Mon Sep 17 00:00:00 2001 From: lijiaqi Date: Tue, 19 Nov 2024 15:53:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(product):=20=E6=9F=A5=E8=AF=A2=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E6=97=B6=E5=A2=9E=E5=8A=A0=E9=94=80=E5=94=AE=E4=BB=B7?= =?UTF-8?q?=E5=92=8C=E5=BA=93=E5=AD=98=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 QueryProductBo 中添加销售价和库存字段 - 实现 ProductService 中的 getStock 方法 - 在 ProductMapper 中添加 getStock 接口- 更新 ProductMapper.xml,添加库存查询 SQL - 移除客户和供应商相关代码中的助记码字段 - 调整销售订单、采购订单等中的审批人和抄送人 ID - 新增 YdoolPersonIds 枚举类,用于定义审批人和抄送人 ID --- .../basedata/bo/product/info/GetProductBo.java | 16 +++++++++------- .../basedata/bo/product/info/QueryProductBo.java | 2 +- .../impl/product/ProductServiceImpl.java | 6 +++--- .../xingyun/basedata/mappers/ProductMapper.java | 3 ++- .../basedata/service/product/ProductService.java | 4 +++- .../resources/mappers/product/ProductMapper.xml | 2 +- 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/bo/product/info/GetProductBo.java b/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/bo/product/info/GetProductBo.java index 0fd52d2..740abdc 100644 --- a/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/bo/product/info/GetProductBo.java +++ b/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/bo/product/info/GetProductBo.java @@ -15,13 +15,7 @@ import com.lframework.xingyun.basedata.entity.ProductRetail; import com.lframework.xingyun.basedata.entity.ProductSale; import com.lframework.xingyun.basedata.enums.ColumnType; import com.lframework.xingyun.basedata.enums.ProductType; -import com.lframework.xingyun.basedata.service.product.ProductBrandService; -import com.lframework.xingyun.basedata.service.product.ProductBundleService; -import com.lframework.xingyun.basedata.service.product.ProductCategoryService; -import com.lframework.xingyun.basedata.service.product.ProductPropertyRelationService; -import com.lframework.xingyun.basedata.service.product.ProductPurchaseService; -import com.lframework.xingyun.basedata.service.product.ProductRetailService; -import com.lframework.xingyun.basedata.service.product.ProductSaleService; +import com.lframework.xingyun.basedata.service.product.*; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; @@ -171,6 +165,12 @@ public class GetProductBo extends BaseBo { @ApiModelProperty("属性") private List properties; + /** + * 库存 + */ + @ApiModelProperty("库存") + private BigDecimal stock; + public GetProductBo() { } @@ -242,6 +242,8 @@ public class GetProductBo extends BaseBo { } } } + ProductService productService = ApplicationUtil.getBean(ProductService.class); + this.stock = productService.getStock(dto.getId()); } @Data diff --git a/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/bo/product/info/QueryProductBo.java b/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/bo/product/info/QueryProductBo.java index 9e9d70a..fb57e46 100644 --- a/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/bo/product/info/QueryProductBo.java +++ b/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/bo/product/info/QueryProductBo.java @@ -103,7 +103,7 @@ public class QueryProductBo extends BaseBo { * 库存 */ @ApiModelProperty("库存") - private Integer stock; + private BigDecimal stock; public QueryProductBo() { diff --git a/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/impl/product/ProductServiceImpl.java b/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/impl/product/ProductServiceImpl.java index 24d4efb..51754d6 100644 --- a/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/impl/product/ProductServiceImpl.java +++ b/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/impl/product/ProductServiceImpl.java @@ -545,9 +545,9 @@ public class ProductServiceImpl extends BaseMpServiceImpl { * @param productId * @return */ - Integer getStock(@Param("productId") String productId); + BigDecimal getStock(@Param("productId") String productId); } diff --git a/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/service/product/ProductService.java b/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/service/product/ProductService.java index e08986b..826bbda 100644 --- a/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/service/product/ProductService.java +++ b/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/service/product/ProductService.java @@ -7,6 +7,8 @@ import com.lframework.xingyun.basedata.vo.product.info.CreateProductVo; import com.lframework.xingyun.basedata.vo.product.info.QueryProductSelectorVo; import com.lframework.xingyun.basedata.vo.product.info.QueryProductVo; import com.lframework.xingyun.basedata.vo.product.info.UpdateProductVo; + +import java.math.BigDecimal; import java.util.Collection; import java.util.List; @@ -117,5 +119,5 @@ public interface ProductService extends BaseMpService { * @param id * @return */ - Integer getStock(String id); + BigDecimal getStock(String id); } diff --git a/xingyun-basedata/src/main/resources/mappers/product/ProductMapper.xml b/xingyun-basedata/src/main/resources/mappers/product/ProductMapper.xml index a72166b..e308a2e 100644 --- a/xingyun-basedata/src/main/resources/mappers/product/ProductMapper.xml +++ b/xingyun-basedata/src/main/resources/mappers/product/ProductMapper.xml @@ -163,7 +163,7 @@ ORDER BY g.code - SELECT SUM(stock_num) FROM tbl_product_stock WHERE product_id = #{productId}