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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package com.fgkj.services.bts61850;
 
import java.util.List;
 
import com.fgkj.dao.BaseDAO;
import com.fgkj.dao.BaseDAOFactory;
import com.fgkj.dao.FBS9100_ComBase;
import com.fgkj.dao.impl.BattInfImpl;
import com.fgkj.dao.impl.Batt_rtdataDAOImpl;
import com.fgkj.dao.impl.Ld9.LD9_setparamImpl;
import com.fgkj.dao.impl.bts61850.BTS_61850_setparamImpl;
import com.fgkj.dto.BTS_61850_setparam;
import com.fgkj.dto.BattInf;
import com.fgkj.dto.LD9_setparam;
import com.fgkj.dto.ServiceModel;
 
public class BTS_61850_setparamService {
    private BaseDAO dao;
    private ServiceModel model;
    
    public BTS_61850_setparamService() {
        super();
        this.dao =BaseDAOFactory.getBaseDAO(BaseDAO.BTS_61850_SETPARAM);
        this.model = new ServiceModel();
    }
    
     //弹出框的确定操作(修改参数信息,不包含修改命令)
    public ServiceModel update(Object obj) {
        BTS_61850_setparam bts=(BTS_61850_setparam) obj;
        Boolean b=dao.update(obj);
        if(b){
                model.setCode(1);
                model.setMsg("修改成功!");
            }else{
                model.setCode(0);
                model.setMsg("设置FBS_61850参数失败,请检查网络!");
            }
        return model;    
    }
     //修改命令(启动和停止)
    public ServiceModel updateCMd(Object obj) {
        BTS_61850_setparam bts=(BTS_61850_setparam) obj;
        boolean bl=((BTS_61850_setparamImpl)dao).sendCmdTo61850Dev(bts.getNum(), bts.getFBSDeviceId());
        if(bl){
                model.setCode(1);
                model.setMsg("修改成功!");
         }else{
                model.setCode(0);
                model.setMsg("修改FBS_61850参数失败,请检查网络!");
         }
        return model;    
    }
     //根据机房编号和维护区查询放电机房的信息和放电参数
    public ServiceModel serchByCondition(Object obj){
        BattInf binf=(BattInf) obj;
        List list=dao.serchByCondition(obj);
        if(list!=null&&list.size()>0){
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
            
        }else{
            model.setCode(0);
            model.setData(list);
            model.setMsg("查询失败!");
        }
        return model;
    } 
    
    //右键查看参数(读取参数)
    public ServiceModel serchbyDev_id(Object obj) {
        List list=((BTS_61850_setparamImpl)dao).serchbyDev_id(obj);
        if(list!=null&&list.size()>0){
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setMsg("读取BS_61850参数失败,请检查网络!");
        }
        //System.out.println(model.getData());
        return model;    
    }
    
    
    //根据电池组id查询电池组内前五的内阻数据
    public ServiceModel serchByThirdBatt(Object obj){
        List list=(new Batt_rtdataDAOImpl()).serchByThirdBatt(obj);
        if(list!=null&&list.size()>0){
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setMsg("查询失败!");
        }
        return model;
    }
}