package xin.glue.ui.B.B02; import com.posdata.glue.biz.activity.PosActivity; import com.posdata.glue.biz.constants.PosBizControlConstants; import com.posdata.glue.context.PosContext; import com.posdata.glue.dao.PosGenericDao; import com.posdata.glue.dao.vo.PosParameter; import com.posdata.glue.dao.vo.PosRow; import com.posdata.glue.dao.vo.PosRowSet; /** * * @Description {界面ID:UIB020240}导出钢卷成分信息 * @author 梅贵平{meiguiping} * @date 2009-7-22 下午09:19:45 * @JDK Version jdk1.4.2 */ public class FindOldSampNoChem extends PosActivity { public String runActivity(PosContext context) { PosParameter param = null; MutilConditionFind mcf = new MutilConditionFind(); PosRowSet rs1 = null; PosGenericDao dao = this.getDao("mesdao"); String[]COILNO1 = (String[])context.get("COILNO1"); String[]COILNO2 = (String[])context.get("COILNO2"); rs1 = dao.find("UIB020240_EXP01.SELECT"); context.put("ChemNM", rs1); String mid = mcf.getQuerySql("UIB020240_EXP03.SELECT").toString(); String temp= ""; StringBuffer sb = new StringBuffer(1000); PosRow row = null; int j = 1; while(rs1.hasNext()) { row = rs1.next(); temp = mid.replaceAll("[{]+[0]+[}]+", row.getAttribute("CHEM_CD").toString()); temp = temp.replaceAll("[{]+[1]+[}]+", new Integer(j++).toString()); sb.append(temp); } StringBuffer sbf = mcf.getQuerySql("UIB020240_EXP02.SELECT"); String sql = sbf.toString().replaceFirst("[{]+[0]+[}]+", sb.toString()); param = new PosParameter(); param.setWhereClauseParameter(0, COILNO1[0]); param.setWhereClauseParameter(1, COILNO2[0]); System.out.println("#############################"+sbf); PosRowSet rowset = dao.findByQueryStatement(sql , param); context.put("ChargeAchievement", rowset); return PosBizControlConstants.SUCCESS; } }