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
66
67
68
69
70
71
72
73
74
75
76
77
package com.fgkj.actions.bts61850;
 
import com.fgkj.actions.ActionUtil;
import com.fgkj.dao.FBS9100_ComBase;
import com.fgkj.dao.UinfDaoFactory;
import com.fgkj.dto.BTS_61850_setparam;
import com.fgkj.dto.BattInf;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_log;
import com.fgkj.services.User_logService;
import com.fgkj.services.bts61850.BTS_61850_setparamService;
 
public class BTS_61850_setparamAction extends ActionUtil{
    private String json;
    private String result;
    private BTS_61850_setparamService service=new BTS_61850_setparamService();
    private User_logService uservice=new User_logService();
    ///根据电池组信息查询参数
    public String serchByCondition() {
        BattInf binf=ActionUtil.getGson().fromJson(json, BattInf.class);
        ServiceModel model=service.serchByCondition(binf);
        result=tojson(model);
        return SUCCESS;
    }
    //根据设备id修改参数
    public String update() {
        BTS_61850_setparam bts=ActionUtil.getGson().fromJson(json, BTS_61850_setparam.class);
        ServiceModel model=service.update(bts);
        {   String msg="";
            msg="修改"+bts.getFBSDeviceId()+"的设备参数";
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
        result=tojson(model);
        return SUCCESS;
    }
    //根据设备id修改参数
    public String updateCMd() {
        BTS_61850_setparam bts=ActionUtil.getGson().fromJson(json, BTS_61850_setparam.class);
        ServiceModel model=service.updateCMd(bts);
        {   String msg="";
            if(bts.getNum()==FBS9100_ComBase.CMD_61850_START_HR){
                 msg="启动"+bts.getFBSDeviceId()+"的设备核容放电";
            }else if(bts.getNum()==FBS9100_ComBase.CMD_61850_START_RES){
                 msg="启动"+bts.getFBSDeviceId()+"的设备内阻放电";
            }else if(bts.getNum()==FBS9100_ComBase.CMD_61850_STOP){
                 msg="停止"+bts.getFBSDeviceId()+"的设备放电";
            }
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
        result=tojson(model);
        return SUCCESS;
    }
    //右键查看参数和弹出框的刷新按钮
    public String serchbyDev_id() {
        BTS_61850_setparam bts=ActionUtil.getGson().fromJson(json, BTS_61850_setparam.class);
        ServiceModel model = service.serchbyDev_id(bts);
        result = tojson(model);
        return SUCCESS;    
    }
    
    
    //根据电池组id查询电池组内前五的内阻数据
    public String serchByThirdBatt(){
        BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
        ServiceModel model = service.serchByThirdBatt(binf);
        result = tojson(model);
        return SUCCESS;
    }    
    public String getResult() {
        return result;
    }
    public void setJson(String json) {
        this.json = json;
    }
}