OBidPlanSignDriver.java 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  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 com.udapsoft.waf.system.HandlerStorage;
  15. import kr.co.hsnc.common.base.WAFLogger;
  16. import kr.co.hsnc.common.base.WAFMessages;
  17. import kr.co.hsnc.common.logger.Logger;
  18. import kr.co.hsnc.common.sql.Row;
  19. import kr.co.hsnc.common.sql.RowSet;
  20. import kr.co.hsnc.common.sql.RowSetImpl;
  21. import kr.co.hsnc.common.sql.WAFSQLException;
  22. import kr.co.hsnc.common.sql.persistent.Persistent;
  23. import kr.co.hsnc.common.sql.persistent.PersistentImpl;
  24. import kr.co.hsnc.common.sql.search.Search;
  25. import kr.co.hsnc.common.sql.search.SearchImpl;
  26. import kr.co.hsnc.common.sql.util.RowSetUtility;
  27. import kr.co.hsnc.common.util.ValueObject;
  28. import kr.co.udapsoft.common.commonSign.CommonSignInterface;
  29. import kr.co.udapsoft.common.sender.MessageSend;
  30. import kr.co.udapsoft.ebid.buyer.bid.outside.biz.InterfaceOutERPiU;
  31. import oracle.toplink.internal.ox.StrBuffer;
  32. /**
  33. *
  34. * @version 1.0
  35. * @author Beomgeun Lee
  36. */
  37. public class OBidPlanSignDriver implements CommonSignInterface {
  38. /**
  39. * 테슽 파일
  40. *
  41. */
  42. public OBidPlanSignDriver() {
  43. super();
  44. }
  45. /*
  46. * (non-Javadoc)
  47. * @see kr.co.udap.ehr.common.sign.SignInterface#doCallSign(java.sql.Connection, com.udapsoft.common.util.ValueObject)
  48. */
  49. public void doCallSign(Connection connection, ValueObject signDoc) throws Exception {
  50. WAFLogger.debug("!!doCallSign");
  51. }
  52. /*
  53. * (non-Javadoc)
  54. * @see kr.co.udap.ehr.common.sign.SignInterface#doStartSign(java.sql.Connection, com.udapsoft.common.util.ValueObject)
  55. */
  56. public void doStartSign(Connection connection, ValueObject signDoc) throws Exception {
  57. WAFLogger.debug("!!doStartSign");
  58. }
  59. /*
  60. * (non-Javadoc)
  61. * @see kr.co.udap.ehr.common.sign.SignInterface#doFirstFinishSign(java.sql.Connection, com.udapsoft.common.util.ValueObject)
  62. */
  63. public void doFirstFinishSign(Connection connection, ValueObject signDoc) throws Exception {
  64. boolean success = true;
  65. WAFLogger.debug("!!doFirstFinishSign");
  66. //String SITEDESC_FLAG = getSignSitedescFlag(connection, signDoc);
  67. //signDoc.set("SITEDESC_FLAG", SITEDESC_FLAG);
  68. //success = updateMaster(connection, signDoc);
  69. //플랜트 상태값 변경//
  70. ValueObject vo = new ValueObject();
  71. vo = getDemanded_kind(connection, signDoc);
  72. String status = "";
  73. if("Y".equals(vo.get("ONBID_YN"))){
  74. if("Y".equals(vo.get("SITEDESC_FLAG"))){
  75. status = "03";//현설의뢰
  76. }else{
  77. status = "04";//견적의뢰
  78. }
  79. success = updateMaster(connection, signDoc, status);
  80. if("B".equals(vo.get("DEMANDED_KIND"))){
  81. UPDATE_EBID_STATUS(connection, signDoc,vo);
  82. }
  83. }else{
  84. status = "06";//오프라인 //2014-12-08 추가
  85. success = updateMaster(connection, signDoc, status);
  86. }
  87. //2018.10.24 입찰내역 발주의뢰 접수시 생성
  88. if(success){
  89. InterfaceOutERPiU.updateStatusPMM(vo.get("DEMANDED_ID"), status);
  90. Send(signDoc,vo.get("SITEDESC_FLAG")); //협력업체메일발송
  91. Send_ToEtec(signDoc,vo.get("SITEDESC_FLAG")); //SGC이앤씨담당자 메일발송 2016.6.16
  92. }
  93. }
  94. /*
  95. * (non-Javadoc)
  96. * @see kr.co.udap.ehr.common.sign.SignInterface#doFinishSign(java.sql.Connection, com.udapsoft.common.util.ValueObject)
  97. */
  98. public void doFinishSign(Connection connection, ValueObject signDoc) throws Exception {
  99. WAFLogger.debug("!!doFinishSign");
  100. }
  101. /*
  102. * (non-Javadoc)
  103. * @see kr.co.udap.ehr.common.sign.SignInterface#doRejectSign(java.sql.Connection, com.udapsoft.common.util.ValueObject)
  104. */
  105. public void doFirstRejectSign(Connection connection, ValueObject signDoc) throws Exception {
  106. WAFLogger.debug("!!반려");
  107. updateMasterReject(connection, signDoc);
  108. ValueObject vo = new ValueObject();
  109. vo = getDemanded_kind(connection, signDoc);
  110. InterfaceOutERPiU.updateStatusPMM(vo.get("DEMANDED_ID"), "94");
  111. }
  112. /*
  113. * (non-Javadoc)
  114. * @see kr.co.udap.ehr.common.sign.SignInterface#doRejectSign(java.sql.Connection, com.udapsoft.common.util.ValueObject)
  115. */
  116. public void doRejectSign(Connection connection, ValueObject signDoc) throws Exception {
  117. WAFLogger.debug("!!doRejectSign");
  118. }
  119. /*
  120. * (non-Javadoc)
  121. * @see kr.co.udap.ehr.common.sign.SignInterface#doCancelSign(java.sql.Connection, com.udapsoft.common.util.ValueObject)
  122. */
  123. public void doCancelSign(Connection connection, ValueObject signDoc) throws Exception {
  124. WAFLogger.debug("!!doCancelSign");
  125. }
  126. /**
  127. * STATUS_CD 상태값을 업데이트해준다.
  128. * @param connection
  129. * @param valueObject
  130. * @throws Exception
  131. */
  132. public boolean updateMaster(Connection connection, ValueObject vo,String status) throws Exception {
  133. Persistent persistent = new PersistentImpl(connection);
  134. StringBuffer sqlstr = null;
  135. try {
  136. sqlstr = new StringBuffer();
  137. sqlstr.append(" UPDATE BID_MASTER \n");
  138. sqlstr.append(" SET STATUS_CD = ? \n");
  139. if("06".equals(status)){
  140. sqlstr.append(" , OPEN_DT = SYSDATE \n");
  141. }
  142. sqlstr.append(" , BID_APP_DATE = SYSDATE \n");
  143. sqlstr.append(" , BID_APP_NO = ? \n");
  144. sqlstr.append(" WHERE BID_NO = ? \n");
  145. sqlstr.append(" AND BID_DEG = ? \n");
  146. persistent.setStatement(sqlstr.toString());
  147. persistent.addParameter(status);
  148. persistent.addParameter(vo.get("SIGN_INTERFACE_ID"));
  149. persistent.addParameter(vo.get("KEY_COL1"));
  150. persistent.addParameter(vo.get("KEY_COL2"));
  151. persistent.execute();
  152. }
  153. catch(Exception e) {
  154. WAFLogger.error(this.getClass().getName() + " --> updateSac01001() : " + e.getMessage());
  155. WAFLogger.error("SQL : " + sqlstr);
  156. WAFLogger.error(e);
  157. return false;
  158. }
  159. return true;
  160. }
  161. /**
  162. * STATUS_CD 상태값을 업데이트해준다.
  163. * @param connection
  164. * @param valueObject
  165. * @throws Exception
  166. */
  167. public boolean updateMasterReject(Connection connection, ValueObject vo) throws Exception {
  168. Persistent persistent = new PersistentImpl(connection);
  169. StringBuffer sqlstr = null;
  170. try {
  171. sqlstr = new StringBuffer();
  172. sqlstr.append("UPDATE BID_MASTER \n");
  173. sqlstr.append("SET STATUS_CD = '94' \n");
  174. sqlstr.append("WHERE BID_NO = ? \n");
  175. sqlstr.append("AND BID_DEG = ? \n");
  176. persistent.setStatement(sqlstr.toString());
  177. persistent.addParameter(vo.get("KEY_COL1"));
  178. persistent.addParameter(vo.get("KEY_COL2"));
  179. persistent.execute();
  180. return true;
  181. }catch(Exception e) {
  182. WAFLogger.error(this.getClass().getName() + " --> updateMasterReject() : " + e.getMessage());
  183. WAFLogger.error("SQL : " + sqlstr);
  184. WAFLogger.error(e);
  185. return false;
  186. }
  187. }
  188. /**
  189. * 아이템 INSERT
  190. * @param connection
  191. * @param valueObject
  192. * @throws Exception
  193. */
  194. private String getSignSitedescFlag(Connection connection, ValueObject vo) throws Exception{
  195. Search search = new SearchImpl();
  196. RowSet rowSet = new RowSetImpl();
  197. String SITEDESC_FLAG = "";
  198. StringBuffer sqlstr = new StringBuffer();
  199. try {
  200. sqlstr.append(" SELECT SITEDESC_FLAG \n");
  201. sqlstr.append(" FROM BID_MASTER \n");
  202. sqlstr.append(" WHERE BID_NO = ? \n");
  203. sqlstr.append(" AND BID_DEG = ? \n");
  204. search.setStatement(sqlstr.toString());
  205. search.addParameter(vo.get("KEY_COL1"));
  206. search.addParameter(vo.get("KEY_COL2"));
  207. rowSet = search.execute();
  208. if (rowSet.size() > 0) {
  209. SITEDESC_FLAG = RowSetUtility.getValueObject(search.execute().getRow(0)).get("SITEDESC_FLAG");
  210. }
  211. }
  212. catch(WAFSQLException se) {
  213. Logger.err.println("SQL : \n" + se.getStatement());
  214. Logger.err.println("PARAM : \n" + se.getParameter());
  215. throw se;
  216. }
  217. finally {
  218. if (SITEDESC_FLAG == null)
  219. SITEDESC_FLAG = "";
  220. return SITEDESC_FLAG;
  221. }
  222. }
  223. public void Send(ValueObject params, String event) throws Exception {
  224. HandlerStorage Stroage = new HandlerStorage();
  225. MessageSend messageSend = new MessageSend(Stroage);
  226. if("Y".equals(event)){
  227. event = "03";
  228. }else{
  229. event = "04";//견적의뢰
  230. }
  231. RowSet SuppInfo = bid_supp_info(params);
  232. ValueObject bid_Master = bid_Master_info(params);
  233. for(int i=0;i < SuppInfo.size();i++){
  234. Row row = SuppInfo.getRow(i);
  235. if(!row.get("CHARGE_EMAIL").isEmpty()){
  236. if("Y".equals(bid_Master.get("ONBID_YN"))){
  237. boolean email = false;
  238. StringBuffer mailtitle = new StringBuffer();
  239. StringBuffer mailtitlein = new StringBuffer();
  240. StringBuffer mailContent = new StringBuffer();
  241. if("04".equals(event)){//견적의뢰
  242. mailtitle.append("* 입찰서 제출요청에 대한 공지 메일입니다.");
  243. mailtitlein.append("* 입찰서 제출요청에 대한 공지 메일입니다.");
  244. mailContent.append(row.get("VENDOR_NAME")+"님께 아래와 같은 내용으로 입찰서 제출을 요청드립니다.<br>협력업체포탈시스템에 접속하시어 입찰서 작성 및 제출바랍니다.<br>입찰서 제출시 법인공인증서가 필요합니다.<br>");
  245. mailContent.append("<font style='width:auto; font-size:12px; line-height:18px; padding:5px; text-align:left;'>");
  246. mailContent.append("<br>");
  247. mailContent.append("1.프로젝트 : " + bid_Master.get("DEPT_NM") + "<br>");
  248. mailContent.append("2.공고번호 : " + bid_Master.get("BID_NO") + "<br>");
  249. mailContent.append("3.공고건명 : " + bid_Master.get("BID_MASTER_NM") + "<br>");
  250. mailContent.append("4.견적마감일시 : " + bid_Master.get("BID_TO_DT_NM") + "<br>");
  251. mailContent.append("5.입찰담당자 : " +bid_Master.get("BUSEO_NM")+" / "+ bid_Master.get("USER_NAME") +" (연락처 : " + bid_Master.get("PO_EMPNM") + ", 이메일 : " + bid_Master.get("E_MAIL") +")<br>");
  252. mailContent.append("</font>");
  253. email = true;
  254. }else if("03".equals(event)){//현설의뢰
  255. mailtitle.append("* 현장설명회에 대한 공지 메일입니다.");
  256. mailtitlein.append("* 현장설명회에 대한 공지 메일입니다.");
  257. mailContent.append(row.get("VENDOR_NAME")+"님께 아래와 같은 내용으로 현장설명회 참석을 요청드립니다.<br>협력업체포탈시스템에 접속하시어 현장설명회 내용 확인 후 참석의사를 입력해 주시기바랍니다.<br>");
  258. mailContent.append("<font style='width:auto; font-size:12px; line-height:18px; padding:5px; text-align:left;'>");
  259. mailContent.append("<br>");
  260. mailContent.append("1.프로젝트 : " + bid_Master.get("DEPT_NM") + "<br>");
  261. mailContent.append("2.공고번호 : " + bid_Master.get("BID_NO") + "<br>");
  262. mailContent.append("3.공고건명 : " + bid_Master.get("BID_MASTER_NM") + "<br>");
  263. mailContent.append("4.현설일시 : " + bid_Master.get("SITEDESCDATE_NM") + "<br>");
  264. mailContent.append("5.현설장소 : " + bid_Master.get("SITEDESCPLACE") + "<br>");
  265. mailContent.append("6.현설담당자 : " +bid_Master.get("SITEDESC_BUSEO_NM")+" / "+ bid_Master.get("SITEDESC_CRG_NM") +" (연락처 : " + bid_Master.get("SITEDESCTELNO") + ", 이메일 : " + bid_Master.get("SITEDESCEMAIL") +")<br>");
  266. mailContent.append("7.입찰담당자 : " +bid_Master.get("BUSEO_NM")+" / "+ bid_Master.get("USER_NAME") +" (연락처 : " + bid_Master.get("PO_EMPNM") + ", 이메일 : " + bid_Master.get("E_MAIL") +")<br>");
  267. mailContent.append("</font>");
  268. email = true;
  269. }
  270. if(email){
  271. messageSend.sendEmail(row.get("CHARGE_EMAIL"), "partner@sgc.co.kr", mailtitle.toString(), mailtitlein.toString(), mailContent);
  272. }
  273. }
  274. }
  275. if(!row.get("CHAGE_HP").isEmpty()){
  276. String smsContent = "";
  277. if("Y".equals(bid_Master.get("ONBID_YN"))){
  278. if("04".equals(event)){//견적의뢰
  279. smsContent = WAFMessages.getMessage("Submit.Estimate.request");
  280. }else if("03".equals(event)){//현설의뢰
  281. smsContent = WAFMessages.getMessage("Description.Announcements.site");
  282. }
  283. }else{
  284. if("Y".equals(bid_Master.get("SITEDESC_FLAG"))){
  285. /*2014-12-08 추가
  286. * 오프라인 현설의뢰 SMS 발송*/
  287. smsContent = "";
  288. }
  289. }
  290. String from_phon_no = bid_Master.get("PO_EMPNM").replace("-", "");
  291. String to_phon_no = row.get("CHAGE_HP").replace("-", ""); //받는사람 row.get("CHAGE_HP").replace("-", "");
  292. if(!smsContent.isEmpty()){
  293. messageSend.sendSMS(to_phon_no,from_phon_no, bid_Master.get("PUREMPNO"), smsContent); //2015.9.21 입찰담당자 전화번호.
  294. }
  295. }
  296. }
  297. }
  298. //2016.6.16 발주의뢰자, 현설담당자 메일발송
  299. public void Send_ToEtec(ValueObject params, String event) throws Exception {
  300. HandlerStorage Stroage = new HandlerStorage();
  301. MessageSend messageSend = new MessageSend(Stroage);
  302. RowSet SuppInfo = bid_supp_info(params);
  303. ValueObject bid_Master = bid_Master_info(params);
  304. StringBuffer mailtitle = new StringBuffer();
  305. StringBuffer mailtitlein = new StringBuffer();
  306. StringBuffer mailContent = new StringBuffer();
  307. mailtitle.append("* [알림]입찰계획 승인");
  308. mailtitlein.append("* [알림]입찰계획 승인");
  309. mailContent.append(" 아래와 같이 현장설명회 일정 및 참석업체 안내 드리오니 업무 참조하시기 바랍니다. <br>");
  310. mailContent.append("<style type='text/css'>");
  311. mailContent.append("td {font-size:12px;}");
  312. mailContent.append("</style>");
  313. mailContent.append("<font style='width:auto; font-size:12px; line-height:18px; padding:5px; text-align:left;'>");
  314. mailContent.append("<br>");
  315. mailContent.append("1.PROJECT명 : " + bid_Master.get("DEPT_NM") + "<br>");
  316. mailContent.append("2.발주명 : " + bid_Master.get("DEMANDED_TITLE") + "<br>");
  317. mailContent.append("3.외주담당자 : " + bid_Master.get("USER_NAME") + "<br>");
  318. mailContent.append("4.견적설명회 : " + bid_Master.get("BID_INFO") + "<br>");
  319. mailContent.append("5.입찰마감 : " + bid_Master.get("BID_TO_DT_NM") + "(입찰마감기한 변경 시 통보 바랍니다)<br>");
  320. mailContent.append("6.견적대상업체" );
  321. mailContent.append("<table width='700' cellspacing='0' cellpadding='0' bordercolordark='#FFFFFF' bordercolorlight='#AEAFAF' border='1'>" );
  322. mailContent.append("<tr><td align='Center' bgcolor='rgb(208,216,232)'>견적업체명</td><td align='Center' bgcolor='rgb(208,216,232)'>연락처</td><td align='Center' bgcolor='rgb(208,216,232)'>E-MAIL</td></tr>" );
  323. for(int j=0;j < SuppInfo.size();j++){
  324. mailContent.append("<tr><td align='Left'>&nbsp;" + SuppInfo.getRow(j).get("VENDOR_NAME") + "</td><td align='Left'>&nbsp;" + SuppInfo.getRow(j).get("CORP_TEL") + "</td><td align='Left'>&nbsp;" + SuppInfo.getRow(j).get("CHARGE_EMAIL") + "</td></tr>" );
  325. }
  326. mailContent.append("</table>" );
  327. mailContent.append("7.비고 <br> ");
  328. mailContent.append("&nbsp;&nbsp;&nbsp;1)추가 견적설명회를 실시할 경우 관련 자료를 외주 담당자에게 송부해 주시기 바랍니다.<br>");
  329. mailContent.append("&nbsp;&nbsp;&nbsp;2)입찰자료(WR, 시방서, 도면)에 변경이 있는 경우 입찰에 반영되도록 수정본을 외주 담당자에게 송부해 주시기 바랍니다.");
  330. mailContent.append("</font>");
  331. if(!bid_Master.get("E_MAIL").isEmpty()) {
  332. //외주담당자
  333. messageSend.sendEmail(bid_Master.get("E_MAIL"), "partner@sgc.co.kr", mailtitle.toString(), mailtitlein.toString(), mailContent, "1");
  334. }
  335. //발주의뢰자
  336. if(!bid_Master.get("EMP_MAIL").isEmpty()){ //
  337. messageSend.sendEmail(bid_Master.get("EMP_MAIL") , "partner@sgc.co.kr", mailtitle.toString(), mailtitlein.toString(), mailContent, "1");
  338. }
  339. //현설담당자
  340. if(!bid_Master.get("SITEDESCEMAIL").isEmpty() && !bid_Master.get("SITEDESCEMAIL").equals(bid_Master.get("EMP_MAIL")) ){
  341. messageSend.sendEmail(bid_Master.get("SITEDESCEMAIL"), "partner@sgc.co.kr", mailtitle.toString(), mailtitlein.toString(), mailContent, "1");
  342. }
  343. }
  344. /**
  345. * 견적 대상 업체 를 검색하여 리턴
  346. * @param Params
  347. * @return
  348. */
  349. public RowSet bid_supp_info(ValueObject param) {
  350. Search search = new SearchImpl();
  351. RowSet rowSet = new RowSetImpl();
  352. // String sqlstr = "";
  353. StrBuffer sqlstr = new StrBuffer();
  354. try{
  355. sqlstr.append(" SELECT A.CHARGE_NAME,A.CHARGE_EMAIL,A.CHAGE_HP,A.VENDOR_NAME, B.CORP_TEL \n");
  356. sqlstr.append(" FROM BID_SUPP A, SUPP_INFO B \n");
  357. sqlstr.append(" WHERE A.VENDOR_CD = B.CORP_ID AND A.BID_NO = ? \n");
  358. sqlstr.append(" AND A.BID_DEG = ? \n");
  359. search.setStatement(sqlstr.toString());
  360. search.addParameter(param.get("KEY_COL1"));
  361. search.addParameter(param.get("KEY_COL2"));
  362. search.setStatement(sqlstr.toString());
  363. rowSet = search.execute();
  364. }
  365. catch (WAFSQLException se) {
  366. Logger.err.println("SQL : \n" + se.getStatement());
  367. Logger.err.println("PARAM : \n" + se.getParameter());
  368. }
  369. finally {
  370. if(rowSet == null){
  371. rowSet = new RowSetImpl();
  372. }
  373. }
  374. WAFLogger.debug("### rowSet size : " + rowSet.size());
  375. return rowSet;
  376. }
  377. /**
  378. * 발주의뢰(외주) 접수를 검색하여 리턴
  379. * @param Params
  380. * @return
  381. */
  382. public ValueObject bid_Master_info(ValueObject param) {
  383. Search search = new SearchImpl();
  384. ValueObject valueobject = null;
  385. RowSet rowSet = new RowSetImpl();
  386. StrBuffer sqlstr = new StrBuffer();
  387. try{
  388. sqlstr.append(" SELECT A.BID_NO, \n");
  389. sqlstr.append(" A.BID_DEG, \n");
  390. sqlstr.append(" A.DEMANDED_ID, \n");
  391. sqlstr.append(" A.DEMANDED_NO, \n");
  392. sqlstr.append(" A.DEPT_CD, \n");
  393. sqlstr.append(" A.DEPT_NM, \n");
  394. sqlstr.append(" A.DEMANDED_TITLE, \n");
  395. sqlstr.append(" A.DEMANDED_KIND, \n");
  396. sqlstr.append(" A.DEMANDED_DATE, \n");
  397. sqlstr.append(" A.REQUEST_DATE, \n");
  398. sqlstr.append(" A.REQ_DEPT_CD, \n");
  399. sqlstr.append(" A.REQ_DEPT_NM, \n");
  400. sqlstr.append(" A.EMP_NO, \n");
  401. sqlstr.append(" A.EMP_NM, \n");
  402. sqlstr.append(" A.PAY_ITEM, \n");
  403. sqlstr.append(" A.COST_CODE, \n");
  404. sqlstr.append(" A.COST_TYPE, \n");
  405. sqlstr.append(" A.CONT_AMT, \n");
  406. sqlstr.append(" A.ACT_AMT, \n");
  407. sqlstr.append(" A.ACT_RATE, \n");
  408. sqlstr.append(" A.RECEIPT_DATE, \n");
  409. sqlstr.append(" A.ONBID_YN, \n");
  410. sqlstr.append(" A.CMPT_CD, \n");
  411. sqlstr.append(" A.SUCC_CD, \n");
  412. sqlstr.append(" A.NOTI_DY, \n");
  413. sqlstr.append(" A.SITEDESC_FLAG, \n");
  414. sqlstr.append(" A.SITEDESCCHRGPRSNID, \n");
  415. sqlstr.append(" NVL(A.SITEDESC_CRG_NM,(SELECT USER_NAME FROM PUB0120T WHERE ACCT_ID = A.SITEDESCCHRGPRSNID)) AS SITEDESC_CRG_NM, \n");
  416. sqlstr.append(" A.SITEDESCTELNO, \n");
  417. sqlstr.append(" A.SITEDESCEMAIL, \n");
  418. sqlstr.append(" A.SITEDESCDATE, \n");
  419. sqlstr.append(" TO_CHAR(A.SITEDESCDATE,'YYYY-MM-DD HH24:MI') AS SITEDESCDATE_NM, \n");
  420. sqlstr.append(" A.SITEDESCPLACE, \n");
  421. sqlstr.append(" A.BID_FROM_DT, \n");
  422. sqlstr.append(" A.BID_TO_DT, \n");
  423. sqlstr.append(" TO_CHAR(A.BID_TO_DT,'YYYY-MM-DD HH24:MI') AS BID_TO_DT_NM, \n");
  424. sqlstr.append(" A.PUREMPNO, \n");
  425. sqlstr.append(" A.PO_EMPNM, \n");
  426. sqlstr.append(" A.OPEN_EMPNM, \n");
  427. sqlstr.append(" A.OPEN_EMPID, \n");
  428. sqlstr.append(" A.OPEN_DT, \n");
  429. sqlstr.append(" A.TBE_FLAG, \n");
  430. sqlstr.append(" A.DELIVERY_CONDITION, \n");
  431. sqlstr.append(" A.DELIVERY_PLACE, \n");
  432. sqlstr.append(" A.INNER_REMARKS, \n");
  433. sqlstr.append(" A.OUTER_REMARKS, \n");
  434. sqlstr.append(" A.ATT_ID, \n");
  435. sqlstr.append(" A.BID_APP_DATE, \n");
  436. sqlstr.append(" A.BID_APP_NO, \n");
  437. sqlstr.append(" A.CONT_APP_DATE, \n");
  438. sqlstr.append(" A.CONT_APP_NO, \n");
  439. sqlstr.append(" A.DOC_ETC_IN, \n");
  440. sqlstr.append(" A.DOC_ETC_OUT, \n");
  441. sqlstr.append(" A.BID_MASTER_NM, \n");
  442. sqlstr.append(" A.POSTPONE_REASON, \n");
  443. sqlstr.append(" A.CANCEL_REASON, \n");
  444. sqlstr.append(" A.MODIFY_REASON, \n");
  445. sqlstr.append(" A.FIB_REASON, \n");
  446. sqlstr.append(" A.OUT_ITEM_CD, \n");
  447. sqlstr.append(" A.STATUS_CD, \n");
  448. sqlstr.append(" A.DIV_PO_YN, \n");
  449. sqlstr.append(" A.CURRENCY_GB, \n");
  450. sqlstr.append(" A.CURRENCY_GB_YN, \n");
  451. sqlstr.append(" A.PBC_CBE_TYPE_CD, \n");
  452. sqlstr.append(" A.PBC_INSTALL_YN, \n");
  453. sqlstr.append(" A.PBC_COMMISS_YN, \n");
  454. sqlstr.append(" A.PBC_SPETOOL_YN, \n");
  455. sqlstr.append(" A.PBC_TEST_YN, \n");
  456. sqlstr.append(" A.PBC_DOC_YN, \n");
  457. sqlstr.append(" A.PBC_PACK_YN, \n");
  458. sqlstr.append(" A.PBC_LANDTRAN_YN, \n");
  459. sqlstr.append(" A.DELIVERY_CONDITION_YN, \n");
  460. sqlstr.append(" A.PBC_FEE_YN, \n");
  461. sqlstr.append(" A.PBC_OPTION_COMMENT, \n");
  462. sqlstr.append(" A.PBC_OPTION_YN, \n");
  463. sqlstr.append(" A.PAY_CON_RATE, \n");
  464. sqlstr.append(" A.CBC_DAMAGE_RATE, \n");
  465. sqlstr.append(" A.CBC_DAMAGE_MAXRATE, \n");
  466. sqlstr.append(" A.CBC_FIRST_RATE, \n");
  467. sqlstr.append(" A.PBC_FIRST_CONDI, \n");
  468. sqlstr.append(" A.CPC_MID_RATE, \n");
  469. sqlstr.append(" A.PBC_MID_CONDI, \n");
  470. sqlstr.append(" A.PBC_REST_RATE, \n");
  471. sqlstr.append(" A.PBC_REST_CONDI, \n");
  472. sqlstr.append(" A.PBC_FRSTGUAR_RATE, \n");
  473. sqlstr.append(" A.PBC_FRSTGUAR_CONDI, \n");
  474. sqlstr.append(" A.CONTFUL_RATE, \n");
  475. sqlstr.append(" A.CONTFUL_CONDI, \n");
  476. sqlstr.append(" A.WARR_RATE, \n");
  477. sqlstr.append(" A.WARR_CONDI, \n");
  478. sqlstr.append(" A.PBC_DEFECT_CONDI, \n");
  479. sqlstr.append(" A.CBC_DEFECT_DAY, \n");
  480. sqlstr.append(" A.CBC_DERECT_TERM_CD, \n");
  481. sqlstr.append(" A.DELI_FROM_DY, \n");
  482. sqlstr.append(" A.DELI_TO_DY, \n");
  483. sqlstr.append(" A.OBC_CONT_TYPE_CD, \n");
  484. sqlstr.append(" A.OBC_FRST_CASH_RATE, \n");
  485. sqlstr.append(" A.OBC_MID_CASH_RATE, \n");
  486. sqlstr.append(" A.OBC_MID_BILL_RATE, \n");
  487. sqlstr.append(" A.OBC_FIN_CASH_RATE, \n");
  488. sqlstr.append(" A.OBC_FIN_BILL_RATE, \n");
  489. sqlstr.append(" A.OBC_FRST_CONDI, \n");
  490. sqlstr.append(" A.OBC_MID_PAYDAY, \n");
  491. sqlstr.append(" A.OBC_FIN_PAYDAY, \n");
  492. sqlstr.append(" A.OBC_FRST_CNT_CONDI, \n");
  493. sqlstr.append(" A.OBC_MID_REQ_MONTH, \n");
  494. sqlstr.append(" A.OBC_MID_CNT, \n");
  495. sqlstr.append(" A.OBC_FIN_CONDI, \n");
  496. sqlstr.append(" A.OBC_EMP_RATE, \n");
  497. sqlstr.append(" A.OBC_EMP_YN, \n");
  498. sqlstr.append(" A.OBC_PENSION_RATE, \n");
  499. sqlstr.append(" A.OBC_PENSION_YN, \n");
  500. sqlstr.append(" A.OBC_HEALTH_RATE, \n");
  501. sqlstr.append(" A.OBC_HEALTH_YN, \n");
  502. sqlstr.append(" A.OBC_ELDER_RATE, \n");
  503. sqlstr.append(" A.OBC_ELDER_YN, \n");
  504. sqlstr.append(" A.OBC_WORK_RATE, \n");
  505. sqlstr.append(" A.OBC_WORK_YN, \n");
  506. sqlstr.append(" A.OBC_RESIGN_RATE, \n");
  507. sqlstr.append(" A.OBC_RESIGN_YN, \n");
  508. sqlstr.append(" A.OBC_SAFE_RATE, \n");
  509. sqlstr.append(" A.OBC_SAFE_YN, \n");
  510. sqlstr.append(" A.OBC_ENV_RATE, \n");
  511. sqlstr.append(" A.OBC_ENV_YN, \n");
  512. sqlstr.append(" A.OBC_SITE_RATE, \n");
  513. sqlstr.append(" A.OBC_SITE_YN, \n");
  514. sqlstr.append(" A.OBC_DUTY_RATE, \n");
  515. sqlstr.append(" A.OBC_DUTY_YN, \n");
  516. sqlstr.append(" A.PAY_DIV, \n");
  517. sqlstr.append(" A.MATERIAL_GB, \n");
  518. sqlstr.append(" A.DELI_START_DT, \n");
  519. sqlstr.append(" A.DELI_END_DT, \n");
  520. sqlstr.append(" A.DELI_END_PLACE, \n");
  521. sqlstr.append(" A.KRW_APPR_YN, \n");
  522. sqlstr.append(" B.USER_NAME, \n");
  523. sqlstr.append(" B.E_MAIL, \n");
  524. sqlstr.append(" D.E_MAIL EMP_MAIL, \n");
  525. sqlstr.append(" DECODE(NVL(A.SITEDESC_FLAG, 'N'), 'N', '미실시', TO_CHAR(A.SITEDESCDATE, 'YYYY-MM-DD HH24:MI') || '/' || A.SITEDESCPLACE) BID_INFO, \n");
  526. sqlstr.append(" (SELECT ACC_DEPT_NM FROM PUB0120T WHERE USER_SABUN = B.USER_SABUN) AS BUSEO_NM, \n");
  527. sqlstr.append(" C.EVAL_EMPNM, \n");
  528. sqlstr.append(" C.EVAL_TEL, \n");
  529. sqlstr.append(" (SELECT ACC_DEPT_NM FROM PUB0120T WHERE USER_SABUN = (SELECT USER_SABUN FROM PUB0120T WHERE ACCT_ID = C.EVAL_EMPID)) AS TBE_BUSEO_NM , \n");
  530. sqlstr.append(" (SELECT ACC_DEPT_NM FROM PUB0120T WHERE USER_SABUN = (SELECT USER_SABUN FROM PUB0120T WHERE ACCT_ID = A.SITEDESCCHRGPRSNID)) AS SITEDESC_BUSEO_NM \n");
  531. sqlstr.append(" FROM BID_MASTER A, PUB0120T B , TBE_INFO C , PUB0120T D \n");
  532. sqlstr.append(" WHERE A.PUREMPNO = B.ACCT_ID \n");
  533. sqlstr.append(" AND A.BID_NO = C.BID_NO(+) \n");
  534. sqlstr.append(" AND A.BID_DEG = C.BID_DEG(+) \n");
  535. sqlstr.append(" AND A.EMP_NO = D.ACCT_ID \n"); //2016.6.16 수정
  536. sqlstr.append(" AND A.BID_NO = ? \n");
  537. sqlstr.append(" AND A.BID_DEG = ? \n");
  538. search.setStatement(sqlstr.toString());
  539. search.addParameter(param.get("KEY_COL1"));
  540. search.addParameter(param.get("KEY_COL2"));
  541. search.setStatement(sqlstr.toString());
  542. rowSet = search.execute();
  543. if( rowSet != null && rowSet.size() > 0 ){
  544. valueobject = RowSetUtility.getValueObject(rowSet.getRow(0));
  545. }
  546. }
  547. catch (WAFSQLException se) {
  548. Logger.err.println("SQL : \n" + se.getStatement());
  549. Logger.err.println("PARAM : \n" + se.getParameter());
  550. }
  551. return valueobject;
  552. }
  553. /**
  554. * STATUS_CD 상태값을 업데이트해준다.
  555. * @param connection
  556. * @param valueObject
  557. * @throws Exception
  558. */
  559. public boolean UPDATE_EBID_STATUS(Connection connection, ValueObject vo, ValueObject BidMaster) throws Exception {
  560. Persistent persistent = new PersistentImpl(connection);
  561. StringBuffer sqlstr = null;
  562. try {
  563. sqlstr = new StringBuffer();
  564. sqlstr.append(" UPDATE ETECEPC.MR_REQ_PO \n");
  565. sqlstr.append(" SET EBID_STATUS = '03' --입찰 \n");
  566. sqlstr.append(" WHERE DEMANDED_ID = (SELECT DEMANDED_ID FROM BID_MASTER WHERE BID_NO = ? AND BID_DEG = ?) \n");
  567. persistent.setStatement(sqlstr.toString());
  568. persistent.addParameter(vo.get("KEY_COL1"));
  569. persistent.addParameter(vo.get("KEY_COL2"));
  570. persistent.execute();
  571. }
  572. catch(Exception e) {
  573. WAFLogger.error(this.getClass().getName() + " --> updateSac01001() : " + e.getMessage());
  574. WAFLogger.error("SQL : " + sqlstr);
  575. WAFLogger.error(e);
  576. return false;
  577. }
  578. return true;
  579. }
  580. private ValueObject getDemanded_kind(Connection connection, ValueObject vo) throws Exception{
  581. Search search = new SearchImpl();
  582. RowSet rowSet = new RowSetImpl();
  583. ValueObject valueobject = null;
  584. StringBuffer sqlstr = new StringBuffer();
  585. try {
  586. sqlstr.append(" SELECT DEMANDED_KIND,STATUS_CD,ONBID_YN,SITEDESC_FLAG, DEMANDED_ID \n");
  587. sqlstr.append(" FROM BID_MASTER \n");
  588. sqlstr.append(" WHERE BID_NO = ? \n");
  589. sqlstr.append(" AND BID_DEG = ? \n");
  590. search.setStatement(sqlstr.toString());
  591. search.addParameter(vo.get("KEY_COL1"));
  592. search.addParameter(vo.get("KEY_COL2"));
  593. rowSet = search.execute();
  594. if (rowSet.size() > 0) {
  595. valueobject = RowSetUtility.getValueObject(search.execute().getRow(0));
  596. }
  597. }
  598. catch(WAFSQLException se) {
  599. Logger.err.println("SQL : \n" + se.getStatement());
  600. Logger.err.println("PARAM : \n" + se.getParameter());
  601. throw se;
  602. }
  603. finally {
  604. if (valueobject == null)
  605. valueobject = new ValueObject();
  606. return valueobject;
  607. }
  608. }
  609. }