jjh 1 year ago
commit 47be3dab1d

@ -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 extends CrdnQuery> T setCurrentUserAcnt(String currentUserAcnt) {
this.currentUserAcnt = currentUserAcnt;
return self();
}
public String getCurrentInstitute() {
return ifEmpty(currentInstitute, () -> null);
}

@ -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

@ -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());

@ -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<DataObject> 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")){

@ -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);

Loading…
Cancel
Save