2 天以前 1ba0dbfde5634c8bf2ec20891d6b226b996f6b59
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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<MesProTracePublicRespVO> getBatchTraceDetail(
            @RequestParam("code") @NotBlank(message = "追溯码不能为空") String code) {
        return success(traceService.queryTrace(code));
    }
 
}