| | |
| | | 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.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | 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") |
| | | @ConditionalOnProperty(prefix = "yudao.ai", name = "enabled", havingValue = "true") |
| | | public class MesProAiController { |
| | | |
| | | @Resource |
| | |
| | | |
| | | @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)); |
| | | } |