package org.jeecg.modules.mdc.subcontrol.api; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.api.vo.Result; import org.jeecg.modules.mdc.service.IEquipmentLogService; import org.jeecg.modules.mdc.subcontrol.service.MdcBigScreenService; import org.jeecg.modules.mdc.subcontrol.vo.AllEquipmentLogVo; import org.jeecg.modules.mdc.subcontrol.vo.LastWeekDataRankingVo; import org.jeecg.modules.mdc.subcontrol.vo.MdcEquipmentOpVo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @author: LiuS * @create: 2022-12-28 10:43 */ @Slf4j @RestController @RequestMapping("/outer/bigScreen") @Api(tags = "大屏接口") public class MdcBigScreenController { @Resource private MdcBigScreenService mdcBigScreenService; @Autowired private IEquipmentLogService equipmentLogService; @ApiOperation("全厂报警信息") @GetMapping("/findAlarmInfo") public Result findAlarmInfo() { List result = equipmentLogService.getALLEquipmentLog(); return Result.OK(result); } @ApiOperation("获取前7数据") @GetMapping("/findDataByLastWeek") public Result findDataByLastWeek() { Map result = mdcBigScreenService.findDataByLastWeek(); return Result.OK(result); } @ApiOperation("获取前7数据排名") @GetMapping("/findDataRankingByLastWeek") public Result findDataRankingByLastWeek() { List rankingByLastWeek = mdcBigScreenService.findDataRankingByLastWeek(); return Result.OK(rankingByLastWeek); } @ApiOperation("获取当前设备状态信息") @GetMapping("/findEquipmentStatus") public Result findEquipmentStatus() { Map result = new HashMap<>(); List list = mdcBigScreenService.findEquipmentStatus(); result.put("equipmentStatusList", list); return Result.OK(result); } @ApiOperation("获取全厂当前设备状态信息") @GetMapping("/findAllEquipmentStatus") public Result findAllEquipmentStatus() { Map result = mdcBigScreenService.findAllEquipmentStatus(); return Result.OK(result); } }