feat(wms): 添加钢卷实测尺寸功能并优化库位排序
- 在WmsMaterialCoil实体类中新增actualLength和actualWidth字段 - 在WmsMaterialCoilBo业务对象中添加实测长度宽度属性 - 在WmsMaterialCoilVo视图对象中增加Excel导出注解配置 - 更新MyBatis映射文件添加实测尺寸数据库字段映射 - 实现根据实测长度宽度的查询过滤功能 - 优化库位排序逻辑,增加全局交错排序辅助字段 - 添加库位层级排序键和库位ID键用于精确排序控制
This commit is contained in:
@@ -160,5 +160,15 @@ public class WmsMaterialCoil extends BaseEntity {
|
||||
|
||||
// 父钢卷id
|
||||
private String parentCoilId;
|
||||
|
||||
/**
|
||||
* 实测长度
|
||||
*/
|
||||
private BigDecimal actualLength;
|
||||
|
||||
/**
|
||||
* 实测宽度
|
||||
*/
|
||||
private BigDecimal actualWidth;
|
||||
}
|
||||
|
||||
|
||||
@@ -260,5 +260,15 @@ public class WmsMaterialCoilBo extends BaseEntity {
|
||||
// 已绑定钢卷列表中,未发货(status=0)的排在前面
|
||||
@TableField(exist = false)
|
||||
private Boolean statusFirst;
|
||||
|
||||
/**
|
||||
* 实测长度
|
||||
*/
|
||||
private BigDecimal actualLength;
|
||||
|
||||
/**
|
||||
* 实测宽度
|
||||
*/
|
||||
private BigDecimal actualWidth;
|
||||
}
|
||||
|
||||
|
||||
@@ -429,5 +429,17 @@ public class WmsMaterialCoilVo extends BaseEntity {
|
||||
* 明细单价
|
||||
*/
|
||||
private BigDecimal bindDetailUnitPrice;
|
||||
|
||||
/**
|
||||
* 实测长度
|
||||
*/
|
||||
@ExcelProperty(value = "实测长度")
|
||||
private BigDecimal actualLength;
|
||||
|
||||
/**
|
||||
* 实测宽度
|
||||
*/
|
||||
@ExcelProperty(value = "实测宽度")
|
||||
private BigDecimal actualWidth;
|
||||
}
|
||||
|
||||
|
||||
@@ -469,6 +469,10 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
}
|
||||
// 新增长度
|
||||
qw.eq(bo.getLength() != null, "mc.length", bo.getLength());
|
||||
// 实测长度
|
||||
qw.eq(bo.getActualLength() != null, "mc.actual_length", bo.getActualLength());
|
||||
// 实测宽度
|
||||
qw.eq(bo.getActualWidth() != null, "mc.actual_width", bo.getActualWidth());
|
||||
// 如果actualWarehouseId不为空,则根据实际库区ID进行查询 如果为-1,则查询无库区的数据
|
||||
if (bo.getActualWarehouseId() != null) {
|
||||
if (bo.getActualWarehouseId() == -1) {
|
||||
@@ -663,11 +667,12 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
qw.orderByAsc("mc.status = 1");
|
||||
qw.orderByAsc("mc.status");
|
||||
} else if (Boolean.TRUE.equals(bo.getOrderBy())) {
|
||||
// 再按实际库位ID升序(库位ID为自增,升序即可满足“先生成的库位在前”)
|
||||
// - 否则:保持原有创建时间倒序
|
||||
// MySQL: false(0) < true(1),因此 "IS NULL" 升序可实现非空在前、空值在后
|
||||
// 按库位全局排序号排序
|
||||
qw.orderByAsc("mc.actual_warehouse_id IS NULL");
|
||||
qw.orderByAsc("mc.actual_warehouse_id");
|
||||
// 全局交错排序(仅三/四级):使用 SQL 中计算好的辅助字段,避免 MP 注入拦截
|
||||
qw.orderByAsc("aw_sort_key");
|
||||
qw.orderByAsc("aw_layer_key");
|
||||
qw.orderByAsc("aw_id_key");
|
||||
} else {
|
||||
//根据创建时间倒叙
|
||||
qw.orderByDesc("mc.create_time");
|
||||
|
||||
Reference in New Issue
Block a user