40848178d7f1132ed61c10a47fe0285e83388269.svn-base 1.8 KB

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