whycrzg
2021-02-23 351b9a53cb9ecebdf8f79db0117f540d9c42c2a4
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
package com.fgkj.controller.ram;
 
import com.fgkj.dto.BattInf;
import com.fgkj.dto.PageBean;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_inf;
import com.fgkj.dto.ram.Fbs9100_state;
import com.fgkj.mapper.FBS9100_ComBase;
import com.fgkj.services.ram.Fbs9100_stateService;
import com.fgkj.util.ActionUtil;
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("fbs9100State")
@RestController
@Api(tags = "fbs9100State接口")
public class Fbs9100_stateController{
 
    @Resource
    private Fbs9100_stateService service;
 
    @PostMapping("/")
    @ApiOperation(notes = "dev_id 唯一 {\n" +
            "  \"dev_ip\": \"\",\n" +
            "  \"dev_id\": 618500009,\n" +
            "  \"op_cmd\": 0,\n" +
            "  \"dev_datetime\": \"\",\n" +
            "  \"dev_testtype\": 0,\n" +
            "  \"dev_testgroupnum\": 0,\n" +
            "  \"dev_workstate\": 0,\n" +
            "  \"dev_alarmstate\": 0,\n" +
            "  \"dev_onlinevollow\": 0,\n" +
            "  \"dev_eachgroup_battsum\": 0,\n" +
            "  \"dev_captest_onlinevol\": 0.0,\n" +
            "  \"dev_captest_groupvol\": 0.0,\n" +
            "  \"dev_captest_curr\": 0.0,\n" +
            "  \"dev_captest_cap\": 0.0,\n" +
            "  \"dev_captest_timelong\": 0,\n" +
            "  \"dev_restest_moncount\": 0,\n" +
            "  \"dev_restest_monindex\": 0,\n" +
            "  \"dev_commcount\": 0,\n" +
            "  \"dev_errcommcount\": 0\n" +
            "}",value="添加")
    public ServiceModel add(@RequestBody Fbs9100_state state) {
        // Fbs9100_state state = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Fbs9100_state.class);
        ServiceModel model = service.add(state);
        return model;
        
    }
 
    @PutMapping("/")
    @ApiOperation(notes = "{\n" +
            "\t\"dev_ip\":\"\",\n" +
            "    \"dev_id\":\"-\",\n" +
            "    \"op_cmd\":\"-\",\n" +
            "    \"dev_datetime\":\"-\",\n" +
            "    \"dev_testtype\":\"-\",\n" +
            "    \"dev_testgroupnum\":\"-\",\n" +
            "    \"dev_workstate\":\"-\",\n" +
            "    \"dev_alarmstate\":\"-\",\n" +
            "    \"dev_onlinevollow\":\"-\",\n" +
            "    \"dev_eachgroup_battsum\":\"-\",\n" +
            "    \"dev_captest_onlinevol\":\"-\",\n" +
            "    \"dev_captest_groupvol\":\"-\",\n" +
            "    \"dev_captest_curr\":\"-\",\n" +
            "    \"dev_captest_cap\":\"-\",\n" +
            "    \"dev_captest_timelong\":\"-\",\n" +
            "    \"dev_restest_moncount\":\"-\",\n" +
            "    \"dev_restest_monindex\":\"-\",\n" +
            "    \"dev_commcount\":\"-\",\n" +
            "    \"dev_errcommcount\":\"-\",\n" +
            "    \"num\":\"-\"\n" +
            "}",value="修改")
    public ServiceModel update(@RequestBody Fbs9100_state state) {
        // Fbs9100_state state = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Fbs9100_state.class);
        ServiceModel model = service.update(state);
        return model;
    }
 
    //fbs9600设备内阻测试
    @PutMapping("/updatePro")
    @ApiOperation(notes = "[\n" +
            "  {\n" +
            "    \"op_cmd\": \"1\",\n" +
            "    \"dev_id\": \"-\"\n" +
            "  }\n" +
            "]",value="fbs9600设备内阻测试")
    public ServiceModel updatePro(@RequestBody List<Fbs9100_state> list) {
        // List<Fbs9100_state> list =getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, new TypeToken<List<Fbs9100_state>>(){}.getType());
        ServiceModel model = service.updatePro(list);
        return model;
    }
 
    @DeleteMapping("/")
    @ApiOperation(notes = "",value="删除")
    public ServiceModel delete(@RequestParam Integer num) {
        Fbs9100_state state = new Fbs9100_state();
        state.setNum(num);
        // Fbs9100_state state = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Fbs9100_state.class);
        ServiceModel model = service.delete(state);
        return model;
    }
 
