|
|
|
@ -6,8 +6,11 @@ import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
import cokr.xit.base.user.ManagedUser;
|
|
|
|
|
import cokr.xit.base.user.dao.UserMapper;
|
|
|
|
|
import cokr.xit.fims.crdn.Crdn;
|
|
|
|
|
import cokr.xit.fims.crdn.CrdnQuery;
|
|
|
|
|
import cokr.xit.fims.crdn.dao.CrdnInfoMapper;
|
|
|
|
|
import cokr.xit.fims.crdn.dao.CrdnInstMapper;
|
|
|
|
|
import cokr.xit.fims.crdn.dao.CrdnUpdtMapper;
|
|
|
|
|
import cokr.xit.fims.crdn.dao.GlobalStngMapper;
|
|
|
|
@ -26,12 +29,18 @@ public class CrdnCvlcptBean extends AbstractComponent {
|
|
|
|
|
@Resource(name = "crdnCvlcptMapper")
|
|
|
|
|
private CrdnCvlcptMapper crdnCvlcptMapper;
|
|
|
|
|
|
|
|
|
|
@Resource(name = "crdnInfoMapper")
|
|
|
|
|
private CrdnInfoMapper crdnInfoMapper;
|
|
|
|
|
|
|
|
|
|
@Resource(name = "crdnInstMapper")
|
|
|
|
|
private CrdnInstMapper crdnInstMapper;
|
|
|
|
|
|
|
|
|
|
@Resource(name = "crdnUpdtMapper")
|
|
|
|
|
private CrdnUpdtMapper crdnUpdtMapper;
|
|
|
|
|
|
|
|
|
|
@Resource(name = "userMapper")
|
|
|
|
|
private UserMapper userMapper;
|
|
|
|
|
|
|
|
|
|
@Resource(name="globalStngMapper")
|
|
|
|
|
protected GlobalStngMapper globalStngMapper;
|
|
|
|
|
|
|
|
|
@ -93,26 +102,12 @@ public class CrdnCvlcptBean extends AbstractComponent {
|
|
|
|
|
return crdnCvlcptMapper.initCvlcptPrcsRsltCn(crdnCvlcpt) == 1 ? true : false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**지정한 조건에 따라 민원답변문구 대장을 조회하여 반환한다.
|
|
|
|
|
* @param taskSeCd 업무구분코드, ansRsnCd 답변 사유 코드
|
|
|
|
|
* @return 답변문구
|
|
|
|
|
*/
|
|
|
|
|
DataObject selectCvlcptAnsWordsInfo(String taskSeCd, String ansRsnCd) {
|
|
|
|
|
DataObject params = new DataObject();
|
|
|
|
|
|
|
|
|
|
params.set("sggCd", globalStngMapper.selectSggCdForCurrentUser());
|
|
|
|
|
params.set("taskSeCd", taskSeCd);
|
|
|
|
|
params.set("ansRsnCd", ansRsnCd);
|
|
|
|
|
|
|
|
|
|
return crdnCvlcptMapper.selectCvlcptAnsWordsInfo(params);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**지정한 단속자료로 복사 등록 처리한다.
|
|
|
|
|
* @param crdnId 단속 ID
|
|
|
|
|
* @return 복사자료의 단속 ID
|
|
|
|
|
*/
|
|
|
|
|
public String insertCrdnFromSelect(String crdnId) {
|
|
|
|
|
//Crdn crdn = new Crdn();
|
|
|
|
|
|
|
|
|
|
DataObject params = new DataObject();
|
|
|
|
|
UserInfo userInfo = currentUser();
|
|
|
|
|
params.set("currentUser", userInfo);
|
|
|
|
@ -128,4 +123,75 @@ public class CrdnCvlcptBean extends AbstractComponent {
|
|
|
|
|
|
|
|
|
|
return (String)params.get("newCrdnId");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**지정한 민원 자료의 답변 예정 문구를 반환한다.
|
|
|
|
|
* @param crdnId 단속 ID
|
|
|
|
|
* @return 답변 예정 문구
|
|
|
|
|
*/
|
|
|
|
|
public String mappingAnswerWords(String crdnId) {
|
|
|
|
|
|
|
|
|
|
DataObject dataInfo = crdnInfoMapper.selectCrdnInfo(crdnId);
|
|
|
|
|
|
|
|
|
|
CrdnQuery crdnQuery = new CrdnQuery();
|
|
|
|
|
crdnQuery.setTaskSeCd(dataInfo.string("TASK_SE_CD"));
|
|
|
|
|
crdnQuery.setSggCd(dataInfo.string("SGG_CD"));
|
|
|
|
|
|
|
|
|
|
if(dataInfo.string("CVLCPT_PRCS_CD").equals("02")) {
|
|
|
|
|
crdnQuery.setAnsSeCd("3");
|
|
|
|
|
crdnQuery.setAnsRsnCd("3"+dataInfo.string("VLTN_CD"));
|
|
|
|
|
|
|
|
|
|
if(dataInfo.string("DSTRBNC_YN").equals("Y")) {
|
|
|
|
|
crdnQuery.setDstrbncYn("Y");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else if(dataInfo.string("CVLCPT_PRCS_CD").equals("03")
|
|
|
|
|
|| dataInfo.string("CVLCPT_PRCS_CD").equals("04")){
|
|
|
|
|
crdnQuery.setAnsSeCd(dataInfo.string("LEVY_EXCL_SE_CD"));
|
|
|
|
|
crdnQuery.setAnsRsnCd(dataInfo.string("LEVY_EXCL_RSN_CD"));
|
|
|
|
|
} else {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DataObject bodyWordsInfo = crdnCvlcptMapper.selectCvlcptAnswerWordsInfo(crdnQuery);
|
|
|
|
|
DataObject basicWordsInfo = crdnCvlcptMapper.selectCvlcptAnswerBasicWordsInfo(crdnQuery);
|
|
|
|
|
|
|
|
|
|
String body = bodyWordsInfo.string("PRCS_RSLT_CN");
|
|
|
|
|
String head = basicWordsInfo.string("HEADER_CN");
|
|
|
|
|
String tail = basicWordsInfo.string("FOOTER_CN");
|
|
|
|
|
|
|
|
|
|
if(body.equals("")) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String joinWords = head + "\n\n" + body + "\n\n" + tail;
|
|
|
|
|
|
|
|
|
|
ManagedUser currentUser = userMapper.getUser(UserInfo.current().getAccount(), UserInfo.current().getInstitute());
|
|
|
|
|
|
|
|
|
|
String completeWords = this.replaceMacroString(joinWords , currentUser.getPhoneNo());
|
|
|
|
|
|
|
|
|
|
return completeWords;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**문구의 매크로 문자열을 치환한다.
|
|
|
|
|
* @param joinWords 전체 문구, telNo 담당자 전화번호
|
|
|
|
|
* @return 치환된 문구
|
|
|
|
|
*/
|
|
|
|
|
private String replaceMacroString(String joinWords, String telNo) {
|
|
|
|
|
|
|
|
|
|
int seq = 1;
|
|
|
|
|
|
|
|
|
|
joinWords = joinWords.replaceAll("@", "@");
|
|
|
|
|
String[] splited = joinWords.split(CrdnCvlcpt.MACRO_SEQ);
|
|
|
|
|
var seqCount = splited.length - 1;
|
|
|
|
|
if(seqCount > 0){
|
|
|
|
|
for(; seq <= seqCount; seq++){
|
|
|
|
|
joinWords = joinWords.replaceFirst(CrdnCvlcpt.MACRO_SEQ, Integer.toString(seq));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
joinWords = joinWords.replace(CrdnCvlcpt.MACRO_TELNO, telNo);
|
|
|
|
|
return joinWords;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|