feat(wms): 新增钢卷报表查询接口和解锁功能

- 添加 queryReportList 方法用于轻量级报表数据查询
- 新增 listForReport 控制器接口返回必要字段提升传输性能
- 创建 WmsMaterialCoilReportVo 类定义报表数据结构
- 添加 unlockCoil 方法解除钢卷锁定状态
- 实现 unlockCoil 控制器接口支持 PUT 请求
- 更新数据库映射配置移除多余关联查询字段
- 优化报表查询 SQL 仅返回必要字段提升查询效率
This commit is contained in:
2026-05-19 14:18:18 +08:00
parent d50bbb1ce3
commit af3c6314a0
6 changed files with 115 additions and 2 deletions

View File

@@ -314,6 +314,15 @@ public interface IWmsMaterialCoilService {
*/
String queryEarliestHotRolledMaterial(String enterCoilNo);
/**
* 查询钢卷报表数据(轻量级,仅返回必要字段)
* 使用与分页列表相同的查询条件,但只返回少量字段以提升传输性能
*
* @param bo 查询条件
* @return 报表数据
*/
List<WmsMaterialCoilReportVo> queryReportList(WmsMaterialCoilBo bo);
/**
* 退火报表导出数据列表(按 coilIds
*
@@ -322,6 +331,15 @@ public interface IWmsMaterialCoilService {
*/
List<WmsMaterialCoilAnnealExportVo> queryAnnealExportList(WmsMaterialCoilBo bo);
/**
* 解除钢卷锁定状态
* 将钢卷的 exclusiveStatus 字段设置为 0
*
* @param coilId 钢卷ID
* @return 操作结果
*/
Boolean unlockCoil(@NotNull(message = "钢卷ID不能为空") Long coilId);
/**
* 导出异常报表(按 coilIds联查钢卷信息、异常信息、改判原因
* 一个钢卷可能对应多个异常,钢卷信息合并居中,异常信息逐条显示

View File

@@ -3050,6 +3050,17 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
return wmsMaterialCoilDeliveryExportVos;
}
/**
* 查询钢卷报表数据(轻量级,仅返回必要字段)
* 使用与分页列表相同的查询条件,但只返回少量字段以提升传输性能
*/
@Override
@Transactional(readOnly = true)
public List<WmsMaterialCoilReportVo> queryReportList(WmsMaterialCoilBo bo) {
QueryWrapper<WmsMaterialCoil> lqw = buildQueryWrapperPlus(bo);
return baseMapper.selectPageReportList(lqw);
}
/**
* 退火报表导出:按 coilIds 查询钢卷 + 退火计划联查数据
*/
@@ -5709,5 +5720,20 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
return material;
}
@Override
public Boolean unlockCoil(Long coilId) {
if (coilId == null) {
throw new RuntimeException("钢卷ID不能为空");
}
WmsMaterialCoil coil = baseMapper.selectById(coilId);
if (coil == null) {
throw new RuntimeException("钢卷不存在");
}
LambdaUpdateWrapper<WmsMaterialCoil> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(WmsMaterialCoil::getCoilId, coilId)
.set(WmsMaterialCoil::getExclusiveStatus, 0);
return baseMapper.update(null, updateWrapper) > 0;
}
}