mirror of
https://github.com/zccbbg/wms-ruoyi.git
synced 2024-09-20 11:05:54 +08:00
feat: 查询库存记录
This commit is contained in:
parent
bdf9fc5e77
commit
f3cc45ae7c
|
@ -41,7 +41,7 @@ public class InventoryHistoryBo extends BaseEntity {
|
|||
* 操作类型
|
||||
*/
|
||||
@NotNull(message = "操作类型不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long formType;
|
||||
private Integer formType;
|
||||
|
||||
/**
|
||||
* 物料ID
|
||||
|
@ -93,5 +93,12 @@ public class InventoryHistoryBo extends BaseEntity {
|
|||
@NotNull(message = "所属库区不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long areaId;
|
||||
|
||||
private String itemName;
|
||||
private String itemCode;
|
||||
private String skuName;
|
||||
private String skuCode;
|
||||
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public class InventoryHistory extends BaseEntity {
|
|||
/**
|
||||
* 操作类型
|
||||
*/
|
||||
private Long formType;
|
||||
private Integer formType;
|
||||
/**
|
||||
* 物料ID
|
||||
*/
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
|||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.ruoyi.common.excel.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.excel.convert.ExcelDictConvert;
|
||||
import com.ruoyi.common.mybatis.core.domain.BaseEntity;
|
||||
import com.ruoyi.wms.domain.entity.InventoryHistory;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
@ -22,7 +23,7 @@ import java.time.LocalDateTime;
|
|||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = InventoryHistory.class)
|
||||
public class InventoryHistoryVo implements Serializable {
|
||||
public class InventoryHistoryVo extends BaseEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -44,7 +45,7 @@ public class InventoryHistoryVo implements Serializable {
|
|||
* 操作类型
|
||||
*/
|
||||
@ExcelProperty(value = "操作类型")
|
||||
private Long formType;
|
||||
private Integer formType;
|
||||
|
||||
/**
|
||||
* 物料ID
|
||||
|
@ -100,5 +101,8 @@ public class InventoryHistoryVo implements Serializable {
|
|||
@ExcelProperty(value = "所属库区")
|
||||
private Long areaId;
|
||||
|
||||
private ItemSkuVo itemSku;
|
||||
|
||||
private ItemVo item;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
package com.ruoyi.wms.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import com.ruoyi.wms.domain.bo.InventoryHistoryBo;
|
||||
import com.ruoyi.wms.domain.entity.InventoryHistory;
|
||||
import com.ruoyi.wms.domain.vo.InventoryHistoryVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 库存记录Mapper接口
|
||||
|
@ -12,4 +15,5 @@ import com.ruoyi.wms.domain.vo.InventoryHistoryVo;
|
|||
*/
|
||||
public interface InventoryHistoryMapper extends BaseMapperPlus<InventoryHistory, InventoryHistoryVo> {
|
||||
|
||||
Page<InventoryHistoryVo> selectVoPageByBo(Page<Object> page, @Param("bo") InventoryHistoryBo bo);
|
||||
}
|
||||
|
|
|
@ -41,8 +41,7 @@ public class InventoryHistoryService extends ServiceImpl<InventoryHistoryMapper,
|
|||
* 查询库存记录列表
|
||||
*/
|
||||
public TableDataInfo<InventoryHistoryVo> queryPageList(InventoryHistoryBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<InventoryHistory> lqw = buildQueryWrapper(bo);
|
||||
Page<InventoryHistoryVo> result = inventoryHistoryMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
Page<InventoryHistoryVo> result = inventoryHistoryMapper.selectVoPageByBo(pageQuery.build(), bo);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,4 +4,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.wms.mapper.InventoryHistoryMapper">
|
||||
|
||||
<resultMap id="inventoryHistoryVoMap" type="com.ruoyi.wms.domain.vo.InventoryHistoryVo">
|
||||
<association property="itemSku" javaType="com.ruoyi.wms.domain.vo.ItemSkuVo" />
|
||||
<association property="item" javaType="com.ruoyi.wms.domain.vo.ItemVo" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectVoPageByBo" resultMap="inventoryHistoryVoMap">
|
||||
select
|
||||
history.*,
|
||||
sku.*,
|
||||
item.*
|
||||
from wms_inventory_history history
|
||||
left join wms_item_sku sku on history.sku_id=sku.id
|
||||
left join wms_item item on sku.item_id=item.id
|
||||
<where>
|
||||
<if test="bo.formType != null">
|
||||
history.form_type=#{bo.formType}
|
||||
</if>
|
||||
<if test="bo.itemName != null and bo.itemName != ''">
|
||||
and item.item_name like concat('%', #{bo.itemName}, '%')
|
||||
</if>
|
||||
<if test="bo.itemCode != null and bo.itemCode != ''">
|
||||
and item.item_code like concat('%', #{bo.itemCode}, '%')
|
||||
</if>
|
||||
<if test="bo.skuName != null and bo.skuName != ''">
|
||||
and sku.sku_name like concat('%', #{bo.skuName}, '%')
|
||||
</if>
|
||||
<if test="bo.skuCode != null and bo.skuCode != ''">
|
||||
and sku.sku_code like concat('%', #{bo.skuCode}, '%')
|
||||
</if>
|
||||
<if test="bo.warehouseId != null">
|
||||
and history.warehouse_id=#{bo.warehouseId}
|
||||
</if>
|
||||
<if test="bo.areaId != null">
|
||||
and history.area_id=#{bo.areaId}
|
||||
</if>
|
||||
<if test="bo.startTime != null and bo.startTime != '' and bo.endTime != null and bo.endTime != ''">
|
||||
and (history.create_time between #{bo.startTime} and #{bo.endTime})
|
||||
</if>
|
||||
</where>
|
||||
order by history.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in a new issue