package cn.iocoder.yudao.module.mes.controller.admin.trace.batch; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.mes.controller.pub.trace.vo.MesProTracePublicRespVO; import cn.iocoder.yudao.module.mes.service.trace.MesProTracePublicService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; import jakarta.validation.constraints.NotBlank; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @Tag(name = "管理后台 - MES 批次追溯") @RestController @RequestMapping("/mes/trace/batch") @Validated public class MesTraceBatchController { @Resource private MesProTracePublicService traceService; @GetMapping("/detail") @Operation(summary = "查询统一批次追溯详情") @Parameter(name = "code", description = "批次码、临时批次码、袋码或托盘码", required = true, example = "BAG-202608280001") @PreAuthorize("@ss.hasPermission('mes:trace-batch:query')") public CommonResult getBatchTraceDetail( @RequestParam("code") @NotBlank(message = "追溯码不能为空") String code) { return success(traceService.queryTrace(code)); } }