From 592720573d6b194bbac25b25b6c619376cb9c0a4 Mon Sep 17 00:00:00 2001
From: hdw <496960745@qq.com>
Date: 星期四, 13 十二月 2018 13:38:34 +0800
Subject: [PATCH] 修改电池查询面板中正则的验证
---
gx_tieta/src/com/fgkj/dao/impl/Battinf_applyImpl.java | 118 ++++++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 89 insertions(+), 29 deletions(-)
diff --git a/gx_tieta/src/com/fgkj/dao/impl/Battinf_applyImpl.java b/gx_tieta/src/com/fgkj/dao/impl/Battinf_applyImpl.java
index 360bd40..1ece33f 100644
--- a/gx_tieta/src/com/fgkj/dao/impl/Battinf_applyImpl.java
+++ b/gx_tieta/src/com/fgkj/dao/impl/Battinf_applyImpl.java
@@ -41,8 +41,8 @@
if(list!=null && list.size()>0){
for (int i = 0; i < list.size(); i++) {
Battinf_apply bapply=list.get(i);
- /*int uid=((User_inf)ActionUtil.getUser()).getUId();
- bapply.setApply_uid(uid);*/
+ int uid=((User_inf)ActionUtil.getUser()).getUId();
+ bapply.setApply_uid(uid);
BattInf binf=bapply.getBinf();
//楠岃瘉鏂版坊鍔犵殑鏈烘埧鏄惁瀛樺湪
List listS=(new BattInfImpl()).judgeBatt(binf);
@@ -67,21 +67,16 @@
}
maxb++;
sql_str.add(sql);
- /*{
+ {
String msg=((User_inf)ActionUtil.getUser()).getUId()+"鐢宠娣诲姞"+binf.getStationName()+"鏈烘埧"+binf.getBattGroupId()+"鐢垫睜缁勭殑淇℃伅";
User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Increase, msg);
listU.add(ulog);
- }*/
+ }
}
}
- Boolean bl=false;
- boolean en=BattinfGroupFactory.backup_battinf();
- if(en){
- bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
- }else{
- return false;
- }
- //(new User_logService()).addPro(listU);//灏嗙敤鎴风殑鎿嶄綔璁板綍涓嬫潵
+ Boolean bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
+
+ (new User_logService()).addPro(listU);//灏嗙敤鎴风殑鎿嶄綔璁板綍涓嬫潵
return bl;
}
@@ -136,25 +131,21 @@
Battinf_apply bapply=list.get(i);
bapply.setConfrim_uid(((User_inf)ActionUtil.getUser()).getUId());
BattInf binf=bapply.getBinf();
+ //System.out.println(binf);
String sql_update_apply= "update db_battinf.tb_battinf_apply set StationName='"+binf.getStationName()+"',StationName1='"+binf.getStationName1()+"',StationName2='"+binf.getStationName2()+"',StationName3='"+binf.getStationName3()+"',StationName4='"+binf.getStationName4()+"',StationName5='"+binf.getStationName5()+"',StationIp='"+binf.getStationIp()+"',"
+ "FBSDeviceName='"+binf.getFBSDeviceName()+"',GroupIndexInFBSDevice="+binf.getGroupIndexInFBSDevice()+",BattGroupNum="+binf.getBattGroupNum()+",BattGroupName='"+binf.getBattGroupName()+"',FloatVolLevel="+binf.getFloatVolLevel()+",OfflineVolLevel="+binf.getOfflineVolLevel()+",BattFloatCurrent="+binf.getBattFloatCurrent()+"," +
"MonCount="+binf.getMonCount()+",MonCapStd="+binf.getMonCapStd()+",monVolStd="+binf.getMonVolStd()+",monResStd="+binf.getMonResStd()+",MonSerStd="+binf.getMonSerStd()+",MonVolLowToAvg="+binf.getMonVolLowToAvg()+",BattProducer='"+binf.getBattProducer()+"',BattModel='"+binf.getBattModel()+"',BattProductDate='"+DAOHelper.sdf.format(binf.getBattProductDate())+"',BattInUseDate='"+DAOHelper.sdf.format(binf.getBattInUseDate())+"', "
- +" Load_curr="+binf.getLoad_curr()+",install_user='"+binf.getInstall_user()+"',DisCurrMax="+binf.getDisCurrMax()+",station_phone='"+binf.getStation_phone()+" where num="+bapply.getNum();
+ +" Load_curr="+binf.getLoad_curr()+",install_user='"+binf.getInstall_user()+"',DisCurrMax="+binf.getDisCurrMax()+",station_phone='"+binf.getStation_phone()+"' where num="+bapply.getNum();
sql_str.add(sql_update_apply);
{
- String msg="淇敼"+binf.getStationName()+"鏈烘埧"+binf.getBattGroupId()+"鐢垫睜缁勭殑淇℃伅";
+ String msg="淇敼鐢宠鐨�"+binf.getStationName()+"鏈烘埧"+binf.getBattGroupId()+"鐢垫睜缁勭殑淇℃伅";
User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Alter, msg);
listU.add(ulog);
}
}
}
- Boolean bl=false;
- boolean en=BattinfGroupFactory.backup_battinf();
- if(en){
- bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
- }else{
- return false;
- }
+ Boolean bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
+
(new User_logService()).addPro(listU);//灏嗙敤鎴风殑鎿嶄綔璁板綍涓嬫潵
return bl;
}
@@ -176,13 +167,8 @@
}
}
}
- Boolean bl=false;
- boolean en=BattinfGroupFactory.backup_battinf();
- if(en){
- bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
- }else{
- return false;
- }
+ Boolean bl=DAOHelper.makeManualCommit(DBUtil.getConn(), sql_str);
+
(new User_logService()).addPro(listU);//灏嗙敤鎴风殑鎿嶄綔璁板綍涓嬫潵
return bl;
}
@@ -445,7 +431,81 @@
}
return list;
}
-
+ //鐢宠浜轰慨鏀瑰緟瀹℃牳鐨勭敵璇锋椂鐨勬煡璇�
+ public List serchbystationId(Object obj){
+ Battinf_apply bapply=(Battinf_apply) obj;
+ BattInf b=bapply.getBinf();
+ String sql=" select distinct num,apply_uid,confrim_uid,apply_date,apply_en,apply_note,StationId,StationName,StationName1,StationName2,StationName3,StationName4,StationName5,StationIp,FbsDeviceId,FbsDeviceIp_YM,FbsDeviceIp_WG,FbsDeviceIp"+
+ ",FBSDeviceName,GroupIndexInFBSDevice,battgroupId,BattGroupNum,BattGroupName,FloatVolLevel,OfflineVolLevel,BattFloatCurrent" +
+ ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate,Load_curr,install_user,DisCurrMax,station_phone " +
+ " from db_battinf.tb_battinf_apply " +
+ " where apply_en=0 and apply_uid=? and stationid=? order by apply_date desc " ;
+ List<Battinf_apply> list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{bapply.getNum(),b.getStationId()}, new CallBack() {
+
+ public List getResults(ResultSet rs) {
+ List list=new ArrayList();
+ try {
+ while(rs.next()){
+ Battinf_apply apply=new Battinf_apply();
+ apply.setNum(rs.getInt("num"));
+ apply.setApply_uid(rs.getInt("apply_uid"));
+ apply.setApply_name((new User_infImpl()).changeUidToUname(apply.getApply_uid()));
+ apply.setConfrim_uid(rs.getInt("confrim_uid"));
+ apply.setConfirm_name((new User_infImpl()).changeUidToUname(apply.getConfrim_uid()));
+ apply.setApply_en(rs.getInt("apply_en"));
+ apply.setApply_date(rs.getTimestamp("apply_date"));
+ apply.setApply_note(rs.getString("apply_note"));
+
+ BattInf binf=new BattInf();
+ 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.setStationName4(rs.getString("stationName4"));
+ binf.setStationName5(rs.getString("stationName5"));
+ binf.setStationIp(rs.getString("stationIp"));
+ binf.setFBSDeviceId(rs.getInt("fBSDeviceId"));
+
+ binf.setFbsDeviceIp(rs.getString("fbsDeviceIp"));
+ binf.setFbsDeviceIp_YM(rs.getString("fbsDeviceIp_YM"));
+ binf.setFbsDeviceIp_WG(rs.getString("fbsDeviceIp_WG"));
+ binf.setFBSDeviceName(rs.getString("fBSDeviceName"));
+ binf.setGroupIndexInFBSDevice(rs.getInt("groupIndexInFBSDevice"));
+ binf.setBattGroupId(rs.getInt("battGroupId"));
+ binf.setBattGroupNum(rs.getInt("battGroupNum"));
+ binf.setBattGroupName(rs.getString("battGroupName"));
+ binf.setFloatVolLevel(rs.getFloat("floatVolLevel"));
+ binf.setOfflineVolLevel(rs.getFloat("offlineVolLevel"));
+ binf.setBattFloatCurrent(rs.getFloat("battFloatCurrent"));
+ binf.setMonCount(rs.getInt("monCount"));
+ binf.setMonCapStd(rs.getFloat("monCapStd"));
+ binf.setMonVolStd(rs.getFloat("monVolStd"));
+ binf.setMonResStd(rs.getFloat("monResStd"));
+ binf.setMonSerStd(rs.getFloat("monSerStd"));
+ binf.setMonVolLowToAvg(rs.getFloat("monVolLowToAvg"));
+ binf.setBattProducer(rs.getString("battProducer"));
+ binf.setBattModel(rs.getString("battModel"));
+ binf.setBattProductDate(rs.getDate("battProductDate"));
+ binf.setBattInUseDate(rs.getDate("battInUseDate"));
+ binf.setLoad_curr(rs.getFloat("load_curr"));
+ binf.setInstall_user(rs.getString("install_user"));
+ binf.setDisCurrMax(rs.getFloat("disCurrMax"));
+ binf.setStation_phone(rs.getString("station_phone"));
+
+ apply.setBinf(binf);
+ list.add(apply);
+
+ }
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return list;
+ }
+ });
+ return list;
+ }
public static void main(String[] args) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date1 = sdf.parse("2000-01-01 00:00:00");
--
Gitblit v1.9.1