whycrzg
2021-02-03 f3e160c4c6690232da3258adb42c1f702cd8bb07
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
package com.fgkj.controller;
 
import com.fgkj.util.*;
 
import com.fgkj.dto.BattPower_off;
import com.fgkj.dto.Batt_Maint_Dealarm;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_inf;
import com.fgkj.services.BattPower_offService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
 
@RequestMapping("battPowerOff")
@RestController
@Api(tags = "battPowerOff接口")
public class BattPower_offController{
 
    @Resource
    private BattPower_offService service;
 
    @PostMapping("/")
    @ApiOperation(notes = "",value="新增")
    public ServiceModel add(@RequestBody BattPower_off bpo) {
        // BattPower_off bpo = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattPower_off.class);
        ServiceModel model = service.add(bpo);
 
        return model;
        
    }
 
    @PutMapping("/")
    @ApiOperation(notes = "",value="修改")
    public ServiceModel update(@RequestBody BattPower_off bpo) {
        // BattPower_off bpo = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattPower_off.class);
        ServiceModel model = service.update(bpo);
 
        return model;
    }
    @DeleteMapping("/")
    @ApiOperation(notes = "",value="删除")
    public ServiceModel delete(@RequestBody BattPower_off bpo) {
        // BattPower_off bpo = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattPower_off.class);
        ServiceModel model = service.delete(bpo);
 
        return model;
    }
    
     //机房断电统计查询
     /*
     * 时间段选择放在:binf的battproductdate*/
     @GetMapping("byCondition")
     @ApiOperation(notes = "时间段选择放在:binf的battproductdate",value="机房断电统计查询")
     public ServiceModel serchByCondition(@RequestBody Batt_Maint_Dealarm bmd){
        // Batt_Maint_Dealarm bmd = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Batt_Maint_Dealarm.class);
        User_inf uinf=(User_inf) ActionUtil.getUser();
        bmd.setUinf(uinf);
        ServiceModel model = service.serchByCondition(bmd);
 
        return model;
    } 
     
    //机房断电统计(首页上的饼状图)
    @GetMapping("powerOff")
    @ApiOperation(notes = "",value="机房断电统计(首页上的饼状图)")
    public ServiceModel serchPowerOff(){
        User_inf uinf=(User_inf) ActionUtil.getUser();
        ServiceModel model = service.serchPowerOff(uinf);
 
        return model;
    }
    @GetMapping("all")
    @ApiOperation(notes = "",value="all")
    public ServiceModel searchAll(){
        ServiceModel model = service.searchAll();
 
        return model;
    }
 
    
    
}