111
81041
2019-11-08 71d888b87ae42888b18013627f980177c34f9509
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
package com.fgkj.actions;
 
import java.util.List;
 
import com.fgkj.dao.UinfDaoFactory;
import com.fgkj.dao.impl.Dev_paramImpl;
import com.fgkj.dto.Dev_param;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_log;
import com.fgkj.services.Dev_paramService;
import com.fgkj.services.User_logService;
 
public class Dev_paramAction extends ActionUtil{
    private Dev_paramService service=new Dev_paramService();
    private User_logService uservice=new User_logService();
    private String json;
    private String result;
    
    //修改所有设备的所有的告警参数
    public String update(){
        Dev_param dparam=ActionUtil.getGson().fromJson(json, Dev_param.class);
        ServiceModel model=service.update(dparam);
        {
            String msg="修改"+dparam.getNote()+"的"+dparam.getAlm_name()+"的参数";
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
        result = tojson(model);
        return SUCCESS;
    }
     //查询所有设备的所有的告警参数
    public String searchAll(){
        ServiceModel model=service.searchAll();
        result = tojson(model);
        return SUCCESS;
    }
    //根据设备id和告警类型查设备告警参数
    public String serchByCondition(){
        Dev_param dparam=ActionUtil.getGson().fromJson(json, Dev_param.class);
        ServiceModel model=service.serchByCondition(dparam);
        result = tojson(model);
        return SUCCESS;
    }
    //查询所有存在设备告警参数的机房
    public String serchAllDevId(){
        ServiceModel model=service.serchAllDevId();
        result = tojson(model);
        return SUCCESS;
    }
    //根据设备id查询设备对应的告警参数种类
    public String serchByInfo(){
        Dev_param dparam=ActionUtil.getGson().fromJson(json, Dev_param.class);
        ServiceModel model=service.serchByInfo(dparam);
        result = tojson(model);
        return SUCCESS;
    }
     //根据设备id查询设备所有的参数
    public String serchParamById(){
        Dev_param dparam=ActionUtil.getGson().fromJson(json, Dev_param.class);
        ServiceModel model=service.serchParamById(dparam);
        result = tojson(model);
        return SUCCESS;
    }
    public String getResult() {
        return result;
    }
    public void setJson(String json) {
        this.json = json;
    }
    
 
}