refactor-java naming rule 적용

main
minuk926 2 years ago
parent 9805d39de7
commit 80c88f6897

@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
@Mapper
public interface Ec0100Mapper {
public interface IEc0100Mapper {
List<Map<String, Object>> selectEc0100List(Map<String, Object> paraMap, RowBounds rowBounds);
Map<String, Object> selectEc0100();

@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
@Mapper
public interface Ec0200Mapper {
public interface IEc0200Mapper {
List<Map<String, Object>> selectEc0200List(Map<String, Object> paraMap, RowBounds rowBounds);
Map<String, Object> selectEc0200();

@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
@Mapper
public interface Ec0300Mapper {
public interface IEc0300Mapper {
List<Map<String, Object>> selectEc0300List(Map<String, Object> paraMap, RowBounds rowBounds);
Map<String, Object> selectEc0300();

@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
@Mapper
public interface Ec0400Mapper {
public interface IEc0400Mapper {
List<Map<String, Object>> selectEc0400List(Map<String, Object> paraMap, RowBounds rowBounds);
Map<String, Object> selectEc0400();

@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
@Mapper
public interface Ec0500Mapper {
public interface IEc0500Mapper {
List<Map<String, Object>> selectEc0500List(Map<String, Object> paraMap, RowBounds rowBounds);
Map<String, Object> selectEc0500();

@ -4,8 +4,24 @@ import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
public interface Ec0100Service {
List<Map<String, Object>> findEc0100List(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findEc0100(String keyField);
import kr.xit.fims.biz.ec.mapper.IEc0100Mapper;
import kr.xit.fims.biz.ec.service.IEc0100Service;
import lombok.AllArgsConstructor;
@AllArgsConstructor
@Service
public class Ec0100Service implements IEc0100Service {
private final IEc0100Mapper mapper;
@Override
public List<Map<String, Object>> findEc0100List(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectEc0100List(paraMap, rowBounds);
}
@Override
public Map<String, Object> findEc0100(String keyField) {
return mapper.selectEc0100();
}
}

@ -4,8 +4,24 @@ import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
public interface Ec0200Service {
List<Map<String, Object>> findEc0200List(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findEc0200();
import kr.xit.fims.biz.ec.mapper.IEc0200Mapper;
import kr.xit.fims.biz.ec.service.IEc0200Service;
import lombok.AllArgsConstructor;
@AllArgsConstructor
@Service
public class Ec0200Service implements IEc0200Service {
private final IEc0200Mapper mapper;
@Override
public List<Map<String, Object>> findEc0200List(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectEc0200List(paraMap, rowBounds);
}
@Override
public Map<String, Object> findEc0200() {
return mapper.selectEc0200();
}
}

@ -4,8 +4,24 @@ import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
public interface Ec0300Service {
List<Map<String, Object>> findEc0300List(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findEc0300();
import kr.xit.fims.biz.ec.mapper.IEc0300Mapper;
import kr.xit.fims.biz.ec.service.IEc0300Service;
import lombok.AllArgsConstructor;
@AllArgsConstructor
@Service
public class Ec0300Service implements IEc0300Service {
private final IEc0300Mapper mapper;
@Override
public List<Map<String, Object>> findEc0300List(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectEc0300List(paraMap, rowBounds);
}
@Override
public Map<String, Object> findEc0300() {
return mapper.selectEc0300();
}
}

@ -4,8 +4,24 @@ import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
public interface Ec0400Service {
List<Map<String, Object>> findEc0400List(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findEc0400();
import kr.xit.fims.biz.ec.mapper.IEc0400Mapper;
import kr.xit.fims.biz.ec.service.IEc0400Service;
import lombok.AllArgsConstructor;
@AllArgsConstructor
@Service
public class Ec0400Service implements IEc0400Service {
private final IEc0400Mapper mapper;
@Override
public List<Map<String, Object>> findEc0400List(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectEc0400List(paraMap, rowBounds);
}
@Override
public Map<String, Object> findEc0400() {
return mapper.selectEc0400();
}
}

@ -4,8 +4,24 @@ import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
public interface Ec0500Service {
List<Map<String, Object>> findEc0500List(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findEc0500();
import kr.xit.fims.biz.ec.mapper.IEc0500Mapper;
import kr.xit.fims.biz.ec.service.IEc0500Service;
import lombok.AllArgsConstructor;
@AllArgsConstructor
@Service
public class Ec0500Service implements IEc0500Service {
private final IEc0500Mapper mapper;
@Override
public List<Map<String, Object>> findEc0500List(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectEc0500List(paraMap, rowBounds);
}
@Override
public Map<String, Object> findEc0500() {
return mapper.selectEc0500();
}
}

@ -0,0 +1,11 @@
package kr.xit.fims.biz.ec.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
public interface IEc0100Service {
List<Map<String, Object>> findEc0100List(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findEc0100(String keyField);
}

@ -0,0 +1,11 @@
package kr.xit.fims.biz.ec.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
public interface IEc0200Service {
List<Map<String, Object>> findEc0200List(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findEc0200();
}

@ -0,0 +1,11 @@
package kr.xit.fims.biz.ec.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
public interface IEc0300Service {
List<Map<String, Object>> findEc0300List(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findEc0300();
}

@ -0,0 +1,11 @@
package kr.xit.fims.biz.ec.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
public interface IEc0400Service {
List<Map<String, Object>> findEc0400List(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findEc0400();
}

@ -0,0 +1,11 @@
package kr.xit.fims.biz.ec.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
public interface IEc0500Service {
List<Map<String, Object>> findEc0500List(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findEc0500();
}

@ -1,27 +0,0 @@
package kr.xit.fims.biz.ec.service.impl;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import kr.xit.fims.biz.ec.mapper.Ec0100Mapper;
import kr.xit.fims.biz.ec.service.Ec0100Service;
import lombok.AllArgsConstructor;
@AllArgsConstructor
@Service
public class Ec0100ServiceImpl implements Ec0100Service {
private final Ec0100Mapper mapper;
@Override
public List<Map<String, Object>> findEc0100List(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectEc0100List(paraMap, rowBounds);
}
@Override
public Map<String, Object> findEc0100(String keyField) {
return mapper.selectEc0100();
}
}

@ -1,27 +0,0 @@
package kr.xit.fims.biz.ec.service.impl;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import kr.xit.fims.biz.ec.mapper.Ec0200Mapper;
import kr.xit.fims.biz.ec.service.Ec0200Service;
import lombok.AllArgsConstructor;
@AllArgsConstructor
@Service
public class Ec0200ServiceImpl implements Ec0200Service {
private final Ec0200Mapper mapper;
@Override
public List<Map<String, Object>> findEc0200List(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectEc0200List(paraMap, rowBounds);
}
@Override
public Map<String, Object> findEc0200() {
return mapper.selectEc0200();
}
}

@ -1,27 +0,0 @@
package kr.xit.fims.biz.ec.service.impl;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import kr.xit.fims.biz.ec.mapper.Ec0300Mapper;
import kr.xit.fims.biz.ec.service.Ec0300Service;
import lombok.AllArgsConstructor;
@AllArgsConstructor
@Service
public class Ec0300ServiceImpl implements Ec0300Service {
private final Ec0300Mapper mapper;
@Override
public List<Map<String, Object>> findEc0300List(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectEc0300List(paraMap, rowBounds);
}
@Override
public Map<String, Object> findEc0300() {
return mapper.selectEc0300();
}
}

@ -1,27 +0,0 @@
package kr.xit.fims.biz.ec.service.impl;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import kr.xit.fims.biz.ec.mapper.Ec0400Mapper;
import kr.xit.fims.biz.ec.service.Ec0400Service;
import lombok.AllArgsConstructor;
@AllArgsConstructor
@Service
public class Ec0400ServiceImpl implements Ec0400Service {
private final Ec0400Mapper mapper;
@Override
public List<Map<String, Object>> findEc0400List(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectEc0400List(paraMap, rowBounds);
}
@Override
public Map<String, Object> findEc0400() {
return mapper.selectEc0400();
}
}

@ -1,27 +0,0 @@
package kr.xit.fims.biz.ec.service.impl;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import kr.xit.fims.biz.ec.mapper.Ec0500Mapper;
import kr.xit.fims.biz.ec.service.Ec0500Service;
import lombok.AllArgsConstructor;
@AllArgsConstructor
@Service
public class Ec0500ServiceImpl implements Ec0500Service {
private final Ec0500Mapper mapper;
@Override
public List<Map<String, Object>> findEc0500List(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectEc0500List(paraMap, rowBounds);
}
@Override
public Map<String, Object> findEc0500() {
return mapper.selectEc0500();
}
}

@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import kr.xit.fims.biz.cmm.FimsConst;
import kr.xit.fims.biz.ec.service.Ec0100Service;
import kr.xit.fims.biz.ec.service.IEc0100Service;
import kr.xit.framework.biz.mng.menu.model.ProgramMngVO;
import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.core.model.ResultResponse;
@ -24,7 +24,7 @@ import lombok.AllArgsConstructor;
@Controller
@RequestMapping(value = "/fims/biz/ec")
public class Ec0100Controler {
private final Ec0100Service service;
private final IEc0100Service service;
@GetMapping(value = "/ec0100Form")
public void ec0100Form(){

@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import kr.xit.fims.biz.ec.service.Ec0200Service;
import kr.xit.fims.biz.ec.service.IEc0200Service;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.support.mybatis.MybatisUtils;
import lombok.AllArgsConstructor;
@ -17,7 +17,7 @@ import lombok.AllArgsConstructor;
@Controller
@RequestMapping(value = "/fims/biz/ec")
public class Ec0200Controler {
private final Ec0200Service service;
private final IEc0200Service service;
@GetMapping(value = "/ec0200Form")
public void ec0200Form(){

@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import kr.xit.fims.biz.ec.service.Ec0300Service;
import kr.xit.fims.biz.ec.service.IEc0300Service;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.support.mybatis.MybatisUtils;
import lombok.AllArgsConstructor;
@ -17,7 +17,7 @@ import lombok.AllArgsConstructor;
@Controller
@RequestMapping(value = "/fims/biz/ec")
public class Ec0300Controler {
private final Ec0300Service service;
private final IEc0300Service service;
@GetMapping(value = "/ec0300Form")
public void ec0300Form(){

@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import kr.xit.fims.biz.ec.service.Ec0400Service;
import kr.xit.fims.biz.ec.service.IEc0400Service;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.support.mybatis.MybatisUtils;
import lombok.AllArgsConstructor;
@ -17,7 +17,7 @@ import lombok.AllArgsConstructor;
@Controller
@RequestMapping(value = "/fims/biz/ec")
public class Ec0400Controler {
private final Ec0400Service service;
private final IEc0400Service service;
@GetMapping(value = "/ec0400Form")
public void ec0400Form(){

@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import kr.xit.fims.biz.ec.service.Ec0500Service;
import kr.xit.fims.biz.ec.service.IEc0500Service;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.support.mybatis.MybatisUtils;
import lombok.AllArgsConstructor;
@ -17,7 +17,7 @@ import lombok.AllArgsConstructor;
@Controller
@RequestMapping(value = "/fims/biz/ec")
public class Ec0500Controler {
private final Ec0500Service service;
private final IEc0500Service service;
@GetMapping(value = "/ec0500Form")
public void ec0500Form(){

@ -1,4 +1,4 @@
package kr.xit.fims.biz.ens.adm.service;
package kr.xit.fims.biz.ens.adm.mapper;
import java.sql.SQLException;
import java.util.List;

@ -1,4 +1,4 @@
package kr.xit.fims.biz.ens.adm.service;
package kr.xit.fims.biz.ens.adm.mapper;
import java.util.List;

@ -7,7 +7,7 @@ import org.springframework.stereotype.Service;
import kr.xit.fims.biz.ens.adm.model.SendRqstMngSearchVO;
import kr.xit.fims.biz.ens.adm.model.SendRqstMngVO;
import kr.xit.fims.biz.ens.adm.service.SendRqstMngMapper;
import kr.xit.fims.biz.ens.adm.mapper.SendRqstMngMapper;
import kr.xit.fims.biz.ens.adm.service.SendRqstMngService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@ -9,7 +9,7 @@ import org.springframework.stereotype.Service;
import kr.xit.fims.biz.ens.adm.model.StatsBySignTalkByYearSearchVO;
import kr.xit.fims.biz.ens.adm.model.StatsBySignTalkByYearVO;
import kr.xit.fims.biz.ens.adm.service.StatsBySignTalkByYearMapper;
import kr.xit.fims.biz.ens.adm.mapper.StatsBySignTalkByYearMapper;
import kr.xit.fims.biz.ens.adm.service.StatsBySignTalkByYearService;
@Service

@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
@Mapper
public interface Rt0100Mapper {
public interface IRt0100Mapper {
List<Map<String, Object>> selectRt0100List(Map<String, Object> paraMap, RowBounds rowBounds);
Map<String, Object> selectRt0100();

@ -10,7 +10,7 @@ import kr.xit.fims.biz.rt.model.Rt0200VO;
import org.apache.ibatis.session.RowBounds;
@Mapper
public interface Rt0200Mapper {
public interface IRt0200Mapper {
// 목록조회
List<Map<String,Object>> selectRt0200List(final Map<String, Object> paraMap);

@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
@Mapper
public interface Rt0300Mapper {
public interface IRt0300Mapper {
List<Map<String, Object>> selectRt0300List(Map<String, Object> paraMap, RowBounds rowBounds);
Map<String, Object> selectRt0300();

@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
@Mapper
public interface Rt0400Mapper {
public interface IRt0400Mapper {
List<Map<String, Object>> selectRt0400List(Map<String, Object> paraMap, RowBounds rowBounds);
Map<String, Object> selectRt0400();

@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
@Mapper
public interface Rt0500Mapper {
public interface IRt0500Mapper {
List<Map<String, Object>> selectRt0500List(Map<String, Object> paraMap, RowBounds rowBounds);
Map<String, Object> selectRt0500();

@ -0,0 +1,11 @@
package kr.xit.fims.biz.rt.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
public interface IRt0100Service {
List<Map<String, Object>> findRt0100List(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findRt0100();
}

@ -0,0 +1,17 @@
package kr.xit.fims.biz.rt.service;
import kr.xit.fims.biz.rt.model.Rt0200SearchVO;
import kr.xit.fims.biz.rt.model.Rt0200VO;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
public interface IRt0200Service {
public List<Map<String,Object>> findRt0200List(final Map<String, Object> paraMap, final RowBounds rowBounds);
public List<Map<String,Object>> findRt0200List(final Rt0200SearchVO vo, final RowBounds rowBounds);
Rt0200VO findRt0200(final String regltId);
}

@ -0,0 +1,11 @@
package kr.xit.fims.biz.rt.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
public interface IRt0300Service {
List<Map<String, Object>> findRt0300List(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findRt0300();
}

@ -0,0 +1,11 @@
package kr.xit.fims.biz.rt.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
public interface IRt0400Service {
List<Map<String, Object>> findRt0400List(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findRt0400();
}

@ -0,0 +1,11 @@
package kr.xit.fims.biz.rt.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
public interface IRt0500Service {
List<Map<String, Object>> findRt0500List(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findRt0500();
}

@ -4,8 +4,24 @@ import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
public interface Rt0100Service {
List<Map<String, Object>> findRt0100List(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findRt0100();
import kr.xit.fims.biz.rt.mapper.IRt0100Mapper;
import kr.xit.fims.biz.rt.service.IRt0100Service;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Service
public class Rt0100Service implements IRt0100Service {
private final IRt0100Mapper mapper;
@Override
public List<Map<String, Object>> findRt0100List(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectRt0100List(paraMap, rowBounds);
}
@Override
public Map<String, Object> findRt0100() {
return mapper.selectRt0100();
}
}

@ -1,17 +1,51 @@
package kr.xit.fims.biz.rt.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import kr.xit.fims.biz.rt.mapper.IRt0200Mapper;
import kr.xit.fims.biz.rt.model.Rt0200SearchVO;
import kr.xit.fims.biz.rt.model.Rt0200VO;
import kr.xit.fims.biz.rt.service.IRt0200Service;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Service
public class Rt0200Service implements IRt0200Service {
private final IRt0200Mapper mapper;
@Override
public List<Map<String,Object>> findRt0200List(final Map<String, Object> paraMap, final RowBounds rowBounds) {
return mapper.selectRt0200List(paraMap, rowBounds);
}
@Override
public List<Map<String,Object>> findRt0200List(final Rt0200SearchVO vo, final RowBounds rowBounds) {
return mapper.selectRt0200List(vo, rowBounds);
}
@Override
public Rt0200VO findRt0200(final String regltId) {
return mapper.selectRt0200(regltId);
}
public void addProc(final Rt0200VO vo) {
}
public void modifyProc(final Rt0200VO vo) {
}
public void removeProc(final Rt0200VO vo) {
}
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
public interface Rt0200Service {
public List<Map<String,Object>> findRt0200List(final Map<String, Object> paraMap, final RowBounds rowBounds);
public List<Map<String,Object>> findRt0200List(final Rt0200SearchVO vo, final RowBounds rowBounds);
Rt0200VO findRt0200(final String regltId);
}

@ -4,8 +4,24 @@ import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
public interface Rt0300Service {
List<Map<String, Object>> findRt0300List(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findRt0300();
import kr.xit.fims.biz.rt.mapper.IRt0300Mapper;
import kr.xit.fims.biz.rt.service.IRt0300Service;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Service
public class Rt0300Service implements IRt0300Service {
private final IRt0300Mapper mapper;
@Override
public List<Map<String, Object>> findRt0300List(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectRt0300List(paraMap, rowBounds);
}
@Override
public Map<String, Object> findRt0300() {
return mapper.selectRt0300();
}
}

@ -4,8 +4,24 @@ import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
public interface Rt0400Service {
List<Map<String, Object>> findRt0400List(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findRt0400();
import kr.xit.fims.biz.rt.mapper.IRt0400Mapper;
import kr.xit.fims.biz.rt.service.IRt0400Service;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Service
public class Rt0400Service implements IRt0400Service {
private final IRt0400Mapper mapper;
@Override
public List<Map<String, Object>> findRt0400List(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectRt0400List(paraMap, rowBounds);
}
@Override
public Map<String, Object> findRt0400() {
return mapper.selectRt0400();
}
}

@ -4,8 +4,24 @@ import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
public interface Rt0500Service {
List<Map<String, Object>> findRt0500List(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findRt0500();
import kr.xit.fims.biz.rt.mapper.IRt0500Mapper;
import kr.xit.fims.biz.rt.service.IRt0500Service;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Service
public class Rt0500Service implements IRt0500Service {
private final IRt0500Mapper mapper;
@Override
public List<Map<String, Object>> findRt0500List(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectRt0500List(paraMap, rowBounds);
}
@Override
public Map<String, Object> findRt0500() {
return mapper.selectRt0500();
}
}

@ -1,27 +0,0 @@
package kr.xit.fims.biz.rt.service.impl;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import kr.xit.fims.biz.rt.mapper.Rt0100Mapper;
import kr.xit.fims.biz.rt.service.Rt0100Service;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Service
public class Rt0100ServiceImpl implements Rt0100Service {
private final Rt0100Mapper mapper;
@Override
public List<Map<String, Object>> findRt0100List(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectRt0100List(paraMap, rowBounds);
}
@Override
public Map<String, Object> findRt0100() {
return mapper.selectRt0100();
}
}

@ -1,51 +0,0 @@
package kr.xit.fims.biz.rt.service.impl;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import kr.xit.fims.biz.rt.mapper.Rt0200Mapper;
import kr.xit.fims.biz.rt.model.Rt0200SearchVO;
import kr.xit.fims.biz.rt.model.Rt0200VO;
import kr.xit.fims.biz.rt.service.Rt0200Service;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Service
public class Rt0200ServiceImpl implements Rt0200Service {
private final Rt0200Mapper mapper;
@Override
public List<Map<String,Object>> findRt0200List(final Map<String, Object> paraMap, final RowBounds rowBounds) {
return mapper.selectRt0200List(paraMap, rowBounds);
}
@Override
public List<Map<String,Object>> findRt0200List(final Rt0200SearchVO vo, final RowBounds rowBounds) {
return mapper.selectRt0200List(vo, rowBounds);
}
@Override
public Rt0200VO findRt0200(final String regltId) {
return mapper.selectRt0200(regltId);
}
public void addProc(final Rt0200VO vo) {
}
public void modifyProc(final Rt0200VO vo) {
}
public void removeProc(final Rt0200VO vo) {
}
}

@ -1,27 +0,0 @@
package kr.xit.fims.biz.rt.service.impl;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import kr.xit.fims.biz.rt.mapper.Rt0300Mapper;
import kr.xit.fims.biz.rt.service.Rt0300Service;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Service
public class Rt0300ServiceImpl implements Rt0300Service {
private final Rt0300Mapper mapper;
@Override
public List<Map<String, Object>> findRt0300List(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectRt0300List(paraMap, rowBounds);
}
@Override
public Map<String, Object> findRt0300() {
return mapper.selectRt0300();
}
}

@ -1,27 +0,0 @@
package kr.xit.fims.biz.rt.service.impl;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import kr.xit.fims.biz.rt.mapper.Rt0400Mapper;
import kr.xit.fims.biz.rt.service.Rt0400Service;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Service
public class Rt0400ServiceImpl implements Rt0400Service {
private final Rt0400Mapper mapper;
@Override
public List<Map<String, Object>> findRt0400List(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectRt0400List(paraMap, rowBounds);
}
@Override
public Map<String, Object> findRt0400() {
return mapper.selectRt0400();
}
}

@ -1,27 +0,0 @@
package kr.xit.fims.biz.rt.service.impl;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import kr.xit.fims.biz.rt.mapper.Rt0500Mapper;
import kr.xit.fims.biz.rt.service.Rt0500Service;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Service
public class Rt0500ServiceImpl implements Rt0500Service {
private final Rt0500Mapper mapper;
@Override
public List<Map<String, Object>> findRt0500List(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectRt0500List(paraMap, rowBounds);
}
@Override
public Map<String, Object> findRt0500() {
return mapper.selectRt0500();
}
}

@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import kr.xit.fims.biz.rt.service.Rt0100Service;
import kr.xit.fims.biz.rt.service.IRt0100Service;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.support.mybatis.MybatisUtils;
import lombok.RequiredArgsConstructor;
@ -17,7 +17,7 @@ import lombok.RequiredArgsConstructor;
@Controller
@RequestMapping(value = "/fims/biz/rt")
public class Rt0100Controller {
private final Rt0100Service service;
private final IRt0100Service service;
@GetMapping(value = "/rt0100Form")
public void rt0100Form(){

@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import kr.xit.fims.biz.rt.service.Rt0200Service;
import kr.xit.fims.biz.rt.service.IRt0200Service;
import kr.xit.framework.biz.cache.util.CacheServiceUtils;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.support.mybatis.MybatisUtils;
@ -34,7 +34,7 @@ import lombok.extern.slf4j.Slf4j;
@RequestMapping("/fims/biz/rt")
public class Rt0200Controller {
private final Rt0200Service service;
private final IRt0200Service service;
/**
* <pre> : </pre>

@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import kr.xit.fims.biz.rt.service.Rt0300Service;
import kr.xit.fims.biz.rt.service.IRt0300Service;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.support.mybatis.MybatisUtils;
import lombok.RequiredArgsConstructor;
@ -17,7 +17,7 @@ import lombok.RequiredArgsConstructor;
@Controller
@RequestMapping(value = "/fims/biz/rt")
public class Rt0300Controler {
private final Rt0300Service service;
private final IRt0300Service service;
@GetMapping(value = "/rt0300Form")
public void rt0300Form(){

@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import kr.xit.fims.biz.rt.service.Rt0400Service;
import kr.xit.fims.biz.rt.service.IRt0400Service;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.support.mybatis.MybatisUtils;
import lombok.RequiredArgsConstructor;
@ -17,7 +17,7 @@ import lombok.RequiredArgsConstructor;
@Controller
@RequestMapping(value = "/fims/biz/rt")
public class Rt0400Controler {
private final Rt0400Service service;
private final IRt0400Service service;
@GetMapping(value = "/rt0400Form")
public void rt0400Form(){

@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import kr.xit.fims.biz.rt.service.Rt0500Service;
import kr.xit.fims.biz.rt.service.IRt0500Service;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.support.mybatis.MybatisUtils;
import lombok.RequiredArgsConstructor;
@ -17,7 +17,7 @@ import lombok.RequiredArgsConstructor;
@Controller
@RequestMapping(value = "/fims/biz/rt")
public class Rt0500Controler {
private final Rt0500Service service;
private final IRt0500Service service;
@GetMapping(value = "/rt0500Form")
public void rt0500Form(){

@ -8,7 +8,7 @@ import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
@Mapper
public interface SampleMapper {
public interface ISampleMapper {
List<Map<String, Object>> selectSampleList(Map<String, Object> paraMap, RowBounds rowBounds);
Map<String, Object> selectSample();

@ -0,0 +1,11 @@
package kr.xit.fims.biz.sample.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
public interface ISampleService {
List<Map<String, Object>> findSampleList(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findSample();
}

@ -4,8 +4,25 @@ import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
public interface SampleService {
List<Map<String, Object>> findSampleList(Map<String, Object> paraMap, RowBounds pagingInfo);
Map<String, Object> findSample();
import kr.xit.fims.biz.sample.mapper.ISampleMapper;
import kr.xit.fims.biz.sample.service.ISampleService;
import kr.xit.fims.biz.sample.service.SampleService;
import lombok.AllArgsConstructor;
@AllArgsConstructor
@Service
public class SampleService implements ISampleService {
private final ISampleMapper mapper;
@Override
public List<Map<String, Object>> findSampleList(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectSampleList(paraMap, rowBounds);
}
@Override
public Map<String, Object> findSample() {
return mapper.selectSample();
}
}

@ -1,27 +0,0 @@
package kr.xit.fims.biz.sample.service.impl;
import java.util.List;
import java.util.Map;
import kr.xit.fims.biz.sample.mapper.SampleMapper;
import kr.xit.fims.biz.sample.service.SampleService;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import lombok.AllArgsConstructor;
@AllArgsConstructor
@Service
public class SampleServiceImpl implements SampleService {
private final SampleMapper mapper;
@Override
public List<Map<String, Object>> findSampleList(Map<String, Object> paraMap, RowBounds rowBounds) {
return mapper.selectSampleList(paraMap, rowBounds);
}
@Override
public Map<String, Object> findSample() {
return mapper.selectSample();
}
}

@ -2,7 +2,7 @@ package kr.xit.fims.biz.sample.web;
import java.util.Map;
import kr.xit.fims.biz.sample.service.SampleService;
import kr.xit.fims.biz.sample.service.ISampleService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -17,7 +17,7 @@ import lombok.AllArgsConstructor;
@Controller
@RequestMapping(value = "/fims/biz/sample")
public class SampleController {
private final SampleService sampleService;
private final ISampleService sampleService;
@GetMapping(value = "/sampleForm")
public void sampleForm(){

@ -6,11 +6,10 @@ import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
import kr.xit.framework.biz.mng.bbs.model.XitBasicBbsMngSearchVO;
import kr.xit.framework.biz.mng.bbs.model.XitBasicBbsMngVO;
@Mapper
public interface CacheBbsMapper {
public interface ICacheBbsMapper {
List<Map<String, Object>> selectLatestBbsList(final Map<String, Object> paraMap, final RowBounds rowBounds);
List<XitBasicBbsMngVO> selectBaseBbsList(final Map<String, Object> paraMap);
}

@ -6,7 +6,7 @@ import java.util.Map;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
@Mapper
public interface CacheCodeMapper {
public interface ICacheCodeMapper {
List<Map<String, Object>> selectCodes(final String codeId);
List<Map<String, Object>> selectComboCodes(final Map<String,Object> map);
}

@ -3,12 +3,10 @@ package kr.xit.framework.biz.cache.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
@Mapper
public interface CacheMenuMapper {
public interface ICacheMenuMapper {
List<Map<String, String>> selectMenuListByUser(final String uniqId);
List<Map<String, String>> selectMenuListByAuthorCode(final String authorCode);

@ -1,65 +1,135 @@
package kr.xit.framework.biz.cache.service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import kr.xit.framework.biz.mng.bbs.model.XitBasicBbsMngSearchVO;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import kr.xit.framework.biz.cache.mapper.ICacheBbsMapper;
import kr.xit.framework.biz.cache.service.ICacheService;
import kr.xit.framework.biz.cache.mapper.ICacheCodeMapper;
import kr.xit.framework.biz.cache.mapper.ICacheMenuMapper;
import kr.xit.framework.biz.mng.bbs.model.XitBasicBbsMngVO;
import kr.xit.framework.support.mybatis.MybatisUtils;
@Service
public class CacheService implements ICacheService {
@Resource
private ICacheCodeMapper codeMapper;
@Resource
private ICacheMenuMapper menuMapper;
@Resource
private ICacheBbsMapper bbsMapper;
@Value("#{prop['Globals.Xit.RollingNotiBbsId']}")
private String notiBbsId;
@Value("#{prop['Globals.Xit.Bbs.parntsSntncNo']}")
private String parntsSntncNo;
@Value("#{prop['Globals.Xit.Bbs.useAt']}")
private String useAt;
// ---------------------------------------------------------------------------------------------------------
// Common code
// ---------------------------------------------------------------------------------------------------------
@Cacheable(cacheNames="codeCache", key = "#codeId")
@Override
public List<Map<String, Object>> findCodes(final String codeId) {
return codeMapper.selectCodes(codeId);
}
@Cacheable(cacheNames="codeComboCache", key = "#codeId + #type")
@Override
public List<Map<String, Object>> findComboCodes(final String codeId, final String type) {
Map<String, Object> map = new HashMap<>();
map.put("codeId", codeId);
map.put("type", type);
return codeMapper.selectComboCodes(map);
}
@Override
@CacheEvict(cacheNames="codeCache", allEntries = true)
public void evictAllCodeCache() {
}
@Override
@CacheEvict(cacheNames="codeCache", key = "#codeId")
public void evictCodeCache(final String codeId) {
}
// ---------------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------
// Menu
// ---------------------------------------------------------------------------------------------------------
@Cacheable(cacheNames="menuCache", key = "#uniqId")
@Override
public List<Map<String, String>> findMenuListByUser(final String uniqId) {
return menuMapper.selectMenuListByUser(uniqId);
}
@Cacheable(cacheNames="menuCache", key = "#authorCode")
@Override
public List<Map<String, String>> findMenuListByAuthorCode(final String authorCode) {
return menuMapper.selectMenuListByAuthorCode(authorCode);
}
@Override
@CacheEvict(cacheNames="menuCache", allEntries = true)
public void evictAllMenuCache() {
}
@Override
@CacheEvict(cacheNames="menuCache", key = "#key")
public void evictMenuCache(final String key) {
}
// ---------------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------
// BBS
// ---------------------------------------------------------------------------------------------------------
@Override
@Cacheable(cacheNames="latestBbsCache")
public List<Map<String, Object>> findLatestBbsList() {
Map<String, Object> paraMap = new HashMap<>();
paraMap.put("bbsId", this.notiBbsId);
paraMap.put("parntsSntncNo", this.parntsSntncNo);
paraMap.put("useAt", this.useAt);
paraMap.put("page", 1);
paraMap.put("perPage", 10);
return bbsMapper.selectLatestBbsList(paraMap, MybatisUtils.getPagingInfo(paraMap));
}
@Override
@Cacheable(cacheNames="baseBbsCache", key = "#paraMap")
public List<XitBasicBbsMngVO> findBaseBbsList(final Map<String, Object> paraMap) {
return bbsMapper.selectBaseBbsList(paraMap);
}
@Override
@CacheEvict(cacheNames="latestBbsCache", allEntries = true)
public void evictLatestBbsList() {
}
@Override
@CacheEvict(cacheNames="baseBbsCache", allEntries = true)
public void evictBaseBbsList(){
}
// ---------------------------------------------------------------------------------------------------------------
public interface CacheService {
/**
* Map .
* @param codeId
* @return List<T>
*/
List<Map<String, Object>> findCodes(final String codeId);
/**
* Map .
* @param codeId
* @return List<T>
*/
List<Map<String, Object>> findComboCodes(final String codeId, final String type);
/**
* Evict
*/
void evictAllCodeCache();
/**
* Evict
*/
void evictCodeCache(final String codeId);
/**
*
* @param uniqId
* @return List<T>
*/
List<Map<String, String>> findMenuListByUser(final String uniqId);
/**
*
* @param authorCode
* @return List<T>
*/
List<Map<String, String>> findMenuListByAuthorCode(final String authorCode);
/**
* Evict
*/
void evictAllMenuCache();
/**
* Evict
*/
void evictMenuCache(final String userId);
List<Map<String, Object>> findLatestBbsList();
List<XitBasicBbsMngVO> findBaseBbsList(final Map<String, Object> paraMap);
void evictLatestBbsList();
void evictBaseBbsList();
}

@ -0,0 +1,64 @@
package kr.xit.framework.biz.cache.service;
import java.util.List;
import java.util.Map;
import kr.xit.framework.biz.mng.bbs.model.XitBasicBbsMngVO;
public interface ICacheService {
/**
* Map .
* @param codeId
* @return List<T>
*/
List<Map<String, Object>> findCodes(final String codeId);
/**
* Map .
* @param codeId
* @return List<T>
*/
List<Map<String, Object>> findComboCodes(final String codeId, final String type);
/**
* Evict
*/
void evictAllCodeCache();
/**
* Evict
*/
void evictCodeCache(final String codeId);
/**
*
* @param uniqId
* @return List<T>
*/
List<Map<String, String>> findMenuListByUser(final String uniqId);
/**
*
* @param authorCode
* @return List<T>
*/
List<Map<String, String>> findMenuListByAuthorCode(final String authorCode);
/**
* Evict
*/
void evictAllMenuCache();
/**
* Evict
*/
void evictMenuCache(final String userId);
List<Map<String, Object>> findLatestBbsList();
List<XitBasicBbsMngVO> findBaseBbsList(final Map<String, Object> paraMap);
void evictLatestBbsList();
void evictBaseBbsList();
}

@ -1,139 +0,0 @@
package kr.xit.framework.biz.cache.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import kr.xit.framework.biz.cache.mapper.CacheBbsMapper;
import kr.xit.framework.biz.cache.service.CacheService;
import kr.xit.framework.biz.cache.mapper.CacheCodeMapper;
import kr.xit.framework.biz.cache.mapper.CacheMenuMapper;
import kr.xit.framework.biz.mng.bbs.model.XitBasicBbsMngSearchVO;
import kr.xit.framework.biz.mng.bbs.model.XitBasicBbsMngVO;
import kr.xit.framework.support.mybatis.MybatisUtils;
import kr.xit.framework.support.util.JBeanRegistry;
import lombok.AllArgsConstructor;
@Service
public class CacheServiceImpl implements CacheService {
@Resource
private CacheCodeMapper codeMapper;
@Resource
private CacheMenuMapper menuMapper;
@Resource
private CacheBbsMapper bbsMapper;
@Value("#{prop['Globals.Xit.RollingNotiBbsId']}")
private String notiBbsId;
@Value("#{prop['Globals.Xit.Bbs.parntsSntncNo']}")
private String parntsSntncNo;
@Value("#{prop['Globals.Xit.Bbs.useAt']}")
private String useAt;
// ---------------------------------------------------------------------------------------------------------
// Common code
// ---------------------------------------------------------------------------------------------------------
@Cacheable(cacheNames="codeCache", key = "#codeId")
@Override
public List<Map<String, Object>> findCodes(final String codeId) {
return codeMapper.selectCodes(codeId);
}
@Cacheable(cacheNames="codeComboCache", key = "#codeId + #type")
@Override
public List<Map<String, Object>> findComboCodes(final String codeId, final String type) {
Map<String, Object> map = new HashMap<>();
map.put("codeId", codeId);
map.put("type", type);
return codeMapper.selectComboCodes(map);
}
@Override
@CacheEvict(cacheNames="codeCache", allEntries = true)
public void evictAllCodeCache() {
}
@Override
@CacheEvict(cacheNames="codeCache", key = "#codeId")
public void evictCodeCache(final String codeId) {
}
// ---------------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------
// Menu
// ---------------------------------------------------------------------------------------------------------
@Cacheable(cacheNames="menuCache", key = "#uniqId")
@Override
public List<Map<String, String>> findMenuListByUser(final String uniqId) {
return menuMapper.selectMenuListByUser(uniqId);
}
@Cacheable(cacheNames="menuCache", key = "#authorCode")
@Override
public List<Map<String, String>> findMenuListByAuthorCode(final String authorCode) {
return menuMapper.selectMenuListByAuthorCode(authorCode);
}
@Override
@CacheEvict(cacheNames="menuCache", allEntries = true)
public void evictAllMenuCache() {
}
@Override
@CacheEvict(cacheNames="menuCache", key = "#key")
public void evictMenuCache(final String key) {
}
// ---------------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------
// BBS
// ---------------------------------------------------------------------------------------------------------
@Override
@Cacheable(cacheNames="latestBbsCache")
public List<Map<String, Object>> findLatestBbsList() {
Map<String, Object> paraMap = new HashMap<>();
paraMap.put("bbsId", this.notiBbsId);
paraMap.put("parntsSntncNo", this.parntsSntncNo);
paraMap.put("useAt", this.useAt);
paraMap.put("page", 1);
paraMap.put("perPage", 10);
return bbsMapper.selectLatestBbsList(paraMap, MybatisUtils.getPagingInfo(paraMap));
}
@Override
@Cacheable(cacheNames="baseBbsCache", key = "#paraMap")
public List<XitBasicBbsMngVO> findBaseBbsList(final Map<String, Object> paraMap) {
return bbsMapper.selectBaseBbsList(paraMap);
}
@Override
@CacheEvict(cacheNames="latestBbsCache", allEntries = true)
public void evictLatestBbsList() {
}
@Override
@CacheEvict(cacheNames="baseBbsCache", allEntries = true)
public void evictBaseBbsList(){
}
// ---------------------------------------------------------------------------------------------------------------
}

@ -31,7 +31,7 @@ import kr.xit.framework.biz.mng.user.model.XitUserRegMngSearchVO;
import kr.xit.framework.biz.mng.user.model.XitUserRegMngVO;
import kr.xit.framework.biz.mng.user.service.XitEntUserRegMngService;
import kr.xit.framework.biz.mng.user.service.XitGnrUserRegMngService;
import kr.xit.framework.biz.mng.user.service.UserMgtService;
import kr.xit.framework.biz.mng.user.service.IUserMgtService;
import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE;
import kr.xit.framework.core.constants.FrameworkConstants.USER_SE;
@ -62,7 +62,7 @@ public class XitFrameAnonymousController {
@Resource
private XitEntUserRegMngService xitEntUserRegMngService;
@Resource
private UserMgtService xitUserRegMngService;
private IUserMgtService xitUserRegMngService;
@Resource
private XitFrameUnitService xitFrameUnitService;
@Autowired

@ -21,7 +21,7 @@ import kr.xit.framework.biz.mng.auth.model.XitRoleSclsrtRescueVO;
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface AuthAuthorMgtMapper {
public interface IAuthAuthorMgtMapper {
/**

@ -19,7 +19,7 @@ import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO;
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface AuthByUserMgtMapper {
public interface IAuthByUserMgtMapper {
List<XitAuthUsrMngVO> selectAuthUsers(final Map<String,Object> paraMap, final RowBounds rowBounds);
<T> XitAuthUsrMngVO selectAuthUser(final T t);
}

@ -19,7 +19,7 @@ import kr.xit.framework.biz.mng.auth.model.XitAuthorGroupInfoVO;
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface AuthGrpMgtMapper {
public interface IAuthGrpMgtMapper {
List<XitAuthorGroupInfoVO> selectAuthorGroupInfos(final Map<String, Object> paraMap, final RowBounds rowBounds);
XitAuthorGroupInfoVO selectAuthorGroupInfo(final String groupId);

@ -1,13 +1,11 @@
package kr.xit.framework.biz.mng.auth.mapper;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngSearchVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO;
/**
@ -21,7 +19,7 @@ import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO;
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface AuthHierarchyMgtMapper {
public interface IAuthHierarchyMgtMapper {
List<XitAuthHierarchyMngVO> selectAuthHierarchies(final Map<String, Object> paraMap, final RowBounds rowBounds);
}

@ -19,7 +19,7 @@ import kr.xit.framework.biz.mng.auth.model.XitRoleInfoVO;
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface AuthRoleMgtMapper {
public interface IAuthRoleMgtMapper {
/**

@ -2,41 +2,111 @@ package kr.xit.framework.biz.mng.auth.service;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import kr.xit.framework.biz.mng.auth.model.XitAuthorInfoVO;
import kr.xit.framework.biz.mng.auth.model.XitRoleInfoVO;
import kr.xit.framework.biz.mng.auth.model.XitRoleSclsrtRescueVO;
import kr.xit.framework.biz.mng.auth.mapper.IAuthAuthorMgtMapper;
import kr.xit.framework.biz.mng.auth.service.IAuthAuthorMgtService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
*
* @: Service
* @:
* @: 2020. 4. 16. 9:38:56
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface AuthAuthorMgtService {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitAuthRegMngVO>
* @author:
* @date: 2020. 4. 16.
*/
List<XitAuthorInfoVO> findAuthAuthors(final Map<String,Object> paraMap, final RowBounds rowBounds);
List<XitAuthorInfoVO> findAuthAuthors(final Map<String,Object> paraMap);
XitAuthorInfoVO findAuthAuthor(final String authorCode);
void addAuthAuthor(final XitAuthorInfoVO vo);
void modifyAuthAuthor(final XitAuthorInfoVO vo);
void removeAuthAuthor(final String authorCode);
List<XitRoleInfoVO> findAuthRoleGrantList(final Map<String, Object> paraMap);
void saveAuthRoleGrantList(final Map<String, Object> paraMap);
@RequiredArgsConstructor
@Slf4j
@Service
public class AuthAuthorMgtService implements IAuthAuthorMgtService {
private final IAuthAuthorMgtMapper mapper;
/** 부모 권한코드 */
private static final String PARNTS_AUTHOR = "ROLE_USER";
/** 자녀 권한코드 */
private static final String CHLDRN_AUTHOR = "ROLE_ADMIN";
@Override
public List<XitAuthorInfoVO> findAuthAuthors(final Map<String,Object> paraMap, final RowBounds rowBounds) {
return mapper.selectAuthorInfos(paraMap, rowBounds);
}
@Override
public List<XitAuthorInfoVO> findAuthAuthors(final Map<String, Object> paraMap) {
return mapper.selectAuthorInfos(paraMap);
}
@Override
public XitAuthorInfoVO findAuthAuthor(final String authorCode) {
return mapper.selectAuthorInfo(authorCode);
}
/* =====================================================
* 2020.05.21
*
* -: egovFrame ~ "익명사용자->사용자->관리자"
* ROLE .
* "관리자>매니저>정회원>준회원>비회원"
* ( ) .
* -: "익명사용자->사용자->관리자"
* "익명사용자->사용자->신규권한1/신규권한2/...->관리자"
* n "사용자" ROLE
* n ROLE "관리자" .
* AS-IS: "익명사용자->사용자->관리자" (PARENT) ROLE .
* TO-BE: "익명사용자->사용자->신규권한1/신규권한2/...->관리자" (PARENT) ROLE .
===================================================== */
@Override
public void addAuthAuthor(final XitAuthorInfoVO vo){
//권한정보 Insert
mapper.insertAuthorInfo(vo);
//계층구조생성
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
//부모관계 생성
roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR);
roleSclsrtRescueVO.setChldrnRole(vo.getAuthorCode());
mapper.insertRoleSclsrtRescue(roleSclsrtRescueVO);
//자녀관계 생성
roleSclsrtRescueVO.setParntsRole(vo.getAuthorCode());
roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR);
mapper.insertRoleSclsrtRescue(roleSclsrtRescueVO);
}
@Override
public void modifyAuthAuthor(final XitAuthorInfoVO vo){
mapper.updateAuthorInfo(vo);
}
public void removeAuthAuthor(final String authorCode){
//계층구조 삭제
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR);
roleSclsrtRescueVO.setChldrnRole(authorCode);
mapper.deleteRoleSclsrtRescue(roleSclsrtRescueVO);
//자녀관계 제거
roleSclsrtRescueVO.setParntsRole(authorCode);
roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR);
mapper.deleteRoleSclsrtRescue(roleSclsrtRescueVO);
mapper.deleteAuthorInfo(authorCode);
}
@Override
public List<XitRoleInfoVO> findAuthRoleGrantList(final Map<String, Object> paraMap) {
return mapper.selectAuthRoleGrantList(paraMap);
}
@Override
public void saveAuthRoleGrantList(final Map<String, Object> paraMap) {
List<Map<String,Object>> mapList = (List<Map<String, Object>>)paraMap.get("grantData");
mapList.forEach(map -> {
map.put("authorCode", paraMap.get("authorCode"));
if(Objects.equals(map.get("regYn"), "N"))
mapper.deleteRoleGrant(map);
else
mapper.saveRoleGrant(map);
});
}
}

@ -2,24 +2,66 @@ package kr.xit.framework.biz.mng.auth.service;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import kr.xit.framework.biz.mng.user.model.XitUserScrtySetupVO;
import kr.xit.framework.biz.mng.auth.mapper.IAuthByUserMgtMapper;
import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO;
import kr.xit.framework.biz.mng.user.mapper.IUserMgtMapper;
import kr.xit.framework.biz.mng.user.service.IUserMgtService;
import kr.xit.framework.core.utils.XitCmmnUtil;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Service
public class AuthByUserMgtService implements IAuthByUserMgtService {
private final IAuthByUserMgtMapper mapper;
private final IUserMgtMapper userMapper;
private final IAuthGrpMgtService authGrpMgtService;
private final IUserMgtService userMgtService;
@Override
public List<XitAuthUsrMngVO> findAuthUsers(final Map<String,Object> paraMap, final RowBounds rowBounds) {
return mapper.selectAuthUsers(paraMap, rowBounds);
}
@Override
public void saveAuthUserList(List<Map<String, Object>> paraList) {
String sessionUniqId = XitCmmnUtil.getUserInfo().getUniqId();
paraList.forEach(map -> {
//유효성확인
authGrpMgtService.isCheckUserForCanChange(sessionUniqId, String.valueOf(map.get("authorCode")));
XitUserScrtySetupVO vo = new XitUserScrtySetupVO();
vo.setScrtySetupTrgetId(String.valueOf(map.get("uniqId")));
vo.setMberTyCode(String.valueOf(map.get("mberTyCode")));
vo.setAuthorCode(String.valueOf(map.get("authorCode")));
if(Objects.equals("N", map.get("regYn"))){
userMapper.insertUserScrtySetup(vo);
}else{
userMapper.updateUserScrtySetup(vo);
}
});
}
@Override
public void removeAuthUserList(List<Map<String, Object>> paraList) {
//삭제 시 사용자의 권한을 소속 그룹의 권한 또는 Defualt 권한으로 설정
paraList.forEach(map -> {
XitUserScrtySetupVO vo = new XitUserScrtySetupVO();
vo.setScrtySetupTrgetId(String.valueOf(map.get("uniqId")));
vo.setMberTyCode(String.valueOf(map.get("mberTyCode")));
vo.setAuthorCode(userMgtService.getDefaultAuthorCode(String.valueOf(map.get("groupId"))));
userMapper.updateUserScrtySetup(vo);
});
}
/**
*
* @: Service
* @:
* @: 2020. 4. 16. 9:38:56
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface AuthByUserMgtService {
List<XitAuthUsrMngVO> findAuthUsers(final Map<String,Object> paraMap, final RowBounds rowBounds);
void saveAuthUserList(final List<Map<String, Object>> paraList);
void removeAuthUserList(final List<Map<String, Object>> paraList);
}

@ -4,26 +4,145 @@ import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import egovframework.rte.fdl.cmmn.exception.FdlException;
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
import kr.xit.framework.biz.mng.auth.mapper.IAuthAuthorMgtMapper;
import kr.xit.framework.biz.mng.auth.mapper.IAuthGrpMgtMapper;
import kr.xit.framework.biz.mng.auth.model.XitAuthorGroupInfoVO;
import kr.xit.framework.biz.mng.auth.model.XitRoleSclsrtRescueVO;
import kr.xit.framework.biz.mng.user.mapper.IUserMgtMapper;
import kr.xit.framework.biz.mng.user.model.XitUserScrtySetupVO;
import kr.xit.framework.core.utils.XitCmmnUtil;
import kr.xit.framework.support.exception.BizRuntimeException;
import kr.xit.framework.support.util.constants.MessageKey;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
*
* @: Service
* @:
* @: 2020. 4. 16. 9:38:56
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface AuthGrpMgtService {
List<XitAuthorGroupInfoVO> findAuthGrps(final Map<String,Object> paraMap, final RowBounds rowBounds);
XitAuthorGroupInfoVO findAuthGrp(final String groupId);
void addAuthGrp(final XitAuthorGroupInfoVO vo);
void modifyAuthGrp(final XitAuthorGroupInfoVO vo);
void removeAuthGrp(final String authorCode);
void isCheckUserForCanChange(final String uniqId, final String trgetAuthorCode);
@RequiredArgsConstructor
@Slf4j
@Service
public class AuthGrpMgtService implements IAuthGrpMgtService {
private final IAuthGrpMgtMapper mapper;
private final IAuthAuthorMgtMapper authAuthorMgtMapper;
private final IUserMgtMapper userMgtMapper;
@Qualifier("groupIdGnrService")
private final EgovIdGnrService groupIdGnrService;
@Override
public List<XitAuthorGroupInfoVO> findAuthGrps(final Map<String, Object> paraMap, final RowBounds rowBounds) {
return mapper.selectAuthorGroupInfos(paraMap, rowBounds);
}
@Override
public XitAuthorGroupInfoVO findAuthGrp(final String groupId) {
return mapper.selectAuthorGroupInfo(groupId);
}
@Override
public void addAuthGrp(final XitAuthorGroupInfoVO vo) {
// 유효성 확인
this.isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), vo.getAuthorCode());
try {
vo.setGroupId(groupIdGnrService.getNextStringId());
} catch (FdlException e) {
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage());
}
mapper.insertAuthorGroupInfo(vo);
}
@Override
public void modifyAuthGrp(final XitAuthorGroupInfoVO vo) {
// 유효성 확인
this.isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), vo.getAuthorCode());
mapper.updateAuthorGroupInfo(vo);
}
@Override
public void removeAuthGrp(final String groupId) {
mapper.deleteAuthorGroupInfo(groupId);
}
public void isCheckUserForCanChange(final String uniqId, final String trgetAuthorCode) {
//사용자보안설정 조회
XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO();
userScrtySetupVO.setScrtySetupTrgetId(uniqId);
List<XitUserScrtySetupVO> listUserScrtySetupVO = userMgtMapper.selectUserScrtySetups(userScrtySetupVO);
String userAuthorCode = XitCmmnUtil.isEmpty(listUserScrtySetupVO)?null:listUserScrtySetupVO.get(0).getAuthorCode();
if(!this.isCheckUserAuthorCodeForCanChange(userAuthorCode, trgetAuthorCode))
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "자신의 권한보다 상위 권한을 설정 할 수 없습니다.");;
}
private boolean isCheckUserAuthorCodeForCanChange(final String userAuthorCode, final String trgetAuthorCode) {
//역할(권한)계층구조 데이터 목록 조회
List<XitRoleSclsrtRescueVO> listRoleSclsrtRescueVO = authAuthorMgtMapper.selectRoleSclsrtRescues(null);
//역할(권한)계층구조를 사용하지 않고 있는 경우 true 반환
if(XitCmmnUtil.isEmpty(listRoleSclsrtRescueVO)) {
log.debug("Do not use a RoleSclsrtRescue Data !!");
return true;
}else {
//사용자의 권한 정보가 없을 때(비정상적인 루트로 등록한 사용자 계정으로 판단)
if(XitCmmnUtil.isEmpty(userAuthorCode)) {
log.debug("This user is have not UserScrtySetup Data !!");
return false;
}
}
boolean isExists = false;
//사용자 권한과 매칭되는 역할(권한)계층정보 유무 확인
for(XitRoleSclsrtRescueVO item : listRoleSclsrtRescueVO) {
if(item.getParntsRole().equals(userAuthorCode)) {
isExists = true;
break;
}
}
//사용자 권한이 최상위 권한이면 true 반환
if(!isExists)
for(XitRoleSclsrtRescueVO item : listRoleSclsrtRescueVO) {
if(item.getChldrnRole().equals(userAuthorCode)) {
log.debug("This user is Top-Level Author !!");
return true;
}
}
//사용자의 역할(권한)정보가 없으면 false 반환
if(!isExists) {
log.debug("This user is have not RoleSclsrtRescue Data !!");
return false;
}
/**
*
*
*/
return this.isHighAuthor(listRoleSclsrtRescueVO, userAuthorCode, trgetAuthorCode)?false:true;
}
private boolean isHighAuthor(final List<XitRoleSclsrtRescueVO> list, final String authorCode, final String highAuthorCode) {
boolean result = false;
for (XitRoleSclsrtRescueVO item : list) {
// 상위 권한으로 확인 되었으면 stop
if (result)
break;
// 권한코드가 일치하지 않으면 skip
if (!item.getParntsRole().equals(authorCode))
continue;
if (item.getChldrnRole().equals(highAuthorCode)) { // 상위 권한과 일치하면
result = true;
} else { // 상위 권한과 일치하지 않으면 재호출
result = this.isHighAuthor(list, item.getChldrnRole(), highAuthorCode);
}
}
return result;
}
}

@ -1,26 +1,252 @@
package kr.xit.framework.biz.mng.auth.service;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import kr.xit.framework.biz.mng.auth.model.XitAuthorInfoVO;
import kr.xit.framework.biz.mng.auth.model.XitRoleSclsrtRescueVO;
import kr.xit.framework.biz.mng.auth.mapper.IAuthAuthorMgtMapper;
import kr.xit.framework.biz.mng.auth.mapper.IAuthHierarchyMgtMapper;
import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO;
import kr.xit.framework.biz.mng.auth.service.IAuthHierarchyMgtService;
import kr.xit.framework.core.utils.XitCmmnUtil;
import kr.xit.framework.support.exception.BizRuntimeException;
import kr.xit.framework.support.util.constants.MessageKey;
import lombok.RequiredArgsConstructor;
/**
*
* @: Service
* @:
* @: 2020. 11. 2. 9:38:56
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface AuthHierarchyMgtService {
List<XitAuthHierarchyMngVO> findAuthHierarchies(final Map<String, Object> paraMap, final RowBounds pagingInfo);
XitAuthHierarchyMngVO findAuthHierarchyInfo(final XitAuthHierarchyMngVO vo);
void saveAuthHierarchy(final XitAuthHierarchyMngVO vo);
@RequiredArgsConstructor
@Service
public class AuthHierarchyMgtService implements IAuthHierarchyMgtService {
private final IAuthHierarchyMgtMapper mapper;
private final IAuthAuthorMgtMapper authAuthorMgtMapper;
@Override
public List<XitAuthHierarchyMngVO> findAuthHierarchies(final Map<String, Object> paraMap, final RowBounds rowBounds) {
List<XitAuthHierarchyMngVO> voList = mapper.selectAuthHierarchies(paraMap, rowBounds);
//권한구조 설정
if(XitCmmnUtil.notEmpty(voList)) {
for(XitAuthHierarchyMngVO vo : voList) {
String strAuthorRescueCode = this.getStrAuthHierarchy(vo.getAuthorCode());
vo.setAuthorRescueCode(strAuthorRescueCode);
vo.setAuthorRescueCodeNm(this.convertKorNm(strAuthorRescueCode));
}
}
return voList;
}
@Override
public XitAuthHierarchyMngVO findAuthHierarchyInfo(final XitAuthHierarchyMngVO vo) {
XitAuthHierarchyMngVO result = new XitAuthHierarchyMngVO();
List<XitRoleSclsrtRescueVO> listRoleSclsrtRescueVO = authAuthorMgtMapper.selectRoleSclsrtRescues(new XitRoleSclsrtRescueVO());
if(XitCmmnUtil.isEmpty(listRoleSclsrtRescueVO))
return result;
String topButtonAuthorCode = this.getStrAuthHierarchy(listRoleSclsrtRescueVO.get(0).getChldrnRole());
topButtonAuthorCode = topButtonAuthorCode.split(">")[0].trim();
String strAuthorRescueCode = this.getStrAuthHierarchy(topButtonAuthorCode);
result.setAuthorRescueCode(strAuthorRescueCode);
return result;
}
public void saveAuthHierarchy(final XitAuthHierarchyMngVO vo) {
if(XitCmmnUtil.isEmpty(vo.getAuthorCode()))
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "권한코드는 필수조건 입니다.");
String[] arrAuthorCodeGrp = vo.getAuthorCode().split(","); //권한코드 묶음 목록
/**
*
* - .
* - () .
*/
if(arrAuthorCodeGrp[0].split(";").length>1)
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG,"최상위 부모는 한개만 설정 가능 합니다.");
// 최하위 자녀 갯수 확인
if(arrAuthorCodeGrp[arrAuthorCodeGrp.length-1].split(";").length>1)
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG,"최하위 자녀는 한개만 설정 가능 합니다.");
// 다중상속 구간 갯수 확인
int cnt = 0;
for(String authorCodeGrp : arrAuthorCodeGrp) {
if(authorCodeGrp.split(";").length > 1)
cnt++;
}
if(cnt > 1)
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG,"다중상속은 하나의 구간만 설정 가능 합니다.");
//권한계층구조 일괄 제거
authAuthorMgtMapper.deleteRoleSclsrtRescue(new XitRoleSclsrtRescueVO());
//권한계층 데이터 등록
for(int i=0; i<arrAuthorCodeGrp.length; i++) {
//마지막 권한이면 stop
if(i==arrAuthorCodeGrp.length-1)
break;
String[] arrParntsRole = arrAuthorCodeGrp[i].split(";");
String[] arrChldrnRole = arrAuthorCodeGrp[i+1].split(";");
for(int j=0; j<arrParntsRole.length; j++) {
String parntsRole = arrParntsRole[j];
for(int k=0; k<arrChldrnRole.length; k++) {
String chldrnRole = arrChldrnRole[k];
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
roleSclsrtRescueVO.setParntsRole(parntsRole);
roleSclsrtRescueVO.setChldrnRole(chldrnRole);
authAuthorMgtMapper.insertRoleSclsrtRescue(roleSclsrtRescueVO);
}
}
}
}
/**
* <pre> : .</pre>
* @param authorCode
* @return String
* @author:
* @date: 2020. 11. 2.
*/
private String getStrAuthHierarchy(final String authorCode) {
LinkedHashMap<String, String> mParnts = new LinkedHashMap<String, String>();
LinkedHashMap<String, String> mChldrn = new LinkedHashMap<String, String>();
List<XitRoleSclsrtRescueVO> list = authAuthorMgtMapper.selectRoleSclsrtRescues(new XitRoleSclsrtRescueVO());
this.getAuthHierarchy(list, authorCode, false, mParnts);
this.getAuthHierarchy(list, authorCode, true, mChldrn);
StringBuffer sb = new StringBuffer();
Iterator<String> it = mParnts.keySet().iterator();
while(it.hasNext()) {
sb.append(mParnts.get(it.next())).append(" > ");
}
sb.append(authorCode).append(" > ");
it = mChldrn.keySet().iterator();
while(it.hasNext()) {
sb.append(mChldrn.get(it.next())).append(" > ");
}
String result = sb.toString().trim();
return result.substring(0, result.length()-2);
}
/**
* <pre> : / resultMap(LinkedHashMap) .</pre>
* @param list
* @param authorCode
* @param isChldrnSearch (true: , false: )
* @param resultMap
* @return void
* @author:
* @date: 2020. 11. 2.
*/
private void getAuthHierarchy(final List<XitRoleSclsrtRescueVO> list, final String authorCode, final boolean isChldrnSearch, final LinkedHashMap<String, String> resultMap) {
for (XitRoleSclsrtRescueVO item : list) {
if(isChldrnSearch) {
// 권한코드가 일치하지 않으면 skip
if (!item.getParntsRole().equals(authorCode))
continue;
//권한코드 Set
if(resultMap.containsKey(authorCode)) {
//동일한 값이면 담지 않음
if(resultMap.get(authorCode).equals(item.getChldrnRole()))
continue;
resultMap.put(authorCode, resultMap.get(authorCode)+", "+item.getChldrnRole());
}else {
//동일한 값이 있으면 담지 않음
Iterator<String> it = resultMap.values().iterator();
boolean isExists = false;
LOOP:
while(it.hasNext()) {
String[] values = it.next().split(",");
for(int j=0; j<values.length; j++) {
String value = values[j].trim();
if(value.equals(item.getChldrnRole())) {
isExists = true;
break LOOP;
}
}
}
if(!isExists)
resultMap.put(authorCode, item.getChldrnRole());
}
//재탐색
this.getAuthHierarchy(list, item.getChldrnRole(), isChldrnSearch, resultMap);
}else {
// 권한코드가 일치하지 않으면 skip
if (!item.getChldrnRole().equals(authorCode))
continue;
//재탐색
this.getAuthHierarchy(list, item.getParntsRole(), isChldrnSearch, resultMap);
//권한코드 Set
if(resultMap.containsKey(authorCode)) {
//동일한 값이면 담지 않음
if(resultMap.get(authorCode).equals(item.getParntsRole()))
continue;
resultMap.put(authorCode, resultMap.get(authorCode)+", "+item.getParntsRole());
}else {
//동일한 값이 있으면 담지 않음
if(!resultMap.containsValue(item.getParntsRole())) {
resultMap.put(authorCode, item.getParntsRole());
}
}
}
}
}
private String convertKorNm(final String strAuthorRescueCode) {
//권한코드 Map 생성
List<XitAuthorInfoVO> listAuthorInfoVO = authAuthorMgtMapper.selectAuthorInfos(null);
Map<String, String> mAuthorInfo = new HashMap<String, String>();
for(XitAuthorInfoVO item : listAuthorInfoVO) {
mAuthorInfo.put(item.getAuthorCode(), item.getAuthorNm());
}
StringBuffer sb = new StringBuffer();
String[] items = strAuthorRescueCode.split(">");
for(int i=0; i<items.length; i++) {
String item = items[i];
if(i>0)
sb.append(" > ");
String[] arrAuthorCode = item.split(",");
for(int j=0; j<arrAuthorCode.length; j++) {
String authorCode = arrAuthorCode[j].trim();
if(j==0)
sb.append(mAuthorInfo.get(authorCode));
else
sb.append(", ").append(mAuthorInfo.get(authorCode));
}
}
return sb.toString();
}
}

@ -4,62 +4,57 @@ import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import egovframework.rte.fdl.cmmn.exception.FdlException;
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
import kr.xit.framework.biz.mng.auth.mapper.IAuthRoleMgtMapper;
import kr.xit.framework.biz.mng.auth.model.XitRoleInfoVO;
/**
*
* @: Service
* @:
* @: 2020. 4. 16. 9:38:56
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface AuthRoleMgtService {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitAuthRuleMngVO>
* @author:
* @date: 2020. 4. 16.
*/
List<XitRoleInfoVO> findAuthRoles(final Map<String,Object> paraMap, final RowBounds rowBounds);
/**
* <pre> : </pre>
* @param vo
* @return XitAuthRuleMngVO
* @author:
* @date: 2020. 4. 16.
*/
XitRoleInfoVO findAuthRole(final String roleCode);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
void addAuthRole(final XitRoleInfoVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
void modifyAuthRole(final XitRoleInfoVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
void removeAuthRole(final String roleCode);
import kr.xit.framework.biz.mng.auth.service.IAuthRoleMgtService;
import kr.xit.framework.support.exception.BizRuntimeException;
import kr.xit.framework.support.util.constants.MessageKey;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Service
public class AuthRoleMgtService implements IAuthRoleMgtService {
private final IAuthRoleMgtMapper mapper;
@Qualifier("groupIdGnrService")
private final EgovIdGnrService groupIdGnrService;
@Override
public List<XitRoleInfoVO> findAuthRoles(final Map<String,Object> paraMap, final RowBounds rowBounds) {
return mapper.selectAuthRoles(paraMap, rowBounds);
}
@Override
public XitRoleInfoVO findAuthRole(final String roleCode) {
return mapper.selectAuthRole(roleCode);
}
@Override
public void addAuthRole(final XitRoleInfoVO vo) {
String roleTyp = vo.getRoleTy();
if("method".equals(roleTyp)) roleTyp = "mtd";
else if("pointcut".equals(roleTyp)) roleTyp = "pct";
else roleTyp = "web";
try {
vo.setRoleCode(roleTyp.concat("-").concat(groupIdGnrService.getNextStringId()));
} catch (FdlException e) {
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage());
}
mapper.insertAuthRole(vo);
}
@Override
public void modifyAuthRole(final XitRoleInfoVO vo) {
mapper.updateAuthRole(vo);
}
@Override
public void removeAuthRole(final String roleCode) {
mapper.deleteAuthRole(roleCode);
}
}

@ -0,0 +1,42 @@
package kr.xit.framework.biz.mng.auth.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import kr.xit.framework.biz.mng.auth.model.XitAuthorInfoVO;
import kr.xit.framework.biz.mng.auth.model.XitRoleInfoVO;
/**
*
* @: Service
* @:
* @: 2020. 4. 16. 9:38:56
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface IAuthAuthorMgtService {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitAuthRegMngVO>
* @author:
* @date: 2020. 4. 16.
*/
List<XitAuthorInfoVO> findAuthAuthors(final Map<String,Object> paraMap, final RowBounds rowBounds);
List<XitAuthorInfoVO> findAuthAuthors(final Map<String,Object> paraMap);
XitAuthorInfoVO findAuthAuthor(final String authorCode);
void addAuthAuthor(final XitAuthorInfoVO vo);
void modifyAuthAuthor(final XitAuthorInfoVO vo);
void removeAuthAuthor(final String authorCode);
List<XitRoleInfoVO> findAuthRoleGrantList(final Map<String, Object> paraMap);
void saveAuthRoleGrantList(final Map<String, Object> paraMap);
}

@ -0,0 +1,25 @@
package kr.xit.framework.biz.mng.auth.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO;
/**
*
* @: Service
* @:
* @: 2020. 4. 16. 9:38:56
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface IAuthByUserMgtService {
List<XitAuthUsrMngVO> findAuthUsers(final Map<String,Object> paraMap, final RowBounds rowBounds);
void saveAuthUserList(final List<Map<String, Object>> paraList);
void removeAuthUserList(final List<Map<String, Object>> paraList);
}

@ -0,0 +1,29 @@
package kr.xit.framework.biz.mng.auth.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import kr.xit.framework.biz.mng.auth.model.XitAuthorGroupInfoVO;
/**
*
* @: Service
* @:
* @: 2020. 4. 16. 9:38:56
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface IAuthGrpMgtService {
List<XitAuthorGroupInfoVO> findAuthGrps(final Map<String,Object> paraMap, final RowBounds rowBounds);
XitAuthorGroupInfoVO findAuthGrp(final String groupId);
void addAuthGrp(final XitAuthorGroupInfoVO vo);
void modifyAuthGrp(final XitAuthorGroupInfoVO vo);
void removeAuthGrp(final String authorCode);
void isCheckUserForCanChange(final String uniqId, final String trgetAuthorCode);
}

@ -0,0 +1,26 @@
package kr.xit.framework.biz.mng.auth.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO;
/**
*
* @: Service
* @:
* @: 2020. 11. 2. 9:38:56
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface IAuthHierarchyMgtService {
List<XitAuthHierarchyMngVO> findAuthHierarchies(final Map<String, Object> paraMap, final RowBounds pagingInfo);
XitAuthHierarchyMngVO findAuthHierarchyInfo(final XitAuthHierarchyMngVO vo);
void saveAuthHierarchy(final XitAuthHierarchyMngVO vo);
}

@ -0,0 +1,65 @@
package kr.xit.framework.biz.mng.auth.service;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import kr.xit.framework.biz.mng.auth.model.XitRoleInfoVO;
/**
*
* @: Service
* @:
* @: 2020. 4. 16. 9:38:56
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface IAuthRoleMgtService {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitAuthRuleMngVO>
* @author:
* @date: 2020. 4. 16.
*/
List<XitRoleInfoVO> findAuthRoles(final Map<String,Object> paraMap, final RowBounds rowBounds);
/**
* <pre> : </pre>
* @param vo
* @return XitAuthRuleMngVO
* @author:
* @date: 2020. 4. 16.
*/
XitRoleInfoVO findAuthRole(final String roleCode);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
void addAuthRole(final XitRoleInfoVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
void modifyAuthRole(final XitRoleInfoVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
void removeAuthRole(final String roleCode);
}

@ -1,112 +0,0 @@
package kr.xit.framework.biz.mng.auth.service.impl;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import kr.xit.framework.biz.mng.auth.model.XitAuthorInfoVO;
import kr.xit.framework.biz.mng.auth.model.XitRoleInfoVO;
import kr.xit.framework.biz.mng.auth.model.XitRoleSclsrtRescueVO;
import kr.xit.framework.biz.mng.auth.mapper.AuthAuthorMgtMapper;
import kr.xit.framework.biz.mng.auth.service.AuthAuthorMgtService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@RequiredArgsConstructor
@Slf4j
@Service
public class AuthAuthorMgtServiceImpl implements AuthAuthorMgtService {
private final AuthAuthorMgtMapper mapper;
/** 부모 권한코드 */
private static final String PARNTS_AUTHOR = "ROLE_USER";
/** 자녀 권한코드 */
private static final String CHLDRN_AUTHOR = "ROLE_ADMIN";
@Override
public List<XitAuthorInfoVO> findAuthAuthors(final Map<String,Object> paraMap, final RowBounds rowBounds) {
return mapper.selectAuthorInfos(paraMap, rowBounds);
}
@Override
public List<XitAuthorInfoVO> findAuthAuthors(final Map<String, Object> paraMap) {
return mapper.selectAuthorInfos(paraMap);
}
@Override
public XitAuthorInfoVO findAuthAuthor(final String authorCode) {
return mapper.selectAuthorInfo(authorCode);
}
/* =====================================================
* 2020.05.21
*
* -: egovFrame ~ "익명사용자->사용자->관리자"
* ROLE .
* "관리자>매니저>정회원>준회원>비회원"
* ( ) .
* -: "익명사용자->사용자->관리자"
* "익명사용자->사용자->신규권한1/신규권한2/...->관리자"
* n "사용자" ROLE
* n ROLE "관리자" .
* AS-IS: "익명사용자->사용자->관리자" (PARENT) ROLE .
* TO-BE: "익명사용자->사용자->신규권한1/신규권한2/...->관리자" (PARENT) ROLE .
===================================================== */
@Override
public void addAuthAuthor(final XitAuthorInfoVO vo){
//권한정보 Insert
mapper.insertAuthorInfo(vo);
//계층구조생성
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
//부모관계 생성
roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR);
roleSclsrtRescueVO.setChldrnRole(vo.getAuthorCode());
mapper.insertRoleSclsrtRescue(roleSclsrtRescueVO);
//자녀관계 생성
roleSclsrtRescueVO.setParntsRole(vo.getAuthorCode());
roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR);
mapper.insertRoleSclsrtRescue(roleSclsrtRescueVO);
}
@Override
public void modifyAuthAuthor(final XitAuthorInfoVO vo){
mapper.updateAuthorInfo(vo);
}
public void removeAuthAuthor(final String authorCode){
//계층구조 삭제
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
roleSclsrtRescueVO.setParntsRole(PARNTS_AUTHOR);
roleSclsrtRescueVO.setChldrnRole(authorCode);
mapper.deleteRoleSclsrtRescue(roleSclsrtRescueVO);
//자녀관계 제거
roleSclsrtRescueVO.setParntsRole(authorCode);
roleSclsrtRescueVO.setChldrnRole(CHLDRN_AUTHOR);
mapper.deleteRoleSclsrtRescue(roleSclsrtRescueVO);
mapper.deleteAuthorInfo(authorCode);
}
@Override
public List<XitRoleInfoVO> findAuthRoleGrantList(final Map<String, Object> paraMap) {
return mapper.selectAuthRoleGrantList(paraMap);
}
@Override
public void saveAuthRoleGrantList(final Map<String, Object> paraMap) {
List<Map<String,Object>> mapList = (List<Map<String, Object>>)paraMap.get("grantData");
mapList.forEach(map -> {
map.put("authorCode", paraMap.get("authorCode"));
if(Objects.equals(map.get("regYn"), "N"))
mapper.deleteRoleGrant(map);
else
mapper.saveRoleGrant(map);
});
}
}

@ -1,69 +0,0 @@
package kr.xit.framework.biz.mng.auth.service.impl;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import kr.xit.framework.biz.mng.user.model.XitUserScrtySetupVO;
import kr.xit.framework.biz.mng.auth.mapper.AuthByUserMgtMapper;
import kr.xit.framework.biz.mng.auth.model.XitAuthUsrMngVO;
import kr.xit.framework.biz.mng.auth.service.AuthGrpMgtService;
import kr.xit.framework.biz.mng.auth.service.AuthByUserMgtService;
import kr.xit.framework.biz.mng.user.mapper.UserMgtMapper;
import kr.xit.framework.biz.mng.user.service.UserMgtService;
import kr.xit.framework.core.utils.XitCmmnUtil;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Service
public class AuthByUserMgtServiceImpl implements AuthByUserMgtService {
private final AuthByUserMgtMapper mapper;
private final UserMgtMapper userMapper;
private final AuthGrpMgtService authGrpMgtService;
private final UserMgtService userMgtService;
@Override
public List<XitAuthUsrMngVO> findAuthUsers(final Map<String,Object> paraMap, final RowBounds rowBounds) {
return mapper.selectAuthUsers(paraMap, rowBounds);
}
@Override
public void saveAuthUserList(List<Map<String, Object>> paraList) {
String sessionUniqId = XitCmmnUtil.getUserInfo().getUniqId();
paraList.forEach(map -> {
//유효성확인
authGrpMgtService.isCheckUserForCanChange(sessionUniqId, String.valueOf(map.get("authorCode")));
XitUserScrtySetupVO vo = new XitUserScrtySetupVO();
vo.setScrtySetupTrgetId(String.valueOf(map.get("uniqId")));
vo.setMberTyCode(String.valueOf(map.get("mberTyCode")));
vo.setAuthorCode(String.valueOf(map.get("authorCode")));
if(Objects.equals("N", map.get("regYn"))){
userMapper.insertUserScrtySetup(vo);
}else{
userMapper.updateUserScrtySetup(vo);
}
});
}
@Override
public void removeAuthUserList(List<Map<String, Object>> paraList) {
//삭제 시 사용자의 권한을 소속 그룹의 권한 또는 Defualt 권한으로 설정
paraList.forEach(map -> {
XitUserScrtySetupVO vo = new XitUserScrtySetupVO();
vo.setScrtySetupTrgetId(String.valueOf(map.get("uniqId")));
vo.setMberTyCode(String.valueOf(map.get("mberTyCode")));
vo.setAuthorCode(userMgtService.getDefaultAuthorCode(String.valueOf(map.get("groupId"))));
userMapper.updateUserScrtySetup(vo);
});
}
}

@ -1,149 +0,0 @@
package kr.xit.framework.biz.mng.auth.service.impl;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import egovframework.rte.fdl.cmmn.exception.FdlException;
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
import kr.xit.framework.biz.mng.auth.mapper.AuthAuthorMgtMapper;
import kr.xit.framework.biz.mng.auth.mapper.AuthGrpMgtMapper;
import kr.xit.framework.biz.mng.auth.model.XitAuthorGroupInfoVO;
import kr.xit.framework.biz.mng.auth.model.XitRoleSclsrtRescueVO;
import kr.xit.framework.biz.mng.auth.service.AuthGrpMgtService;
import kr.xit.framework.biz.mng.user.mapper.UserMgtMapper;
import kr.xit.framework.biz.mng.user.model.XitUserScrtySetupVO;
import kr.xit.framework.core.utils.XitCmmnUtil;
import kr.xit.framework.support.exception.BizRuntimeException;
import kr.xit.framework.support.util.constants.MessageKey;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@RequiredArgsConstructor
@Slf4j
@Service
public class AuthGrpMgtServiceImpl implements AuthGrpMgtService {
private final AuthGrpMgtMapper mapper;
private final AuthAuthorMgtMapper authAuthorMgtMapper;
private final UserMgtMapper userMgtMapper;
@Qualifier("groupIdGnrService")
private final EgovIdGnrService groupIdGnrService;
@Override
public List<XitAuthorGroupInfoVO> findAuthGrps(final Map<String, Object> paraMap, final RowBounds rowBounds) {
return mapper.selectAuthorGroupInfos(paraMap, rowBounds);
}
@Override
public XitAuthorGroupInfoVO findAuthGrp(final String groupId) {
return mapper.selectAuthorGroupInfo(groupId);
}
@Override
public void addAuthGrp(final XitAuthorGroupInfoVO vo) {
// 유효성 확인
this.isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), vo.getAuthorCode());
try {
vo.setGroupId(groupIdGnrService.getNextStringId());
} catch (FdlException e) {
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage());
}
mapper.insertAuthorGroupInfo(vo);
}
@Override
public void modifyAuthGrp(final XitAuthorGroupInfoVO vo) {
// 유효성 확인
this.isCheckUserForCanChange(XitCmmnUtil.getUserInfo().getUniqId(), vo.getAuthorCode());
mapper.updateAuthorGroupInfo(vo);
}
@Override
public void removeAuthGrp(final String groupId) {
mapper.deleteAuthorGroupInfo(groupId);
}
public void isCheckUserForCanChange(final String uniqId, final String trgetAuthorCode) {
//사용자보안설정 조회
XitUserScrtySetupVO userScrtySetupVO = new XitUserScrtySetupVO();
userScrtySetupVO.setScrtySetupTrgetId(uniqId);
List<XitUserScrtySetupVO> listUserScrtySetupVO = userMgtMapper.selectUserScrtySetups(userScrtySetupVO);
String userAuthorCode = XitCmmnUtil.isEmpty(listUserScrtySetupVO)?null:listUserScrtySetupVO.get(0).getAuthorCode();
if(!this.isCheckUserAuthorCodeForCanChange(userAuthorCode, trgetAuthorCode))
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "자신의 권한보다 상위 권한을 설정 할 수 없습니다.");;
}
private boolean isCheckUserAuthorCodeForCanChange(final String userAuthorCode, final String trgetAuthorCode) {
//역할(권한)계층구조 데이터 목록 조회
List<XitRoleSclsrtRescueVO> listRoleSclsrtRescueVO = authAuthorMgtMapper.selectRoleSclsrtRescues(null);
//역할(권한)계층구조를 사용하지 않고 있는 경우 true 반환
if(XitCmmnUtil.isEmpty(listRoleSclsrtRescueVO)) {
log.debug("Do not use a RoleSclsrtRescue Data !!");
return true;
}else {
//사용자의 권한 정보가 없을 때(비정상적인 루트로 등록한 사용자 계정으로 판단)
if(XitCmmnUtil.isEmpty(userAuthorCode)) {
log.debug("This user is have not UserScrtySetup Data !!");
return false;
}
}
boolean isExists = false;
//사용자 권한과 매칭되는 역할(권한)계층정보 유무 확인
for(XitRoleSclsrtRescueVO item : listRoleSclsrtRescueVO) {
if(item.getParntsRole().equals(userAuthorCode)) {
isExists = true;
break;
}
}
//사용자 권한이 최상위 권한이면 true 반환
if(!isExists)
for(XitRoleSclsrtRescueVO item : listRoleSclsrtRescueVO) {
if(item.getChldrnRole().equals(userAuthorCode)) {
log.debug("This user is Top-Level Author !!");
return true;
}
}
//사용자의 역할(권한)정보가 없으면 false 반환
if(!isExists) {
log.debug("This user is have not RoleSclsrtRescue Data !!");
return false;
}
/**
*
*
*/
return this.isHighAuthor(listRoleSclsrtRescueVO, userAuthorCode, trgetAuthorCode)?false:true;
}
private boolean isHighAuthor(final List<XitRoleSclsrtRescueVO> list, final String authorCode, final String highAuthorCode) {
boolean result = false;
for (XitRoleSclsrtRescueVO item : list) {
// 상위 권한으로 확인 되었으면 stop
if (result)
break;
// 권한코드가 일치하지 않으면 skip
if (!item.getParntsRole().equals(authorCode))
continue;
if (item.getChldrnRole().equals(highAuthorCode)) { // 상위 권한과 일치하면
result = true;
} else { // 상위 권한과 일치하지 않으면 재호출
result = this.isHighAuthor(list, item.getChldrnRole(), highAuthorCode);
}
}
return result;
}
}

@ -1,252 +0,0 @@
package kr.xit.framework.biz.mng.auth.service.impl;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Service;
import kr.xit.framework.biz.mng.auth.model.XitAuthorInfoVO;
import kr.xit.framework.biz.mng.auth.model.XitRoleSclsrtRescueVO;
import kr.xit.framework.biz.mng.auth.mapper.AuthAuthorMgtMapper;
import kr.xit.framework.biz.mng.auth.mapper.AuthHierarchyMgtMapper;
import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO;
import kr.xit.framework.biz.mng.auth.service.AuthHierarchyMgtService;
import kr.xit.framework.core.utils.XitCmmnUtil;
import kr.xit.framework.support.exception.BizRuntimeException;
import kr.xit.framework.support.util.constants.MessageKey;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Service
public class AuthHierarchyMgtServiceImpl implements AuthHierarchyMgtService {
private final AuthHierarchyMgtMapper mapper;
private final AuthAuthorMgtMapper authAuthorMgtMapper;
@Override
public List<XitAuthHierarchyMngVO> findAuthHierarchies(final Map<String, Object> paraMap, final RowBounds rowBounds) {
List<XitAuthHierarchyMngVO> voList = mapper.selectAuthHierarchies(paraMap, rowBounds);
//권한구조 설정
if(XitCmmnUtil.notEmpty(voList)) {
for(XitAuthHierarchyMngVO vo : voList) {
String strAuthorRescueCode = this.getStrAuthHierarchy(vo.getAuthorCode());
vo.setAuthorRescueCode(strAuthorRescueCode);
vo.setAuthorRescueCodeNm(this.convertKorNm(strAuthorRescueCode));
}
}
return voList;
}
@Override
public XitAuthHierarchyMngVO findAuthHierarchyInfo(final XitAuthHierarchyMngVO vo) {
XitAuthHierarchyMngVO result = new XitAuthHierarchyMngVO();
List<XitRoleSclsrtRescueVO> listRoleSclsrtRescueVO = authAuthorMgtMapper.selectRoleSclsrtRescues(new XitRoleSclsrtRescueVO());
if(XitCmmnUtil.isEmpty(listRoleSclsrtRescueVO))
return result;
String topButtonAuthorCode = this.getStrAuthHierarchy(listRoleSclsrtRescueVO.get(0).getChldrnRole());
topButtonAuthorCode = topButtonAuthorCode.split(">")[0].trim();
String strAuthorRescueCode = this.getStrAuthHierarchy(topButtonAuthorCode);
result.setAuthorRescueCode(strAuthorRescueCode);
return result;
}
public void saveAuthHierarchy(final XitAuthHierarchyMngVO vo) {
if(XitCmmnUtil.isEmpty(vo.getAuthorCode()))
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, "권한코드는 필수조건 입니다.");
String[] arrAuthorCodeGrp = vo.getAuthorCode().split(","); //권한코드 묶음 목록
/**
*
* - .
* - () .
*/
if(arrAuthorCodeGrp[0].split(";").length>1)
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG,"최상위 부모는 한개만 설정 가능 합니다.");
// 최하위 자녀 갯수 확인
if(arrAuthorCodeGrp[arrAuthorCodeGrp.length-1].split(";").length>1)
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG,"최하위 자녀는 한개만 설정 가능 합니다.");
// 다중상속 구간 갯수 확인
int cnt = 0;
for(String authorCodeGrp : arrAuthorCodeGrp) {
if(authorCodeGrp.split(";").length > 1)
cnt++;
}
if(cnt > 1)
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG,"다중상속은 하나의 구간만 설정 가능 합니다.");
//권한계층구조 일괄 제거
authAuthorMgtMapper.deleteRoleSclsrtRescue(new XitRoleSclsrtRescueVO());
//권한계층 데이터 등록
for(int i=0; i<arrAuthorCodeGrp.length; i++) {
//마지막 권한이면 stop
if(i==arrAuthorCodeGrp.length-1)
break;
String[] arrParntsRole = arrAuthorCodeGrp[i].split(";");
String[] arrChldrnRole = arrAuthorCodeGrp[i+1].split(";");
for(int j=0; j<arrParntsRole.length; j++) {
String parntsRole = arrParntsRole[j];
for(int k=0; k<arrChldrnRole.length; k++) {
String chldrnRole = arrChldrnRole[k];
XitRoleSclsrtRescueVO roleSclsrtRescueVO = new XitRoleSclsrtRescueVO();
roleSclsrtRescueVO.setParntsRole(parntsRole);
roleSclsrtRescueVO.setChldrnRole(chldrnRole);
authAuthorMgtMapper.insertRoleSclsrtRescue(roleSclsrtRescueVO);
}
}
}
}
/**
* <pre> : .</pre>
* @param authorCode
* @return String
* @author:
* @date: 2020. 11. 2.
*/
private String getStrAuthHierarchy(final String authorCode) {
LinkedHashMap<String, String> mParnts = new LinkedHashMap<String, String>();
LinkedHashMap<String, String> mChldrn = new LinkedHashMap<String, String>();
List<XitRoleSclsrtRescueVO> list = authAuthorMgtMapper.selectRoleSclsrtRescues(new XitRoleSclsrtRescueVO());
this.getAuthHierarchy(list, authorCode, false, mParnts);
this.getAuthHierarchy(list, authorCode, true, mChldrn);
StringBuffer sb = new StringBuffer();
Iterator<String> it = mParnts.keySet().iterator();
while(it.hasNext()) {
sb.append(mParnts.get(it.next())).append(" > ");
}
sb.append(authorCode).append(" > ");
it = mChldrn.keySet().iterator();
while(it.hasNext()) {
sb.append(mChldrn.get(it.next())).append(" > ");
}
String result = sb.toString().trim();
return result.substring(0, result.length()-2);
}
/**
* <pre> : / resultMap(LinkedHashMap) .</pre>
* @param list
* @param authorCode
* @param isChldrnSearch (true: , false: )
* @param resultMap
* @return void
* @author:
* @date: 2020. 11. 2.
*/
private void getAuthHierarchy(final List<XitRoleSclsrtRescueVO> list, final String authorCode, final boolean isChldrnSearch, final LinkedHashMap<String, String> resultMap) {
for (XitRoleSclsrtRescueVO item : list) {
if(isChldrnSearch) {
// 권한코드가 일치하지 않으면 skip
if (!item.getParntsRole().equals(authorCode))
continue;
//권한코드 Set
if(resultMap.containsKey(authorCode)) {
//동일한 값이면 담지 않음
if(resultMap.get(authorCode).equals(item.getChldrnRole()))
continue;
resultMap.put(authorCode, resultMap.get(authorCode)+", "+item.getChldrnRole());
}else {
//동일한 값이 있으면 담지 않음
Iterator<String> it = resultMap.values().iterator();
boolean isExists = false;
LOOP:
while(it.hasNext()) {
String[] values = it.next().split(",");
for(int j=0; j<values.length; j++) {
String value = values[j].trim();
if(value.equals(item.getChldrnRole())) {
isExists = true;
break LOOP;
}
}
}
if(!isExists)
resultMap.put(authorCode, item.getChldrnRole());
}
//재탐색
this.getAuthHierarchy(list, item.getChldrnRole(), isChldrnSearch, resultMap);
}else {
// 권한코드가 일치하지 않으면 skip
if (!item.getChldrnRole().equals(authorCode))
continue;
//재탐색
this.getAuthHierarchy(list, item.getParntsRole(), isChldrnSearch, resultMap);
//권한코드 Set
if(resultMap.containsKey(authorCode)) {
//동일한 값이면 담지 않음
if(resultMap.get(authorCode).equals(item.getParntsRole()))
continue;
resultMap.put(authorCode, resultMap.get(authorCode)+", "+item.getParntsRole());
}else {
//동일한 값이 있으면 담지 않음
if(!resultMap.containsValue(item.getParntsRole())) {
resultMap.put(authorCode, item.getParntsRole());
}
}
}
}
}
private String convertKorNm(final String strAuthorRescueCode) {
//권한코드 Map 생성
List<XitAuthorInfoVO> listAuthorInfoVO = authAuthorMgtMapper.selectAuthorInfos(null);
Map<String, String> mAuthorInfo = new HashMap<String, String>();
for(XitAuthorInfoVO item : listAuthorInfoVO) {
mAuthorInfo.put(item.getAuthorCode(), item.getAuthorNm());
}
StringBuffer sb = new StringBuffer();
String[] items = strAuthorRescueCode.split(">");
for(int i=0; i<items.length; i++) {
String item = items[i];
if(i>0)
sb.append(" > ");
String[] arrAuthorCode = item.split(",");
for(int j=0; j<arrAuthorCode.length; j++) {
String authorCode = arrAuthorCode[j].trim();
if(j==0)
sb.append(mAuthorInfo.get(authorCode));
else
sb.append(", ").append(mAuthorInfo.get(authorCode));
}
}
return sb.toString();
}
}

@ -1,60 +0,0 @@
package kr.xit.framework.biz.mng.auth.service.impl;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.session.RowBounds;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import egovframework.rte.fdl.cmmn.exception.FdlException;
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
import kr.xit.framework.biz.mng.auth.mapper.AuthRoleMgtMapper;
import kr.xit.framework.biz.mng.auth.model.XitRoleInfoVO;
import kr.xit.framework.biz.mng.auth.service.AuthRoleMgtService;
import kr.xit.framework.support.exception.BizRuntimeException;
import kr.xit.framework.support.util.constants.MessageKey;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
@Service
public class AuthRoleMgtServiceImpl implements AuthRoleMgtService {
private final AuthRoleMgtMapper mapper;
@Qualifier("groupIdGnrService")
private final EgovIdGnrService groupIdGnrService;
@Override
public List<XitRoleInfoVO> findAuthRoles(final Map<String,Object> paraMap, final RowBounds rowBounds) {
return mapper.selectAuthRoles(paraMap, rowBounds);
}
@Override
public XitRoleInfoVO findAuthRole(final String roleCode) {
return mapper.selectAuthRole(roleCode);
}
@Override
public void addAuthRole(final XitRoleInfoVO vo) {
String roleTyp = vo.getRoleTy();
if("method".equals(roleTyp)) roleTyp = "mtd";
else if("pointcut".equals(roleTyp)) roleTyp = "pct";
else roleTyp = "web";
try {
vo.setRoleCode(roleTyp.concat("-").concat(groupIdGnrService.getNextStringId()));
} catch (FdlException e) {
throw BizRuntimeException.create(MessageKey.CUSTOM_MSG, e.getMessage());
}
mapper.insertAuthRole(vo);
}
@Override
public void modifyAuthRole(final XitRoleInfoVO vo) {
mapper.updateAuthRole(vo);
}
@Override
public void removeAuthRole(final String roleCode) {
mapper.deleteAuthRole(roleCode);
}
}

@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import kr.xit.framework.biz.mng.auth.model.XitAuthorInfoVO;
import kr.xit.framework.biz.mng.auth.service.AuthAuthorMgtService;
import kr.xit.framework.biz.mng.auth.service.IAuthAuthorMgtService;
import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.support.mybatis.MybatisUtils;
@ -39,7 +39,7 @@ import lombok.RequiredArgsConstructor;
@RequestMapping("/framework/biz/mng/auth")
public class AuthAuthorMgtController {
private final AuthAuthorMgtService service;
private final IAuthAuthorMgtService service;
/**

@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import kr.xit.framework.biz.cache.util.CacheServiceUtils;
import kr.xit.framework.biz.mng.auth.service.AuthByUserMgtService;
import kr.xit.framework.biz.mng.auth.service.IAuthByUserMgtService;
import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.support.mybatis.MybatisUtils;
@ -35,7 +35,7 @@ import lombok.RequiredArgsConstructor;
@RequestMapping("/framework/biz/mng/auth")
public class AuthByUserMgtController {
private final AuthByUserMgtService service;
private final IAuthByUserMgtService service;
/**

@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import kr.xit.framework.biz.mng.auth.model.XitAuthorGroupInfoVO;
import kr.xit.framework.biz.mng.auth.service.AuthGrpMgtService;
import kr.xit.framework.biz.mng.auth.service.IAuthGrpMgtService;
import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.support.mybatis.MybatisUtils;
@ -35,7 +35,7 @@ import lombok.RequiredArgsConstructor;
@RequestMapping("/framework/biz/mng/auth")
public class AuthGrpMgtController {
private final AuthGrpMgtService service;
private final IAuthGrpMgtService service;
/**
* <pre> : </pre>

@ -20,8 +20,8 @@ import egovframework.rte.fdl.security.securedobject.EgovSecuredObjectService;
import egovframework.rte.fdl.security.userdetails.jdbc.EgovJdbcUserDetailsManager;
import kr.xit.framework.biz.mng.auth.model.XitAuthHierarchyMngVO;
import kr.xit.framework.biz.mng.auth.model.XitAuthorInfoVO;
import kr.xit.framework.biz.mng.auth.service.AuthAuthorMgtService;
import kr.xit.framework.biz.mng.auth.service.AuthHierarchyMgtService;
import kr.xit.framework.biz.mng.auth.service.IAuthAuthorMgtService;
import kr.xit.framework.biz.mng.auth.service.IAuthHierarchyMgtService;
import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.support.exception.BizRuntimeException;
@ -46,8 +46,8 @@ import lombok.RequiredArgsConstructor;
@RequestMapping("/framework/biz/mng/auth")
public class AuthHierarchyMgtController {
private final AuthHierarchyMgtService service;
private final AuthAuthorMgtService authAuthorMgtService;
private final IAuthHierarchyMgtService service;
private final IAuthAuthorMgtService authAuthorMgtService;
private final EgovSecuredObjectService egovSecuredObjectService;
private final RoleHierarchyImpl roleHierarchyImpl;

@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import kr.xit.framework.biz.mng.auth.model.XitRoleInfoVO;
import kr.xit.framework.biz.mng.auth.service.AuthRoleMgtService;
import kr.xit.framework.biz.mng.auth.service.IAuthRoleMgtService;
import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.support.mybatis.MybatisUtils;
@ -37,7 +37,7 @@ import lombok.RequiredArgsConstructor;
@RequestMapping("/framework/biz/mng/auth")
public class AuthRoleMgtController {
private final AuthRoleMgtService service;
private final IAuthRoleMgtService service;
/**
* <pre> : </pre>

@ -0,0 +1,49 @@
package kr.xit.framework.biz.mng.code.mapper;
import java.sql.SQLException;
import java.util.List;
import egovframework.rte.psl.dataaccess.mapper.Mapper;
import kr.xit.framework.biz.mng.code.model.XitClCodeMngSearchVO;
import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO;
/**
*
* @: Mapper
* @:
* @: 2020. 4. 16. 9:38:07
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface ICodeClassificationMgtMapper {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitClCodeMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitClCodeMngVO> findList(XitClCodeMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitClCodeMngSearchVO searchVO) throws SQLException;
/**
* <pre> : </pre>
* @param vo
* @return XitClCodeMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitClCodeMngVO findView(XitClCodeMngVO vo) throws SQLException;
}

@ -0,0 +1,140 @@
package kr.xit.framework.biz.mng.code.service;
import java.sql.SQLException;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
import kr.xit.framework.biz.cmm.model.XitCmmnClCodeVO;
import kr.xit.framework.biz.cmm.service.XitFrameCrudService;
import kr.xit.framework.biz.mng.code.mapper.ICodeClassificationMgtMapper;
import kr.xit.framework.biz.mng.code.model.XitClCodeMngSearchVO;
import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO;
import kr.xit.framework.core.message.XitMessageSource;
@Service
public class CodeClassificationMgtService implements ICodeClassificationMgtService {
@Resource
private ICodeClassificationMgtMapper mapper;
@Resource
private XitFrameCrudService xitFrameCrudService;
@Resource(name="groupIdGnrService")
private EgovIdGnrService idgenService;
@Resource
private XitMessageSource xitMessageSource;
@Override
public List<XitClCodeMngVO> findList(XitClCodeMngSearchVO searchVO) {
List<XitClCodeMngVO> result = null;
try {
result = mapper.findList(searchVO);
} catch (SQLException e) {
throw new RuntimeException("분류코드관리 목록 조회 FAIL::", e);
}
return result;
}
@Override
public int findListTotCnt(XitClCodeMngSearchVO searchVO) {
int result = 0;
try {
result = mapper.findListTotCnt(searchVO);
} catch (SQLException e) {
throw new RuntimeException("분류코드관리 목록 총건수 조회 FAIL::", e);
}
return result;
}
@Override
public XitClCodeMngVO findView(XitClCodeMngVO vo) {
XitClCodeMngVO result = null;
try {
result = mapper.findView(vo);
} catch (SQLException e) {
throw new RuntimeException("분류코드관리 상세정보 조회 FAIL::", e);
}
return result;
}
@Override
public void addProc(XitClCodeMngVO vo) {
/**
*
*/
XitCmmnClCodeVO cmmnClCodeVO = convertToCrudVO(vo);
cmmnClCodeVO.setFrst_register_id(vo.getFrstRegisterId());
/**
*
*/
xitFrameCrudService.addXitCmmnClCode(cmmnClCodeVO);
}
@Override
public void modifyProc(XitClCodeMngVO vo) {
/**
*
*/
XitCmmnClCodeVO cmmnClCodeVO = convertToCrudVO(vo);
cmmnClCodeVO.setLast_updusr_id(vo.getLastUpdusrId());
/**
*
*/
xitFrameCrudService.modifyXitCmmnClCode(cmmnClCodeVO);
}
@Override
public void removeProc(XitClCodeMngVO vo) {
/**
*
*/
XitCmmnClCodeVO cmmnClCodeVO = new XitCmmnClCodeVO();
cmmnClCodeVO.setCl_code(vo.getClCode());
cmmnClCodeVO.setLast_updusr_id(vo.getLastUpdusrId());
cmmnClCodeVO.setUse_at("N");
/**
*
*/
xitFrameCrudService.modifyXitCmmnClCode(cmmnClCodeVO);
}
@Override
public void removesProc(String ids, String userId) {
/**
*
*/
String [] clCodes = ids.split(";");
for(int i=0; i<clCodes.length;i++) {
XitClCodeMngVO vo = new XitClCodeMngVO();
vo.setClCode(clCodes[i]);
vo.setLastUpdusrId(userId);
this.removeProc(vo);
}
}
/**
* <pre>
* : VO CRUD Service VO .
* </pre>
*
* @return XitCmmnClCodeVO
* @author:
* @date: 2020. 4. 16.
*/
private XitCmmnClCodeVO convertToCrudVO(XitClCodeMngVO vo) {
XitCmmnClCodeVO crudVO = new XitCmmnClCodeVO();
crudVO.setCl_code (vo.getClCode()); //분류 코드
crudVO.setCl_code_nm (vo.getClCodeNm()); //분류 코드 명
crudVO.setCl_code_dc (vo.getClCodeDc()); //분류 코드 설명
crudVO.setUse_at (vo.getUseAt()); //사용 여부
return crudVO;
}
}

@ -0,0 +1,79 @@
package kr.xit.framework.biz.mng.code.service;
import java.util.List;
import kr.xit.framework.biz.mng.code.model.XitClCodeMngSearchVO;
import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO;
/**
*
* @: Service
* @:
* @: 2020. 4. 16. 9:38:56
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface ICodeClassificationMgtService {
/**
* <pre> : </pre>
* @param searchVO
* @return List<XitClCodeMngVO>
* @author:
* @date: 2020. 4. 16.
*/
public List<XitClCodeMngVO> findList(XitClCodeMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param searchVO
* @return int
* @author:
* @date: 2020. 4. 16.
*/
public int findListTotCnt(XitClCodeMngSearchVO searchVO);
/**
* <pre> : </pre>
* @param vo
* @return XitClCodeMngVO
* @author:
* @date: 2020. 4. 16.
*/
public XitClCodeMngVO findView(XitClCodeMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void addProc(XitClCodeMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void modifyProc(XitClCodeMngVO vo);
/**
* <pre> : </pre>
* @param vo void
* @author:
* @date: 2020. 4. 16.
*/
public void removeProc(XitClCodeMngVO vo);
/**
* <pre> : </pre>
* @param ids void
* @author:
* @date: 2020. 4. 16.
*/
public void removesProc(String ids, String userId);
}

@ -0,0 +1,343 @@
package kr.xit.framework.biz.mng.code.web;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.support.SessionStatus;
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
import kr.xit.framework.biz.cmm.model.XitLoginVO;
import kr.xit.framework.biz.mng.code.model.XitClCodeMngSearchVO;
import kr.xit.framework.biz.mng.code.model.XitClCodeMngVO;
import kr.xit.framework.biz.mng.code.service.ICodeClassificationMgtService;
import kr.xit.framework.core.constants.FrameworkConstants;
import kr.xit.framework.core.constants.FrameworkConstants.TILES_TYPE;
import kr.xit.framework.core.message.XitMessageSource;
import kr.xit.framework.core.utils.XitCmmnUtil;
import kr.xit.framework.core.validation.XitBeanValidator;
import kr.xit.framework.support.util.AjaxUtils;
/**
*
* @: Controller
* @:
* @: 2020. 4. 16. 9:39:52
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Controller
@RequestMapping("/framework/biz/mng/code")
public class CodeClassificationMgtController {
@Resource
private ICodeClassificationMgtService service;
@Autowired
private XitBeanValidator beanValidator;
@Resource(name = "xitMessageSource")
XitMessageSource xitMessageSource;
@RequestMapping(value = "/mngCodeClassificationMgtForm")
public void mngCodeClassificationMgtForm() {
}
/**
* <pre> : </pre>
* @return String
* @author:
* @date: 2020. 7. 31.
*/
@RequestMapping(value = "ClCodeMng_list.ajax", method={RequestMethod.GET, RequestMethod.POST})
@ResponseBody
public Map<String, Object> ClCodeMng_listAjax(@ModelAttribute("searchVO") XitClCodeMngSearchVO searchVO, ModelMap model) {
/** paging */
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(searchVO.getPage()>-1?searchVO.getPage():searchVO.getPageIndex());
paginationInfo.setRecordCountPerPage(searchVO.getPerPage()>-1?searchVO.getPerPage():searchVO.getPageUnit());
paginationInfo.setPageSize(searchVO.getPageSize());
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
Map<String, Object> resultMap = new HashMap<String, Object>();
try {
/**
*
*/
int totCnt = service.findListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
/**
*
*/
/* ***************************
* tui Grid Response Set
*************************** */
resultMap.put("result", true); //[tui Grid] result
resultMap.put("message", xitMessageSource.getMessage("success.common.select")); //[tui Grid] result message
Map<String, Object> data = new HashMap<String, Object>();
data.put("contents", service.findList(searchVO)); //[tui Grid] data-contents
Map<String, Integer> pagination = new HashMap<String, Integer>();
pagination.put("page", searchVO.getPage());
pagination.put("totalCount", totCnt);
data.put("pagination", pagination); //[tui Grid] data-paging
resultMap.put("data", data); //[tui Grid] data
/* ***************************
* //tui Grid Response Set
*************************** */
} catch (Exception e) {
/**
*
*/
//tui Grid Response Set
resultMap.put("result", false); //[tui Grid] result
resultMap.put("message", xitMessageSource.getMessage("fail.common.select")); //[tui Grid] result message
}
return resultMap;
}
/**
* <pre> : .</pre>
* @param page
* @param tilesDef Type(none: tiles )
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(value = "ClCodeMng_{cmd}", method={RequestMethod.GET, RequestMethod.POST})
public String ClCodeMng_page(@PathVariable String cmd
, @RequestParam(value="tilesDef", required=false, defaultValue="") String tilesDef
, @ModelAttribute("cmmnClCode") XitClCodeMngVO vo
, @ModelAttribute XitClCodeMngSearchVO searchVO
, ModelMap model) {
switch (cmd) {
case "input": //등록 페이지
break;
case "edit": //수정 페이지
case "view": //상세 페이지
model.addAttribute("cmmnClCode", service.findView(vo));
model.addAttribute("message", xitMessageSource.getMessage("success.common.select"));
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
if(!"".equals(tilesDef))
tilesDef = "."+tilesDef;
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/code/XitClCodeMng_"+cmd+tilesDef;
}
/**
* <pre> : .</pre>
* @param page
* @param model
* @return String
* @author:
* @date: 2020. 4. 16.
*/
@RequestMapping(value = "ClCodeMng_{cmd}_popup", method={RequestMethod.GET, RequestMethod.POST})
public String ClCodeMng_page_popup(@PathVariable String cmd
, @ModelAttribute("cmmnClCode") XitClCodeMngVO vo
, @ModelAttribute XitClCodeMngSearchVO searchVO
, ModelMap model) {
switch (cmd) {
case "": //
break;
default:
throw new RuntimeException("유효하지 않은 요청 입니다.");
}
return FrameworkConstants.FRAMEWORK_JSP_BASE_PATH +"mng/code/XitClCodeMng_"+cmd+"_popup"+TILES_TYPE.POPUP.getVal();
}
/**
* <pre> : CUD </pre>
* @return String
* @author:
* @throws IOException
* @throws ServletException
* @date: 2020. 4. 16.
*/
@RequestMapping(value = "ClCodeMng_{cmd}_proc", method=RequestMethod.POST)
public void ClCodeMng_cmd_proc(@PathVariable String cmd
,@ModelAttribute("vo") XitClCodeMngVO vo
,@ModelAttribute("searchVO") XitClCodeMngSearchVO searchVO
,@RequestParam(value="clCodes", required=false, defaultValue="") String clCodes
,BindingResult bindingResult
,SessionStatus status
,Model model
,HttpServletRequest request
,HttpServletResponse response
) throws ServletException, IOException {
/**
*
*/
XitLoginVO loginVO = (XitLoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
String sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_list";
String message = null;
switch (cmd) {
case "insert": //등록
//유효성 확인
//2020.11.24. 주석처리
beanValidator.validate(vo, bindingResult);
// beanValidator.validate("cmmnClCode", vo, bindingResult);
if (bindingResult.hasErrors()) {
message = xitMessageSource.getMessage("fail.common.insert");
sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_input";
break;
}
//처리
try {
vo.setFrstRegisterId(loginVO.getUniqId());
service.addProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.insert");
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_input";
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.insert");
sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_input";
}
break;
// case "inserts": //다건 등록
// break;
case "update": //수정
//유효성 확인
//2020.11.24. 주석처리
beanValidator.validate(vo, bindingResult);
// beanValidator.validate("cmmnClCode", vo, bindingResult);
if (bindingResult.hasErrors()) {
message = xitMessageSource.getMessage("fail.common.update");
sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_edit";
break;
}
//처리
try {
vo.setLastUpdusrId(loginVO.getUniqId());
service.modifyProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.update");
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_edit";
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.update");
sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_edit";
}
break;
case "delete": //삭제
//처리
try {
vo.setLastUpdusrId(loginVO.getUniqId());
service.removeProc(vo);
status.setComplete();
message = xitMessageSource.getMessage("success.common.delete");
break;
} catch (RuntimeException e) {
message = e.getMessage();
sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_edit";
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.delete");
sLocationUrl = "forward:/framework/biz/mng/code/ClCodeMng_edit";
}
break;
case "deletes": //다건 삭제
//처리
try {
service.removesProc(clCodes, loginVO.getUniqId());
status.setComplete();
message = xitMessageSource.getMessage("success.common.delete");
} catch (RuntimeException e) {
message = e.getMessage();
} catch (Exception e) {
message = xitMessageSource.getMessage("fail.common.delete");
}
break;
default:
new RuntimeException("유효하지 않은 요청 입니다.");
}
/**
*
*/
/* ============================
* 2020.09.10
*
* - ajax json
* [AS-IS] String, return url "forward"
* [TO-BE] void, DispatchServlet forward , ajax json forward
============================ */
//2020.09.10 주석처리
// model.addAttribute("message", message);
// return sLocationUrl;
model.addAttribute("message", message);
if(AjaxUtils.isAjaxRequest(request)){ //ajax 요청시
//반환 데이터 설정
Map<String, Object> resultMap = new HashMap<String, Object>();
resultMap.put("message", message);
XitCmmnUtil.forwardForAjaxRequest(request, response, resultMap);
}else { //submit 요청 시
XitCmmnUtil.forwardForSubmitRequest(request, response, sLocationUrl, model.asMap());
}
}
}

@ -46,7 +46,7 @@ import kr.xit.framework.support.util.AjaxUtils;
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Controller
@RequestMapping("/framework/biz/mng/code/")
@RequestMapping("/framework/biz/mng/ccode/")
public class XitClCodeMngController {
@Resource

@ -7,7 +7,7 @@ import kr.xit.framework.biz.cmm.model.XitMenuCreatDtlsVO;
import kr.xit.framework.biz.mng.menu.model.MenuCreateMngVO;
@Mapper
public interface MenuByRoleMgtMapper {
public interface IMenuByRoleMgtMapper {
<T> List<MenuCreateMngVO> selectRoleInfos(T t);

@ -21,7 +21,7 @@ import kr.xit.framework.biz.mng.menu.model.XitMenuInfoVO;
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
@Mapper
public interface MenuMgtMapper {
public interface IMenuMgtMapper {
<T> List<XitMenuInfoVO> selectMenuInfos(final T t, final RowBounds rowBounds);
<T> List<XitMenuInfoVO> selectMenuInfos(final T t);

@ -8,7 +8,7 @@ import egovframework.rte.psl.dataaccess.mapper.Mapper;
import kr.xit.framework.biz.mng.menu.model.ProgramMngVO;
@Mapper
public interface ProgramMgtMapper {
public interface IProgramMgtMapper {
/**
* <pre> : </pre>

@ -0,0 +1,23 @@
package kr.xit.framework.biz.mng.menu.service;
import java.util.List;
import java.util.Map;
import kr.xit.framework.biz.mng.menu.model.MenuCreateMngVO;
/**
*
* @: Service
* @:
* @: 2020. 3. 26. 10:07:11
* @:
* @author ()
* @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved.
*/
public interface IMenuByRoleMgtService {
<T> List<MenuCreateMngVO> findRoleInfos(T t);
<T> List<MenuCreateMngVO> findMenuInfoByRoleList(T t);
void saveMenuByRoleList(Map<String, Object> paraMap);
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save