From a6f98e999eb9fd9a4595bf7f18f81ee6ecd60e59 Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Fri, 14 Jun 2024 17:25:29 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20controller=20class=20=EC=A0=95?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/adds/nims/web/AddsNimsController.java | 148 +++++++++++++++++- .../xit/adds/nims/web/DsuseDocController.java | 26 --- .../nims/web/DsuseMgtMappingController.java | 53 ------- .../nims/web/DsuseMgtReceiptController.java | 68 -------- .../adds/nims/web/DsuseMgtRsltController.java | 69 -------- .../xit/adds/nims/web/TestController.java | 10 -- .../jsp/adds/nims/dsuseMgtReceipt-info.jsp | 21 ++- .../jsp/adds/nims/dsuseMgtReceipt-main.jsp | 4 +- 8 files changed, 163 insertions(+), 236 deletions(-) delete mode 100644 src/main/java/cokr/xit/adds/nims/web/DsuseDocController.java delete mode 100644 src/main/java/cokr/xit/adds/nims/web/DsuseMgtMappingController.java delete mode 100644 src/main/java/cokr/xit/adds/nims/web/DsuseMgtReceiptController.java delete mode 100644 src/main/java/cokr/xit/adds/nims/web/DsuseMgtRsltController.java diff --git a/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java b/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java index cebcff5..3cf6cae 100644 --- a/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java +++ b/src/main/java/cokr/xit/adds/nims/web/AddsNimsController.java @@ -7,6 +7,7 @@ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; +import cokr.xit.adds.nims.DsuseMgtReceiptQuery; import cokr.xit.adds.nims.service.DsuseMgtReceiptService; import cokr.xit.foundation.web.AbstractController; @@ -22,13 +23,148 @@ public class AddsNimsController extends AbstractController { @Resource(name="dsuseMgtReceiptService") private DsuseMgtReceiptService dsuseMgtReceiptService; - @RequestMapping(value = "/bssh-popup.do", name="마약류 취급 업체 조회 팝업") - public ModelAndView bsshPopup(String openPage) { - ModelAndView mav = new ModelAndView("adds/nims/bssh-popup"); + //------------------------------------------------------------------------------------------------- + // 신청서 접수 + //------------------------------------------------------------------------------------------------- + @RequestMapping(value = "/dsuseMgtReceipt-list.do", name="신청서 접수 목록 조회") + public ModelAndView getDsuseMgtReceiptList(DsuseMgtReceiptQuery query) { + setFetchSize(query); + + return setCollectionInfo(new ModelAndView("jsonView"), dsuseMgtReceiptService.getdsuseMgtReceiptList(query),"",""); + } + + + @RequestMapping(value = "/dsuseMgtReceipt-info.do", name="신청서 접수 상세") + public ModelAndView getDsuseMgtReceiptInfo() { + ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtReceipt-info"); + + return mav + .addObject("pageName", "dsuseMgtReceiptInfo") // View(jsp)에서 사용할 id 뒤에 붙일 suffix + .addObject("apiHost", apiHost); + } + //------------------------------------------------------------------------------------------------- + // 신청서 접수 + //------------------------------------------------------------------------------------------------- + + + //------------------------------------------------------------------------------------------------- + // 결과[통보] 처리 + //------------------------------------------------------------------------------------------------- + @RequestMapping(value = "dsuseMgtRslt-list.do", name="결과[통보] 처리 조회") + public ModelAndView getDsuseMgtRsltList(DsuseMgtReceiptQuery query) { + setFetchSize(query); + + return setCollectionInfo(new ModelAndView("jsonView"), dsuseMgtReceiptService.getdsuseMgtReceiptList(query),"",""); + } + + @RequestMapping(value = "dsuseMgtRslt-info.do", name="결과[통보] 상세") + public ModelAndView getDsuseMgtRsltInfo(String usrRptIdNo) { + ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtRslt-info"); + + return mav + .addObject("pageName", "dsuseMgtRsltInfo") // View(jsp)에서 사용할 id 뒤에 붙일 suffix + .addObject("infoPrefix", "dsuseMgtRsltInfo") // prefix + .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl + .addObject("usrRptIdNo", usrRptIdNo) // View(jsp)에서 사용할 id 뒤에 붙일 suffix + ; + } + //------------------------------------------------------------------------------------------------- + // 결과[통보] 처리 + //------------------------------------------------------------------------------------------------- + + + //------------------------------------------------------------------------------------------------- + // 보고 확인 처리 + //------------------------------------------------------------------------------------------------- + // dsuseMgtMappingList = "/dsuseMgtMapping-list.do" + @RequestMapping(value = "/dsuseMgtMapping-info.do", name = "페기 보고 확인 등록") + public ModelAndView getDsuseMgtMappingInfo() { + ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtMapping-info"); + + return mav + .addObject("pageName", "dsuseMgtMappingInfo") // View(jsp)에서 사용할 id 뒤에 붙일 suffix + .addObject("apiHost", apiHost) + // .addObject("infoPrefix", "dsuseMgtReceipt") // prefix + // .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl + ; + } + //------------------------------------------------------------------------------------------------- + // 보고 확인 처리 + //------------------------------------------------------------------------------------------------- + + + //------------------------------------------------------------------------------------------------- + // 보고 문서 관리 + //------------------------------------------------------------------------------------------------- + @RequestMapping(value = "dsuseMgtRslt-list.do", name="결과[통보] 처리 조회") + public ModelAndView getDsuseMgtDocList(DsuseMgtReceiptQuery query) { + // FIXME : nims_query.sql의 '보고문서 관리' query를 참조하여 구현 + return null; + } + //------------------------------------------------------------------------------------------------- + // 보고 문서 관리 + //------------------------------------------------------------------------------------------------- + + + + //------------------------------------------------------------------------------------------------- + // menu 처리 + //------------------------------------------------------------------------------------------------- + @RequestMapping(value = "/dsuseMgtReceipt.do", name="신청서 접수 메인") + public ModelAndView dsuseMgtReceiptMain() { + ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtReceipt-main"); + + return mav + .addObject("pageName", "dsuseMgtReceipt") // View(jsp)에서 사용할 id 뒤에 붙일 suffix + // .addObject("infoPrefix", "dsuseMgtReceipt") // prefix + // .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl + ; + } + + @RequestMapping(value = "dsuseMgtRslt.do", name="결과[통보] 처리 메인") + public ModelAndView dsuseMgtRsltMain() { + ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtRslt-main"); + + return mav + .addObject("pageName", "dsuseMgtRslt") // View(jsp)에서 사용할 id 뒤에 붙일 suffix + // .addObject("infoPrefix", "dsuseMgtReceipt") // prefix + // .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl + ; + } + + @RequestMapping(value = "/dsuseMgtMapping.do", name="폐기 보고 확인 메인") + public ModelAndView dsuseMgtMapping() { + ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtMapping-main"); // 사용자 정보 //ManagedUser managedUser = (ManagedUser)currentUser().getUser(); + return mav + .addObject("pageName", "dsuseMgtMapping") // View(jsp)에서 사용할 id 뒤에 붙일 suffix + // .addObject("infoPrefix", "dsuseMgtReceipt") // prefix + // .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl + ; + } + + @RequestMapping(name = "폐기보고 문서 관리 메인", value = {"/dsuseMgtDoc.do"}) + public ModelAndView dsuseMgtDoc() { + ModelAndView mav = new ModelAndView(); + mav.setViewName("adds/nims/dsuseDoc-main"); + return mav; + } + //------------------------------------------------------------------------------------------------- + // menu 호출 처리 + //------------------------------------------------------------------------------------------------- + + + + //------------------------------------------------------------------------------------------------- + // 마약류폐기보고 팝업 + //------------------------------------------------------------------------------------------------- + @RequestMapping(value = "/bssh-popup.do", name="마약류 취급 업체 조회 팝업") + public ModelAndView bsshPopup(String openPage) { + ModelAndView mav = new ModelAndView("adds/nims/bssh-popup"); + return mav .addObject("pageName", "bsshPopup") // View(jsp)에서 사용할 id 뒤에 붙일 suffix .addObject("infoPrefix", "bssh") // prefix @@ -41,9 +177,6 @@ public class AddsNimsController extends AbstractController { public ModelAndView productPopup(String openPage) { ModelAndView mav = new ModelAndView("adds/nims/product-popup"); - // 사용자 정보 - //ManagedUser managedUser = (ManagedUser)currentUser().getUser(); - return mav .addObject("pageName", "productMain") // View(jsp)에서 사용할 id 뒤에 붙일 suffix .addObject("infoPrefix", "product") // prefix @@ -51,4 +184,7 @@ public class AddsNimsController extends AbstractController { .addObject("openPage", openPage) .addObject("apiHost", apiHost); } + //------------------------------------------------------------------------------------------------- + // 마약류폐기보고 팝업 + //------------------------------------------------------------------------------------------------- } diff --git a/src/main/java/cokr/xit/adds/nims/web/DsuseDocController.java b/src/main/java/cokr/xit/adds/nims/web/DsuseDocController.java deleted file mode 100644 index 3b210c0..0000000 --- a/src/main/java/cokr/xit/adds/nims/web/DsuseDocController.java +++ /dev/null @@ -1,26 +0,0 @@ -package cokr.xit.adds.nims.web; - -import cokr.xit.foundation.web.AbstractController; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -@RequiredArgsConstructor -@Controller -@RequestMapping( - name = "Nims 관리", - value = {"/adds/nims"} -) -public class DsuseDocController extends AbstractController { - - @RequestMapping( - name = "Nims 메인", - value = {"/dsuseMgtDoc.do"} - ) - public ModelAndView main() { - ModelAndView mav = new ModelAndView(); - mav.setViewName("adds/nims/dsuseDoc-main"); - return mav; - } -} diff --git a/src/main/java/cokr/xit/adds/nims/web/DsuseMgtMappingController.java b/src/main/java/cokr/xit/adds/nims/web/DsuseMgtMappingController.java deleted file mode 100644 index 100ae38..0000000 --- a/src/main/java/cokr/xit/adds/nims/web/DsuseMgtMappingController.java +++ /dev/null @@ -1,53 +0,0 @@ -package cokr.xit.adds.nims.web; - -import cokr.xit.adds.nims.web.DsuseMgtReceiptController.METHOD_URL; -import cokr.xit.foundation.web.AbstractController; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -@RequiredArgsConstructor -@Controller -@RequestMapping( - name = "Nims 관리", - value = {"/adds/nims"} -) -public class DsuseMgtMappingController extends AbstractController { - - public static final String CLASS_URL = "/adds/nims"; - - public class METHOD_URL { - public static final String - dsuseMgtMappingMain = "/dsuseMgtMapping.do" // 부과 제외 관리 메인 화면 - , dsuseMgtMappingList = "/dsuseMgtMapping-list.do" // 부과 제외 대장 목록 조회 - , dsuseMgtMappinginfo = "/dsuseMgtMapping-info.do" // 부과 제외 대장 조회 -// , createLevyExclusion = "/020/create.do" // 부과 제외 대장 등록 - ; - } - - @RequestMapping(name="폐기 보고 확인 메인", value=METHOD_URL.dsuseMgtMappingMain) - public ModelAndView main() { - ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtMapping-main"); - - // 사용자 정보 - //ManagedUser managedUser = (ManagedUser)currentUser().getUser(); - - return mav - .addObject("pageName", "dsuseMgtMapping") // View(jsp)에서 사용할 id 뒤에 붙일 suffix -// .addObject("infoPrefix", "dsuseMgtReceipt") // prefix -// .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl - ; - } - - @RequestMapping(name="페기 보고 확인 등록", value=METHOD_URL.dsuseMgtMappinginfo) - public ModelAndView getdsuseMgtReceiptInfo() { - ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtMapping-info"); - - return mav - .addObject("pageName", "dsuseMgtMappingInfo") // View(jsp)에서 사용할 id 뒤에 붙일 suffix -// .addObject("infoPrefix", "dsuseMgtReceipt") // prefix -// .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl - ; - } -} diff --git a/src/main/java/cokr/xit/adds/nims/web/DsuseMgtReceiptController.java b/src/main/java/cokr/xit/adds/nims/web/DsuseMgtReceiptController.java deleted file mode 100644 index b4808bb..0000000 --- a/src/main/java/cokr/xit/adds/nims/web/DsuseMgtReceiptController.java +++ /dev/null @@ -1,68 +0,0 @@ -package cokr.xit.adds.nims.web; - -import javax.annotation.Resource; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import cokr.xit.adds.nims.DsuseMgtReceiptQuery; -import cokr.xit.adds.nims.service.DsuseMgtReceiptService; -import cokr.xit.foundation.web.AbstractController; - - -@Controller -@RequestMapping( - name = "마약류 폐기 신청서 접수", - value = {"/adds/nims"} -) -public class DsuseMgtReceiptController extends AbstractController { - @Value("${app.api.host:}") - private String apiHost; - - private static final String CLASS_URL = "/adds/nims"; - - public class METHOD_URL { - public static final String - dsuseMgtReceiptMain = "/dsuseMgtReceipt.do" // 부과 제외 관리 메인 화면 - , getdsuseMgtReceiptList = "/dsuseMgtReceipt-list.do" // 부과 제외 대장 목록 조회 - , getdsuseMgtReceiptInfo = "/dsuseMgtReceipt-info.do" // 부과 제외 대장 목록 조회 -// , getLevyExclusionInfo = "/020/info.do" // 부과 제외 대장 조회 -// , createLevyExclusion = "/020/create.do" // 부과 제외 대장 등록 - ; - } - - @Resource(name="dsuseMgtReceiptService") - private DsuseMgtReceiptService dsuseMgtReceiptService; - - @RequestMapping(name="마약류폐기 신청서 접수 메인", value=METHOD_URL.dsuseMgtReceiptMain) - public ModelAndView dsuseMgtReceiptMain() { - ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtReceipt-main"); - - // 사용자 정보 - //ManagedUser managedUser = (ManagedUser)currentUser().getUser(); - - return mav - .addObject("pageName", "dsuseMgtReceipt") // View(jsp)에서 사용할 id 뒤에 붙일 suffix -// .addObject("infoPrefix", "dsuseMgtReceipt") // prefix -// .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl - ; - } - - @RequestMapping(name="마약류폐기 신청서 접수 조회", value=METHOD_URL.getdsuseMgtReceiptList) - public ModelAndView getdsuseMgtReceiptList(DsuseMgtReceiptQuery query) { - setFetchSize(query); - - return setCollectionInfo(new ModelAndView("jsonView"), dsuseMgtReceiptService.getdsuseMgtReceiptList(query),"",""); - } - - @RequestMapping(name="마약류폐기 신청서 접수 상세", value=METHOD_URL.getdsuseMgtReceiptInfo) - public ModelAndView getdsuseMgtReceiptInfo() { - ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtReceipt-info"); - - return mav - .addObject("pageName", "dsuseMgtReceiptInfo") // View(jsp)에서 사용할 id 뒤에 붙일 suffix - .addObject("apiHost", apiHost); - } -} diff --git a/src/main/java/cokr/xit/adds/nims/web/DsuseMgtRsltController.java b/src/main/java/cokr/xit/adds/nims/web/DsuseMgtRsltController.java deleted file mode 100644 index d6418b6..0000000 --- a/src/main/java/cokr/xit/adds/nims/web/DsuseMgtRsltController.java +++ /dev/null @@ -1,69 +0,0 @@ -package cokr.xit.adds.nims.web; - -import cokr.xit.adds.nims.DsuseMgtReceiptQuery; -import cokr.xit.adds.nims.service.DsuseMgtReceiptService; -import cokr.xit.adds.nims.web.DsuseMgtReceiptController.METHOD_URL; -import cokr.xit.foundation.web.AbstractController; -import lombok.RequiredArgsConstructor; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -@Controller -@RequestMapping( - name = "마약류폐기 결과 처리", - value = {"/adds/nims"} -) -public class DsuseMgtRsltController extends AbstractController { - - public static final String CLASS_URL = "/adds/nims"; - - public class METHOD_URL { - public static final String - dsuseMgtRsltMain = "/dsuseMgtRslt.do" // 부과 제외 관리 메인 화면 - , dsuseMgtRsltList = "/dsuseMgtRslt-list.do" // 부과 제외 대장 목록 조회 - , dsuseMgtRsltInfo = "/dsuseMgtRslt-info.do" // 부과 제외 대장 목록 조회 -// , getLevyExclusionInfo = "/020/info.do" // 부과 제외 대장 조회 -// , createLevyExclusion = "/020/create.do" // 부과 제외 대장 등록 - ; - } - - @Resource(name="dsuseMgtReceiptService") - private DsuseMgtReceiptService dsuseMgtReceiptService; - - @RequestMapping(name="마약류폐기 결과 처리 메인", value=METHOD_URL.dsuseMgtRsltMain) - public ModelAndView dsuseMgtReceiptMain() { - ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtRslt-main"); - - // 사용자 정보 - //ManagedUser managedUser = (ManagedUser)currentUser().getUser(); - - return mav - .addObject("pageName", "dsuseMgtRslt") // View(jsp)에서 사용할 id 뒤에 붙일 suffix -// .addObject("infoPrefix", "dsuseMgtReceipt") // prefix -// .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl - ; - } - - @RequestMapping(name="마약류폐기 결과 처리 조회", value=METHOD_URL.dsuseMgtRsltList) - public ModelAndView getdsuseMgtReceiptList(DsuseMgtReceiptQuery query) { - setFetchSize(query); - - return setCollectionInfo(new ModelAndView("jsonView"), dsuseMgtReceiptService.getdsuseMgtReceiptList(query),"",""); - } - - @RequestMapping(name="마약류폐기 신청서 접수 상세", value=METHOD_URL.dsuseMgtRsltInfo) - public ModelAndView getdsuseMgtReceiptInfo(String usrRptIdNo) { - ModelAndView mav = new ModelAndView("adds/nims/dsuseMgtRslt-info"); - - return mav - .addObject("pageName", "dsuseMgtRsltInfo") // View(jsp)에서 사용할 id 뒤에 붙일 suffix - .addObject("infoPrefix", "dsuseMgtRsltInfo") // prefix - .addObject("infoPrefixUrl", "/adds/nims") // prefixUrl - .addObject("usrRptIdNo", usrRptIdNo) // View(jsp)에서 사용할 id 뒤에 붙일 suffix - ; - } -} diff --git a/src/main/java/cokr/xit/adds/nims/web/TestController.java b/src/main/java/cokr/xit/adds/nims/web/TestController.java index 2689690..d43d232 100644 --- a/src/main/java/cokr/xit/adds/nims/web/TestController.java +++ b/src/main/java/cokr/xit/adds/nims/web/TestController.java @@ -42,14 +42,4 @@ public class TestController extends AbstractController { mav.setViewName("adds/nims/dsuseMgtReceipt_Test-main"); return mav.addObject("apiHost", apiHost); } - - // @RequestMapping( - // name = "결과[통보] 처리", - // value = {"/dsuseMgtRslt.do"} - // ) - // public ModelAndView dsuseMgtRsltForm() { - // ModelAndView mav = new ModelAndView(); - // mav.setViewName("adds/nims/dsuseMgtRslt-main"); - // return mav.addObject("apiHost", apiHost); - // } } diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-info.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-info.jsp index d6f05cd..dd93e7d 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-info.jsp @@ -300,13 +300,26 @@ $("#tbody--productList").find("input[type='file'][name='dsusePrdImgFiles']").each(function (i) { fileArr.push(this.files[0]); }); - + let saveData = { dsuseMgtJsonStr: JSON.stringify(saveBsshData), dsuseMgtDtlsJsonStr: JSON.stringify(datasetListPrd), // 폐기상품이미지목록 dsusePrdImgFiles: fileArr } + + + let formData = new FormData(); + formData.append("dsuseMgtJsonStr", JSON.stringify(saveBsshData)); + formData.append("dsuseMgtDtlsJsonStr", JSON.stringify(datasetListPrd)); +debugger; + $("input[type='file'][name='dsusePrdImgFiles']").each(function (i) { + //formData.append("dsusePrdImgFiles", $('input[type=file]')[i].files[0]); + formData.append("dsusePrdImgFiles", this.files[0]); + }); + + + let create = (jsonBssh.dscdmngId == ""); upload({ @@ -319,9 +332,11 @@ }); return; } - //$P.control.onSave(resp.data) + debugger + + //$P.control.onSave(resp) dialog.alert("저장됐습니다."); - dialog.close(this.prefixed("dialog")); + dialog.close("dsuseMgtReceiptDialog"); //this._load(); } }); diff --git a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-main.jsp b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-main.jsp index 0bfe6e7..3bc2ed8 100644 --- a/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/adds/nims/dsuseMgtReceipt-main.jsp @@ -21,6 +21,7 @@ + <%--
@@ -31,6 +32,7 @@
+ --%>
@@ -365,7 +367,7 @@ if (typeof usrRptIdNo == "undefined" || usrRptIdNo == null || usrRptIdNo == "") return; let params = { - usrRptIdNo: usrRptIdNo + usrRptIdNo: usrRptIdNo } ajax.get({