public static String getOperUser(String params, HttpServletRequest request) throws Exception { String[] p = params.split("\\|"); String opertyp = p[0]; String operidx = p[1]; String objectno = p[2]; String userid = p[3]; String sql = "select PRKEY,DICTTBL_ID from WFTESTMST where CLIENTIP = '" + request.getRemoteAddr() + "'"; Rowset rs = WorkFlowExecSql.wf_getRs(sql); String prkey = ""; String dicttblid = ""; if (rs.next()) { prkey = rs.getString(1); dicttblid = rs.getString(2); } sql = "select instance_no,model_no from wfinstrn where dicttbl_id = '" + dicttblid + "' and prkey='" + prkey + "'"; rs = WorkFlowExecSql.wf_getRs(sql); String instanceno = ""; String mdltypno = ""; if (rs.next()) { instanceno = rs.getString(1); mdltypno = WorkFlowUnification.wf_getwftyp(rs.getString(2)); } String rtn = WorkflowUtil.WorkFlowGetNextUserGoOn( instanceno, objectno, opertyp, operidx, userid, prkey, mdltypno, dicttblid); return rtn; }
public static void Wf_createFstNodeS(String params, HttpServletRequest request) throws Exception { String[] p = params.split("\\;"); String userid = p[0]; String progid = p[1]; String dicttblid = p[2]; String seq = p[3]; String mdltypno = p[4]; String org_no = p[5]; Database db = null; Rowset rs = null; Rowset rsin = null; Rowset obrs = null; Rowset currrs = null; String sql = null; String startobj = null; StringBuffer rtn = new StringBuffer(); sql = "SELECT user_id FROM WFSTRIGMST WHERE MDLTYP_NO='" + mdltypno + "' and USER_FLG='1'"; try { rs = WorkFlowExecSql.wf_getRs(sql); int i = 0; while (rs.next()) { if (i < rs.getRowCount()) { rtn.append(rs.getString(1) + ";"); } else { rtn.append(rs.getString(1)); } i++; } String version = WorkFlowUtilExt.getWorkFlowCurrVerison(mdltypno); sql = "select object_no from wfobjmst t where t.model_no='" + version + "' and t.object_typ='01'"; obrs = WorkFlowExecSql.wf_getRs(sql); if (obrs.next()) { startobj = obrs.getString(1); } sql = "select object_no from vw_wfobjrelmst where head='" + startobj + "'"; currrs = WorkFlowExecSql.wf_getRs(sql); if (currrs.next()) { rtn = new StringBuffer(currrs.getString(1) + "|").append(rtn); } sql = "select WFAPP_ID from WFMDLTYPMST where MDLTYP_NO = " + mdltypno; rsin = WorkFlowExecSql.wf_getRs(sql); String appid = ""; if (rs.next()) { appid = rsin.getString(1); } WorkflowUtil.creatFstNode( dicttblid, progid, appid, seq, mdltypno, userid, "0", "1", rtn.toString(), "", org_no); } catch (Exception se) { se.printStackTrace(); } finally { if (db != null) { db.cleanup(); } } }
public void CST_NO_onblur( DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) { Database db = null; Rowset rs = null; String sql = ""; String cstNo = ""; String cstId = ""; String cstNam = ""; try { db = Tools.getDatabase(true); cstId = Charset.nullToEmpty(serviceRequest.getParameter("value")); if (!cstId.equals("")) { sql = "select cst_no,cst_nam from ogcstmst where cst_id='" + cstId + "'"; rs = db.getRS(sql); if (rs.getRowCount() <= 0) { serviceRequest.addServiceReturnParameter("CSTFLG", "FALSE"); return; } else { if (rs.next()) { cstNo = Charset.nullToEmpty(rs.getString("cst_no")); cstNam = Charset.nullToEmpty(rs.getString("cst_nam")); } } } serviceRequest.addServiceReturnParameter("CSTFLG", "TRUE"); serviceRequest.addServiceReturnParameter("CST_NO", cstNo); serviceRequest.addServiceReturnParameter("CST_NAM", cstNam); } catch (Exception e) { Log.error(e); } finally { if (db != null) db.cleanup(); } }
public String getuser(String usrid, HttpServletRequest request) { String resu = ""; Database db = null; Rowset rs = null; try { db = Tools.getDatabase(true); String str_ALLUSRID = usrid; String[] ARR_USR = str_ALLUSRID.split("\\|"); String str_rtn = ""; for (int i = 0; i < ARR_USR.length; i++) { String str_USRID = ARR_USR[i]; if ((str_USRID != null) && (!str_USRID.equals(""))) { String str_SQL = "select USR_NAM from UTUSRMST where USR_ID = '" + str_USRID + "'"; rs = db.getRS(str_SQL); if (rs.next()) { String userpos = getUserInfo.getAttribute(str_USRID); if ((userpos == null) || (userpos.equals(""))) { userpos = " "; } if (str_rtn.equals("")) { str_rtn = str_USRID + "|" + rs.getString("USR_NAM") + "|" + userpos; } else { str_rtn = str_rtn + "||" + str_USRID + "|" + rs.getString("USR_NAM") + "|" + userpos; } } } } resu = str_rtn; } catch (Exception e) { Log.error(e); } finally { db.cleanup(); } return resu; }
public static void Wf_createFstNode(String params, HttpServletRequest request) throws Exception { String[] p = params.split("\\;"); String userid = p[0]; String progid = p[1]; String dicttblid = p[2]; String seq = p[3]; String mdltypno = p[4]; String org_no = p[5]; Database db = null; Rowset rs = null; String sql = null; try { sql = "select WFAPP_ID from WFMDLTYPMST where MDLTYP_NO = " + mdltypno; rs = WorkFlowExecSql.wf_getRs(sql); String appid = ""; if (rs.next()) { appid = rs.getString(1); } WorkflowUtil.creatFstNode( dicttblid, progid, appid, seq, mdltypno, userid, "0", "2", null, "", org_no); } catch (Exception se) { se.printStackTrace(); } finally { if (db != null) { db.cleanup(); } } }
public static String getWorkFlowList(String params, HttpServletRequest request) throws Exception { String sql = "select MDLTYP_NO,MDLTYP_SHT from WFMDLTYPMST"; Rowset rs = WorkFlowExecSql.wf_getRs(sql); StringBuffer rtn = new StringBuffer(""); while (rs.next()) { rtn.append(rs.getString(1) + ";" + rs.getString(2) + "|"); } return rtn.toString(); }
public static String getProgInfo(String params, HttpServletRequest request) throws Exception { StringBuffer rtn = new StringBuffer(""); String sql = "select PROGID from WFPRGMST where MDLTYP_NO=" + params + " and ISCHIEF='1'"; Rowset rs = WorkFlowExecSql.wf_getRs(sql); if (rs.next()) { rtn.append(rs.getString(1)); } sql = "select DICTTBL_ID,PKFLD_ID from WFDICMST where MDLTYP_NO=" + params + " and DICTTBL_STA='1'"; rs = WorkFlowExecSql.wf_getRs(sql); if (rs.next()) { rtn.append(";" + rs.getString(1) + ";" + rs.getString(2)); } return rtn.toString(); }
private Object _$15996(String pk) { String id = ""; try { Rowset rs = Database.getRowset("select PRJL_ID from YXPRJLIN where PRJL_NO =" + pk); if (rs.next()) { id = rs.getString("PRJL_ID"); } } catch (Exception e) { e.printStackTrace(); } return id; }
/** * ??????????????л?????λ * * @param prj_no * @return * @addTime 2014-2-25 ????10:47:13 * @author Libo */ private String getMonUnit(String prj_no) { String unit = ""; try { Rowset rs = Database.getRowset("SELECT MON_UNIT FROM YXKBRMST WHERE PRJ_NO = '" + prj_no + "'"); if (rs.next()) { unit = Charset.nullToEmpty(rs.getString(1)); } } catch (Exception e) { Log.error(e); } return unit; }
public static String getFWList(String params, HttpServletRequest request) throws Exception { String reStr = ""; String sql = "select t.MDLTYP_NO from OADOCTMPLMST t where t.WORKFLOW_TYP='02' and t.ORG_NO=" + params; Rowset rs = Database.getRowset(sql); int i = 1; while (rs.next()) { reStr = reStr + rs.getString("MDLTYP_NO"); if (rs.getRowCount() > i) { reStr = reStr + ";"; } i++; } return reStr; }
private boolean saveBefore( DataDom dataDom, ServiceRequest serviceRequest, SessionInfo sessionInfo) { Table ctb = dataDom.getChildTable(); String pkValue = dataDom.getRootTable().getPkValue(); ArrayList<String> prjlIds = new ArrayList<String>(); try { Rowset rs = Database.getRowset("select PRJL_ID from YXPRJLIN where PRJ_NO =" + pkValue); while (rs.next()) { String lid = rs.getString("PRJL_ID"); prjlIds.add(lid); } Iterator<?> it = ctb.getRows().keySet().iterator(); String zbId = dataDom.getRootTable().getSafeRowColumnValue("PRJ_ID"); while (it.hasNext()) { String rowNo = (String) it.next(); Row row = (Row) ctb.getRows().get(rowNo); String rPk = row.getColumnValue("PRJL_NO"); if ((rPk != null) && (Integer.parseInt(rPk) > 0)) { prjlIds.remove(_$15996(rPk)); } } Iterator<?> it2 = ctb.getRows().keySet().iterator(); while (it2.hasNext()) { String rowNo = (String) it2.next(); Row row = (Row) ctb.getRows().get(rowNo); String prjId = row.getColumnValue("PRJL_ID"); if (prjlIds.contains(prjId)) { serviceRequest .getMessage() .addError("第" + (Integer.parseInt(rowNo) + 1) + "行的分包编号之前已经使用过,请重新输入!"); return false; } if ((!prjId.startsWith(zbId + "-")) && (!prjId.equals(zbId))) { serviceRequest .getMessage() .addError("第" + (Integer.parseInt(rowNo) + 1) + "行的分包编号格式错误,未包含招标编号,请重新输入!"); return false; } prjlIds.add(prjId); } } catch (Exception e) { e.printStackTrace(); Log.error(e); return false; } return true; }
public static String getLinCount(String params, HttpServletRequest request) { String flag = "0"; String pkValue = params; try { if ((pkValue != null) && (!"".equals(pkValue))) { Rowset rs = Database.getRowset("select count(1) num from YXPRJLIN where PRJ_NO = " + pkValue); if (rs.next()) { return rs.getString("num"); } } } catch (Exception ex) { Log.error(ex.getMessage()); ex.printStackTrace(); } return flag; }
/** 扩展字段 创建下拉列表 Select aa = dataDom.getExtend().getSelect("字段"); */ public void creatSel(Select select, String strSQL, boolean canNull) { try { Rowset rs = Database.getRowset(strSQL); if (select != null) { for (int i = 0; i < select.getOptions().size(); i++) { select.removeOption(i); } } if (canNull) { select.addOption(new Option("", "")); } if (rs != null) while (rs.next()) select.addOption(new Option(rs.getString(1), rs.getString(2))); } catch (Exception e) { Log.error(e); } }
public String setVenLxr(String org_no, HttpServletRequest request) { String venNo = Charset.nullToEmpty(request.getParameter("venNo")); String returnValue = ""; String sql = "SELECT LXR_NAM FROM HLVDVENLIN WHERE VEN_NO=" + venNo; try { Rowset rs = Database.getRowset(sql); while (rs.next()) { String lixNam = Charset.nullToEmpty(rs.getString("LXR_NAM")); returnValue = returnValue + ",['" + lixNam + "','" + lixNam + "']"; } if ((returnValue.length() > 0) && (returnValue.charAt(0) == ',')) { returnValue = returnValue.substring(1); returnValue = "array=[" + returnValue + "]"; } } catch (Exception e) { e.printStackTrace(); } return returnValue; }
private void initTBRTable(DataDom dataDom, String prjNo, Database db) throws Exception { String sql1 = "select PRJL_NO from YXPRJLIN where PRJ_NO = " + prjNo; String unit = getMonUnit(prjNo); Rowset rs = db.getRS(sql1); CommSequence seq = CommSequence.getInstance("YXDBJYLIN_SEQ"); while (rs.next()) { String prjlNo = Charset.nullToEmpty(rs.getString("PRJL_NO")); String sql = "insert into YXDBJYLIN(DBJYL_NO,PRJL_NO,PRJ_NO,IS_NTC,IS_RCV,MON_UNIT)values(" + seq.getNextValue() + "," + prjlNo + "," + Charset.nullToEmpty(prjNo) + "," + "'N', 'N'," + unit + ")"; db.execSqlUpdate(sql); } }
private void initNoSplitTbrTab(DataDom dataDom, String prjNo, Database db) throws Exception { String sql = "select t.TBR_NAM,t.TBR_NO,d.PRJL_NO from YXTBRMST t join YXBJDFLIN d on t.TBR_NO=d.TBR_NO where d.PRJ_NO = " + prjNo; Rowset rs = db.getRS(sql); Table ct1 = dataDom.getTable("YXDBJYLIN"); Row row = new Row(false, 0, 0, "new"); row.addColumn("PRJ_NO", Charset.nullToEmpty(prjNo)); String unit = getMonUnit(prjNo); row.addColumn("IS_NTC", "N"); row.addColumn("IS_RCV", "N"); row.addColumn("MON_UNIT", unit); if (rs.next()) { row.addColumn("PRJL_NO", Charset.nullToEmpty(rs.getString("PRJL_NO"))); row.addColumn("TBR_NO", rs.getString("TBR_NO")); ct1.getRows().put("0", row); creatSel(ct1.getField("TBR_NO"), sql, false, false); } else { ct1.clearRow(); } }
/** * 招标代理费生成 * * @param dataDom * @param sessionInfo * @param serviceRequest * @throws LiemsException */ public void creatDLFEE(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) throws LiemsException { Database db = null; Table table = dataDom.getTable("YXDBJYMST"); Row currRow = table.getRow(0L); try { db = Tools.getDatabase(true); String DBJY_NO = currRow.getColumnValue("DBJY_NO"); String PRJ_NO = currRow.getColumnValue("PRJ_NO"); String ORG_NO = currRow.getColumnValue("ORG_NO"); Vector<String> vc = new Vector<String>(); String sel1 = "select distinct TBR_NO from YXDBJYLIN where DBJY_NO=" + DBJY_NO + " and IS_ZB='01'"; Rowset rs = db.getRS(sel1); while (rs.next()) { // 查询投标单位 生成主表 String TBR_NO = rs.getString("TBR_NO"); CommSequence cs = CommSequence.getInstance("YXDLFMST_SEQ"); String TBDJ_NO = cs.getNextValue(); CommCodeNumber seq = new CommCodeNumber( "DLF", sessionInfo.getCurrentLanguage(), sessionInfo.getUserId(), db); String TBDJ_ID = seq.getNextValue(); String insertSQL = " insert into YXDLFMST(DLF_NO,ORG_NO,DLF_STA,DLF_ID,PRJ_NO,TBR_NO,FSTUSR_ID,FSTUSR_DTM) " + " values(" + TBDJ_NO + "," + ORG_NO + ",'00','" + TBDJ_ID + "'," + PRJ_NO + ",'" + TBR_NO + "','" + sessionInfo.getUserId() + "',sysdate) "; vc.add(insertSQL); // 查询标包 生成子表明细数据 String sel2 = "select YXDBJYLIN.PRJL_NO,YXPRJLIN.DLFL_AMT from YXDBJYLIN,YXPRJLIN " + " where YXDBJYLIN.PRJL_NO=YXPRJLIN.PRJL_NO and YXDBJYLIN.TBR_NO = " + TBR_NO + " and YXDBJYLIN.DBJY_NO=" + DBJY_NO + " and YXDBJYLIN.IS_ZB='01'"; Rowset rs2 = db.getRS(sel2); while (rs2.next()) { String PRJL_NO = rs2.getString("PRJL_NO"); CommSequence cs2 = CommSequence.getInstance("YXDBJYLIN_SEQ"); String TBDJL_NO = cs2.getNextValue(); String DLFL_AMT = rs2.getString("DLFL_AMT"); insertSQL = " insert into YXDBJYLIN(DLFL_NO,DLF_NO,TBR_NO,PRJ_NO,PRJL_NO,DLFL_AMT,IS_JF) " + " values(" + TBDJL_NO + "," + TBDJ_NO + "," + TBR_NO + "," + PRJ_NO + "," + PRJL_NO + "," + DLFL_AMT + ", 'N')"; vc.add(insertSQL); } } db.execSqlUpdateBatch(vc); db.commit(); serviceRequest.addServiceReturnParameter("relString", "true"); } catch (Exception e) { e.printStackTrace(); serviceRequest.addServiceReturnParameter("relString", e.toString()); } finally { if (db != null) { db.cleanup(); } } }
public void save(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) throws LiemsException { Table table = dataDom.getTable("YXDBJYMST"); Table cTable = dataDom.getTable("YXDBJYLIN"); Row currRow = table.getRow(0L); if (currRow == null) { table.addRow(new Row(false, 0, 0, "new")); currRow = table.getRow(0L); } currRow.setFirstLastUserInfo(sessionInfo.getUserId()); String prjNo = currRow.getColumnValue("PRJ_NO"); Database db = null; try { db = Tools.getDatabase(false); if (currRow.getDataStatus().equals("new")) { currRow.addColumn("ORG_NO", sessionInfo.getDefaultOrg()); if ((currRow.getColumn("DBJY_ID") == null) || (currRow.getColumn("DBJY_ID").getValue() == null) || (currRow.getColumn("DBJY_ID").getValue().equals(""))) { CommCodeNumber KLTYPID = new CommCodeNumber("DBJY", sessionInfo.getCurrentLanguage(), sessionInfo.getUserId()); currRow.addColumn(new Column("DBJY_ID", KLTYPID.getNextValue())); } } else if ((currRow.getDataStatus().equals("modified")) && (CheckDate.isPrjNoChange(dataDom, db))) { deleteChildTable(dataDom, sessionInfo, serviceRequest, db); } String isSplit = Database.getValue(db, "select IS_SPLIT from YXPRJMST where PRJ_NO=" + prjNo); if ((prjNo != null) && (!(prjNo.equals(""))) && (Integer.parseInt(prjNo) > 0)) { if ((isSplit.equals("Y")) && (CheckDate.isTableEmpty( "YXDBJYLIN", dataDom, db, "PRJ_NO=" + prjNo, currRow.getPkValue("DBJY_NO")))) initTBRTable(dataDom, prjNo, db); else if ((isSplit.equals("N")) && (CheckDate.isTableEmpty( "YXDBJYLIN", dataDom, db, "PRJ_NO=" + prjNo, currRow.getPkValue("DBJY_NO")))) { initNoSplitTbrTab(dataDom, prjNo, db); } } super.save(dataDom, sessionInfo, serviceRequest, db); String pkValue = dataDom.getRootTable().getPkValue(); // String selString = "select PRJL_NO,dlf_sum from YXDBJYLIN where DBJY_NO=" + pkValue + " and dlf_sum is not null"; Rowset rs = db.getRS(selString); Vector<String> vc = new Vector<String>(); while (rs.next()) { String PRJL_NO = rs.getString("PRJL_NO"); String dlf_sum = Charset.nullToEmpty(rs.getString("dlf_sum")); if (!"".equals(dlf_sum)) { String upPrjInfoString = "update yxprjlin set DLFL_AMT=" + dlf_sum + " where PRJ_NO=" + prjNo + " and prjl_no=" + PRJL_NO; vc.add(upPrjInfoString); } } if (vc.size() > 0) { db.execSqlUpdateBatch(vc); } db.commit(); } catch (Exception e) { db.rollback(); table.refresh("B1YXM00200", sessionInfo); Log.error(e); serviceRequest.getMessage().addInfo("保存失败"); } finally { if (db != null) { db.cleanup(); } } initSel(dataDom, sessionInfo); dataDom.getChildTable().refresh("B1YXM00200", sessionInfo); }
public String createWfButton(String params, HttpServletRequest request) throws LiemsException { String returnValue = ""; String operstatus = "W"; String startup = "N"; try { Document wfOperInfoOutput = null; String[] p = params.split("\\;"); String userid = p[0]; String instNo = ""; String nodeId = ""; String workflowId = ""; String objNo = ""; String nodeName = ""; String actObjNo = ""; String instSta = ""; String parentinstNo = ""; String isactive = ""; String isaccept = ""; String programno = p[1]; String stacd = ""; String isExec = ""; String pkval = p[5]; String dicttblid = p[2]; String instanceno = ""; String appId = ""; String modelId = ""; String OrgNo = ""; String sql = "select MODEL_NO,APP_ID,INSTANCE_NO from wfinstrn where dicttbl_id = '" + dicttblid + "' and prkey='" + pkval + "'"; Rowset trs = WorkFlowExecSql.wf_getRs(sql); if (trs.next()) { modelId = trs.getString(1); appId = trs.getString(2); instanceno = trs.getString(3); } if (pkval != null) { wfOperInfoOutput = new ejbflowBean().wf_getnodeinfo(dicttblid, pkval, userid, programno); } if (wfOperInfoOutput != null) { Element commRoot = wfOperInfoOutput.getRootElement(); instNo = commRoot.getChildText("InstNo"); nodeId = commRoot.getChildText("ObjID"); workflowId = commRoot.getChildText("WfID"); objNo = commRoot.getChildText("ObjNo"); nodeName = commRoot.getChildText("ObjNam"); actObjNo = commRoot.getChildText("ActObjNo"); instSta = commRoot.getChildText("inSta"); parentinstNo = commRoot.getChildText("parentinstno"); isactive = commRoot.getChildText("isactive"); isaccept = commRoot.getChildText("isaccept"); programno = commRoot.getChildText("programno"); stacd = commRoot.getChildText("stacd"); isExec = commRoot.getChildText("isexec"); OrgNo = commRoot.getChildText("OrgNo"); returnValue = instNo + "|" + nodeId + "|" + workflowId + "|" + objNo + "|" + nodeName + "|" + actObjNo + "|" + instSta + "|" + parentinstNo + "|" + isactive + "|" + isaccept + "|" + programno + "|" + stacd + "|" + isExec; returnValue = returnValue + "|" + pkval + "|" + dicttblid; returnValue = returnValue + "|" + instanceno + "|" + appId + "|" + modelId + "|" + OrgNo + "|"; Iterator it = commRoot.getChildren("UserOper").iterator(); if (it.hasNext()) { operstatus = "Y"; } else { operstatus = "W"; } request.setAttribute("hastask", operstatus); String OperID = ""; String OperNam = ""; String OperSht = ""; String OperTyp = ""; String Operidx = ""; String Hascomm = ""; String jsqsta = ""; String jsqname = ""; String jshsta = ""; String jshname = ""; returnValue = returnValue + "*"; while (it.hasNext()) { Element e = (Element) it.next(); OperID = e.getChildText("OperID"); OperNam = e.getChildText("OperNam"); OperSht = e.getChildText("OperSht"); OperTyp = e.getChildText("OperTyp"); Operidx = e.getChildText("Operidx"); Hascomm = e.getChildText("Hascomm"); jsqsta = e.getChildText("jsqsta"); jsqname = e.getChildText("jsqname"); jshsta = e.getChildText("jshsta"); jshname = e.getChildText("jshname"); returnValue = returnValue + OperID + "|" + OperNam + "|" + OperSht + "|" + OperTyp + "|" + Operidx + "|" + Hascomm + "|" + jsqsta + "|" + jsqname + "|" + jshsta + "|" + jshname + "|"; returnValue = returnValue + "@"; } if (startup.equalsIgnoreCase("Y")) { returnValue = returnValue + "|10"; } } } catch (Exception e) { Log.error(e); } return returnValue; }