SACDOCreatePDF8.java 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035
  1. package kr.co.udapsoft.common.commonSign.util;
  2. import java.awt.Color;
  3. import java.io.IOException;
  4. import java.io.OutputStream;
  5. import java.sql.Connection;
  6. import javax.servlet.http.HttpServletRequest;
  7. import com.lowagie.text.Document;
  8. import com.lowagie.text.DocumentException;
  9. import com.lowagie.text.Element;
  10. import com.lowagie.text.Font;
  11. import com.lowagie.text.Image;
  12. import com.lowagie.text.PageSize;
  13. import com.lowagie.text.Paragraph;
  14. import com.lowagie.text.Rectangle;
  15. import com.lowagie.text.pdf.BaseFont;
  16. import com.lowagie.text.pdf.PdfPCell;
  17. import com.lowagie.text.pdf.PdfPTable;
  18. import com.lowagie.text.pdf.PdfWriter;
  19. /*
  20. * 외주기성고 계산서 : http://172.17.217.243/lib/dlgReport.screen?&WINDOW_TITLE=%20&REPORT_NAME=%2Fjsp%2Fko_kr%2Fsub%2Freport%2FSUBAcmpBillList.mrd&REPORT_OPTION=%2Frf&HIDE_STATUS_BAR=false&HIDE_TOOL_BAR=false&ZOOM_RATIO=100&HIDE_STATUS_DLG=false&P_0=6250A10401&P_1=200808&P_2='SUBO06110064'%2C'SUBO06110089'%2C'SUBO07010064'%2C'SUBO07030114'%2C'SUBO07030116'%2C'SUBO07050041'%2C'SUBO07070043'%2C'SUBO08040034'%2C'SUBO08040127'%2C'SUBO08050150'%2C'SUBO08070004'%2C'SUBO08070023'%2C'SUBO08070026'%2C'SUBO06110066'%2C'SUBO07010039'%2C'SUBO06110040'%2C'SUBO07020049'%2C'SUBO07090060'%2C'SUBO07110105'%2C'SUBO07110107'%2C'SUBO07120076'%2C'SUBO07120085'%2C'SUBO07120109'%2C'SUBO07120131'%2C'SUBO07120133'%2C'SUBO08010025'%2C'SUBO08010058'%2C'SUBO08020050'%2C'SUBO08030015'%2C'SUBO08040100'%2C'SUBO08040141'%2C'SUBO08060015'%2C'SUBO08060040'%2C'SUBO08060078'%2C'SUBO08070074'%2C'SUBO07010081'%2C'SUBO07030115'%2C'SUBO07060089'%2C'SUBO07070013'%2C'SUBO07070053'%2C'SUBO07070086'%2C'SUBO07070088'%2C'SUBO07070089'%2C'SUBO07100113'%2C'SUBO07100118'%2C'SUBO07100124'%2C'SUBO07110030'%2C'SUBO08030034'%2C'SUBO08030122'%2C'SUBO06120108'%2C'SUBO07020069'%2C'SUBO07020083'%2C'SUBO07030125'%2C'SUBO07050062'%2C'SUBO07060070'%2C'SUBO07070051'%2C'SUBO07070119'%2C'SUBO07070122'%2C'SUBO07100123'%2C'SUBO07120055'%2C'SUBO07120062'%2C'SUBO07120113'%2C'SUBO08030075'%2C'SUBO08060115'%2C'SUBO08060118'%2C'SUBO08070006'%2C'SUBO08070037'%2C'SUBO08070167'%2C'SUBO08070168'%2C'SUBO08080030'%2C'SUBO06120082'%2C'SUBO07030006'%2C'SUBO07030110'%2C'SUBO07040059'%2C'SUBO07040075'%2C'SUBO07090007'%2C'SUBO07110067'%2C'SUBO07120004'%2C'SUBO07120081'%2C'SUBO08010023'%2C'SUBO08010104'%2C'SUBO08010171'%2C'SUBO08030099'%2C'SUBO08040027'%2C'SUBO08040089'%2C'SUBO08060018'%2C'SUBO08090001'&P_SIZE=3
  21. *
  22. */
  23. import com.udapsoft.waf.system.HandlerStorage;
  24. import kr.co.hsnc.common.base.WAFLogger;
  25. import kr.co.hsnc.common.config.WAFConfig;
  26. import kr.co.hsnc.common.sql.RowSet;
  27. import kr.co.hsnc.common.sql.RowSetImpl;
  28. import kr.co.hsnc.common.sql.persistent.Persistent;
  29. import kr.co.hsnc.common.sql.persistent.PersistentImpl;
  30. import kr.co.hsnc.common.sql.search.Search;
  31. import kr.co.hsnc.common.sql.search.SearchImpl;
  32. import kr.co.hsnc.common.sql.util.RowSetUtility;
  33. import kr.co.hsnc.common.util.ValueObject;
  34. public class SACDOCreatePDF8 {
  35. public static BaseFont bfKorean = null;
  36. /*
  37. * private static Font FontKorean = null;
  38. */
  39. public static Font FontBold = null;
  40. private static String strClassName = (new Throwable()).getStackTrace()[0]
  41. .getClassName();
  42. // private static String strFileName = "d:\\temp\\pdf\\" + strClassName +
  43. // ".pdf";
  44. private static String strFileName = WAFConfig.get("waf.repository.path")
  45. + "\\" + strClassName + ".pdf";
  46. private static Color borderColor = Color.BLACK;
  47. private static String strGubun = null;
  48. private static float BorderW = 0.1f;
  49. private static Rectangle border = new Rectangle(0f, 0f);
  50. private static boolean isGray = false;
  51. private static boolean LineisGray = false; //데이터 로
  52. /**
  53. * @param args
  54. */
  55. public void doBiz1(Connection con, OutputStream outputStream, String tmpslipID, HttpServletRequest request) {
  56. WAFLogger.debug("\n\t #################### 기성 검사 보고서 시작");
  57. // step 1
  58. Document document = new Document(PageSize.A4, 25f, 25f, 35f, 10f);
  59. try {
  60. // step 2
  61. PdfWriter writer = PdfWriter.getInstance(document, outputStream);
  62. // step 3
  63. document.open();
  64. BaseFont bfKorean = BaseFont.createFont("HYGoThic-Medium", "UniKS-UCS2-H", BaseFont.NOT_EMBEDDED);
  65. Font FontTitle = new Font(bfKorean,10, Font.NORMAL);
  66. Font FontTitle3 = new Font(bfKorean, 9, Font.NORMAL);
  67. Font FontTitle1 = new Font(bfKorean, 8, Font.NORMAL);
  68. FontTitle.setColor(borderColor);
  69. Font FontData = new Font(bfKorean, 4.8f, Font.NORMAL);
  70. Font FontTitle2 = new Font(bfKorean, 20, Font.BOLD);
  71. PdfPTable table = null;
  72. PdfPCell cell = null;
  73. /*
  74. * 정보 검색 시작 ---------------------------------------------
  75. */
  76. ValueObject params = new ValueObject();
  77. HandlerStorage storage = new HandlerStorage();
  78. storage.setParams(params);
  79. ValueObject listRowSet = null;
  80. RowSet rowSet = null;
  81. /*
  82. * 정보 검색 시작 ---------------------------------------------
  83. */
  84. String subContModId = getSubContModId(con,tmpslipID);
  85. listRowSet = getPayReqList1(con, tmpslipID,subContModId);
  86. rowSet = getPayReqList2(tmpslipID);
  87. // 정보 검색 끝 ---------------------------------------------
  88. /*
  89. * ===========================================================================================
  90. * 제목 생성
  91. * ===========================================================================================
  92. */
  93. makeTitle(document, FontTitle, FontTitle2 , listRowSet, request);
  94. //본문생성
  95. setBorder(border, true, true, true, true);
  96. //1행
  97. PdfPTable table11 = new PdfPTable(9);
  98. table11.setWidthPercentage(100);
  99. table11.setSpacingBefore(7f);
  100. table11.setSpacingAfter(7f);
  101. float[] table11Width = {12f,12f,3f,15f,3f,15f,3f,12f,6f};
  102. table11.setWidths(table11Width);
  103. // 1행
  104. PT_addCell(table11, new String [] { "계 약 번 호" }, FontTitle, border,
  105. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  106. PT_addCell(table11, listRowSet.get("CON_DOC_NO"), FontTitle, border,
  107. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 25f ,false);
  108. PT_addCell(table11, new String [] { "작 성 일 자" }, FontTitle, border,
  109. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 25f ,false);
  110. PT_addCell(table11, listRowSet.get("ACMP_DATE"), FontTitle, border,
  111. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 25f,false);
  112. //2019.08.29 주석
  113. //PT_addCell(table11, new String [] { "주 관 부 서" }, FontTitle, border,
  114. // Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  115. //PT_addCell(table11,listRowSet.get("DEPART_DEPT_NM"), FontTitle, border,
  116. // Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 25f ,false);
  117. //PT_addCell(table11, new String [] { "협 조 부 서" }, FontTitle, border,
  118. // Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 25f ,false);
  119. //PT_addCell(table11, listRowSet.get("ACC_DEPT_NM"), FontTitle, border,
  120. // Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 25f,false);
  121. /* PT_addCell(table11, new String [] { "구매부 외주팀" }, FontTitle, border,
  122. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 25f,false);
  123. */
  124. PT_addCell(table11, new String [] { "PROJECT 명" }, FontTitle, border,
  125. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  126. PT_addCell(table11, listRowSet.get("DEPT_NAME"), FontTitle, border,
  127. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 25f ,false);
  128. PT_addCell(table11, new String [] { "투 자 코 드" }, FontTitle, border,
  129. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 25f ,false);
  130. PT_addCell(table11, listRowSet.get("CONCD"), FontTitle, border,
  131. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 25f,false);
  132. PT_addCell(table11, new String [] { "계 약 명 " }, FontTitle, border,
  133. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  134. PT_addCell(table11, listRowSet.get("BUILD_NAME"), FontTitle, border,
  135. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 8, 25f ,false);
  136. PT_addCell(table11, new String [] { "공사비 내역\n(부가세 별도)" }, FontTitle, border,
  137. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 275f ,false);
  138. PdfPTable table21 = new PdfPTable(8);
  139. float[] table21Width = {13f,3f,14f,3f,14f,3f,14f,12f};
  140. table21.setWidths(table21Width);
  141. PdfPCell permission = new PdfPCell(table21);
  142. PT_addCell(table21, new String [] { "구 분" }, FontTitle, border,
  143. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  144. PT_addCell(table21, new String [] { "과 세" }, FontTitle, border,
  145. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 25f ,false);
  146. PT_addCell(table21, new String [] { "면 세" }, FontTitle, border,
  147. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 25f ,false);
  148. PT_addCell(table21, new String [] { "합 계" }, FontTitle, border,
  149. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 3, 25f ,false);
  150. PT_addCell(table21, new String [] { "총 공 사 비" }, FontTitle, border,
  151. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  152. setBorder(border, true, false, true, true);
  153. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  154. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  155. setBorder(border, false, true, true, true);
  156. PT_addCell(table21, listRowSet.get("CON_SUPPLY_TAMT"), FontTitle3, border,
  157. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  158. setBorder(border, true, false, true, true);
  159. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  160. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  161. setBorder(border, false, true, true, true);
  162. PT_addCell(table21, listRowSet.get("CON_SUPPLY_NAMT"), FontTitle3, border,
  163. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  164. setBorder(border, true, false, true, true);
  165. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  166. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  167. setBorder(border, false, false, true, true);
  168. PT_addCell(table21, listRowSet.get("CON_SUPPLY_AMT"), FontTitle3, border,
  169. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  170. setBorder(border, false, true, true, true);
  171. PT_addCell(table21, new String [] { " " }, FontTitle3, border,
  172. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  173. PT_addCell(table21, new String [] { "전회까지 기성고" }, FontTitle, border,
  174. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  175. setBorder(border, true, false, true, true);
  176. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  177. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  178. setBorder(border, false, true, true, true);
  179. PT_addCell(table21, listRowSet.get("PRE_FUND_TAMT"), FontTitle3, border,
  180. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  181. setBorder(border, true, false, true, true);
  182. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  183. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  184. setBorder(border, false, true, true, true);
  185. PT_addCell(table21, listRowSet.get("PRE_FUND_NAMT"), FontTitle3, border,
  186. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  187. setBorder(border, true, false, true, true);
  188. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  189. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  190. setBorder(border, false, false, true, true);
  191. PT_addCell(table21, listRowSet.get("PRE_FUND_AMT"), FontTitle3, border,
  192. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  193. setBorder(border, false, true, true, true);
  194. PT_addCell(table21, listRowSet.get("PRE_FUND_RATE"), FontTitle3, border,
  195. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  196. PT_addCell(table21, new String [] { "금 회 기 성 고" }, FontTitle, border,
  197. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  198. setBorder(border, true, false, true, true);
  199. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  200. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  201. setBorder(border, false, true, true, true);
  202. PT_addCell(table21, listRowSet.get("FUND_TAMT"), FontTitle3, border,
  203. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  204. setBorder(border, true, false, true, true);
  205. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  206. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  207. setBorder(border, false, true, true, true);
  208. PT_addCell(table21, listRowSet.get("FUND_NAMT"), FontTitle3, border,
  209. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  210. setBorder(border, true, false, true, true);
  211. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  212. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  213. setBorder(border, false, false, true, true);
  214. PT_addCell(table21, listRowSet.get("FUND_AMT"), FontTitle3, border,
  215. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  216. setBorder(border, false, true, true, true);
  217. PT_addCell(table21, listRowSet.get("FUND_RATE"), FontTitle3, border,
  218. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  219. PT_addCell(table21, new String [] { "미 성 고" }, FontTitle, border,
  220. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  221. setBorder(border, true, false, true, true);
  222. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  223. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  224. setBorder(border, false, true, true, true);
  225. PT_addCell(table21, listRowSet.get("RES_FUND_TAMT"), FontTitle3, border,
  226. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  227. setBorder(border, true, false, true, true);
  228. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  229. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  230. setBorder(border, false, true, true, true);
  231. PT_addCell(table21, listRowSet.get("RES_FUND_NAMT"), FontTitle3, border,
  232. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  233. setBorder(border, true, false, true, true);
  234. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  235. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  236. setBorder(border, false, false, true, true);
  237. PT_addCell(table21, listRowSet.get("RES_FUND_AMT"), FontTitle3, border,
  238. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  239. setBorder(border, false, true, true, true);
  240. PT_addCell(table21, listRowSet.get("RES_FUND_RATE"), FontTitle3, border,
  241. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  242. PT_addCell(table21, new String [] { "기 지 불 액" }, FontTitle, border,
  243. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  244. setBorder(border, true, false, true, true);
  245. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  246. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  247. setBorder(border, false, true, true, true);
  248. PT_addCell(table21, listRowSet.get("PRE_PAYED_TAMT"), FontTitle3, border,
  249. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  250. setBorder(border, true, false, true, true);
  251. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  252. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  253. setBorder(border, false, true, true, true);
  254. PT_addCell(table21, listRowSet.get("PRE_PAYED_NAMT"), FontTitle3, border,
  255. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  256. setBorder(border, true, false, true, true);
  257. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  258. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  259. setBorder(border, false, false, true, true);
  260. PT_addCell(table21, listRowSet.get("PRE_PAYED_AMT"), FontTitle3, border,
  261. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  262. setBorder(border, false, true, true, true);
  263. PT_addCell(table21, listRowSet.get("PRE_PAYED_RATE"), FontTitle3, border,
  264. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  265. PT_addCell(table21, new String [] { "금 회 청 구 액" }, FontTitle, border,
  266. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  267. setBorder(border, true, false, true, true);
  268. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  269. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  270. setBorder(border, false, true, true, true);
  271. PT_addCell(table21, listRowSet.get("REQU_TAMT"), FontTitle3, border,
  272. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  273. setBorder(border, true, false, true, true);
  274. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  275. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  276. setBorder(border, false, true, true, true);
  277. PT_addCell(table21, listRowSet.get("REQU_NAMT"), FontTitle3, border,
  278. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  279. setBorder(border, true, false, true, true);
  280. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  281. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  282. setBorder(border, false, false, true, true);
  283. PT_addCell(table21, listRowSet.get("REQU_AMT"), FontTitle3, border,
  284. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  285. setBorder(border, false, true, true, true);
  286. PT_addCell(table21, listRowSet.get("REQU_RATE"), FontTitle3, border,
  287. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  288. PT_addCell(table21, new String [] { "잔 액" }, FontTitle, border,
  289. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  290. setBorder(border, true, false, true, true);
  291. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  292. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  293. setBorder(border, false, true, true, true);
  294. PT_addCell(table21, listRowSet.get("RES_REQU_TAMT"), FontTitle3, border,
  295. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  296. setBorder(border, true, false, true, true);
  297. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  298. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  299. setBorder(border, false, true, true, true);
  300. PT_addCell(table21, listRowSet.get("RES_REQU_NAMT"), FontTitle3, border,
  301. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  302. setBorder(border, true, false, true, true);
  303. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  304. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  305. setBorder(border, false, false, true, true);
  306. PT_addCell(table21, listRowSet.get("RES_REQU_AMT"), FontTitle3, border,
  307. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  308. setBorder(border, false, true, true, true);
  309. PT_addCell(table21, listRowSet.get("RES_REQU_RATE"), FontTitle3, border,
  310. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  311. PT_addCell(table21, new String [] { "선 급 금" }, FontTitle, border,
  312. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  313. setBorder(border, true, false, true, true);
  314. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  315. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  316. setBorder(border, false, true, true, true);
  317. PT_addCell(table21, listRowSet.get("PREPAY_SUPPLY_TAMT"), FontTitle3, border,
  318. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  319. setBorder(border, true, false, true, true);
  320. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  321. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  322. setBorder(border, false, true, true, true);
  323. PT_addCell(table21, listRowSet.get("PREPAY_SUPPLY_NAMT"), FontTitle3, border,
  324. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  325. setBorder(border, true, false, true, true);
  326. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  327. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  328. setBorder(border, false, false, true, true);
  329. PT_addCell(table21, listRowSet.get("PREPAY_SUPPLY_AMT"), FontTitle3, border,
  330. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  331. setBorder(border, false, true, true, true);
  332. PT_addCell(table21, listRowSet.get("PREPAY_SUPPLY_RATE"), FontTitle3, border,
  333. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  334. PT_addCell(table21, new String [] { "선 급 금\n전 회 공 제" }, FontTitle, border,
  335. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  336. setBorder(border, true, false, true, true);
  337. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  338. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  339. setBorder(border, false, true, true, true);
  340. PT_addCell(table21, listRowSet.get("PRE_PAY_DEDUCT_TAMT"), FontTitle3, border,
  341. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  342. setBorder(border, true, false, true, true);
  343. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  344. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  345. setBorder(border, false, true, true, true);
  346. PT_addCell(table21, listRowSet.get("PRE_PAY_DEDUCT_NAMT"), FontTitle3, border,
  347. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  348. setBorder(border, true, false, true, true);
  349. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  350. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  351. setBorder(border, false, false, true, true);
  352. PT_addCell(table21, listRowSet.get("PRE_PAY_DEDUCT_AMT"), FontTitle3, border,
  353. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  354. setBorder(border, false, true, true, true);
  355. PT_addCell(table21, listRowSet.get("PRE_PAY_DEDUCT_RATE"), FontTitle3, border,
  356. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  357. PT_addCell(table21, new String [] { "선 급 금\n금 회 공 제" }, FontTitle, border,
  358. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  359. setBorder(border, true, false, true, true);
  360. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  361. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  362. setBorder(border, false, true, true, true);
  363. PT_addCell(table21, listRowSet.get("PAY_DEDUCT_TAMT"), FontTitle3, border,
  364. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  365. setBorder(border, true, false, true, true);
  366. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  367. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  368. setBorder(border, false, true, true, true);
  369. PT_addCell(table21, listRowSet.get("PAY_DEDUCT_NAMT"), FontTitle3, border,
  370. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  371. setBorder(border, true, false, true, true);
  372. PT_addCell(table21, listRowSet.get("CON_P"), FontTitle3, border,
  373. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f,false);
  374. setBorder(border, false, false, true, true);
  375. PT_addCell(table21, listRowSet.get("PAY_DEDUCT_AMT"), FontTitle3, border,
  376. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  377. setBorder(border, false, true, true, true);
  378. PT_addCell(table21, listRowSet.get("PAY_DEDUCT_RATE"), FontTitle3, border,
  379. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f,false);
  380. permission.setColspan(8);
  381. table11.addCell(permission);
  382. setBorder(border, true, false, true, false);
  383. PT_addCell(table11, new String [] { "위와 같이 기성검사 내역을 보고 합니다." }, FontTitle, border,
  384. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 8, 25f,false);
  385. setBorder(border, false, true, true, false);
  386. PT_addCell(table11, new String [] { " " }, FontTitle, border,
  387. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 25f,false);
  388. setBorder(border, true, false, false, false);
  389. PT_addCell(table11, listRowSet.get("ACMP_DATE").substring(0, 4) + "년 " + listRowSet.get("ACMP_DATE").substring(5, 7) + "월" + listRowSet.get("ACMP_DATE").substring(8, 10) + "일 ", FontTitle, border,
  390. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 8, 25f,false);
  391. setBorder(border, false, true, false, true);
  392. PT_addCell(table11, new String [] { " " }, FontTitle, border,
  393. Element.ALIGN_RIGHT, Element.ALIGN_MIDDLE, 1, 25f,false);
  394. setBorder(border, true, true, true, true);
  395. PT_addCell(table11, new String [] { "공 사 업 체" }, FontTitle, border,
  396. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  397. setBorder(border, true, false, true, true);
  398. PT_addCell(table11, new String [] { "(업체명)" }, FontTitle, border,
  399. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  400. setBorder(border, false, false, true, true);
  401. PT_addCell(table11, listRowSet.get("CORP_KOR"), FontTitle, border,
  402. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 25f ,false);
  403. setBorder(border, false, false, true, true);
  404. PT_addCell(table11, new String [] { "(대표자명)" }, FontTitle, border,
  405. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  406. setBorder(border, false, false, true, true);
  407. PT_addCell(table11, listRowSet.get("REP_NAME"), FontTitle, border,
  408. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 25f ,false);
  409. setBorder(border, false, true, true, true);
  410. PT_addCell(table11, new String [] { " " }, FontTitle, border,
  411. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  412. setBorder(border, true, true, true, true);
  413. PT_addCell(table11, new String [] { "검 사 인" }, FontTitle, border,
  414. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  415. setBorder(border, true, false, true, true);
  416. PT_addCell(table11, new String [] { "(소 속)" }, FontTitle, border,
  417. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  418. setBorder(border, false, false, true, true);
  419. PT_addCell(table11, listRowSet.get("CHECK_COMP"), FontTitle, border,
  420. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 25f ,false);
  421. setBorder(border, false, false, true, true);
  422. PT_addCell(table11, new String [] { "(성 명)" }, FontTitle, border,
  423. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  424. setBorder(border, false, false, true, true);
  425. PT_addCell(table11, listRowSet.get("CHECK_MAN"), FontTitle, border,
  426. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 25f ,false);
  427. setBorder(border, false, true, true, true);
  428. PT_addCell(table11, new String [] { "" }, FontTitle1, border,
  429. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f ,false);
  430. setBorder(border, true, true, true, true);
  431. PT_addCell(table11, new String [] { "입 회 인" }, FontTitle, border,
  432. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  433. setBorder(border, true, false, true, true);
  434. PT_addCell(table11, new String [] { "(소 속)" }, FontTitle, border,
  435. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  436. setBorder(border, false, false, true, true);
  437. PT_addCell(table11, listRowSet.get("ATTEN_COMP"), FontTitle, border,
  438. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 3, 25f ,false);
  439. setBorder(border, false, false, true, true);
  440. PT_addCell(table11, new String [] { "(성 명)" }, FontTitle, border,
  441. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  442. setBorder(border, false, false, true, true);
  443. PT_addCell(table11, listRowSet.get("ATTEN_MAN"), FontTitle, border,
  444. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 25f ,false);
  445. setBorder(border, false, true, true, true);
  446. PT_addCell(table11, new String [] { "" }, FontTitle1, border,
  447. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f ,false);
  448. setBorder(border, true, true, true, true);
  449. PT_addCell(table11, new String [] { "세금계산서\n발행방법" }, FontTitle, border,
  450. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 35f ,false);
  451. PdfPTable table41 = new PdfPTable(3);
  452. float[] table41Width = {35f,35f,35f};
  453. table41.setWidths(table41Width);
  454. PdfPCell permission3 = new PdfPCell(table41);
  455. String check1 = "";
  456. String check2 = "";
  457. String check3 = "";
  458. check1 = (listRowSet.get("TAX_METHOD_CD").equals("1")?"●":"○")+" 역발행(SGC이앤씨 발행)";
  459. check2 = (listRowSet.get("TAX_METHOD_CD").equals("2")?"●":"○")+" 순발행(업체 직접 발행)";
  460. check3 = (listRowSet.get("TAX_METHOD_CD").equals("3")?"●":"○")+" Invoice";
  461. setBorder(border, true, false, true, false);
  462. PT_addCell(table41, check1 , FontTitle, border,
  463. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  464. setBorder(border, false, false, true, false);
  465. PT_addCell(table41, check2, FontTitle, border,
  466. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  467. setBorder(border, false, true, true, false);
  468. PT_addCell(table41, check3, FontTitle, border,
  469. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 25f ,false);
  470. setBorder(border, true, true, true, true);
  471. permission3.setColspan(8);
  472. table11.addCell(permission3);
  473. PT_addCell(table11, new String [] { "특 기 사 항" }, FontTitle, border,
  474. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 140f ,false);
  475. PT_addCell(table11, listRowSet.get("ACMP_REMARK"), FontTitle, border,
  476. Element.ALIGN_LEFT, Element.ALIGN_TOP, 8, 140f ,false);
  477. PT_addCell(table11, new String [] { "첨 부 서 류" }, FontTitle, border,
  478. Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 1, 75f ,false);
  479. PdfPTable table31 = new PdfPTable(3);
  480. float[] table31Width = {25f,25f,25f};
  481. table31.setWidths(table31Width);
  482. PdfPCell permission2 = new PdfPCell(table31);
  483. setBorder(border, true, false, true, false);
  484. PT_addCell(table31, rowSet.getRow(0).get("DOC_NM") , FontTitle, border,
  485. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f ,false);
  486. setBorder(border, false, false, true, false);
  487. PT_addCell(table31, rowSet.getRow(1).get("DOC_NM"), FontTitle, border,
  488. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f ,false);
  489. setBorder(border, false, true, true, false);
  490. PT_addCell(table31, rowSet.getRow(2).get("DOC_NM"), FontTitle, border,
  491. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f ,false);
  492. setBorder(border, true, false, false, false);
  493. PT_addCell(table31, rowSet.getRow(3).get("DOC_NM"), FontTitle, border,
  494. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f ,false);
  495. setBorder(border, false, false, false, false);
  496. PT_addCell(table31, rowSet.getRow(4).get("DOC_NM"), FontTitle, border,
  497. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f ,false);
  498. setBorder(border, false, true, false, false);
  499. PT_addCell(table31, rowSet.getRow(5).get("DOC_NM"), FontTitle, border,
  500. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f ,false);
  501. setBorder(border, true, false, false, false);
  502. PT_addCell(table31, rowSet.getRow(6).get("DOC_NM"), FontTitle, border,
  503. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f ,false);
  504. setBorder(border, false, false, false, false);
  505. PT_addCell(table31, rowSet.getRow(7).get("DOC_NM"), FontTitle, border,
  506. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f ,false);
  507. setBorder(border, false, true, false, false);
  508. PT_addCell(table31, rowSet.getRow(8).get("DOC_NM"), FontTitle, border,
  509. Element.ALIGN_LEFT, Element.ALIGN_MIDDLE, 1, 25f ,false);
  510. setBorder(border, true, true, true, true);
  511. permission2.setColspan(8);
  512. table11.addCell(permission2);
  513. document.add(table11);
  514. } catch (DocumentException de) {
  515. WAFLogger.debug("de.getMessage() = " + de.getMessage());
  516. } catch (IOException ioe) {
  517. WAFLogger.debug("ioe.getMessage() = " + ioe.getMessage());
  518. } catch (Exception e) {
  519. WAFLogger.debug("[Exception] ... " + e);
  520. }
  521. // step 5
  522. document.close();
  523. WAFLogger.debug("\n\t #################### "+ strFileName +" 생성완료 SACDOCreatePDF8");
  524. }
  525. /*
  526. * ===========================================================================================
  527. * A. 타이틀
  528. * ===========================================================================================
  529. */
  530. private static void makeTitle(Document document, Font FontTitle,
  531. Font FontTitle2, ValueObject listRowSet, HttpServletRequest request) throws Exception {
  532. PdfPTable tbl_Title = new PdfPTable(2);
  533. tbl_Title.setWidthPercentage(40f);
  534. float[] tbl_TitleWidths = {10f,10f};
  535. tbl_Title.setWidths(tbl_TitleWidths);
  536. PdfPCell title= new PdfPCell(new Paragraph("기성 검사 보고서", FontTitle2));
  537. title.setColspan(2);
  538. title.setHorizontalAlignment(Element.ALIGN_CENTER);
  539. title.setVerticalAlignment(Element.ALIGN_MIDDLE);
  540. title.setFixedHeight(40f);
  541. title.setBorder(0);
  542. title.setBorderWidthBottom(1);
  543. tbl_Title.addCell(title);
  544. PdfPCell titleB = new PdfPCell(new Paragraph("( 제 " + listRowSet.get("ACMP_NUMBER") + " 회 )", FontTitle));
  545. titleB.setColspan(2);
  546. titleB.setFixedHeight(30f);
  547. titleB.setBorder(0);
  548. titleB.setHorizontalAlignment(1);
  549. titleB.setVerticalAlignment(5);
  550. tbl_Title.addCell(titleB);
  551. //PT_addCell(tbl_Title, "대 금 지 급", FontTitle2, borderTemp,
  552. // Element.ALIGN_CENTER, Element.ALIGN_MIDDLE, 2, 28f, false);
  553. document.add(tbl_Title);
  554. Image img = null;
  555. if(request == null)
  556. {
  557. //img = Image.getInstance(new URL("http://edreams21.co.kr/img/invoice/Title_bg1.gif"));
  558. }
  559. else
  560. {
  561. //img = Image.getInstance(new URL(request.getScheme(), request.getServerName(), request.getServerPort(), "/img/invoice/Title_bg1.gif"));
  562. }
  563. // img.scaleToFit(300f, 40f);
  564. // img.setAbsolutePosition(310, 554);
  565. // img.setAbsolutePosition(203, 246);
  566. // img.setAbsolutePosition(180, 310);
  567. // document.add(img);
  568. }
  569. /*
  570. * ===========================================================================================
  571. * B. 데이터 입력
  572. * ===========================================================================================
  573. */
  574. /*
  575. * ===========================================================================================
  576. * 기타
  577. * ===========================================================================================
  578. */
  579. // PdfPCell을 리턴하자
  580. private static PdfPCell PC_addCell(String strText, Font FontTitle,
  581. Rectangle border, int HA, int VA, int CS) {
  582. // 추가할 Cell 생성
  583. PdfPCell cell = new PdfPCell(new Paragraph(strText, FontTitle));
  584. // PdfPCell cell = new PdfPCell(new Paragraph(strText));
  585. // Cell Border 설정
  586. // setBorder(cell, blnLEFT, blnRIGHT, blnTOP, blnBOTTOM);
  587. cell.cloneNonPositionParameters(border);
  588. // 가로/세로 정렬
  589. cell.setHorizontalAlignment(HA);
  590. cell.setVerticalAlignment(VA);
  591. // setColspan
  592. if (CS > 1)
  593. cell.setColspan(CS);
  594. // cell.setPadding(0);
  595. if( isGray )
  596. cell.setGrayFill(0.8f);
  597. //if( LineisGray )
  598. // cell.setGrayFill(0.9f);
  599. //cell.setBackgroundColor(arg0)
  600. return cell;
  601. }
  602. // Cell Border 설정
  603. private static void setBorder(Rectangle border, boolean blnLEFT,
  604. boolean blnRIGHT, boolean blnTOP, boolean blnBOTTOM) {
  605. border.setBorderColor(borderColor);
  606. if (blnLEFT) {
  607. border.setBorderWidthLeft(BorderW);
  608. } else {
  609. border.setBorderWidthLeft(0);
  610. }
  611. if (blnRIGHT) {
  612. border.setBorderWidthRight(BorderW);
  613. } else {
  614. border.setBorderWidthRight(0);
  615. }
  616. if (blnTOP) {
  617. border.setBorderWidthTop(BorderW);
  618. } else {
  619. border.setBorderWidthTop(0);
  620. }
  621. if (blnBOTTOM) {
  622. border.setBorderWidthBottom(BorderW);
  623. } else {
  624. border.setBorderWidthBottom(0);
  625. }
  626. }
  627. // PdfPTable에 Cell 을 추가하자
  628. private static void PT_addCell(PdfPTable table, String[] arrText,
  629. Font FontTitle, Rectangle border, int HA, int VA, int CS) {
  630. for (int i = 0; i < arrText.length; i++) {
  631. PT_addCell(table, arrText[i], FontTitle, border, HA, VA, CS);
  632. }
  633. }
  634. private static void PT_addCell(PdfPTable table, String[] arrText,
  635. Font FontTitle, Rectangle border, int HA, int VA, int CS, float RH, boolean CL) {
  636. for (int i = 0; i < arrText.length; i++) {
  637. PT_addCell(table, arrText[i], FontTitle, border, HA, VA, CS, RH, CL);
  638. }
  639. }
  640. private static void PT_addCell(PdfPTable table, String strText,
  641. Font FontTitle, Rectangle border, int HA, int VA, int CS) {
  642. // 추가할 Cell 생성
  643. PdfPCell cell = PC_addCell(strText, FontTitle, border, HA, VA, CS);
  644. table.addCell(cell);
  645. }
  646. // PdfPTable에 Cell 을 추가하자(행높이 추가)
  647. private static void PT_addCell(PdfPTable table, String strText,
  648. Font FontTitle, Rectangle border, int HA, int VA, int CS, float RH, boolean CL) {
  649. // 추가할 Cell 생성
  650. PdfPCell cell = PC_addCell(strText, FontTitle, border, HA, VA, CS);
  651. // 셀 높이
  652. if (RH > 0)
  653. cell.setFixedHeight(RH);
  654. if (CL) {
  655. cell.setBackgroundColor(Color.lightGray);
  656. } else {
  657. cell.setBackgroundColor(Color.white);
  658. }
  659. table.addCell(cell);
  660. }
  661. public ValueObject getPayReqList1(Connection con, String tmpslipID, String subContModId ){
  662. Persistent persistent_c = null;
  663. Search search = new SearchImpl();
  664. ValueObject vo = null;
  665. RowSet rowSet = new RowSetImpl();
  666. StringBuffer sql = new StringBuffer();
  667. try{
  668. persistent_c = new PersistentImpl(con);
  669. sql.append(" SELECT A.ACMP_NO \n");
  670. sql.append(" , B.CON_DOC_NO \n");
  671. sql.append(" , TO_CHAR(to_date(A.TAX_DY, 'YYYY.MM.DD'),'YYYY.MM.DD') ACMP_DATE \n");
  672. sql.append(" , B.DEPT_NAME \n");
  673. sql.append(" , A.DEPT_CD \n");
  674. sql.append(" , B.BUILD_NAME \n");
  675. sql.append(" , F_GET_D_CURRENCY(NVL(B.CON_SUPPLY_AMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) AS CON_SUPPLY_AMT \n");
  676. sql.append(" , F_GET_D_CURRENCY(NVL(B.CON_SUPPLY_TAMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) AS CON_SUPPLY_TAMT \n");
  677. sql.append(" , F_GET_D_CURRENCY(NVL(B.CON_SUPPLY_NAMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) AS CON_SUPPLY_NAMT \n");
  678. sql.append(" , F_GET_D_CURRENCY(NVL(A.PRE_FUND_AMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) PRE_FUND_AMT \n");
  679. sql.append(" , F_GET_D_CURRENCY(NVL(A.PRE_FUND_TAMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) PRE_FUND_TAMT \n");
  680. sql.append(" , F_GET_D_CURRENCY(NVL(A.PRE_FUND_NAMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) PRE_FUND_NAMT \n");
  681. sql.append(" , F_GET_D_CURRENCY(NVL(A.FUND_AMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) FUND_AMT \n");
  682. sql.append(" , F_GET_D_CURRENCY(NVL(A.FUND_TAMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) FUND_TAMT \n");
  683. sql.append(" , F_GET_D_CURRENCY(NVL(A.FUND_NAMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) FUND_NAMT \n");
  684. sql.append(" , F_GET_D_CURRENCY(NVL( (B.CON_SUPPLY_AMT - A.TOT_FUND_AMT), 0 ), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) RES_FUND_AMT \n");
  685. sql.append(" , F_GET_D_CURRENCY(NVL( (B.CON_SUPPLY_TAMT - A.TOT_FUND_TAMT), 0 ) , F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) RES_FUND_TAMT \n");
  686. sql.append(" , F_GET_D_CURRENCY(NVL( (B.CON_SUPPLY_NAMT - A.TOT_FUND_NAMT), 0 ) , F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) RES_FUND_NAMT \n");
  687. sql.append(" , F_GET_D_CURRENCY(NVL((A.PRE_REQU_SUPPLY_TAMT + NVL( (SELECT SUM(REQ_PREPAY_SUPPLY_TAMT) SUPPLY_AMT --2015.10.5 \n");
  688. sql.append(" FROM SUB1030T B \n");//2016.7.5 중복제거 SUB1050T C, SAC01001 D
  689. sql.append(" WHERE DECODE(B.CONVERSION_YN, 'Y', '10', B.STATUS_CD) >= '10' \n");
  690. sql.append(" AND A.SUB_CONT_ID = B.SUB_CONT_ID) , 0 )), 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) PRE_PAYED_TAMT \n");
  691. sql.append(" , F_GET_D_CURRENCY(NVL((A.PRE_REQU_SUPPLY_NAMT + NVL( (SELECT SUM(REQ_PREPAY_SUPPLY_NAMT) SUPPLY_AMT --2015.10.5 \n");
  692. sql.append(" FROM SUB1030T B \n");
  693. sql.append(" WHERE DECODE(B.CONVERSION_YN, 'Y', '10', B.STATUS_CD) >= '10' \n");
  694. sql.append(" AND A.SUB_CONT_ID = B.SUB_CONT_ID) , 0 )), 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) PRE_PAYED_NAMT \n");
  695. sql.append(" , F_GET_D_CURRENCY(NVL((A.PRE_REQU_SUPPLY_AMT + NVL( (SELECT SUM(REQ_PREPAY_SUPPLY_AMT) SUPPLY_AMT --2015.10.5 \n");
  696. sql.append(" FROM SUB1030T B \n");
  697. sql.append(" WHERE DECODE(B.CONVERSION_YN, 'Y', '10', B.STATUS_CD) >= '10' \n");
  698. sql.append(" AND A.SUB_CONT_ID = B.SUB_CONT_ID) , 0 )), 0) \n");
  699. sql.append(" , F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) PRE_PAYED_AMT \n");
  700. sql.append(" , F_GET_D_CURRENCY(NVL(A.REQU_SUPPLY_AMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) REQU_AMT \n");
  701. sql.append(" , F_GET_D_CURRENCY(NVL( (A.REQU_SUPPLY_TAMT), 0 ), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) REQU_TAMT \n");
  702. sql.append(" , F_GET_D_CURRENCY(NVL(A.REQU_SUPPLY_NAMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) REQU_NAMT \n");
  703. sql.append(" , F_GET_D_CURRENCY(NVL( (B.CON_SUPPLY_AMT - (A.TOT_REQU_SUPPLY_AMT + NVL( (SELECT SUM(REQ_PREPAY_SUPPLY_AMT) SUPPLY_AMT --2015.10.5 \n");
  704. sql.append(" FROM SUB1030T B \n");
  705. sql.append(" WHERE DECODE(B.CONVERSION_YN, 'Y', '10', B.STATUS_CD) >= '10' \n");
  706. sql.append(" AND A.SUB_CONT_ID = B.SUB_CONT_ID) , 0 )) ) , 0 ), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) RES_REQU_AMT \n");
  707. sql.append(" , F_GET_D_CURRENCY(NVL( (B.CON_SUPPLY_TAMT - (A.TOT_REQU_SUPPLY_TAMT + NVL( (SELECT SUM(REQ_PREPAY_SUPPLY_TAMT) SUPPLY_AMT --2015.10.5 \n");
  708. sql.append(" FROM SUB1030T B \n");
  709. sql.append(" WHERE DECODE(B.CONVERSION_YN, 'Y', '10', B.STATUS_CD) >= '10' \n");
  710. sql.append(" AND A.SUB_CONT_ID = B.SUB_CONT_ID) , 0 )) ), 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) RES_REQU_TAMT \n");
  711. sql.append(" , F_GET_D_CURRENCY(NVL( (B.CON_SUPPLY_NAMT - (A.TOT_REQU_SUPPLY_NAMT + NVL( (SELECT SUM(REQ_PREPAY_SUPPLY_NAMT) SUPPLY_AMT --2015.10.5 \n");
  712. sql.append(" FROM SUB1030T B \n");
  713. sql.append(" WHERE DECODE(B.CONVERSION_YN, 'Y', '10', B.STATUS_CD) >= '10' \n");
  714. sql.append(" AND A.SUB_CONT_ID = B.SUB_CONT_ID) , 0 )) ), 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) RES_REQU_NAMT \n");
  715. sql.append(" , A.CHECK_COMP \n");
  716. sql.append(" , A.CHECK_MAN \n");
  717. sql.append(" , A.CHECK_TEL \n");
  718. sql.append(" , A.ATTEN_COMP \n");
  719. sql.append(" , A.ATTEN_MAN \n");
  720. sql.append(" , A.ATTEN_TEL \n");
  721. sql.append(" , SUBSTR(C.CORP_KOR,1) AS CORP_KOR \n");
  722. sql.append(" , F.REP_NAME as REP_NAME \n");
  723. sql.append(" , A.ACMP_REMARK \n");
  724. sql.append(" , '( ' || ROUND( (A.REQU_SUPPLY_AMT/B.CON_SUPPLY_AMT) *100 , 2) || '% )' REQU_RATE \n");
  725. sql.append(" , '( ' || ROUND( (A.PRE_FUND_AMT/B.CON_SUPPLY_AMT)*100,2) || '% )' PRE_FUND_RATE \n");
  726. sql.append(" , '( ' || ROUND( (A.FUND_AMT/B.CON_SUPPLY_AMT)*100,2) || '% )' FUND_RATE \n");
  727. sql.append(" , '( ' || ROUND( ( (B.CON_SUPPLY_AMT - A.TOT_FUND_AMT) / B.CON_SUPPLY_AMT ) * 100 , 2) || '% )' RES_FUND_RATE \n");
  728. sql.append(" , '( ' || ROUND( NVL( ( ((A.PRE_REQU_SUPPLY_AMT + NVL( (SELECT SUM(REQ_PREPAY_SUPPLY_AMT) SUPPLY_AMT --2015.10.5 \n");
  729. sql.append(" FROM SUB1030T B \n");
  730. sql.append(" WHERE DECODE(B.CONVERSION_YN, 'Y', '10', B.STATUS_CD) >= '10' \n");
  731. sql.append(" AND A.SUB_CONT_ID = B.SUB_CONT_ID) , 0 )) ) / B.CON_SUPPLY_AMT) * 100, 0), 2) || '% )' PRE_PAYED_RATE \n");
  732. sql.append(" , '( ' || ROUND( NVL( (((B.CON_SUPPLY_AMT - (A.TOT_REQU_SUPPLY_AMT + NVL( (SELECT SUM(REQ_PREPAY_SUPPLY_AMT) SUPPLY_AMT --2015.10.5 \n");
  733. sql.append(" FROM SUB1030T B \n");
  734. sql.append(" WHERE DECODE(B.CONVERSION_YN, 'Y', '10', B.STATUS_CD) >= '10' \n");
  735. sql.append(" AND A.SUB_CONT_ID = B.SUB_CONT_ID) , 0 ))) / B.CON_SUPPLY_AMT) * 100) , 0 ), 2) || '% )' RES_REQU_RATE \n");
  736. sql.append(" , D.DEPART_DEPT_NM \n");
  737. sql.append(" , A.ACMP_NO ACMP_NUMBER \n");
  738. sql.append(" , (SELECT CHG_CODE09 FROM EBID_COM911T WHERE BASECD = '911' AND DETAILCD = A.CON_CUR_CD ) AS CON_P \n");
  739. sql.append(" , '' AS CONCD \n");
  740. sql.append(" , (SELECT DEPART_DEPT_NM FROM PUB0120T WHERE ACCT_ID = B.CON_CHARGE_ID ) ACC_DEPT_NM \n");
  741. sql.append(" , F_GET_D_CURRENCY(NVL(H.PREPAY_SUPPLY_AMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) AS PREPAY_SUPPLY_AMT \n");
  742. sql.append(" , F_GET_D_CURRENCY(NVL(H.PREPAY_SUPPLY_TAMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) AS PREPAY_SUPPLY_TAMT \n");
  743. sql.append(" , F_GET_D_CURRENCY(NVL(H.PREPAY_SUPPLY_NAMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) AS PREPAY_SUPPLY_NAMT \n");
  744. sql.append(" , F_GET_D_CURRENCY(NVL(A.PRE_PAY_DEDUCT_AMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) AS PRE_PAY_DEDUCT_AMT \n");
  745. sql.append(" , F_GET_D_CURRENCY(NVL(A.PRE_PAY_DEDUCT_TAMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) AS PRE_PAY_DEDUCT_TAMT \n");
  746. sql.append(" , F_GET_D_CURRENCY(NVL(A.PRE_PAY_DEDUCT_NAMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) AS PRE_PAY_DEDUCT_NAMT \n");
  747. sql.append(" , F_GET_D_CURRENCY(NVL(A.PAY_DEDUCT_AMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) AS PAY_DEDUCT_AMT \n");
  748. sql.append(" , F_GET_D_CURRENCY(NVL(A.PAY_DEDUCT_TAMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) AS PAY_DEDUCT_TAMT \n");
  749. sql.append(" , F_GET_D_CURRENCY(NVL(A.PAY_DEDUCT_NAMT, 0), F_GET_CURRENCY_DIGIT( NVL(A.CON_CUR_CD, 'KRW') ) ) AS PAY_DEDUCT_NAMT \n");
  750. sql.append(" , '' AS PREPAY_SUPPLY_RATE \n");
  751. sql.append(" , '( ' || TO_CHAR(DECODE(NVL(H.PREPAY_SUPPLY_AMT, 0),0,0,ROUND((A.PRE_PAY_DEDUCT_AMT/H.PREPAY_SUPPLY_AMT)*100,2)),'FM990.00') || '% )' AS PRE_PAY_DEDUCT_RATE \n");
  752. sql.append(" , '( ' || TO_CHAR(DECODE(NVL(H.PREPAY_SUPPLY_AMT, 0),0,0,ROUND((A.PAY_DEDUCT_AMT/H.PREPAY_SUPPLY_AMT)*100,2)),'FM990.00') || '% )' AS PAY_DEDUCT_RATE \n");
  753. sql.append(" , A.TAX_METHOD_CD \n");
  754. sql.append(" FROM SUB1040T A \n");
  755. sql.append(" ,SUB2000T B \n");
  756. sql.append(" ,SUB1020T C \n");
  757. sql.append(" ,(SELECT ACCT_ID, DEPART_DEPT_CD, DEPART_DEPT_NM FROM PUB0120T) D \n");
  758. sql.append(" ,(SELECT COUNT(*) ACMP_NUMBER, SUB_CONT_ID FROM SUB1040T GROUP BY SUB_CONT_ID) E \n");
  759. sql.append(" ,(SELECT CORP_ID, REP_NAME FROM SUB9000T_V) F \n");
  760. sql.append(" ,( \n");
  761. sql.append(" SELECT SUB_CONT_ID \n");
  762. sql.append(" ,CON_CORP_ID \n");
  763. sql.append(" ,SUM(REQ_PREPAY_SUPPLY_AMT) AS PREPAY_SUPPLY_AMT \n");
  764. sql.append(" ,SUM(REQ_PREPAY_SUPPLY_TAMT) AS PREPAY_SUPPLY_TAMT \n");
  765. sql.append(" ,SUM(REQ_PREPAY_SUPPLY_NAMT) AS PREPAY_SUPPLY_NAMT \n");
  766. sql.append(" FROM SUB1030T \n");
  767. sql.append(" WHERE STATUS_CD = '10' \n");
  768. sql.append(" AND SUB_CONT_MOD_ID <= "+subContModId+" \n");
  769. sql.append(" GROUP BY SUB_CONT_ID, CON_CORP_ID \n");
  770. sql.append(" ) H \n");
  771. sql.append(" WHERE A.SUB_CONT_ID = B.SUB_CONT_ID \n");
  772. sql.append(" AND A.MOD_NO = B.MOD_NO \n");
  773. sql.append(" AND A.CON_CORP_ID = C.CON_CORP_ID \n");
  774. sql.append(" AND B.REQ_USERID = D.ACCT_ID(+) \n");
  775. sql.append(" AND E.SUB_CONT_ID = A.SUB_CONT_ID \n");
  776. sql.append(" AND C.CORP_ID = F.CORP_ID(+) \n");
  777. sql.append(" AND C.MAIN_CORP = 'Y' \n");
  778. sql.append(" AND A.SUB_CONT_ID = H.SUB_CONT_ID(+) \n");
  779. sql.append(" AND A.ACMP_ID = '"+tmpslipID+"' \n");
  780. //search.setStatement(sql.toString());
  781. //rowSet = search.execute();
  782. System.out.println(sql.toString());
  783. persistent_c.setStatement(sql.toString());
  784. rowSet = persistent_c.query();
  785. if(rowSet.size()>0){
  786. vo = RowSetUtility.getValueObject(rowSet.getRow(0));
  787. }
  788. }catch(Exception e){
  789. WAFLogger.error("SQL : " + search.getStatement());
  790. WAFLogger.error(e);
  791. }finally{
  792. if( vo == null) vo = new ValueObject();
  793. }
  794. return vo;
  795. }
  796. public RowSet getPayReqList2(String tmpslipID ){
  797. Search search = new SearchImpl();
  798. RowSet rowSet = new RowSetImpl();
  799. StringBuffer sql = new StringBuffer();
  800. try{
  801. sql.append(" SELECT DOC_NM \n");
  802. sql.append(" FROM \n");
  803. sql.append(" ( \n");
  804. sql.append(" SELECT DECODE(NVL(B.ID,''),'','□','■') || ' ' || A.DETAILNM AS DOC_NM, ROWNUM AS RO \n");
  805. sql.append(" ,A.DETAILCD \n");
  806. sql.append(" FROM EBID_COM911T A, PUB0510T B \n");
  807. sql.append(" WHERE A.BASECD = 'SUB_ACMP_FILE' \n");
  808. sql.append(" AND A.DETAILCD = B.ID(+) \n");
  809. sql.append(" AND B.FILE_GB(+) = 'RESOLUTION_"+tmpslipID+"' \n");
  810. sql.append(" AND A.CHG_CODE01 = '10' \n");
  811. sql.append(" AND DETAILCD NOT IN ('560', '570') \n");
  812. sql.append(" ) A \n");
  813. sql.append(" , ( SELECT LEVEL AS RO2 \n");
  814. sql.append(" FROM DUAL \n");
  815. sql.append(" CONNECT BY LEVEL <= 9) B \n");
  816. sql.append(" WHERE A.RO(+) =B.RO2 \n");
  817. sql.append(" ORDER BY A.DETAILCD \n");
  818. search.setStatement(sql.toString());
  819. rowSet = search.execute();
  820. }catch(Exception e){
  821. WAFLogger.error("SQL : " + search.getStatement());
  822. WAFLogger.error(e);
  823. }finally{
  824. if( rowSet == null) rowSet = new RowSetImpl();
  825. }
  826. return rowSet;
  827. }
  828. public String getSubContModId( Connection con, String acmp_id){
  829. Persistent persistent_c = null;
  830. Search search = new SearchImpl();
  831. RowSet rowSet = new RowSetImpl();
  832. StringBuffer sql = new StringBuffer();
  833. String rtnStr = "";
  834. try {
  835. persistent_c = new PersistentImpl(con);
  836. sql.append(" SELECT A.SUB_CONT_MOD_ID \n");
  837. sql.append(" FROM SUB2000T A \n");
  838. sql.append(" ,SUB1040T C \n");
  839. sql.append(" WHERE A.SUB_CONT_ID = C.SUB_CONT_ID \n");
  840. sql.append(" AND A.MOD_NO = C.MOD_NO \n");
  841. sql.append(" AND C.ACMP_ID = "+acmp_id+" \n");
  842. persistent_c.setStatement(sql.toString());
  843. rowSet = persistent_c.query();
  844. if(rowSet.size()>0){
  845. rtnStr = rowSet.getRow(0).get("SUB_CONT_MOD_ID");
  846. }
  847. } catch(Exception e) {
  848. WAFLogger.error(this.getClass().getName() + " --> getSubContModId() : \n" + e.getMessage());
  849. WAFLogger.error("SQL : " + search.getStatement());
  850. WAFLogger.error(e);
  851. } finally {
  852. if( rtnStr == null ) rtnStr = "";
  853. }
  854. return rtnStr;
  855. }
  856. }