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
package com.fgkj.controller.ram;
 
import com.fgkj.dto.BattInf;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_inf;
import com.fgkj.dto.User_log;
import com.fgkj.dto.ram.Fbs9600_state;
import com.fgkj.mapper.FBS9100_ComBase;
import com.fgkj.mapper.UinfDaoFactory;
import com.fgkj.services.User_logService;
import com.fgkj.services.ram.Fbs9600_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("fbs9600State")
@RestController
@Api(tags = "fbs9600State接口")
public class Fbs9600_stateController{
 
    @Resource
    private Fbs9600_stateService service;
 
    @Resource
    private User_logService uservice;
 
    @PostMapping("/")
    @ApiOperation(notes = "",value="添加")
    public ServiceModel add(@RequestBody Fbs9600_state state) {
        ServiceModel model = service.add(state);
 
        return model;
        
    }
 
    //bts显示屏启动放电
    @PutMapping("/")
    @ApiOperation(notes = "",value="bts显示屏启动放电")
    public ServiceModel update(@RequestBody Fbs9600_state state) {
        ServiceModel model = service.update(state);
        {   String msg="";
            if(state.getNum()==FBS9100_ComBase.CMD_Start){
                 msg="启动"+state.getDev_id()+"的设备放电";
            }else if(state.getNum()==FBS9100_ComBase.CMD_Stop){
                 msg="停止"+state.getDev_id()+"的设备放电";
            }
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
 
        return model;
    }
 
    //fbs9600设备内阻测试
    @PutMapping("updatePro")
    @ApiOperation(notes = "",value="fbs9600设备内阻测试")
    public ServiceModel updatePro(@RequestBody List<Fbs9600_state> list) {
        ServiceModel model = service.updatePro(list);
 
        return model;
    }
 
    @DeleteMapping("/")
    @ApiOperation(notes = "",value="删除")
    public ServiceModel delete(@RequestBody Fbs9600_state state) {
        ServiceModel model = service.delete(state);
 
        return model;
    }
 
    //11.1FBS9600设备通信状态查询
    @GetMapping("byCondition")
    @ApiOperation(notes = "",value="FBS9600设备通信状态查询")
    public ServiceModel serchByCondition(@RequestBody Fbs9600_state state){
        User_inf uinf=(User_inf) ActionUtil.getUser();
        state.setNum(uinf.getuId());//将用户id存放在Fbs9100_state的num中用于处理用户管理的机房问题
        ServiceModel model = service.serchByCondition(state);
 
        return model;
    } 
    
     //放电测试添加fbs9600设备的添加电池组的操作
    @GetMapping("byInfo")
    @ApiOperation(notes = "",value="放电测试添加fbs9600设备的添加电池组的操作")
    public ServiceModel serchByInfo(@RequestBody BattInf binf){
        ServiceModel model= service.serchByInfo(binf);
 
        return model;
    }
 
   //FBS9600设备内阻测试显示全部9600设备的信息(改为将9600内阻数据放在9100state表中)
    @GetMapping("byUid")
    @ApiOperation(notes = "",value="FBS9600设备内阻测试显示全部9600设备的信息(改为将9600内阻数据放在9100state表中)")
    public ServiceModel searchByUid(){
        User_inf uinf=(User_inf) ActionUtil.getUser();
        ServiceModel model = service.searchByUid(uinf);
 
        return model;
    } 
    
 
    
}