    //FBS9600设备内阻测试显示全部9600设备的信息
    @GetMapping("byUid")
    @ApiOperation(notes = "",value="FBS9600设备内阻测试显示全部9600设备的信息")
    public ServiceModel searchByUid(){
        User_inf uinf=(User_inf) ActionUtil.getUser();
        ServiceModel model = service.searchByUid(uinf);
        return model;
    }
 
    //11.1FBS9100设备通信状态查询
    @PostMapping("byCondition")
    @ApiOperation(notes = "",value="FBS9100设备通信状态查询")
    public ServiceModel serchByCondition(@RequestParam Integer dev_errcommcount,@RequestParam Integer pageNum,@RequestParam Integer pageSize) {
        Fbs9100_state state = new Fbs9100_state();
        state.setDev_errcommcount(dev_errcommcount);
        PageBean pageBean = new PageBean();
        pageBean.setPageNum(pageNum);
        pageBean.setPageSize(pageSize);
        state.setPageBean(pageBean);
        User_inf uinf=(User_inf) ActionUtil.getUser();
        state.setNum(uinf.getuId());//将用户id存放在Fbs9100_state的num中用于处理用户管理的机房问题
        ServiceModel model = service.serchByCondition(state);
 
        return model;
    }
 
    //实时监测界面根据dev_alarmstate状态判断接触器状态
    @PostMapping("contactorState")
    @ApiOperation(notes = "",value="实时监测界面根据dev_alarmstate状态判断接触器状态")
      public ServiceModel serchContactorState(@RequestParam Integer dev_id) {
        Fbs9100_state state = new Fbs9100_state();
        state.setDev_id(dev_id);
        ServiceModel model = service.serchContactorState(state);
 
        return model;
      }
 
      //放电测试界面根据设备id查询网络拓扑图
    @PostMapping("byInfo")
    @ApiOperation(notes = "",value="放电测试界面根据设备id查询网络拓扑图")
      public ServiceModel serchByInfo(@RequestParam Integer battGroupId) {
        BattInf binf = new BattInf();
        binf.setBattGroupId(battGroupId);
        ServiceModel model = service.serchByInfo(binf);
 
        return model;
      }
 
      @GetMapping("all")
    @ApiOperation(notes = "",value="all")
    public ServiceModel searchAll(){
        ServiceModel model = service.searchAll();
 
        return model;
    }
 
    //实时界面左侧导航实时查询61850设备是否存在4种告警
    @GetMapping("by61850Alarms")
    @ApiOperation(notes = "",value="实时界面左侧导航实时查询61850设备是否存在4种告警")
      public ServiceModel serchBy61850Alarms(){
        ServiceModel model = service.serchBy61850Alarms();
 
        return model;
      }
 
   //查询61850设备的6种工作状态
    @PostMapping("devWorkState")
    @ApiOperation(notes = "",value="查询61850设备的6种工作状态")
      public ServiceModel searchDevWorkstate(@RequestParam Integer dev_id,@RequestParam Integer dev_workstate){
        Fbs9100_state state = new Fbs9100_state();
        state.setDev_id(dev_id);
        state.setDev_workstate(dev_workstate);
        User_inf uinf=(User_inf) ActionUtil.getUser();
        //用户id暂存在num中
        state.setNum(uinf.getuId());
          ServiceModel model = service.searchDevWorkstate(state);
 
        return model;
      }
 
   //导航上实时查询61850设备的处于核容测试的数据
    @GetMapping("61850NuclearCap")
    @ApiOperation(notes = "",value="导航上实时查询61850设备的处于核容测试的数据")
      public ServiceModel seach6185Nuclear_cap(){
        User_inf uinf=(User_inf) ActionUtil.getUser();
          ServiceModel model = service.seach6185Nuclear_cap(uinf, FBS9100_ComBase.DEV_NUCLEAR_CAP);
 
        return model;
      }
 
  //11.1FBS9100设备通信状态查询                 <--     跨域    -->
    @GetMapping("byConditionKy")
    @ApiOperation(tags = "跨域", notes = "",value="FBS9100设备通信状态查询 跨域")
      public ServiceModel serchByCondition_ky(){
          //isAllowHeaders();                                                //允许跨域访问
        ServiceModel model = service.serchByCondition_ky();
 
          return model;
      }
 
    
    
}