jjh 1 year ago
commit 47be3dab1d

@ -23,6 +23,7 @@ public class CrdnQuery extends CmmnQuery {
//현재정보 //현재정보
private String currentUserId; private String currentUserId;
private String currentUserAcnt;
private String currentInstitute; private String currentInstitute;
//ID //ID
@ -96,6 +97,15 @@ public class CrdnQuery extends CmmnQuery {
return self(); return self();
} }
public String getCurrentUserAcnt() {
return ifEmpty(currentUserAcnt, () -> null);
}
public <T extends CrdnQuery> T setCurrentUserAcnt(String currentUserAcnt) {
this.currentUserAcnt = currentUserAcnt;
return self();
}
public String getCurrentInstitute() { public String getCurrentInstitute() {
return ifEmpty(currentInstitute, () -> null); return ifEmpty(currentInstitute, () -> null);
} }

@ -72,7 +72,7 @@ public interface CrdnCvlcptService {
* @param processType , crdnIDs ID * @param processType , crdnIDs ID
* @return * @return
*/ */
boolean updateAnswerTargetProcessStatus(String processType, String[] crdnIDs); boolean updateAnswerTargetProcessStatus(String processType, String currentUserInstitute, String currentUserAcnt, String[] crdnIDs);
/** . /** .
* @param crdnQuery * @param crdnQuery

@ -162,7 +162,7 @@ public class CrdnCvlcptMainBean extends AbstractComponent {
* @param crdnId ID * @param crdnId ID
* @return * @return
*/ */
public String mappingAnswerWords(String crdnId) { public String mappingAnswerWords(String crdnId, String currentUserInstitute, String currentUserAcnt) {
DataObject dataInfo = crdnInfoMapper.selectCrdnInfo(crdnId); DataObject dataInfo = crdnInfoMapper.selectCrdnInfo(crdnId);
@ -199,7 +199,7 @@ public class CrdnCvlcptMainBean extends AbstractComponent {
String joinWords = head + "\n\n" + body + "\n\n" + tail; 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()); String completeWords = this.replaceMacroString(joinWords , currentUser.getPhoneNo(), currentUser.getName());

@ -246,7 +246,7 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
//저장된 답변이 없으면 //저장된 답변이 없으면
if(ifEmpty(dataObject.string("CVLCPT_PRCS_RSLT_CN"), () -> "").equals("")) { 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); dataObject.set("CVLCPT_PRCS_RSLT_CN", resultWords);
} }
@ -628,7 +628,7 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
} }
@Override @Override
public boolean updateAnswerTargetProcessStatus(String processType, String[] crdnIDs) { public boolean updateAnswerTargetProcessStatus(String processType, String currentUserInstitute, String currentUserAcnt, String[] crdnIDs) {
List<DataObject> targetDataList = crdnCvlcptMapper.selectAnswerTargetList(crdnIDs); List<DataObject> targetDataList = crdnCvlcptMapper.selectAnswerTargetList(crdnIDs);
@ -639,7 +639,7 @@ public class CrdnCvlcptServiceBean extends AbstractServiceBean implements CrdnCv
if(processType.equals("answerExecute")) { if(processType.equals("answerExecute")) {
crdnCvlcpt.setCvlcptTrsmCd("04"); crdnCvlcpt.setCvlcptTrsmCd("04");
if(ifEmpty(targetDataList.get(i).string("CVLCPT_PRCS_RSLT_CN"), () -> "").equals("")) { 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); crdnCvlcpt.setCvlcptPrcsRsltCn(answerWords);
} }
} else if(processType.equals("answerComplete")){ } else if(processType.equals("answerComplete")){

@ -78,6 +78,8 @@ public class Cvlc02Controller extends ApplicationController {
mav.addObject("taskSeCd", urlTaskSeCd); mav.addObject("taskSeCd", urlTaskSeCd);
query.setTaskSeCd(urlTaskSeCd); query.setTaskSeCd(urlTaskSeCd);
query.setCurrentInstitute(currentUser().getInstitute());
query.setCurrentUserAcnt(currentUser().getAccount());
DataObject cvlcptInfo = crdnCvlcptService.getAnswerPreview(query); DataObject cvlcptInfo = crdnCvlcptService.getAnswerPreview(query);
mav.addObject("cvlcptInfo", json ? cvlcptInfo : toJson(cvlcptInfo)); mav.addObject("cvlcptInfo", json ? cvlcptInfo : toJson(cvlcptInfo));
@ -113,8 +115,9 @@ public class Cvlc02Controller extends ApplicationController {
public ModelAndView updateAnswerTargetProcessStatus(String processType, String... crdnIDs) { public ModelAndView updateAnswerTargetProcessStatus(String processType, String... crdnIDs) {
boolean saved = false; boolean saved = false;
String currentInstitute = currentUser().getInstitute();
saved = crdnCvlcptService.updateAnswerTargetProcessStatus(processType, crdnIDs); String currentUserAcnt = currentUser().getAccount();
saved = crdnCvlcptService.updateAnswerTargetProcessStatus(processType, currentInstitute, currentUserAcnt, crdnIDs);
return new ModelAndView("jsonView") return new ModelAndView("jsonView")
.addObject("saved", saved); .addObject("saved", saved);

Loading…
Cancel
Save