f721dd996b4dd794fb21aec6219f52329ba7a109.svn-base 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. package UIM;
  2. import java.sql.PreparedStatement;
  3. import java.sql.ResultSet;
  4. import java.sql.SQLException;
  5. import java.util.Map;
  6. import UIB.COM.XmlSqlParsersFactory;
  7. import CoreFS.SA01.CoreIComponent;
  8. import CoreFS.SA06.CoreReturnObject;
  9. public class UIM010320 extends CoreIComponent{
  10. public CoreReturnObject query(String coilNo,String fromTime,String toTime) throws SQLException{
  11. CoreReturnObject cro = new CoreReturnObject();
  12. String sql = XmlSqlParsersFactory.getSql("UIM010320_01.SELECT");
  13. cro = this.getDao("KgDao").ExcuteQuery(sql,new Object[]{coilNo,fromTime,toTime});
  14. return cro;
  15. }
  16. public CoreReturnObject out(String coilNo, String regId,
  17. String trnfShift, String trnfGroup, String trnfTime) throws SQLException{
  18. CoreReturnObject cro = new CoreReturnObject();
  19. // 根据钢卷号查询垛位编号
  20. String sql1 = "select clf_no from c_tbk08_coil_yard where coil_no = '"
  21. + coilNo + "'";
  22. ResultSet rs = this.getDao("KgDao").ExceuteQueryForResultSet(sql1);
  23. long yardNo = 0;
  24. // 如果钢卷在原料库中,查询出相应的垛位编号
  25. if (rs.next()) {
  26. yardNo = Long.parseLong(rs.getObject("clf_no").toString());
  27. }
  28. //20131014系统连接异常优化
  29. this.getDao("KgDao").closeRs(rs);
  30. // 根据垛位编号清除钢卷信息
  31. String sql2 = "update c_tbk08_coil_yard set coil_no = '' where clf_no= ?";
  32. this.getDao("KgDao").ExcuteNonQuery(sql2, new Object[] { yardNo });
  33. // 修改公共表钢卷操作信息
  34. String sql3 = XmlSqlParsersFactory.getSql("UIM010320_01.UPDATE");
  35. this.getDao("KgDao").ExcuteNonQuery(
  36. sql3,
  37. new Object[] { regId, trnfShift, trnfGroup, trnfTime,
  38. coilNo });
  39. return cro;
  40. }
  41. public CoreReturnObject outCJ(String coilNo, String regId,
  42. String trnfShift, String trnfGroup, String trnfTime) throws SQLException{
  43. CoreReturnObject cro = new CoreReturnObject();
  44. // 根据钢卷号查询垛位编号
  45. String sql1 = "select clf_no from c_tbk08_coil_yard where coil_no = '"
  46. + coilNo + "'";
  47. ResultSet rs = this.getDao("KgDao").ExceuteQueryForResultSet(sql1);
  48. long yardNo = 0;
  49. // 如果钢卷在原料库中,查询出相应的垛位编号
  50. if (rs.next()) {
  51. yardNo = Long.parseLong(rs.getObject("clf_no").toString());
  52. }
  53. //20131014系统连接异常优化
  54. this.getDao("KgDao").closeRs(rs);
  55. // 根据垛位编号清除钢卷信息
  56. String sql2 = "update c_tbk08_coil_yard set coil_no = '' where clf_no= ?";
  57. this.getDao("KgDao").ExcuteNonQuery(sql2, new Object[] { yardNo });
  58. // 修改公共表钢卷操作信息
  59. String sql3 = XmlSqlParsersFactory.getSql("UIM010320_01.UPDATE");
  60. this.getDao("KgDao").ExcuteNonQuery(
  61. sql3,
  62. new Object[] { regId, trnfShift, trnfGroup, trnfTime,
  63. coilNo });
  64. return cro;
  65. }
  66. }