149 lines
5.5 KiB
Java
149 lines
5.5 KiB
Java
package kcc.kccadr.accdnt.ass.web;
|
|
|
|
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
|
import kcc.com.cmm.LoginVO;
|
|
import kcc.com.utl.fcc.service.EgovStringUtil;
|
|
import kcc.kccadr.accdnt.ai.service.AdjstIncidentVO;
|
|
import kcc.kccadr.accdnt.ass.service.AdjustSchStatusService;
|
|
import kcc.kccadr.accdnt.ass.service.AdjustSchStatusVO;
|
|
import kcc.let.utl.fcc.service.EgovCryptoUtil;
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.ui.ModelMap;
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpSession;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* 대국민(사용자)
|
|
* 조정일정현황에 관한 controller 클래스를 정의한다.
|
|
* @author 김봉호
|
|
* @since 2021.08.11
|
|
* @version 1.0
|
|
* @see
|
|
*
|
|
* <pre>
|
|
* << 개정이력(Modification Information) >>
|
|
*
|
|
* 수정일 수정자 수정내용
|
|
* ------- -------- ---------------------------
|
|
* 2021.08.11 김봉호 최초 생성
|
|
*
|
|
* </pre>
|
|
*/
|
|
@Controller
|
|
public class AdjustSchStatusController {
|
|
|
|
|
|
@Resource(name = "adjustSchStatusService")
|
|
private AdjustSchStatusService adjustSchStatusService;
|
|
|
|
@Resource(name = "egovCryptoUtil")
|
|
EgovCryptoUtil egovCryptoUtil;
|
|
|
|
/**
|
|
* 저정일정현황 달력 화면
|
|
*/
|
|
@RequestMapping("/web/kccadr/accdnt/ass/AdjustSchStatusList.do")
|
|
public String adjustSchStatusList(@ModelAttribute("statusVO") AdjustSchStatusVO statusVO, ModelMap model) throws Exception {
|
|
return "/web/kccadr/accdnt/ass/AdjustSchStatusList";
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/web/kccadr/accdnt/ajaxLoadData.do")
|
|
@ResponseBody
|
|
public List<AdjustSchStatusVO> ajaxLoadData(@ModelAttribute("statusVO") AdjustSchStatusVO statusVO, ModelMap model) throws Exception {
|
|
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
|
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getUniqId());
|
|
statusVO.setRpplId(userId);
|
|
return adjustSchStatusService.selectWebSchList(statusVO);
|
|
}
|
|
|
|
@RequestMapping(value = "/web/kccadr/accdnt/ass/popup/AdjustSchStatusDtailPop.do")
|
|
public String adjustSchStatusDtailPop(@ModelAttribute("statusVO") AdjustSchStatusVO statusVO, ModelMap model , HttpSession session) throws Exception {
|
|
AdjustSchStatusVO info = adjustSchStatusService.selectWebSchDetail(statusVO);
|
|
decryptInfomation(null, info);
|
|
model.addAttribute("info", info);
|
|
return "/web/kccadr/accdnt/ass/popup/AdjustSchStatusDtailPop";
|
|
}
|
|
|
|
@RequestMapping(value = "/web/kccadr/accdnt/ass/ajaxLoadDataTest.do")
|
|
@ResponseBody
|
|
public List<Map<String, Object>> selectEventList(Map param) {
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
|
|
Map m1 = new HashMap();
|
|
m1.put("title" , "테스트1");
|
|
m1.put("content" , "컨텐츠 내용입니다.1");
|
|
m1.put("start" , "2021-08-04");
|
|
m1.put("end" , "");
|
|
m1.put("url" , "");
|
|
m1.put("color" , "");
|
|
m1.put("textColor" , "");
|
|
m1.put("allDay" , true);
|
|
|
|
Map m2 = new HashMap();
|
|
m2.put("title" , "테스트2");
|
|
m2.put("content" , "컨텐츠 내용입니다.2");
|
|
m2.put("start" , "2021-08-05");
|
|
m2.put("end" , "2021-08-20");
|
|
m2.put("url" , "");
|
|
m2.put("color" , "");
|
|
m2.put("textColor" , "");
|
|
m2.put("allDay" , true);
|
|
|
|
list.add(m1);
|
|
list.add(m2);
|
|
return list;
|
|
}
|
|
|
|
public void decryptInfomation(List<AdjustSchStatusVO> list, AdjustSchStatusVO info){
|
|
if(CollectionUtils.isNotEmpty(list)){
|
|
for(AdjustSchStatusVO model : list){
|
|
model.setAdrCdnt(egovCryptoUtil.decrypt(model.getAdrCdnt()));
|
|
model.setAppliCantNm(egovCryptoUtil.decrypt(model.getAppliCantNm()));
|
|
|
|
if(StringUtils.isNotBlank(model.getResPonDentNms())){
|
|
String[] resNms = model.getResPonDentNms().split(",");
|
|
if(resNms.length > 1 ){
|
|
List<String> names = new ArrayList<>();
|
|
for(String name : resNms){
|
|
names.add(egovCryptoUtil.decrypt(name));
|
|
}
|
|
model.setResPonDentNms(String.join(",", names));
|
|
}else{
|
|
model.setResPonDentNms(egovCryptoUtil.decrypt(resNms[0]));
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
if(info != null){
|
|
info.setAdrCdnt(egovCryptoUtil.decrypt(info.getAdrCdnt()));
|
|
info.setAppliCantNm(egovCryptoUtil.decrypt(info.getAppliCantNm()));
|
|
|
|
if(StringUtils.isNotBlank(info.getResPonDentNms())){
|
|
String[] resNms = info.getResPonDentNms().split(",");
|
|
if(resNms.length > 1 ){
|
|
List<String> names = new ArrayList<>();
|
|
for(String name : resNms){
|
|
names.add(egovCryptoUtil.decrypt(name));
|
|
}
|
|
info.setResPonDentNms(String.join(",", names));
|
|
}else{
|
|
info.setResPonDentNms(egovCryptoUtil.decrypt(resNms[0]));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|