-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #194 from Jzow/master
Adjusting the interface regarding the inventory dao layer
- Loading branch information
Showing
17 changed files
with
272 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 0 additions & 66 deletions
66
core/dao/src/main/resources/mapper_xml/product/ProductStockKeepUnitMapper.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
<mapper namespace="com.wansenai.mappers.product.ProductStockKeepUnitMapper"> | ||
<resultMap id="productResultMap" type="com.wansenai.vo.product.ProductStockKeepUnitVO"> | ||
<id property="id" column="id" /> | ||
<result property="productId" column="productId" /> | ||
<result property="productCategoryId" column="product_category_id" /> | ||
<result property="barCode" column="product_bar_code" /> | ||
<result property="productName" column="product_name" /> | ||
<result property="productCategoryName" column="category_name" /> | ||
<result property="productStandard" column="product_standard" /> | ||
<result property="productModel" column="product_model" /> | ||
<result property="productColor" column="product_color" /> | ||
<result property="productUnit" column="product_unit" /> | ||
<result property="multiAttribute" column="multi_attribute" /> | ||
<result property="stock" column="current_stock_quantity" /> | ||
<result property="extendInfo" column="product_manufacturer" /> | ||
<result property="retailPrice" column="retail_price" /> | ||
</resultMap> | ||
|
||
<select id="getProductSkuList" resultMap="productResultMap" parameterType="com.baomidou.mybatisplus.core.metadata.IPage"> | ||
SELECT ps.id, p.id AS productId, p.product_category_id, p.product_name, p.product_model, p.product_standard, p.product_color, | ||
sku.product_bar_code, sku.multi_attribute, sku.product_unit, sku.retail_price, p.product_manufacturer,pc.category_name, | ||
ps.current_stock_quantity, w.warehouse_name, ps.warehouse_id | ||
FROM product_stock AS ps | ||
LEFT JOIN warehouse as w ON ps.warehouse_id = w.id | ||
LEFT JOIN product_sku AS sku ON sku.id = ps.product_sku_id | ||
LEFT JOIN product AS p ON sku.product_id = p.id | ||
LEFT JOIN product_category AS pc ON p.product_category_id = pc.id | ||
<where> | ||
<if test="queryProductStockKeepUnitDTO.productCategoryId != null"> | ||
AND p.product_category_id = #{queryProductStockKeepUnitDTO.productCategoryId} | ||
</if> | ||
<if test="queryProductStockKeepUnitDTO.warehouseId != null"> | ||
AND ps.warehouse_id = #{queryProductStockKeepUnitDTO.warehouseId} | ||
</if> | ||
<if test="queryProductStockKeepUnitDTO.productName != null"> | ||
AND p.product_name = #{queryProductStockKeepUnitDTO.productName} | ||
</if> | ||
<if test="queryProductStockKeepUnitDTO.enableSerialNumber != null"> | ||
AND p.enable_serial_number = #{queryProductStockKeepUnitDTO.enableSerialNumber} | ||
</if> | ||
<if test="queryProductStockKeepUnitDTO.enableBatchNumber != null"> | ||
AND p.enable_batch_number = #{queryProductStockKeepUnitDTO.enableBatchNumber} | ||
</if> | ||
</where> | ||
</select> | ||
|
||
<select id="getProductSkuByBarCode" resultMap="productResultMap"> | ||
SELECT sku.id, p.id AS productId, p.product_category_id, p.product_name, p.product_model, p.product_standard, p.product_color, | ||
sku.product_bar_code, sku.multi_attribute, sku.product_unit, sku.retail_price, p.product_manufacturer, | ||
pc.category_name, ps.current_stock_quantity, ps.warehouse_id | ||
FROM product_stock AS ps | ||
LEFT JOIN product_sku AS sku ON sku.id = ps.product_sku_id | ||
LEFT JOIN product AS p ON sku.product_id = p.id | ||
LEFT JOIN product_category AS pc ON p.product_category_id = pc.id | ||
WHERE sku.product_bar_code = #{barCode} AND ps.warehouse_id = #{warehouseId} | ||
</select> | ||
|
||
<select id="getProductSkuDetail" resultMap="productResultMap"> | ||
SELECT sku.id, p.id AS productId, p.product_category_id, p.product_name, p.product_model, p.product_standard, p.product_color, | ||
sku.product_bar_code, sku.multi_attribute, sku.product_unit, sku.retail_price, p.product_manufacturer, | ||
pc.category_name, ps.current_stock_quantity, ps.warehouse_id | ||
FROM product_stock AS ps | ||
LEFT JOIN product_sku AS sku ON sku.id = ps.product_sku_id | ||
LEFT JOIN product AS p ON sku.product_id = p.id | ||
LEFT JOIN product_category AS pc ON p.product_category_id = pc.id | ||
WHERE p.id= #{productId} AND ps.warehouse_id = #{warehouseId} AND sku.product_bar_code = #{barCode} | ||
</select> | ||
|
||
</mapper> |
92 changes: 92 additions & 0 deletions
92
core/dao/src/main/resources/mapper_xml/product/ProductStockMapper.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,97 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
<mapper namespace="com.wansenai.mappers.product.ProductStockMapper"> | ||
<resultMap id="productResultMap" type="com.wansenai.vo.product.ProductStockKeepUnitVO"> | ||
<id property="id" column="id" /> | ||
<result property="productId" column="productId" /> | ||
<result property="productCategoryId" column="product_category_id" /> | ||
<result property="barCode" column="product_bar_code" /> | ||
<result property="productName" column="product_name" /> | ||
<result property="productCategoryName" column="category_name" /> | ||
<result property="productStandard" column="product_standard" /> | ||
<result property="productModel" column="product_model" /> | ||
<result property="productColor" column="product_color" /> | ||
<result property="productUnit" column="product_unit" /> | ||
<result property="multiAttribute" column="multi_attribute" /> | ||
<result property="stock" column="current_stock_quantity" /> | ||
<result property="extendInfo" column="product_manufacturer" /> | ||
<result property="retailPrice" column="retail_price" /> | ||
</resultMap> | ||
|
||
<resultMap id="productStockMap" type="com.wansenai.vo.report.ProductStockVO"> | ||
<id property="id" column="id" /> | ||
</resultMap> | ||
|
||
<select id="getProductSkuList" resultMap="productResultMap" parameterType="com.baomidou.mybatisplus.core.metadata.IPage"> | ||
SELECT ps.id, p.id AS productId, p.product_category_id, p.product_name, p.product_model, p.product_standard, p.product_color, | ||
sku.product_bar_code, sku.multi_attribute, sku.product_unit, sku.retail_price, p.product_manufacturer,pc.category_name, | ||
ps.current_stock_quantity, w.warehouse_name, ps.warehouse_id | ||
FROM product_stock AS ps | ||
LEFT JOIN warehouse as w ON ps.warehouse_id = w.id | ||
LEFT JOIN product_sku AS sku ON sku.id = ps.product_sku_id | ||
LEFT JOIN product AS p ON sku.product_id = p.id | ||
LEFT JOIN product_category AS pc ON p.product_category_id = pc.id | ||
<where> | ||
<if test="queryProductStockKeepUnitDTO.productCategoryId != null"> | ||
AND p.product_category_id = #{queryProductStockKeepUnitDTO.productCategoryId} | ||
</if> | ||
<if test="queryProductStockKeepUnitDTO.warehouseId != null"> | ||
AND ps.warehouse_id = #{queryProductStockKeepUnitDTO.warehouseId} | ||
</if> | ||
<if test="queryProductStockKeepUnitDTO.productName != null"> | ||
AND p.product_name = #{queryProductStockKeepUnitDTO.productName} | ||
</if> | ||
<if test="queryProductStockKeepUnitDTO.enableSerialNumber != null"> | ||
AND p.enable_serial_number = #{queryProductStockKeepUnitDTO.enableSerialNumber} | ||
</if> | ||
<if test="queryProductStockKeepUnitDTO.enableBatchNumber != null"> | ||
AND p.enable_batch_number = #{queryProductStockKeepUnitDTO.enableBatchNumber} | ||
</if> | ||
</where> | ||
</select> | ||
|
||
<select id="getProductSkuByBarCode" resultMap="productResultMap"> | ||
SELECT sku.id, p.id AS productId, p.product_category_id, p.product_name, p.product_model, p.product_standard, p.product_color, | ||
sku.product_bar_code, sku.multi_attribute, sku.product_unit, sku.retail_price, p.product_manufacturer, | ||
pc.category_name, ps.current_stock_quantity, ps.warehouse_id | ||
FROM product_stock AS ps | ||
LEFT JOIN product_sku AS sku ON sku.id = ps.product_sku_id | ||
LEFT JOIN product AS p ON sku.product_id = p.id | ||
LEFT JOIN product_category AS pc ON p.product_category_id = pc.id | ||
WHERE sku.product_bar_code = #{barCode} AND ps.warehouse_id = #{warehouseId} | ||
</select> | ||
|
||
<select id="getProductSkuDetail" resultMap="productResultMap"> | ||
SELECT sku.id, p.id AS productId, p.product_category_id, p.product_name, p.product_model, p.product_standard, p.product_color, | ||
sku.product_bar_code, sku.multi_attribute, sku.product_unit, sku.retail_price, p.product_manufacturer, | ||
pc.category_name, ps.current_stock_quantity, ps.warehouse_id | ||
FROM product_stock AS ps | ||
LEFT JOIN product_sku AS sku ON sku.id = ps.product_sku_id | ||
LEFT JOIN product AS p ON sku.product_id = p.id | ||
LEFT JOIN product_category AS pc ON p.product_category_id = pc.id | ||
WHERE p.id= #{productId} AND ps.warehouse_id = #{warehouseId} AND sku.product_bar_code = #{barCode} | ||
</select> | ||
|
||
<select id="getProductStock" resultMap="productStockMap" parameterType="com.baomidou.mybatisplus.core.metadata.IPage"> | ||
SELECT ps.id, p.product_name, p.product_model, p.product_standard, p.product_color,sku.product_bar_code, sku.multi_attribute, | ||
sku.product_unit, sku.retail_price, p.product_manufacturer,pc.category_name, | ||
ps.current_stock_quantity, w.warehouse_name, ps.warehouse_id | ||
FROM product_stock AS ps | ||
LEFT JOIN warehouse as w ON ps.warehouse_id = w.id | ||
LEFT JOIN product_sku AS sku ON sku.id = ps.product_sku_id | ||
LEFT JOIN product AS p ON sku.product_id = p.id | ||
LEFT JOIN product_stock AS sk ON sk.product_sku_id = sku.id | ||
LEFT JOIN product_category AS pc ON p.product_category_id = pc.id | ||
<where> | ||
<if test="queryProductStock.productCategoryId != null"> | ||
AND p.product_category_id = #{queryProductStock.productCategoryId} | ||
</if> | ||
<if test="queryProductStock.warehouseId != null"> | ||
AND ps.warehouse_id = #{queryProductStock.warehouseId} | ||
</if> | ||
<if test="queryProductStock.productName != null"> | ||
AND p.product_name = #{queryProductStock.productName} | ||
</if> | ||
</where> | ||
</select> | ||
</mapper> |
27 changes: 27 additions & 0 deletions
27
core/domain/src/main/java/com/wansenai/dto/report/QueryProductStock.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance | ||
* with the License. A copy of the License is located at | ||
* | ||
* http://opensource.wansenai.com/apache2.0/ | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES | ||
* OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
package com.wansenai.dto.report; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class QueryProductStock { | ||
|
||
private Long warehouseId; | ||
|
||
private String productInfo; | ||
|
||
private Long productCategoryId; | ||
|
||
private String warehouseShelves; | ||
} |
58 changes: 58 additions & 0 deletions
58
core/domain/src/main/java/com/wansenai/vo/report/ProductStockVO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright 2023-2033 WanSen AI Team, Inc. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance | ||
* with the License. A copy of the License is located at | ||
* | ||
* http://opensource.wansenai.com/apache2.0/ | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES | ||
* OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
*/ | ||
package com.wansenai.vo.report; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import com.wansenai.bo.BigDecimalSerializerBO; | ||
import lombok.Data; | ||
|
||
import java.math.BigDecimal; | ||
|
||
@Data | ||
public class ProductStockVO { | ||
|
||
@JsonFormat(shape = JsonFormat.Shape.STRING) | ||
private Long Id; | ||
|
||
private String productBarcode; | ||
|
||
private String productName; | ||
|
||
private String productCategoryName; | ||
|
||
private String productStandard; | ||
|
||
private String productModel; | ||
|
||
private String productColor; | ||
|
||
private String productUnit; | ||
|
||
private String warehouseShelves; | ||
|
||
@JsonSerialize(using = BigDecimalSerializerBO.class) | ||
private BigDecimal productWeight; | ||
|
||
@JsonSerialize(using = BigDecimalSerializerBO.class) | ||
private BigDecimal unitPrice; | ||
|
||
@JsonSerialize(using = BigDecimalSerializerBO.class) | ||
private BigDecimal initialStock; | ||
|
||
@JsonSerialize(using = BigDecimalSerializerBO.class) | ||
private BigDecimal currentStock; | ||
|
||
@JsonSerialize(using = BigDecimalSerializerBO.class) | ||
private BigDecimal stockAmount; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.