whyclxw
3 天以前 a4e25fc0cd113518980305af3c061892b1b24b14
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.dto.Statistic.*;
import com.whyc.pojo.db_param.AppParam;
import com.whyc.pojo.db_user.User;
import com.whyc.service.*;
import com.whyc.util.ActionUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
import java.util.Map;
 
@RestController
@Api(tags = "统计管理")
@RequestMapping("statistic")
public class StatisticController {
    @Autowired
    private StationInfService stationInfService;
 
    @Autowired
    private BatttestdataInfService battTinfService;
 
    @Autowired
    private BattInfService battService;
 
    @Autowired
    private PowerInfService powerInfService;
 
    @Autowired
    private DeviceStateService deviceStateService;
 
    @Autowired
    private AppParamService appParamService;
 
    @ApiOperation(value = "电源信息统计(1.2.1/1.2.13)")
    @PostMapping("getPowerStatistic")
    public Response getPowerStatistic(@RequestBody StationStic stic){
        User uinf= ActionUtil.getUser();
        stic.setUid(uinf.getId());
        return powerInfService.getPowerStatistic(stic);
    }
 
    @ApiOperation(value = "设备信息统计(1.2.2)")
    @PostMapping("getDevStatistic")
    public Response getDevStatistic(@RequestBody StationStic stic){
        User uinf= ActionUtil.getUser();
        stic.setUid(uinf.getId());
        return battService.getDevStatistic(stic);
    }
 
    @ApiOperation(value = "蓄电池组信息统计(1.2.3/1.2.12)")
    @PostMapping("getBattStatistic")
    public Response getBattStatistic(@RequestBody StationStic stic){
        User uinf= ActionUtil.getUser();
        stic.setUid(uinf.getId());
        return battService.getBattStatistic(stic);
    }
 
    @ApiOperation(value = "单节数量统计(1.2.4)")
    @PostMapping("getMonStatistic")
    public Response getMonStatistic(@RequestBody MonStic stic){
        User uinf= ActionUtil.getUser();
        stic.setUid(uinf.getId());
        Map<String,Object> map= battTinfService.getMonStatistic(stic);
        return new Response().setII(1,true,map,"单节数量统计");
    }
 
    @ApiOperation(value = "本年度已放电数量统计(1.2.5)")
    @PostMapping("getDischr5Statistic")
    public Response getDischr5Statistic(@RequestBody DisChargeStic stic){
        User uinf= ActionUtil.getUser();
        stic.setUid(uinf.getId());
        return battTinfService.getDischr5Statistic(stic);
    }
    @ApiOperation(value = "本年度未放电数量统计(1.2.6)")
    @PostMapping("getDischr6Statistic")
    public Response getDischr6Statistic(@RequestBody DisChargeStic stic){
        User uinf= ActionUtil.getUser();
        stic.setUid(uinf.getId());
        /*if(stic.getTypeList()==null||stic.getTypeList().size()==0){
            stic.setStopReasonType(0);
        }else{
            stic.setStopReasonType(1);
        }*/
        return battTinfService.getDischr6Statistic(stic);
    }
    @ApiOperation(value = "优良电源数量统计(1.2.7)")
    @PostMapping("getPwr7Statistic")
    public Response getPwr7Statistic(@RequestBody Pwr7Stic stic) throws NoSuchFieldException, IllegalAccessException {
        User uinf= ActionUtil.getUser();
        stic.setUid(uinf.getId());
        return battTinfService.getPwr7Statistic(stic);
    }
    @ApiOperation(value = "电池组电池性能统计(优秀,劣化,损坏<按照容量统计>)统计(1.2.8/9/10)")
    @PostMapping("getPerformanceStatistic")
    public Response getPerformanceStatistic(@RequestBody PerformanceStic stic){
        User uinf= ActionUtil.getUser();
        stic.setUid(uinf.getId());
        return battTinfService.getPerformanceStatistic(stic);
    }
 
    @ApiOperation(value = "电池组电池性能统计(劣化<按照单体电压+内阻统计>)统计(1.2.9)")
    @PostMapping("getPerVolAndRes9Statistic")
    public Response getPerVolAndRes9Statistic(@RequestBody PerformanceStic stic){
        User uinf= ActionUtil.getUser();
        stic.setUid(uinf.getId());
        return battTinfService.getPerVolAndRes9Statistic(stic);
    }
 
 
 
    @ApiOperation(value = "站点信息统计(1.2.11)")
    @PostMapping("getStationStatistic")
    public Response getStationStatistic(@RequestBody StationStic stic){
        User uinf= ActionUtil.getUser();
        stic.setUid(uinf.getId());
        return stationInfService.getStationStatistic(stic);
    }
 
    @ApiOperation(value = "蓄电池核容信息统计(1.2.14)")
    @PostMapping("getBattTinfStatistic")
    public Response getBattTinfStatistic(@RequestBody BattTinfStic stic){
        User uinf= ActionUtil.getUser();
        stic.setUid(uinf.getId());
        return battTinfService.getBattTinfStatistic(stic);
    }
    @ApiOperation(value = "蓄电池组对比分析界面(同一品牌同一时间)(1.2.15)")
    @PostMapping("getBattCompare15Statistic")
    public Response getBattCompare15Statistic(@RequestBody BattCompareStic stic){
        User uinf= ActionUtil.getUser();
        stic.setUid(uinf.getId());
        return battTinfService.getBattCompare15Statistic(stic);
    }
 
    @ApiOperation(value = "蓄电池组对比分析界面(不同品牌同一时间)(1.2.16)")
    @PostMapping("getBattCompare16Statistic")
    public Response getBattCompare16Statistic(@RequestBody BattCompareStic stic){
        User uinf= ActionUtil.getUser();
        stic.setUid(uinf.getId());
        return battTinfService.getBattCompare16Statistic(stic);
    }
 
    @ApiOperation(value = "蓄电池组对比分析界面(同一品牌不同时间)(1.2.17)")
    @PostMapping("getBattCompare17Statistic")
    public Response getBattCompare17Statistic(@RequestBody BattCompareStic stic){
        User uinf= ActionUtil.getUser();
        stic.setUid(uinf.getId());
        return battTinfService.getBattCompare17Statistic(stic);
    }
 
    @ApiOperation(value = "设备工作状态统计(1.2.21)")
    @PostMapping("getDeviceStateStatistic")
    public Response getDeviceStateStatistic(@RequestBody DeviceStateStic stic){
        User uinf= ActionUtil.getUser();
        stic.setUid(uinf.getId());
        return deviceStateService.getDeviceStateStatistic(stic);
    }
 
    @ApiOperation(value = "设置权重(1.2.16)")
    @PostMapping("setHehavior")
    public Response setHehavior(@RequestBody List<AppParam> List){
        return appParamService.setHehavior(List);
    }
 
    @ApiOperation(value = "读取权重(1.2.16)")
    @GetMapping("getHehavior")
    public Response getHehavior(){
        return appParamService.getHehavior();
    }
 
 
}