whycrzh
2021-01-28 9f05d9863af714b206bdfffe2096d60a942c9d23
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
177
178
179
180
181
182
183
184
package com.fgkj.controller.ram;
 
import com.fgkj.dto.BattInf;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_log;
import com.fgkj.dto.ram.Fbs9100_setparam;
import com.fgkj.mapper.FBS9100_ComBase;
import com.fgkj.mapper.UinfDaoFactory;
import com.fgkj.services.User_logService;
import com.fgkj.services.ram.Fbs9100_setparamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import java.util.List;
 
@RequestMapping("fbs9100SetParam")
@RestController
@Api(tags = "fbs9100SetParam接口")
public class Fbs9100_setparamController{
 
    @Resource
    private Fbs9100_setparamService service;
 
    @Resource
    private User_logService uservice;
 
    //根据机房编号和维护区查询放电机房的信息和放电参数
    @GetMapping("byCondition")
    @ApiOperation(notes = "",value="机房编号和维护区查询放电机房的信息和放电参数")
    public ServiceModel serchByCondition(@RequestBody BattInf binf){
        // BattInf binf = getGson().fromJson(json, BattInf.class);
        ServiceModel model = service.serchByCondition(binf);
        return model;
    }
 
     //根据设备id查询设备的放电参数
    @GetMapping("devParamById")
    @ApiOperation(notes = "",value="设备id查询设备的放电参数")
    public ServiceModel serchdevParam(@RequestBody BattInf binf){
        ServiceModel model = service.serchdevParam(binf);
        return model;
    }
 
