feat(product): 查询产品时增加销售价和库存信息
- 在 QueryProductBo 中添加销售价和库存字段 - 实现 ProductService 中的 getStock 方法 - 在 ProductMapper 中添加 getStock 接口- 更新 ProductMapper.xml,添加库存查询 SQL - 移除客户和供应商相关代码中的助记码字段 - 调整销售订单、采购订单等中的审批人和抄送人 ID - 新增 YdoolPersonIds 枚举类,用于定义审批人和抄送人 ID
This commit is contained in:
parent
00c1db8105
commit
1fe802ca6f
|
@ -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<Product> {
|
|||
@ApiModelProperty("属性")
|
||||
private List<PropertyBo> properties;
|
||||
|
||||
/**
|
||||
* 库存
|
||||
*/
|
||||
@ApiModelProperty("库存")
|
||||
private BigDecimal stock;
|
||||
|
||||
public GetProductBo() {
|
||||
|
||||
}
|
||||
|
@ -242,6 +242,8 @@ public class GetProductBo extends BaseBo<Product> {
|
|||
}
|
||||
}
|
||||
}
|
||||
ProductService productService = ApplicationUtil.getBean(ProductService.class);
|
||||
this.stock = productService.getStock(dto.getId());
|
||||
}
|
||||
|
||||
@Data
|
||||
|
|
|
@ -103,7 +103,7 @@ public class QueryProductBo extends BaseBo<Product> {
|
|||
* 库存
|
||||
*/
|
||||
@ApiModelProperty("库存")
|
||||
private Integer stock;
|
||||
private BigDecimal stock;
|
||||
|
||||
public QueryProductBo() {
|
||||
|
||||
|
|
|
@ -545,9 +545,9 @@ public class ProductServiceImpl extends BaseMpServiceImpl<ProductMapper, Product
|
|||
}
|
||||
|
||||
@Override
|
||||
public Integer getStock(String id) {
|
||||
Integer stock = this.getBaseMapper().getStock(id);
|
||||
return ObjectUtil.isNull(stock) ? 0 : stock;
|
||||
public BigDecimal getStock(String id) {
|
||||
BigDecimal stock = this.getBaseMapper().getStock(id);
|
||||
return ObjectUtil.isNull(stock) ? BigDecimal.valueOf(0) : stock;
|
||||
}
|
||||
|
||||
@CacheEvict(value = Product.CACHE_NAME, key = "@cacheVariables.tenantId() + #key")
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.lframework.xingyun.template.core.annotations.sort.Sorts;
|
|||
import com.lframework.xingyun.template.core.components.permission.SysDataPermissionDataPermissionType;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -111,5 +112,5 @@ public interface ProductMapper extends BaseMapper<Product> {
|
|||
* @param productId
|
||||
* @return
|
||||
*/
|
||||
Integer getStock(@Param("productId") String productId);
|
||||
BigDecimal getStock(@Param("productId") String productId);
|
||||
}
|
||||
|
|
|
@ -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<Product> {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Integer getStock(String id);
|
||||
BigDecimal getStock(String id);
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@
|
|||
</where>
|
||||
ORDER BY g.code
|
||||
</select>
|
||||
<select id="getStock" resultType="java.lang.Integer">
|
||||
<select id="getStock" resultType="java.math.BigDecimal">
|
||||
SELECT SUM(stock_num) FROM tbl_product_stock WHERE product_id = #{productId}
|
||||
</select>
|
||||
|
||||
|
|
Loading…
Reference in New Issue