5f48206deb8ae224368b8cb99579d2a71d54ac0f.svn-base 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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:UIB020050}
  12. * @author 梅贵平{meiguiping}
  13. * @date 2009-2-4 上午11:24:37
  14. * @JDK Version jdk1.4.2
  15. */
  16. public class FindUnqualifiedCharge extends PosActivity
  17. {
  18. public String runActivity(PosContext context)
  19. {
  20. ///ready
  21. PosGenericDao dao = this.getDao("mesdao");
  22. PosParameter param = null;
  23. PosRowSet rowset = null;
  24. MutilConditionFind mcf = new MutilConditionFind();
  25. ///get request data
  26. String[] CHARGENO = (String[])context.get("CHARGENO");//炉次号
  27. ///获得满足条件的成分代码
  28. param = new PosParameter();
  29. param.setWhereClauseParameter(0, CHARGENO[0]);
  30. rowset = dao.find("UIB020050_01.SELECT", param);
  31. context.put("ChemNM", rowset);
  32. ///通过循环,获取SQL语句,并执行
  33. PosRow row = null;
  34. String temp= "";
  35. String repl= mcf.getQuerySql("UIB020050_02_01.LOOP").toString();
  36. StringBuffer sb = new StringBuffer(350);
  37. int j = 1;
  38. while(rowset.hasNext())
  39. {
  40. row = rowset.next();
  41. temp = repl.replaceFirst("[{]+[0]+[}]+", row.getAttribute("CHEM_CD").toString());
  42. temp = temp.replaceFirst("[{]+[1]+[}]+", new Integer(j++).toString());
  43. sb.append(temp);
  44. }
  45. //生成最终需要的SQL语句
  46. String sql = mcf.getQuerySql("UIB020050_02.SELECT").toString().replaceFirst("[{]+[0]+[}]+", sb.toString());
  47. param = new PosParameter();
  48. param.setWhereClauseParameter(0, CHARGENO[0]);
  49. rowset = dao.findByQueryStatement(sql, param);
  50. context.put("ErrorCharge", rowset);
  51. return PosBizControlConstants.SUCCESS;
  52. }
  53. }