电池组删除添加修改时修改app——sys中值为1+配组管理
| | |
| | | result = ActionUtil.tojson(model);
|
| | | return SUCCESS;
|
| | | }
|
| | | |
| | | |
| | | |
| | | //搜索机房或电池组
|
| | | public String serchStationOrBattgroup(){
|
| | | BattInf binf = ActionUtil.getGson().fromJson(json, BattInf.class);
|
| | |
| | | return SUCCESS;
|
| | | }
|
| | |
|
| | | //电池配组管理(重要)
|
| | | public String serchMakeGroup(){
|
| | | BattInf binf=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, BattInf.class);
|
| | | ServiceModel model = service.serchMakeGroup(binf);
|
| | | result = ActionUtil.tojson(model);
|
| | | return SUCCESS;
|
| | | }
|
| | | public BattInf getBif() {
|
| | | return bif;
|
| | | }
|
| | |
| | | this.btdif = btdif;
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | // public ServiceModel getModel() {
|
| | | // return model;
|
| | | // }
|
| | |
|
| | |
|
| | | public void setJson(String json) {
|
| | | this.json = json;
|
| | |
| | | final public static int BATT_DISCHARGE=3;//放电测试
|
| | | final public static int BATT_RES=5;//内阻测试
|
| | |
|
| | | final public static int AppServer_Reinit_BattGroupData_EN=1;//修改删除添加电池组信息时识别信号
|
| | | |
| | | final public static int BATT_MON_COUNT_MAX = 512;
|
| | |
|
| | | final public static byte BATTDATA_NULL = 0;
|
New file |
| | |
| | | package com.fgkj.dao.impl;
|
| | |
|
| | | import java.sql.ResultSet;
|
| | | import java.util.List;
|
| | |
|
| | | import com.fgkj.dao.BaseDAO;
|
| | | import com.fgkj.dao.BattTestData;
|
| | | import com.fgkj.dao.CallBack;
|
| | | import com.fgkj.dao.DAOHelper;
|
| | | import com.fgkj.db.DBUtil;
|
| | | import com.fgkj.dto.App_Sys;
|
| | |
|
| | | public class App_SysImpl implements BaseDAO,CallBack{
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | // TODO Auto-generated method stub
|
| | | return null;
|
| | | }
|
| | |
|
| | | public boolean add(Object obj) {
|
| | | // TODO Auto-generated method stub
|
| | | return false;
|
| | | }
|
| | | //电池组信息添加修改和删除不重启主程序,只修改AppServer_Reinit_BattGroupData_EN值为false
|
| | | public boolean update(Object obj) {
|
| | | App_Sys as=(App_Sys) obj;
|
| | | String sql=" update db_app_sys.tb_app_sys set AppServer_Reinit_BattGroupData_EN=? ";
|
| | | boolean bl=DAOHelper.executeUpdate(DBUtil.getConn(), sql, new Object[]{as.getAppServer_Reinit_BattGroupData_EN()});
|
| | | return bl;
|
| | | }
|
| | |
|
| | | public boolean del(Object obj) {
|
| | | // TODO Auto-generated method stub
|
| | | return false;
|
| | | }
|
| | |
|
| | | public List searchAll() {
|
| | | // TODO Auto-generated method stub
|
| | | return null;
|
| | | }
|
| | |
|
| | | public List serchByCondition(Object obj) {
|
| | | // TODO Auto-generated method stub
|
| | | return null;
|
| | | }
|
| | |
|
| | | public List serchByInfo(Object obj) {
|
| | | // TODO Auto-generated method stub
|
| | | return null;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.fgkj.dto.Batt_Maint_Dealarm;
|
| | | import com.fgkj.dto.Batt_maint_inf;
|
| | | import com.fgkj.dto.Batt_maintenance_inf;
|
| | | import com.fgkj.dto.Batttestdata;
|
| | | import com.fgkj.dto.Batttestdata_inf;
|
| | | import com.fgkj.dto.Batttestdatastop;
|
| | | import com.fgkj.dto.Limit;
|
| | |
| | | return nums;
|
| | | }
|
| | |
|
| | | |
| | | //电池配组管理(重要)
|
| | | public List serchMakeGroup(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="SELECT distinct BattGroupId,stationid,stationname1,stationname2,stationname,stationname3,BattProducer,MonVolStd,MonCapStd,monCount from db_battinf.tb_battinf where stationname2 like ? ";
|
| | | //选中品牌一致
|
| | | String producerSqlT=" order by BattProducer,MonCapStd,MonVolStd ";//一致
|
| | | String producerSqlF=" order by MonCapStd,MonVolStd ";//不一致
|
| | | if(binf.getBattProducer().equals("1")){
|
| | | sql+=producerSqlT;
|
| | | }else{
|
| | | sql+=producerSqlF;
|
| | | }
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName2()+"%"}, new CallBack() {
|
| | | |
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()){
|
| | | BattInf binf=new BattInf();
|
| | | binf.setBattGroupId(rs.getInt("battGroupId"));
|
| | | binf.setStationId(rs.getString("stationId"));
|
| | | binf.setStationName(rs.getString("stationName"));
|
| | | binf.setStationName1(rs.getString("stationName1"));
|
| | | binf.setStationName2(rs.getString("stationName2"));
|
| | | binf.setStationName3(rs.getString("stationName3"));
|
| | | binf.setBattProducer(rs.getString("battProducer"));
|
| | | binf.setMonVolStd(rs.getFloat("monVolStd"));
|
| | | binf.setMonCapStd(rs.getFloat("monCapStd"));
|
| | | binf.setMonCount(rs.getInt("monCount"));
|
| | | list.add(binf);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | });
|
| | | return list;
|
| | | }
|
| | | public static void main(String[] args) throws ParseException {
|
| | | //new BattInfImpl().searchAll();
|
| | |
|
| | |
| | | });
|
| | | return list;
|
| | | }
|
| | |
|
| | | //电池配组用到(筛选出有效的最近的一次节能放电技术)
|
| | | public List Batt_selecteffectiveBatt(Object obj,float param){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="SELECT distinct battGroupId,test_starttime,record_time,test_cap,max_monvol,min_monvol,test_record_count,test_curr FROM db_batt_testdata.tb_batttestdata_inf "
|
| | | + " WHERE BattGroupId =? " |
| | | + " AND data_available=1 AND data_new = 1 AND " |
| | | + " test_type = 3 AND test_starttype = 3 AND " //判断是节能放电
|
| | | + " abs(test_cap) >?*? " //判断测试数据容量是否有效
|
| | | + " ORDER BY test_record_count DESC LIMIT 1 ";
|
| | | |
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getBattGroupId(),binf.getMonCapStd(),param}, new CallBack() {
|
| | | |
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()){
|
| | | Batttestdata_inf tinf=new Batttestdata_inf();
|
| | | tinf.setBattGroupId(rs.getInt("battGroupId"));
|
| | | if(rs.getString("test_starttime")!=null)
|
| | | tinf.setTest_starttime(rs.getTimestamp("test_starttime"));
|
| | | if(rs.getString("record_time")!=null)
|
| | | tinf.setRecord_time(rs.getTimestamp("record_time"));
|
| | | tinf.setTest_cap(rs.getFloat("test_cap"));
|
| | | tinf.setMax_monvol(rs.getFloat("max_monvol"));
|
| | | tinf.setMin_monvol(rs.getFloat("min_monvol"));
|
| | | tinf.setTest_record_count(rs.getInt("test_record_count"));
|
| | | tinf.setTest_curr(rs.getFloat("test_curr"));
|
| | | list.add(tinf);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | });
|
| | | return list;
|
| | | }
|
| | | |
| | | public static void main(String[] args) throws ParseException {
|
| | | Batttestdata_infDAOImpl bimpl=new Batttestdata_infDAOImpl();
|
| | | Batttestdata_inf tdata=new Batttestdata_inf();
|
| | |
| | | }
|
| | | return listB;
|
| | | }
|
| | | //电池配组管理(重要)
|
| | | public List serchMakeGroup(Object obj1,Object obj2){
|
| | | BattInf binf=(BattInf) obj1;
|
| | | Batttestdata_inf tinf=(Batttestdata_inf) obj2;
|
| | | String sql="select num,BattGroupId,test_record_count,test_type,data_new,data_available,record_num,test_starttime,record_time,test_timelong,group_vol," +
|
| | | " test_curr,test_cap,mon_num,mon_vol " +
|
| | | " from db_batt_testdata.tb_batttestdatastop_"+tinf.getBattGroupId()+" " +
|
| | | " where " +
|
| | | "test_record_count=? and record_time=? " +
|
| | | " and db_batt_testdata.tb_batttestdatastop_"+tinf.getBattGroupId()+".data_available=1 ";//tb_batttestdatastop_id表中筛选出实际电压>标存电压*0.9的时的那笔数据,new Object[]{tdata.getTest_record_count(),tdata.getRecord_time()}
|
| | | |
| | | List<Batttestdatastop> list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{tinf.getTest_record_count(),tinf.getRecord_time()}, new CallBack() {
|
| | | |
| | | public List getResults(ResultSet rs) {
|
| | | List<Batttestdatastop> list=new ArrayList<Batttestdatastop>();
|
| | | try {
|
| | | while(rs.next()){
|
| | | Batttestdatastop sdata=new Batttestdatastop();
|
| | | sdata.setNum(rs.getInt("num"));
|
| | | sdata.setBattGroupId(rs.getInt("BattGroupId"));
|
| | | sdata.setTest_record_count(rs.getInt("test_record_count"));
|
| | | sdata.setTest_type(rs.getInt("test_type"));
|
| | | sdata.setData_new(rs.getInt("data_new")); |
| | | sdata.setData_available(rs.getInt("data_available"));
|
| | | sdata.setRecord_num(rs.getInt("record_num"));
|
| | | sdata.setTest_starttime(rs.getTimestamp("test_starttime"));
|
| | | sdata.setRecord_time(rs.getTimestamp("record_time"));
|
| | | sdata.setTest_timelong(rs.getInt("test_timelong"));
|
| | | sdata.setGroup_vol(rs.getFloat("group_vol"));
|
| | | sdata.setTest_curr(rs.getFloat("test_curr"));
|
| | | sdata.setTest_cap(rs.getFloat("test_cap"));
|
| | | sdata.setMon_num(rs.getInt("mon_num"));
|
| | | sdata.setMon_vol(rs.getFloat("mon_vol"));
|
| | | list.add(sdata);
|
| | |
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | });
|
| | | double realCap=0;//实际容量
|
| | | double STDAH=0;//标存容量
|
| | | int hourRate=0;//小时率
|
| | | double current=0;//当前电流
|
| | | double SumAH=0;//测试容量
|
| | | double MaxMonomerVol=0;//最大电压
|
| | | double MonomerVol=0; //最小电压
|
| | | double MonomerVolType=0;//电池电压类型
|
| | | int flag=1;//电池单体告警标识
|
| | | if(list!=null&&list.size()>0){
|
| | | for(int i=0;i<list.size();i++){
|
| | | Batttestdatastop sdata=list.get(i);
|
| | | STDAH=binf.getMonCapStd();
|
| | | MonomerVolType=binf.getMonVolStd();
|
| | | |
| | | current=sdata.getTest_curr();
|
| | | SumAH=sdata.getTest_cap();
|
| | | MaxMonomerVol=tinf.getMax_monvol();
|
| | | MonomerVol=sdata.getMon_vol();
|
| | | hourRate=BattCapFactory.GetHourRate(STDAH, current);
|
| | | if(sdata.getMon_vol()>binf.getMonVolStd()*BattTestData.test_stop){
|
| | | realCap=BattCapFactory.GetMonomerCap(STDAH, hourRate, SumAH, MaxMonomerVol, MonomerVol, MonomerVolType, BattCapFactory.CapType_Real);
|
| | | }else{
|
| | | sdata.setMon_vol(binf.getMonVolStd()*BattTestData.test_stop);
|
| | | realCap=(new BatttestdataDAOImpl()).serchRealCap(sdata);
|
| | | }
|
| | | sdata.setTest_cap((float)realCap);
|
| | | }
|
| | | }
|
| | | return list;
|
| | | }
|
| | | //查询指定电池组指定单体的实际容量
|
| | | public double serchRealCapByMon_num(Object obj) {
|
| | | BattInf binf=(BattInf) obj;
|
New file |
| | |
| | | package com.fgkj.dto;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | public class App_Sys implements Serializable {
|
| | | private int num;
|
| | | private float SqlDB_Version;
|
| | | private Date SqlDB_BackUpTime;
|
| | | private int SqlDB_BackUpManual_EN;
|
| | | private int AppServer_Reinit_BattGroupData_EN;
|
| | | private float AppServer_Version;
|
| | | private float AppClient_Version;
|
| | | private String AppName;
|
| | | public int getNum() {
|
| | | return num;
|
| | | }
|
| | | public void setNum(int num) {
|
| | | this.num = num;
|
| | | }
|
| | | public float getSqlDB_Version() {
|
| | | return SqlDB_Version;
|
| | | }
|
| | | public void setSqlDB_Version(float sqlDB_Version) {
|
| | | SqlDB_Version = sqlDB_Version;
|
| | | }
|
| | | public Date getSqlDB_BackUpTime() {
|
| | | return SqlDB_BackUpTime;
|
| | | }
|
| | | public void setSqlDB_BackUpTime(Date sqlDB_BackUpTime) {
|
| | | SqlDB_BackUpTime = sqlDB_BackUpTime;
|
| | | }
|
| | | public int getSqlDB_BackUpManual_EN() {
|
| | | return SqlDB_BackUpManual_EN;
|
| | | }
|
| | | public void setSqlDB_BackUpManual_EN(int sqlDB_BackUpManual_EN) {
|
| | | SqlDB_BackUpManual_EN = sqlDB_BackUpManual_EN;
|
| | | }
|
| | | public int getAppServer_Reinit_BattGroupData_EN() {
|
| | | return AppServer_Reinit_BattGroupData_EN;
|
| | | }
|
| | | public void setAppServer_Reinit_BattGroupData_EN(
|
| | | int appServer_Reinit_BattGroupData_EN) {
|
| | | AppServer_Reinit_BattGroupData_EN = appServer_Reinit_BattGroupData_EN;
|
| | | }
|
| | | public float getAppServer_Version() {
|
| | | return AppServer_Version;
|
| | | }
|
| | | public void setAppServer_Version(float appServer_Version) {
|
| | | AppServer_Version = appServer_Version;
|
| | | }
|
| | | public float getAppClient_Version() {
|
| | | return AppClient_Version;
|
| | | }
|
| | | public void setAppClient_Version(float appClient_Version) {
|
| | | AppClient_Version = appClient_Version;
|
| | | }
|
| | | public String getAppName() {
|
| | | return AppName;
|
| | | }
|
| | | public void setAppName(String appName) {
|
| | | AppName = appName;
|
| | | }
|
| | | @Override
|
| | | public String toString() {
|
| | | return "App_Sys [num=" + num + ", SqlDB_Version=" + SqlDB_Version
|
| | | + ", SqlDB_BackUpTime=" + SqlDB_BackUpTime
|
| | | + ", SqlDB_BackUpManual_EN=" + SqlDB_BackUpManual_EN
|
| | | + ", AppServer_Reinit_BattGroupData_EN="
|
| | | + AppServer_Reinit_BattGroupData_EN + ", AppServer_Version="
|
| | | + AppServer_Version + ", AppClient_Version="
|
| | | + AppClient_Version + ", AppName=" + AppName + "]";
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
| | | import java.io.Serializable;
|
| | | import java.text.ParseException;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.mysql.fabric.xmlrpc.base.Array;
|
| | |
|
| | | /**
|
| | | * @author 星伟
|
| | |
| | | private Integer StartNum;
|
| | | private Integer Size;
|
| | |
|
| | | private Object obj;
|
| | | public BattInf() {
|
| | | super();
|
| | | // TODO Auto-generated constructor stub
|
| | | }
|
| | | |
| | | public Integer getNum() {
|
| | | return num;
|
| | | }
|
| | |
| | | public void setBattGuarantDayCount(Integer battGuarantDayCount) {
|
| | | BattGuarantDayCount = battGuarantDayCount;
|
| | | }
|
| | |
|
| | | |
| | | public Object getObj() {
|
| | | return obj;
|
| | | }
|
| | | public void setObj(Object obj) {
|
| | | this.obj = obj;
|
| | | }
|
| | | @Override
|
| | | public String toString() {
|
| | | return "BattInf [num=" + num + ", StationId=" + StationId
|
| | |
| | | + ", StationName9=" + StationName9 + ", StationIp=" + StationIp
|
| | | + ", FBSDeviceId=" + FBSDeviceId + ", FbsDeviceIp="
|
| | | + FbsDeviceIp + ", FbsDeviceIp_YM=" + FbsDeviceIp_YM
|
| | | + ", FbsDeviceIp_WG=" + FbsDeviceIp_WG + ", FBSDeviceName="
|
| | | + FBSDeviceName + ", GroupIndexInFBSDevice="
|
| | | + GroupIndexInFBSDevice + ", BattModel=" + BattModel
|
| | | + ", BattGroupId=" + BattGroupId + ", BattGroupNum="
|
| | | + BattGroupNum + ", BattGroupName=" + BattGroupName
|
| | | + ", BattGroupName1=" + BattGroupName1 + ", BattGroupName2="
|
| | | + BattGroupName2 + ", BattGroupName3=" + BattGroupName3
|
| | | + ", BattGroupName4=" + BattGroupName4 + ", BattGroupName5="
|
| | | + BattGroupName5 + ", BattGroupName6=" + BattGroupName6
|
| | | + ", FloatVolLevel=" + FloatVolLevel + ", OfflineVolLevel="
|
| | | + OfflineVolLevel + ", BattFloatCurrent=" + BattFloatCurrent
|
| | | + ", DeviceId=" + DeviceId + ", DeviceName=" + DeviceName
|
| | | + ", MonCount=" + MonCount + ", MonCapStd=" + MonCapStd
|
| | | + ", MonResStd=" + MonResStd + ", MonSerStd=" + MonSerStd
|
| | | + ", MonTmpStd=" + MonTmpStd + ", MonVolStd=" + MonVolStd
|
| | | + ", MonVolLowToAvg=" + MonVolLowToAvg + ", MonNum=" + MonNum
|
| | | + ", BattProducer=" + BattProducer + ", BattProductDate="
|
| | | + BattProductDate + ", BattProductDate1=" + BattProductDate1
|
| | | + ", BattInUseDate=" + BattInUseDate + ", BattInUseDate1="
|
| | | + BattInUseDate1 + ", BattGuarantDayCount="
|
| | | + BattGuarantDayCount + ", SignalId=" + SignalId
|
| | | + ", CInterFaceId=" + CInterFaceId + ", Load_curr=" + Load_curr
|
| | | + ", SignalName=" + SignalName + ", StartNum=" + StartNum
|
| | | + ", Size=" + Size + "]";
|
| | | + ", FbsDeviceIp_WG=" + FbsDeviceIp_WG + ", FbsDeviceIp_old="
|
| | | + FbsDeviceIp_old + ", FbsDeviceIp_YM_old="
|
| | | + FbsDeviceIp_YM_old + ", FbsDeviceIp_WG_old="
|
| | | + FbsDeviceIp_WG_old + ", FBSDeviceName=" + FBSDeviceName
|
| | | + ", GroupIndexInFBSDevice=" + GroupIndexInFBSDevice
|
| | | + ", BattModel=" + BattModel + ", BattGroupId=" + BattGroupId
|
| | | + ", BattGroupNum=" + BattGroupNum + ", BattGroupName="
|
| | | + BattGroupName + ", BattGroupName1=" + BattGroupName1
|
| | | + ", BattGroupName2=" + BattGroupName2 + ", BattGroupName3="
|
| | | + BattGroupName3 + ", BattGroupName4=" + BattGroupName4
|
| | | + ", BattGroupName5=" + BattGroupName5 + ", BattGroupName6="
|
| | | + BattGroupName6 + ", FloatVolLevel=" + FloatVolLevel
|
| | | + ", OfflineVolLevel=" + OfflineVolLevel
|
| | | + ", BattFloatCurrent=" + BattFloatCurrent + ", DeviceId="
|
| | | + DeviceId + ", DeviceName=" + DeviceName + ", MonCount="
|
| | | + MonCount + ", MonCapStd=" + MonCapStd + ", MonResStd="
|
| | | + MonResStd + ", MonSerStd=" + MonSerStd + ", MonTmpStd="
|
| | | + MonTmpStd + ", MonVolStd=" + MonVolStd + ", MonVolLowToAvg="
|
| | | + MonVolLowToAvg + ", MonNum=" + MonNum + ", BattProducer="
|
| | | + BattProducer + ", BattProductDate=" + BattProductDate
|
| | | + ", BattProductDate1=" + BattProductDate1 + ", BattInUseDate="
|
| | | + BattInUseDate + ", BattInUseDate1=" + BattInUseDate1
|
| | | + ", BattGuarantDayCount=" + BattGuarantDayCount
|
| | | + ", SignalId=" + SignalId + ", CInterFaceId=" + CInterFaceId
|
| | | + ", Load_curr=" + Load_curr + ", SignalName=" + SignalName
|
| | | + ", StartNum=" + StartNum + ", Size=" + Size + ", obj=" + obj
|
| | | + "]";
|
| | | }
|
| | |
|
| | | |
| | |
|
| | |
|
| | |
|
| | |
| | | package com.fgkj.dto;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.List;
|
| | |
|
| | | public class Batt_Maint_Dealarm implements Serializable{
|
| | | private BattInf binf; //battinf对象信息
|
| | |
| | | import java.sql.PreparedStatement;
|
| | | import java.sql.SQLException;
|
| | | import java.text.ParseException;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.fgkj.actions.ActionUtil;
|
| | | import com.fgkj.dao.BaseDAO;
|
| | | import com.fgkj.dao.BaseDAOFactory;
|
| | | import com.fgkj.dao.BattCapFactory;
|
| | | import com.fgkj.dao.BattTestData;
|
| | | import com.fgkj.dao.BattinfGroupFactory;
|
| | | import com.fgkj.dao.DAOHelper;
|
| | | import com.fgkj.dao.ProcessServerDao;
|
| | | import com.fgkj.dao.impl.App_SysImpl;
|
| | | import com.fgkj.dao.impl.BattInfImpl;
|
| | | import com.fgkj.dao.impl.Batt_param_lowImpl;
|
| | | import com.fgkj.dao.impl.Batttestdata_infDAOImpl;
|
| | | import com.fgkj.dao.impl.BatttestdatastopDAOImpl;
|
| | | import com.fgkj.dao.impl.Process_surveyImpl;
|
| | | import com.fgkj.dao.impl.ram.Fbs9100_setparamImpl;
|
| | | import com.fgkj.db.DBUtil;
|
| | | import com.fgkj.dto.App_Sys;
|
| | | import com.fgkj.dto.BattInf;
|
| | | import com.fgkj.dto.Batt_Maint_Dealarm;
|
| | | import com.fgkj.dto.Batt_param_low;
|
| | | import com.fgkj.dto.Batttestdata_inf;
|
| | | import com.fgkj.dto.Batttestdatastop;
|
| | | import com.fgkj.dto.Page;
|
| | | import com.fgkj.dto.Process_survey;
|
| | | import com.fgkj.dto.ServiceModel;
|
| | |
| | | public ServiceModel add(Object obj) {
|
| | | Boolean bl=dao.add(obj);
|
| | | if(bl){
|
| | | //将主程序的服务设为重启
|
| | | /*//将主程序的服务设为重启
|
| | | Process_survey process=new Process_survey();
|
| | | process.setProcessName(ProcessServerDao.BMS_FBSDEV);
|
| | | Boolean b=(new Process_surveyImpl()).update(process);
|
| | | Boolean b=(new Process_surveyImpl()).update(process);*/
|
| | | App_Sys as=new App_Sys();
|
| | | as.setAppServer_Reinit_BattGroupData_EN(BattTestData.AppServer_Reinit_BattGroupData_EN);
|
| | | Boolean b=(new App_SysImpl()).update(as);
|
| | | model.setCode(1);
|
| | | model.setMsg("添加成功!");
|
| | | }
|
| | |
| | | public ServiceModel update(Object obj) {
|
| | | Boolean bl=dao.update(obj);
|
| | | if(bl){
|
| | | //将主程序的服务设为重启
|
| | | /*//将主程序的服务设为重启
|
| | | Process_survey process=new Process_survey();
|
| | | process.setProcessName(ProcessServerDao.BMS_FBSDEV);
|
| | | Boolean b=(new Process_surveyImpl()).update(process);
|
| | | Boolean b=(new Process_surveyImpl()).update(process);*/
|
| | | App_Sys as=new App_Sys();
|
| | | as.setAppServer_Reinit_BattGroupData_EN(BattTestData.AppServer_Reinit_BattGroupData_EN);
|
| | | Boolean b=(new App_SysImpl()).update(as);
|
| | | model.setCode(1);
|
| | | model.setMsg("修改成功!");
|
| | | }
|
| | |
| | | model.setCode(1);
|
| | | model.setMsg("修改成功!");
|
| | | }else{
|
| | | System.out.println(bl);
|
| | | //System.out.println(bl);
|
| | | binf.setFbsDeviceIp(binf.getFbsDeviceIp_old());
|
| | | binf.setFbsDeviceIp_WG(binf.getFbsDeviceIp_WG_old());
|
| | | binf.setFbsDeviceIp_YM(binf.getFbsDeviceIp_YM_old());
|
| | |
| | | public ServiceModel delete(Object obj) {
|
| | | Boolean bl=dao.del(obj);
|
| | | if(bl){
|
| | | //将主程序的服务设为重启
|
| | | /*//将主程序的服务设为重启
|
| | | Process_survey process=new Process_survey();
|
| | | process.setProcessName(ProcessServerDao.BMS_FBSDEV);
|
| | | Boolean b=(new Process_surveyImpl()).update(process);
|
| | | Boolean b=(new Process_surveyImpl()).update(process);*/
|
| | | App_Sys as=new App_Sys();
|
| | | as.setAppServer_Reinit_BattGroupData_EN(BattTestData.AppServer_Reinit_BattGroupData_EN);
|
| | | Boolean b=(new App_SysImpl()).update(as);
|
| | | model.setCode(1);
|
| | | model.setMsg("删除成功!");
|
| | | }
|
| | |
| | | //System.out.println(model);
|
| | | return model;
|
| | | }
|
| | |
|
| | | //电池配组管理(重要)
|
| | | public ServiceModel serchMakeGroup(Object obj){
|
| | | List<BattInf> list=((BattInfImpl)dao).serchMakeGroup(obj);
|
| | | Batt_param_low capLow=new Batt_param_low();
|
| | | capLow.setLow_type(BattCapFactory.CapType_type);//2容量
|
| | | capLow.setLow_nametype(BattCapFactory.CapType_name);//1次低
|
| | | capLow.setLow_method(BattCapFactory.CapType_method);//0
|
| | | List<Batt_param_low> listp=(new Batt_param_lowImpl()).serchByLow(capLow);
|
| | | float param=0f;//阈值
|
| | | if(listp!=null&&listp.size()>0){
|
| | | param=listp.get(listp.size()-1).getLow_value();//0.1
|
| | | }
|
| | | if(list!=null&&list.size()>0){
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | BattInf binf=list.get(i);
|
| | | List<Batttestdatastop> list_sdata=new ArrayList();
|
| | | //筛选出电池组有效的节能放电记录
|
| | | List<Batttestdata_inf> list_tinf=(new Batttestdata_infDAOImpl()).Batt_selecteffectiveBatt(binf, param);
|
| | | if(list_tinf!=null&&list_tinf.size()>0){
|
| | | Batttestdata_inf tinf=list_tinf.get(list_tinf.size()-1);
|
| | | //求出单体的实际容量
|
| | | list_sdata=(new BatttestdatastopDAOImpl().serchMakeGroup(binf, tinf));
|
| | | }else{
|
| | | for (int j = 0; j <binf.getMonCount(); j++) {
|
| | | Batttestdatastop sdata=new Batttestdatastop();
|
| | | sdata.setMon_num(j+1);
|
| | | sdata.setTest_cap(binf.getMonCapStd()/binf.getMonCount());//没有放电默认为标称
|
| | | list_sdata.add(sdata);
|
| | | }
|
| | | }
|
| | | binf.setObj(list_sdata);
|
| | | }
|
| | | model.setCode(1);
|
| | | model.setData(list);
|
| | | model.setMsg("查询成功!");
|
| | | }else{
|
| | | model.setCode(0);
|
| | | model.setMsg("查询失败!");
|
| | | }
|
| | | return model;
|
| | | }
|
| | | public static void main(String[] args) {
|
| | | //new BattInfServices().findMenu();
|
| | | BattInf b=new BattInf();
|
| | |
| | | b.setFbsDeviceIp_WG_old("192.168.0.1");
|
| | | b.setStationName("");
|
| | | b.setStationName1("");
|
| | | b.setStationName2("");
|
| | | b.setStationName9("");
|
| | | b.setBattGroupName("");
|
| | | b.setStationId("42070463");
|
| | | //b.setBattGroupName1("开关电源系统");
|
| | | //b.setBattProducer("光宇");
|
| | | b.setBattProducer("1");
|
| | | b.setMonCapStd(100f);
|
| | | b.setMonVolStd(12f);
|
| | | BattInfServices bs=new BattInfServices();
|
| | |
| | | bmd.setPage(page);
|
| | | //bs.searchInform(bmd);
|
| | | //bs.serchByBattGroupName(b);
|
| | | bs.updateIp(b);
|
| | | //bs.updateIp(b);
|
| | | ServiceModel model=bs.serchMakeGroup(b);
|
| | | List<BattInf> list=(List) model.getData();
|
| | | for (BattInf binf : list) {
|
| | | List<Batttestdatastop> list_sdata=(List) binf.getObj();
|
| | | for (Batttestdatastop s : list_sdata) {
|
| | | System.out.println(s);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|