fad22331d420047e750d13fbb0c4ed80bcacd510.svn-base 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. //package xin.glue.ui.G.G02;
  2. //
  3. //import java.io.File;
  4. //import java.util.Iterator;
  5. //import java.util.Map;
  6. //import java.util.Set;
  7. //
  8. //import javax.xml.parsers.DocumentBuilder;
  9. //import javax.xml.parsers.DocumentBuilderFactory;
  10. //
  11. //import org.w3c.dom.Document;
  12. //import org.w3c.dom.Node;
  13. //import org.w3c.dom.NodeList;
  14. //
  15. //import com.posdata.glue.PosException;
  16. //import com.posdata.glue.biz.activity.PosActivity;
  17. //import com.posdata.glue.biz.constants.PosBizControlConstants;
  18. //import com.posdata.glue.context.PosContext;
  19. //import com.posdata.glue.dao.PosDaoException;
  20. //import com.posdata.glue.dao.PosGenericDao;
  21. //import com.posdata.glue.dao.vo.PosParameter;
  22. //import com.posdata.glue.dao.vo.PosRow;
  23. //import com.posdata.glue.dao.vo.PosRowSet;
  24. //
  25. ///**
  26. // *
  27. // * 炼刚成分实绩查询
  28. // * @author 梅贵平
  29. // * @date 2008-9-21
  30. // */
  31. //public class FindChem extends PosActivity
  32. //{
  33. // private PosGenericDao dao = this.getDao("mesdao");
  34. // public String runActivity(PosContext context)
  35. // {
  36. // try
  37. // {
  38. // String[]chem = getChem();//获得所有成分
  39. // StringBuffer buffer0 = new StringBuffer();//用于替代{0}
  40. // StringBuffer buffer1 = new StringBuffer();//用于替代{1}
  41. // StringBuffer buffer2 = new StringBuffer();//用于替代{2}
  42. // StringBuffer buffer3 = new StringBuffer();//用于替代{3}
  43. //
  44. // if(chem!=null)
  45. // {
  46. // for(int i=0; i < chem.length; i++)
  47. // {
  48. // buffer0.append(" , "+chem[i]);//{0}被其替换
  49. // buffer1.append(" , "+" max(decode(CHEM_CD, '"+chem[i] +"' ,CHEM_MIN,NULL)) "+ chem[i]);//{1}被其替换
  50. // buffer2.append(" , "+" max(decode(CHEM_CD, '"+chem[i] +"' ,CHEM_MAX,NULL)) "+ chem[i]);//{2}被其替换
  51. // buffer3.append(" , "+" max(decode(CHEM_CD, '"+chem[i] +"' ,CHEM_VAL,NULL)) "+ chem[i]);//{3}被其替换
  52. // }
  53. //
  54. // DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  55. // factory.setValidating(false);// 是否使用DTD,Schemal来校验
  56. // DocumentBuilder build = factory.newDocumentBuilder();
  57. // Document doc = build.parse(new File("webapps\\xgmes3\\WEB-INF\\classes\\sql.xml"));
  58. //
  59. // NodeList nl = doc.getElementsByTagName("sql001");
  60. // Node n = nl.item(0);
  61. //
  62. //// String str = n.getTextContent().trim();
  63. // String str = n.getNodeValue().trim();
  64. // str = str.replaceAll("[{]+[0]+[}]+", buffer0.toString());//替代{0}
  65. // str = str.replaceAll("[{]+[1]+[}]+", buffer1.toString());//替代{1}
  66. // str = str.replaceAll("[{]+[2]+[}]+", buffer2.toString());//替代{2}
  67. // str = str.replaceAll("[{]+[3]+[}]+", buffer3.toString());//替代{3},形成最终的sql
  68. //
  69. // String[]CHARGE_NO = (String[])context.get("CHARGE_NO");//炉次号
  70. // String[]SUBPROC = (String[])context.get("SUBPROC");//工序,如转炉(B),CAS(C)
  71. // PosParameter param= new PosParameter();
  72. // param.setWhereClauseParameter(0, CHARGE_NO[0]);
  73. // param.setWhereClauseParameter(1, CHARGE_NO[0]);
  74. // param.setWhereClauseParameter(2, CHARGE_NO[0]);
  75. // param.setWhereClauseParameter(3, SUBPROC[0]);
  76. // PosRowSet rowset = dao.findByQueryStatement(str, param);
  77. // context.put("BofChemResult", rowset);
  78. // }
  79. //
  80. // }
  81. // catch(Exception e)
  82. // {
  83. // e.printStackTrace();
  84. // throw new PosDaoException(e.toString());
  85. // }
  86. //
  87. // return PosBizControlConstants.SUCCESS;
  88. // }
  89. //
  90. // //返回所有化学成分
  91. // public String[] getChem()
  92. // {
  93. // String sqlChem ="SELECT DISTINCT upper(CHEM_CD) FROM TBB01_FAC_INGR";
  94. // PosRowSet rowset = dao.findByQueryStatement(sqlChem);
  95. // PosRow row = null;
  96. // Map map = null;
  97. // Set set = null;
  98. // Iterator it= null;
  99. // String key = null;
  100. // int i =0;
  101. // String[]str = new String[rowset.count()];//存储成分
  102. // while(rowset.hasNext())
  103. // {
  104. // row = rowset.next();
  105. // map = row.getAttributes();
  106. // set = map.keySet();
  107. // it = set.iterator();
  108. // while(it.hasNext())
  109. // {
  110. // key = (String)it.next();
  111. // str[i++] = map.get(key).toString();
  112. // }
  113. // }
  114. // return str;
  115. // }
  116. //}