package com.fgkj.actions;
|
|
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;
|
import com.fgkj.dto.Batt_maintenance_inf;
|
import com.fgkj.dto.Battalarm_data;
|
import com.fgkj.dto.Batttestdata_inf;
|
import com.fgkj.dto.Cmcc_Power_Data;
|
import com.fgkj.dto.ServiceModel;
|
import com.fgkj.dto.User;
|
import com.fgkj.dto.User_battgroup_baojigroup_usr;
|
import com.fgkj.dto.User_inf;
|
import com.fgkj.dto.User_permitgroup;
|
import com.fgkj.services.BattInfServices;
|
import com.google.gson.Gson;
|
import com.google.gson.GsonBuilder;
|
import com.google.gson.reflect.TypeToken;
|
import com.opensymphony.xwork2.ActionSupport;
|
|
public class BattInfAction extends ActionUtil{
|
private BattInfServices service=new BattInfServices();
|
private ServiceModel model;
|
private BattInf bif;
|
private Batt_maintenance_inf bmaif;
|
private Batttestdata_inf btdif;
|
private User_inf uinf;
|
//private Battalarm_data bdata;
|
private String result;
|
private String json;
|
|
public String find(){
|
return SUCCESS;
|
}
|
|
//添加新的电池组
|
public String add() {
|
List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType());
|
ServiceModel model = service.add(list);
|
result = tojson(model);
|
return SUCCESS;
|
}
|
//修改电池组信息
|
public String update() {
|
List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType());
|
ServiceModel model = service.update(list);
|
result = tojson(model);
|
return SUCCESS;
|
}
|
//修改电池信息配置(ip地址,掩码和网关)
|
public String updateIp() {
|
BattInf binf= getGson("yyyy-MM-dd").fromJson(json, BattInf.class);
|
//System.out.println(binf);
|
ServiceModel model = service.updateIp(binf);
|
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());
|
ServiceModel model = service.delete(list);
|
result = tojson(model);
|
return SUCCESS;
|
}
|
//根据维护区和机房名称查询电池组信息
|
public String searchInform() {
|
Batt_Maint_Dealarm bmd = getGson().fromJson(json, Batt_Maint_Dealarm.class);
|
ServiceModel model = service.searchInform(bmd);
|
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;
|
}
|
|
//添加操作时查询出电池组id
|
public String searchMaxBattgroupId(){
|
model = service.searchMaxBattgroupId();
|
result = ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
public String searchAll() {
|
model = service.searchAll();
|
result = ActionUtil.tojson(model);
|
//System.out.println(result);
|
return SUCCESS;
|
}
|
|
public String serchByBattgroupId(){
|
model=service.findByBattGroupId(bif);
|
result=ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
|
//----------根据StationName1(维护区) 查不重复的BattGroupName(蓄电池组)
|
public String serchByStationName1(){
|
model=service.serchByStationName1(bif);
|
result = ActionUtil.tojson(model);
|
//System.out.println(result);
|
return SUCCESS;
|
}
|
//----------根据StationName1(维护区) 查不重复的StationName(站点)
|
public String serchByStationName(){
|
model=service.serchByStationName(bif);
|
result = ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
//----------根据StationName1(维护区) 查不重复的StationName(站点)不包含91000000一期设备
|
public String serchByStationNameNot91(){
|
model=service.serchByStationNameNot91(bif);
|
result = ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
//--查不重复的StationName1(维护区)
|
public String serchByStation(){
|
model=service.serchByStation();
|
result = ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
//--查不重复的StationName1(维护区)不包含91000000一期设备
|
public String serchByStationNot91(){
|
model=service.serchByStationNot91();
|
result = ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
//----------根据StationName(站点) 查不重复的BattGroupName(蓄电池组)
|
public String serchByBattGroupName(){
|
model=service.serchByBattGroupName(bif);
|
result = ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
//查电池品牌
|
public String serchByBattProducer(){
|
model=service.serchByBattProducer();
|
result = ActionUtil.tojson(model);
|
//System.out.println(result);
|
return SUCCESS;
|
}
|
//查单体电压
|
public String serchByMonVolStd(){
|
model=service.serchByMonVolStd();
|
result = ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
//查电池容量
|
public String serchByMonCapStd(){
|
model=service.serchByMonCapStd();
|
result = ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
|
//查询菜单
|
public String findMenu(){
|
model=service.findMenu();
|
result = ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
|
|
public String findByBattGroupId(){
|
model=service.findByBattGroupId(bif);
|
Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
|
result=gson.toJson(model);
|
return SUCCESS;
|
}
|
|
//根据电池组id查询不重复的单体编号
|
public String serchByMonNum(){
|
model=service.serchByMonNum(bif);
|
result=ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
|
//根据电池id查询电池的基本信息
|
public String searchBattBybattgroupid(){
|
model=service.searchBattBybattgroupid(bif);
|
result=ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
|
//5.3添加选取电池组或者机房或者维护区(未被应用)
|
public String serchBatt() {
|
bif=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,BattInf.class);
|
model=service.serchBatt(bif);
|
result=ActionUtil.tojson(model);
|
//System.out.println(result);
|
return SUCCESS;
|
}
|
|
//6.4.7按地域和标称电压分组统计蓄电池组服役超期的数量
|
/*
|
* 区域层次放在stationid中
|
* battgroupnum 中存放统计方式:年度统计为0 季度统计为1
|
* moncount中存放统计季度:一季度为1 以此类推
|
* monnum 中存放年份*/
|
public String serchBeyondTime(){
|
bif=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,BattInf.class);
|
model=service.serchBeyondTime(bif);
|
result=ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
|
//6.4.8按地域和标称电压分组统计蓄电池组的数量(蓄电池组数量统计)
|
public String serchByMonVolStdGroup(){
|
bif=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,BattInf.class);
|
model=service.serchByMonVolStdGroup(bif);
|
result=ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
|
//6.4.9按地域和标称电压分组统计蓄电池组品牌的数量(蓄电池供应商信息统计)
|
public String serchByBattProducerGroup(){
|
bif=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,BattInf.class);
|
model=service.serchByBattProducerGroup(bif);
|
result=ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
|
//6.4.10按地域和标称电压分组统计蓄电池组使用时间(蓄电池投产年限统计)
|
public String serchByBattInUseDateGroup(){
|
bif=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,BattInf.class);
|
model=service.serchByBattInUseDateGroup(bif);
|
result=ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
|
//1 根据机房id查询电池组id排序最小值
|
public String serchByIdLow(){
|
bif=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,BattInf.class);
|
ServiceModel model =service.serchByIdLow(bif);
|
result = ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
|
/**
|
* 根据机房id查询机房中的电池组信息
|
* @param obj
|
* @return
|
*/
|
public String searchBattByStationId(){
|
BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
|
ServiceModel model = service.searchBattByStationId(binf);
|
result = ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
//搜索机房或电池组
|
public String serchStationOrBattgroup(){
|
BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
|
ServiceModel model = service.serchStationOrBattgroup(binf);
|
result = ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
//查询所有的省份(左侧导航第一层,查所有的省份,num中存放uid)
|
public String serchAllStation(){
|
User_inf u = (User_inf)getUser();
|
BattInf binf=new BattInf();
|
binf.setNum(u.getUId());
|
ServiceModel model = service.serchAllStation(binf);
|
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();
|
BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
|
binf.setNum(u.getUId());
|
ServiceModel model = service.serchStationName2(binf);
|
result = ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
//查询管理的市(左侧导航第二层,查所有的市)
|
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);
|
binf.setNum(u.getUId());
|
ServiceModel model = service.serchStationName3(binf);
|
result = ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
//查询管理的机房(左侧导航第四层,查所有的机房)
|
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;
|
}
|
|
//查询所有的电池组数
|
public String serchAllBatt(){
|
User_inf u = (User_inf)getUser();
|
ServiceModel model = service.serchAllBatt(u);
|
result = ActionUtil.tojson(model);
|
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 serchByDischarge(){
|
BattInf binf=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
|
ServiceModel model = service.serchByDischarge(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 add_ky() {
|
List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType());
|
ServiceModel model = service.add(list);
|
result = tojson(model);
|
return SUCCESS;
|
}
|
//修改电池组信息<-------跨域----------->
|
public String update_ky() {
|
List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType());
|
ServiceModel model = service.update(list);
|
result = tojson(model);
|
return SUCCESS;
|
}
|
//删除电池组<-------跨域----------->
|
public String delete_ky() {
|
List<BattInf> list= getGson("yyyy-MM-dd").fromJson(json, new TypeToken<List<BattInf>>(){}.getType());
|
ServiceModel model = service.delete(list);
|
result = tojson(model);
|
return SUCCESS;
|
}
|
//添加操作时查询出设备id<-------跨域----------->
|
public String searchmaxdev_id_ky(){
|
model = service.searchmaxdev_id();
|
result = ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
|
//添加操作时查询出电池组id<-------跨域----------->
|
public String searchMaxBattgroupId_ky(){
|
model = service.searchMaxBattgroupId();
|
result = ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
//添加操作时查询机房id<-------跨域----------->
|
public String searchStationId_ky(){
|
model = service.searchStationId();
|
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 String judgeBatt(){
|
BattInf binf=getGson().fromJson(json, BattInf.class);
|
ServiceModel model = service.judgeBatt(binf);
|
result = ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
public BattInf getBif() {
|
return bif;
|
}
|
public void setBif(BattInf bif) {
|
this.bif = bif;
|
}
|
|
|
|
public String getResult() {
|
return result;
|
}
|
|
public void setResult(String result) {
|
this.result = result;
|
}
|
|
public Batt_maintenance_inf getBmaif() {
|
return bmaif;
|
}
|
|
public void setBmaif(Batt_maintenance_inf bmaif) {
|
this.bmaif = bmaif;
|
}
|
|
public Batttestdata_inf getBtdif() {
|
return btdif;
|
}
|
|
public void setBtdif(Batttestdata_inf btdif) {
|
this.btdif = btdif;
|
}
|
|
|
public void setJson(String json) {
|
this.json = json;
|
}
|
|
|
|
public User_inf getUinf() {
|
return uinf;
|
}
|
|
public static void main(String[] args) {
|
BattInfAction ba=new BattInfAction();
|
BattInf b=new BattInf();
|
/*b.setStationName1("二枢纽");
|
b.setStationName("太原小店二枢纽1号楼1602动力机房");*/
|
b.setStationName("中国山西太原杏花岭区移动枢纽一枢纽-2F-网管监控-203");
|
b.setStationName1("");
|
//b.setBattGroupName("1#开关电源系统-1#电池组-光宇-24节");
|
//b.setBattGroupName1("开关电源系统");
|
//b.setBattProducer("光宇");
|
//b.setMonCapStd(100f);
|
//b.setMonVolStd(12f);
|
//System.out.println(b.getStationName());
|
ba.setBif(b);
|
//ba.searchAll();
|
//ba.serchByStation();
|
//ba.serchByStationName();
|
//ba.serchByStationName1();
|
//ba.serchByBattGroupName();
|
//ba.serchByBattProducer();
|
//ba.serchByMonVolStd();
|
//ba.serchByMonCapStd();
|
//ba.serchByStationName();
|
ba.serchBatt();
|
}
|
}
|