From fe35a76066cf12c660aab7b60a66e59f08f2faa7 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 31 Aug 2023 17:45:10 +0900 Subject: [PATCH] =?UTF-8?q?=EC=86=8C=EC=8A=A4=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/cokr/xit/fims/crdn/CrdnQuery.java | 10 ++++++++++ .../cokr/xit/fims/cvlc/service/CrdnCvlcptService.java | 2 +- .../xit/fims/cvlc/service/bean/CrdnCvlcptMainBean.java | 4 ++-- .../fims/cvlc/service/bean/CrdnCvlcptServiceBean.java | 6 +++--- .../java/cokr/xit/fims/cvlc/web/Cvlc02Controller.java | 7 +++++-- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/main/java/cokr/xit/fims/crdn/CrdnQuery.java b/src/main/java/cokr/xit/fims/crdn/CrdnQuery.java index 3d851f7f..5364b993 100644 --- a/src/main/java/cokr/xit/fims/crdn/CrdnQuery.java +++ b/src/main/java/cokr/xit/fims/crdn/CrdnQuery.java @@ -23,6 +23,7 @@ public class CrdnQuery extends CmmnQuery { //현재정보 private String currentUserId; + private String currentUserAcnt; private String currentInstitute; //ID @@ -96,6 +97,15 @@ public class CrdnQuery extends CmmnQuery { return self(); } + public String getCurrentUserAcnt() { + return ifEmpty(currentUserAcnt, () -> null); + } + + public T setCurrentUserAcnt(String currentUserAcnt) { + this.currentUserAcnt = currentUserAcnt; + return self(); + } + public String getCurrentInstitute() { return ifEmpty(currentInstitute, () -> null); } diff --git a/src/main/java/cokr/xit/fims/cvlc/service/CrdnCvlcptService.java b/src/main/java/cokr/xit/fims/cvlc/service/CrdnCvlcptService.java index 5a5a28a1..f5c219be 100644 --- a/src/main/java/cokr/xit/fims/cvlc/service/CrdnCvlcptService.java +++ b/src/main/java/cokr/xit/fims/cvlc/service/CrdnCvlcptService.java @@ -72,7 +72,7 @@ public interface CrdnCvlcptService { * @param processType 처리 유형, crdnIDs 단속ID목록 * @return 저장여부 */ - boolean updateAnswerTargetProcessStatus(String processType, String[] crdnIDs); + boolean updateAnswerTargetProcessStatus(String processType, String currentUserInstitute, String currentUserAcnt, String[] crdnIDs); /** 민원답변 문구 설정 정보를 조회한다. * @param crdnQuery 조회 조건 diff --git a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptMainBean.java b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptMainBean.java index 1fa161e8..ddaa8a2f 100644 --- a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptMainBean.java +++ b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptMainBean.java @@ -162,7 +162,7 @@ public class CrdnCvlcptMainBean extends AbstractComponent { * @param crdnId 단속 ID * @return 답변 예정 문구 */ - public String mappingAnswerWords(String crdnId) { + public String mappingAnswerWords(String crdnId, String currentUserInstitute, String currentUserAcnt) { DataObject dataInfo = crdnInfoMapper.selectCrdnInfo(crdnId); @@ -199,7 +199,7 @@ public class CrdnCvlcptMainBean extends AbstractComponent { String joinWords = head + "\n\n" + body + "\n\n" + tail; - ManagedUser currentUser = userMapper.getUser(UserInfo.current().getAccount(), UserInfo.current().getInstitute()); + ManagedUser currentUser = userMapper.getUser(currentUserAcnt, currentUserInstitute); String completeWords = this.replaceMacroString(joinWords , currentUser.getPhoneNo(), currentUser.getName()); diff --git a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java index 1c14cd40..02eebd9f 100644 --- a/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java +++ b/src/main/java/cokr/xit/fims/cvlc/service/bean/CrdnCvlcptServiceBean.java @@ -246,7 +246,7 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv //저장된 답변이 없으면 if(ifEmpty(dataObject.string("CVLCPT_PRCS_RSLT_CN"), () -> "").equals("")) { - String resultWords = crdnCvlcptMainBean.mappingAnswerWords(query.getCrdnId()); + String resultWords = crdnCvlcptMainBean.mappingAnswerWords(query.getCrdnId(), query.getCurrentInstitute(), query.getCurrentUserAcnt()); dataObject.set("CVLCPT_PRCS_RSLT_CN", resultWords); } @@ -628,7 +628,7 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv } @Override - public boolean updateAnswerTargetProcessStatus(String processType, String[] crdnIDs) { + public boolean updateAnswerTargetProcessStatus(String processType, String currentUserInstitute, String currentUserAcnt, String[] crdnIDs) { List targetDataList = crdnCvlcptMapper.selectAnswerTargetList(crdnIDs); @@ -639,7 +639,7 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv if(processType.equals("answerExecute")) { crdnCvlcpt.setCvlcptTrsmCd("04"); if(ifEmpty(targetDataList.get(i).string("CVLCPT_PRCS_RSLT_CN"), () -> "").equals("")) { - String answerWords = crdnCvlcptMainBean.mappingAnswerWords(targetDataList.get(i).string("CRDN_ID")); + String answerWords = crdnCvlcptMainBean.mappingAnswerWords(targetDataList.get(i).string("CRDN_ID"), currentUserInstitute, currentUserAcnt); crdnCvlcpt.setCvlcptPrcsRsltCn(answerWords); } } else if(processType.equals("answerComplete")){ diff --git a/src/main/java/cokr/xit/fims/cvlc/web/Cvlc02Controller.java b/src/main/java/cokr/xit/fims/cvlc/web/Cvlc02Controller.java index b467617c..9dcb7eda 100644 --- a/src/main/java/cokr/xit/fims/cvlc/web/Cvlc02Controller.java +++ b/src/main/java/cokr/xit/fims/cvlc/web/Cvlc02Controller.java @@ -78,6 +78,8 @@ public class Cvlc02Controller extends ApplicationController { mav.addObject("taskSeCd", urlTaskSeCd); query.setTaskSeCd(urlTaskSeCd); + query.setCurrentInstitute(currentUser().getInstitute()); + query.setCurrentUserAcnt(currentUser().getAccount()); DataObject cvlcptInfo = crdnCvlcptService.getAnswerPreview(query); mav.addObject("cvlcptInfo", json ? cvlcptInfo : toJson(cvlcptInfo)); @@ -113,8 +115,9 @@ public class Cvlc02Controller extends ApplicationController { public ModelAndView updateAnswerTargetProcessStatus(String processType, String... crdnIDs) { boolean saved = false; - - saved = crdnCvlcptService.updateAnswerTargetProcessStatus(processType, crdnIDs); + String currentInstitute = currentUser().getInstitute(); + String currentUserAcnt = currentUser().getAccount(); + saved = crdnCvlcptService.updateAnswerTargetProcessStatus(processType, currentInstitute, currentUserAcnt, crdnIDs); return new ModelAndView("jsonView") .addObject("saved", saved);