3 天以前 83e1b4d0e661f11a407fd6ea86e906b9b87b7180
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
40
41
42
43
44
45
46
47
48
49
50
51
package cn.iocoder.yudao.module.mes.controller.admin.pro.ai;
 
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.mes.controller.admin.pro.ai.vo.*;
import cn.iocoder.yudao.module.mes.service.pro.ai.MesProAiService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
 
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 
@Tag(name = "管理后台 - MES 生产 AI 辅助分析")
@RestController
@RequestMapping("/mes/pro/ai")
public class MesProAiController {
 
    @Resource
    private MesProAiService proAiService;
 
    @PostMapping("/predict-material")
    @Operation(summary = "AI 物料短缺预测")
    @PreAuthorize("@ss.hasPermission('mes:pro-work-order:query')")
    public CommonResult<MesProAiMaterialPredictRespVO> predictMaterial(@Valid @RequestBody MesProAiMaterialPredictReqVO reqVO) {
        return success(proAiService.predictMaterial(reqVO));
    }
 
    @PostMapping("/predict-duration")
    @Operation(summary = "AI 生产计划时长预测")
    @PreAuthorize("@ss.hasPermission('mes:pro-work-order:query')")
    public CommonResult<MesProAiDurationPredictRespVO> predictDuration(@Valid @RequestBody MesProAiDurationPredictReqVO reqVO) {
        return success(proAiService.predictDuration(reqVO));
    }
 
    @PostMapping("/predict-risk")
    @Operation(summary = "AI 生产风险预测")
    @PreAuthorize("@ss.hasPermission('mes:pro-work-order:query')")
    public CommonResult<MesProAiRiskPredictRespVO> predictRisk(@Valid @RequestBody MesProAiRiskPredictReqVO reqVO) {
        return success(proAiService.predictRisk(reqVO));
    }
 
    @PostMapping("/predict-delivery")
    @Operation(summary = "AI 是否能按时交付")
    @PreAuthorize("@ss.hasPermission('mes:pro-work-order:query')")
    public CommonResult<MesProAiDeliveryPredictRespVO> predictDelivery(@Valid @RequestBody MesProAiDeliveryPredictReqVO reqVO) {
        return success(proAiService.predictDelivery(reqVO));
    }
 
}