51cafb3370e3a820a7f2cdf022f71c0410cbdc2e.svn-base 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. package xin.glue.ui.H.H05;
  2. import java.sql.Connection;
  3. import java.sql.Date;
  4. import java.sql.PreparedStatement;
  5. import java.sql.ResultSet;
  6. import java.sql.SQLException;
  7. import java.text.DateFormat;
  8. import java.text.SimpleDateFormat;
  9. import xin.glue.ui.common.DataSo;
  10. import com.posdata.glue.biz.activity.PosActivity;
  11. import com.posdata.glue.biz.constants.PosBizControlConstants;
  12. import com.posdata.glue.context.PosContext;
  13. import com.posdata.glue.dao.PosJdbcDao;
  14. import com.posdata.glue.dao.manager.PosQueryDefinition;
  15. import com.posdata.glue.dao.manager.PosQueryManager;
  16. import com.posdata.glue.dao.vo.PosParameter;
  17. import com.posdata.glue.dao.vo.PosRowSet;
  18. public class SearchKeFa extends PosActivity {
  19. public String runActivity(PosContext context) {
  20. // Connection conn = null;
  21. // PreparedStatement ps = null;
  22. // ResultSet rs = null;
  23. // String ret = "";
  24. //
  25. //
  26. // SimpleDateFormat tempDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  27. // String currDate = tempDate.format(new java.util.Date());
  28. // try {
  29. //
  30. // conn = DataSo.getDataSource2().getConnection();
  31. // ps = conn.prepareStatement("insert into if_raw_mtr_coil_m (COIL_NO,COIL_SOURCE,COIL_SORT,HEATNO,SMP_NO) values (?,?,?,?,?)");
  32. //
  33. // ps.setString(1, currDate);
  34. // ps.setString(2, "1");
  35. // ps.setString(3, "1");
  36. // ps.setString(4, "1");
  37. // ps.setString(5, "1");
  38. // ps.executeUpdate();
  39. //
  40. // } catch (Exception e) {
  41. // e.printStackTrace();
  42. // }finally{
  43. // try {
  44. // if(null != ps)
  45. // ps.close();
  46. // if(null != conn)
  47. // conn.close();
  48. // } catch (SQLException e) {
  49. // e.printStackTrace();
  50. // }
  51. // }
  52. String[] DLIV_TP = (String[])context.get("DLIV_TP");
  53. String[] ORD_NO = (String[])context.get("ORD_NO");
  54. String[] SPEC_STL_GRD = (String[])context.get("SPEC_STL_GRD");
  55. String[] sqlOrdFl = (String[])context.get("sqlStr");
  56. logger.logInfo("------------------------" + sqlOrdFl[0]);
  57. StringBuffer sqlStr = null;
  58. StringBuffer sqlStr2 = null;
  59. PosJdbcDao dao = (PosJdbcDao)this.getDao("mesdao");
  60. PosQueryManager ppt = dao.getQueryManager();
  61. PosQueryDefinition x = ppt.getQueryDefinition("UIG050900_01.select");
  62. PosQueryDefinition xx = ppt.getQueryDefinition("UIG050900_03.select");
  63. sqlStr = new StringBuffer(x.getQueryStatement());
  64. sqlStr2 = new StringBuffer(xx.getQueryStatement());
  65. sqlStr = sqlStr.append("\n");
  66. sqlStr = sqlStr.append(sqlOrdFl[0]);
  67. sqlStr = sqlStr.append("\n");
  68. sqlStr = sqlStr.append(sqlStr2);
  69. logger.logDebug("------------------" + sqlStr);
  70. PosParameter param = new PosParameter();
  71. param.setWhereClauseParameter(0, DLIV_TP[0]);
  72. param.setWhereClauseParameter(1, ORD_NO[0]);
  73. param.setWhereClauseParameter(2, SPEC_STL_GRD[0]);
  74. PosRowSet rowSet = getDao("mesdao").findByQueryStatement(sqlStr.toString(), param);
  75. context.put("UIH050900_ERSULT", rowSet);
  76. return PosBizControlConstants.SUCCESS;
  77. }
  78. }