From 7660a9d6257819ca02b399f87f049ed4205ce87e Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Wed, 15 Nov 2023 14:18:52 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8A=B9=EA=B8=B0=EC=82=AC=ED=95=AD=20?= =?UTF-8?q?=EC=9D=BC=EA=B4=84=20=EB=93=B1=EB=A1=9D=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/fims/crdn/dao/CrdnUpdtMapper.java | 6 ++ .../xit/fims/sprt/service/Sprt01Service.java | 6 ++ .../fims/sprt/service/bean/Sprt01Bean.java | 27 +++++ .../sprt/service/bean/Sprt01ServiceBean.java | 7 ++ .../xit/fims/sprt/web/Sprt01Controller.java | 46 +++++++- .../cokr/xit/fims/task/web/CmnController.java | 19 +++- .../sql/mapper/fims/crdn/crdn-updt-mapper.xml | 8 ++ .../WEB-INF/jsp/fims/sprt/sprt01010-main.jsp | 66 ++++++++++++ .../WEB-INF/jsp/fims/sprt/sprt01012-info.jsp | 4 +- .../WEB-INF/jsp/fims/sprt/sprt01013-info.jsp | 4 +- .../WEB-INF/jsp/fims/sprt/sprt01020-info.jsp | 5 + .../WEB-INF/jsp/fims/sprt/sprt01030-info.jsp | 102 ++++++++++++++++++ 12 files changed, 292 insertions(+), 8 deletions(-) create mode 100644 src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01020-info.jsp create mode 100644 src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01030-info.jsp diff --git a/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java b/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java index ff17074e..07d822c9 100644 --- a/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java +++ b/src/main/java/cokr/xit/fims/crdn/dao/CrdnUpdtMapper.java @@ -36,6 +36,12 @@ public interface CrdnUpdtMapper extends AbstractMapper { */ int updateCrdnAmt(Crdn crdn); + /** 단속 자료의 기타사항을 변경한다. + * @param crdn 단속 대장 + * @return 저장된 정보수 + */ + int updateEtcCn(Crdn crdn); + /**단속정보를 변경한다.
* {@link cokr.xit.fims.crdn.service.bean.CrdnBean#update(Crdn)} 참고 * @param crdn 단속정보 diff --git a/src/main/java/cokr/xit/fims/sprt/service/Sprt01Service.java b/src/main/java/cokr/xit/fims/sprt/service/Sprt01Service.java index b878a008..d1c512f8 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/Sprt01Service.java +++ b/src/main/java/cokr/xit/fims/sprt/service/Sprt01Service.java @@ -23,4 +23,10 @@ public interface Sprt01Service { */ List getIntegrationDataList(SprtQuery query); + /**단속 특기사항을 일괄 저장한다. + * @param etcCn 특기사항, crdnIds 단속 ID 목록 + * @return 저장여부 + */ + boolean updateEtcCn(String etcCn, String... crdnIds); + } diff --git a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01Bean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01Bean.java index d7fe5934..a470f533 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01Bean.java +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01Bean.java @@ -6,6 +6,8 @@ import javax.annotation.Resource; import org.springframework.stereotype.Component; +import cokr.xit.fims.crdn.Crdn; +import cokr.xit.fims.crdn.dao.CrdnUpdtMapper; import cokr.xit.fims.sprt.SprtQuery; import cokr.xit.fims.sprt.dao.IntegrationSearchMapper; import cokr.xit.foundation.AbstractComponent; @@ -28,6 +30,9 @@ public class Sprt01Bean extends AbstractComponent { @Resource(name = "integrationSearchMapper") private IntegrationSearchMapper integrationSearchMapper; + @Resource(name = "crdnUpdtMapper") + private CrdnUpdtMapper crdnUpdtMapper; + /**지정한 조건에 따라 통합 조회 자료 목록을 조회하여 반환한다. * @param query 통합 조회 조건 * @return 통합 자료 목록 @@ -37,4 +42,26 @@ public class Sprt01Bean extends AbstractComponent { return integrationSearchMapper.selectIntegrationDataList(query); } + /**단속 특기사항을 일괄 저장한다. + * @param etcCn 특기사항, crdnIds 단속 ID 목록 + * @return 저장여부 + */ + public boolean updateEtcCn(String etcCn, String[] crdnIds) { + + Crdn crdn = new Crdn(); + crdn.setEtcCn(etcCn); + + int effected = 0; + for(String crdnId : crdnIds) { + crdn.setCrdnId(crdnId); + int result = crdnUpdtMapper.updateEtcCn(crdn); + effected += result; + } + + if(effected != crdnIds.length) { + throw new RuntimeException("특기사항 저장 중 오류가 발생하였습니다."); + } + return true; + } + } diff --git a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01ServiceBean.java b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01ServiceBean.java index d981155e..cfeec6c9 100644 --- a/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01ServiceBean.java +++ b/src/main/java/cokr/xit/fims/sprt/service/bean/Sprt01ServiceBean.java @@ -33,4 +33,11 @@ public class Sprt01ServiceBean extends AbstractServiceBean implements Sprt01Serv return sprt01Bean.getIntegrationDataList(query); } + @Override + public boolean updateEtcCn(String etcCn, String... crdnIds) { + + return sprt01Bean.updateEtcCn(etcCn, crdnIds); + + } + } diff --git a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java index 21b94fb2..76f4a494 100644 --- a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java +++ b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java @@ -32,6 +32,18 @@ import cokr.xit.foundation.data.DataObject; */ public class Sprt01Controller extends ApplicationController { + public static final String CLASS_URL = "/sprt/sprt01"; + + public class METHOD_URL { + public static final String + integrationSearchMain = "/010/main.do", + getIntegrationDataList = "/010/list.do", + manageEtcCnMain = "/020/info.do", + inputEtcCnMain = "/030/info.do", + inputEtcCn = "/030/update.do" + ; + } + /**통합 조회 서비스*/ @Resource(name="sprt01Service") private Sprt01Service sprt01Service; @@ -69,7 +81,7 @@ public class Sprt01Controller extends ApplicationController { addCodes(commonCodes, mav, "FIM003", "FIM010", "FIM026", "FIM054" ,"FIM004","FIM005","FIM006","FIM061","FIM064"); - mav.addObject("pageName", "sprt01010");// View(jsp)에서 사용할 id 뒤에 붙일 suffix + mav.addObject("pageName", "sprt01010-main");// View(jsp)에서 사용할 id 뒤에 붙일 suffix String fastBy = req.getParameter("fastBy"); String fastTerm = req.getParameter("fastTerm"); @@ -224,4 +236,36 @@ public class Sprt01Controller extends ApplicationController { return temp1 + temp2; } + + /**특기사항 일괄 입력 화면을 연다. + * + * @return /fims/sprt/sprt01030 + */ + public ModelAndView inputEtcCnMain(String... crdnIds) { + ModelAndView mav = new ModelAndView("fims/sprt/sprt01030-info"); + + mav.addObject("crdnIds", toJson(crdnIds)); + + return mav; + } + + /**특기사항을 일괄 갱신한다. + * @param etcCn 특기사항, crdnIds 단속 ID 목록 + * @return jsonView + *
 {
+	 *     "affected": 저장된 정보수
+	 *     "saved": 저장되었으면 true, 그렇지 않으면 false
+	 * }
+ */ + public ModelAndView inputEtcCn(String etcCn, String... crdnIds) { + ModelAndView mav = new ModelAndView("jsonView"); + + boolean saved = false; + + saved = sprt01Service.updateEtcCn(etcCn, crdnIds); + + mav.addObject("saved", saved); + + return mav; + } } diff --git a/src/main/java/cokr/xit/fims/task/web/CmnController.java b/src/main/java/cokr/xit/fims/task/web/CmnController.java index 8f752e21..43d74a06 100644 --- a/src/main/java/cokr/xit/fims/task/web/CmnController.java +++ b/src/main/java/cokr/xit/fims/task/web/CmnController.java @@ -330,23 +330,36 @@ public class CmnController { } @Controller - @RequestMapping(name = "통합 조회", value = "/sprt/sprt01") + @RequestMapping(name = "통합 조회", value = Sprt01Controller.CLASS_URL) class Sprt01Controller extends cokr.xit.fims.sprt.web.Sprt01Controller { /** 통합조회 메인 화면을 연다. * @return fims/sprt/sprt01010-main */ @Override - @RequestMapping(name="통합조회 메인", value="/010/main.do") + @RequestMapping(name="통합조회 메인", value=METHOD_URL.integrationSearchMain) public ModelAndView integrationSearchMain(HttpServletRequest req) { return super.integrationSearchMain(req); } @Override - @RequestMapping(name="통합조회 자료 목록", value="/010/list.do") + @RequestMapping(name="통합조회 자료 목록", value=METHOD_URL.getIntegrationDataList) public ModelAndView getIntegrationDataList(SprtQuery query, HttpServletRequest req) { return super.getIntegrationDataList(query, req); } + + @Override + @RequestMapping(name="특기사항 일괄 입력 화면", value=METHOD_URL.inputEtcCnMain) + public ModelAndView inputEtcCnMain(String... crdnIds) { + return super.inputEtcCnMain(crdnIds); + } + + @Override + @RequestMapping(name="특기사항 일괄 입력", value=METHOD_URL.inputEtcCn) + public ModelAndView inputEtcCn(String etcCn, String... crdnIds) { + return super.inputEtcCn(etcCn, crdnIds); + } + } @Controller diff --git a/src/main/resources/sql/mapper/fims/crdn/crdn-updt-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/crdn-updt-mapper.xml index 8e9d53bc..088c8933 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdn-updt-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdn-updt-mapper.xml @@ -112,6 +112,14 @@ WHERE CRDN_ID = #{crdnId} /* 단속 ID */ + + /* 단속 기타사항 수정(crdnUpdtMapper.updateEtcCn) */ + UPDATE TB_CRDN + SET MDFCN_DT = /* 수정일시 */ + , MDFR = #{modifiedBy} /* 수정자 */ + , ETC_CN = #{etcCn} + WHERE CRDN_ID = #{crdnId} /* 단속 ID */ + /* 단속 정보 수정(crdnUpdtMapper.updateEditCrdn) */ UPDATE TB_CRDN diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp index 4e899b80..2869b7ed 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01010-main.jsp @@ -314,6 +314,65 @@ integrationSearch.fnCopyPyrNo = (updown) => { } } +//특기사항관리 +integrationSearch.fnManageEtcCn = (updown) => { + var cur; + if(updown == "up"){ + cur = integrationSearchControl.updataset.getCurrent(); + } else { + cur = integrationSearchControl.downdataset.getCurrent(); + } + + if(cur != null){ + + } +} + +//특기사항일괄입력 +integrationSearch.fnInputEtcCn = (updown) => { + var cur; + if(updown == "up"){ + cur = integrationSearchControl.updataset; + + } else { + cur = integrationSearchControl.downdataset; + + } + + if(cur == null && cur.length <= 0){ + return; + } + + var list = cur.getDataset(); + var grouped = Object.groupBy(list, ({ CRDN_ID }) => CRDN_ID); + var crdnIds = Object.keys(grouped); + + var url = wctx.url("/sprt/sprt01/030/info.do"); + + var dialogId = "inputEtcCnDialog"; + ajax.get({ + url : url + , data : { crdnIds : crdnIds.join(",") } + , success : resp => { + dialog.open({ + id : dialogId + , title : "특기사항입력-일괄" + , size : "xl" + , content : resp + , init : () => { + + $("#"+dialogId).find("input[name='dialogId']").val(dialogId); + var found = $("#"+dialogId).find("template")[0].innerHTML; + var trs = cur.inStrings(found, null); + $("#"+dialogId).find("tbody").html(trs.join()); + } + , onClose : () => { } + }); + } + }); + +} + //개별총정보 dialog integrationSearch.getInfo = (taskSeCd, crdnId) => { if (crdnId == undefined || crdnId == null || crdnId == "") { @@ -357,6 +416,13 @@ integrationSearch.setEvent = () => { $("#btnUpCopyPyrNo--${pageName}").on("click", function(){ integrationSearch.fnCopyPyrNo("up"); }); $("#btnDownCopyPyrNo--${pageName}").on("click", function(){ integrationSearch.fnCopyPyrNo("down"); }); + + $("#btnUpManageEtcCn--${pageName}").on("click", function(){ integrationSearch.fnManageEtcCn("up"); }); + $("#btnDownManageEtcCn--${pageName}").on("click", function(){ integrationSearch.fnManageEtcCn("down"); }); + + $("#btnUpInputEtcCn--${pageName}").on("click", function(){ integrationSearch.fnInputEtcCn("up"); }); + $("#btnDownInputEtcCn--${pageName}").on("click", function(){ integrationSearch.fnInputEtcCn("down"); }); + //$("#btn").on("click", function(){ }); diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01012-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01012-info.jsp index d1c5a869..b4617732 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01012-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01012-info.jsp @@ -33,11 +33,11 @@ title="납부자번호복사"> 납부자번호복사 - - diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01013-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01013-info.jsp index 1624411e..dc19de02 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01013-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01013-info.jsp @@ -41,11 +41,11 @@ title="납부자번호복사"> 납부자번호복사 - - diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01020-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01020-info.jsp new file mode 100644 index 00000000..433f45dd --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01020-info.jsp @@ -0,0 +1,5 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> +<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> + +특기사항관리 + diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01030-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01030-info.jsp new file mode 100644 index 00000000..abdea5af --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01030-info.jsp @@ -0,0 +1,102 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> +<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> + +특기사항입력-일괄 + +
+
+ +
+ +
+ +
+ +
+
+ + +
+
+ +
+
+
+ +
+
+
+
+
+
+ + \ No newline at end of file