시군구별 업무구분코드(공통코드) 추출 함수 추가

main
이범준 11 months ago
parent 7d45c75288
commit ffd77be73a

@ -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<CommonCode> filterTaskSectionCodeForSgg(List<CommonCode> taskSectionCodes) {
List<CommonCode> taskListForSgg = new ArrayList<CommonCode>();
if(currentUser().getInstitute().equals("default")) {
taskListForSgg = taskSectionCodes;
} else {
SecuredUserInfo userInfo = currentUser();
Map<String, Object> info = userInfo.getInfo();
if(info == null || info.get("sggCd") == null || info.get("sggCd").equals("")) {
factionBean.initUserInfo(userInfo);
}
List<String> 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;
}
}

@ -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<CommonCode> taskListForSgg = new ArrayList<CommonCode>();
if(currentUser().getInstitute().equals("default")) {
taskListForSgg = commonCodes.get("FIM054");
} else {
SecuredUserInfo userInfo = currentUser();
Map<String, Object> info = userInfo.getInfo();
if(info == null || info.get("sggCd") == null || info.get("sggCd").equals("")) {
factionBean.initUserInfo(userInfo);
}
List<String> 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"));

Loading…
Cancel
Save