File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
package itn.let.mjo.conf.web;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
import itn.com.cmm.LoginVO;
import itn.com.cmm.util.StringUtil;
import itn.com.utl.fcc.service.EgovStringUtil;
import itn.let.mjo.conf.service.MjonConfService;
import itn.let.mjo.conf.service.MjonConfVO;
@Controller
public class MjonConfController {
@Resource(name = "mjonConfService")
private MjonConfService mjonConfService;
/**
* @Method Name : updateMjonConfAjax
* @작성일 : 2023. 2. 22.
* @작성자 : anjooyoung
* @Method 설명 : 문자온 설정 수정 Ajax
*/
@RequestMapping(value = "/web/mjon/conf/selectMjonMsgUseConfAjax.do")
public ModelAndView selectMjonMsgUseConfAjax(@ModelAttribute MjonConfVO confVO, Model model) throws Exception {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView");
try {
MjonConfVO vo = mjonConfService.selectConfDetail("CONF01"); //문자발송 사용여부
if(vo == null || "".equals(vo.getConfCode()) || !"Y".equals(vo.getConfCode())) {
modelAndView.addObject("message", "문자 발송 불가");
modelAndView.addObject("result", "fail");
} else {
modelAndView.addObject("message", "문자 발송 가능");
modelAndView.addObject("result", "success");
}
}catch (Exception e) {
modelAndView.addObject("message", "오류가 발생하였습니다.");
modelAndView.addObject("result", "fail");
}
return modelAndView;
}
/**
* @Method Name : updateMjonConfAjax
* @작성일 : 2023. 2. 22.
* @작성자 : anjooyoung
* @Method 설명 : 문자온 설정 수정 Ajax
*/
@RequestMapping(value = "/let/mjo/conf/updateMjonConfAjax.do")
public ModelAndView updateMjonConfAjax(@ModelAttribute MjonConfVO confVO, Model model) throws Exception {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView");
try {
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
if(StringUtil.isEmpty(userId)) {
modelAndView.addObject("message", "로그인 정보가 없습니다.");
modelAndView.addObject("result", "fail");
modelAndView.setViewName("redirect:/uat/uia/EgovLoginUsr.do");
return modelAndView;
}
confVO.setLastUpdusrId(loginVO.getId());
int succCnt = mjonConfService.updateConfCode(confVO);
if(succCnt > 0) {
modelAndView.addObject("message", "수정 완료.");
modelAndView.addObject("result", "success");
} else {
modelAndView.addObject("message", "수정 실패.");
modelAndView.addObject("result", "fail");
}
}catch (Exception e) {
modelAndView.addObject("message", "오류가 발생하였습니다.");
modelAndView.addObject("result", "fail");
}
return modelAndView;
}
}