    //弹出框的确定操作
    @PutMapping("update")
    @ApiOperation(notes = "",value="弹出框的确定操作")
    public ServiceModel update(@RequestBody Fbs9100_setparam fbs) {
        ServiceModel model = service.update(fbs);
        {   String msg="";
            if(fbs.getNum()==FBS9100_ComBase.CMD_SetDischargeParm){
                 msg="修改"+fbs.getDev_id()+"的设备放电参数";
            }else if(fbs.getNum()==FBS9100_ComBase.CMD_Start){
                 msg="启动"+fbs.getDev_id()+"的设备放电";
            }else if(fbs.getNum()==FBS9100_ComBase.CMD_Stop){
                 msg="停止"+fbs.getDev_id()+"的设备放电";
            }
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
        return model;
    }
 
    //离线养护功能
    @PutMapping("maintain")
    @ApiOperation(notes = "",value="离线养护功能")
    public ServiceModel updateMaintain(@RequestBody Fbs9100_setparam fbs) {
        ServiceModel model = service.updateMaintain(fbs);
        {   String msg="";
        if(fbs.getOp_cmd()==FBS9100_ComBase.CMD_SetOffLineYHParam){
             msg="设置"+fbs.getDev_id()+"的设备离线养护功能";
        }else if(fbs.getOp_cmd()==FBS9100_ComBase.CMD_StartOffLine){
             msg="启动"+fbs.getDev_id()+"的设备离线养护功能";
        }else if(fbs.getOp_cmd()==FBS9100_ComBase.CMD_StopOffLine){
             msg="停止"+fbs.getDev_id()+"的设备离线养护功能";
        }else if(fbs.getOp_cmd()==FBS9100_ComBase.CMD_GetOffLineYHParam){
             msg="读取"+fbs.getDev_id()+"的设备离线养护功能";
        }else if(fbs.getOp_cmd()==FBS9100_ComBase.CMD_ResetSystem){
             msg="重启"+fbs.getDev_id()+"的设备";
        }
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
 
        return model;
    }
 
    //点击弹出框的设定按钮,修改ld6测试参数
    @PutMapping("ld6Param")
    @ApiOperation(notes = "",value="点击弹出框的设定按钮,修改ld6测试参数")
    public ServiceModel updateld6Param(@RequestBody Fbs9100_setparam fbs){
        ServiceModel model = service.updateld6Param(fbs);
        {   String msg="";
            if(fbs.getNum()==FBS9100_ComBase.CMD_SetDischargeParm){
                 msg="修改"+fbs.getDev_id()+"的设备放电参数";
            }else if(fbs.getNum()==FBS9100_ComBase.CMD_Start){
                 msg="启动"+fbs.getDev_id()+"的设备放电";
            }else if(fbs.getNum()==FBS9100_ComBase.CMD_Stop){
                 msg="停止"+fbs.getDev_id()+"的设备放电";
            }
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
 
        return model;
    }
 
    //点击弹出框的设定按钮,修改61850测试参数
    @PutMapping("61850Param")
    @ApiOperation(notes = "",value="点击弹出框的设定按钮,修改61850测试参数")
    public ServiceModel update61850Param(@RequestBody Fbs9100_setparam fbs){
        ServiceModel model = service.update61850Param(fbs);
        {   String msg="";
            if(fbs.getNum()==FBS9100_ComBase.CMD_SetDischargeParm){
                 msg="修改"+fbs.getDev_id()+"的设备放电参数";
            }else if(fbs.getNum()==FBS9100_ComBase.CMD_Start){
                 msg="启动"+fbs.getDev_id()+"的设备放电";
            }else if(fbs.getNum()==FBS9100_ComBase.CMD_Stop){
                 msg="停止"+fbs.getDev_id()+"的设备放电";
            }
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
 
        return model;
    }
    
    //右键查看参数和弹出框的刷新按钮
    @GetMapping("byDevId")
    @ApiOperation(notes = "",value="右键查看参数和弹出框的刷新按钮")
    public ServiceModel serchbyDev_id(@RequestBody Fbs9100_setparam fsparam) {
        ServiceModel model = service.serchbyDev_id(fsparam);
        return model;
    }
    
    //实时刷新放电表格的电池组状态(集合)
    @GetMapping("byInfo")
    @ApiOperation(notes = "",value="实时刷新放电表格的电池组状态(集合)")
    public ServiceModel serchByInfo(@RequestBody List<BattInf> binf){
        // List<BattInf> binf = getGson().fromJson(json, new TypeToken<List<BattInf>>(){}.getType());
        ServiceModel model = service.serchByInfo(binf);
        return model;
    }
    
    //根据电池组id查询电池组内前五的内阻数据(修改为前10)
    @GetMapping("byThirdBatt")
    @ApiOperation(notes = "",value="电池组id查询电池组内前五的内阻数据(修改为前10)")
    public ServiceModel serchByThirdBatt(@RequestBody BattInf binf){
        ServiceModel model = service.serchByThirdBatt(binf);
        return model;
    }
 
    //-----------跨域实现(启动,停止)设备放电
    @PutMapping("update_ky")
    @ApiOperation(tags = "跨域", notes = "",value="跨域实现(启动,停止)设备放电")
    public ServiceModel update_ky(@RequestBody Fbs9100_setparam fbs) {
        {   String msg="";
            if(fbs.getNum()==FBS9100_ComBase.CMD_SetDischargeParm){
                 msg="修改"+fbs.getDev_id()+"的设备放电参数";
            }else if(fbs.getNum()==FBS9100_ComBase.CMD_Start){
                 msg="启动"+fbs.getDev_id()+"的设备放电";
            }else if(fbs.getNum()==FBS9100_ComBase.CMD_Stop){
                 msg="停止"+fbs.getDev_id()+"的设备放电";
            }else if(fbs.getNum()==FBS9100_ComBase.CMD_GetDischargeParm){
                 msg="获取"+fbs.getDev_id()+"的设备放电参数";
            }
        }
        ServiceModel model = service.update(fbs);
 
        return model;
    }
 
 
    //-----------跨域根据机房编号和维护区查询放电机房的信息和放电参数
    @GetMapping("byCondition_ky")
    @ApiOperation(tags = "跨域", notes = "",value="跨域根据机房编号和维护区查询放电机房的信息和放电参数")
    public ServiceModel serchByCondition_ky(@RequestBody BattInf binf){
        ServiceModel model = service.serchByCondition(binf);
        return model;
    }
 
    
}