a7a04679b9c58e71ab7ff107de9a7cc1845e32a4.svn-base 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. package pda;
  2. //����ֵ�´��ӿ�
  3. import java.sql.SQLException;
  4. import java.text.SimpleDateFormat;
  5. import java.util.ArrayList;
  6. import java.util.Date;
  7. import java.util.List;
  8. import com.alibaba.fastjson.JSON;
  9. import com.alibaba.fastjson.JSONArray;
  10. import com.alibaba.fastjson.JSONObject;
  11. import UIB.COM.XmlSqlParsersFactory;
  12. import CoreFS.SA01.CoreIComponent;
  13. import CoreFS.SA06.CoreReturnObject;
  14. import CoreFS.SA01.CoreException;
  15. import CoreFS.SA01.CoreExceptionHandler;
  16. import CoreFS.SA06.CoreSqlType.CoreOracleType;
  17. import QCM.JHY01.JHY0101.AddAutoSample;
  18. import java.io.IOException;
  19. import java.sql.ResultSet;
  20. import java.sql.Array;
  21. import java.sql.PreparedStatement;
  22. //import com.sun.xml.bind.v2.runtime.unmarshaller.XsiNilLoader.Array;
  23. public class CharacteristicValue extends CoreIComponent implements
  24. ICharacteristicValue
  25. {
  26. public String abc(String MESSAGESEQ,String b)
  27. {
  28. String dd = MESSAGESEQ + b;
  29. return dd;
  30. }
  31. //ִ�д洢���� pnameΪ�洢������ arΪ�洢�����������
  32. public String uim01001 (String pname, ArrayList<String> ar) throws IOException, SQLException
  33. {
  34. ArrayList<String> sqlparams = new ArrayList<String>(); // �洢�����������
  35. ArrayList<Integer> sqltypes = new ArrayList<Integer>(); // �洢���������������
  36. for(int i=0;i<ar.size();i++)
  37. {
  38. sqltypes.add(CoreOracleType.STRING_TYPE.ordinal());
  39. sqlparams.add(ar.get(i));
  40. }
  41. ArrayList<Integer> temp = new ArrayList<Integer>();
  42. ArrayList<String> temp1 = new ArrayList<String>();
  43. temp.add(CoreOracleType.STRING_TYPE.ordinal());
  44. temp.add(CoreOracleType.STRING_TYPE.ordinal());
  45. CoreReturnObject cro = new CoreReturnObject();
  46. cro = this.getDao("KgDao").ExcuteProcedure(pname, sqltypes, sqlparams,temp, temp1);
  47. //String ret = temp1.get(0) + temp1.get(1);
  48. String ret = temp1.get(1);
  49. return ret;
  50. }
  51. //ִ�д洢���� pnameΪ�洢������ CP_Type�������� parmar2Ϊ�������
  52. //public String uim01002 (String pname,String CP_Type,ArrayList<ArrayList<String>> parmar2) throws SQLException
  53. /*
  54. public String uim01002 (String pname,String CP_Type,ArrayList parmar2) throws SQLException
  55. {
  56. Array ar=null;
  57. ArrayList sqlparams = new ArrayList(); // �洢�����������
  58. ArrayList<Integer> sqltypes = new ArrayList<Integer>(); // �洢���������������
  59. for(int i=0;i<parmar2.size();i++)
  60. {
  61. sqltypes.add(CoreOracleType.ARRAY_TYPE.ordinal());
  62. ar = this.getDao("KgDao").getArray( CP_Type,(ArrayList) parmar2.get(i));
  63. //java.sql.Array ar = this.getDao("KgDao").getArray( CP_Type,parmar2.get(i));
  64. sqlparams.add(ar);
  65. }
  66. ArrayList<Integer> temp = new ArrayList<Integer>();
  67. ArrayList<String> temp1 = new ArrayList<String>();
  68. temp.add(CoreOracleType.STRING_TYPE.ordinal());
  69. temp.add(CoreOracleType.STRING_TYPE.ordinal());
  70. CoreReturnObject cro = new CoreReturnObject();
  71. cro = this.getDao("KgDao").ExcuteProcedure(pname, sqltypes, sqlparams,temp, temp1);
  72. String ret = temp1.get(1);
  73. return ret;
  74. }
  75. */
  76. public String uim01002(String ProcedureName,ArrayList arcd1,ArrayList arcd2) throws SQLException
  77. {
  78. String name = ProcedureName;
  79. Array ar1=null;
  80. Array ar2=null;
  81. ArrayList sqlparams = new ArrayList(); // �洢�����������
  82. ArrayList sqltypes = new ArrayList(); // �洢���������������
  83. sqltypes.add(CoreOracleType.ARRAY_TYPE.ordinal());
  84. ar1 = this.getDao("KgDao").getArray( "STR_ARY_TYPE", arcd1);
  85. sqlparams.add(ar1);
  86. sqltypes.add(CoreOracleType.ARRAY_TYPE.ordinal());
  87. ar2 = this.getDao("KgDao").getArray( "STR_ARY_TYPE", arcd2);
  88. sqlparams.add(ar2);
  89. ArrayList temp = new ArrayList();
  90. temp.add(CoreOracleType.STRING_TYPE.ordinal());
  91. temp.add(CoreOracleType.STRING_TYPE.ordinal());
  92. //ArrayList temp1 = new ArrayList();
  93. ArrayList<String> temp1 = new ArrayList<String>();
  94. CoreReturnObject cro = new CoreReturnObject();
  95. cro = this.getDao("KgDao").ExcuteProcedure(name, sqltypes, sqlparams,temp, temp1);
  96. String ret = temp1.get(1);
  97. return ret;
  98. }
  99. public String uimSelect(String abc) throws IOException, SQLException
  100. {
  101. String sql = abc;//"SELECT T.Area_No,t.area_name FROM C_TBK08_COIL_YARD_AREA T where t.area_type = 2";
  102. CoreReturnObject cro = new CoreReturnObject();
  103. cro = this.getDao("KgDao").ExcuteQuery(sql);
  104. //List a = (List)new java.util.ArrayList();
  105. //a.add(cro.getResult());
  106. String a = cro.getResult().toString();
  107. return a;
  108. }
  109. @SuppressWarnings("unused")
  110. @Override
  111. public String autoGenerationSampleInfo(String materialInfo) {
  112. JSONObject json = JSON.parseObject(materialInfo);
  113. JSONArray material= json.getJSONArray("KEY");
  114. AddAutoSample sample=new AddAutoSample();
  115. String msg = "";
  116. try {
  117. msg = sample.AutoGenerationSampleInfo(material);
  118. } catch (Exception e) {
  119. // TODO Auto-generated catch block
  120. e.printStackTrace();
  121. }
  122. return msg;
  123. }
  124. }