From 2a1b991ca37fd569de1def0628968c0027256b69 Mon Sep 17 00:00:00 2001 From: leebj Date: Thu, 20 Jun 2024 18:48:29 +0900 Subject: [PATCH] =?UTF-8?q?=ED=95=9C=EA=B8=80=EB=AC=B8=EC=84=9C=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=83=9D=EC=84=B1=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cokr/xit/adds/DocController.java | 248 ------------------ .../hwp/format/DisposeProcessDetails.java | 4 +- .../cmmn/hwp/format/DisposeResultReport.java | 6 +- .../xit/adds/nims/web/AddsNimsController.java | 120 +++++++++ .../template/hwp/dispose_result_report.hwp | Bin 27136 -> 29696 bytes .../WEB-INF/jsp/adds/nims/dsuseDoc-main.jsp | 96 +++++-- 6 files changed, 200 insertions(+), 274 deletions(-) delete mode 100644 src/main/java/cokr/xit/adds/DocController.java diff --git a/src/main/java/cokr/xit/adds/DocController.java b/src/main/java/cokr/xit/adds/DocController.java deleted file mode 100644 index 9ca2ccb..0000000 --- a/src/main/java/cokr/xit/adds/DocController.java +++ /dev/null @@ -1,248 +0,0 @@ -package cokr.xit.adds; - -import java.io.File; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; - -import javax.annotation.Resource; - -import org.egovframe.rte.fdl.string.EgovStringUtil; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import cokr.xit.adds.cmmn.hwp.format.DisposeProcessDetails; -import cokr.xit.adds.cmmn.hwp.format.DisposeResultReport; -import cokr.xit.applib.Print; -import cokr.xit.applib.PrintOption; -import cokr.xit.base.file.FileInfo; -import cokr.xit.base.file.FileInfo.Relation; -import cokr.xit.base.file.service.FileQuery; -import cokr.xit.base.file.service.FileService; -import cokr.xit.foundation.data.DataObject; -import cokr.xit.foundation.web.AbstractController; - -@Controller -@RequestMapping(value="/doc") -public class DocController extends AbstractController { - - @Resource(name="fileService") - FileService fileService; - - @RequestMapping(value="/makeDisposeResultReportHwp.do") - public ModelAndView makeDisposeResultReportHwp(String dscdmngId) { - - ModelAndView mav = new ModelAndView(); - mav.setViewName("jsonView"); - - if(dscdmngId == null || dscdmngId.equals("")) { - - return mav; - } - - - //출력일시,출력작업자 - Print print = new Print(); - print.setPrintRequestUserInfo(currentUser()); - - //개인정보표시여부,기관장 등 - PrintOption printOption = new PrintOption(); - Map globalVariable = new HashMap(); - printOption.setGlobalVariable(globalVariable); - - //상품 사진 갯수 체크 - List totalProduct = fileService.getFileList( - new FileQuery().setInfoKeys(dscdmngId).setInfoType("100") - ); - int totalProductCnt = 0; - if(totalProduct != null && !totalProduct.isEmpty()) { - totalProductCnt = totalProduct.size(); - } - - //샘플 데이터 생성 - List dataobjectList = this.makeSample(dscdmngId,totalProductCnt); - - for(DataObject data : dataobjectList) { - 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) - ); - if(fileinfo == null || fileinfo.isEmpty()) { - data.put("filePath", ""); - } else { - data.put("filePath", fileinfo.get(0).string("FILE_PATH")); - } - - } - - DisposeResultReport form = new DisposeResultReport(print, printOption, dataobjectList); - String resultFilePath = form.makeFile().andGetPath(); - - File file = new File(resultFilePath); - 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); - String fileId = fileInfo.getId(); - file.delete(); - - mav.addObject("fileId",fileId); - return mav; - } - - - - @RequestMapping(value="/makeDisposeProcessDetailsHwp.do") - public ModelAndView makeDisposeProcessDetailsHwp(String dscdmngId) { - - ModelAndView mav = new ModelAndView(); - mav.setViewName("jsonView"); - - if(dscdmngId == null || dscdmngId.equals("")) { - - return mav; - } - - //출력일시,출력작업자 - Print print = new Print(); - print.setPrintRequestUserInfo(currentUser()); - - //개인정보표시여부,기관장 등 - PrintOption printOption = new PrintOption(); - Map globalVariable = new HashMap(); - printOption.setGlobalVariable(globalVariable); - - //폐기증거사진 - List dsuseimgs = fileService.getFileList( - new FileQuery().setInfoType("110").setInfoKeys(dscdmngId) - ); - List dataobjectList2 = new ArrayList<>(); - for(DataObject dsuseimg : dsuseimgs) { - dataobjectList2.add(dsuseimg.string("FILE_PATH")); - } - - //상품사진갯수 체크 - List totalProduct = fileService.getFileList( - new FileQuery().setInfoKeys(dscdmngId).setInfoType("100").setOrderBy("SUB_TYPE") - ); - int totalProductCnt = 0; - if(totalProduct != null && !totalProduct.isEmpty()) { - totalProductCnt = totalProduct.size(); - } - - //샘플 데이터 생성 - List dataobjectList = this.makeSample(dscdmngId,totalProductCnt); - - for(DataObject data : dataobjectList) { - 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) - ); - if(fileinfo == null || fileinfo.isEmpty()) { - data.put("filePath", ""); - } else { - data.put("filePath", fileinfo.get(0).string("FILE_PATH")); - } - - } - - DisposeProcessDetails form = new DisposeProcessDetails(print, printOption, dataobjectList, dataobjectList2); - String resultFilePath = form.makeFile().andGetPath(); - - File file = new File(resultFilePath); - 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); - String fileId = fileInfo.getId(); - file.delete(); - - mav.addObject("fileId",fileId); - return mav; - } - - - public List makeSample(String dscdmngId, int totalProductCnt){ - List dataobjectList = new ArrayList(); - - for(int i=0; i dataForDoc = fromJson(dtls, new TypeReference>() {}); + + //출력일시,출력작업자 + Print print = new Print(); + print.setPrintRequestUserInfo(currentUser()); + + //개인정보표시여부,기관장 등 + PrintOption printOption = new PrintOption(); + Map globalVariable = new HashMap(); + printOption.setGlobalVariable(globalVariable); + + + for(DataObject data : dataForDoc) { + 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) + ); + if(fileinfo == null || fileinfo.isEmpty()) { + data.put("filePath", ""); + } else { + data.put("filePath", fileinfo.get(0).string("FILE_PATH")); + } + + } + + DisposeResultReport form = new DisposeResultReport(print, printOption, dataForDoc); + String resultFilePath = form.makeFile().andGetPath(); + + File file = new File(resultFilePath); + Relation rel = new Relation().setInfoType("200").setSubType("01").setInfoKey(dataForDoc.get(0).string("dscdmngId")); + FileInfo fileInfo = new FileInfo.Factory().create(rel, file); + fileInfo.setName(print.getFormatKorName()+".hwp"); + int effected= fileService.create(fileInfo); + String fileId = fileInfo.getId(); + file.delete(); + + mav.addObject("fileId",fileId); + mav.addObject("saved", true); + return mav; + } + + + + @RequestMapping(value="/makeDisposeProcessDetailsHwp.do", name="폐기 처리 내역 및 사진 HWP파일 생성") + public ModelAndView makeDisposeProcessDetailsHwp(String dtls) { + + ModelAndView mav = new ModelAndView(); + mav.setViewName("jsonView"); + + List dataForDoc = fromJson(dtls, new TypeReference>() {}); + + //출력일시,출력작업자 + Print print = new Print(); + print.setPrintRequestUserInfo(currentUser()); + + //개인정보표시여부,기관장 등 + PrintOption printOption = new PrintOption(); + Map globalVariable = new HashMap(); + printOption.setGlobalVariable(globalVariable); + + //폐기증거사진 + List dsuseimgs = fileService.getFileList( + new FileQuery().setInfoType("110").setInfoKeys(dataForDoc.get(0).string("dscdmngId")) + ); + List dsuseimgPaths = new ArrayList<>(); + for(DataObject dsuseimg : dsuseimgs) { + dsuseimgPaths.add(dsuseimg.string("FILE_PATH")); + } + + for(DataObject data : dataForDoc) { + 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) + ); + if(fileinfo == null || fileinfo.isEmpty()) { + data.put("filePath", ""); + } else { + data.put("filePath", fileinfo.get(0).string("FILE_PATH")); + } + + } + + DisposeProcessDetails form = new DisposeProcessDetails(print, printOption, dataForDoc, dsuseimgPaths); + String resultFilePath = form.makeFile().andGetPath(); + + File file = new File(resultFilePath); + Relation rel = new Relation().setInfoType("200").setSubType("02").setInfoKey(dataForDoc.get(0).string("dscdmngId")); + FileInfo fileInfo = new FileInfo.Factory().create(rel, file); + fileInfo.setName(print.getFormatKorName()+".hwp"); + int effected= fileService.create(fileInfo); + String fileId = fileInfo.getId(); + file.delete(); + + mav.addObject("fileId",fileId); + mav.addObject("saved", true); + return mav; + } //------------------------------------------------------------------------------------------------- // 보고 문서 관리 //------------------------------------------------------------------------------------------------- @@ -201,6 +320,7 @@ public class AddsNimsController extends ApplicationController { mav.addObject("DEPTList", deptList); mav.addObject("pageName", "dsuseMgtDoc"); + mav.addObject("apiHost", apiHost); return mav; } //------------------------------------------------------------------------------------------------- diff --git a/src/main/resources/template/hwp/dispose_result_report.hwp b/src/main/resources/template/hwp/dispose_result_report.hwp index f3d8469a55942faf3de62551800da50c4204f889..a13b219174f2cd0f8842e07328b0a5011a85cab0 100644 GIT binary patch delta 3999 zcmchacTiJnw}+E}5Rgu20@8c$(g_06yC@)P022%WBd7?7p-7jO0D|-?2zY=1(z__V zBL+c~E|4fyLEt9$-f!-lGxOa)zcusBde^((wrB0Ve`|+M0Yle;$vPaD0001x%<0+L z8QB4-$Y|8q@q*|UQ|}QDx(Psa{6kO#knY_%%4GmR1qY<=ustCUrx<0L8o8I^RmonH z45go9&g8Z>867gZWc0}BlQAFzC1XhDG8rQ>IF`G%Qj|qp$bl=F8)R;hxkbjE%xy9- zGL$iHDRu!^5b7T%Wc}9(DSK0l8Ak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Zek5HhNpy u(I-cT>CV6|{kh5h*@i&pRB$>Xltzphy9F~O^dQv0wN`jA24z(kNb@gRL>(gl diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseDoc-main.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseDoc-main.jsp index 26ed1b6..fab35ed 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseDoc-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseDoc-main.jsp @@ -313,15 +313,12 @@ } //문서 생성 버튼 이벤트 - $P.fnCreateDoc = (ADDS12) => { + $P.fnClickCreateDoc = (ADDS12) => { - let url = ""; let docName = ""; if(ADDS12 == "01"){ - url = wctx.url("/doc/makeDisposeResultReportHwp.do"); docName = "폐기결과보고서"; } else if(ADDS12 == "02"){ - url = wctx.url("/doc/makeDisposeProcessDetailsHwp.do"); docName = "폐기처리내역"; } else { return; @@ -331,23 +328,80 @@ content: "선택한 폐기관리 정보로 "+ docName+" 파일을 생성 하시겠습니까?" , init: () => { setDialogZindex(); } , onOK: () => { - let dscdmngId = $P.control.getCurrent().dscdmngId; - ajax.get({ - url: url, - data: { dscdmngId : dscdmngId }, - success:resp => { - - //$P.control.load($P.control.pageNum); - - } - }); + $P.getDataForDocument(ADDS12); } }); - } + }; + + //한글문서파일 생성을 위한 데이터 조회 + $P.getDataForDocument = (ADDS12) => { + + let dscdmngId = $P.control.getCurrent().dscdmng_id; + ajax.post({ + url: '', + contentType : "application/json; charset=utf-8", + + data: JSON.stringify({ + "dscdmngIds" : [dscdmngId], + "userId" : "${currentUser.account}", + "deptCd": "", + "prgrsSttsCd": "" + }), + success:resp => { + if(!resp.success){ + dialog.alert({ + content: resp.message + }); + return; + } + $P.fnCreateDoc(resp.data[0], ADDS12); + } + }); + + }; + + //한글문서파일 생성 요청 + $P.fnCreateDoc = (respData, ADDS12) => { + + respData.dsuseMgtDtls.map((dtl) => { + keys = Object.keys(respData); + for(let key of keys){ + if(key == "dsuseMgtDtls"){ + continue; + } + if(dtl[key] == undefined){ + dtl[key] = respData[key]; + } + } + return dtl; + }); + + let dtls = respData.dsuseMgtDtls; + + let url = ""; + if(ADDS12 == "01"){ + url = wctx.url("/adds/nims/makeDisposeResultReportHwp.do"); + } else if(ADDS12 == "02"){ + url = wctx.url("/adds/nims/makeDisposeProcessDetailsHwp.do"); + } else { + return; + } + + let dscdmngId = $P.control.getCurrent().dscdmng_id; + ajax.get({ + url: url, + data: { dtls : JSON.stringify(dtls) } , + success:resp => { + if(resp.saved){ + $P.control.load($P.control.pageNum); + } + } + }); + }; - // 전자우편 안내문 등록 버튼 이벤트 - $P.fnSearchBssh = (title) => { + // 업체 검색 버튼 이벤트 + $P.fnSearchBssh = () => { $P.control.getBsshInfo(); } @@ -415,11 +469,11 @@ // 폐기결과보고서 생성 버튼 이벤트 $("#btnCreateDsuseRsltDoc--${pageName}").on("click", function() { - $P.fnCreateDoc("01"); + $P.fnClickCreateDoc("01"); }); // 폐기처리내역및사진 생성 버튼 이벤트 $("#btnCreateDsuseRsltListPhoto--${pageName}").on("click", function() { - $P.fnCreateDoc("02"); + $P.fnClickCreateDoc("02"); }); // form-date 항목에서 키보드로 입력시 날짜 포맷팅 적용 @@ -435,9 +489,9 @@ }); }); - // 안내문 등록 버튼 이벤트 + // 업체 검색 버튼 이벤트 $("#btnBsshSearch--${pageName}").on("click", function() { - $P.fnSearchBssh($(this).attr("title")); + $P.fnSearchBssh(); }); // DataTables width 변경 조정 (업무별 그리드가 존재 한다면.. crdn06010-main.jsp 참고)