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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package com.fgkj.services.ram;
 
import java.util.List;
 
import com.fgkj.dao.BaseDAO;
import com.fgkj.dao.BaseDAOFactory;
import com.fgkj.dao.impl.BadBatt_monImpl;
import com.fgkj.dao.impl.BattInfImpl;
import com.fgkj.dao.impl.Batt_enduranceImpl;
import com.fgkj.dao.impl.Battalarm_dataDAOImpl;
import com.fgkj.dao.impl.ram.Bts_station_stateImpl;
import com.fgkj.dto.Battalarm_data;
import com.fgkj.dto.ServiceModel;
 
public class Bts_station_stateService {
    private ServiceModel model;
    private BaseDAO dao;
    
    public Bts_station_stateService() {
        super();
        model=new ServiceModel();
        dao=BaseDAOFactory.getBaseDAO(BaseDAO.BTS_STATION_STATE);
    }
    //查询机房实时状态
    public ServiceModel serchByCondition(Object 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.setMsg("查询失败!");
        }
        return model;    
    }
    //查询当前机房停电数
    public ServiceModel serchByState(Object obj) {
        int nums=((Bts_station_stateImpl)dao).serchByState(obj);
        model.setNewsum(nums);
        return model;    
    }
    //机房断电统计(首页上的饼状图)
    public ServiceModel serchPowerOff(Object obj){
        int powerNum=((Bts_station_stateImpl)dao).serchByState(obj);    //断电实时数
        int dianzhanNum=((Bts_station_stateImpl)dao).serchByState_diaozhan(obj);    //掉站实时数
        int devNum=(new BattInfImpl()).serchByDeviceId(obj);        //总设备数
        model.setSum(powerNum);
        model.setNewsum(devNum);
        model.setCode(dianzhanNum);
        return model;
    }
  //地图右下角显示出已安装机房中(停电数/掉站数/机房告警数/落后单体机房数)
    public ServiceModel serchStationState(Object obj){
        int powerNum=((Bts_station_stateImpl)dao).serchByState(obj);    //停电实时数
        int dianzhanNum=((Bts_station_stateImpl)dao).serchByState_diaozhan(obj);    //掉站实时数
        int badbattNum=(new BadBatt_monImpl()).searchBadBattInStation(obj);//存在落后单体的机房个数
        int alarmNum=(new Battalarm_dataDAOImpl()).searchAlarmInStation(obj);//存在电池告警的机房个数
        int xuhangnums=(new Batt_enduranceImpl()).serchxuhangNotInThree(obj); //存在续航不足3小时的机房个数
        int devNum=(new BattInfImpl()).serchByDeviceId(obj);        //总设备数
        model.setSum(powerNum);//停电实时数
        model.setCode(dianzhanNum);//掉站实时数
        model.setNewsum(devNum);    //总设备数
        model.setMsgN(String.valueOf(badbattNum));//存在落后单体的机房个数
        model.setMsg(String.valueOf(alarmNum));//存在电池告警的机房个数
        model.setMsgT(String.valueOf(xuhangnums));//存在续航不足3小时的机房个数
        return model;
    }
    //查询设备SD卡的实时状态<根据设备id来查>
    public ServiceModel serchSDCard(Object obj) {
        int station_state=((Bts_station_stateImpl)dao).serchSDCard(obj);
        model.setData(station_state);
        return model;
    }
}