| | |
| | | import com.iailab.framework.common.pojo.PageResult; |
| | | import com.iailab.framework.common.util.object.BeanUtils; |
| | | import com.iailab.module.model.mcs.pre.entity.MmPredictAlarmMessageEntity; |
| | | 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.pre.service.MmPredictAlarmMessageService; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmMessagePageReqVO; |
| | | import com.iailab.module.model.mcs.pre.vo.MmPredictAlarmMessageRespVO; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | import java.util.List; |
| | | |
| | | import static com.iailab.framework.common.pojo.CommonResult.success; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private MmPredictAlarmMessageService mmPredictAlarmMessageService; |
| | | |
| | | @Autowired |
| | | private MmItemOutputService mmItemOutputService; |
| | | |
| | | @Autowired |
| | | private DmModuleItemService dmModuleItemService; |
| | | |
| | | @Autowired |
| | | private DmModuleService dmModuleService; |
| | | |
| | | @PostMapping("/create") |
| | | @Operation(summary = "创建预警消息") |
| | |
| | | @Operation(summary = "删除预警消息") |
| | | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| | | @PreAuthorize("@ss.hasPermission('pre:alarm-message:delete')") |
| | | public CommonResult<Boolean> deleteTenant(@RequestParam("id") String id) { |
| | | public CommonResult<Boolean> delete(@RequestParam("id") String id) { |
| | | mmPredictAlarmMessageService.delete(id); |
| | | return success(true); |
| | | } |
| | |
| | | @GetMapping("/page") |
| | | @Operation(summary = "获得预警消息分页") |
| | | @PreAuthorize("@ss.hasPermission('pre:alarm-message:query')") |
| | | public CommonResult<PageResult<MmPredictAlarmMessageRespVO>> getTenantPage(@Valid MmPredictAlarmMessagePageReqVO pageVO) { |
| | | public CommonResult<PageResult<MmPredictAlarmMessageRespVO>> getPage(@Valid MmPredictAlarmMessagePageReqVO pageVO) { |
| | | PageResult<MmPredictAlarmMessageEntity> pageResult = mmPredictAlarmMessageService.page(pageVO); |
| | | return success(BeanUtils.toBean(pageResult, MmPredictAlarmMessageRespVO.class)); |
| | | } |
| | | |
| | | @PostMapping("/list-out") |
| | | @Operation(summary = "获得预警消息列表") |
| | | public CommonResult<List<MmPredictAlarmMessageRespVO>> getListByOut(@RequestBody MmPredictAlarmMessagePageReqVO pageVO) { |
| | | List<String> itemIds = mmItemOutputService.getItemIdByOut(pageVO.getOutIds()); |
| | | List<String> moduleIds = dmModuleItemService.getModuleIdByItemId(itemIds); |
| | | List<String> moduleList = dmModuleService.geModuleByIds(moduleIds); |
| | | List<MmPredictAlarmMessageEntity> list = mmPredictAlarmMessageService.getList(moduleList, pageVO.getPredictTime()); |
| | | return success(BeanUtils.toBean(list, MmPredictAlarmMessageRespVO.class)); |
| | | } |
| | | } |