库存查询根据查询维度分组插叙;

This commit is contained in:
王奎兴
2026-02-07 15:40:56 +08:00
parent ea4b53b041
commit de7c40e6ce
5 changed files with 87 additions and 8 deletions
@@ -23,10 +23,16 @@ import java.util.List;
*/
public interface MaterialInventoryMapper extends BaseMapper<MaterialInventory>
{
/**
* 查询物料库存列表
*/
//查全部
public List<MaterialInventoryPO> queryList(MaterialInventoryDO materialInventoryDO);
//查物料库存列表-物料/库位
public List<MaterialInventoryPO> queryListByWlKw(MaterialInventoryDO materialInventoryDO);
//查物料库存列表-库位
public List<MaterialInventoryPO> queryListByKw(MaterialInventoryDO materialInventoryDO);
//查物料库存列表-物料
public List<MaterialInventoryPO> queryListByWl(MaterialInventoryDO materialInventoryDO);
//查物料库存列表-货主
public List<MaterialInventoryPO> queryListByHz(MaterialInventoryDO materialInventoryDO);
/**
* @description 批量增加库存
@@ -48,7 +48,20 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
@Override
public List<MaterialInventoryPO> queryList(MaterialInventoryDO materialInventoryDO)
{
return materialInventoryMapper.queryList(materialInventoryDO);
String queryRule = materialInventoryDO.getQueryRule();
if ("hz".equals(queryRule)) {
return materialInventoryMapper.queryListByHz(materialInventoryDO);
} else if ("wl".equals(queryRule)) {
return materialInventoryMapper.queryListByWl(materialInventoryDO);
} else if ("kw".equals(queryRule)) {
return materialInventoryMapper.queryListByKw(materialInventoryDO);
} else if ("wlkw".equals(queryRule)) {
return materialInventoryMapper.queryListByWlKw(materialInventoryDO);
} else if ("all".equals(queryRule)) {
return materialInventoryMapper.queryList(materialInventoryDO);
} else {
throw new ServiceException("查询规则不存在");
}
}
/**
@@ -365,4 +378,4 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
public MaterialInventoryPO selectOneByWhere(MaterialInventoryDO materialInventoryDO) {
return materialInventoryMapper.selectOneByWhere(materialInventoryDO);
}
}
}
@@ -226,4 +226,7 @@ public class MaterialInventoryDO extends MaterialBaseDO {
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "ExtAttr4", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date extAttr4;
//查询规则 hz:货主,wl:物料,kw:库位,wlkw:物料库位,all:全部
private String queryRule;
}
@@ -159,4 +159,6 @@ public class MaterialInventoryDTO extends MaterialBaseDTO {
@ApiModelProperty("箱号/卡板号")
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
}
//查询规则 hz:货主,wl:物料,kw:库位,wlkw:物料库位,all:全部
private String queryRule;
}