1
81041
2019-06-20 ab3c4acf83f54f8449ca8664c4a2bb79bd30f297
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
package com.fgkj.actions;
 
import java.util.List;
 
import com.fgkj.dto.Batt_param_low;
import com.fgkj.dto.RoleLimit;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.UserRole;
import com.fgkj.services.Batt_param_lowService;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.opensymphony.xwork2.ActionSupport;
 
public class Batt_param_lowAction extends ActionSupport{
    private Batt_param_lowService service=new Batt_param_lowService();
    private Batt_param_low blow;
    private ServiceModel model;
    private String blowstr;
    private String result;
    
    public String searchAll(){
        model=service.searchAll();
        result=ActionUtil.tojson(model);
        //System.out.println(result);
        return SUCCESS;        
    }
    
    public String updateAll(){
        Gson gson=new Gson();
        UserRole u=new UserRole();
        List<Batt_param_low> list = gson.fromJson(blowstr, new TypeToken<List<Batt_param_low>>(){}.getType());  
        for(int i=0;i<list.size();i++){
            model=service.update(list.get(i));
        }
        result=gson.toJson(model);
        return SUCCESS;
    }
    
    public Batt_param_low getBlow() {
        return blow;
    }
    public void setBlow(Batt_param_low blow) {
        this.blow = blow;
    }
    public String getResult() {
        return result;
    }
    public void setResult(String result) {
        this.result = result;
    }    
 
    public String getBlowstr() {
        return blowstr;
    }
 
    public void setBlowstr(String blowstr) {
        this.blowstr = blowstr;
    }
 
    public static void main(String[] args) {
        Batt_param_lowAction b=new Batt_param_lowAction();
        b.searchAll();
    }
    
}