lxw
2020-07-11 9db52f2f2dd3665fe9da1ae5657e0167c3a34d40
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
package com.fgkj.actions;
 
import java.util.List;
 
import com.fgkj.dao.impl.BattPower_offImpl;
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;
 
public class BattPower_offAction extends ActionUtil{
    private BattPower_offService service = new BattPower_offService();
    private String json;            //传入数据
    private String result;            //传出数据
    
    public String add() {
        BattPower_off bpo = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattPower_off.class);
        ServiceModel model = service.add(bpo);
        result = tojson(model);
        return SUCCESS;
        
    }
    public String update() {
        BattPower_off bpo = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattPower_off.class);
        ServiceModel model = service.update(bpo);
        result = tojson(model);
        return SUCCESS;    
    }
    public String delete() {
        BattPower_off bpo = getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattPower_off.class);
        ServiceModel model = service.delete(bpo);
        result = tojson(model);
        return SUCCESS;        
    }
    
     //机房断电统计查询
     /*
     * 时间段选择放在:binf的battproductdate*/
     public String serchByCondition(){
        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);
        result = tojson(model);
        return SUCCESS;    
    } 
     
    //机房断电统计(首页上的饼状图)
    public String serchPowerOff(){
        User_inf uinf=(User_inf) ActionUtil.getUser();
        ServiceModel model = service.serchPowerOff(uinf);
        result = tojson(model);              
        return SUCCESS;
    }
    
    public String searchAll(){
        ServiceModel model = service.searchAll();
        result = tojson(model);
        return SUCCESS;    
    }
    public String getResult() {
        return result;
    }
    public void setJson(String json) {
        this.json = json;
    }
    
    
}