From 7f3b2a12c565ed720db03bbbeff3c56cc57f1d13 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Tue, 6 Feb 2024 18:00:43 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B3=BC=ED=83=9C=EB=A3=8C=EC=97=85=EB=AC=B4?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95,=20=EC=9C=84=EB=B0=98=ED=95=AD=EB=AA=A9?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95=20=EC=A0=80=EC=9E=A5=20=EA=B8=B0=EB=8A=A5?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cokr/xit/fims/mngt/Task.java | 9 +- .../fims/mngt/service/TaskVltnService.java | 28 ++ .../service/bean/TaskVltnServiceBean.java | 100 ++++++ .../xit/fims/mngt/web/Mngt03Controller.java | 44 ++- .../cokr/xit/fims/task/web/CmnController.java | 14 + .../sql/mapper/fims/mngt/task-mapper.xml | 2 +- .../sql/mapper/fims/mngt/vltn-mapper.xml | 14 +- .../WEB-INF/jsp/fims/mngt/mngt03010-main.jsp | 293 ++++++++++++++---- src/main/webapp/WEB-INF/jsp/index.jsp | 4 +- 9 files changed, 445 insertions(+), 63 deletions(-) create mode 100644 src/main/java/cokr/xit/fims/mngt/service/TaskVltnService.java create mode 100644 src/main/java/cokr/xit/fims/mngt/service/bean/TaskVltnServiceBean.java diff --git a/src/main/java/cokr/xit/fims/mngt/Task.java b/src/main/java/cokr/xit/fims/mngt/Task.java index dffd7083..02948c72 100644 --- a/src/main/java/cokr/xit/fims/mngt/Task.java +++ b/src/main/java/cokr/xit/fims/mngt/Task.java @@ -1,5 +1,7 @@ package cokr.xit.fims.mngt; +import java.util.List; + import cokr.xit.foundation.AbstractEntity; import lombok.Getter; import lombok.Setter; @@ -30,7 +32,7 @@ public class Task extends AbstractEntity { /** * 사전통지 일수 */ - private Integer advntceDaycnt; + private Integer advntceDayCnt; /** * 사전통지 감경 율 @@ -72,4 +74,9 @@ public class Task extends AbstractEntity { */ private String nxrpLinkSeDtlSn; + /** + * 위반 설정 목록 + */ + private List vltnStngList; + } diff --git a/src/main/java/cokr/xit/fims/mngt/service/TaskVltnService.java b/src/main/java/cokr/xit/fims/mngt/service/TaskVltnService.java new file mode 100644 index 00000000..82c14979 --- /dev/null +++ b/src/main/java/cokr/xit/fims/mngt/service/TaskVltnService.java @@ -0,0 +1,28 @@ +package cokr.xit.fims.mngt.service; + +import java.util.List; + +import cokr.xit.fims.mngt.Task; +import cokr.xit.fims.mngt.Vltn; + +public interface TaskVltnService { + + /**업무 설정, 위반 설정을 수정한다. + * @param task 업무 설정, vltnList 위반 설정 + * @return 저장 여부 + * + */ + boolean update(Task task, List vltnList); + + /**시군구별 업무 설정, 위반 설정을 추가한다. + * @param sggCd 시군구 코드, taskSeCd 업무구분 코드 + * @return 저장 여부 + *
  • 저장됐으면 true
  • + *
  • 그렇지 않으면 false
  • + *
+ */ + boolean create(String sggCd, String taskSeCd); + +} diff --git a/src/main/java/cokr/xit/fims/mngt/service/bean/TaskVltnServiceBean.java b/src/main/java/cokr/xit/fims/mngt/service/bean/TaskVltnServiceBean.java new file mode 100644 index 00000000..461324bf --- /dev/null +++ b/src/main/java/cokr/xit/fims/mngt/service/bean/TaskVltnServiceBean.java @@ -0,0 +1,100 @@ +package cokr.xit.fims.mngt.service.bean; + +import java.util.ArrayList; +import java.util.List; + +import javax.annotation.Resource; + +import org.springframework.stereotype.Service; + +import cokr.xit.base.code.service.CodeQuery; +import cokr.xit.base.code.service.bean.CodeBean; +import cokr.xit.fims.mngt.Task; +import cokr.xit.fims.mngt.Vltn; +import cokr.xit.fims.mngt.service.TaskVltnService; +import cokr.xit.foundation.component.AbstractServiceBean; +import cokr.xit.foundation.data.DataObject; + +@Service("taskVltnService") +public class TaskVltnServiceBean extends AbstractServiceBean implements TaskVltnService { + + /** 업무 정보 Bean */ + @Resource(name = "taskBean") + private TaskBean taskBean; + + /** 위반 정보 Bean */ + @Resource(name = "vltnBean") + private VltnBean vltnBean; + + @Resource(name = "codeBean") + private CodeBean codeBean; + + @Override + public boolean update(Task task, List vltnList) { + + boolean result = taskBean.update(task); + if(!result) { + throw new RuntimeException("[F]업무 설정 수정 중 오류가 발생하였습니다."); + } + + for(Vltn vltn : vltnList) { + result = vltnBean.update(vltn); + if(!result) { + throw new RuntimeException("[F]위반 설정 수정 중 오류가 발생하였습니다."); + } + } + + return result; + } + + @Override + public boolean create(String sggCd, String taskSeCd) { + Task task = new Task(); + task.setSggCd(sggCd); + task.setTaskSeCd(taskSeCd); + CodeQuery cq = new CodeQuery(); + cq.setGroupIDs("FIM054"); + List taskCodes = codeBean.getCodeList(cq); + for(DataObject taskCodeInfo : taskCodes) { + if(taskCodeInfo.string("CODE").equals(taskSeCd)) { + task.setTaskSeNm(taskCodeInfo.string("CODE_VAL")); + } + } + + boolean result = taskBean.create(task); + if(!result) { + throw new RuntimeException("[F]업무 설정 추가 중 오류가 발생하였습니다."); + } + + List vltnCdList = new ArrayList<>(); + String vltnByTask = ""; + switch(taskSeCd) { + case "PVS" -> { vltnByTask = "FIM004"; } + case "BPV" -> { vltnByTask = "FIM005"; } + case "DPV" -> { vltnByTask = "FIM006"; } + case "ECA" -> { vltnByTask = "FIM061"; } + case "TPV" -> { vltnByTask = "FIM064"; } + } + if(!vltnByTask.equals("")) { + cq = new CodeQuery(); + cq.setGroupIDs(vltnByTask); + vltnCdList = codeBean.getCodeList(cq); + } + + for(DataObject vltnCdInfo : vltnCdList) { + Vltn vltn = new Vltn(); + vltn.setSggCd(sggCd); + vltn.setTaskSeCd(taskSeCd); + vltn.setVltnCd(vltnCdInfo.string("CODE")); + vltn.setVltnArtcl(vltnCdInfo.string("CODE_VAL")); + + result = vltnBean.create(vltn); + if(!result) { + throw new RuntimeException("[F]위반 설정 추가 중 오류가 발생하였습니다."); + } + } + + return result; + } + +} diff --git a/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java b/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java index a5b39b95..ea8aa69c 100644 --- a/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java +++ b/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java @@ -15,10 +15,10 @@ import cokr.xit.base.web.ApplicationController; import cokr.xit.fims.cmmn.CmmnQuery; import cokr.xit.fims.mngt.Sgg; import cokr.xit.fims.mngt.Task; -import cokr.xit.fims.mngt.Vltn; import cokr.xit.fims.mngt.VltnQuery; import cokr.xit.fims.mngt.dao.FactionMapper; import cokr.xit.fims.mngt.service.SggService; +import cokr.xit.fims.mngt.service.TaskVltnService; import cokr.xit.fims.mngt.service.bean.FactionBean; import cokr.xit.fims.mngt.service.bean.TaskBean; import cokr.xit.fims.mngt.service.bean.VltnBean; @@ -39,7 +39,9 @@ public class Mngt03Controller extends ApplicationController { getSggInfo = "/010/getSggInfo.do", getTasks = "/010/getTasks.do", getVltns = "/010/getVltns.do", - updateSgg = "/010/updateSgg.do" + updateSgg = "/010/updateSgg.do", + updateTaskStng = "/010/updateTaskStng.do", + createTaskStng = "/010/createTaskStng.do" ; } @@ -48,10 +50,14 @@ public class Mngt03Controller extends ApplicationController { private SggService sggService; /** 업무 정보 서비스 */ + @Resource(name = "taskVltnService") + private TaskVltnService taskVltnService; + + /** 업무 정보 Bean */ @Resource(name = "taskBean") private TaskBean taskBean; - /**위반 정보 서비스*/ + /**위반 정보 Bean */ @Resource(name = "vltnBean") private VltnBean vltnBean; @@ -185,4 +191,36 @@ public class Mngt03Controller extends ApplicationController { return newFileInfoMap; } + /**시군구별 업무,위반 설정 정보를 수정한다. + * @param sgg 시군구 정보 + * @return jsonView + *
 {
+	 *     "saved": 수정되었으면 true, 그렇지 않으면 false
+	 * }
+ */ + public ModelAndView updateTaskStng(Task task) { + ModelAndView mav = new ModelAndView("jsonView"); + + boolean saved = taskVltnService.update(task, task.getVltnStngList()); + + mav.addObject("saved", saved); + return mav; + } + + /**시군구별 업무,위반 설정을 추가한다. + * @param sggCd 시군구 코드, taskSeCd 업무 구분 코드 + * @return jsonView + *
 {
+	 *     "saved": 수정되었으면 true, 그렇지 않으면 false
+	 * }
+ */ + public ModelAndView createTaskStng(String sggCd, String taskSeCd) { + ModelAndView mav = new ModelAndView("jsonView"); + + boolean saved = taskVltnService.create(sggCd, taskSeCd); + + 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 3a97ff48..35728b36 100644 --- a/src/main/java/cokr/xit/fims/task/web/CmnController.java +++ b/src/main/java/cokr/xit/fims/task/web/CmnController.java @@ -10,6 +10,7 @@ import org.springframework.web.servlet.ModelAndView; import cokr.xit.fims.cmmn.CmmnQuery; import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.mngt.Sgg; +import cokr.xit.fims.mngt.Task; import cokr.xit.fims.mngt.VltnQuery; import cokr.xit.fims.sprt.OtptForm; import cokr.xit.fims.sprt.OtptStngQuery; @@ -623,6 +624,19 @@ public class CmnController { public ModelAndView updateSgg(Sgg sgg, MultipartFile symbol, MultipartFile logo, MultipartFile offcs) { return super.updateSgg(sgg, symbol, logo, offcs); } + + @Override + @RequestMapping(name="업무 설정 정보 수정", value=METHOD_URL.updateTaskStng) + public ModelAndView updateTaskStng(Task task) { + return super.updateTaskStng(task); + } + + @Override + @RequestMapping(name="시군구 과태료 업무 추가", value=METHOD_URL.createTaskStng) + public ModelAndView createTaskStng(String sggCd, String taskSeCd) { + return super.createTaskStng(sggCd,taskSeCd); + } + } @Controller diff --git a/src/main/resources/sql/mapper/fims/mngt/task-mapper.xml b/src/main/resources/sql/mapper/fims/mngt/task-mapper.xml index 07e09272..e397e529 100644 --- a/src/main/resources/sql/mapper/fims/mngt/task-mapper.xml +++ b/src/main/resources/sql/mapper/fims/mngt/task-mapper.xml @@ -122,7 +122,7 @@ , #{task.ffnlgInadtnRt} , #{task.ffnlgInadtnMxmmCnt} , #{task.nxrpLinkSeCd} - , #{task.nxrpLinkDtlSn} + , #{task.nxrpLinkSeDtlSn} , 'Y' , , #{currentUser.id} diff --git a/src/main/resources/sql/mapper/fims/mngt/vltn-mapper.xml b/src/main/resources/sql/mapper/fims/mngt/vltn-mapper.xml index 10af074b..a34b9a22 100644 --- a/src/main/resources/sql/mapper/fims/mngt/vltn-mapper.xml +++ b/src/main/resources/sql/mapper/fims/mngt/vltn-mapper.xml @@ -99,7 +99,14 @@ - /* 위반 정보 등록(vltnMapper.insertVltn) */ + + /* 위반 정보 등록(vltnMapper.insertVltn) */ + + SELECT + LPAD(CAST(IFNULL(MAX(VLTN_ID) + 1, 1) AS INT), 10, '0') + AS NEW_ID + FROM TB_VLTN + INSERT INTO TB_VLTN ( VLTN_ID @@ -125,7 +132,7 @@ , MDFR ) VALUES ( - #{vltn.vltnId} + #{vltnId} , #{vltn.sggCd} , #{vltn.taskSeCd} , #{vltn.vltnCd} @@ -151,8 +158,7 @@ /* 위반 정보 수정(vltnMapper.updateVltn) */ UPDATE TB_VLTN - SET VLTN_CD = #{vltn.vltnCd} - , VLTN_ARTCL = #{vltn.vltnArtcl} + SET VLTN_ARTCL = #{vltn.vltnArtcl} , VLTN_LAW_NM = #{vltn.vltnLawNm} , VLTN_LAW1 = #{vltn.vltnLaw1} , VLTN_LAW2 = #{vltn.vltnLaw2} diff --git a/src/main/webapp/WEB-INF/jsp/fims/mngt/mngt03010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/mngt/mngt03010-main.jsp index e99eb67e..ef863d14 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/mngt/mngt03010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/mngt/mngt03010-main.jsp @@ -71,9 +71,11 @@ -