diff --git a/src/main/java/cokr/xit/adds/DocController.java b/src/main/java/cokr/xit/adds/DocController.java index f930437..3736f5a 100644 --- a/src/main/java/cokr/xit/adds/DocController.java +++ b/src/main/java/cokr/xit/adds/DocController.java @@ -32,15 +32,13 @@ public class DocController extends AbstractController { @Resource(name="fileService") FileService fileService; - private String sggNm = "용인시"; - @RequestMapping(value="/makeDisposeResultReportHwp.do") - public ModelAndView makeDisposeResultReportHwp(String dscMngId) { + public ModelAndView makeDisposeResultReportHwp(String dscdmngId) { ModelAndView mav = new ModelAndView(); mav.setViewName("jsonView"); - if(dscMngId == null || dscMngId.equals("")) { + if(dscdmngId == null || dscdmngId.equals("")) { return mav; } @@ -53,14 +51,11 @@ public class DocController extends AbstractController { //개인정보표시여부,기관장 등 PrintOption printOption = new PrintOption(); Map globalVariable = new HashMap(); - String gigwanjang = sggNm+"장"; - gigwanjang = spreadBySpace(gigwanjang,4); - globalVariable.put("gigwanjang", gigwanjang); printOption.setGlobalVariable(globalVariable); //상품 사진 갯수 체크 List totalProduct = fileService.getFileList( - new FileQuery().setInfoKeys(dscMngId).setInfoType("100") + new FileQuery().setInfoKeys(dscdmngId).setInfoType("100") ); int totalProductCnt = 0; if(totalProduct != null && !totalProduct.isEmpty()) { @@ -68,11 +63,11 @@ public class DocController extends AbstractController { } //샘플 데이터 생성 - List dataobjectList = this.makeSample(dscMngId,totalProductCnt); + List dataobjectList = this.makeSample(dscdmngId,totalProductCnt); for(DataObject data : dataobjectList) { - String infKey = data.string("dscMngId"); - String subType = data.string("dscMngSn"); + String infKey = data.string("dscdmngId"); + String subType = data.string("dscdmngSn"); List fileinfo = fileService.getFileList( new FileQuery().setInfoKeys(infKey).setInfoType("100").setBy("SUB_TYPE").setTerm(subType) @@ -89,7 +84,7 @@ public class DocController extends AbstractController { String resultFilePath = form.makeFile().andGetPath(); File file = new File(resultFilePath); - Relation rel = new Relation().setInfoType("200").setSubType("01").setInfoKey(dscMngId); + Relation rel = new Relation().setInfoType("200").setSubType("01").setInfoKey(dscdmngId); FileInfo fileInfo = new FileInfo.Factory().create(rel, file); fileInfo.setName(print.getFormatKorName()+".hwp"); int effected= fileService.create(fileInfo); @@ -100,30 +95,15 @@ public class DocController extends AbstractController { return mav; } - private String spreadBySpace(String str, int spaceCnt) { - String result = ""; - - String spaces = ""; - for(int i=1; i<=spaceCnt; i++) { - spaces += " "; - } - - char[] charArr = str.toCharArray(); - result += Character.toString(charArr[0]); - for(int i=1; i globalVariable = new HashMap(); - String gigwanjang = sggNm+"장"; - gigwanjang = spreadBySpace(gigwanjang,4); - globalVariable.put("gigwanjang", gigwanjang); printOption.setGlobalVariable(globalVariable); //폐기증거사진 List dsuseimgs = fileService.getFileList( - new FileQuery().setInfoType("110").setInfoKeys(dscMngId) + new FileQuery().setInfoType("110").setInfoKeys(dscdmngId) ); List dataobjectList2 = new ArrayList<>(); for(DataObject dsuseimg : dsuseimgs) { @@ -151,7 +128,7 @@ public class DocController extends AbstractController { //상품사진갯수 체크 List totalProduct = fileService.getFileList( - new FileQuery().setInfoKeys(dscMngId).setInfoType("100").setOrderBy("SUB_TYPE") + new FileQuery().setInfoKeys(dscdmngId).setInfoType("100").setOrderBy("SUB_TYPE") ); int totalProductCnt = 0; if(totalProduct != null && !totalProduct.isEmpty()) { @@ -159,11 +136,11 @@ public class DocController extends AbstractController { } //샘플 데이터 생성 - List dataobjectList = this.makeSample(dscMngId,totalProductCnt); + List dataobjectList = this.makeSample(dscdmngId,totalProductCnt); for(DataObject data : dataobjectList) { - String infKey = data.string("dscMngId"); - String subType = data.string("dscMngSn"); + String infKey = data.string("dscdmngId"); + String subType = data.string("dscdmngSn"); List fileinfo = fileService.getFileList( new FileQuery().setInfoKeys(infKey).setInfoType("100").setBy("SUB_TYPE").setTerm(subType) @@ -180,7 +157,7 @@ public class DocController extends AbstractController { String resultFilePath = form.makeFile().andGetPath(); File file = new File(resultFilePath); - Relation rel = new Relation().setInfoType("200").setSubType("02").setInfoKey(dscMngId); + Relation rel = new Relation().setInfoType("200").setSubType("02").setInfoKey(dscdmngId); FileInfo fileInfo = new FileInfo.Factory().create(rel, file); fileInfo.setName(print.getFormatKorName()+".hwp"); int effected= fileService.create(fileInfo); @@ -192,14 +169,14 @@ public class DocController extends AbstractController { } - public List makeSample(String dscMngId, int totalProductCnt){ + public List makeSample(String dscdmngId, int totalProductCnt){ List dataobjectList = new ArrayList(); for(int i=0; i dataObjectList, List afterPhotoPaths) { super(print, printOption, dataObjectList); - this.maxRunCount = 1; - this.formatFilePath = "template/hwp/dispose_status.hwp"; this.print.setFormatKorName("폐기처리내역"); this.print.setFormatName("disposeProcessDetails"); + this.maxRunCount = 1; + this.formatFilePath = "template/hwp/dispose_status.hwp"; + this.data2 = new ArrayList(); DataObject page = null; @@ -102,8 +103,6 @@ public class DisposeProcessDetails extends HWPFormat { while(currentRunCount != maxRunCount) { - System.out.println(currentRunCount); - System.out.println(maxRunCount); HWPFile hwpFile_i = HWPWriter.classpath(this.formatFilePath); this.writer = new HWPWriter(hwpFile_i); runAsWriter(); @@ -123,10 +122,16 @@ public class DisposeProcessDetails extends HWPFormat { protected void runAsWriter() { if(this.formatFilePath.equals("template/hwp/dispose_status.hwp")) { + String dsuseDe = data.get(0).string("dsuseDe"); + String year = dsuseDe.substring(0, 4); + String month = dsuseDe.substring(4, 6); + String day = dsuseDe.substring(6, 8); + dsuseDe = year + ". " + month + ". " + day + "."; + writer.setValue("폐기일자", dsuseDe); + List list = IntStream.rangeClosed(1, data.size()).boxed().map(i -> { DataObject one = data.get(i-1); return (DataObject) new DataObject() - .set("폐기일자", DataFormat.yyyy_mm_dd(one.string("dsuseDe"))) .set("번호", i) .set("업소명", one.string("bsshNm")) .set("폐기사유", one.string("dsusePrvCdNm")) diff --git a/src/main/java/cokr/xit/adds/cmmn/hwp/format/DisposeResultReport.java b/src/main/java/cokr/xit/adds/cmmn/hwp/format/DisposeResultReport.java index 16186e1..407f77e 100644 --- a/src/main/java/cokr/xit/adds/cmmn/hwp/format/DisposeResultReport.java +++ b/src/main/java/cokr/xit/adds/cmmn/hwp/format/DisposeResultReport.java @@ -14,10 +14,12 @@ public class DisposeResultReport extends HWPFormat { public DisposeResultReport(Print print, PrintOption printOption, List dataObjectList) { super(print, printOption, dataObjectList); - this.maxRunCount = 1; - this.formatFilePath = "template/hwp/dispose_result_report.hwp"; this.print.setFormatKorName("폐기결과보고서"); this.print.setFormatName("disposeResultReport"); + + this.maxRunCount = 1; + this.formatFilePath = "template/hwp/dispose_result_report.hwp"; + } @Override @@ -46,15 +48,6 @@ public class DisposeResultReport extends HWPFormat { }).toList(); writer.table(0, 3, 1).setValues(list); - String currentTime = print.getPrintRequestDt(); - String year = currentTime.substring(0, 4); - String month = currentTime.substring(4, 6); - String day = currentTime.substring(6, 8); - String yyyymmdd = year+month+day; - writer.setValue("연월일", DataFormat.yyyy_mm_dd(yyyymmdd)); - - String gigwanjang = printOption.getGlobalVariable().get("gigwanjang"); - writer.setValue("기관장", gigwanjang); } @Override diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 8d9246e..7f8d33d 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -12,6 +12,14 @@ server: key-store-password: 5811807 spring: + datasource: + hikari: + driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy + jdbc-url: jdbc:log4jdbc:mariadb://211.119.124.9:4407/adds?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Seoul&useSSL=false + username: addsweb + password: addsweb1234 + auto-commit: false + application: name: adds-fo diff --git a/src/main/resources/template/hwp/dispose_result_report.hwp b/src/main/resources/template/hwp/dispose_result_report.hwp index d33cf4b..f3d8469 100644 Binary files a/src/main/resources/template/hwp/dispose_result_report.hwp and b/src/main/resources/template/hwp/dispose_result_report.hwp differ diff --git a/src/main/resources/template/hwp/dispose_status.hwp b/src/main/resources/template/hwp/dispose_status.hwp index 1d39487..a377903 100644 Binary files a/src/main/resources/template/hwp/dispose_status.hwp and b/src/main/resources/template/hwp/dispose_status.hwp differ diff --git a/src/main/webapp/WEB-INF/jsp/include/top.jsp b/src/main/webapp/WEB-INF/jsp/include/top.jsp index 62f28eb..70763bf 100644 --- a/src/main/webapp/WEB-INF/jsp/include/top.jsp +++ b/src/main/webapp/WEB-INF/jsp/include/top.jsp @@ -11,16 +11,17 @@ alt="Login image" /> +
+
+
+ + + +
+
+
-
-
- -
-
- -
-