| | |
| | | import com.fgkj.db.DBUtil;
|
| | | import com.fgkj.db.IDatabaseName;
|
| | | import com.fgkj.dto.BattInf;
|
| | | import com.fgkj.dto.BattInf_Rebuild;
|
| | | import com.fgkj.dto.BattMap_information;
|
| | | import com.fgkj.dto.Batt_Maint_Dealarm;
|
| | | import com.fgkj.dto.Batt_maint_inf;
|
| | |
| | | //电池配组管理(重要)
|
| | | public List serchMakeGroup(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="SELECT distinct BattGroupId,battgroupname,stationid,stationname1,stationname2,stationname,stationname3,BattProducer,MonVolStd,MonCapStd,monCount from db_battinf.tb_battinf where stationname2 like ? ";
|
| | | String sql="SELECT distinct BattGroupId,battgroupname,stationid,stationname1,stationname2,stationname,stationname3,BattProducer,MonVolStd,MonCapStd,monCount " +
|
| | | " ,battinf_re.old_stationname,old_battgroupname,old_battproducer,old_stationid,old_battgroupid,old_monum,new_stationname,new_battgroupname,new_battproducer,new_stationid,new_battgroupid,new_monum,rebuild_time,rebuild_uid,rebuild_address,rebuild_clear_type " +
|
| | | " from db_battinf.tb_battinf " +
|
| | | " left outer join (select * from db_battinf.tb_battinf_rebuild where tb_battinf_rebuild.rebuild_clear_type=1 ) as battinf_re " +
|
| | | " on BattGroupId=battinf_re.new_battgroupid or BattGroupId=battinf_re.old_battgroupid " +
|
| | | " where stationname2 like ? ";
|
| | | //选中品牌一致
|
| | | String producerSqlT=" order by BattProducer,MonCapStd,MonVolStd ";//一致
|
| | | String producerSqlF=" order by MonCapStd,MonVolStd ";//不一致
|
| | | String producerSqlT=" order by BattProducer,MonCapStd,MonVolStd,BattGroupId ";//一致
|
| | | String producerSqlF=" order by MonCapStd,MonVolStd,BattGroupId ";//不一致
|
| | | if(binf.getBattProducer().equals("1")){
|
| | | sql+=producerSqlT;
|
| | | }else{
|
| | |
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName2()+"%"}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | List<BattInf> list=new ArrayList();
|
| | | int battgroupid=0;
|
| | | try {
|
| | | while(rs.next()){
|
| | | BattInf binf=new BattInf();
|
| | |
| | | binf.setMonVolStd(rs.getFloat("monVolStd"));
|
| | | binf.setMonCapStd(rs.getFloat("monCapStd"));
|
| | | binf.setMonCount(rs.getInt("monCount"));
|
| | | |
| | | BattInf_Rebuild brinf=new BattInf_Rebuild();
|
| | | brinf.setNew_battgroupid(rs.getInt("new_battgroupid"));
|
| | | brinf.setNew_battgroupname(rs.getString("new_battgroupname"));
|
| | | brinf.setNew_battproducer(rs.getString("new_battproducer"));
|
| | | brinf.setNew_monum(rs.getInt("new_monum"));
|
| | | brinf.setNew_stationid(rs.getString("new_stationid"));
|
| | | brinf.setNew_stationname(rs.getString("new_stationname"));
|
| | | brinf.setOld_battgroupid(rs.getInt("old_battgroupid"));
|
| | | brinf.setOld_battgroupname(rs.getString("old_battgroupname"));
|
| | | brinf.setOld_battproducer(rs.getString("old_battproducer"));
|
| | | brinf.setOld_monum(rs.getInt("old_monum"));
|
| | | brinf.setOld_stationid(rs.getString("old_stationid"));
|
| | | brinf.setOld_stationname(rs.getString("old_stationname"));
|
| | | brinf.setRebuild_address(rs.getString("rebuild_address"));
|
| | | brinf.setRebuild_clear_type(rs.getInt("rebuild_clear_type"));
|
| | | brinf.setRebuild_time(rs.getTimestamp("rebuild_time"));
|
| | | brinf.setRebuild_uid(rs.getInt("rebuild_uid"));
|
| | | |
| | | if(binf.getBattGroupId()==battgroupid){
|
| | | ((ArrayList)list.get(list.size()-1).getObj()).add(brinf);
|
| | | continue;
|
| | | }
|
| | | List listr=new ArrayList();
|
| | | listr.add(brinf);
|
| | | binf.setObj(listr);
|
| | | battgroupid=binf.getBattGroupId();
|
| | | |
| | | list.add(binf);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | |
| | | BattInfImpl biml = new BattInfImpl();
|
| | | BattInf binf = new BattInf();
|
| | | binf.setBattGroupId(1000967);
|
| | | binf.setStationName("内蒙古");
|
| | | binf.setStationName1("内蒙古");
|
| | | |
| | | binf.setStationName("");
|
| | | binf.setStationName1("");
|
| | | binf.setStationName2("");
|
| | | binf.setBattProducer("1");
|
| | | User_inf uinf=new User_inf();
|
| | | uinf.setUId(1002);
|
| | |
|
| | |
| | | //List<BattInf> list = biml.serchByConditionNew(bmd);
|
| | | //List<BattInf> list=biml.serchByTestType(bmd);
|
| | | //List<BattInf> list=biml.serchGroupAssess(bmd);
|
| | | List<BattInf> list=biml.serchByMonNum(binf);
|
| | | List<BattInf> list=biml.serchMakeGroup(binf);
|
| | | for (BattInf b : list) {
|
| | | System.out.println(b);
|
| | | }
|
| | |
| | | import com.fgkj.db.IDatabaseName;
|
| | | import com.fgkj.dto.Alarm_param;
|
| | | import com.fgkj.dto.BattInf;
|
| | | import com.fgkj.dto.BattInf_Rebuild;
|
| | | import com.fgkj.dto.Batt_Maint_Dealarm;
|
| | | import com.fgkj.dto.Batttestdata;
|
| | | import com.fgkj.dto.Batttestdata_inf;
|
| | |
| | | //电池配组管理(重要)
|
| | | public List serchMakeGroup(Object obj1,Object obj2){
|
| | | BattInf binf=(BattInf) obj1;
|
| | | List listr=(List) binf.getObj();
|
| | | 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 " +
|
| | |
| | | if(list!=null&&list.size()>0){
|
| | | for(int i=0;i<list.size();i++){
|
| | | Batttestdatastop sdata=list.get(i);
|
| | | sdata.setNote(binf.getBattProducer());
|
| | | for (int j = 0; j < listr.size(); j++) {
|
| | | BattInf_Rebuild brinf=(BattInf_Rebuild) listr.get(j);
|
| | | if(sdata.getMon_num()==brinf.getOld_monum()){
|
| | | sdata.setMon_num(-1);
|
| | | break;
|
| | | }
|
| | | if(sdata.getMon_num()==brinf.getNew_monum()){
|
| | | sdata.setNote(brinf.getOld_battproducer());
|
| | | break;
|
| | | }
|
| | | }
|
| | | STDAH=binf.getMonCapStd();
|
| | | MonomerVolType=binf.getMonVolStd();
|
| | |
|
| | |
| | |
|
| | | public class Batt_Maint_Dealarm implements Serializable{
|
| | | private BattInf binf; //battinf对象信息
|
| | | private BattInf_Rebuild brinf; //BattInf_Rebuild对象
|
| | | private Batt_maintenance_inf minf; //Batt_maintenance_inf对象信息
|
| | | private Batt_maint_inf mainf; //Batt_maint_inf对象信息
|
| | | private Batt_maint_process mprocess; //Batt_maint_process对象信息
|
| | |
| | | public void setAdata_H(Battalarm_data_history adata_H) {
|
| | | this.adata_H = adata_H;
|
| | | }
|
| | | public BattInf_Rebuild getBrinf() {
|
| | | return brinf;
|
| | | }
|
| | | public void setBrinf(BattInf_Rebuild brinf) {
|
| | | this.brinf = brinf;
|
| | | }
|
| | | @Override
|
| | | public String toString() {
|
| | | return "Batt_Maint_Dealarm [binf=" + binf + ", minf=" + minf
|
| | | + ", mainf=" + mainf + ", mprocess=" + mprocess + ", uinf="
|
| | | + uinf + ", tdata=" + tdata + ", rinf=" + rinf + ", rdata="
|
| | | + rdata + ", adata=" + adata + ", sdata=" + sdata + ", page="
|
| | | + page + ", bplan=" + bplan + ", binformation=" + binformation
|
| | | + ", bdmon=" + bdmon + ", adata_H=" + adata_H + "]";
|
| | | return "Batt_Maint_Dealarm [binf=" + binf + ", brinf=" + brinf
|
| | | + ", minf=" + minf + ", mainf=" + mainf + ", mprocess="
|
| | | + mprocess + ", uinf=" + uinf + ", tdata=" + tdata + ", rinf="
|
| | | + rinf + ", rdata=" + rdata + ", adata=" + adata + ", sdata="
|
| | | + sdata + ", page=" + page + ", bplan=" + bplan
|
| | | + ", binformation=" + binformation + ", bdmon=" + bdmon
|
| | | + ", adata_H=" + adata_H + "]";
|
| | | }
|
| | | |
| | |
|
| | |
|
| | |
|
| | |
| | | private Float mon_min;
|
| | | private Float mon_max;
|
| | | private float percent;
|
| | | private String note;
|
| | | public Batttestdatastop() {
|
| | | }
|
| | |
|
| | |
| | | this.percent = percent;
|
| | | }
|
| | |
|
| | | public String getNote() {
|
| | | return note;
|
| | | }
|
| | |
|
| | | public void setNote(String note) {
|
| | | this.note = note;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String toString() {
|
| | | return "Batttestdatastop [num=" + num + ", BattGroupId=" + BattGroupId
|
| | |
| | | + ", test_cap=" + test_cap + ", mon_num=" + mon_num
|
| | | + ", mon_vol=" + mon_vol + ", lowC=" + lowC + ", lowV=" + lowV
|
| | | + ", mon_avg=" + mon_avg + ", mon_min=" + mon_min
|
| | | + ", mon_max=" + mon_max + ", percent=" + percent + "]";
|
| | | + ", mon_max=" + mon_max + ", percent=" + percent + ", note="
|
| | | + note + "]";
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | |
| | |
|
| | |
|
| | |
|
| | |
| | | import com.fgkj.db.DBUtil;
|
| | | import com.fgkj.dto.App_Sys;
|
| | | import com.fgkj.dto.BattInf;
|
| | | import com.fgkj.dto.BattInf_Rebuild;
|
| | | import com.fgkj.dto.Batt_Maint_Dealarm;
|
| | | import com.fgkj.dto.Batt_param_low;
|
| | | import com.fgkj.dto.Batttestdata_inf;
|
| | |
| | | //求出单体的实际容量
|
| | | list_sdata=(new BatttestdatastopDAOImpl().serchMakeGroup(binf, tinf));
|
| | | }else{
|
| | | List listr=(List) binf.getObj();
|
| | | for (int j = 0; j <binf.getMonCount(); j++) {
|
| | | Batttestdatastop sdata=new Batttestdatastop();
|
| | | sdata.setBattGroupId(binf.getBattGroupId());
|
| | | sdata.setNote(binf.getBattProducer());
|
| | | sdata.setMon_num(j+1);
|
| | | for (int z = 0; z < listr.size(); z++) {
|
| | | BattInf_Rebuild brinf=(BattInf_Rebuild) listr.get(z);
|
| | | if((j+1)==brinf.getOld_monum()){
|
| | | sdata.setMon_num(-1);
|
| | | break;
|
| | | }
|
| | | if((j+1)==brinf.getNew_monum()){
|
| | | sdata.setNote(brinf.getOld_battproducer());
|
| | | break;
|
| | | }
|
| | | }
|
| | | sdata.setTest_cap(binf.getMonCapStd());//没有放电默认为标称
|
| | | sdata.setPercent(1f);
|
| | | list_sdata.add(sdata);
|
| | |
| | | //bs.searchInform(bmd);
|
| | | //bs.serchByBattGroupName(b);
|
| | | //bs.updateIp(b);
|
| | | /*ServiceModel model=bs.serchMakeGroup(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);
|
| | | }
|
| | | }*/
|
| | | }
|
| | | //BattTestData.run_cmd(BattTestData.STRCMD);
|
| | | }
|
| | | }
|