新增物料库存告警页面

master
maxw@mesnac.com 7 days ago
parent 73aa065843
commit 383e22cefe

@ -48,6 +48,17 @@ public class WmsInventoryController extends BaseController {
return wmsInventoryService.queryPageList(bo, pageQuery); return wmsInventoryService.queryPageList(bo, pageQuery);
} }
/**
*
* @param bo
* @param pageQuery
* @return
*/
@GetMapping("/listInventoryAlarm")
public TableDataInfo<WmsInventoryVo> listInventoryAlarm(WmsInventoryBo bo, PageQuery pageQuery) {
return wmsInventoryService.listInventoryAlarm(bo, pageQuery);
}
/** /**
* *
*/ */

@ -4,6 +4,8 @@ import org.dromara.common.tenant.core.TenantEntity;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.io.Serial; import java.io.Serial;
@ -156,12 +158,12 @@ public class BaseMaterialInfo extends TenantEntity {
/** /**
* *
*/ */
private Long maxStockAmount; private BigDecimal maxStockAmount;
/** /**
* *
*/ */
private Long minStockAmount; private BigDecimal minStockAmount;
/** /**
* *

@ -95,6 +95,7 @@ public class WmsInventory{
private String warehouseCode;//字段映射 private String warehouseCode;//字段映射
@TableField(exist = false) @TableField(exist = false)
private String materialCode;//字段映射 private String materialCode;//字段映射
private String warehouseId;
} }

@ -8,6 +8,8 @@ import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*; import jakarta.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
@ -158,12 +160,12 @@ public class BaseMaterialInfoBo extends BaseEntity {
/** /**
* *
*/ */
private Long maxStockAmount; private BigDecimal maxStockAmount;
/** /**
* *
*/ */
private Long minStockAmount; private BigDecimal minStockAmount;
/** /**
* *

@ -76,5 +76,6 @@ public class WmsInventoryBo extends BaseEntity {
@NotNull(message = "仓库ID不能为空", groups = { AddGroup.class, EditGroup.class }) @NotNull(message = "仓库ID不能为空", groups = { AddGroup.class, EditGroup.class })
private Long storeId; private Long storeId;
private String tenantId; private String tenantId;
private String warehouseId;
} }

@ -1,5 +1,6 @@
package org.dromara.wms.domain.vo; package org.dromara.wms.domain.vo;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.wms.domain.BaseMaterialInfo; import org.dromara.wms.domain.BaseMaterialInfo;
@ -201,13 +202,13 @@ public class BaseMaterialInfoVo implements Serializable {
* *
*/ */
@ExcelProperty(value = "最大库存数量") @ExcelProperty(value = "最大库存数量")
private Long maxStockAmount; private BigDecimal maxStockAmount;
/** /**
* *
*/ */
@ExcelProperty(value = "最小库存数量") @ExcelProperty(value = "最小库存数量")
private Long minStockAmount; private BigDecimal minStockAmount;
/** /**
* *

@ -113,6 +113,9 @@ public class WmsInventoryVo implements Serializable {
private String warehouseCode;//字段映射 private String warehouseCode;//字段映射
private String materialCode;//字段映射 private String materialCode;//字段映射
private String warehouseId;
private BigDecimal maxStockAmount;
private BigDecimal minStockAmount;
} }

@ -3,10 +3,12 @@ package org.dromara.wms.mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.wms.domain.WmsInventory; import org.dromara.wms.domain.WmsInventory;
import org.dromara.wms.domain.bo.WmsInventoryBo;
import org.dromara.wms.domain.vo.WmsInventoryVo; import org.dromara.wms.domain.vo.WmsInventoryVo;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
/** /**
* Mapper * Mapper
@ -17,4 +19,6 @@ import java.math.BigDecimal;
public interface WmsInventoryMapper extends BaseMapperPlus<WmsInventory, WmsInventoryVo> { public interface WmsInventoryMapper extends BaseMapperPlus<WmsInventory, WmsInventoryVo> {
BigDecimal materailCount(@Param("entity") WmsInventory wmsInventory); BigDecimal materailCount(@Param("entity") WmsInventory wmsInventory);
List<WmsInventoryVo> listInventoryAlarm(@Param("entity")WmsInventoryBo bo);
} }

@ -79,4 +79,6 @@ public interface IWmsInventoryService {
int updateWmsInventorys(ArrayList<WmsInventory> updateList); int updateWmsInventorys(ArrayList<WmsInventory> updateList);
int deletePlanList(ArrayList<Long> ids); int deletePlanList(ArrayList<Long> ids);
TableDataInfo<WmsInventoryVo> listInventoryAlarm(WmsInventoryBo bo, PageQuery pageQuery);
} }

@ -152,6 +152,17 @@ public class WmsInventoryServiceImpl implements IWmsInventoryService {
} }
@Override
public TableDataInfo<WmsInventoryVo> listInventoryAlarm(WmsInventoryBo bo, PageQuery pageQuery) {
List<WmsInventoryVo> wmsInventoryVos = baseMapper.listInventoryAlarm(bo);
Page<WmsInventoryVo> page = new Page<>();
page.setRecords(wmsInventoryVos);
page.setTotal(wmsInventoryVos.size());
page.setCurrent(pageQuery.getPageNum());
page.setSize(pageQuery.getPageSize());
return TableDataInfo.build(page);
}
@Override @Override
public int deletePlanList(ArrayList<Long> ids) { public int deletePlanList(ArrayList<Long> ids) {
return baseMapper.deleteByIds(ids); return baseMapper.deleteByIds(ids);

@ -13,4 +13,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where where
x.material_id = #{entity.materialId} x.material_id = #{entity.materialId}
</select> </select>
<select id="listInventoryAlarm" resultType="org.dromara.wms.domain.vo.WmsInventoryVo"
parameterType="org.dromara.wms.domain.bo.WmsInventoryBo">
SELECT
x.material_id,
SUM(x.inventory_qty) inventory_qty,
x.warehouse_id,
MAX(b.min_stock_amount) min_stock_amount,
MAX(b.max_stock_amount) max_stock_amount,
MAX(c.warehouse_code) warehouse_code,
MAX(d.material_code) material_code,
MAX(x.lock_state) lock_state,
MAX(x.inventory_status) inventory_status,
MAX(x.material_categories) material_categories,
MAX(x.location_code) locationCode,
MAX(x.batch_code) batchCode
FROM
hwmom.dbo.wms_inventory x
left join base_material_info b on
x.material_id = b.material_id
left join wms_base_warehouse c on
x.warehouse_id = c.warehouse_id
left join base_material_info d
on
x.material_id = d.material_id
<where>
<if test="entity.materialId != null ">and x.material_id = #{entity.materialId}</if>
<if test="entity.warehouseId != null and entity.warehouseId != ''">and x.warehouse_id = #{entity.warehouseId}</if>
</where>
group by
x.warehouse_id ,
x.material_id
</select>
</mapper> </mapper>

Loading…
Cancel
Save