feat(mes/roll): 扩展磨削记录查询功能,新增班组与轧辊类型筛选

在磨削记录查询接口中新增以下筛选条件:
1. 班组(team)
2. 轧辊类型(rollType)

调整涉及服务接口、控制器、Mapper及XML映射文件,将原有的时间范围和产线筛选扩展为支持多维度查询。调整前,查询仅支持按轧辊ID、产线ID和时间范围筛选;调整后,新增班组和轧辊类型条件,提升查询灵活性与业务分析能力。同时优化SQL查询,通过关联mes_roll_info表获取轧辊类型,并在返回结果中新增rollType字段。
This commit is contained in:
2026-06-02 14:22:55 +08:00
parent cd3b25fa30
commit b7d47a5d9d
6 changed files with 28 additions and 19 deletions

View File

@@ -26,17 +26,19 @@ public class MesRollGrindController extends BaseController {
private final IMesRollGrindService iMesRollGrindService;
/** 查询磨削记录列表(不传 rollId 时返回全部,支持时间范围产线筛选) */
/** 查询磨削记录列表(不传 rollId 时返回全部,支持时间范围产线、班组、轧辊类型筛选) */
@GetMapping("/list")
public R<List<MesRollGrindVo>> list(
@RequestParam(required = false) Long rollId,
@RequestParam(required = false) Long lineId,
@RequestParam(required = false) String beginTime,
@RequestParam(required = false) String endTime) {
@RequestParam(required = false) String endTime,
@RequestParam(required = false) String team,
@RequestParam(required = false) String rollType) {
if (rollId != null) {
return R.ok(iMesRollGrindService.listByRoll(rollId));
}
return R.ok(iMesRollGrindService.listByQuery(null, lineId, beginTime, endTime));
return R.ok(iMesRollGrindService.listByQuery(null, lineId, beginTime, endTime, team, rollType));
}
/** 按年份查询月度汇总 */

View File

@@ -20,6 +20,7 @@ public class MesRollGrindVo {
private Date grindTime;
private String team;
private String rollType;
private BigDecimal diaBefore;
private BigDecimal diaAfter;
private BigDecimal grindAmount;

View File

@@ -20,7 +20,9 @@ public interface MesRollGrindMapper extends BaseMapperPlus<MesRollGrindMapper, M
List<MesRollGrindVo> selectList(@Param("rollId") Long rollId,
@Param("lineId") Long lineId,
@Param("beginTime") String beginTime,
@Param("endTime") String endTime);
@Param("endTime") String endTime,
@Param("team") String team,
@Param("rollType") String rollType);
/** 按年份统计每月磨削量 { month, grindCount, totalGrindAmount } */
List<Map<String, Object>> selectMonthlyStats(@Param("rollId") Long rollId, @Param("year") int year);

View File

@@ -15,7 +15,7 @@ public interface IMesRollGrindService {
List<MesRollGrindVo> listByRoll(Long rollId);
/** 通用查询(所有参数可选) */
List<MesRollGrindVo> listByQuery(Long rollId, Long lineId, String beginTime, String endTime);
List<MesRollGrindVo> listByQuery(Long rollId, Long lineId, String beginTime, String endTime, String team, String rollType);
/** 新增磨削记录,同步更新轧辊当前直径和磨削次数 */
Long addGrind(MesRollGrindBo bo);

View File

@@ -35,8 +35,8 @@ public class MesRollGrindServiceImpl implements IMesRollGrindService {
}
@Override
public List<MesRollGrindVo> listByQuery(Long rollId, Long lineId, String beginTime, String endTime) {
return baseMapper.selectList(rollId, lineId, beginTime, endTime);
public List<MesRollGrindVo> listByQuery(Long rollId, Long lineId, String beginTime, String endTime, String team, String rollType) {
return baseMapper.selectList(rollId, lineId, beginTime, endTime, team, rollType);
}
@Override