whycrzh
2021-01-28 c8332186836b3dfe1fbd32d7bec7cd29a57e1888
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
package com.fgkj.controller;
 
import com.fgkj.dto.*;
import com.fgkj.services.Batt_rtstateService;
import com.fgkj.util.ActionUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
 
@RequestMapping("battRtState")
@RestController
@Api(tags = "battRtState接口")
public class Batt_rtstateController{
 
    @Resource
    private Batt_rtstateService service;
 
    ServiceModel model = new ServiceModel();
 
    // private Batt_rtstate rtstate;
 
    //实时监测中的查询实时组端信息
    @GetMapping("byCondition")
    @ApiOperation(notes = "",value="实时监测中的查询实时组端信息")
    public ServiceModel serchByCondition(@RequestBody Batt_rtstate rtstate){
        //System.out.println("开始查询rtstate");
        ServiceModel model=service.serchByCondition(rtstate);
        //System.out.println(model);
        // result = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").toJson(model);
        return model;
    }
    
    //9.1根据查询电池组单体的实时数据(电池单体实时信息)
    @GetMapping("byMons")
    @ApiOperation(notes = "",value="查询电池组单体的实时数据(电池单体实时信息)")
    public ServiceModel serchByMons(@RequestBody BattInf binf){
        // BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
        ServiceModel model = service.serchByMons(binf);
        return model;
    }
    
    //根据电池组id查询该电池组/单体的实时情况(电池续航能力)
    @GetMapping("byInfo")
    @ApiOperation(notes = "",value="电池组id查询该电池组/单体的实时情况(电池续航能力)")
    public ServiceModel serchByInfo(@RequestBody BattInf binf){
        // BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
        ServiceModel model = service.serchByInfo(binf);
        return model;
    }
    
    //查询电池组的实时状态(电池组状态查询<放电,充电>)
//    public ServiceModel serchBattState(){
//        Batt_Maint_Dealarm bmd = ActionUtil.getGson().fromJson(json, Batt_Maint_Dealarm.class);
//        ServiceModel model = service.serchBattState(bmd);
//        result = ActionUtil.tojson(model);
//        return model;
//    }
    //首页上饼状图电池状态比例
    @GetMapping("battStateRate")
    @ApiOperation(notes = "",value="首页上饼状图电池状态比例")
    public ServiceModel serchBattStateRate(){
        User_inf uinf=(User_inf) ActionUtil.getUser();
        ServiceModel model = service.serchBattStateRate(uinf);
        return model;
    }
    
    //电池组实时情况+实时电池续航能力查询
    @GetMapping("battLife")
    @ApiOperation(notes = "",value="电池组实时情况+实时电池续航能力查询")
    public ServiceModel serchBattLife(@RequestBody Batt_Maint_Dealarm bmd){
        System.out.println("bmd = " + bmd);
        // Batt_Maint_Dealarm bmd = ActionUtil.getGson().fromJson(json, Batt_Maint_Dealarm.class);
        User_inf uinf=(User_inf) ActionUtil.getUser();
        bmd.setUinf(uinf);
        ServiceModel model = service.serchBattLife(bmd);
        return model;
    }
    
    //测试数据——实时查询中左下角的充放电统计(旧)
    @GetMapping("disOrCharge")
    @ApiOperation(notes = "",value="测试数据——实时查询中左下角的充放电统计(旧)")
    public ServiceModel serchDisOrChargr(){
        ServiceModel model = service.serchDisOrChargr();
        return model;
    }
    
    //测试数据——实时查询中左下角的充放电统计(用户管理的机房)
    @GetMapping("disOrCharge2")
    @ApiOperation(notes = "",value="测试数据——实时查询中左下角的充放电统计(用户管理的机房)")
    public ServiceModel serchDisOrChargrNew(){
        User_inf uinf=(User_inf) ActionUtil.getUser();
        ServiceModel model = service.serchDisOrChargrNew(uinf);
        return model;
    }
    //实时监测中的查询实时组端信息        <!--   跨域访问 --->
    @GetMapping("byCondition_ky")
    @ApiOperation(notes = "跨域访问",value="实时监测中的查询实时组端信息")
    public ServiceModel serchByCondition_ky(@RequestBody Batt_rtstate rtstate){
        //ActionUtil.isAllowHeaders();                //允许跨域访问
        // rtstate = ActionUtil.getGson().fromJson(json, Batt_rtstate.class);
        ServiceModel model=service.serchByCondition_ky(rtstate);
        // result = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").toJson(model);
        return model;
    }
 
}