yangbin
2025-02-19 efdecc7019261f8fdc875505281f54ef7a3bfbce
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package org.jeecg.modules.mdc.subcontrol.api;
 
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
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.jeecg.modules.mdc.vo.MdcEquipmentVo;
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<AllEquipmentLogVo> result = equipmentLogService.getALLEquipmentLog();
        return Result.OK(result);
    }
 
    @ApiOperation("获取前7数据")
    @GetMapping("/findDataByLastWeek")
    public Result findDataByLastWeek() {
        Map<String, Object> result = mdcBigScreenService.findDataByLastWeek();
        return Result.OK(result);
    }
 
    @ApiOperation("获取前7数据排名")
    @GetMapping("/findDataRankingByLastWeek")
    public Result findDataRankingByLastWeek() {
        List<LastWeekDataRankingVo> rankingByLastWeek = mdcBigScreenService.findDataRankingByLastWeek();
        return Result.OK(rankingByLastWeek);
    }
 
    @ApiOperation("获取当前设备状态信息")
    @GetMapping("/findEquipmentStatus")
    public Result findEquipmentStatus() {
        Map<String, Object> result = new HashMap<>();
        List<MdcEquipmentOpVo> list = mdcBigScreenService.findEquipmentStatus();
        result.put("equipmentStatusList", list);
        return Result.OK(result);
    }
 
    @ApiOperation("获取全厂当前设备状态信息")
    @GetMapping("/findAllEquipmentStatus")
    public Result findAllEquipmentStatus() {
        Map<String, Object> result = mdcBigScreenService.findAllEquipmentStatus();
        return Result.OK(result);
    }
 
 
}