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
package com.fgkj.actions;
 
import java.util.List;
 
import com.fgkj.dto.BattInf;
import com.fgkj.dto.Cmcc_Power_Data;
import com.fgkj.dto.ServiceModel;
import com.fgkj.services.Cmcc_Power_DataService;
 
public class Cmcc_Power_DataAction extends ActionUtil{
    private Cmcc_Power_DataService service = new Cmcc_Power_DataService();
    private String json;
    private String result;
    
    public String add() {
        Cmcc_Power_Data cpd = getGson().fromJson(json, Cmcc_Power_Data.class);
        ServiceModel model = service.add(cpd);
        result = tojson(model);
        return SUCCESS;
        
    }
    public String update() {
        Cmcc_Power_Data cpd = getGson().fromJson(json, Cmcc_Power_Data.class);
        ServiceModel model = service.update(cpd);
        result = tojson(model);
        return SUCCESS;    
    }
    public String delete() {
        Cmcc_Power_Data cpd = getGson().fromJson(json, Cmcc_Power_Data.class);
        ServiceModel model = service.delete(cpd);
        result = tojson(model);
        return SUCCESS;    
    }
    
    //根据电池组id查询cmcc实时表中的实时电流画柱状图
    public String serchByCondition(){
        BattInf binf = getGson().fromJson(json, BattInf.class);
        ServiceModel model = service.serchByCondition(binf);
        result = tojson(model);
        return SUCCESS;    
    }
    
    public String getResult() {
        return result;
    }
    
    public void setJson(String json) {
        this.json = json;
    }    
    
}