From 00c1db8105fbffef90f03578d1954707a9ad6d85 Mon Sep 17 00:00:00 2001 From: lijiaqi Date: Tue, 19 Nov 2024 13:43:47 +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 --- .../bo/product/info/QueryProductBo.java | 26 +++++++++++++++++++ .../customer/CustomerImportListener.java | 10 +++---- .../excel/customer/CustomerImportModel.java | 6 ++--- .../supplier/SupplierImportListener.java | 10 +++---- .../excel/supplier/SupplierImportModel.java | 6 ++--- .../impl/product/ProductServiceImpl.java | 6 +++++ .../basedata/mappers/ProductMapper.java | 11 +++++++- .../service/product/ProductService.java | 8 ++++++ .../vo/customer/CreateCustomerVo.java | 4 +-- .../vo/customer/UpdateCustomerVo.java | 4 +-- .../vo/supplier/CreateSupplierVo.java | 4 +-- .../vo/supplier/UpdateSupplierVo.java | 4 +-- .../mappers/product/ProductMapper.xml | 4 +++ .../xingyun/sc/enums/SaleOrderStatus.java | 3 --- .../xingyun/sc/enums/YdoolPersonIds.java | 25 ++++++++++++++++++ .../purchase/PurchaseOrderServiceImpl.java | 4 +-- .../retail/RetailOutSheetServiceImpl.java | 4 +-- .../sc/impl/sale/SaleOrderServiceImpl.java | 9 +++---- .../adjust/StockAdjustSheetServiceImpl.java | 4 +-- 19 files changed, 112 insertions(+), 40 deletions(-) create mode 100644 xingyun-sc/src/main/java/com/lframework/xingyun/sc/enums/YdoolPersonIds.java 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 c755cfe..9e9d70a 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 @@ -1,5 +1,6 @@ package com.lframework.xingyun.basedata.bo.product.info; +import cn.hutool.core.util.ObjectUtil; import com.fasterxml.jackson.annotation.JsonFormat; import com.lframework.starter.common.constants.StringPool; import com.lframework.starter.web.annotations.convert.EnumConvert; @@ -8,9 +9,14 @@ 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.ProductSale; import com.lframework.xingyun.basedata.service.product.ProductBrandService; import com.lframework.xingyun.basedata.service.product.ProductCategoryService; +import com.lframework.xingyun.basedata.service.product.ProductSaleService; +import com.lframework.xingyun.basedata.service.product.ProductService; import io.swagger.annotations.ApiModelProperty; + +import java.math.BigDecimal; import java.time.LocalDateTime; import lombok.Data; @@ -86,6 +92,19 @@ public class QueryProductBo extends BaseBo { @JsonFormat(pattern = StringPool.DATE_TIME_PATTERN) private LocalDateTime updateTime; + + /** + * 销售价 + */ + @ApiModelProperty("销售价") + private BigDecimal salePrice; + + /** + * 库存 + */ + @ApiModelProperty("库存") + private Integer stock; + public QueryProductBo() { } @@ -105,5 +124,12 @@ public class QueryProductBo extends BaseBo { ProductBrandService productBrandService = ApplicationUtil.getBean(ProductBrandService.class); ProductBrand brand = productBrandService.findById(dto.getBrandId()); this.brandName = brand.getName(); + + ProductSaleService productSaleService = ApplicationUtil.getBean(ProductSaleService.class); + ProductSale productSale = productSaleService.getById(dto.getId()); + this.salePrice = productSale.getPrice(); + + ProductService productService = ApplicationUtil.getBean(ProductService.class); + this.stock = productService.getStock(dto.getId()); } } diff --git a/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/excel/customer/CustomerImportListener.java b/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/excel/customer/CustomerImportListener.java index 3a74ced..2820a25 100644 --- a/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/excel/customer/CustomerImportListener.java +++ b/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/excel/customer/CustomerImportListener.java @@ -54,10 +54,10 @@ public class CustomerImportListener extends ExcelImportListener * Mapper 接口 @@ -103,4 +104,12 @@ public interface ProductMapper extends BaseMapper { */ List getByBrandIds(@Param("brandIds") List brandIds, @Param("productType") Integer productType); + + /** + * 查询库存 + * + * @param productId + * @return + */ + Integer 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 4c9d4d3..e08986b 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 @@ -110,4 +110,12 @@ public interface ProductService extends BaseMpService { * @return */ List getByBrandIds(List brandIds, Integer productType); + + /** + * 根据ID查询库存 + * + * @param id + * @return + */ + Integer getStock(String id); } diff --git a/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/vo/customer/CreateCustomerVo.java b/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/vo/customer/CreateCustomerVo.java index a4646d1..f4d9e14 100644 --- a/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/vo/customer/CreateCustomerVo.java +++ b/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/vo/customer/CreateCustomerVo.java @@ -34,8 +34,8 @@ public class CreateCustomerVo implements BaseVo, Serializable { /** * 助记码 */ - @ApiModelProperty(value = "助记码", required = true) - @NotBlank(message = "请输入助记码!") +// @ApiModelProperty(value = "助记码", required = true) +// @NotBlank(message = "请输入助记码!") private String mnemonicCode; /** diff --git a/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/vo/customer/UpdateCustomerVo.java b/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/vo/customer/UpdateCustomerVo.java index fe42f59..e9eb90d 100644 --- a/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/vo/customer/UpdateCustomerVo.java +++ b/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/vo/customer/UpdateCustomerVo.java @@ -39,8 +39,8 @@ public class UpdateCustomerVo implements BaseVo, Serializable { /** * 助记码 */ - @ApiModelProperty(value = "助记码", required = true) - @NotBlank(message = "请输入助记码!") +// @ApiModelProperty(value = "助记码", required = true) +// @NotBlank(message = "请输入助记码!") private String mnemonicCode; /** diff --git a/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/vo/supplier/CreateSupplierVo.java b/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/vo/supplier/CreateSupplierVo.java index 86874d9..4bf3278 100644 --- a/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/vo/supplier/CreateSupplierVo.java +++ b/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/vo/supplier/CreateSupplierVo.java @@ -36,8 +36,8 @@ public class CreateSupplierVo implements BaseVo, Serializable { /** * 助记码 */ - @ApiModelProperty(value = "助记码", required = true) - @NotBlank(message = "请输入助记码!") +// @ApiModelProperty(value = "助记码", required = true) +// @NotBlank(message = "请输入助记码!") private String mnemonicCode; /** diff --git a/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/vo/supplier/UpdateSupplierVo.java b/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/vo/supplier/UpdateSupplierVo.java index f5f2b4f..446da59 100644 --- a/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/vo/supplier/UpdateSupplierVo.java +++ b/xingyun-basedata/src/main/java/com/lframework/xingyun/basedata/vo/supplier/UpdateSupplierVo.java @@ -40,8 +40,8 @@ public class UpdateSupplierVo implements BaseVo, Serializable { /** * 助记码 */ - @ApiModelProperty(value = "助记码", required = true) - @NotBlank(message = "请输入助记码!") +// @ApiModelProperty(value = "助记码", required = true) +// @NotBlank(message = "请输入助记码!") private String mnemonicCode; /** diff --git a/xingyun-basedata/src/main/resources/mappers/product/ProductMapper.xml b/xingyun-basedata/src/main/resources/mappers/product/ProductMapper.xml index 6a225f5..a72166b 100644 --- a/xingyun-basedata/src/main/resources/mappers/product/ProductMapper.xml +++ b/xingyun-basedata/src/main/resources/mappers/product/ProductMapper.xml @@ -163,4 +163,8 @@ ORDER BY g.code + + diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/enums/SaleOrderStatus.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/enums/SaleOrderStatus.java index 0a776ed..a5273a5 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/enums/SaleOrderStatus.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/enums/SaleOrderStatus.java @@ -15,20 +15,17 @@ public enum SaleOrderStatus implements BaseEnum { private String desc; SaleOrderStatus(Integer code, String desc) { - this.code = code; this.desc = desc; } @Override public Integer getCode() { - return this.code; } @Override public String getDesc() { - return this.desc; } } diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/enums/YdoolPersonIds.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/enums/YdoolPersonIds.java new file mode 100644 index 0000000..dae6b3c --- /dev/null +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/enums/YdoolPersonIds.java @@ -0,0 +1,25 @@ +package com.lframework.xingyun.sc.enums; + +import com.baomidou.mybatisplus.annotation.EnumValue; + +public enum YdoolPersonIds { + SALE_ORDER_AUDIT_PERSON_IDS("9,262", "销售订单审批人"), + SALE_ORDER_PUSH_PERSON_IDS("9,262", "销售订单抄送人"), + ; + @EnumValue + private final String ids; + + private final String desc; + + + YdoolPersonIds(String ids, String desc) { + this.ids = ids; + this.desc = desc; + } + public String getIds() { + return ids; + } + public String getDesc() { + return desc; + } +} diff --git a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/purchase/PurchaseOrderServiceImpl.java b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/purchase/PurchaseOrderServiceImpl.java index feb6e78..2b4528f 100644 --- a/xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/purchase/PurchaseOrderServiceImpl.java +++ b/xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/purchase/PurchaseOrderServiceImpl.java @@ -673,8 +673,8 @@ public class PurchaseOrderServiceImpl extends BaseMpServiceImpl