cd5ae3ee0871ef0e72b01c35e83f53881cdc809b.svn-base 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. package UIL.UIL01;
  2. import java.sql.Connection;
  3. import java.sql.PreparedStatement;
  4. import java.sql.ResultSet;
  5. import java.sql.SQLException;
  6. import java.sql.Statement;
  7. import java.util.ArrayList;
  8. import UIB.COM.XmlSqlParsersFactory;
  9. import CoreFS.SA01.CoreIComponent;
  10. import CoreFS.SA06.CoreReturnObject;
  11. /**
  12. * 服务器进程监控
  13. *
  14. * @author Administrator
  15. *
  16. */
  17. public class UIL010010 extends CoreIComponent {
  18. /**
  19. * 查询服务器进程状态
  20. *
  21. * @return
  22. * @throws SQLException
  23. */
  24. public CoreReturnObject queryServerProgramStatus() throws SQLException {
  25. CoreReturnObject cro = new CoreReturnObject();
  26. StringBuffer sqlBuffer = new StringBuffer();
  27. sqlBuffer.append("select s.program,\n");
  28. sqlBuffer.append(" status,CHANNELNAME,\n");
  29. sqlBuffer
  30. .append(" decode(s.status, 0,'网络断开', 1,'网络正常', 2,'应用正常','') status_name,\n");
  31. sqlBuffer
  32. .append(" s.srcnode,s.DESTNODE,round(s.modify_time - s.trans_dtime) DURATION,\n");
  33. sqlBuffer.append(" s.curtel,\n");
  34. sqlBuffer.append(" s.sndbytes,s.rcvbytes\n");
  35. sqlBuffer.append(" from tbs01_com_status s\n");
  36. cro = this.getDao("KgDao").ExcuteQuery(sqlBuffer.toString());
  37. return cro;
  38. }
  39. public CoreReturnObject queryprinter() throws SQLException {
  40. CoreReturnObject cro = new CoreReturnObject();
  41. StringBuffer sqlBuffer = new StringBuffer();
  42. sqlBuffer.append("select t.OLD_SAMPL_NO,t.STL_GRD,t.T_K, T.ORD_NO,O.FAC_STL_GRD,t.ACT_WGT,t.SPEC_ABBSYM,SUBSTR(T3.SLAB_NO, 1, 10) CHARGE_NO," +
  43. "T3.MILL_DTIME,(SELECT A.CUST_NM FROM TBZ00_CUSTOMER A WHERE A.CUST_CD = T1.ORDCUST_CD) ORDCUST_CD," +
  44. "PKG_QUALITY_COMM.FZ00_COMM('A01007', t2.ORD_USE_TP) ORD_USE_TP " +
  45. "from tbh06_l1_send_mark t,tbb01_ord_head t2,tbe02_ord_prc t1,tba01_ord_line O,TBH02_COIL_COMM T3 " +
  46. "where t.MSG_FLAG = 'N' and t3.ORD_NO = t1.ORD_NO and t1.ORD_NO=O.ord_no and T1.ORD_SEQ = O.ORD_SEQ and t3.ORD_NO = t2.ORD_NO AND T3.ORD_SEQ = T1.ORD_SEQ" +
  47. " AND T3.ORD_SEQ = T2.ORD_SEQ " +
  48. "AND T.OLD_SAMPL_NO = T3.OLD_SAMPL_NO " +
  49. " ORDER BY T.SEQ_NO DESC");
  50. //sqlBuffer.append(" COILTHICK\n");
  51. //sqlBuffer.append(" from L2_CALTHKDATA WHERE FLAG='4'\n");
  52. cro = this.getDao("KgDao").ExcuteQuery(sqlBuffer.toString());
  53. return cro;
  54. }
  55. public CoreReturnObject queryprintING() throws SQLException {
  56. CoreReturnObject cro = new CoreReturnObject();
  57. StringBuffer sqlBuffer = new StringBuffer();
  58. sqlBuffer.append("select t.OLD_SAMPL_NO,t.STL_GRD,t.T_K, T.ORD_NO,O.FAC_STL_GRD,t.ACT_WGT,t.SPEC_ABBSYM,SUBSTR(T3.SLAB_NO, 1, 10) CHARGE_NO," +
  59. "T3.MILL_DTIME,(SELECT A.CUST_NM FROM TBZ00_CUSTOMER A WHERE A.CUST_CD = T1.ORDCUST_CD) ORDCUST_CD," +
  60. "PKG_QUALITY_COMM.FZ00_COMM('A01007', t2.ORD_USE_TP) ORD_USE_TP " +
  61. "from tbh06_l1_send_mark t,tbb01_ord_head t2,tbe02_ord_prc t1,tba01_ord_line O,TBH02_COIL_COMM T3 " +
  62. "where t.MSG_FLAG = 'C' and t3.ORD_NO = t1.ORD_NO and t1.ORD_NO=O.ord_no and T1.ORD_SEQ = O.ORD_SEQ and t3.ORD_NO = t2.ORD_NO AND T3.ORD_SEQ = T1.ORD_SEQ" +
  63. " AND T3.ORD_SEQ = T2.ORD_SEQ " +
  64. "AND T.OLD_SAMPL_NO = T3.OLD_SAMPL_NO " +
  65. "AND SYSDATE - TO_DATE(SUBSTR(T.MILL_DTIME, 1, 8), 'YYYY-mm-dd') < 3" +
  66. " ORDER BY T.SEQ_NO DESC");
  67. //sqlBuffer.append(" COILTHICK\n");
  68. //sqlBuffer.append(" from L2_CALTHKDATA WHERE FLAG='4'\n");
  69. cro = this.getDao("KgDao").ExcuteQuery(sqlBuffer.toString());
  70. return cro;
  71. }
  72. public CoreReturnObject updateprinter(String COILNO) throws SQLException
  73. {
  74. CoreReturnObject cro = new CoreReturnObject();
  75. StringBuffer sqlQuery = new StringBuffer();
  76. sqlQuery.append("update tbh06_l1_send_mark t set t.MSG_FLAG='C' WHERE T.OLD_SAMPL_NO=?");
  77. //String sqlQuery ="update tbh06_l1_send_mark t set t.MSG_FLAG='C' WHERE T.OLD_SAMPL_NO=?";
  78. cro = this.getDao("KgDao").ExcuteNonQuery(sqlQuery.toString(), new Object[]{ COILNO });
  79. return cro;
  80. }
  81. }