|
|
@ -1,9 +1,7 @@
|
|
|
|
package kr.xit.framework.biz.mng.web;
|
|
|
|
package kr.xit.framework.biz.mng.web;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
@ -25,8 +23,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.databind.JsonMappingException;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
|
|
|
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
|
|
|
import kr.xit.framework.biz.mng.model.ProgramMngSearchVO;
|
|
|
|
import kr.xit.framework.biz.mng.model.ProgramMngSearchVO;
|
|
|
|
import kr.xit.framework.biz.mng.model.ProgramMngVO;
|
|
|
|
import kr.xit.framework.biz.mng.model.ProgramMngVO;
|
|
|
@ -41,7 +37,6 @@ import kr.xit.framework.support.exception.BizRuntimeException;
|
|
|
|
import kr.xit.framework.support.mybatis.MybatisUtils;
|
|
|
|
import kr.xit.framework.support.mybatis.MybatisUtils;
|
|
|
|
import kr.xit.framework.support.util.AjaxMessageMapRenderer;
|
|
|
|
import kr.xit.framework.support.util.AjaxMessageMapRenderer;
|
|
|
|
import kr.xit.framework.support.util.AjaxUtils;
|
|
|
|
import kr.xit.framework.support.util.AjaxUtils;
|
|
|
|
import kr.xit.framework.support.util.constants.Globals;
|
|
|
|
|
|
|
|
import kr.xit.framework.support.util.constants.MessageKey;
|
|
|
|
import kr.xit.framework.support.util.constants.MessageKey;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -124,11 +119,38 @@ public class ProgramMngController {
|
|
|
|
|
|
|
|
|
|
|
|
/*@PostMapping(value = "ProgramMng_list.ajax")*/
|
|
|
|
/*@PostMapping(value = "ProgramMng_list.ajax")*/
|
|
|
|
@RequestMapping(value = "/programList", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
|
@RequestMapping(value = "/programList", method = {RequestMethod.GET, RequestMethod.POST})
|
|
|
|
public ModelAndView finds(@RequestParam Map<String,Object> paramMap) {
|
|
|
|
public ModelAndView findPrograms(@RequestParam final Map<String,Object> paramMap) {
|
|
|
|
|
|
|
|
|
|
|
|
return ResultResponse.of(programMngService.findList(paramMap, MybatisUtils.getPagingInfo(paramMap)));
|
|
|
|
return ResultResponse.of(programMngService.findPrograms(paramMap, MybatisUtils.getPagingInfo(paramMap)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/updateProgram")
|
|
|
|
|
|
|
|
public ModelAndView modifyProgram(
|
|
|
|
|
|
|
|
@ModelAttribute("progrmMngVO") final ProgramMngVO vo
|
|
|
|
|
|
|
|
, @RequestParam(value="checkedProgrmFileNmForDel", required=false, defaultValue="") String checkedProgrmFileNmForDel
|
|
|
|
|
|
|
|
, final BindingResult bindingResult
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//유효성 확인
|
|
|
|
|
|
|
|
//2020.11.24. 주석처리
|
|
|
|
|
|
|
|
beanValidator.validate(vo, bindingResult);
|
|
|
|
|
|
|
|
// beanValidator.validate("progrmMngVO", vo, bindingResult);
|
|
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
|
|
|
throw BizRuntimeException.create(MessageKey.CMM_UPDATE_FAIL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
if (vo.getProgrmDc() == null || vo.getProgrmDc().equals("")) {
|
|
|
|
|
|
|
|
vo.setProgrmDc(" ");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
programMngService.modifyProgram(vo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS);
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* <pre>메소드 설명: 요청 페이지로 이동 한다.</pre>
|
|
|
|
* <pre>메소드 설명: 요청 페이지로 이동 한다.</pre>
|
|
|
@ -140,7 +162,7 @@ public class ProgramMngController {
|
|
|
|
* @date: 2020. 3. 26.
|
|
|
|
* @date: 2020. 3. 26.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RequestMapping(value = "/program_{cmd}", method={RequestMethod.GET, RequestMethod.POST})
|
|
|
|
@RequestMapping(value = "/program_{cmd}", method={RequestMethod.GET, RequestMethod.POST})
|
|
|
|
public String ProgramMng_page(@PathVariable String cmd
|
|
|
|
public String ProgramMng_page(@PathVariable final String cmd
|
|
|
|
, @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef
|
|
|
|
, @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef
|
|
|
|
, @ModelAttribute("progrmMngVO") ProgramMngVO vo
|
|
|
|
, @ModelAttribute("progrmMngVO") ProgramMngVO vo
|
|
|
|
, ModelMap model) {
|
|
|
|
, ModelMap model) {
|
|
|
@ -149,7 +171,7 @@ public class ProgramMngController {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "edit": //수정 페이지
|
|
|
|
case "edit": //수정 페이지
|
|
|
|
case "view": //상세 페이지
|
|
|
|
case "view": //상세 페이지
|
|
|
|
ProgramMngVO programMngVO = programMngService.findView(vo);
|
|
|
|
ProgramMngVO programMngVO = programMngService.findProgram(vo);
|
|
|
|
model.addAttribute("progrmMngVO", programMngVO);
|
|
|
|
model.addAttribute("progrmMngVO", programMngVO);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
@ -196,14 +218,14 @@ public class ProgramMngController {
|
|
|
|
/*model.addAttribute("list_progrmmanage", xitProgramMngService.findList(searchVO));*/
|
|
|
|
/*model.addAttribute("list_progrmmanage", xitProgramMngService.findList(searchVO));*/
|
|
|
|
model.addAttribute("searchVO", searchVO);
|
|
|
|
model.addAttribute("searchVO", searchVO);
|
|
|
|
|
|
|
|
|
|
|
|
int totCnt = programMngService.findListTotCnt(searchVO);
|
|
|
|
//int totCnt = programMngService.findListTotCnt(searchVO);
|
|
|
|
paginationInfo.setTotalRecordCount(totCnt);
|
|
|
|
//paginationInfo.setTotalRecordCount(totCnt);
|
|
|
|
model.addAttribute("paginationInfo", paginationInfo);
|
|
|
|
model.addAttribute("paginationInfo", paginationInfo);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "input" :
|
|
|
|
case "input" :
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "edit" :
|
|
|
|
case "edit" :
|
|
|
|
ProgramMngVO xitProgramMngVO = programMngService.findView(vo);
|
|
|
|
ProgramMngVO xitProgramMngVO = programMngService.findProgram(vo);
|
|
|
|
model.addAttribute("progrmMngVO", xitProgramMngVO);
|
|
|
|
model.addAttribute("progrmMngVO", xitProgramMngVO);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
@ -255,7 +277,7 @@ public class ProgramMngController {
|
|
|
|
vo.setProgrmDc(" ");
|
|
|
|
vo.setProgrmDc(" ");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//처리
|
|
|
|
//처리
|
|
|
|
programMngService.addProc(vo);
|
|
|
|
programMngService.addProgram(vo);
|
|
|
|
message = xitMessageSource.getMessage("success.common.insert");
|
|
|
|
message = xitMessageSource.getMessage("success.common.insert");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
@ -277,14 +299,14 @@ public class ProgramMngController {
|
|
|
|
vo.setProgrmDc(" ");
|
|
|
|
vo.setProgrmDc(" ");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//처리
|
|
|
|
//처리
|
|
|
|
programMngService.modifyProc(vo);
|
|
|
|
programMngService.modifyProgram(vo);
|
|
|
|
message = xitMessageSource.getMessage("success.common.update");
|
|
|
|
message = xitMessageSource.getMessage("success.common.update");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case "delete": //삭제
|
|
|
|
case "delete": //삭제
|
|
|
|
//처리
|
|
|
|
//처리
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
programMngService.removeProc(vo);
|
|
|
|
programMngService.removeProgram(vo);
|
|
|
|
message = xitMessageSource.getMessage("success.common.delete");
|
|
|
|
message = xitMessageSource.getMessage("success.common.delete");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
} catch (RuntimeException e) {
|
|
|
|
} catch (RuntimeException e) {
|
|
|
@ -296,17 +318,17 @@ public class ProgramMngController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case "deletes": //다건 삭제
|
|
|
|
// case "deletes": //다건 삭제
|
|
|
|
//처리
|
|
|
|
// //처리
|
|
|
|
try {
|
|
|
|
// try {
|
|
|
|
programMngService.removesProc(checkedProgrmFileNmForDel);
|
|
|
|
// programMngService.removesProgram(checkedProgrmFileNmForDel);
|
|
|
|
message = xitMessageSource.getMessage("success.common.delete");
|
|
|
|
// message = xitMessageSource.getMessage("success.common.delete");
|
|
|
|
} catch (RuntimeException e) {
|
|
|
|
// } catch (RuntimeException e) {
|
|
|
|
message = e.getMessage();
|
|
|
|
// message = e.getMessage();
|
|
|
|
} catch (Exception e) {
|
|
|
|
// } catch (Exception e) {
|
|
|
|
message = xitMessageSource.getMessage("fail.common.delete");
|
|
|
|
// message = xitMessageSource.getMessage("fail.common.delete");
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
break;
|
|
|
|
// break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
new RuntimeException("유효하지 않은 요청 입니다.");
|
|
|
|
new RuntimeException("유효하지 않은 요청 입니다.");
|
|
|
@ -366,7 +388,7 @@ public class ProgramMngController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//처리
|
|
|
|
//처리
|
|
|
|
programMngService.modifyProc(vo);
|
|
|
|
programMngService.modifyProgram(vo);
|
|
|
|
message = xitMessageSource.getMessage("success.common.update");
|
|
|
|
message = xitMessageSource.getMessage("success.common.update");
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -397,30 +419,5 @@ public class ProgramMngController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "/updateProgram")
|
|
|
|
|
|
|
|
public ModelAndView updateProgram(@ModelAttribute("progrmMngVO") ProgramMngVO vo
|
|
|
|
|
|
|
|
,@RequestParam(value="checkedProgrmFileNmForDel", required=false, defaultValue="") String checkedProgrmFileNmForDel
|
|
|
|
|
|
|
|
,BindingResult bindingResult
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
ModelAndView mav = new ModelAndView(FrameworkConstants.JSON_VIEW);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//유효성 확인
|
|
|
|
|
|
|
|
//2020.11.24. 주석처리
|
|
|
|
|
|
|
|
beanValidator.validate(vo, bindingResult);
|
|
|
|
|
|
|
|
// beanValidator.validate("progrmMngVO", vo, bindingResult);
|
|
|
|
|
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
|
|
|
|
|
throw BizRuntimeException.create(MessageKey.CMM_UPDATE_FAIL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
if (vo.getProgrmDc() == null || vo.getProgrmDc().equals("")) {
|
|
|
|
|
|
|
|
vo.setProgrmDc(" ");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
throw BizRuntimeException.create(MessageKey.CMM_UPDATE_FAIL);
|
|
|
|
|
|
|
|
//처리
|
|
|
|
|
|
|
|
// programMngService.modifyProc(vo);
|
|
|
|
|
|
|
|
// AjaxMessageMapRenderer.success(mav, MessageKey.CMM_UPDATE_SUCCESS);
|
|
|
|
|
|
|
|
// return mav;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|