refactor: inventory detail 优化

This commit is contained in:
zccbbg 2024-08-21 18:19:07 +08:00
parent 1242f91427
commit 5ca4dec277
4 changed files with 12 additions and 17 deletions

View file

@ -122,11 +122,6 @@ public class InventoryDetailBo extends BaseEntity implements PlaceAndItem {
/** 出库数量 */
private BigDecimal shipmentQuantity;
/**
* 最小数量
*/
private BigDecimal minQuantity;
private String itemName;
private String itemCode;
private String skuName;

View file

@ -19,7 +19,7 @@ import java.util.List;
public interface InventoryDetailMapper extends BaseMapperPlus<InventoryDetail, InventoryDetailVo> {
void deductInventoryDetailQuantity(@Param("list")List<InventoryDetailBo> list, @Param("updateBy") String updateBy, @Param("updateTime") LocalDateTime updateTime);
Page<InventoryDetailVo> selectPageByBo(Page<Object> page, @Param("bo") InventoryDetailBo bo);
Page<InventoryDetailVo> selectPageByBo(Page<InventoryDetailVo> page, @Param("bo") InventoryDetailBo bo);
List<InventoryDetailVo> selectListByBo(@Param("bo") InventoryDetailBo bo);
}

View file

@ -15,8 +15,8 @@ import org.apache.ibatis.annotations.Param;
*/
public interface InventoryMapper extends BaseMapperPlus<Inventory, InventoryVo> {
Page<InventoryVo> queryItemBoardList(Page<Object> page, @Param("bo") InventoryBo bo);
Page<InventoryVo> queryAreaBoardList(Page<Object> page, @Param("bo") InventoryBo bo);
Page<InventoryVo> queryItemBoardList(Page<InventoryVo> page, @Param("bo") InventoryBo bo);
Page<InventoryVo> queryAreaBoardList(Page<InventoryVo> page, @Param("bo") InventoryBo bo);
Page<InventoryVo> selectBoardPageByWarehouse(Page<Object> page, @Param("bo") InventoryBo bo);
Page<InventoryVo> selectBoardPageByWarehouse(Page<InventoryVo> page, @Param("bo") InventoryBo bo);
}

View file

@ -5,8 +5,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.wms.mapper.InventoryDetailMapper">
<resultMap id="inventoryDetailVoMap" type="com.ruoyi.wms.domain.vo.InventoryDetailVo">
<association property="itemSku" javaType="com.ruoyi.wms.domain.vo.ItemSkuVo" />
<association property="item" javaType="com.ruoyi.wms.domain.vo.ItemVo" />
<association property="itemSku" javaType="com.ruoyi.wms.domain.vo.ItemSkuVo">
<id property="id" column="sku_id"/> <!-- 映射 itemSku 的 id -->
</association>
<association property="item" javaType="com.ruoyi.wms.domain.vo.ItemVo">
<id property="id" column="item_id"/> <!-- 映射 item 的 id -->
</association>
</resultMap>
<update id="deductInventoryDetailQuantity">
@ -30,7 +34,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectPageByBo" resultMap="inventoryDetailVoMap">
select
detail.*,
sku.id as sku_id,
sku.*,
item.id as item_id,
item.*
from wms_inventory_detail detail
inner join wms_item_sku sku on detail.sku_id=sku.id
@ -57,9 +63,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bo.areaId != null">
and detail.area_id=#{bo.areaId}
</if>
<if test="bo.minQuantity != null">
and detail.remain_quantity>=#{bo.minQuantity}
</if>
<if test="bo.batchNo != null and bo.batchNo != ''">
and detail.batch_no=#{bo.batchNo}
</if>
@ -87,9 +90,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="bo.areaId != null">
and detail.area_id=#{bo.areaId}
</if>
<if test="bo.minQuantity != null">
and detail.remain_quantity>=#{bo.minQuantity}
</if>
<if test="bo.batchNo != null and bo.batchNo != ''">
and detail.batch_no=#{bo.batchNo}
</if>