public void clearDLFL_AMT(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) throws Exception { Table table = dataDom.getTable("YXPRJMST"); Database db = null; String pk = ""; try { db = Tools.getDatabase(false); save(dataDom, sessionInfo, serviceRequest); serviceRequest.getMessage().clear(); pk = table.getPkValue(); db.execSqlUpdate("update YXPRJLIN set DLFL_AMT='' where PRJ_NO = " + pk); db.commit(); pk = table.getPkValue(); WhereLimit wr = new WhereLimit(); wr.addColumn(new Column("PRJ_NO", pk)); dataDom.getTable("YXPRJLIN").setWhereLimit(wr); dataDom.getTable("YXPRJLIN").refresh("B1YXM00030", sessionInfo); } catch (Exception ex) { db.rollback(); Log.error(ex); } finally { if (db != null) { db.cleanup(); } } }
public void Delete(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) { Table table = dataDom.getTable("YXDBJYMST"); Row row = table.getRow(0L); if (row == null) { serviceRequest.getMessage().addInfo("没有需要删除的数据"); return; } String pkValue = table.getPkValue(); if ((pkValue == null) || ("".equals(pkValue.trim()))) { serviceRequest.getMessage().addInfo("没有需要删除的数据"); return; } Database db = null; try { db = Tools.getDatabase(false); deleteChildTable(dataDom, sessionInfo, serviceRequest, db); super.Delete(dataDom, sessionInfo, serviceRequest, db); db.commit(); dataDom.refresh(sessionInfo); serviceRequest.getMessage().addInfo("删除数据成功"); } catch (Exception e) { if (db != null) { db.rollback(); } Log.error(e); serviceRequest.getMessage().addInfo("发生异常,请联系管理员"); } finally { if (db != null) { db.cleanup(); } dataDom.refresh(sessionInfo); } init(dataDom, sessionInfo, serviceRequest); }
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 void init(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) { try { super.init(dataDom, sessionInfo, serviceRequest); String pkValue = dataDom.getTable("YXPBPFMST").getPkValue(); Table table = dataDom.getTable("YXSWPFLIN"); WhereLimit lw = new WhereLimit(); if ((pkValue == null) || (pkValue.equals(""))) { pkValue = "-1"; } lw.addColumn("PBPF_NO", pkValue); // 子表业务类型,B 商务评分,T 技术评分 Z 总报价评分,P 报价质量评分 lw.addColumn("PBYS_TYP", "T"); String PRJL_TYP = dataDom.getRootTable().getSafeRowColumnValue("PRJL_TYP"); if (PRJL_TYP.equals("A")) { // 综合评分 dataDom.getExtend().getSelect("evalSelector").setReadonly(true); } else { // 独立评分 dataDom.getExtend().getSelect("evalSelector").setReadonly(false); // 初始化评委 String prjNo = dataDom.getTable("YXPBPFMST").getSafeRow().getColumnValue("PRJ_NO"); String prjlNo = dataDom.getTable("YXPBPFMST").getSafeRow().getColumnValue("PRJL_NO"); if (!"".equals(prjNo)) { initEvalSelector(dataDom, prjlNo, prjNo); } } table.setWhereLimit(lw); table.refresh("B1YXM00173", sessionInfo); } catch (Exception e) { Log.error(e); } setReadOnly(dataDom); }
public void Delete(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) { Table table = dataDom.getTable("YXPBPFMST"); Row row = table.getRow(0L); if (row == null) { /* */ serviceRequest.getMessage().addInfo("没有需要删除的数据!"); return; } String pkValue = table.getPkValue(); if ((pkValue == null) || ("".equals(pkValue.trim()))) { serviceRequest.getMessage().addInfo("没有需要删除的数据!"); return; } Database db = null; try { db = Tools.getDatabase(false); deleteChildTable(dataDom, sessionInfo, serviceRequest, db); super.Delete(dataDom, sessionInfo, serviceRequest, db); db.commit(); serviceRequest.getMessage().addInfo("删除成功!"); } catch (Exception e) { if (db != null) { db.rollback(); } Log.error(e); serviceRequest.getMessage().addInfo("删除失败,请重试或联系系统管理员!"); } finally { if (db != null) db.cleanup(); } }
public void DeleteAllSubTable_FB( DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) throws Exception { Table table = dataDom.getTable("YXPRJMST"); Database db = null; String pk = ""; try { db = Tools.getDatabase(false); save(dataDom, sessionInfo, serviceRequest); serviceRequest.getMessage().clear(); pk = table.getPkValue(); if ((pk != null) && (!"".equals(pk))) { db.execSqlUpdate("delete from YXPRJLIN where IS_FB='Y' and PRJ_NO = " + pk); } db.commit(); WhereLimit wr = new WhereLimit(); wr.addColumn(new Column("PRJ_NO", pk)); dataDom.getTable("YXPRJLIN").setWhereLimit(wr); dataDom.getTable("YXPRJLIN").refresh("B1YXM00030", sessionInfo); } catch (Exception ex) { if (db != null) { db.rollback(); } Log.error(ex); } 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 void Delete(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) { Table table = dataDom.getTable("YXPRJMST"); Row row = table.getRow(0L); if (row == null) { serviceRequest.getMessage().addInfo("没有需要删除的数据!"); return; } String pkValue = table.getPkValue(); if ((pkValue == null) || ("".equals(pkValue.trim()))) { serviceRequest.getMessage().addInfo("没有需要删除的数据!"); return; } Database db = null; try { db = Tools.getDatabase(false); deleteChildTable(dataDom, sessionInfo, serviceRequest, db); super.Delete(dataDom, sessionInfo, serviceRequest, db); db.commit(); String pk = table.getPkValue(); table.refreshG(pk); pk = table.getPkValue(); WhereLimit wl = new WhereLimit(); wl.addColumn("new_sql_wherelimit", "PRJ_NO =" + pk); Log.info("PRJ_NO:" + pk); dataDom.getTable("YXPRJLIN").setWhereLimit(wl); dataDom.getTable("YXPRJLIN").refresh2("B1YXM00030", sessionInfo); } catch (Exception e) { if (db != null) { db.rollback(); } Log.error(e); serviceRequest.getMessage().addInfo("删除失败,请重试或联系系统管理员!"); table.refresh("B1YXM00030", sessionInfo); ; } finally { if (db != null) { db.cleanup(); } } }
public void isSplitChange( DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) { try { String pkValue = dataDom.getRootTable().getPkValue(); if ((pkValue != null) && (!"".equals(pkValue))) { Database.execString("delete from yxprjlin where prj_no=" + pkValue); } } catch (Exception e) { Log.error(e); } }
public String getPosInfo(String singleUsrId, HttpServletRequest request) { String resu = ""; try { resu = getUserInfo.getAttribute(singleUsrId); if ((resu == null) || (resu.equals(""))) { resu = " "; } } catch (Exception ex) { Log.error(ex); } return resu; }
/** * ??????????????л?????λ * * @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 void rowSave(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) throws Exception { Table table = dataDom.getTable("YXDBJYMST"); String pkValue = table.getPkValue(); if ((pkValue == null) || ("".equals(pkValue)) || ("-1".equals(pkValue))) serviceRequest.getMessage().addError("??????????????"); else try { String tableName = serviceRequest.getParameter("tableName"); super.save(tableName, dataDom, sessionInfo, serviceRequest); } catch (Exception e) { Log.error(e); serviceRequest.getMessage().addInfo("保存子表失败"); } }
public void save(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) throws LiemsException { Table table = dataDom.getTable("YXPBPFMST"); Row currRow = table.getRow(0L); if (currRow == null) { table.addRow(new Row(false, 0, 0, "new")); currRow = table.getRow(0L); } currRow.setFirstLastUserInfo(sessionInfo.getUserId()); try { super.save(dataDom, sessionInfo, serviceRequest); } catch (Exception e) { Log.error(e); serviceRequest.getMessage().addInfo("保存失败,请重试或联系系统管理员!"); } }
public static String deletedata(String params, HttpServletRequest request) throws Exception { Database db = null; try { db = Tools.getDatabase(true); String sql = "delete from WFTESTMST where CLIENTIP = '" + request.getRemoteAddr() + "'"; db.execSqlUpdate(sql); } catch (SQLException se) { Log.error(se.getMessage()); return "删除失败"; } finally { if (db != null) { db.cleanup(); } } return "删除成功"; }
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 WorkFlowGetNextUserGoOn( String instanceno, String objectno, String opertyp, String operidx, String userid, String prkey, String mdltypno, String dicttblid) throws LiemsException { try { Document out = new ejbflowBean() .wf_getnextusers( instanceno, objectno, opertyp, operidx, userid, prkey, mdltypno, dicttblid); Element commRoot = out.getRootElement(); Element nodeObjRoot = null; Element nodeUsersRoot = null; List nextNodeNoList = commRoot.getChildren("NodeUser"); List nextNodeUserList = null; String usrdoc = ""; if (nextNodeNoList.size() > 0) { nodeObjRoot = (Element) nextNodeNoList.get(0); nextNodeUserList = nodeObjRoot.getChildren("Users"); } else { return ""; } if (nextNodeUserList.size() > 0) { nodeUsersRoot = (Element) nextNodeUserList.get(0); List nodeUserList = nodeUsersRoot.getChildren("User"); for (int i = 0; i < nodeUserList.size(); i++) { Element nodeUserRoot = (Element) nodeUserList.get(i); usrdoc = usrdoc + nodeUserRoot.getAttributeValue("userid"); if (i < nodeUserList.size()) { usrdoc = usrdoc + "|"; } } } else { return ""; } return usrdoc; } catch (Exception e) { Log.error(e); } return null; }
/** 扩展字段 创建下拉列表 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 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; }
public void DeleteAllSubTable( DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) throws Exception { Table table = dataDom.getTable("YXPRJMST"); Database db = null; String pk = ""; try { db = Tools.getDatabase(false); save(dataDom, sessionInfo, serviceRequest); serviceRequest.getMessage().clear(); pk = table.getPkValue(); db.execSqlUpdate("delete from YXPRJLIN where PRJ_NO = " + pk); db.commit(); } catch (Exception ex) { db.rollback(); Log.error(ex); } finally { if (db != null) { db.cleanup(); } } setFirstRowSubTable(dataDom, sessionInfo, serviceRequest); }
public void USR_ID_onblur( DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) { String usrId = ""; String usrNam = ""; try { usrId = Charset.nullToEmpty(serviceRequest.getParameter("value")); if (!usrId.equals("")) { usrNam = Charset.nullToEmpty(UTUSRMST.getDesc(usrId)); if (usrNam.equals("")) { serviceRequest.addServiceReturnParameter("USRFLG", "FALSE"); return; } } serviceRequest.addServiceReturnParameter("USRFLG", "TRUE"); serviceRequest.addServiceReturnParameter("USR_ID", usrId); serviceRequest.addServiceReturnParameter("USR_NAM", usrNam); } catch (Exception e) { Log.error(e); } }
public void setFirstRowSubTable( DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) throws Exception { String ZB_ID = serviceRequest.getParameter("ZB_ID"); String PRJ_NAM = serviceRequest.getParameter("PRJ_NAM"); Table table = dataDom.getTable("YXPRJMST"); Database db = null; String pk = ""; try { db = Tools.getDatabase(false); pk = table.getPkValue(); String nextPkValue = CommSequence.getInstance("YXPRJLIN_SEQ").getNextValue(); db.execSqlUpdate( "insert into YXPRJLIN(PRJL_NO,PRJ_NO,PRJL_ID,PRJL_NAM,IS_FB) values( " + nextPkValue + "," + pk + ",'" + ZB_ID + "','" + PRJ_NAM + "','Y') "); db.commit(); pk = table.getPkValue(); WhereLimit wr = new WhereLimit(); wr.addColumn(new Column("PRJ_NO", pk)); dataDom.getTable("YXPRJLIN").setWhereLimit(wr); dataDom.getTable("YXPRJLIN").refresh("B1YXM00030", sessionInfo); } catch (Exception ex) { db.rollback(); Log.error(ex); } finally { if (db != null) { db.cleanup(); } } }
/** * 子表行记录保存 @Override * * @param dataDom DataDom * @param sessionInfo SessionInfo * @param serviceRequest ServiceRequest * @throws LiemsException */ public void rowSave(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) throws Exception { Table table = dataDom.getTable("YXPBPFLIN"); String pkValue = table.getPkValue(); if (null == pkValue || "".equals(pkValue) || "-1".equals(pkValue)) { serviceRequest.getMessage().addError("请先维护主信息!"); } else { try { String tableName = serviceRequest.getParameter("tableName"); Table childTable = dataDom.getTable(tableName); // 添加whereLimit的判断,这里目前不加任何过滤字段由研发人员自行添加 if (null != childTable) { WhereLimit whereLimit = childTable.getWhereLimit(); if (null == whereLimit) { whereLimit = new WhereLimit(); } super.save(tableName, dataDom, sessionInfo, serviceRequest); } } catch (Exception e) { Log.error(e); serviceRequest.getMessage().addInfo("保存失败,请重试或联系系统管理员!"); } } }
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; }
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 void save(DataDom dataDom, SessionInfo sessionInfo, ServiceRequest serviceRequest) throws LiemsException { if (!saveBefore(dataDom, serviceRequest, sessionInfo)) { return; } Table table = dataDom.getTable("YXPRJMST"); Database db = null; Row currRow = table.getRow(0L); if (currRow == null) { table.addRow(new Row(false, 0, 0, "new")); currRow = table.getRow(0L); } currRow.setFirstLastUserInfo(sessionInfo.getUserId()); try { db = Tools.getDatabase(false); String isSplit = dataDom.getRootTable().getSafeRowColumnValue("IS_SPLIT"); if (currRow.getDataStatus().equals("new")) { currRow.addColumn("ORG_NO", sessionInfo.getDefaultOrg()); if ((currRow.getColumn("PRJ_ID") == null) || (currRow.getColumn("PRJ_ID").getValue() == null) || (currRow.getColumn("PRJ_ID").getValue().equals(""))) { String idTyp = currRow.getColumnValue("PRJ_EXT02"); if ("A".equals(idTyp)) { CommCodeNumber KLTYPID = new CommCodeNumber( "PRJ", sessionInfo.getCurrentLanguage(), sessionInfo.getUserId()); currRow.addColumn(new Column("PRJ_ID", KLTYPID.getNextValue())); } CommCodeNumber ZB_ID = new CommCodeNumber("ZBBH", sessionInfo.getCurrentLanguage(), sessionInfo.getUserId()); currRow.addColumn(new Column("ZB_ID", ZB_ID.getNextValue())); currRow.addColumn("VALID_STA", "A"); currRow.addColumn(new Column("ZB_TIMES", "1")); } if ("N".equals(isSplit)) { Row row = new Row(false, 0, 0, "new"); row.addColumn("PRJL_NAM", currRow.getColumnValue("PRJ_NAM")); row.addColumn("PRJL_ID", currRow.getColumnValue("PRJ_ID")); row.addColumn("BZ_AMT", "0.00"); row.addColumn("IS_FB", "Y"); dataDom.getChildTable().getRows().put("0", row); } } String dlfTyp = dataDom.getRootTable().getSafeRowColumnValue("DLF_TYP"); super.save(dataDom, sessionInfo, serviceRequest, db); db.commit(); String pkValue = currRow.getPkValue("PRJ_NO"); if (isSplit.equals("Y")) { String sql = ""; if (dlfTyp.equals("B")) { sql = "update YXPRJMST set ZBS_AMT = (select sum(ZBS_AMT) from YXPRJLIN where PRJ_NO=" + pkValue + ")," + "BZ_AMT = (select sum(BZ_AMT) from YXPRJLIN where PRJ_NO=" + pkValue + ")," + "DL_AMT=(select sum(DLFL_AMT) from YXPRJLIN where PRJ_NO=" + pkValue + ")" + " where PRJ_NO = " + pkValue; dataDom.getChildTable().getField("DLFL_AMT").setReadonly(false); } else { sql = "update YXPRJMST set ZBS_AMT = (select sum(ZBS_AMT) from YXPRJLIN where PRJ_NO=" + pkValue + ")," + "BZ_AMT = (select sum(BZ_AMT) from YXPRJLIN where PRJ_NO=" + pkValue + ")" + " where PRJ_NO = " + pkValue; dataDom.getChildTable().getField("DLFL_AMT").setReadonly(true); } Database.execString(sql); } serviceRequest.getMessage().addInfo("保存成功"); initSel(dataDom); dataDom.getChildTable().getWhereLimit().addColumn("PRJ_NO", pkValue); dataDom.refresh(sessionInfo); } catch (Exception e) { if (db != null) { db.rollback(); } Log.error(e); serviceRequest.getMessage().addInfo("保存失败,请重试或联系系统管理员!"); } finally { if (db != null) { db.cleanup(); } } }