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
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
package com.fgkj.controller;
 
import com.fgkj.util.*;
 
import com.fgkj.dto.BattInf;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_battgroup_baojigroup_battgroup;
import com.fgkj.dto.User_inf;
import com.fgkj.services.User_battgroup_baojigroup_battgroupService;
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 javax.annotation.Resource;
 
@RequestMapping("baojiGroupBattGroup")
@RestController
@Api(tags = "baojiGroupBattGroup接口")
public class User_battgroup_baojigroup_battgroupController{
    
    @Resource
    private User_battgroup_baojigroup_battgroupService service;
 
    //根据用户UId查询对应的机房以及电池组
    @GetMapping("byCondition")
    @ApiOperation(notes = "",value="用户UId查询对应的机房以及电池组")
    public ServiceModel serchByCondition(@RequestBody User_inf userInf) {
//        userInf.setuId(1003);
//        User_inf user_inf = new User_inf();
        System.out.println("userInf.getuId() = " + userInf.getuId());
        ServiceModel model = service.serchByCondition(userInf);
 
        return model;
    }
    
    /*//5.3删除选取的电池组(根据baoji_group_id,battgroupid,stationid)
    public ServiceModel delete() {
        ServiceModel model=new ServiceModel();
        boolean flag=true;
        if(result!=null){
            List<User_battgroup_baojigroup_battgroup> list=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,new TypeToken<List<User_battgroup_baojigroup_battgroup>>(){}.getType());
            if(list!=null && list.size()>0){
                for (User_battgroup_baojigroup_battgroup ubbb : list) {
                    model=service.delete(ubbb);
                    if(model.code==0){
                        flag=false;
                    }
                }
            }
        }
        if(flag){
            model.setCode(1);
            model.setMsg("删除电池组成功!");
        }else{
            model.setCode(0);
            model.setMsg("删除电池组失败!");
        }
        
        return model;
    }*/
    //5.3删除选取的电池组(根据baoji_group_id,battgroupid,stationid)
    @DeleteMapping("/")
    @ApiOperation(notes = "",value="删除选取的电池组(根据baoji_group_id,battgroupid,stationid)")
    public ServiceModel delete(@RequestBody List<User_battgroup_baojigroup_battgroup> list) {
        ServiceModel model=service.delPro(list);
        
        return model;
    }
    //5.3包机组重做(穿梭框)删除
    @DeleteMapping("proCs")
    @ApiOperation(notes = "",value="包机组重做(穿梭框)删除")
    public ServiceModel delPro_CS(@RequestBody List<User_battgroup_baojigroup_battgroup> list) {
        ServiceModel model=service.delPro_CS(list);
        
        return model;
    }
    //5.3添加选取电池组或者机房或者维护区(点击应用)
    @PostMapping("/")
    @ApiOperation(notes = "",value="添加选取电池组或者机房或者维护区(点击应用)")
    public ServiceModel add(@RequestBody List<User_battgroup_baojigroup_battgroup> list){
        ServiceModel model=service.add(list);
        
        return model;
    }
    //包机组重做(穿梭框)查询所有的用户
    @PostMapping("proCs")
    @ApiOperation(notes = "",value="包机组重做(穿梭框)查询所有的用户")
    public ServiceModel addPro_CS(@RequestBody List<User_battgroup_baojigroup_battgroup> list){
        ServiceModel model=service.addPro_CS(list);
        return model;
    }
    
    
    /**
     * 查询当前用户所属包机组中的所有的电池组
     * @return
     */
    @GetMapping("myBatts")
    @ApiOperation(notes = "",value="查询当前用户所属包机组中的所有的电池组")
    public ServiceModel searchMyBatts(){
        User_inf  u = (User_inf) ActionUtil.getUser();
        ServiceModel model = service.serchByCondition(u);
        
        return model;
    }
    
    //放电测试(查询用户管理的维护区)
    @GetMapping("stationName1InGroup")
    @ApiOperation(notes = "",value="放电测试(查询用户管理的维护区)")
    public ServiceModel serchStationName1InGroup(){
        User_inf u = (User_inf) ActionUtil.getUser();
        ServiceModel model = service.serchStationName1InGroup(u);
        
        return model;
    } 
    //放电测试(查询用户管理的维护区对应的机房)
    @PostMapping("stationNameInGroup")
    @ApiOperation(notes = "",value="放电测试(查询用户管理的维护区对应的机房)")
    public ServiceModel serchStationNameInGroup(@RequestBody User_inf user){
        //System.out.println(json+"***********");
        User_inf u = (User_inf) ActionUtil.getUser();
        user.setuId(u.getuId());
        //System.out.println(user);
        ServiceModel model = service.serchStationNameInGroup(user);
        
        return model;
    } 
    //放电测试(查询用户管理的维护区对应的机房对应的battgroupid)
    @PostMapping("battGroupIdInGroup")
    @ApiOperation(notes = "",value="放电测试(查询用户管理的维护区对应的机房对应的battgroupid)")
    public ServiceModel serchBattgroupidInGroup(@RequestBody User_inf user){
        User_inf u = (User_inf) ActionUtil.getUser();
        user.setuId(u.getuId());
        ServiceModel model = service.serchBattgroupidInGroup(user);
        
        return model;
    } 
    //6185下拉(查询用户管理的维护区对应的机房对应的battgroupid)
    @GetMapping("61850DevidInGroup")
    @ApiOperation(notes = "",value="6185下拉(查询用户管理的维护区对应的机房对应的battgroupid)")
    public ServiceModel serch61850DevidInGroup(){
        User_inf u = (User_inf) ActionUtil.getUser();
        ServiceModel model = service.serch61850DevidInGroup(u);
        
        return model;
    }
    
    //首页(查询用户管理的维护区对应的机房和机房ID以及设备id)
    @PostMapping("stationByStationName1")
    @ApiOperation(notes = "",value="首页(查询用户管理的维护区对应的机房和机房ID以及设备id)")
    public ServiceModel serchStationByStationName1(@RequestBody User_inf user){
        User_inf u = (User_inf) ActionUtil.getUser();
        user.setuId(u.getuId());
        ServiceModel model = service.serchStationByStationName1(user);
        
        return model;
    }
    
    //首页(查询用户管理的维护区对应的机房信息)   ->首页左侧的导航显示
    @PostMapping("stationInfoByStationName1")
    @ApiOperation(notes = "首页左侧的导航显示",value="首页(查询用户管理的维护区对应的机房信息)")
    public ServiceModel serchStationInfoByStationName1(@RequestBody User_inf user){
        User_inf u = (User_inf) ActionUtil.getUser();
        user.setuId(u.getuId());
        ServiceModel model = service.serchStationInfoByStationName1(user);
        
        return model;
    }
    //首页左侧的导航实时刷新
    @PostMapping("stationInfoNow")
    @ApiOperation(notes = "",value="首页左侧的导航实时刷新")
    public ServiceModel serchStationInfoNow(@RequestBody List<BattInf> list){
        ServiceModel model = service.serchStationInfoNow(list);
        
        return model;
    }
    
}