e11828cd6da5a6146c5cef67bd7fe7375ef4eac6.svn-base 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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.PosJdbcDao;
  7. import com.posdata.glue.dao.manager.PosQueryDefinition;
  8. import com.posdata.glue.dao.manager.PosQueryManager;
  9. import com.posdata.glue.dao.vo.PosParameter;
  10. import com.posdata.glue.dao.vo.PosRow;
  11. import com.posdata.glue.dao.vo.PosRowSet;
  12. /**
  13. *
  14. * @Description 按炉次号查询试样信息{界面ID:UIB020132}
  15. * @author 梅贵平{meiguiping}
  16. * @date 2008-12-12 上午11:57:57
  17. * @JDK Version jdk1.4.2
  18. */
  19. public class FindConvSmpAchievement extends PosActivity
  20. {
  21. public String runActivity(PosContext context)
  22. {
  23. ///ready
  24. PosParameter param = null;
  25. PosRowSet rowset = null;
  26. MutilConditionFind mcf = new MutilConditionFind();
  27. PosGenericDao dao = this.getDao("mesdao");
  28. // ///get request data
  29. // String[] P_Pstove = (String[])context.get("Pstove");//炉次号
  30. String[] P_ProcCD = (String[])context.get("PROCCD");//进程代码
  31. String[] P_COIL1 = (String[])context.get("COIL1");
  32. String[] P_COIL2 = (String[])context.get("COIL2");
  33. StringBuffer SQL = mcf.getQuerySql("UIB020132_00.SELECT");
  34. param = new PosParameter();
  35. int j = 0;
  36. if(!"".equals(P_ProcCD[0]))
  37. {
  38. param.setWhereClauseParameter(j++, P_ProcCD[0]);//进程代码
  39. SQL.append("\n AND LOT.SMP_PROG_CD = ?");
  40. }
  41. else
  42. {
  43. SQL.append("\n AND (LOT.SMP_PROG_CD = 'C' OR LOT.SMP_PROG_CD = 'D' )");
  44. }
  45. if(!"".equals(P_COIL1[0]) && !"".equals(P_COIL2[0]))
  46. {
  47. param.setWhereClauseParameter(j++, P_COIL1[0]);
  48. param.setWhereClauseParameter(j++, P_COIL2[0]);
  49. SQL.append("\n AND SUBSTR(CCM.OLD_SAMPL_NO , 1, 10 )BETWEEN ? AND ?");
  50. }
  51. SQL.append("\n ORDER BY CCM.OLD_SAMPL_NO ");
  52. rowset = dao.findByQueryStatement(SQL.toString(), param);
  53. context.put("MapSmpResult", rowset);
  54. // param.setWhereClauseParameter(0, P_Pstove[0]+"%");
  55. // rowset = dao.find("UIB020132_01.SELECT", param);
  56. // context.put("QltyNM", rowset);
  57. //
  58. // String start = "";
  59. // param = new PosParameter();
  60. //
  61. // if("".equals(P_Pstove[0]))//炉号为空
  62. // {
  63. // start = mcf.getQuerySql("UIB020132_02_2.SELECT").toString();
  64. // param.setWhereClauseParameter(0, P_ProcCD[0]);
  65. // }
  66. // else if("".equals(P_ProcCD[0]))//若进程代码为空,此处已经废弃
  67. // {
  68. // start = mcf.getQuerySql("UIB020132_02_0.SELECT").toString();
  69. // param.setWhereClauseParameter(0, P_Pstove[0]);
  70. // }
  71. // else//炉号不为空
  72. // {
  73. // start = mcf.getQuerySql("UIB020132_02_1.SELECT").toString();
  74. // param.setWhereClauseParameter(0, P_Pstove[0]);
  75. // param.setWhereClauseParameter(1, P_ProcCD[0]);
  76. // }
  77. // StringBuffer mid = new StringBuffer(8000);
  78. //
  79. // PosRow row = null;
  80. // String sql = "";
  81. // String temp = mcf.getQuerySql("UIB020132_02.LOOP").toString();
  82. // int j = 1;
  83. // //SELECT has some value
  84. // while(rowset.hasNext())
  85. // {
  86. // row = rowset.next();
  87. // sql = temp.replaceAll("[{]+[0]+[}]+", row.getAttribute("QLTY_CD").toString());
  88. // sql = sql.replaceAll("[{]+[1]+[}]+" , new Integer(j++).toString());
  89. // mid.append(sql);
  90. // }
  91. //// System.out.println(mid);
  92. //
  93. //
  94. // PosRowSet rs = dao.findByQueryStatement(start.replaceFirst("[{]+[1]+[}]+", mid.toString()) , param);
  95. // ///return response data
  96. // context.put("MapSmpResult", rs);
  97. // PosParameter param = null;
  98. // PosRowSet rowset = null;
  99. return PosBizControlConstants.SUCCESS;
  100. }
  101. }