ed6ad6642ef4f6ba9f5e482ae26313f7e57d0568.svn-base 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package xin.glue.ui.B.B02;
  2. import com.posdata.glue.biz.activity.PosActivity;
  3. import com.posdata.glue.biz.constants.PosBizControlConstants;
  4. import com.posdata.glue.context.PosContext;
  5. import com.posdata.glue.dao.PosGenericDao;
  6. import com.posdata.glue.dao.vo.PosParameter;
  7. import com.posdata.glue.dao.vo.PosRow;
  8. import com.posdata.glue.dao.vo.PosRowSet;
  9. /**
  10. *
  11. * @Description {界面ID:UIB020240}导出钢卷成分信息
  12. * @author 梅贵平{meiguiping}
  13. * @date 2009-7-22 下午09:19:45
  14. * @JDK Version jdk1.4.2
  15. */
  16. public class FindOldSampNoChem extends PosActivity
  17. {
  18. public String runActivity(PosContext context)
  19. {
  20. PosParameter param = null;
  21. MutilConditionFind mcf = new MutilConditionFind();
  22. PosRowSet rs1 = null;
  23. PosGenericDao dao = this.getDao("mesdao");
  24. String[]COILNO1 = (String[])context.get("COILNO1");
  25. String[]COILNO2 = (String[])context.get("COILNO2");
  26. rs1 = dao.find("UIB020240_EXP01.SELECT");
  27. context.put("ChemNM", rs1);
  28. String mid = mcf.getQuerySql("UIB020240_EXP03.SELECT").toString();
  29. String temp= "";
  30. StringBuffer sb = new StringBuffer(1000);
  31. PosRow row = null;
  32. int j = 1;
  33. while(rs1.hasNext())
  34. {
  35. row = rs1.next();
  36. temp = mid.replaceAll("[{]+[0]+[}]+", row.getAttribute("CHEM_CD").toString());
  37. temp = temp.replaceAll("[{]+[1]+[}]+", new Integer(j++).toString());
  38. sb.append(temp);
  39. }
  40. StringBuffer sbf = mcf.getQuerySql("UIB020240_EXP02.SELECT");
  41. String sql = sbf.toString().replaceFirst("[{]+[0]+[}]+", sb.toString());
  42. param = new PosParameter();
  43. param.setWhereClauseParameter(0, COILNO1[0]);
  44. param.setWhereClauseParameter(1, COILNO2[0]);
  45. System.out.println("#############################"+sbf);
  46. PosRowSet rowset = dao.findByQueryStatement(sql , param);
  47. context.put("ChargeAchievement", rowset);
  48. return PosBizControlConstants.SUCCESS;
  49. }
  50. }