| | |
| | | import com.fgkj.dao.impl.BattDischarge_planImpl;
|
| | | import com.fgkj.dao.impl.BattInfImpl;
|
| | | import com.fgkj.dao.impl.BattMap_informationImpl;
|
| | | import com.fgkj.dao.impl.Batt_enduranceImpl;
|
| | | import com.fgkj.dao.impl.Batt_rtstateDAOImpl;
|
| | | import com.fgkj.dao.impl.Battalarm_dataDAOImpl;
|
| | | import com.fgkj.dao.impl.ram.Bts_station_stateImpl;
|
| | | import com.fgkj.dao.impl.ram.Fbs9100_stateImpl;
|
| | | import com.fgkj.db.DBUtil;
|
| | | import com.fgkj.dto.BattInf;
|
| | |
| | | //9.1录入机房信息
|
| | | public ServiceModel add(Object obj){
|
| | | Boolean bl=dao.add(obj);
|
| | | if(bl){
|
| | | model.setCode(1);
|
| | | model.setMsg("添加成功!");
|
| | | }else{
|
| | | model.setCode(0);
|
| | | model.setMsg("添加失败!");
|
| | | }
|
| | | return model;
|
| | | }
|
| | | //9.1录入机房信息(手机端)
|
| | | public ServiceModel replace(Object obj){
|
| | | Boolean bl=((BattMap_informationImpl)dao).replace(obj);
|
| | | if(bl){
|
| | | model.setCode(1);
|
| | | model.setMsg("添加成功!");
|
| | |
| | | }
|
| | | return listAll;
|
| | | }
|
| | | |
| | | //首页上查询用户管理的已经设置过位置的机房信息
|
| | | public List searchUserManageStation(Object obj){ |
| | | List<BattMap_information> list = ((BattMap_informationImpl)dao).serchInBattMapByUid(obj);
|
| | | //首页上查询用户管理的已经设置过位置的机房信息(用户管理的,l查询全部打开页面)
|
| | | public ServiceModel searchUserManageStation(Object obj){ |
| | | List list = ((BattMap_informationImpl)dao).serchInBattMapByUid(obj);
|
| | | if(list!=null&&list.size()>0){
|
| | | model.setCode(1);
|
| | | model.setData(list);
|
| | | model.setMsg("查询成功!");
|
| | | }else{
|
| | | model.setCode(0);
|
| | | model.setMsg("查询失败!");
|
| | | }
|
| | | return model;
|
| | | }
|
| | | //首页上查询用户管理的已经设置过位置的机房信息(用户管理的,分页刷新)
|
| | | public List searchUserManageStation2(Object obj){ |
| | | List<BattMap_information> list = ((BattMap_informationImpl)dao).serchInBattMapByUid2(obj);
|
| | | List listAll=new ArrayList();//存放最后的结果
|
| | | String state="";
|
| | | int numBadBatt=0;
|
| | | int numAlarm=0;
|
| | | int numPlan=0;
|
| | | int numPoff=0;
|
| | | int dianzhanNum=0;
|
| | | int xuhangNum=0;
|
| | | if(list!=null&&list.size()>0){
|
| | | for(int i=0;i<list.size();i++){ |
| | | state="item-normal";
|
| | | ServiceModel model=new ServiceModel();
|
| | | BattMap_information binformation = list.get(i);
|
| | | if(binformation.getFBSDeviceId()/100000==6185){
|
| | | BattInf binf=new BattInf();
|
| | | binf.setFBSDeviceId(binformation.getFBSDeviceId());
|
| | | state=(new Fbs9100_stateImpl().seachDevNow(binf));
|
| | | }else{
|
| | | xuhangNum=(new Batt_enduranceImpl()).serchxuhangNotInThree_stationid(binformation);//续航不足3小时数
|
| | | numPoff=(new Bts_station_stateImpl()).serchByStationId(binformation); //停电数 |
| | | dianzhanNum=(new Bts_station_stateImpl()).serchByStationId_diaozhan(binformation); //掉站数
|
| | | numBadBatt=(new BadBatt_monImpl()).serchByStationId(binformation); //落后总数
|
| | | numAlarm=(new Battalarm_dataDAOImpl()).serchByStationId(binformation); //告警总数
|
| | | //numPlan=(new BattDischarge_planImpl()).serchByStationId(binformation); //延迟总数
|
| | | if(dianzhanNum>0){ |
| | | state="item-timeout"; //掉站
|
| | | }else{
|
| | | if(numPoff>0){
|
| | | state="item-poff"; //停电
|
| | | |
| | | }else{
|
| | | if(xuhangNum>0){
|
| | | state="item-xuhang"; //续航不足
|
| | | }else{
|
| | | if(numBadBatt>0){
|
| | | state="item-behind"; //落后机房
|
| | | }else{
|
| | | if(numAlarm > 0){
|
| | | state="item-warn"; //告警机房 |
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | if("0".equals(list.get(i).getInformation())){
|
| | | state="item-install"; //若机房未安装将指定的机房设置成灰色的
|
| | | }
|
| | | model.setData(list.get(i)); |
| | | model.setMsgO(String.valueOf(numPoff)); //停电数
|
| | | model.setCode(numAlarm); //告警总数
|
| | | model.setSum(numBadBatt); //落后总数
|
| | | //model.setNewsum(numPlan); //延时总数
|
| | | model.setMsgT(String.valueOf(dianzhanNum)); //掉站
|
| | | model.setMsgV(String.valueOf(xuhangNum));//续航不足
|
| | | model.setMsg(state); //61850状态
|
| | | model.setMsgN(binformation.getFBSDeviceId().toString());
|
| | | listAll.add(model);
|
| | | }
|
| | | }
|
| | | return listAll;
|
| | | }
|
| | | //首页上查询用户管理的已经设置过位置的机房信息(用户管理的,3.根据具体id查询告警信息等)
|
| | | public List searchUserManageStation3(Object obj){ |
| | | List<BattMap_information> list = ((BattMap_informationImpl)dao).serchInBattMapByUid3(obj);
|
| | | List listAll=new ArrayList();//存放最后的结果
|
| | | String state="";
|
| | | int numBadBatt=0;
|
| | | int numAlarm=0;
|
| | | int numPlan=0;
|
| | | int numPoff=0;
|
| | | int dianzhanNum=0;
|
| | | int xuhangNum=0;
|
| | | if(list!=null&&list.size()>0){
|
| | | for(int i=0;i<list.size();i++){
|
| | | state="item-normal";
|
| | |
| | | binf.setFBSDeviceId(binformation.getFBSDeviceId());
|
| | | state=(new Fbs9100_stateImpl().seachDevNow(binf));
|
| | | }else{
|
| | | xuhangNum=(new Batt_enduranceImpl()).serchxuhangNotInThree_stationid(binformation);//续航不足3小时数
|
| | | numPoff=(new Bts_station_stateImpl()).serchByStationId(binformation); //停电数 |
| | | dianzhanNum=(new Bts_station_stateImpl()).serchByStationId_diaozhan(binformation); //掉站数
|
| | | numBadBatt=(new BadBatt_monImpl()).serchByStationId(binformation); //落后总数
|
| | | numAlarm=(new Battalarm_dataDAOImpl()).serchByStationId(binformation); //告警总数
|
| | | numPlan=(new BattDischarge_planImpl()).serchByStationId(binformation); //延迟总数
|
| | | if(numBadBatt>0){
|
| | | state="item-behind"; //落后机房
|
| | | //numPlan=(new BattDischarge_planImpl()).serchByStationId(binformation); //延迟总数
|
| | | if(dianzhanNum>0){ |
| | | state="item-timeout"; //掉站
|
| | | }else{
|
| | | if(numAlarm > 0){
|
| | | state="item-warn"; //告警机房
|
| | | if(numPoff>0){
|
| | | state="item-poff"; //停电
|
| | | |
| | | }else{
|
| | | if(numPlan > 0){
|
| | | state="item-timeout"; //延迟机房
|
| | | if(xuhangNum>0){
|
| | | state="item-xuhang"; //续航不足
|
| | | }else{
|
| | | if(numBadBatt>0){
|
| | | state="item-behind"; //落后机房
|
| | | }else{
|
| | | if(numAlarm > 0){
|
| | | state="item-warn"; //告警机房 |
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | model.setData(list.get(i));
|
| | | model.setMsgO(String.valueOf(numPoff)); //停电数
|
| | | model.setCode(numAlarm); //告警总数
|
| | | model.setSum(numBadBatt); //落后总数
|
| | | model.setNewsum(numPlan); //延时总数
|
| | | //model.setNewsum(numPlan); //延时总数
|
| | | model.setMsgT(String.valueOf(dianzhanNum)); //掉站
|
| | | model.setMsgV(String.valueOf(xuhangNum));//续航不足
|
| | | model.setMsg(state); //61850状态
|
| | | model.setMsgN(binformation.getFBSDeviceId().toString());
|
| | | listAll.add(model);
|
| | |
| | | }
|
| | | return listAll;
|
| | | }
|
| | | |
| | | //9.1百度地图定位根据省份查询所有该区域的机房
|
| | | public List serchByCondition(Object obj){
|
| | | List<BattMap_information> list =dao.serchByCondition(obj);
|
| | |
| | | int numAlarm=(new Battalarm_dataDAOImpl()).serchByStationId(binformation);
|
| | | int numBadBatt=(new BadBatt_monImpl()).serchByStationId(binformation);
|
| | | int numPlan=(new BattDischarge_planImpl()).serchByStationId(binformation);
|
| | | int numPoff=(new Bts_station_stateImpl()).serchByStationId(binformation); //停电数 |
| | | int dianzhanNum=(new Bts_station_stateImpl()).serchByStationId_diaozhan(binformation); //掉站数
|
| | | int xuhangNum=(new Batt_enduranceImpl()).serchxuhangNotInThree_stationid(binformation);//续航不足3小时数
|
| | | model.setData(list.get(i));
|
| | | model.setCode(numAlarm); //告警总数
|
| | | model.setSum(numBadBatt); //落后总数
|
| | | model.setNewsum(numPlan); //延时总数
|
| | | model.setMsgO(String.valueOf(numPoff)); //停电数
|
| | | model.setMsgT(String.valueOf(dianzhanNum)); //掉站
|
| | | model.setMsgV(String.valueOf(xuhangNum));//续航不足
|
| | | listAll.add(model);
|
| | | }
|
| | | }
|