Merge branch 'dev_lxw' of https://whychdw@gitlab.com/whyclxw1/gx_tieta.git into dev_lxw
| | |
| | | //电池配组管理(重要)
|
| | | 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;
|
| | |
| | |
|
| | | import com.fgkj.dto.Batt_endurance;
|
| | | import com.fgkj.dto.ServiceModel;
|
| | | import com.fgkj.dto.User_inf;
|
| | | import com.fgkj.services.Batt_enduranceService;
|
| | |
|
| | | public class Batt_enduranceAction extends ActionUtil{
|
| | |
| | | //续航时间的查询
|
| | | public String serchByCondition() {
|
| | | Batt_endurance bendurance=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Batt_endurance.class);
|
| | | User_inf uinf=(User_inf) getUser();
|
| | | bendurance.setNum(uinf.getUId());
|
| | | ServiceModel model=service.serchByCondition(bendurance);
|
| | | result=tojson(model);
|
| | | return SUCCESS;
|
| | |
| | | import com.fgkj.dto.BattInf;
|
| | | import com.fgkj.dto.Bts_station_event;
|
| | | import com.fgkj.dto.ServiceModel;
|
| | | import com.fgkj.dto.User_inf;
|
| | | import com.fgkj.services.Batt_devalarm_data_historyService;
|
| | | import com.fgkj.services.Bts_station_eventService;
|
| | |
|
| | |
| | | //机房事件统计
|
| | | public String serchByCondition(){
|
| | | 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.serchByCondition(binf);
|
| | | result=tojson(model);
|
| | | return SUCCESS;
|
| | |
| | | //机房事件统计
|
| | | public String serchByInfo(){
|
| | | Bts_station_event bevent=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Bts_station_event.class);
|
| | | User_inf uinf=(User_inf) getUser();
|
| | | bevent.setNum(uinf.getUId());
|
| | | ServiceModel model=service.serchByInfo(bevent);
|
| | | result=tojson(model);
|
| | | return SUCCESS;
|
| | |
| | | import com.fgkj.actions.ActionUtil;
|
| | | import com.fgkj.dto.BattInf;
|
| | | import com.fgkj.dto.ServiceModel;
|
| | | import com.fgkj.dto.User_inf;
|
| | | import com.fgkj.services.ram.Bts_station_stateService;
|
| | |
|
| | | public class Bts_station_stateAction extends ActionUtil{
|
| | |
| | | //查询机房实时状态
|
| | | public String serchByCondition(){
|
| | | 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.serchByCondition(binf);
|
| | | result=tojson(model);
|
| | | return SUCCESS;
|
| | | }
|
| | | //查询当前机房停电数
|
| | | public String serchByState(){
|
| | | User_inf uinf=(User_inf) getUser();
|
| | | ServiceModel model=service.serchByState(uinf);
|
| | | result=tojson(model);
|
| | | return SUCCESS;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
| | | " 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 userSql=" and StationId in(" +
|
| | | " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id and db_user.tb_user_battgroup_baojigroup_usr.uId=?" +
|
| | | " ) ";
|
| | | sql+=userSql;
|
| | | //选中品牌一致
|
| | | String producerSqlT=" order by BattProducer,MonCapStd,MonVolStd,BattGroupId ";//一致
|
| | | String producerSqlF=" order by MonCapStd,MonVolStd,BattGroupId ";//不一致
|
| | |
| | | }else{
|
| | | sql+=producerSqlF;
|
| | | }
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName2()+"%"}, new CallBack() {
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName2()+"%",binf.getNum()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List<BattInf> list=new ArrayList();
|
| | |
| | | " 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 stationname1 like ? and stationname2 like ? and stationname3 like ? and battgroupname like ? and battgroupid=? ";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getBattGroupName()+"%",binf.getBattGroupId()}, new CallBack() {
|
| | | //用户管理
|
| | | String userSql=" and StationId in(" +
|
| | | " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id and db_user.tb_user_battgroup_baojigroup_usr.uId=?" +
|
| | | " ) ";
|
| | | sql+=userSql;
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getBattGroupName()+"%",binf.getBattGroupId(),binf.getNum()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List<BattInf> list=new ArrayList();
|
| | |
| | |
|
| | | BattInfImpl biml = new BattInfImpl();
|
| | | BattInf binf = new BattInf();
|
| | | binf.setNum(1002);
|
| | | binf.setBattGroupId(1000001);
|
| | | binf.setStationName("");
|
| | | binf.setStationName1("");
|
| | | binf.setStationName2("");
|
| | | binf.setStationName3("武汉源暢实验室1");
|
| | | binf.setStationName3("");
|
| | | binf.setBattGroupName("");
|
| | | binf.setBattProducer("1");
|
| | | User_inf uinf=new User_inf();
|
| | |
| | | //List<BattInf> list = biml.serchByConditionNew(bmd);
|
| | | //List<BattInf> list=biml.serchByTestType(bmd);
|
| | | //List<BattInf> list=biml.serchGroupAssess(bmd);
|
| | | //List<BattInf> list=biml.serchMakeGroup(binf);
|
| | | List<BattInf> list=biml.serchGroupByInfor(binf);
|
| | | List<BattInf> list=biml.serchMakeGroup(binf);
|
| | | //List<BattInf> list=biml.serchGroupByInfor(binf);
|
| | | for (BattInf b : list) {
|
| | | System.out.println(b);
|
| | | }
|
| | |
| | | String sql="select SQL_CALC_FOUND_ROWS distinct tb_batt_endurance.num,tb_batt_endurance.deviceid,tb_batt_endurance.stationid,real_cap,tb_batt_endurance.moncapstd,real_curr,endurance_theory_timelong,endurance_actual_timelong,is_out_stand " +
|
| | | ",db_battinf.tb_battinf.StationName,db_battinf.tb_battinf.StationName1,db_battinf.tb_battinf.StationName2 " +
|
| | | " from web_site.tb_batt_endurance,db_battinf.tb_battinf " +
|
| | | " where tb_batt_endurance.stationid=db_battinf.tb_battinf.stationid " ;
|
| | | " where tb_batt_endurance.stationid=db_battinf.tb_battinf.stationid "+
|
| | | " and tb_batt_endurance.stationid in (" +
|
| | | " select distinct db_battinf.tb_battinf.stationid " +
|
| | | " from db_battinf.tb_battinf " +
|
| | | " left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid " +
|
| | | " left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
|
| | | " left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
|
| | | " where db_user.tb_user_inf.uid=? ) " ;
|
| | | //机房筛选
|
| | | String stationSql=" and db_battinf.tb_battinf.StationName like ? and db_battinf.tb_battinf.StationName1 like ? and db_battinf.tb_battinf.StationName2 like ?";
|
| | | sql+=stationSql;
|
| | |
| | |
|
| | |
|
| | | //System.out.println(sql);
|
| | | List<Batt_endurance> list=DAOHelper.executeQueryLimit(sql, conn, new Object[]{"%"+bendurance.getStationName()+"%","%"+bendurance.getStationName1()+"%","%"+bendurance.getStationName2()+"%",bendurance.getEndurance_actual_timelong(),bendurance.getIs_out_stand()
|
| | | List<Batt_endurance> list=DAOHelper.executeQueryLimit(sql, conn, new Object[]{bendurance.getNum(),"%"+bendurance.getStationName()+"%","%"+bendurance.getStationName1()+"%","%"+bendurance.getStationName2()+"%",bendurance.getEndurance_actual_timelong(),bendurance.getIs_out_stand()
|
| | | ,(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | |
| | | public static void main(String[] args) {
|
| | | Batt_enduranceImpl bimpl=new Batt_enduranceImpl();
|
| | | Batt_endurance ben=new Batt_endurance();
|
| | | ben.setNum(1002);
|
| | | ben.setStationName("");
|
| | | ben.setStationName1("");
|
| | | ben.setStationName2("");
|
| | |
| | | String sql="select station_id,dev_id,station_event_type,record_datetime,station_event_trig ,tb_battinf.StationName,tb_battinf.StationName1,tb_battinf.StationName2,tb_battinf.StationName3 " +
|
| | | " from db_alarm.tb_bts_station_event,db_battinf.tb_battinf " +
|
| | | " where tb_bts_station_event.dev_id=tb_battinf.FBSDeviceId " +
|
| | | " and tb_bts_station_event.station_id in (" +
|
| | | " select distinct db_battinf.tb_battinf.stationid " +
|
| | | " from db_battinf.tb_battinf " +
|
| | | " left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid " +
|
| | | " left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
|
| | | " left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
|
| | | " where db_user.tb_user_inf.uid=? ) " +
|
| | | " and record_datetime>=? and record_datetime<=? " +
|
| | | " and stationname1 like ? and stationname2 like ? and stationname3 like ? and stationid like ? " ;
|
| | | /*//事件筛选
|
| | |
| | | String orderSql=" order by station_id,record_datetime,station_event_type asc ";
|
| | | sql+=orderSql;
|
| | | //System.err.println(sql);
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getBattInUseDate(),binf.getBattInUseDate1(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationId()+"%"}, new CallBack() {
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum(),binf.getBattInUseDate(),binf.getBattInUseDate1(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationId()+"%"}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | |
| | | String sql="select distinct station_id,dev_id,station_event_type,record_datetime,station_event_trig ,tb_battinf.StationName,tb_battinf.StationName1,tb_battinf.StationName2,tb_battinf.StationName3 " +
|
| | | " from db_alarm.tb_bts_station_event,db_battinf.tb_battinf " +
|
| | | " where tb_bts_station_event.dev_id=tb_battinf.FBSDeviceId " +
|
| | | " and tb_bts_station_event.station_id in (" +
|
| | | " select distinct db_battinf.tb_battinf.stationid " +
|
| | | " from db_battinf.tb_battinf " +
|
| | | " left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid " +
|
| | | " left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
|
| | | " left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
|
| | | " where db_user.tb_user_inf.uid=? ) " +
|
| | | " and dev_id=? " +
|
| | | " and record_datetime>=? and record_datetime<=? ";
|
| | | //基站状态
|
| | |
| | | //sql+=limitSql;
|
| | | //,(p.getPageCurr()-1)*p.getPageSize(),p.getPageSize()
|
| | | //executeQueryLimit
|
| | | List<Bts_station_event> list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{bevent.getDev_id(),bevent.getRecord_datetime(),bevent.getRecord_datetime_end(),bevent.getStation_event_type()}, new CallBack() {
|
| | | List<Bts_station_event> list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{bevent.getNum(),bevent.getDev_id(),bevent.getRecord_datetime(),bevent.getRecord_datetime_end(),bevent.getStation_event_type()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | |
| | |
|
| | |
|
| | | BattInf binf = new BattInf();
|
| | | binf.setNum(0);
|
| | | binf.setNum(1002);
|
| | | binf.setStationName("");
|
| | | binf.setStationName1("");
|
| | | binf.setStationName2("");
|
| | |
| | | bmd.setPage(p);
|
| | | bmd.setBinf(binf);
|
| | | bmd.setUinf(uinf);
|
| | | /* List<Bts_station_event> list=bimpl.serchByCondition(binf);
|
| | | List<Bts_station_event> list=bimpl.serchByCondition(binf);
|
| | | System.out.println(list.size());
|
| | | for (Bts_station_event b : list) {
|
| | | System.out.println(b.getNote()+" "+b.getDev_id()+" "+b.getStation_event_type_poff()+" "+b.getStation_event_type_xuhang()+" "+b.getStation_event_type_fadian()+" "+b.getStation_event_type_diaozhan()+" "+b.getStation_event_type_dooropen()+" "+b.getStation_event_type_tempup()+" "+b.getStation_event_type_templow()+" "+b.getStation_event_type_dampup()+" "+b.getStation_event_type_damplow()+" "+b.getStationName());
|
| | | }*/
|
| | | }
|
| | | Bts_station_event b=new Bts_station_event();
|
| | | b.setNum(1002);
|
| | | b.setDev_id(910000001);
|
| | | b.setRecord_datetime(ActionUtil.getSimpDate(date1));
|
| | | b.setRecord_datetime_end(ActionUtil.getSimpDate(date2));
|
| | |
| | | page.setPageCurr(1);
|
| | | page.setPageSize(10);
|
| | | b.setPage(page);
|
| | | List list=bimpl.serchByInfo(b);
|
| | | System.out.println(list.size());
|
| | | /*List list=bimpl.serchByInfo(b);
|
| | | System.out.println(list.size());*/
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.fgkj.dao.CallBack;
|
| | | import com.fgkj.dao.DAOHelper;
|
| | | import com.fgkj.dao.LimitNumberFactory;
|
| | | import com.fgkj.dao.UinfDaoFactory;
|
| | | import com.fgkj.db.DBUtil;
|
| | | import com.fgkj.dto.BattInf;
|
| | | import com.fgkj.dto.Page;
|
| | | import com.fgkj.dto.User_inf;
|
| | | import com.fgkj.dto.ram.Bts_station_state;
|
| | |
|
| | | public class Bts_station_stateImpl implements BaseDAO,CallBack{
|
| | |
| | | " ,tb_battinf.stationname,tb_battinf.stationname1,tb_battinf.stationname2,tb_battinf.stationname3 " +
|
| | | " from db_ram_db.tb_bts_station_state,db_battinf.tb_battinf " +
|
| | | " where tb_bts_station_state.dev_id=db_battinf.tb_battinf.FBSDeviceId " +
|
| | | " and tb_bts_station_state.station_id=db_battinf.tb_battinf.StationId " +
|
| | | " and tb_bts_station_state.station_id in (" +
|
| | | " select distinct db_battinf.tb_battinf.stationid " +
|
| | | " from db_battinf.tb_battinf " +
|
| | | " left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid " +
|
| | | " left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
|
| | | " left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
|
| | | " where db_user.tb_user_inf.uid=? ) " +
|
| | | " and tb_battinf.stationname1 like ? and tb_battinf.stationname2 like ? and tb_battinf.stationname3 like ? " +
|
| | | " and stationid like ? limit ? ,? ";
|
| | | List<Bts_station_state> list=DAOHelper.executeQueryLimit(sql, conn, new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationId()+"%",(p.getPageCurr()-1)*p.getPageSize(),p.getPageSize()},new CallBack() {
|
| | | List<Bts_station_state> list=DAOHelper.executeQueryLimit(sql, conn, new Object[]{binf.getNum(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationId()+"%",(p.getPageCurr()-1)*p.getPageSize(),p.getPageSize()},new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | |
| | | return list;
|
| | | }
|
| | | //查询当前机房停电数
|
| | | public int serchByState() {
|
| | | String sql=" select count(*) as nums from db_ram_db.tb_bts_station_state where station_stat&2>1 ";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), null, new CallBack() {
|
| | | public int serchByState(Object obj) {
|
| | | User_inf uinf=(User_inf) obj;
|
| | | String sql=" select count(*) as nums from db_ram_db.tb_bts_station_state where station_stat&2>1 " +
|
| | | " and tb_bts_station_state.station_id in (" +
|
| | | " select distinct db_battinf.tb_battinf.stationid " +
|
| | | " from db_battinf.tb_battinf " +
|
| | | " left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.stationid=db_battinf.tb_battinf.stationid " +
|
| | | " left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " +
|
| | | " left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " +
|
| | | " where db_user.tb_user_inf.uid=? ) " ;
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | |
| | | public static void main(String[] args) {
|
| | | Bts_station_stateImpl bimpl=new Bts_station_stateImpl();
|
| | | BattInf binf=new BattInf();
|
| | | binf.setNum(1002);
|
| | | binf.setStationName1("");
|
| | | binf.setStationName2("");
|
| | | binf.setStationName3("");
|
| | | binf.setStationId("");
|
| | | User_inf uinf=new User_inf();
|
| | | uinf.setUId(1002);
|
| | | Page p=new Page();
|
| | | p.setPageCurr(1);
|
| | | p.setPageSize(1);
|
| | | binf.setPage(p);
|
| | | /*List<Bts_station_state> list=bimpl.serchByCondition(binf);
|
| | | List<Bts_station_state> list=bimpl.serchByCondition(binf);
|
| | | for (Bts_station_state bs : list) {
|
| | | //System.out.println(bs.getStation_stat_diaozhan()+" "+bs.getStation_stat_dooropen()+" "+bs.getStation_stat_fadian()+" "+bs.getStation_stat_xuhang()+" "+bs.getStation_stat_poff());
|
| | | System.out.println(bs);
|
| | | }*/
|
| | | int nums=bimpl.serchByState();
|
| | | System.out.println(nums);
|
| | | }
|
| | | /*int nums=bimpl.serchByState(uinf);
|
| | | System.out.println(nums);*/
|
| | | }
|
| | |
|
| | |
|
| | |
| | |
|
| | | import com.fgkj.dao.BaseDAO;
|
| | | import com.fgkj.dao.BaseDAOFactory;
|
| | | import com.fgkj.dao.impl.ram.Bts_station_stateImpl;
|
| | | import com.fgkj.dto.ServiceModel;
|
| | |
|
| | | public class Bts_station_stateService {
|
| | |
| | | }
|
| | | return model;
|
| | | }
|
| | | //查询当前机房停电数
|
| | | public ServiceModel serchByState(Object obj) {
|
| | | int nums=((Bts_station_stateImpl)dao).serchByState(obj);
|
| | | model.setNewsum(nums);
|
| | | return model; |
| | | }
|
| | |
|
| | | }
|
| | |
| | | String exp_thead_str = req.getParameter("exp_thead");
|
| | | String exp_tbody_str = req.getParameter("exp_tbody");
|
| | |
|
| | | String exp_page_break = req.getParameter("exp_page_break");
|
| | | String exp_data_break = req.getParameter("exp_data_break");
|
| | | String exp_page_break = "\\"+req.getParameter("exp_page_break");
|
| | | String exp_data_break = "\\"+req.getParameter("exp_data_break");
|
| | |
|
| | | String exp_page_names_str = req.getParameter("exp_page_names");
|
| | |
|
| | |
| | | String[] exp_thead_sheets = exp_thead_str.split(exp_page_break);
|
| | | String[] exp_tbody_sheets = exp_tbody_str.split(exp_page_break);
|
| | |
|
| | | |
| | | for (int i = 0; i < exp_page_names.length && exp_page_names.length >= exp_thead_sheets.length; i++) {
|
| | | HSSFSheet sheet = workbook.createSheet(excelTitle);
|
| | | HSSFSheet sheet = workbook.createSheet(exp_page_names[i]);
|
| | | String[] exp_thead = exp_thead_sheets[i].split(exp_data_break);
|
| | | String[] exp_tbody = exp_tbody_sheets[i].split(exp_data_break);
|
| | |
|
| | | int maxColNum = exp_thead.length; //最大列数
|
| | | int nowRowNum = 0; //当前行
|
| | | int nowColNum = 0; //当前列
|
| | | for(int j=0;j <= exp_tbody.length;j++){
|
| | | HSSFRow row = null;
|
| | | for(int j=0;j <= exp_tbody.length;j++){
|
| | | //System.out.println("j="+j+"\t nowRowNum="+nowRowNum);
|
| | | if(j == 0){
|
| | | row = sheet.createRow(nowRowNum++);
|
| | | for(int k=0;k<exp_thead.length;k++){
|
| | |
| | | }
|
| | | HSSFCell cell = row.createCell(nowColNum++);
|
| | | HSSFRichTextString text = new HSSFRichTextString(exp_tbody[j-1]);
|
| | | //HSSFRichTextString text = new HSSFRichTextString("*****");
|
| | | //System.out.print(text+"\t");
|
| | | cell.setCellValue(text);
|
| | | }
|
| | |
| | | + new String(excelName.getBytes("gb2312"), "ISO8859-1")
|
| | | + ".xls");
|
| | | OutputStream out = resp.getOutputStream();
|
| | | workbook.write(out);
|
| | | out.close();
|
| | | } catch (UnsupportedEncodingException e) {
|
| | | e.printStackTrace();
|
| | | } catch (IOException e) {
|
| | |
| | |
|
| | | }
|
| | |
|
| | | |
| | | public static void main(String[] args) {
|
| | | String ths = "h1&h2&h3&h4$xh1&xh2&xh3&xh4";
|
| | | System.out.println(ths.indexOf("$"));
|
| | | String[] sheets = ths.split("\\&");
|
| | | System.out.println(sheets.length);
|
| | | }
|
| | | }
|