PurchaseContSignDriver.java 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /**
  2. * @(#)file BidPlanSignDriver.java
  3. * @(#)author Son hyungmin
  4. * @(#)version 1.0
  5. * @(#)date 2014-09-29
  6. * @(#)since JDK 1.4.2
  7. *
  8. * Copyright (c) www.dcchem.co.kr, Inc.
  9. * All rights reserved.
  10. * This software is the proprietary information of dcchem, Inc.
  11. */
  12. package kr.co.udapsoft.common.commonSign.driver;
  13. import java.sql.Connection;
  14. import kr.co.hsnc.common.base.WAFLogger;
  15. import kr.co.hsnc.common.sql.persistent.Persistent;
  16. import kr.co.hsnc.common.sql.persistent.PersistentImpl;
  17. import kr.co.hsnc.common.util.ValueObject;
  18. import kr.co.udapsoft.common.commonSign.CommonSignInterface;
  19. /**
  20. *
  21. * @version 1.0
  22. * @author Beomgeun Lee
  23. */
  24. public class PurchaseContSignDriver implements CommonSignInterface {
  25. /**
  26. * 테슽 파일
  27. *
  28. */
  29. public PurchaseContSignDriver() {
  30. super();
  31. }
  32. /*
  33. * (non-Javadoc)
  34. * @see kr.co.udap.ehr.common.sign.SignInterface#doCallSign(java.sql.Connection, com.udapsoft.common.util.ValueObject)
  35. */
  36. public void doCallSign(Connection connection, ValueObject signDoc) throws Exception {
  37. System.out.println("!!doCallSign");
  38. }
  39. /*
  40. * (non-Javadoc)
  41. * @see kr.co.udap.ehr.common.sign.SignInterface#doStartSign(java.sql.Connection, com.udapsoft.common.util.ValueObject)
  42. */
  43. public void doStartSign(Connection connection, ValueObject signDoc) throws Exception {
  44. System.out.println("!!doStartSign");
  45. }
  46. /*
  47. * (non-Javadoc)
  48. * @see kr.co.udap.ehr.common.sign.SignInterface#doFirstFinishSign(java.sql.Connection, com.udapsoft.common.util.ValueObject)
  49. */
  50. public void doFirstFinishSign(Connection connection, ValueObject signDoc) throws Exception {
  51. System.out.println("!!doFirstFinishSign");
  52. System.out.println("### 결재 Strart");
  53. updateMaster(connection, signDoc);
  54. System.out.println("### 결재 End");
  55. }
  56. /*
  57. * (non-Javadoc)
  58. * @see kr.co.udap.ehr.common.sign.SignInterface#doFinishSign(java.sql.Connection, com.udapsoft.common.util.ValueObject)
  59. */
  60. public void doFinishSign(Connection connection, ValueObject signDoc) throws Exception {
  61. System.out.println("!!doFinishSign");
  62. }
  63. /*
  64. * (non-Javadoc)
  65. * @see kr.co.udap.ehr.common.sign.SignInterface#doRejectSign(java.sql.Connection, com.udapsoft.common.util.ValueObject)
  66. */
  67. public void doFirstRejectSign(Connection connection, ValueObject signDoc) throws Exception {
  68. System.out.println("!!반려");
  69. updateMaster(connection, signDoc);
  70. }
  71. /*
  72. * (non-Javadoc)
  73. * @see kr.co.udap.ehr.common.sign.SignInterface#doRejectSign(java.sql.Connection, com.udapsoft.common.util.ValueObject)
  74. */
  75. public void doRejectSign(Connection connection, ValueObject signDoc) throws Exception {
  76. System.out.println("!!doRejectSign");
  77. }
  78. /*
  79. * (non-Javadoc)
  80. * @see kr.co.udap.ehr.common.sign.SignInterface#doCancelSign(java.sql.Connection, com.udapsoft.common.util.ValueObject)
  81. */
  82. public void doCancelSign(Connection connection, ValueObject signDoc) throws Exception {
  83. System.out.println("!!doCancelSign");
  84. }
  85. /**
  86. * SAC01001 상태값을 업데이트해준다.
  87. * @param connection
  88. * @param valueObject
  89. * @throws Exception
  90. */
  91. public void updateMaster(Connection connection, ValueObject vo) throws Exception {
  92. Persistent persistent = new PersistentImpl(connection);
  93. StringBuffer sqlstr = null;
  94. try {
  95. sqlstr = new StringBuffer();
  96. String status = "";
  97. if(vo.get("SIGN_TYPE").equals("1")){
  98. if(vo.get("SIGN_DECI_CLASS").equals("14")){
  99. status = "18";//결재완료
  100. }else {
  101. status = "41";//반려
  102. }
  103. }
  104. sqlstr.append(" UPDATE PUR2000T \n");
  105. sqlstr.append(" SET STATUS_CD = ? \n");
  106. sqlstr.append(" WHERE PUR_CONT_MOD_ID = ? \n");
  107. persistent.setStatement(sqlstr.toString());
  108. persistent.addParameter(status);
  109. persistent.addParameter(vo.get("KEY_COL1"));
  110. persistent.execute();
  111. }
  112. catch(Exception e) {
  113. WAFLogger.error(this.getClass().getName() + " --> updateSac01001() : " + e.getMessage());
  114. WAFLogger.error("SQL : " + sqlstr);
  115. WAFLogger.error(e);
  116. throw e;
  117. }
  118. }
  119. }