package com.fgkj.actions; import java.util.List; import com.fgkj.dao.UinfDaoFactory; import com.fgkj.dto.BattMap_information; import com.fgkj.dto.Page; import com.fgkj.dto.ServiceModel; import com.fgkj.dto.User_inf; import com.fgkj.dto.User_log; import com.fgkj.services.BattMap_informationService; import com.fgkj.services.User_logService; public class BattMap_informationAction extends ActionUtil{ private BattMap_informationService service = new BattMap_informationService(); private User_logService uservice=new User_logService(); private String json; private String result; //9.1录入机房信息 public String add(){ BattMap_information binfo = getGson().fromJson(json, BattMap_information.class); ServiceModel model = service.add(binfo); { String msg="设置"+binfo.getStationName()+"在"+binfo.getAddress(); User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Increase, msg); uservice.add(ulog);//将用户的操作记录下来 } result = tojson(model); return SUCCESS; } //9.1录入机房信息(手机端) public String replace(){ BattMap_information binfo = getGson().fromJson(json, BattMap_information.class); ServiceModel model = service.replace(binfo); { String msg="设置"+binfo.getStationName()+"在"+binfo.getAddress(); User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Increase, msg); uservice.add(ulog);//将用户的操作记录下来 } result = tojson(model); return SUCCESS; } public String update(){ BattMap_information binfo = getGson().fromJson(json, BattMap_information.class); ServiceModel model = service.update(binfo); result = tojson(model); return SUCCESS; } //删除机房的位置信息 public String del(){ BattMap_information binfo = getGson().fromJson(json, BattMap_information.class); ServiceModel model = service.del(binfo); { String msg="删除"+binfo.getStationName()+"的位置"; User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Delete, msg); uservice.add(ulog);//将用户的操作记录下来 } result = tojson(model); return SUCCESS; } //9.1百度地图定位查询电池组信息 public String searchAll(){ List list = service.searchAll(); result = tojson(list); return SUCCESS; } //9.1地图上根据维护区查询机房经纬度 public String serchByInfo(){ BattMap_information binfo = getGson().fromJson(json, BattMap_information.class); ServiceModel model = service.serchByInfo(binfo); result = tojson(model); return SUCCESS; } //9.1百度地图定位根据省份查询所有该区域的机房 public String serchByCondition(){ BattMap_information binfo = getGson().fromJson(json, BattMap_information.class); List list = service.serchByCondition(binfo); result = tojson(list); return SUCCESS; } //9.1机房详情显示机房具体落后和告警的信息(机房信息内容画图) public String serchMonNum(){ BattMap_information binfo = getGson().fromJson(json, BattMap_information.class); List list = service.serchMonNum(binfo); result = tojson(list); return SUCCESS; } //9.1查询未添加物理信息的机房 public String serchNotInBattMap(){ ServiceModel model = service.serchNotInBattMap(); result = tojson(model); return SUCCESS; } //9.1查询未添加物理信息的机房(用户管理的) public String serchNotInBattMapByUid() { User_inf uinf=(User_inf) getUser(); ServiceModel model = service.serchNotInBattMapByUid(uinf); result = tojson(model); return SUCCESS; } //9.1查询已经添加物理信息的机房(用户管理的) public String serchInBattMapByUid() { User_inf uinf=(User_inf) getUser(); ServiceModel model = service.serchInBattMapByUid(uinf); result = tojson(model); return SUCCESS; } //9.1首页上查询已经添加物理信息的机房(用户管理的,l查询全部打开页面) public String searchUserManageStation() { User_inf uinf=(User_inf) getUser(); ServiceModel model = service.searchUserManageStation(uinf); result = tojson(model); return SUCCESS; } //9.1首页上查询已经添加物理信息的机房(用户管理的,分页刷新) public String searchUserManageStation2() { Page p=getGson().fromJson(json, Page.class); User_inf uinf=(User_inf) getUser(); p.setPageAll(uinf.getUId()); List list = service.searchUserManageStation2(p); result = tojson(list); return SUCCESS; } //9.1首页上查询已经添加物理信息的机房(用户管理的,3.根据具体id查询告警信息等) public String searchUserManageStation3() { BattMap_information binfor=getGson().fromJson(json, BattMap_information.class); User_inf uinf=(User_inf) getUser(); binfor.setNum(uinf.getUId()); List list = service.searchUserManageStation3(binfor); result = tojson(list); return SUCCESS; } //9.1电池寿命管理 public String serchByStationid(){ BattMap_information bmap = getGson().fromJson(json, BattMap_information.class); ServiceModel model = service.serchByStationid(bmap); result = tojson(model); return SUCCESS; } //9.1查询机房所在的所有省份 public String serchStationName1(){ ServiceModel model = service.serchStationName1(); result = tojson(model); return SUCCESS; } //9.1根据省份查询机房所在的所有城市 public String serchStationName2(){ BattMap_information bmap = getGson().fromJson(json, BattMap_information.class); ServiceModel model = service.serchStationName2(bmap); result = tojson(model); return SUCCESS; } //9.1根据省份和城市查询机房所在的所有机房 public String serchStationName(){ BattMap_information bmap = getGson().fromJson(json, BattMap_information.class); ServiceModel model = service.serchStationName(bmap); result = tojson(model); return SUCCESS; } public String getResult() { return result; } public void setJson(String json) { this.json = json; } }