OInsurSignDriver.java 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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 OInsurSignDriver implements CommonSignInterface {
  25. /**
  26. * 테슽 파일
  27. *
  28. */
  29. public OInsurSignDriver() {
  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. }
  53. /*
  54. * (non-Javadoc)
  55. * @see kr.co.udap.ehr.common.sign.SignInterface#doFinishSign(java.sql.Connection, com.udapsoft.common.util.ValueObject)
  56. */
  57. public void doFinishSign(Connection connection, ValueObject signDoc) throws Exception {
  58. System.out.println("!!doFinishSign");
  59. updateMaster(connection, signDoc);
  60. }
  61. /*
  62. * (non-Javadoc)
  63. * @see kr.co.udap.ehr.common.sign.SignInterface#doRejectSign(java.sql.Connection, com.udapsoft.common.util.ValueObject)
  64. */
  65. public void doFirstRejectSign(Connection connection, ValueObject signDoc) throws Exception {
  66. System.out.println("!!doFirstRejectSign");
  67. updateMaster(connection, signDoc);
  68. }
  69. /*
  70. * (non-Javadoc)
  71. * @see kr.co.udap.ehr.common.sign.SignInterface#doRejectSign(java.sql.Connection, com.udapsoft.common.util.ValueObject)
  72. */
  73. public void doRejectSign(Connection connection, ValueObject signDoc) throws Exception {
  74. System.out.println("!!doRejectSign");
  75. updateMaster(connection, signDoc);
  76. }
  77. /*
  78. * (non-Javadoc)
  79. * @see kr.co.udap.ehr.common.sign.SignInterface#doCancelSign(java.sql.Connection, com.udapsoft.common.util.ValueObject)
  80. */
  81. public void doCancelSign(Connection connection, ValueObject signDoc) throws Exception {
  82. System.out.println("!!doCancelSign");
  83. updateMaster(connection, signDoc);
  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_DECI_CLASS").equals("24")){
  98. status = "10";//결재완료
  99. }else {
  100. status = "09";//반려
  101. }
  102. //2018.08.16 구매,외주 구분
  103. if (vo.get("KEY_COL2").equals("P")){
  104. sqlstr.append(" UPDATE CONT_PUR_INSUR \n");
  105. sqlstr.append(" SET STATUS_CD = ? \n");
  106. sqlstr.append(" WHERE PUR_CONT_MOD_ID = ? \n");
  107. }else {
  108. sqlstr.append(" UPDATE CONT_OUT_INSUR \n");
  109. sqlstr.append(" SET STATUS_CD = ? \n");
  110. sqlstr.append(" WHERE SUB_CONT_MOD_ID = ? \n");
  111. }
  112. persistent.setStatement(sqlstr.toString());
  113. persistent.addParameter(status);
  114. persistent.addParameter(vo.get("KEY_COL1"));
  115. persistent.execute();
  116. }
  117. catch(Exception e) {
  118. WAFLogger.error(this.getClass().getName() + " --> updateSac01001() : " + e.getMessage());
  119. WAFLogger.error("SQL : " + sqlstr);
  120. WAFLogger.error(e);
  121. throw e;
  122. }
  123. }
  124. }