didiyu
2018-12-11 b8f449dca8e53bbd5c0e424befe07c8207c10032
gx_tieta/src/com/fgkj/actions/BattInfAction.java
@@ -2,6 +2,8 @@
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.fgkj.dao.impl.BattInfImpl;
import com.fgkj.dto.BattInf;
import com.fgkj.dto.Batt_Maint_Dealarm;
@@ -57,6 +59,13 @@
      result = tojson(model);
      return SUCCESS;
   }
   //设置电池组充电电流阈值
   public String update_charge() {
      BattInf binf= getGson("yyyy-MM-dd").fromJson(json, BattInf.class);
      ServiceModel model = service.update_charge(binf);
      result = tojson(model);
      return SUCCESS;
   }
   //删除电池组
   public String delete() {
      List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType());
@@ -71,13 +80,28 @@
      result = tojson(model);
      return SUCCESS;
   }
   //根据维护区和机房名称查询电池组信息
   public String searchInform1() {
      Batt_Maint_Dealarm bmd = getGson().fromJson(json, Batt_Maint_Dealarm.class);
      ServiceModel model = service.searchInform1(bmd);
      result = tojson(model);
      return SUCCESS;
   }
   public String serchByCondition() {
      model = service.serchByCondition(bif);
      result = ActionUtil.tojson(model);
      //System.out.println(result);
      return SUCCESS;
   }
   //添加操作时查询出设备id
    public String searchmaxdev_id(){
       model = service.searchmaxdev_id();
      result = ActionUtil.tojson(model);
      return SUCCESS;
    }
   public String searchAll() {
      model = service.searchAll();
      result = ActionUtil.tojson(model);
@@ -242,9 +266,6 @@
      result = ActionUtil.tojson(model);
      return SUCCESS;
   }
   //搜索机房或电池组
   public String serchStationOrBattgroup(){
      BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
@@ -261,6 +282,15 @@
      result = ActionUtil.tojson(model);
      return SUCCESS;
   }
   //查询所有的省份(左侧导航第一层,查所有的省份)
   public String serchAllStation_all(){
      User_inf u = (User_inf)getUser();
      BattInf binf=new BattInf();
      binf.setNum(u.getUId());
      ServiceModel model = service.serchAllStation_all(binf);
      result = ActionUtil.tojson(model);
      return SUCCESS;
   }
   //查询管理的市(左侧导航第二层,查所有的市,num中存放uid)
   public String serchStationName2(){
      User_inf u = (User_inf)getUser();
@@ -270,7 +300,30 @@
      result = ActionUtil.tojson(model);
      return SUCCESS;
   }
   //查询管理的机房(左侧导航第三层,查所有的机房,num中存放uid)
   //查询管理的市(左侧导航第二层,查所有的市)
   public String serchStationName2_all(){
      BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
      ServiceModel model = service.serchStationName2_all(binf);
      result = ActionUtil.tojson(model);
      return SUCCESS;
   }
   //查询管理的县/区(左侧导航第三层,查所有的县/区)
   public String serchStationName5(){
      User_inf u = (User_inf)getUser();
      BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
      binf.setNum(u.getUId());
      ServiceModel model = service.serchStationName5(binf);
      result = ActionUtil.tojson(model);
      return SUCCESS;
   }
   //查询管理的县/区(左侧导航第三层,查所有的县/区)
   public String serchStationName5_all(){
      BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
      ServiceModel model = service.serchStationName5_all(binf);
      result = ActionUtil.tojson(model);
      return SUCCESS;
   }
   //查询管理的机房(左侧导航第四层,查所有的机房,num中存放uid)
   public String serchStationName3(){
      User_inf u = (User_inf)getUser();
      BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
@@ -279,10 +332,28 @@
      result = ActionUtil.tojson(model);
      return SUCCESS;
   }
   //根据机房id查询机房下的电池组信息(左侧导航第四层,根据机房查询下面的电池组,num中存放uid)
   //查询管理的机房(左侧导航第四层,查所有的机房)
   public String serchStationName3_all(){
      BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
      ServiceModel model = service.serchStationName3_all(binf);
      result = ActionUtil.tojson(model);
      return SUCCESS;
   }
   //根据机房id查询机房下的电池组信息(左侧导航第五层,根据机房查询下面的电池组,num中存放uid)
   public String serchBattByStation(){
      BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
      User_inf u = (User_inf)getUser();
      binf.setNum(u.getUId());
      //System.out.println(binf);
      ServiceModel model = service.serchBattByStation(binf);
      result = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").toJson(model);
      return SUCCESS;
   }
   //根据机房id查询机房下的电池组信息(左侧导航第五层,根据机房查询下面的电池组)
   public String serchBattByStation_all(){
      BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
      //System.out.println(binf);
      ServiceModel model = service.serchBattByStation_all(binf);
      result = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").toJson(model);
      return SUCCESS;
   }
@@ -295,6 +366,61 @@
      return SUCCESS;
   }
   
   //电池配组管理(重要)
   public String serchMakeGroup(){
      BattInf binf=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
      User_inf uinf=(User_inf) getUser();
      binf.setNum(uinf.getUId());
      ServiceModel model = service.serchMakeGroup(binf);
      result = ActionUtil.tojson(model);
      return SUCCESS;
   }
   //电池配组管理(重要)
   public String serchGroupByInfor(){
      BattInf binf=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
      User_inf uinf=(User_inf) getUser();
      binf.setNum(uinf.getUId());
      ServiceModel model = service.serchGroupByInfor(binf);
      result = ActionUtil.tojson(model);
      return SUCCESS;
   }
   //首页上根据stationid查询电池组的机历卡
   public String serchBattAllInfoByStationId(){
      BattInf binf=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
      ServiceModel model = service.serchBattAllInfoByStationId(binf);
      result = ActionUtil.tojson(model);
      return SUCCESS;
   }
   //跨域访问获取所有电池组的信息<-------跨域----------->
   public String searchInform_ky(){
      //isAllowHeaders();                     //允许跨域访问
      ServiceModel model = new ServiceModel();
      model = service.searchInform_ky();
      result = ActionUtil.tojson(model);
      return SUCCESS;
   }
   //首页上显示已安装数和全部基站数
   public String serchDevice(){
      User_inf uinf=(User_inf) getUser();
      ServiceModel model = service.serchDevice(uinf);
      result = ActionUtil.tojson(model);
      return SUCCESS;
   }
   //头部查出已安装的所有机房
   public String serchByDeviceId(){
      User_inf uinf=(User_inf) getUser();
      ServiceModel model = service.serchByDeviceId(uinf);
      result = ActionUtil.tojson(model);
      return SUCCESS;
   }
   //头部查出已安装的电池单体
   public String serchByInstall_count(){
      User_inf uinf=(User_inf) getUser();
      ServiceModel model = service.serchByInstall_count(uinf);
      result = ActionUtil.tojson(model);
      return SUCCESS;
   }
   public BattInf getBif() {
      return bif;
   }
@@ -328,12 +454,6 @@
      this.btdif = btdif;
   }
   
//   public ServiceModel getModel() {
//      return model;
//   }
    
   public void setJson(String json) {
      this.json = json;