From b45beab4bd9fd91bf583b57d48edf2e99584ec62 Mon Sep 17 00:00:00 2001
From: 81041 <81041@192.168.10.33>
Date: 星期四, 11 十月 2018 14:14:57 +0800
Subject: [PATCH] 配组记录添加
---
gx_tieta/src/com/fgkj/actions/BattInf_RebuildAction.java | 36 ++++++
gx_tieta/src/com/fgkj/dao/impl/BatttestdatastopDAOImpl.java | 1
gx_tieta/src/com/fgkj/dao/BaseDAO.java | 2
gx_tieta/src/com/fgkj/services/BattInf_RebuildService.java | 45 +++++++
gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java | 46 +++++++
gx_tieta/src/com/fgkj/dto/Batttestdatastop.java | 13 ++
gx_tieta/src/com/fgkj/dto/ram/Bts_station_state.java | 148 ++++++++++++++++++++++++
gx_tieta/src/com/fgkj/dao/impl/BattInf_RebuildImpl.java | 16 +-
gx_tieta/src/com/fgkj/services/BattInfServices.java | 1
9 files changed, 300 insertions(+), 8 deletions(-)
diff --git a/gx_tieta/src/com/fgkj/actions/BattInf_RebuildAction.java b/gx_tieta/src/com/fgkj/actions/BattInf_RebuildAction.java
new file mode 100644
index 0000000..87859c8
--- /dev/null
+++ b/gx_tieta/src/com/fgkj/actions/BattInf_RebuildAction.java
@@ -0,0 +1,36 @@
+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;
+ }
+
+
+}
diff --git a/gx_tieta/src/com/fgkj/dao/BaseDAO.java b/gx_tieta/src/com/fgkj/dao/BaseDAO.java
index a9691ce..c929e3d 100644
--- a/gx_tieta/src/com/fgkj/dao/BaseDAO.java
+++ b/gx_tieta/src/com/fgkj/dao/BaseDAO.java
@@ -178,6 +178,8 @@
public static final int BATT_ENDURANCE=87;
+ public static final int BATTINF_REBUILD=88;
+
public boolean add(Object obj); // 娣诲姞
public boolean update(Object obj); // 鏇存柊
diff --git a/gx_tieta/src/com/fgkj/dao/impl/BattInf_RebuildImpl.java b/gx_tieta/src/com/fgkj/dao/impl/BattInf_RebuildImpl.java
index c2c9dc1..d50f513 100644
--- a/gx_tieta/src/com/fgkj/dao/impl/BattInf_RebuildImpl.java
+++ b/gx_tieta/src/com/fgkj/dao/impl/BattInf_RebuildImpl.java
@@ -15,19 +15,21 @@
// 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) {
diff --git a/gx_tieta/src/com/fgkj/dao/impl/BatttestdatastopDAOImpl.java b/gx_tieta/src/com/fgkj/dao/impl/BatttestdatastopDAOImpl.java
index 95ea981..2bb1a5c 100644
--- a/gx_tieta/src/com/fgkj/dao/impl/BatttestdatastopDAOImpl.java
+++ b/gx_tieta/src/com/fgkj/dao/impl/BatttestdatastopDAOImpl.java
@@ -478,6 +478,7 @@
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()){
diff --git a/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java b/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java
new file mode 100644
index 0000000..fda58af
--- /dev/null
+++ b/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java
@@ -0,0 +1,46 @@
+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;
+ }
+
+}
diff --git a/gx_tieta/src/com/fgkj/dto/Batttestdatastop.java b/gx_tieta/src/com/fgkj/dto/Batttestdatastop.java
index 7d98060..49f26c0 100644
--- a/gx_tieta/src/com/fgkj/dto/Batttestdatastop.java
+++ b/gx_tieta/src/com/fgkj/dto/Batttestdatastop.java
@@ -26,6 +26,7 @@
private Float mon_max;
private float percent;
private String note;
+ private String stationid;
public Batttestdatastop() {
}
@@ -206,6 +207,14 @@
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() {
@@ -220,12 +229,14 @@
+ ", 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 + "]";
}
+
+
diff --git a/gx_tieta/src/com/fgkj/dto/ram/Bts_station_state.java b/gx_tieta/src/com/fgkj/dto/ram/Bts_station_state.java
new file mode 100644
index 0000000..9bb6325
--- /dev/null
+++ b/gx_tieta/src/com/fgkj/dto/ram/Bts_station_state.java
@@ -0,0 +1,148 @@
+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
+ + "]";
+ }
+
+
+}
diff --git a/gx_tieta/src/com/fgkj/services/BattInfServices.java b/gx_tieta/src/com/fgkj/services/BattInfServices.java
index 16d3dec..3c6ac12 100644
--- a/gx_tieta/src/com/fgkj/services/BattInfServices.java
+++ b/gx_tieta/src/com/fgkj/services/BattInfServices.java
@@ -830,6 +830,7 @@
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);
diff --git a/gx_tieta/src/com/fgkj/services/BattInf_RebuildService.java b/gx_tieta/src/com/fgkj/services/BattInf_RebuildService.java
new file mode 100644
index 0000000..c1181d6
--- /dev/null
+++ b/gx_tieta/src/com/fgkj/services/BattInf_RebuildService.java
@@ -0,0 +1,45 @@
+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;
+ }
+}
--
Gitblit v1.9.1