From afb607180caf32bd51231a62d608ec9b5cc90c34 Mon Sep 17 00:00:00 2001 From: shilei <798989044@qq.com> Date: Thu, 20 Feb 2025 15:55:12 +0800 Subject: [PATCH] =?UTF-8?q?#HZZX-1#=20=E8=8E=B7=E5=8F=96=E4=BA=8C=E5=BC=80?= =?UTF-8?q?=E7=9A=84=E9=85=8D=E7=BD=AE=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interfaces/hzzx/cominfo/PropBean.java | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/weaver/interfaces/hzzx/cominfo/PropBean.java diff --git a/src/weaver/interfaces/hzzx/cominfo/PropBean.java b/src/weaver/interfaces/hzzx/cominfo/PropBean.java new file mode 100644 index 0000000..18ffb4d --- /dev/null +++ b/src/weaver/interfaces/hzzx/cominfo/PropBean.java @@ -0,0 +1,73 @@ +package weaver.interfaces.hzzx.cominfo; + +import org.apache.commons.lang.StringUtils; +import weaver.conn.RecordSet; +import weaver.general.BaseBean; +import weaver.general.Util; + +public class PropBean { + + public static BaseBean bb = new BaseBean(); + public static String active = Util.null2String(bb.getPropValue("developProp","active")).toUpperCase(); + + /*** + * + * @param pkey + * @return + */ + public static String getUfPropValue(String pkey) + { + BaseBean baseBean = new BaseBean(); + if(StringUtils.isEmpty(pkey)){ + return ""; + } + + if(StringUtils.isEmpty(active)){ + active = Util.null2String(baseBean.getPropValue("developProp","active")).toUpperCase(); + } + + String pvalue = ""; + try{ + RecordSet rs = new RecordSet(); + String sql = " SELECT DEVVALUE,TESTVALUE,PRODVALUE FROM UF_PROP WHERE PKEY = ?"; + rs.executeQuery(sql,new Object[]{pkey.trim()}); + if(rs.next()){ + pvalue = Util.null2String(rs.getString(active+"VALUE")); + } + }catch (Exception e){ + e.printStackTrace(); + bb.writeLog("propbean-e:"+e); + } + return pvalue; + } + + + /*** + * + * @param pkey + * @return + */ + public String getUfPropValueStatic(String pkey) + { + BaseBean baseBean = new BaseBean(); + if(StringUtils.isEmpty(pkey)){ + return ""; + } + String active = Util.null2String(baseBean.getPropValue("developProp","active")).toUpperCase(); + String pvalue = ""; + try{ + RecordSet rs = new RecordSet(); + String sql = " SELECT DEVVALUE,TESTVALUE,PRODVALUE FROM UF_PROP WHERE PKEY = ?"; + rs.executeQuery(sql,new Object[]{pkey.trim()}); + if(rs.next()){ + pvalue = Util.null2String(rs.getString(active+"VALUE")); + } + baseBean.writeLog("pvalue:"+pvalue); + }catch (Exception e){ + e.printStackTrace(); + bb.writeLog("propbean-e:"+e); + } + return pvalue; + } + +}