New file |
| | |
| | | package com.fgkj.actions;
|
| | |
|
| | | import com.fgkj.dto.BattInf_Rebuild;
|
| | | import com.fgkj.dto.ServiceModel;
|
| | | import com.fgkj.dto.User;
|
| | | import com.fgkj.dto.User_inf;
|
| | | import com.fgkj.services.BattInf_RebuildService;
|
| | |
|
| | | public class BattInf_RebuildAction extends ActionUtil{
|
| | | private BattInf_RebuildService service=new BattInf_RebuildService();
|
| | | private String json;
|
| | | private String result;
|
| | | |
| | | //添加
|
| | | public String add() {
|
| | | BattInf_Rebuild br=getGson("yyyy-MM-dd").fromJson(json, BattInf_Rebuild.class);
|
| | | User_inf uinf=(User_inf) getUser();
|
| | | br.setRebuild_uid(uinf.getUId());
|
| | | ServiceModel model=service.add(br);
|
| | | result=tojson(model);
|
| | | return SUCCESS;
|
| | | }
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public String getResult() {
|
| | | return result;
|
| | | }
|
| | | public void setJson(String json) {
|
| | | this.json = json;
|
| | | }
|
| | | |
| | | |
| | | }
|
| | |
| | |
|
| | | public static final int BATT_ENDURANCE=87;
|
| | |
|
| | | public static final int BATTINF_REBUILD=88;
|
| | | |
| | | public boolean add(Object obj); // 添加
|
| | |
|
| | | public boolean update(Object obj); // 更新
|
| | |
| | | // TODO Auto-generated method stub
|
| | | return null;
|
| | | }
|
| | |
|
| | | //添加
|
| | | public boolean add(Object obj) {
|
| | | BattInf_Rebuild br=(BattInf_Rebuild) obj;
|
| | | String sql="insert into db_battinf.tb_battinf_rebuild(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) " +
|
| | | "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
| | | String sql="insert into db_battinf.tb_battinf_rebuild(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_clear_type) " +
|
| | | "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
| | | boolean bl=DAOHelper.executeUpdate(DBUtil.getConn(), sql, new Object[]{br.getOld_stationname(),br.getOld_battgroupname(),br.getOld_battproducer(),br.getOld_stationid(),br.getOld_battgroupid(),br.getOld_monum(),
|
| | | br.getNew_stationname(),br.getNew_battgroupname(),br.getNew_battproducer(),br.getNew_stationid(),br.getNew_battgroupid(),br.getNew_monum(),br.getRebuild_time(),br.getRebuild_uid(),br.getRebuild_address(),br.getRebuild_clear_type()});
|
| | | br.getNew_stationname(),br.getNew_battgroupname(),br.getNew_battproducer(),br.getNew_stationid(),br.getNew_battgroupid(),br.getNew_monum(),br.getRebuild_time(),br.getRebuild_uid(),br.getRebuild_clear_type()});
|
| | | return bl;
|
| | | }
|
| | |
|
| | | //将同电池组同单体的记录变为历史(rebuild_clear_type=0)
|
| | | public boolean update(Object obj) {
|
| | | // TODO Auto-generated method stub
|
| | | return false;
|
| | | BattInf_Rebuild br=(BattInf_Rebuild) obj;
|
| | | String sql="update db_battinf.tb_battinf_rebuild set rebuild_clear_type=0 where new_battgroupid=? and new_monum=? ";
|
| | | Boolean bl=DAOHelper.executeUpdate(DBUtil.getConn(), sql, new Object[]{br.getNew_battgroupid(),br.getNew_monum()});
|
| | | return bl;
|
| | | }
|
| | |
|
| | | public boolean del(Object obj) {
|
| | |
| | | for(int i=0;i<list.size();i++){
|
| | | Batttestdatastop sdata=list.get(i);
|
| | | sdata.setNote(binf.getBattProducer());
|
| | | sdata.setStationid(binf.getStationId());
|
| | | for (int j = 0; j < listr.size(); j++) {
|
| | | BattInf_Rebuild brinf=(BattInf_Rebuild) listr.get(j);
|
| | | if(sdata.getMon_num()==brinf.getOld_monum()&&sdata.getBattGroupId()==brinf.getOld_battgroupid()){
|
New file |
| | |
| | | package com.fgkj.dao.impl.ram;
|
| | |
|
| | | import java.sql.ResultSet;
|
| | | import java.util.List;
|
| | |
|
| | | import com.fgkj.dao.BaseDAO;
|
| | | import com.fgkj.dao.CallBack;
|
| | |
|
| | | public class Bts_station_stateImpl 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;
|
| | | }
|
| | |
|
| | | public boolean update(Object obj) {
|
| | | // TODO Auto-generated method stub
|
| | | return false;
|
| | | }
|
| | |
|
| | | 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;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | private Float mon_max;
|
| | | private float percent;
|
| | | private String note;
|
| | | private String stationid;
|
| | | public Batttestdatastop() {
|
| | | }
|
| | |
|
| | |
| | | public void setNote(String note) {
|
| | | this.note = note;
|
| | | }
|
| | | |
| | | public String getStationid() {
|
| | | return stationid;
|
| | | }
|
| | |
|
| | | public void setStationid(String stationid) {
|
| | | this.stationid = stationid;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String toString() {
|
| | |
| | | + ", mon_vol=" + mon_vol + ", lowC=" + lowC + ", lowV=" + lowV
|
| | | + ", mon_avg=" + mon_avg + ", mon_min=" + mon_min
|
| | | + ", mon_max=" + mon_max + ", percent=" + percent + ", note="
|
| | | + note + "]";
|
| | | + note + ", stationid=" + stationid + "]";
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | |
| | |
|
| | |
|
| | |
|
New file |
| | |
| | | package com.fgkj.dto.ram;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | import com.fgkj.dto.Page;
|
| | |
|
| | | public class Bts_station_state implements Serializable{
|
| | | private int num;
|
| | | private int station_id;
|
| | | private int dev_id;
|
| | | private Date record_datetime;
|
| | | private int station_stat;
|
| | | private Date station_poff_start_time;
|
| | | private int station_poff_tlong;
|
| | | private Date station_fadian_start_time;
|
| | | private int station_fadian_tlong;
|
| | | private Date station_diaozhan_start_time;
|
| | | private int station_diaozhan_tlong;
|
| | | private float station_temp;
|
| | | private float station_damp;
|
| | | private Date station_dooropen_start_time;
|
| | | private int station_dooropen_tlong;
|
| | | private String note;
|
| | | private Page page;
|
| | | public int getNum() {
|
| | | return num;
|
| | | }
|
| | | public void setNum(int num) {
|
| | | this.num = num;
|
| | | }
|
| | | public int getStation_id() {
|
| | | return station_id;
|
| | | }
|
| | | public void setStation_id(int station_id) {
|
| | | this.station_id = station_id;
|
| | | }
|
| | | public int getDev_id() {
|
| | | return dev_id;
|
| | | }
|
| | | public void setDev_id(int dev_id) {
|
| | | this.dev_id = dev_id;
|
| | | }
|
| | | public Date getRecord_datetime() {
|
| | | return record_datetime;
|
| | | }
|
| | | public void setRecord_datetime(Date record_datetime) {
|
| | | this.record_datetime = record_datetime;
|
| | | }
|
| | | public int getStation_stat() {
|
| | | return station_stat;
|
| | | }
|
| | | public void setStation_stat(int station_stat) {
|
| | | this.station_stat = station_stat;
|
| | | }
|
| | | public Date getStation_poff_start_time() {
|
| | | return station_poff_start_time;
|
| | | }
|
| | | public void setStation_poff_start_time(Date station_poff_start_time) {
|
| | | this.station_poff_start_time = station_poff_start_time;
|
| | | }
|
| | | public int getStation_poff_tlong() {
|
| | | return station_poff_tlong;
|
| | | }
|
| | | public void setStation_poff_tlong(int station_poff_tlong) {
|
| | | this.station_poff_tlong = station_poff_tlong;
|
| | | }
|
| | | public Date getStation_fadian_start_time() {
|
| | | return station_fadian_start_time;
|
| | | }
|
| | | public void setStation_fadian_start_time(Date station_fadian_start_time) {
|
| | | this.station_fadian_start_time = station_fadian_start_time;
|
| | | }
|
| | | public int getStation_fadian_tlong() {
|
| | | return station_fadian_tlong;
|
| | | }
|
| | | public void setStation_fadian_tlong(int station_fadian_tlong) {
|
| | | this.station_fadian_tlong = station_fadian_tlong;
|
| | | }
|
| | | public Date getStation_diaozhan_start_time() {
|
| | | return station_diaozhan_start_time;
|
| | | }
|
| | | public void setStation_diaozhan_start_time(Date station_diaozhan_start_time) {
|
| | | this.station_diaozhan_start_time = station_diaozhan_start_time;
|
| | | }
|
| | | public int getStation_diaozhan_tlong() {
|
| | | return station_diaozhan_tlong;
|
| | | }
|
| | | public void setStation_diaozhan_tlong(int station_diaozhan_tlong) {
|
| | | this.station_diaozhan_tlong = station_diaozhan_tlong;
|
| | | }
|
| | | public float getStation_temp() {
|
| | | return station_temp;
|
| | | }
|
| | | public void setStation_temp(float station_temp) {
|
| | | this.station_temp = station_temp;
|
| | | }
|
| | | public float getStation_damp() {
|
| | | return station_damp;
|
| | | }
|
| | | public void setStation_damp(float station_damp) {
|
| | | this.station_damp = station_damp;
|
| | | }
|
| | | public Date getStation_dooropen_start_time() {
|
| | | return station_dooropen_start_time;
|
| | | }
|
| | | public void setStation_dooropen_start_time(Date station_dooropen_start_time) {
|
| | | this.station_dooropen_start_time = station_dooropen_start_time;
|
| | | }
|
| | | public int getStation_dooropen_tlong() {
|
| | | return station_dooropen_tlong;
|
| | | }
|
| | | public void setStation_dooropen_tlong(int station_dooropen_tlong) {
|
| | | this.station_dooropen_tlong = station_dooropen_tlong;
|
| | | }
|
| | | public String getNote() {
|
| | | return note;
|
| | | }
|
| | | public void setNote(String note) {
|
| | | this.note = note;
|
| | | }
|
| | | public Page getPage() {
|
| | | return page;
|
| | | }
|
| | | public void setPage(Page page) {
|
| | | this.page = page;
|
| | | }
|
| | | @Override
|
| | | public String toString() {
|
| | | return "Bts_station_state [num=" + num + ", station_id=" + station_id
|
| | | + ", dev_id=" + dev_id + ", record_datetime=" + record_datetime
|
| | | + ", station_stat=" + station_stat
|
| | | + ", station_poff_start_time=" + station_poff_start_time
|
| | | + ", station_poff_tlong=" + station_poff_tlong
|
| | | + ", station_fadian_start_time=" + station_fadian_start_time
|
| | | + ", station_fadian_tlong=" + station_fadian_tlong
|
| | | + ", station_diaozhan_start_time="
|
| | | + station_diaozhan_start_time + ", station_diaozhan_tlong="
|
| | | + station_diaozhan_tlong + ", station_temp=" + station_temp
|
| | | + ", station_damp=" + station_damp
|
| | | + ", station_dooropen_start_time="
|
| | | + station_dooropen_start_time + ", station_dooropen_tlong="
|
| | | + station_dooropen_tlong + ", note=" + note + ", page=" + page
|
| | | + "]";
|
| | | }
|
| | | |
| | | |
| | | }
|
| | |
| | | Batttestdatastop sdata=new Batttestdatastop();
|
| | | sdata.setBattGroupId(binf.getBattGroupId());
|
| | | sdata.setNote(binf.getBattProducer());
|
| | | sdata.setStationid(binf.getStationId());
|
| | | sdata.setMon_num(j+1);
|
| | | for (int z = 0; z < listr.size(); z++) {
|
| | | BattInf_Rebuild brinf=(BattInf_Rebuild) listr.get(z);
|
New file |
| | |
| | | package com.fgkj.services;
|
| | |
|
| | | import com.fgkj.dao.BaseDAO;
|
| | | import com.fgkj.dao.BaseDAOFactory;
|
| | | import com.fgkj.dto.ServiceModel;
|
| | |
|
| | | public class BattInf_RebuildService {
|
| | | private ServiceModel model;
|
| | | private BaseDAO dao;
|
| | | public BattInf_RebuildService() {
|
| | | super();
|
| | | this.model =new ServiceModel();
|
| | | this.dao = BaseDAOFactory.getBaseDAO(BaseDAO.BATTINF_REBUILD);
|
| | | }
|
| | | //添加
|
| | | public ServiceModel add(Object obj) {
|
| | | boolean b=dao.update(obj);
|
| | | if(b){
|
| | | boolean bl=dao.add(obj);
|
| | | if(bl){
|
| | | model.setCode(1);
|
| | | model.setMsg("添加成功!");
|
| | | }else{
|
| | | model.setCode(0);
|
| | | model.setMsg("添加失败!");
|
| | | }
|
| | | }else{
|
| | | model.setCode(0);
|
| | | model.setMsg("添加失败!");
|
| | | }
|
| | | return model;
|
| | | }
|
| | | //将同电池组同单体的记录变为历史(rebuild_clear_type=0)
|
| | | public ServiceModel update(Object obj) {
|
| | | boolean bl=dao.update(obj);
|
| | | if(bl){
|
| | | model.setCode(1);
|
| | | model.setMsg("修改成功!");
|
| | | }else{
|
| | | model.setCode(0);
|
| | | model.setMsg("修改失败!");
|
| | | }
|
| | | return model;
|
| | | }
|
| | | }
|