库存分配跟库存查询区分
This commit is contained in:
+3
@@ -244,4 +244,7 @@ public class MaterialInventoryDO extends MaterialBaseDO {
|
|||||||
@ApiModelProperty("LOT编号")
|
@ApiModelProperty("LOT编号")
|
||||||
@Excel(name = "LOT编号")
|
@Excel(name = "LOT编号")
|
||||||
private String lotNumber;
|
private String lotNumber;
|
||||||
|
|
||||||
|
/** 为 true 时 SQL 排除库存数量为 0(含 null 视为 0) */
|
||||||
|
private Boolean excludeZeroInventoryQuantity;
|
||||||
}
|
}
|
||||||
+4
@@ -185,4 +185,8 @@ public class MaterialInventoryDTO extends MaterialBaseDTO {
|
|||||||
@Excel(name = "冻结数量大于0条件")
|
@Excel(name = "冻结数量大于0条件")
|
||||||
private String greaterThanFreezeQuantity;
|
private String greaterThanFreezeQuantity;
|
||||||
|
|
||||||
|
/** 为 true 时排除库存数量为 0 的行(出库分配选库存用);库存查询页不传或 false */
|
||||||
|
@ApiModelProperty(value = "是否排除库存数量为0", example = "false")
|
||||||
|
private Boolean excludeZeroInventoryQuantity;
|
||||||
|
|
||||||
}
|
}
|
||||||
+6
-2
@@ -48,11 +48,15 @@ public class MaterialInventoryApi extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 分页查询物料库存列表
|
* 分页查询物料库存列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation("查询物料库存列表")
|
@ApiOperation(value = "查询物料库存列表", notes = "库存查询页不传 excludeZeroInventoryQuantity 可查出数量为0;出库分配页传 excludeZeroInventoryQuantity=true 排除库存数量为0")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(MaterialInventoryDTO materialInventoryDTO,
|
public TableDataInfo list(MaterialInventoryDTO materialInventoryDTO,
|
||||||
@RequestParam(value = "customerName", required = false) String customerName)
|
@RequestParam(value = "customerName", required = false) String customerName,
|
||||||
|
@RequestParam(value = "excludeZeroInventoryQuantity", required = false) Boolean excludeZeroInventoryQuantity)
|
||||||
{
|
{
|
||||||
|
if (Boolean.TRUE.equals(excludeZeroInventoryQuantity)) {
|
||||||
|
materialInventoryDTO.setExcludeZeroInventoryQuantity(true);
|
||||||
|
}
|
||||||
// 出库分配前端传的是客户名称 customerName,这里通过名称查询货主ID,使用精确匹配(不模糊匹配)
|
// 出库分配前端传的是客户名称 customerName,这里通过名称查询货主ID,使用精确匹配(不模糊匹配)
|
||||||
String shipperName = null; // 保存查询到的货主名称
|
String shipperName = null; // 保存查询到的货主名称
|
||||||
if (StringUtils.isNotBlank(customerName) && materialInventoryDTO.getShipperId() == null) {
|
if (StringUtils.isNotBlank(customerName) && materialInventoryDTO.getShipperId() == null) {
|
||||||
|
|||||||
@@ -183,6 +183,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="freezeQuantity != null ">
|
<if test="freezeQuantity != null ">
|
||||||
and a.freeze_quantity = #{freezeQuantity}
|
and a.freeze_quantity = #{freezeQuantity}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="excludeZeroInventoryQuantity != null and excludeZeroInventoryQuantity == true">
|
||||||
|
and COALESCE(a.inventory_quantity, 0) > 0
|
||||||
|
</if>
|
||||||
|
|
||||||
<if test="createByName != null and createByName != ''">
|
<if test="createByName != null and createByName != ''">
|
||||||
and a.create_by_name like concat('%', #{createByName}, '%')
|
and a.create_by_name like concat('%', #{createByName}, '%')
|
||||||
|
|||||||
Reference in New Issue
Block a user