From 71899e2d88280f9da55fde79c6e7979db72eb0df Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Fri, 21 Jul 2023 09:51:01 +0900 Subject: [PATCH] =?UTF-8?q?=EC=86=8C=EC=8A=A4=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crdn/service/bean/Crdn01ServiceBean.java | 8 ++ .../fims/crdn/service/bean/Crdn05Bean.java | 127 +----------------- .../crdn/service/bean/Crdn05ServiceBean.java | 125 +++++++++++++++++ .../crdn/service/bean/Crdn06ServiceBean.java | 6 + .../xit/fims/crdn/web/Crdn01Controller.java | 11 +- .../xit/fims/crdn/web/Crdn02Controller.java | 4 +- .../xit/fims/crdn/web/Crdn05Controller.java | 11 +- .../xit/fims/crdn/web/Crdn06Controller.java | 3 +- .../cokr/xit/fims/task/web/DpvController.java | 12 +- 9 files changed, 154 insertions(+), 153 deletions(-) diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn01ServiceBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn01ServiceBean.java index 6adcc360..c5845d94 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn01ServiceBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn01ServiceBean.java @@ -39,5 +39,13 @@ public class Crdn01ServiceBean extends AbstractServiceBean implements CrdnServic } + public DataObject getCivilComplaintOriginalInfo(CrdnQuery req) { + return crdn01Bean.getCivilComplaintOriginalInfo(req); + } + + public boolean removeCivilComplaint(String... crdnIDs) { + return crdn01Bean.removeCivilComplaint(crdnIDs); + } + } diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn05Bean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn05Bean.java index d03cf85b..dbe9b3bc 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn05Bean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn05Bean.java @@ -1,24 +1,13 @@ package cokr.xit.fims.crdn.service.bean; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; - import javax.annotation.Resource; import org.springframework.stereotype.Component; -import cokr.xit.base.file.FileInfo; import cokr.xit.base.file.service.bean.FileBean; -import cokr.xit.fims.cmmn.CrdnSttsHstry; -import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean; import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.dao.Crdn05Mapper; -import cokr.xit.fims.excl.Excl01; -import cokr.xit.fims.excl.service.bean.Excl01Bean; -import cokr.xit.fims.task.service.TaskService; import cokr.xit.foundation.AbstractComponent; -import cokr.xit.foundation.UserInfo; /** 단속 자료 등록 Bean * @author leebj @@ -30,34 +19,9 @@ public class Crdn05Bean extends AbstractComponent { @Resource(name="fileBean") private FileBean fileBean; - @Resource(name="excl01Bean") - private Excl01Bean excl01Bean; - - @Resource(name="crdnSttsHstryBean") - private CrdnSttsHstryBean crdnSttsHstryBean; - @Resource(name = "crdn05Mapper") private Crdn05Mapper crdn05Mapper; - @Resource(name = "pvsService") - private TaskService pvsService; - @Resource(name = "bpvService") - private TaskService bpvService; - @Resource(name = "dpvService") - private TaskService dpvService; - @Resource(name = "ecaService") - private TaskService ecaService; - @Resource(name = "tpvService") - private TaskService tpvService; - - public boolean create(Crdn crdn, List fileInfoList) { - crdn.setAtchFileCnt(fileInfoList.size()); - boolean saved = this.create(crdn); - fileInfoList.forEach(fileInfo -> fileInfo.setInfoType(Crdn.INF_TYPE).setInfoKey(crdn.getCrdnId())); - fileBean.create(fileInfoList); - return saved; - } - /**단속 대장 정보를 등록한다. * @param crdn 단속 대장 * @return 저장 여부 @@ -65,94 +29,7 @@ public class Crdn05Bean extends AbstractComponent { *
  • 그렇지 않으면 false
  • * */ - public boolean create(Crdn crdn) { - - if(ifEmpty(crdn.getAtchFileCnt(), () -> 0) == 0) { - crdn.setAtchFileCnt(0); - } - int[] basicAmt; - switch (crdn.getTaskSeCd()) { - case "PVS": { - basicAmt = pvsService.getBasicAmt(crdn); - break; - } - case "BPV": { - basicAmt = bpvService.getBasicAmt(crdn); - break; - } - case "DPV": { - basicAmt = dpvService.getBasicAmt(crdn); - break; - } - case "ECA": { - basicAmt = ecaService.getBasicAmt(crdn); - break; - } - case "TPV": { - basicAmt = tpvService.getBasicAmt(crdn); - break; - } - default: - throw new IllegalArgumentException("Unexpected value: " + crdn.getTaskSeCd()); - } - crdn.setFfnlgAmt(basicAmt[0]); - crdn.setLevyAmt(basicAmt[0]); - crdn.setAdvntceLevyAmt(basicAmt[1]); - - - - if(ifEmpty(crdn.getDoGuidance(), () -> "").equals("on")) { - crdn.setCrdnSttsCd("83"); - } else { - crdn.setCrdnSttsCd("01"); - } - - crdn.setInstitute(UserInfo.current().getInstitute()); - boolean result = crdn05Mapper.insertCrdn(crdn) == 1 ? true : false; - - SimpleDateFormat yyyyMMdd = new SimpleDateFormat("yyyyMMdd"); - SimpleDateFormat yyyyMMddHHmmss = new SimpleDateFormat("yyyyMMddHHmmss"); - Date curTime = new Date(); - String strCurrentDate = yyyyMMdd.format(curTime); - String strCurrentDatetime = yyyyMMddHHmmss.format(curTime); - - - String taskDtlId = crdn.getCrdnId(); - - if(crdn.getCrdnSttsCd().equals("83")) { - // 부과제외(TB_LEVY_EXCL) 대장 등록 - Excl01 excl01 = new Excl01(); - excl01.setSggCd(""); // TODO:시군구 - excl01.setTaskSeCd(crdn.getTaskSeCd()); - excl01.setCrdnId(crdn.getCrdnId()); - excl01.setLevyExclYmd(strCurrentDate); - excl01.setLevyExclSeCd("2"); - excl01.setLevyExclRsnCd("192"); - excl01.setEtcCn(""); - - result = excl01Bean.createLevyExclusion(excl01); - if (!result) { - return false; - } - - taskDtlId = excl01.getLevyExclId(); - } - - // 단속상태이력(TB_CRDN_STTS_HSTRY) 대장 등록 - CrdnSttsHstry crdnSttsHstry = new CrdnSttsHstry(); - crdnSttsHstry.setCrdnId(crdn.getCrdnId()); - crdnSttsHstry.setBfrSttsCd(""); - crdnSttsHstry.setBfrSttsChgDt(""); - crdnSttsHstry.setCrdnSttsCd(crdn.getCrdnSttsCd()); - crdnSttsHstry.setTaskDtlId(taskDtlId); - crdnSttsHstry.setEtcCn(""); - - result = crdnSttsHstryBean.create(crdnSttsHstry); - if (!result) { - return false; - } - - return result; + public boolean insertCrdn(Crdn crdn) { + return crdn05Mapper.insertCrdn(crdn) == 1 ? true : false; } - } diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn05ServiceBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn05ServiceBean.java index 28739dab..f37ed824 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn05ServiceBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn05ServiceBean.java @@ -1,15 +1,25 @@ package cokr.xit.fims.crdn.service.bean; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.List; import javax.annotation.Resource; import org.springframework.stereotype.Service; +import cokr.xit.base.file.FileInfo; import cokr.xit.base.file.service.bean.FileBean; +import cokr.xit.fims.cmmn.CrdnSttsHstry; +import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean; +import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.dao.Crdn05Mapper; import cokr.xit.fims.crdn.service.CrdnService; +import cokr.xit.fims.excl.Excl01; +import cokr.xit.fims.excl.service.bean.Excl01Bean; +import cokr.xit.fims.task.service.TaskService; +import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.component.AbstractServiceBean; import cokr.xit.foundation.data.DataObject; @@ -29,6 +39,27 @@ public class Crdn05ServiceBean extends AbstractServiceBean implements CrdnServic @Resource(name="fileBean") private FileBean fileBean; + @Resource(name="excl01Bean") + private Excl01Bean excl01Bean; + + @Resource(name="crdnSttsHstryBean") + private CrdnSttsHstryBean crdnSttsHstryBean; + + @Resource(name = "pvsService") + private TaskService pvsService; + + @Resource(name = "bpvService") + private TaskService bpvService; + + @Resource(name = "dpvService") + private TaskService dpvService; + + @Resource(name = "ecaService") + private TaskService ecaService; + + @Resource(name = "tpvService") + private TaskService tpvService; + @Override public List getCrackdownList(CrdnQuery req) { req.setCurrentUserId(currentUser().getId()); @@ -36,5 +67,99 @@ public class Crdn05ServiceBean extends AbstractServiceBean implements CrdnServic return crdn05Mapper.selectCrackdownList(req); } + public boolean create(Crdn crdn, List fileInfoList) { + crdn.setAtchFileCnt(fileInfoList.size()); + boolean saved = this.create(crdn); + fileInfoList.forEach(fileInfo -> fileInfo.setInfoType(Crdn.INF_TYPE).setInfoKey(crdn.getCrdnId())); + fileBean.create(fileInfoList); + return saved; + } + + public boolean create(Crdn crdn) { + if(ifEmpty(crdn.getAtchFileCnt(), () -> 0) == 0) { + crdn.setAtchFileCnt(0); + } + int[] basicAmt; + switch (crdn.getTaskSeCd()) { + case "PVS": { + basicAmt = pvsService.getBasicAmt(crdn); + break; + } + case "BPV": { + basicAmt = bpvService.getBasicAmt(crdn); + break; + } + case "DPV": { + basicAmt = dpvService.getBasicAmt(crdn); + break; + } + case "ECA": { + basicAmt = ecaService.getBasicAmt(crdn); + break; + } + case "TPV": { + basicAmt = tpvService.getBasicAmt(crdn); + break; + } + default: + throw new IllegalArgumentException("Unexpected value: " + crdn.getTaskSeCd()); + } + crdn.setFfnlgAmt(basicAmt[0]); + crdn.setLevyAmt(basicAmt[0]); + crdn.setAdvntceLevyAmt(basicAmt[1]); + + + + if(ifEmpty(crdn.getDoGuidance(), () -> "").equals("on")) { + crdn.setCrdnSttsCd("83"); + } else { + crdn.setCrdnSttsCd("01"); + } + + crdn.setInstitute(UserInfo.current().getInstitute()); + boolean result = crdn05Bean.insertCrdn(crdn); + + SimpleDateFormat yyyyMMdd = new SimpleDateFormat("yyyyMMdd"); + Date curTime = new Date(); + String strCurrentDate = yyyyMMdd.format(curTime); + + String taskDtlId = crdn.getCrdnId(); + + if(crdn.getCrdnSttsCd().equals("83")) { + // 부과제외(TB_LEVY_EXCL) 대장 등록 + Excl01 excl01 = new Excl01(); + excl01.setSggCd(""); // TODO:시군구 + excl01.setTaskSeCd(crdn.getTaskSeCd()); + excl01.setCrdnId(crdn.getCrdnId()); + excl01.setLevyExclYmd(strCurrentDate); + excl01.setLevyExclSeCd("2"); + excl01.setLevyExclRsnCd("192"); + excl01.setEtcCn(""); + + result = excl01Bean.createLevyExclusion(excl01); + if (!result) { + return false; + } + + taskDtlId = excl01.getLevyExclId(); + } + + // 단속상태이력(TB_CRDN_STTS_HSTRY) 대장 등록 + CrdnSttsHstry crdnSttsHstry = new CrdnSttsHstry(); + crdnSttsHstry.setCrdnId(crdn.getCrdnId()); + crdnSttsHstry.setBfrSttsCd(""); + crdnSttsHstry.setBfrSttsChgDt(""); + crdnSttsHstry.setCrdnSttsCd(crdn.getCrdnSttsCd()); + crdnSttsHstry.setTaskDtlId(taskDtlId); + crdnSttsHstry.setEtcCn(""); + + result = crdnSttsHstryBean.create(crdnSttsHstry); + if (!result) { + return false; + } + + return result; + } + } diff --git a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn06ServiceBean.java b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn06ServiceBean.java index 3a8f70f5..a4c4ee61 100644 --- a/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn06ServiceBean.java +++ b/src/main/java/cokr/xit/fims/crdn/service/bean/Crdn06ServiceBean.java @@ -8,6 +8,7 @@ import javax.annotation.Resource; import org.springframework.stereotype.Service; +import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.dao.Crdn06Mapper; import cokr.xit.fims.crdn.service.CrdnService; @@ -91,4 +92,9 @@ public class Crdn06ServiceBean extends AbstractServiceBean implements CrdnServic return dataObjectList; } + + public boolean update(Crdn crdn) { + return crdn06Bean.update(crdn); + } + } diff --git a/src/main/java/cokr/xit/fims/crdn/web/Crdn01Controller.java b/src/main/java/cokr/xit/fims/crdn/web/Crdn01Controller.java index 5cf95609..fb1f2c55 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn01Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn01Controller.java @@ -12,8 +12,6 @@ import cokr.xit.base.code.CommonCode; import cokr.xit.base.web.ApplicationController; import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; -import cokr.xit.fims.crdn.service.CrdnService; -import cokr.xit.fims.crdn.service.bean.Crdn01Bean; import cokr.xit.fims.crdn.service.bean.Crdn01ServiceBean; import cokr.xit.foundation.UserInfo; import cokr.xit.foundation.data.DataObject; @@ -24,11 +22,8 @@ import cokr.xit.foundation.data.DataObject; */ public class Crdn01Controller extends ApplicationController { - @Resource(name="crdn01Bean") - private Crdn01Bean crdn01Bean; - @Resource(name="crdn01Service") - private CrdnService crdn01Service; + private Crdn01ServiceBean crdn01Service; /** 민원 접수 자료 메인화면을 연다. * @return fims/crdn/crdn01010-main @@ -86,7 +81,7 @@ public class Crdn01Controller extends ApplicationController { ModelAndView mav = new ModelAndView(json ? "jsonView" : "fims/crdn/crdn01050-info"); mav.addObject("pageName", "crdn01050-info"); - DataObject info = crdn01Bean.getCivilComplaintOriginalInfo(req); + DataObject info = crdn01Service.getCivilComplaintOriginalInfo(req); mav.addObject("cvlcptInfo", json ? info : toJson(info)); return mav; @@ -167,7 +162,7 @@ public class Crdn01Controller extends ApplicationController { */ @RequestMapping(name="민원자료 제거", value="/010/remove.do") public ModelAndView removeCivilComplaint(Crdn crdn) { - boolean saved = crdn01Bean.removeCivilComplaint(crdn.getCrdnIDs()); + boolean saved = crdn01Service.removeCivilComplaint(crdn.getCrdnIDs()); return new ModelAndView("jsonView") .addObject("saved", saved); diff --git a/src/main/java/cokr/xit/fims/crdn/web/Crdn02Controller.java b/src/main/java/cokr/xit/fims/crdn/web/Crdn02Controller.java index c79225d5..af3e3ab7 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn02Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn02Controller.java @@ -5,7 +5,7 @@ import javax.annotation.Resource; import org.springframework.web.servlet.ModelAndView; import cokr.xit.base.web.ApplicationController; -import cokr.xit.fims.crdn.service.CrdnService; +import cokr.xit.fims.crdn.service.bean.Crdn02ServiceBean; /**민원 개별 등록 서비스 웹 컨트롤러.
    * {웹 컨텍스트}/crdn/crdn02 로 접근할 수 있다. @@ -14,7 +14,7 @@ import cokr.xit.fims.crdn.service.CrdnService; public class Crdn02Controller extends ApplicationController { @Resource(name="crdn02Service") - private CrdnService crdn02Service; + private Crdn02ServiceBean crdn02Service; /** 민원 개별 등록 메인화면을 연다. * @return fims/crdn/crdn02010-main diff --git a/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java b/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java index 488fd621..e598f93c 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn05Controller.java @@ -17,8 +17,6 @@ import cokr.xit.base.file.web.FileInfoFactory; import cokr.xit.base.web.ApplicationController; import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; -import cokr.xit.fims.crdn.service.CrdnService; -import cokr.xit.fims.crdn.service.bean.Crdn05Bean; import cokr.xit.fims.crdn.service.bean.Crdn05ServiceBean; /**단속 자료 등록 서비스 웹 컨트롤러.
    @@ -27,11 +25,8 @@ import cokr.xit.fims.crdn.service.bean.Crdn05ServiceBean; */ public class Crdn05Controller extends ApplicationController { - @Resource(name="crdn05Bean") - private Crdn05Bean crdn05Bean; - @Resource(name="crdn05Service") - private CrdnService crdn05Service; + private Crdn05ServiceBean crdn05Service; /** 단속 자료 등록 메인화면을 연다. * @return fims/crdn/crdn05010-main @@ -138,9 +133,9 @@ public class Crdn05Controller extends ApplicationController { if(uploadFileList != null) { List fileInfoList = new FileInfoFactory().makeFileInfos(null, uploadFileList); - saved = crdn05Bean.create(crdn, fileInfoList); + saved = crdn05Service.create(crdn, fileInfoList); } else { - saved = crdn05Bean.create(crdn); + saved = crdn05Service.create(crdn); } return new ModelAndView("jsonView") diff --git a/src/main/java/cokr/xit/fims/crdn/web/Crdn06Controller.java b/src/main/java/cokr/xit/fims/crdn/web/Crdn06Controller.java index b6d225aa..1fad9544 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn06Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn06Controller.java @@ -11,7 +11,6 @@ import org.springframework.web.servlet.ModelAndView; import cokr.xit.base.code.CommonCode; import cokr.xit.base.web.ApplicationController; import cokr.xit.fims.crdn.CrdnQuery; -import cokr.xit.fims.crdn.service.CrdnService; import cokr.xit.fims.crdn.service.bean.Crdn06ServiceBean; /**단속 관리 서비스 웹 컨트롤러.
    @@ -21,7 +20,7 @@ import cokr.xit.fims.crdn.service.bean.Crdn06ServiceBean; public class Crdn06Controller extends ApplicationController { @Resource(name="crdn06Service") - private CrdnService crdn06Service; + private Crdn06ServiceBean crdn06Service; /** 단속 관리 메인화면을 연다. * @return fims/crdn/crdn06010-main diff --git a/src/main/java/cokr/xit/fims/task/web/DpvController.java b/src/main/java/cokr/xit/fims/task/web/DpvController.java index 29ad1ba4..13b24c38 100644 --- a/src/main/java/cokr/xit/fims/task/web/DpvController.java +++ b/src/main/java/cokr/xit/fims/task/web/DpvController.java @@ -9,8 +9,7 @@ import org.springframework.web.servlet.ModelAndView; import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.CrdnQuery; -import cokr.xit.fims.crdn.service.CrdnService; -import cokr.xit.fims.crdn.service.bean.Crdn06Bean; +import cokr.xit.fims.crdn.service.bean.Crdn06ServiceBean; @Controller public class DpvController { @@ -31,10 +30,7 @@ public class DpvController { @RequestMapping(name="장애인과태료업무 단속업무", value="/DPV/crdn/crdn06") class Crdn06Controller extends cokr.xit.fims.crdn.web.Crdn06Controller { @Resource(name="crdn06Service") - private CrdnService crdn06Service; - - @Resource(name="crdn06Bean") - private Crdn06Bean crdn06Bean; + private Crdn06ServiceBean crdn06Service; /**표지정보미확인자료 목록을 조회한다.
    * {@link Crdn06Service#getCrackdownList(CrdnQuery)} 참고 @@ -65,10 +61,10 @@ public class DpvController { * "saved": 수정되었으면 true, 그렇지 않으면 false * } */ - @PostMapping(name = "단속 대장 수정", value = "/030/update.do") + @PostMapping(name = "표지정보 미확인 자료 수정", value = "/030/update.do") public ModelAndView update(Crdn crdn) { crdn.setUpdateInfomation("tagInformationUndefinedData"); - boolean saved = crdn06Bean.update(crdn); + boolean saved = crdn06Service.update(crdn); return new ModelAndView("jsonView") .addObject("saved", saved); }