From ffd77be73a431dddc86cb690ee0538995be4c98c Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 28 Dec 2023 18:03:33 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8B=9C=EA=B5=B0=EA=B5=AC=EB=B3=84=20?= =?UTF-8?q?=EC=97=85=EB=AC=B4=EA=B5=AC=EB=B6=84=EC=BD=94=EB=93=9C(?= =?UTF-8?q?=EA=B3=B5=ED=86=B5=EC=BD=94=EB=93=9C)=20=EC=B6=94=EC=B6=9C=20?= =?UTF-8?q?=ED=95=A8=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/fims/cmmn/service/bean/StngBean.java | 27 +++++++++++++++++++ .../xit/fims/sprt/web/Sprt01Controller.java | 26 ++++-------------- 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/src/main/java/cokr/xit/fims/cmmn/service/bean/StngBean.java b/src/main/java/cokr/xit/fims/cmmn/service/bean/StngBean.java index 890300dd..38b43ec9 100644 --- a/src/main/java/cokr/xit/fims/cmmn/service/bean/StngBean.java +++ b/src/main/java/cokr/xit/fims/cmmn/service/bean/StngBean.java @@ -9,6 +9,7 @@ import javax.annotation.Resource; import org.springframework.stereotype.Component; +import cokr.xit.base.code.CommonCode; import cokr.xit.base.code.service.CodeQuery; import cokr.xit.base.code.service.bean.CodeBean; import cokr.xit.base.security.Authority; @@ -160,4 +161,30 @@ public class StngBean extends AbstractComponent { return effected == 1 ? true : false; } + /** 업무구분코드 목록 중에서 현재 로그인한 사용자의 시군구에서 사용하는 업무구분코드 목록만 반환한다. + * @param taskSectionCodes 업무구분코드 목록 + * @return 현재 로그인한 사용자의 시군구에서 사용하는 업무구분코드 목록 + */ + public List filterTaskSectionCodeForSgg(List taskSectionCodes) { + + List taskListForSgg = new ArrayList(); + if(currentUser().getInstitute().equals("default")) { + taskListForSgg = taskSectionCodes; + } else { + SecuredUserInfo userInfo = currentUser(); + Map info = userInfo.getInfo(); + if(info == null || info.get("sggCd") == null || info.get("sggCd").equals("")) { + factionBean.initUserInfo(userInfo); + } + + List taskSeCdListForSgg = taskBean.getTasks((new CmmnQuery()).setSggCd((String)userInfo.getInfo().get("sggCd")).setUseYN("Y")) + .stream().map(item -> item.string("TASK_SE_CD")).toList(); + + taskListForSgg = taskSectionCodes.stream() + .filter(item -> taskSeCdListForSgg.contains(item.getCode())).toList(); + } + + return taskListForSgg; + } + } 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 116f55c8..dc4da525 100644 --- a/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java +++ b/src/main/java/cokr/xit/fims/sprt/web/Sprt01Controller.java @@ -21,13 +21,12 @@ import cokr.xit.base.code.CommonCode; import cokr.xit.base.file.xls.XLSWriter; import cokr.xit.base.file.xls.XLSWriter.CellDef; import cokr.xit.base.file.xls.XLSWriter.Styler; -import cokr.xit.base.security.SecuredUserInfo; import cokr.xit.base.user.ManagedUser; import cokr.xit.base.user.dao.UserMapper; import cokr.xit.base.web.ApplicationController; -import cokr.xit.fims.cmmn.CmmnQuery; import cokr.xit.fims.cmmn.CmmnUtil; import cokr.xit.fims.cmmn.service.bean.FactionBean; +import cokr.xit.fims.cmmn.service.bean.StngBean; import cokr.xit.fims.cmmn.service.bean.TaskBean; import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.dao.GlobalStngMapper; @@ -105,6 +104,9 @@ public class Sprt01Controller extends ApplicationController { @Resource(name = "factionBean") private FactionBean factionBean; + @Resource(name = "stngBean") + private StngBean stngBean; + /**통합 조회 메인화면(fims/sprt/sprt01/010-main)을 연다. * * @return /fims/sprt/sprt01010 @@ -127,25 +129,7 @@ public class Sprt01Controller extends ApplicationController { mav.addObject("FIM010List", commonCodes.get("FIM010")); mav.addObject("FIM026List", commonCodes.get("FIM026")); mav.addObject("FIM054List", commonCodes.get("FIM054")); - - List taskListForSgg = new ArrayList(); - if(currentUser().getInstitute().equals("default")) { - taskListForSgg = commonCodes.get("FIM054"); - } else { - SecuredUserInfo userInfo = currentUser(); - Map info = userInfo.getInfo(); - if(info == null || info.get("sggCd") == null || info.get("sggCd").equals("")) { - factionBean.initUserInfo(userInfo); - } - - List taskSeCdListForSgg = taskBean.getTasks((new CmmnQuery()).setSggCd((String)userInfo.getInfo().get("sggCd")).setUseYN("Y")) - .stream().map(item -> item.string("TASK_SE_CD")).toList(); - - taskListForSgg = commonCodes.get("FIM054").stream() - .filter(item -> taskSeCdListForSgg.contains(item.getCode())).toList(); - } - mav.addObject("TaskListForSgg", taskListForSgg); - + mav.addObject("TaskListForSgg", stngBean.filterTaskSectionCodeForSgg(commonCodes.get("FIM054"))); mav.addObject("FIM004List", commonCodes.get("FIM004")); mav.addObject("FIM005List", commonCodes.get("FIM005")); mav.addObject("FIM006List", commonCodes.get("FIM006"));