package com.iailab.module.model.mcs.sche.controller.admin; import com.iailab.framework.common.pojo.CommonResult; import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.module.model.mcs.pre.service.DmModuleItemService; import com.iailab.module.model.mcs.pre.service.DmModuleService; import com.iailab.module.model.mcs.pre.service.MmItemOutputService; import com.iailab.module.model.mcs.sche.entity.StScheduleSuggestEntity; import com.iailab.module.model.mcs.sche.service.StScheduleSuggestService; import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestPageReqVO; import com.iailab.module.model.mcs.sche.vo.StScheduleSuggestRespVO; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; import static com.iailab.framework.common.pojo.CommonResult.success; /** * @author PanZhibao * @Description * @createTime 2025年03月20日 */ @Tag(name = "模型服务 - 调度建议") @RestController @RequestMapping("/model/sche/suggest") public class StScheduleSuggestController { @Autowired private StScheduleSuggestService stScheduleSuggestService; @Autowired private MmItemOutputService mmItemOutputService; @Autowired private DmModuleItemService dmModuleItemService; @Autowired private DmModuleService dmModuleService; @PostMapping("/list-out") @Operation(summary = "获得预警消息列表") public CommonResult> getListByOut(@RequestBody StScheduleSuggestPageReqVO pageVO) { List itemIds = mmItemOutputService.getItemIdByOut(pageVO.getOutIds()); List moduleIds = dmModuleItemService.getModuleIdByItemId(itemIds); List moduleList = dmModuleService.geModuleByIds(moduleIds); List list = stScheduleSuggestService.getList(moduleList, pageVO.getPredictTime()); return success(BeanUtils.toBean(list, StScheduleSuggestRespVO.class)); } }