오류수정.
parent
6574428fb4
commit
9e28a540a0
|
|
@ -36,8 +36,8 @@ import kcg.faics.member.vo.MemberVO;
|
||||||
import kcg.faics.sec.AuthType;
|
import kcg.faics.sec.AuthType;
|
||||||
import kcg.faics.sec.LoginUserVO;
|
import kcg.faics.sec.LoginUserVO;
|
||||||
import kcg.faics.sec.UserUtil;
|
import kcg.faics.sec.UserUtil;
|
||||||
import kcg.faics.target.service.impl.DivMngServiceImpl;
|
import kcg.faics.tg.service.impl.DivMngServiceImpl;
|
||||||
import kcg.faics.target.vo.DivMngVO;
|
import kcg.faics.tg.vo.DivMngVO;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ import kcg.faics.fa.vo.EduSearchVO;
|
||||||
import kcg.faics.fa.vo.EduVO;
|
import kcg.faics.fa.vo.EduVO;
|
||||||
import kcg.faics.sec.LoginUserVO;
|
import kcg.faics.sec.LoginUserVO;
|
||||||
import kcg.faics.sec.UserUtil;
|
import kcg.faics.sec.UserUtil;
|
||||||
import kcg.faics.target.vo.DivMngSearchVO;
|
import kcg.faics.tg.vo.DivMngSearchVO;
|
||||||
import kcg.faics.target.vo.DivMngVO;
|
import kcg.faics.tg.vo.DivMngVO;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,96 @@
|
||||||
|
package kcg.faics.target;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 항로 타입.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public enum FerryRouteType {
|
||||||
|
/**
|
||||||
|
* 한-중.
|
||||||
|
*/
|
||||||
|
KR_CH("A", "한-중"),
|
||||||
|
/**
|
||||||
|
* 한-러.
|
||||||
|
*/
|
||||||
|
KR_RU("B", "한-러"),
|
||||||
|
/**
|
||||||
|
* 한-일.
|
||||||
|
*/
|
||||||
|
KR_JP("C", "한-일"),
|
||||||
|
/**
|
||||||
|
* 북한.
|
||||||
|
*/
|
||||||
|
KP("D", "북한");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* code.
|
||||||
|
*/
|
||||||
|
private final String code;
|
||||||
|
/**
|
||||||
|
* value.
|
||||||
|
*/
|
||||||
|
private final String value;
|
||||||
|
/**
|
||||||
|
* @return the code
|
||||||
|
*/
|
||||||
|
public final String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the value
|
||||||
|
*/
|
||||||
|
public final String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* code에 해당하는 value를 반환한다.
|
||||||
|
*
|
||||||
|
* @param code code
|
||||||
|
* @return value
|
||||||
|
*/
|
||||||
|
public static final String getValue(final String code) {
|
||||||
|
String value = "";
|
||||||
|
|
||||||
|
for (FerryRouteType item: FerryRouteType.values()) {
|
||||||
|
if (item.getCode().equalsIgnoreCase(code)) {
|
||||||
|
value = item.getValue();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* exclude를 제외한 List를 반환한다.
|
||||||
|
*
|
||||||
|
* @param exclude 제외할 타입
|
||||||
|
* @return List
|
||||||
|
*/
|
||||||
|
public static final List<FerryRouteType> values(final FerryRouteType... exclude) {
|
||||||
|
List<FerryRouteType> list = new ArrayList<FerryRouteType>();
|
||||||
|
for (FerryRouteType item : values()) {
|
||||||
|
if (!Arrays.asList(exclude).contains(item)) {
|
||||||
|
list.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 생성자.
|
||||||
|
*
|
||||||
|
* @param code 코드값
|
||||||
|
* @param value 표출값
|
||||||
|
*/
|
||||||
|
FerryRouteType(final String code, final String value) {
|
||||||
|
this.code = code;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
package kcg.faics.target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 운항횟수 타입.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public enum FerryRunTermType {
|
||||||
|
/**
|
||||||
|
* 주.
|
||||||
|
*/
|
||||||
|
WEEK("A", "주"),
|
||||||
|
/**
|
||||||
|
* 일.
|
||||||
|
*/
|
||||||
|
DAY("B", "일");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* code.
|
||||||
|
*/
|
||||||
|
private final String code;
|
||||||
|
/**
|
||||||
|
* value.
|
||||||
|
*/
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the code
|
||||||
|
*/
|
||||||
|
public final String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the value
|
||||||
|
*/
|
||||||
|
public final String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* code에 해당하는 value를 반환한다.
|
||||||
|
*
|
||||||
|
* @param code code
|
||||||
|
* @return value
|
||||||
|
*/
|
||||||
|
public static final String getValue(final String code) {
|
||||||
|
String value = "";
|
||||||
|
|
||||||
|
for (FerryRunTermType item: FerryRunTermType.values()) {
|
||||||
|
if (item.getCode().equalsIgnoreCase(code)) {
|
||||||
|
value = item.getValue();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 생성자.
|
||||||
|
*
|
||||||
|
* @param code 코드값
|
||||||
|
* @param value 표출값
|
||||||
|
*/
|
||||||
|
FerryRunTermType(final String code, final String value) {
|
||||||
|
this.code = code;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
/**
|
||||||
|
* 외사대상목표 패키지.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package kcg.faics.target;
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package kcg.faics.target.service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import kcg.faics.cmmn.bbs.BaseBbsService;
|
||||||
|
import kcg.faics.target.vo.CorpSearchVO;
|
||||||
|
import kcg.faics.target.vo.CorpVO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 관련 인터페이스.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface CorpService extends BaseBbsService<CorpSearchVO, CorpVO> {
|
||||||
|
/**
|
||||||
|
* 치안대상 통계현황을 반환한다.
|
||||||
|
*
|
||||||
|
* @return 치안대상 통계현황
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
List<HashMap<String, Object>> selectStats() throws Exception;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package kcg.faics.target.service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import kcg.faics.cmmn.bbs.BaseBbsService;
|
||||||
|
import kcg.faics.target.vo.WeakPlaceSearchVO;
|
||||||
|
import kcg.faics.target.vo.WeakPlaceVO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 관련 인터페이스.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public interface WeakPlaceService extends
|
||||||
|
BaseBbsService<WeakPlaceSearchVO, WeakPlaceVO> {
|
||||||
|
/**
|
||||||
|
* 소속별 외사취약지 통계현황을 반환한다.
|
||||||
|
*
|
||||||
|
* @return 소속별 외사취약지 통계현황
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
List<HashMap<String, Object>> selectStatsPerPlace() throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 해당 소속의 마지막 외사취약지 일련번호를 반환한다.
|
||||||
|
*
|
||||||
|
* @param place1
|
||||||
|
* 소속
|
||||||
|
* @return 마지막 외사취약지 일련번호
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
int selectMaxWpNo(String place1) throws Exception;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,109 @@
|
||||||
|
package kcg.faics.target.service.impl;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import kcg.faics.target.vo.CorpSearchVO;
|
||||||
|
import kcg.faics.target.vo.CorpVO;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import egovframework.rte.psl.dataaccess.EgovAbstractMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 관련 Mapper 클래스.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Repository("corpMapper")
|
||||||
|
public class CorpMapper extends EgovAbstractMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 정보를 반환한다.
|
||||||
|
*
|
||||||
|
* @param corpVO
|
||||||
|
* 치안대상 VO
|
||||||
|
* @return 치안대상 정보
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public CorpVO select(final CorpVO corpVO) throws Exception {
|
||||||
|
return selectOne("Corp.select", corpVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 목록을 반환한다.
|
||||||
|
*
|
||||||
|
* @param searchVO
|
||||||
|
* 검색조건 VO
|
||||||
|
* @return 치안대상 목록
|
||||||
|
*/
|
||||||
|
public List<CorpVO> selectList(final CorpSearchVO searchVO) {
|
||||||
|
return selectList("Corp.selectList", searchVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 통계현황을 반환한다.
|
||||||
|
*
|
||||||
|
* @param map
|
||||||
|
* 조건 Map 객체
|
||||||
|
* @return 치안대상 통계현황
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public List<HashMap<String, Object>> selectStats(final HashMap<String, Object> map)
|
||||||
|
throws Exception {
|
||||||
|
return selectList("Corp.selectStats", map);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 정보를 입력한다.
|
||||||
|
*
|
||||||
|
* @param corpVO
|
||||||
|
* 입력할 치안대상 VO
|
||||||
|
* @return <code>1</code> 성공, <code>0</code> 실패
|
||||||
|
*/
|
||||||
|
public int insert(final CorpVO corpVO) {
|
||||||
|
return insert("Corp.insert", corpVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* orgNo의 최대값을 반환한다.
|
||||||
|
*
|
||||||
|
* @param corpVO
|
||||||
|
* 치안대상 VO
|
||||||
|
* @return orgNo 최대값
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public int selectMaxOrgNo(final CorpVO corpVO) throws Exception {
|
||||||
|
return selectOne("Corp.selectMaxOrgNo", corpVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 정보를 삭제한다.
|
||||||
|
*
|
||||||
|
* @param corpVO
|
||||||
|
* 치안대상 VO
|
||||||
|
* @return <code>1</code>성공, <code>0</code>실패
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public int delete(final CorpVO corpVO) throws Exception {
|
||||||
|
return delete("Corp.delete", corpVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 정보를 수정한다.
|
||||||
|
*
|
||||||
|
* @param corpVO
|
||||||
|
* 치안대상 VO
|
||||||
|
* @return <code>1</code>성공, <code>0</code>실패
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public int update(final CorpVO corpVO) throws Exception {
|
||||||
|
return update("Corp.update", corpVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,128 @@
|
||||||
|
package kcg.faics.target.service.impl;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import kcg.faics.cmmn.egov.file.EgovFileMngUtil;
|
||||||
|
import kcg.faics.cmmn.service.CodeService;
|
||||||
|
import kcg.faics.target.service.CorpService;
|
||||||
|
import kcg.faics.target.vo.CorpSearchVO;
|
||||||
|
import kcg.faics.target.vo.CorpVO;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 관련 비지니스로직.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Service("corpService")
|
||||||
|
public class CorpServiceImpl extends EgovAbstractServiceImpl implements CorpService {
|
||||||
|
/**
|
||||||
|
* 전자정부프레임워크에서 제공되는 파일 업로드 처리 관련 Utility.
|
||||||
|
**/
|
||||||
|
@Resource(name = "EgovFileMngUtil")
|
||||||
|
private EgovFileMngUtil fileUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 Mapper 클래스.
|
||||||
|
*/
|
||||||
|
@Resource(name = "corpMapper")
|
||||||
|
private CorpMapper corpMapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* orgNo의 최대값을 반환한다.
|
||||||
|
*
|
||||||
|
* @param corpVO
|
||||||
|
* 치안대상 VO
|
||||||
|
* @return orgNo 최대값
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
private int selectNextOrgNo(final CorpVO corpVO) throws Exception {
|
||||||
|
int result = 1;
|
||||||
|
try {
|
||||||
|
result = corpMapper.selectMaxOrgNo(corpVO) + 1;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CorpVO select(final CorpVO dataVO) throws Exception {
|
||||||
|
return corpMapper.select(dataVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CorpVO> selectListAll(final CorpSearchVO searchVO) throws Exception {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CorpVO> selectList(final CorpSearchVO searchVO) throws Exception {
|
||||||
|
if (CodeService.LIST_ALL_VAL.equalsIgnoreCase(searchVO.getPlace1())) {
|
||||||
|
searchVO.setPlace1("");
|
||||||
|
}
|
||||||
|
return corpMapper.selectList(searchVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int selectListCnt(final CorpSearchVO searchVO) throws Exception {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int selectTotalCnt(final CorpSearchVO searchVO) throws Exception {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HashMap<String, Object> insert(final CorpVO dataVO,
|
||||||
|
final Map<String, MultipartFile> fileMap) throws Exception {
|
||||||
|
int nextOrgNo = selectNextOrgNo(dataVO);
|
||||||
|
dataVO.setOrgNo(nextOrgNo);
|
||||||
|
|
||||||
|
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||||
|
map.put("result", corpMapper.insert(dataVO));
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HashMap<String, Object> update(final CorpVO dataVO,
|
||||||
|
final Map<String, MultipartFile> fileMap, final String[] deleteFiles)
|
||||||
|
throws Exception {
|
||||||
|
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||||
|
map.put("result", corpMapper.update(dataVO));
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HashMap<String, Object> delete(final CorpVO dataVO) throws Exception {
|
||||||
|
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||||
|
map.put("result", corpMapper.delete(dataVO));
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<HashMap<String, Object>> selectStats() throws Exception {
|
||||||
|
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||||
|
map.put("placeList", CodeService.POLICE_STATION_LIST);
|
||||||
|
|
||||||
|
return corpMapper.selectStats(map);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,94 @@
|
||||||
|
package kcg.faics.target.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import kcg.faics.target.vo.DivMngSearchVO;
|
||||||
|
import kcg.faics.target.vo.DivMngVO;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import egovframework.rte.psl.dataaccess.EgovAbstractMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 관련 Mapper 클래스.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Repository("divMngMapper")
|
||||||
|
public class DivMngMapper extends EgovAbstractMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 정보를 반환한다.
|
||||||
|
*
|
||||||
|
* @param vo
|
||||||
|
* 외사분실운영현황 VO
|
||||||
|
* @return 외사분실운영현황 정보
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public DivMngVO select(final DivMngVO vo) throws Exception {
|
||||||
|
return selectOne("DivMng.select", vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 목록을 반환한다.
|
||||||
|
*
|
||||||
|
* @param searchVO
|
||||||
|
* 검색조건 VO
|
||||||
|
* @return 치안대상 목록
|
||||||
|
*/
|
||||||
|
public List<DivMngVO> selectList(final DivMngSearchVO searchVO) {
|
||||||
|
return selectList("DivMng.selectList", searchVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 정보를 입력한다.
|
||||||
|
*
|
||||||
|
* @param vo
|
||||||
|
* 입력할 외사분실운영현황 VO
|
||||||
|
* @return <code>1</code> 성공, <code>0</code> 실패
|
||||||
|
*/
|
||||||
|
public int insert(final DivMngVO vo) {
|
||||||
|
return insert("DivMng.insert", vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 정보를 삭제한다.
|
||||||
|
*
|
||||||
|
* @param vo
|
||||||
|
* 외사분실운영현황 VO
|
||||||
|
* @return <code>1</code>성공, <code>0</code>실패
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public int delete(final DivMngVO vo) throws Exception {
|
||||||
|
return delete("DivMng.delete", vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 정보를 수정한다.
|
||||||
|
*
|
||||||
|
* @param vo
|
||||||
|
* 외사분실운영현황 VO
|
||||||
|
* @return <code>1</code>성공, <code>0</code>실패
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public int update(final DivMngVO vo) throws Exception {
|
||||||
|
return update("DivMng.update", vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Place별 DS_NO의 최대값을 반환한다.
|
||||||
|
*
|
||||||
|
* @param vo
|
||||||
|
* 외사분실운영현황 VO
|
||||||
|
* @return place별 최대 DS_NO 값
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public int selectMaxNo(final DivMngVO vo) throws Exception {
|
||||||
|
return selectOne("DivMng.selectMaxNo", vo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,224 @@
|
||||||
|
package kcg.faics.target.service.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import kcg.faics.cmmn.bbs.BaseBbsService;
|
||||||
|
import kcg.faics.cmmn.egov.file.EgovFileMngUtil;
|
||||||
|
import kcg.faics.cmmn.egov.vo.FileVO;
|
||||||
|
import kcg.faics.cmmn.service.CodeService;
|
||||||
|
import kcg.faics.target.vo.DivMngSearchVO;
|
||||||
|
import kcg.faics.target.vo.DivMngVO;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 관련 비지니스로직.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Service("divMngService")
|
||||||
|
public class DivMngServiceImpl extends EgovAbstractServiceImpl implements
|
||||||
|
BaseBbsService<DivMngSearchVO, DivMngVO> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* property 파일에서 읽은 저장 경로 키워드.
|
||||||
|
*/
|
||||||
|
public static final String FILE_PATH_KEYWORD = "Target.divmng.fileStorePath";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 전자정부프레임워크에서 제공되는 파일 업로드 처리 관련 Utility.
|
||||||
|
**/
|
||||||
|
@Resource(name = "EgovFileMngUtil")
|
||||||
|
private EgovFileMngUtil fileUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 Mapper 클래스.
|
||||||
|
*/
|
||||||
|
@Resource(name = "divMngMapper")
|
||||||
|
private DivMngMapper divMngMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Place별 다음에 사용할 DS_NO를 반환한다.
|
||||||
|
*
|
||||||
|
* @param divMngVO
|
||||||
|
* 외사분실운영현황 VO
|
||||||
|
* @return place별 최대 DS_NO+1
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
private int selectNextNo(final DivMngVO divMngVO) throws Exception {
|
||||||
|
int result = 1;
|
||||||
|
try {
|
||||||
|
result = divMngMapper.selectMaxNo(divMngVO) + 1;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DivMngVO select(final DivMngVO dataVO) throws Exception {
|
||||||
|
return divMngMapper.select(dataVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DivMngVO> selectListAll(final DivMngSearchVO searchVO)
|
||||||
|
throws Exception {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DivMngVO> selectList(final DivMngSearchVO searchVO) throws Exception {
|
||||||
|
if (CodeService.LIST_ALL_VAL.equalsIgnoreCase(searchVO.getPlace())) {
|
||||||
|
searchVO.setPlace("");
|
||||||
|
}
|
||||||
|
return divMngMapper.selectList(searchVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int selectListCnt(final DivMngSearchVO searchVO) throws Exception {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int selectTotalCnt(final DivMngSearchVO searchVO) throws Exception {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HashMap<String, Object> insert(final DivMngVO dataVO,
|
||||||
|
final Map<String, MultipartFile> fileMap) throws Exception {
|
||||||
|
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||||
|
int no = selectNextNo(dataVO);
|
||||||
|
if (no > 0) {
|
||||||
|
dataVO.setNo(no);
|
||||||
|
|
||||||
|
List<FileVO> fileList = fileUtil.parseFileInf(fileMap, null, 0, "", FILE_PATH_KEYWORD);
|
||||||
|
for (FileVO fileVO : fileList) {
|
||||||
|
if ("fileImgObj".equalsIgnoreCase(fileVO.getFileSn())) {
|
||||||
|
dataVO.setFileImg(fileVO.getStreFileNm());
|
||||||
|
} else if ("file1obj".equalsIgnoreCase(fileVO.getFileSn())) {
|
||||||
|
dataVO.setFile1(fileVO.getStreFileNm());
|
||||||
|
} else if ("file2obj".equalsIgnoreCase(fileVO.getFileSn())) {
|
||||||
|
dataVO.setFile2(fileVO.getStreFileNm());
|
||||||
|
} else if ("file3obj".equalsIgnoreCase(fileVO.getFileSn())) {
|
||||||
|
dataVO.setFile3(fileVO.getStreFileNm());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
map.put("result", divMngMapper.insert(dataVO));
|
||||||
|
} else {
|
||||||
|
map.put("result", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update시 파일삭제 대상을 판별한다.
|
||||||
|
*
|
||||||
|
* @param fileMap 파일 Map 객체
|
||||||
|
* @param fileMapKey 파일 Map 객체에서 추출할 key
|
||||||
|
* @param deleteFileList 삭제대상 목록
|
||||||
|
* @param deleteFileListKey 삭제대상 목록에서 추출할 문자열
|
||||||
|
* @return 파일삭제여부
|
||||||
|
*/
|
||||||
|
private boolean isRemoveTarget(final Map<String, MultipartFile> fileMap,
|
||||||
|
final String fileMapKey, final List<String> deleteFileList,
|
||||||
|
final String deleteFileListKey) {
|
||||||
|
boolean isRemoveTarget = false;
|
||||||
|
|
||||||
|
if (deleteFileList.contains(deleteFileListKey)
|
||||||
|
|| (fileMap.containsKey(fileMapKey) && fileMap.get(fileMapKey).getSize() > 0)) {
|
||||||
|
isRemoveTarget = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return isRemoveTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HashMap<String, Object> update(final DivMngVO dataVO,
|
||||||
|
final Map<String, MultipartFile> fileMap, final String[] deleteFiles)
|
||||||
|
throws Exception {
|
||||||
|
DivMngVO vo = select(dataVO);
|
||||||
|
dataVO.setFileImg(vo.getFileImg());
|
||||||
|
dataVO.setFile1(vo.getFile1());
|
||||||
|
dataVO.setFile2(vo.getFile2());
|
||||||
|
dataVO.setFile3(vo.getFile3());
|
||||||
|
|
||||||
|
List<String> deleteFileList = new ArrayList<String>();
|
||||||
|
if (deleteFiles != null) {
|
||||||
|
deleteFileList = Arrays.asList(deleteFiles);
|
||||||
|
}
|
||||||
|
if (isRemoveTarget(fileMap, "fileImgObj", deleteFileList, "fileImg")) {
|
||||||
|
fileUtil.deleteFile(vo.getFileImg(), FILE_PATH_KEYWORD);
|
||||||
|
dataVO.setFileImg("");
|
||||||
|
}
|
||||||
|
if (isRemoveTarget(fileMap, "file1obj", deleteFileList, "file1")) {
|
||||||
|
fileUtil.deleteFile(vo.getFile1(), FILE_PATH_KEYWORD);
|
||||||
|
dataVO.setFile1("");
|
||||||
|
}
|
||||||
|
if (isRemoveTarget(fileMap, "file2obj", deleteFileList, "file2")) {
|
||||||
|
fileUtil.deleteFile(vo.getFile2(), FILE_PATH_KEYWORD);
|
||||||
|
dataVO.setFile2("");
|
||||||
|
}
|
||||||
|
if (isRemoveTarget(fileMap, "file3obj", deleteFileList, "file3")) {
|
||||||
|
fileUtil.deleteFile(vo.getFile3(), FILE_PATH_KEYWORD);
|
||||||
|
dataVO.setFile3("");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<FileVO> fileList = fileUtil.parseFileInf(fileMap, null, 0, "", FILE_PATH_KEYWORD);
|
||||||
|
for (FileVO fileVO : fileList) {
|
||||||
|
if ("fileImgObj".equalsIgnoreCase(fileVO.getFileSn())) {
|
||||||
|
dataVO.setFileImg(fileVO.getStreFileNm());
|
||||||
|
} else if ("file1obj".equalsIgnoreCase(fileVO.getFileSn())) {
|
||||||
|
dataVO.setFile1(fileVO.getStreFileNm());
|
||||||
|
} else if ("file2obj".equalsIgnoreCase(fileVO.getFileSn())) {
|
||||||
|
dataVO.setFile2(fileVO.getStreFileNm());
|
||||||
|
} else if ("file3obj".equalsIgnoreCase(fileVO.getFileSn())) {
|
||||||
|
dataVO.setFile3(fileVO.getStreFileNm());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||||
|
map.put("result", divMngMapper.update(dataVO));
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HashMap<String, Object> delete(final DivMngVO dataVO) throws Exception {
|
||||||
|
DivMngVO vo = select(dataVO);
|
||||||
|
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||||
|
map.put("result", divMngMapper.delete(dataVO));
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(vo.getFileImg())) {
|
||||||
|
fileUtil.deleteFile(vo.getFileImg(), FILE_PATH_KEYWORD);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(vo.getFile1())) {
|
||||||
|
fileUtil.deleteFile(vo.getFile1(), FILE_PATH_KEYWORD);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(vo.getFile2())) {
|
||||||
|
fileUtil.deleteFile(vo.getFile2(), FILE_PATH_KEYWORD);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(vo.getFile3())) {
|
||||||
|
fileUtil.deleteFile(vo.getFile3(), FILE_PATH_KEYWORD);
|
||||||
|
}
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,94 @@
|
||||||
|
package kcg.faics.target.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import kcg.faics.target.vo.FerrySearchVO;
|
||||||
|
import kcg.faics.target.vo.FerryVO;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import egovframework.rte.psl.dataaccess.EgovAbstractMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 관련 Mapper 클래스.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Repository("ferryMapper")
|
||||||
|
public class FerryMapper extends EgovAbstractMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 정보를 반환한다.
|
||||||
|
*
|
||||||
|
* @param vo
|
||||||
|
* 국제여객선 VO
|
||||||
|
* @return 국제여객선 정보
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public FerryVO select(final FerryVO vo) throws Exception {
|
||||||
|
return selectOne("Ferry.select", vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 목록을 반환한다.
|
||||||
|
*
|
||||||
|
* @param searchVO
|
||||||
|
* 검색조건 VO
|
||||||
|
* @return 치안대상 목록
|
||||||
|
*/
|
||||||
|
public List<FerryVO> selectList(final FerrySearchVO searchVO) {
|
||||||
|
return selectList("Ferry.selectList", searchVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 정보를 입력한다.
|
||||||
|
*
|
||||||
|
* @param vo
|
||||||
|
* 입력할 국제여객선 VO
|
||||||
|
* @return <code>1</code> 성공, <code>0</code> 실패
|
||||||
|
*/
|
||||||
|
public int insert(final FerryVO vo) {
|
||||||
|
return insert("Ferry.insert", vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 정보를 삭제한다.
|
||||||
|
*
|
||||||
|
* @param vo
|
||||||
|
* 국제여객선 VO
|
||||||
|
* @return <code>1</code>성공, <code>0</code>실패
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public int delete(final FerryVO vo) throws Exception {
|
||||||
|
return delete("Ferry.delete", vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 정보를 수정한다.
|
||||||
|
*
|
||||||
|
* @param vo
|
||||||
|
* 국제여객선 VO
|
||||||
|
* @return <code>1</code>성공, <code>0</code>실패
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public int update(final FerryVO vo) throws Exception {
|
||||||
|
return update("Ferry.update", vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SER_NO의 최대값을 반환한다.
|
||||||
|
*
|
||||||
|
* @param vo
|
||||||
|
* 국제여객선 VO
|
||||||
|
* @return SER_NO 최대 값
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public int selectMaxSerNo(final FerryVO vo) throws Exception {
|
||||||
|
return selectOne("Ferry.selectMaxSerNo", vo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,184 @@
|
||||||
|
package kcg.faics.target.service.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import kcg.faics.cmmn.bbs.BaseBbsService;
|
||||||
|
import kcg.faics.cmmn.egov.file.EgovFileMngUtil;
|
||||||
|
import kcg.faics.cmmn.egov.vo.FileVO;
|
||||||
|
import kcg.faics.target.vo.FerrySearchVO;
|
||||||
|
import kcg.faics.target.vo.FerryVO;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 관련 비지니스로직.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Service("ferryService")
|
||||||
|
public class FerryServiceImpl extends EgovAbstractServiceImpl implements
|
||||||
|
BaseBbsService<FerrySearchVO, FerryVO> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* property 파일에서 읽은 저장 경로 키워드.
|
||||||
|
*/
|
||||||
|
public static final String FILE_PATH_KEYWORD = "Target.ferry.fileStorePath";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 전자정부프레임워크에서 제공되는 파일 업로드 처리 관련 Utility.
|
||||||
|
**/
|
||||||
|
@Resource(name = "EgovFileMngUtil")
|
||||||
|
private EgovFileMngUtil fileUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 Mapper 클래스.
|
||||||
|
*/
|
||||||
|
@Resource(name = "ferryMapper")
|
||||||
|
private FerryMapper ferryMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Place별 다음에 사용할 DS_NO를 반환한다.
|
||||||
|
*
|
||||||
|
* @param ferryVO
|
||||||
|
* 국제여객선 VO
|
||||||
|
* @return SER_NO 최대 값+1
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
private int selectNextSerNo(final FerryVO ferryVO) throws Exception {
|
||||||
|
int result = 1;
|
||||||
|
try {
|
||||||
|
result = ferryMapper.selectMaxSerNo(ferryVO) + 1;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FerryVO select(final FerryVO dataVO) throws Exception {
|
||||||
|
return ferryMapper.select(dataVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FerryVO> selectListAll(final FerrySearchVO searchVO)
|
||||||
|
throws Exception {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FerryVO> selectList(final FerrySearchVO searchVO) throws Exception {
|
||||||
|
return ferryMapper.selectList(searchVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int selectListCnt(final FerrySearchVO searchVO) throws Exception {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int selectTotalCnt(final FerrySearchVO searchVO) throws Exception {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HashMap<String, Object> insert(final FerryVO dataVO,
|
||||||
|
final Map<String, MultipartFile> fileMap) throws Exception {
|
||||||
|
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||||
|
int no = selectNextSerNo(dataVO);
|
||||||
|
if (no > 0) {
|
||||||
|
dataVO.setSerNo(no);
|
||||||
|
|
||||||
|
List<FileVO> fileList = fileUtil.parseFileInf(fileMap, null, 0, "", FILE_PATH_KEYWORD);
|
||||||
|
for (FileVO fileVO : fileList) {
|
||||||
|
if ("imgFileObj".equalsIgnoreCase(fileVO.getFileSn())) {
|
||||||
|
dataVO.setImgFile(fileVO.getStreFileNm());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
map.put("result", ferryMapper.insert(dataVO));
|
||||||
|
} else {
|
||||||
|
map.put("result", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update시 파일삭제 대상을 판별한다.
|
||||||
|
*
|
||||||
|
* @param fileMap 파일 Map 객체
|
||||||
|
* @param fileMapKey 파일 Map 객체에서 추출할 key
|
||||||
|
* @param deleteFileList 삭제대상 목록
|
||||||
|
* @param deleteFileListKey 삭제대상 목록에서 추출할 문자열
|
||||||
|
* @return 파일삭제여부
|
||||||
|
*/
|
||||||
|
private boolean isRemoveTarget(final Map<String, MultipartFile> fileMap,
|
||||||
|
final String fileMapKey, final List<String> deleteFileList,
|
||||||
|
final String deleteFileListKey) {
|
||||||
|
boolean isRemoveTarget = false;
|
||||||
|
|
||||||
|
if (deleteFileList.contains(deleteFileListKey)
|
||||||
|
|| (fileMap.containsKey(fileMapKey) && fileMap.get(fileMapKey).getSize() > 0)) {
|
||||||
|
isRemoveTarget = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return isRemoveTarget;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HashMap<String, Object> update(final FerryVO dataVO,
|
||||||
|
final Map<String, MultipartFile> fileMap, final String[] deleteFiles)
|
||||||
|
throws Exception {
|
||||||
|
FerryVO vo = select(dataVO);
|
||||||
|
dataVO.setImgFile(vo.getImgFile());
|
||||||
|
|
||||||
|
List<String> deleteFileList = new ArrayList<String>();
|
||||||
|
if (deleteFiles != null) {
|
||||||
|
deleteFileList = Arrays.asList(deleteFiles);
|
||||||
|
}
|
||||||
|
if (isRemoveTarget(fileMap, "imgFileObj", deleteFileList, "imgFile")) {
|
||||||
|
fileUtil.deleteFile(vo.getImgFile(), FILE_PATH_KEYWORD);
|
||||||
|
dataVO.setImgFile("");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<FileVO> fileList = fileUtil.parseFileInf(fileMap, null, 0, "", FILE_PATH_KEYWORD);
|
||||||
|
for (FileVO fileVO : fileList) {
|
||||||
|
if ("imgFileObj".equalsIgnoreCase(fileVO.getFileSn())) {
|
||||||
|
dataVO.setImgFile(fileVO.getStreFileNm());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||||
|
map.put("result", ferryMapper.update(dataVO));
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HashMap<String, Object> delete(final FerryVO dataVO) throws Exception {
|
||||||
|
FerryVO vo = select(dataVO);
|
||||||
|
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||||
|
map.put("result", ferryMapper.delete(dataVO));
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(vo.getImgFile())) {
|
||||||
|
fileUtil.deleteFile(vo.getImgFile(), FILE_PATH_KEYWORD);
|
||||||
|
}
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,120 @@
|
||||||
|
package kcg.faics.target.service.impl;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import kcg.faics.target.vo.WeakPlaceSearchVO;
|
||||||
|
import kcg.faics.target.vo.WeakPlaceVO;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import egovframework.rte.psl.dataaccess.EgovAbstractMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 관련 Mapper 클래스.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Repository("weakPlaceMapper")
|
||||||
|
public class WeakPlaceMapper extends EgovAbstractMapper {
|
||||||
|
/**
|
||||||
|
* 외사취약지 정보를 반환한다.
|
||||||
|
*
|
||||||
|
* @param vo
|
||||||
|
* 검색정보 VO
|
||||||
|
* @return 외사취약지 VO
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public WeakPlaceVO select(final WeakPlaceVO vo) throws Exception {
|
||||||
|
return selectOne("WeakPlace.select", vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 목록을 반환한다.
|
||||||
|
*
|
||||||
|
* @param vo
|
||||||
|
* 검색정보 VO
|
||||||
|
* @return 외사취약지 목록
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public List<WeakPlaceVO> selectList(final WeakPlaceSearchVO vo)
|
||||||
|
throws Exception {
|
||||||
|
return selectList("WeakPlace.selectList", vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 해당 소속의 마지막 외사취약지 일련번호를 반환한다.
|
||||||
|
*
|
||||||
|
* @param place1
|
||||||
|
* 소속
|
||||||
|
* @return 마지막 외사취약지 일련번호
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public int selectMaxWpNo(final String place1) throws Exception {
|
||||||
|
int wpNo = 0;
|
||||||
|
try {
|
||||||
|
wpNo = selectOne("WeakPlace.selectMaxWpNo", place1);
|
||||||
|
} catch (Exception e) {
|
||||||
|
wpNo = 0;
|
||||||
|
}
|
||||||
|
return wpNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 소속별 외사취약지 통계현황을 반환한다.
|
||||||
|
*
|
||||||
|
* @param placeList
|
||||||
|
* 통계를 산출할 소속 코드 배열
|
||||||
|
* @return 소속별 외사취약지 통계현황
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public List<HashMap<String, Object>> selectStatsPerPlace(final String[] placeList) throws Exception {
|
||||||
|
HashMap<String, String[]> map = new HashMap<String, String[]>();
|
||||||
|
map.put("placeList", placeList);
|
||||||
|
return selectList("WeakPlace.selectStatsPerPlace", map);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 정보를 입력한다.
|
||||||
|
*
|
||||||
|
* @param weakPlaceVO
|
||||||
|
* 입력할 외사취약지 VO
|
||||||
|
* @return 1-성공, 0-실패
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public int insert(final WeakPlaceVO weakPlaceVO) throws Exception {
|
||||||
|
return insert("WeakPlace.insert", weakPlaceVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 정보를 수정한다.
|
||||||
|
*
|
||||||
|
* @param weakPlaceVO
|
||||||
|
* 수정할 외사취약지 VO
|
||||||
|
* @return 1-성공, 0-실패
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public int update(final WeakPlaceVO weakPlaceVO) throws Exception {
|
||||||
|
return update("WeakPlace.update", weakPlaceVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 정보를 삭제한다.
|
||||||
|
*
|
||||||
|
* @param weakPlaceVO
|
||||||
|
* 삭제할 외사취약지 VO
|
||||||
|
* @return 1-성공, 0-실패
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
public int delete(final WeakPlaceVO weakPlaceVO) throws Exception {
|
||||||
|
return delete("WeakPlace.delete", weakPlaceVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,191 @@
|
||||||
|
package kcg.faics.target.service.impl;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import kcg.faics.cmmn.egov.file.EgovFileMngUtil;
|
||||||
|
import kcg.faics.cmmn.egov.vo.FileVO;
|
||||||
|
import kcg.faics.cmmn.service.CodeService;
|
||||||
|
import kcg.faics.target.service.WeakPlaceService;
|
||||||
|
import kcg.faics.target.vo.WeakPlaceSearchVO;
|
||||||
|
import kcg.faics.target.vo.WeakPlaceVO;
|
||||||
|
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 관련 비지니스로직.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Service("weakPlaceService")
|
||||||
|
public class WeakPlaceServiceImpl extends EgovAbstractServiceImpl implements WeakPlaceService {
|
||||||
|
/**
|
||||||
|
* property 파일에서 읽은 저장 경로 키워드.
|
||||||
|
*/
|
||||||
|
private String filePathKeyword = "Target.wp.fileStorePath";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 전자정부프레임워크에서 제공되는 파일 업로드 처리 관련 Utility.
|
||||||
|
**/
|
||||||
|
@Resource(name = "EgovFileMngUtil")
|
||||||
|
private EgovFileMngUtil fileUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 Mapper 클래스.
|
||||||
|
*/
|
||||||
|
@Resource(name = "weakPlaceMapper")
|
||||||
|
private WeakPlaceMapper weakPlaceMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WeakPlaceVO select(final WeakPlaceVO dataVO) throws Exception {
|
||||||
|
return weakPlaceMapper.select(dataVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WeakPlaceVO> selectListAll(final WeakPlaceSearchVO searchVO)
|
||||||
|
throws Exception {
|
||||||
|
// 사용하지 않음
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WeakPlaceVO> selectList(final WeakPlaceSearchVO searchVO)
|
||||||
|
throws Exception {
|
||||||
|
return weakPlaceMapper.selectList(searchVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<HashMap<String, Object>> selectStatsPerPlace() throws Exception {
|
||||||
|
List<HashMap<String, Object>> statsList = new ArrayList<HashMap<String, Object>>();
|
||||||
|
try {
|
||||||
|
statsList = weakPlaceMapper.selectStatsPerPlace(CodeService.POLICE_STATION_LIST);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return statsList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int selectListCnt(final WeakPlaceSearchVO searchVO) throws Exception {
|
||||||
|
// 사용하지 않음
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int selectTotalCnt(final WeakPlaceSearchVO searchVO) throws Exception {
|
||||||
|
// 사용하지 않음
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int selectMaxWpNo(final String place1) throws Exception {
|
||||||
|
return weakPlaceMapper.selectMaxWpNo(place1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HashMap<String, Object> insert(final WeakPlaceVO dataVO,
|
||||||
|
final Map<String, MultipartFile> fileMap) throws Exception {
|
||||||
|
int result = 0;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 파일저장
|
||||||
|
if (fileMap != null) {
|
||||||
|
List<FileVO> uploadedFile = fileUtil.parseFileInf(fileMap, null, 0, "", filePathKeyword);
|
||||||
|
for (FileVO file : uploadedFile) {
|
||||||
|
if (file != null) {
|
||||||
|
String fileSn = file.getFileSn();
|
||||||
|
if (!StringUtils.isBlank(fileSn)) {
|
||||||
|
fileSn = fileSn.trim();
|
||||||
|
}
|
||||||
|
if ("file1".equalsIgnoreCase(fileSn)) {
|
||||||
|
dataVO.setFilename1(file.getStreFileNm());
|
||||||
|
} else if ("file2".equalsIgnoreCase(fileSn)) {
|
||||||
|
dataVO.setFilename2(file.getStreFileNm());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// DB저장
|
||||||
|
result = weakPlaceMapper.insert(dataVO);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||||
|
map.put("result", result);
|
||||||
|
if (result == 1) {
|
||||||
|
map.put("place1", dataVO.getPlace1());
|
||||||
|
map.put("wpNo", dataVO.getWpNo());
|
||||||
|
}
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HashMap<String, Object> update(final WeakPlaceVO dataVO,
|
||||||
|
final Map<String, MultipartFile> fileMap, final String[] deleteFiles)
|
||||||
|
throws Exception {
|
||||||
|
int result = 0;
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 파일삭제 : 기존 PHP 소스에서 실제 물리적인 파일은 삭제하지 않는다. 이를 준용한다.
|
||||||
|
if (deleteFiles != null) {
|
||||||
|
for (String deleteTarget : deleteFiles) {
|
||||||
|
if ("1".equalsIgnoreCase(deleteTarget)) {
|
||||||
|
dataVO.setFilename1("");
|
||||||
|
} else if ("2".equalsIgnoreCase(deleteTarget)) {
|
||||||
|
dataVO.setFilename2("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 파일저장
|
||||||
|
if (fileMap != null) {
|
||||||
|
List<FileVO> uploadedFile = fileUtil.parseFileInf(fileMap, null, 0, "", filePathKeyword);
|
||||||
|
for (FileVO file : uploadedFile) {
|
||||||
|
if (file != null) {
|
||||||
|
String fileSn = file.getFileSn();
|
||||||
|
if (!StringUtils.isBlank(fileSn)) {
|
||||||
|
fileSn = fileSn.trim();
|
||||||
|
}
|
||||||
|
if ("file1".equalsIgnoreCase(fileSn)) {
|
||||||
|
dataVO.setFilename1(file.getStreFileNm());
|
||||||
|
} else if ("file2".equalsIgnoreCase(fileSn)) {
|
||||||
|
dataVO.setFilename2(file.getStreFileNm());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// DB저장
|
||||||
|
result = weakPlaceMapper.update(dataVO);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||||
|
map.put("result", result);
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HashMap<String, Object> delete(final WeakPlaceVO dataVO) throws Exception {
|
||||||
|
// 기존 PHP 소스에서 실제 물리적인 파일은 삭제하지 않는다. 이를 준용한다.
|
||||||
|
int result = weakPlaceMapper.delete(dataVO);
|
||||||
|
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||||
|
map.put("result", result);
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
/**
|
||||||
|
* 외사수사대상 관련 비지니스로직 패키지.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package kcg.faics.target.service.impl;
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
/**
|
||||||
|
* 외사수사대상 관련 인터페이스 패키지.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package kcg.faics.target.service;
|
||||||
|
|
@ -0,0 +1,92 @@
|
||||||
|
package kcg.faics.target.vo;
|
||||||
|
|
||||||
|
import kcg.faics.cmmn.bbs.BaseSearchVO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 검색 관련 Value Object.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class CorpSearchVO extends BaseSearchVO {
|
||||||
|
/**
|
||||||
|
* 소속1.
|
||||||
|
*/
|
||||||
|
private String place1;
|
||||||
|
/**
|
||||||
|
* 구분(협조기관~외국인투자업체).
|
||||||
|
*/
|
||||||
|
private String orgId;
|
||||||
|
/**
|
||||||
|
* 화면구분. (01-업무협조기관, 02-해운항만관련협회, 03-외사관련없체, 04-외국인고용업체, 05-외국인투자업체)
|
||||||
|
*/
|
||||||
|
private String grpNo;
|
||||||
|
/**
|
||||||
|
* 기관/협회/업체명.
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 업종(외국인 고용업체).
|
||||||
|
*/
|
||||||
|
private String jobType;
|
||||||
|
/**
|
||||||
|
* @return the place1
|
||||||
|
*/
|
||||||
|
public final String getPlace1() {
|
||||||
|
return place1;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param place1 the place1 to set
|
||||||
|
*/
|
||||||
|
public final void setPlace1(final String place1) {
|
||||||
|
this.place1 = place1;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the orgId
|
||||||
|
*/
|
||||||
|
public final String getOrgId() {
|
||||||
|
return orgId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param orgId the orgId to set
|
||||||
|
*/
|
||||||
|
public final void setOrgId(final String orgId) {
|
||||||
|
this.orgId = orgId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the grpNo
|
||||||
|
*/
|
||||||
|
public final String getGrpNo() {
|
||||||
|
return grpNo;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param grpNo the grpNo to set
|
||||||
|
*/
|
||||||
|
public final void setGrpNo(final String grpNo) {
|
||||||
|
this.grpNo = grpNo;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the name
|
||||||
|
*/
|
||||||
|
public final String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param name the name to set
|
||||||
|
*/
|
||||||
|
public final void setName(final String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the jobType
|
||||||
|
*/
|
||||||
|
public final String getJobType() {
|
||||||
|
return jobType;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param jobType the jobType to set
|
||||||
|
*/
|
||||||
|
public final void setJobType(final String jobType) {
|
||||||
|
this.jobType = jobType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,346 @@
|
||||||
|
package kcg.faics.target.vo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 Value Ojbect.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class CorpVO {
|
||||||
|
/**
|
||||||
|
* 소속1.
|
||||||
|
*/
|
||||||
|
private String place1;
|
||||||
|
/**
|
||||||
|
* 소속1 명칭.
|
||||||
|
*/
|
||||||
|
private String place1str;
|
||||||
|
/**
|
||||||
|
* 구분(협조기관~외국인투자업체).
|
||||||
|
*/
|
||||||
|
private String orgId;
|
||||||
|
/**
|
||||||
|
* 구분별 일련번호.
|
||||||
|
*/
|
||||||
|
private int orgNo;
|
||||||
|
/**
|
||||||
|
* 화면구분. (01-업무협조기관, 02-해운항만관련협회, 03-외사관련없체, 04-외국인고용업체, 05-외국인투자업체)
|
||||||
|
*/
|
||||||
|
private String grpNo;
|
||||||
|
/**
|
||||||
|
* 기관/협회/업체명.
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 소재지.
|
||||||
|
*/
|
||||||
|
private String location;
|
||||||
|
/**
|
||||||
|
* 대표자명.
|
||||||
|
*/
|
||||||
|
private String ceo;
|
||||||
|
/**
|
||||||
|
* 업종(외국인 고용업체).
|
||||||
|
*/
|
||||||
|
private String jobType;
|
||||||
|
/**
|
||||||
|
* 전화번호.
|
||||||
|
*/
|
||||||
|
private String tel;
|
||||||
|
/**
|
||||||
|
* FAX.
|
||||||
|
*/
|
||||||
|
private String fax;
|
||||||
|
/**
|
||||||
|
* 비고.
|
||||||
|
*/
|
||||||
|
private String comments;
|
||||||
|
/**
|
||||||
|
* 대상국(외국인 투자업체).
|
||||||
|
*/
|
||||||
|
private String partner;
|
||||||
|
/**
|
||||||
|
* 선박(척).
|
||||||
|
*/
|
||||||
|
private int shipCnt;
|
||||||
|
/**
|
||||||
|
* 근무인원.
|
||||||
|
*/
|
||||||
|
private int memberCnt;
|
||||||
|
/**
|
||||||
|
* 설립년도.
|
||||||
|
*/
|
||||||
|
private String basicYear;
|
||||||
|
/**
|
||||||
|
* 자본금(만원).
|
||||||
|
*/
|
||||||
|
private int fund;
|
||||||
|
/**
|
||||||
|
* 등록자 소속서.
|
||||||
|
*/
|
||||||
|
private String writerPlace1;
|
||||||
|
/**
|
||||||
|
* 등록자.
|
||||||
|
*/
|
||||||
|
private String writer;
|
||||||
|
/**
|
||||||
|
* 생성일.
|
||||||
|
*/
|
||||||
|
private String credate;
|
||||||
|
/**
|
||||||
|
* 수정일.
|
||||||
|
*/
|
||||||
|
private String logdate;
|
||||||
|
/**
|
||||||
|
* @return the place1
|
||||||
|
*/
|
||||||
|
public final String getPlace1() {
|
||||||
|
return place1;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param place1 the place1 to set
|
||||||
|
*/
|
||||||
|
public final void setPlace1(final String place1) {
|
||||||
|
this.place1 = place1;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the place1str
|
||||||
|
*/
|
||||||
|
public final String getPlace1str() {
|
||||||
|
return place1str;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param place1str the place1str to set
|
||||||
|
*/
|
||||||
|
public final void setPlace1str(final String place1str) {
|
||||||
|
this.place1str = place1str;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the orgId
|
||||||
|
*/
|
||||||
|
public final String getOrgId() {
|
||||||
|
return orgId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param orgId the orgId to set
|
||||||
|
*/
|
||||||
|
public final void setOrgId(final String orgId) {
|
||||||
|
this.orgId = orgId;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the orgNo
|
||||||
|
*/
|
||||||
|
public final int getOrgNo() {
|
||||||
|
return orgNo;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param orgNo the orgNo to set
|
||||||
|
*/
|
||||||
|
public final void setOrgNo(final int orgNo) {
|
||||||
|
this.orgNo = orgNo;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the grpNo
|
||||||
|
*/
|
||||||
|
public final String getGrpNo() {
|
||||||
|
return grpNo;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param grpNo the grpNo to set
|
||||||
|
*/
|
||||||
|
public final void setGrpNo(final String grpNo) {
|
||||||
|
this.grpNo = grpNo;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the name
|
||||||
|
*/
|
||||||
|
public final String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param name the name to set
|
||||||
|
*/
|
||||||
|
public final void setName(final String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the location
|
||||||
|
*/
|
||||||
|
public final String getLocation() {
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param location the location to set
|
||||||
|
*/
|
||||||
|
public final void setLocation(final String location) {
|
||||||
|
this.location = location;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the ceo
|
||||||
|
*/
|
||||||
|
public final String getCeo() {
|
||||||
|
return ceo;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param ceo the ceo to set
|
||||||
|
*/
|
||||||
|
public final void setCeo(final String ceo) {
|
||||||
|
this.ceo = ceo;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the jobType
|
||||||
|
*/
|
||||||
|
public final String getJobType() {
|
||||||
|
return jobType;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param jobType the jobType to set
|
||||||
|
*/
|
||||||
|
public final void setJobType(final String jobType) {
|
||||||
|
this.jobType = jobType;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the tel
|
||||||
|
*/
|
||||||
|
public final String getTel() {
|
||||||
|
return tel;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param tel the tel to set
|
||||||
|
*/
|
||||||
|
public final void setTel(final String tel) {
|
||||||
|
this.tel = tel;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the fax
|
||||||
|
*/
|
||||||
|
public final String getFax() {
|
||||||
|
return fax;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param fax the fax to set
|
||||||
|
*/
|
||||||
|
public final void setFax(final String fax) {
|
||||||
|
this.fax = fax;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the comments
|
||||||
|
*/
|
||||||
|
public final String getComments() {
|
||||||
|
return comments;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param comments the comments to set
|
||||||
|
*/
|
||||||
|
public final void setComments(final String comments) {
|
||||||
|
this.comments = comments;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the partner
|
||||||
|
*/
|
||||||
|
public final String getPartner() {
|
||||||
|
return partner;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param partner the partner to set
|
||||||
|
*/
|
||||||
|
public final void setPartner(final String partner) {
|
||||||
|
this.partner = partner;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the shipCnt
|
||||||
|
*/
|
||||||
|
public final int getShipCnt() {
|
||||||
|
return shipCnt;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param shipCnt the shipCnt to set
|
||||||
|
*/
|
||||||
|
public final void setShipCnt(final int shipCnt) {
|
||||||
|
this.shipCnt = shipCnt;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the memberCnt
|
||||||
|
*/
|
||||||
|
public final int getMemberCnt() {
|
||||||
|
return memberCnt;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param memberCnt the memberCnt to set
|
||||||
|
*/
|
||||||
|
public final void setMemberCnt(final int memberCnt) {
|
||||||
|
this.memberCnt = memberCnt;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the basicYear
|
||||||
|
*/
|
||||||
|
public final String getBasicYear() {
|
||||||
|
return basicYear;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param basicYear the basicYear to set
|
||||||
|
*/
|
||||||
|
public final void setBasicYear(final String basicYear) {
|
||||||
|
this.basicYear = basicYear;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the fund
|
||||||
|
*/
|
||||||
|
public final int getFund() {
|
||||||
|
return fund;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param fund the fund to set
|
||||||
|
*/
|
||||||
|
public final void setFund(final int fund) {
|
||||||
|
this.fund = fund;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the writerPlace1
|
||||||
|
*/
|
||||||
|
public final String getWriterPlace1() {
|
||||||
|
return writerPlace1;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param writerPlace1 the writerPlace1 to set
|
||||||
|
*/
|
||||||
|
public final void setWriterPlace1(final String writerPlace1) {
|
||||||
|
this.writerPlace1 = writerPlace1;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the writer
|
||||||
|
*/
|
||||||
|
public final String getWriter() {
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param writer the writer to set
|
||||||
|
*/
|
||||||
|
public final void setWriter(final String writer) {
|
||||||
|
this.writer = writer;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the credate
|
||||||
|
*/
|
||||||
|
public final String getCredate() {
|
||||||
|
return credate;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param credate the credate to set
|
||||||
|
*/
|
||||||
|
public final void setCredate(final String credate) {
|
||||||
|
this.credate = credate;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the logdate
|
||||||
|
*/
|
||||||
|
public final String getLogdate() {
|
||||||
|
return logdate;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param logdate the logdate to set
|
||||||
|
*/
|
||||||
|
public final void setLogdate(final String logdate) {
|
||||||
|
this.logdate = logdate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
package kcg.faics.target.vo;
|
||||||
|
|
||||||
|
import kcg.faics.cmmn.bbs.BaseSearchVO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 검색정보 Value Object.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class DivMngSearchVO extends BaseSearchVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 소속.
|
||||||
|
*/
|
||||||
|
private String place;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the place
|
||||||
|
*/
|
||||||
|
public final String getPlace() {
|
||||||
|
return place;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param place the place to set
|
||||||
|
*/
|
||||||
|
public final void setPlace(final String place) {
|
||||||
|
this.place = place;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,355 @@
|
||||||
|
package kcg.faics.target.vo;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분신운영현황 Value Object.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class DivMngVO {
|
||||||
|
/**
|
||||||
|
* 소속.
|
||||||
|
*/
|
||||||
|
private String place;
|
||||||
|
/**
|
||||||
|
* 소속명칭.
|
||||||
|
*/
|
||||||
|
private String placeStr;
|
||||||
|
/**
|
||||||
|
* 소속별 일련번호.
|
||||||
|
*/
|
||||||
|
private int no;
|
||||||
|
/**
|
||||||
|
* 설치장소.
|
||||||
|
*/
|
||||||
|
private String local;
|
||||||
|
/**
|
||||||
|
* 근무형태. 근무형태 i-상주, o-비상주
|
||||||
|
*/
|
||||||
|
private String gubun = "i";
|
||||||
|
/**
|
||||||
|
* 근무형태 표현 문자열.
|
||||||
|
*/
|
||||||
|
private String gubunStr = "비상주";
|
||||||
|
/**
|
||||||
|
* 근무인원.
|
||||||
|
*/
|
||||||
|
private int staffNum;
|
||||||
|
/**
|
||||||
|
* 전화번호.
|
||||||
|
*/
|
||||||
|
private String tel;
|
||||||
|
/**
|
||||||
|
* 현황.
|
||||||
|
*/
|
||||||
|
private String condition;
|
||||||
|
/**
|
||||||
|
* 장비현황.
|
||||||
|
*/
|
||||||
|
private String equipStat;
|
||||||
|
/**
|
||||||
|
* 사진.
|
||||||
|
*/
|
||||||
|
private String fileImg;
|
||||||
|
/**
|
||||||
|
* 사진 객체.
|
||||||
|
*/
|
||||||
|
private MultipartFile fileImgObj;
|
||||||
|
/**
|
||||||
|
* 첨부파일1.
|
||||||
|
*/
|
||||||
|
private String file1;
|
||||||
|
/**
|
||||||
|
* 첨부파일2.
|
||||||
|
*/
|
||||||
|
private String file2;
|
||||||
|
/**
|
||||||
|
* 첨부파일3.
|
||||||
|
*/
|
||||||
|
private String file3;
|
||||||
|
/**
|
||||||
|
* 첨부파일1 객체.
|
||||||
|
*/
|
||||||
|
private MultipartFile file1obj;
|
||||||
|
/**
|
||||||
|
* 첨부파일 2 객체.
|
||||||
|
*/
|
||||||
|
private MultipartFile file2obj;
|
||||||
|
/**
|
||||||
|
* 첨부파일 3 객체.
|
||||||
|
*/
|
||||||
|
private MultipartFile file3obj;
|
||||||
|
/**
|
||||||
|
* 입력일.
|
||||||
|
*/
|
||||||
|
private Date creDate;
|
||||||
|
/**
|
||||||
|
* 수정일.
|
||||||
|
*/
|
||||||
|
private Date logDate;
|
||||||
|
/**
|
||||||
|
* 입력자.
|
||||||
|
*/
|
||||||
|
private String writer;
|
||||||
|
/**
|
||||||
|
* @return the place
|
||||||
|
*/
|
||||||
|
public final String getPlace() {
|
||||||
|
return place;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param place the place to set
|
||||||
|
*/
|
||||||
|
public final void setPlace(final String place) {
|
||||||
|
this.place = place;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the placeStr
|
||||||
|
*/
|
||||||
|
public final String getPlaceStr() {
|
||||||
|
return placeStr;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param placeStr the placeStr to set
|
||||||
|
*/
|
||||||
|
public final void setPlaceStr(final String placeStr) {
|
||||||
|
this.placeStr = placeStr;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the no
|
||||||
|
*/
|
||||||
|
public final int getNo() {
|
||||||
|
return no;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param no the no to set
|
||||||
|
*/
|
||||||
|
public final void setNo(final int no) {
|
||||||
|
this.no = no;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the local
|
||||||
|
*/
|
||||||
|
public final String getLocal() {
|
||||||
|
return local;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param local the local to set
|
||||||
|
*/
|
||||||
|
public final void setLocal(final String local) {
|
||||||
|
this.local = local;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the gubun
|
||||||
|
*/
|
||||||
|
public final String getGubun() {
|
||||||
|
return gubun;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param gubun the gubun to set
|
||||||
|
*/
|
||||||
|
public final void setGubun(final String gubun) {
|
||||||
|
this.gubun = gubun;
|
||||||
|
if ("i".equalsIgnoreCase(this.gubun)) {
|
||||||
|
setGubunStr("상주");
|
||||||
|
} else {
|
||||||
|
setGubunStr("비상주");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the gubunStr
|
||||||
|
*/
|
||||||
|
public final String getGubunStr() {
|
||||||
|
return gubunStr;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param gubunStr the gubunStr to set
|
||||||
|
*/
|
||||||
|
public final void setGubunStr(final String gubunStr) {
|
||||||
|
this.gubunStr = gubunStr;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the staffNum
|
||||||
|
*/
|
||||||
|
public final int getStaffNum() {
|
||||||
|
return staffNum;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param staffNum the staffNum to set
|
||||||
|
*/
|
||||||
|
public final void setStaffNum(final int staffNum) {
|
||||||
|
this.staffNum = staffNum;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the tel
|
||||||
|
*/
|
||||||
|
public final String getTel() {
|
||||||
|
return tel;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param tel the tel to set
|
||||||
|
*/
|
||||||
|
public final void setTel(final String tel) {
|
||||||
|
this.tel = tel;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the condition
|
||||||
|
*/
|
||||||
|
public final String getCondition() {
|
||||||
|
return condition;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param condition the condition to set
|
||||||
|
*/
|
||||||
|
public final void setCondition(final String condition) {
|
||||||
|
this.condition = condition;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the equipStat
|
||||||
|
*/
|
||||||
|
public final String getEquipStat() {
|
||||||
|
return equipStat;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param equipStat the equipStat to set
|
||||||
|
*/
|
||||||
|
public final void setEquipStat(final String equipStat) {
|
||||||
|
this.equipStat = equipStat;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the fileImgObj
|
||||||
|
*/
|
||||||
|
public final MultipartFile getFileImgObj() {
|
||||||
|
return fileImgObj;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param fileImgObj the fileImgObj to set
|
||||||
|
*/
|
||||||
|
public final void setFileImgObj(final MultipartFile fileImgObj) {
|
||||||
|
this.fileImgObj = fileImgObj;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the fileImg
|
||||||
|
*/
|
||||||
|
public final String getFileImg() {
|
||||||
|
return fileImg;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param fileImg the fileImg to set
|
||||||
|
*/
|
||||||
|
public final void setFileImg(final String fileImg) {
|
||||||
|
this.fileImg = fileImg;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the file1
|
||||||
|
*/
|
||||||
|
public final String getFile1() {
|
||||||
|
return file1;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param file1 the file1 to set
|
||||||
|
*/
|
||||||
|
public final void setFile1(final String file1) {
|
||||||
|
this.file1 = file1;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the file2
|
||||||
|
*/
|
||||||
|
public final String getFile2() {
|
||||||
|
return file2;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param file2 the file2 to set
|
||||||
|
*/
|
||||||
|
public final void setFile2(final String file2) {
|
||||||
|
this.file2 = file2;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the file3
|
||||||
|
*/
|
||||||
|
public final String getFile3() {
|
||||||
|
return file3;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param file3 the file3 to set
|
||||||
|
*/
|
||||||
|
public final void setFile3(final String file3) {
|
||||||
|
this.file3 = file3;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the file1obj
|
||||||
|
*/
|
||||||
|
public final MultipartFile getFile1obj() {
|
||||||
|
return file1obj;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param file1obj the file1obj to set
|
||||||
|
*/
|
||||||
|
public final void setFile1obj(final MultipartFile file1obj) {
|
||||||
|
this.file1obj = file1obj;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the file2obj
|
||||||
|
*/
|
||||||
|
public final MultipartFile getFile2obj() {
|
||||||
|
return file2obj;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param file2obj the file2obj to set
|
||||||
|
*/
|
||||||
|
public final void setFile2obj(final MultipartFile file2obj) {
|
||||||
|
this.file2obj = file2obj;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the file3obj
|
||||||
|
*/
|
||||||
|
public final MultipartFile getFile3obj() {
|
||||||
|
return file3obj;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param file3obj the file3obj to set
|
||||||
|
*/
|
||||||
|
public final void setFile3obj(final MultipartFile file3obj) {
|
||||||
|
this.file3obj = file3obj;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the creDate
|
||||||
|
*/
|
||||||
|
public final Date getCreDate() {
|
||||||
|
return creDate;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param creDate the creDate to set
|
||||||
|
*/
|
||||||
|
public final void setCreDate(final Date creDate) {
|
||||||
|
this.creDate = creDate;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the logDate
|
||||||
|
*/
|
||||||
|
public final Date getLogDate() {
|
||||||
|
return logDate;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param logDate the logDate to set
|
||||||
|
*/
|
||||||
|
public final void setLogDate(final Date logDate) {
|
||||||
|
this.logDate = logDate;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @return the writer
|
||||||
|
*/
|
||||||
|
public final String getWriter() {
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param writer the writer to set
|
||||||
|
*/
|
||||||
|
public final void setWriter(final String writer) {
|
||||||
|
this.writer = writer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
package kcg.faics.target.vo;
|
||||||
|
|
||||||
|
import kcg.faics.cmmn.bbs.BaseSearchVO;
|
||||||
|
import kcg.faics.target.FerryRouteType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 검색정보 Value Object.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class FerrySearchVO extends BaseSearchVO {
|
||||||
|
/**
|
||||||
|
* 항로(한-중, 한-러, 한-일, 금강산).
|
||||||
|
*/
|
||||||
|
private String ferryRoute;
|
||||||
|
/**
|
||||||
|
* 항로 표현 문자열.
|
||||||
|
*/
|
||||||
|
private String ferryRouteStr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the ferryRoute
|
||||||
|
*/
|
||||||
|
public final String getFerryRoute() {
|
||||||
|
return ferryRoute;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ferryRoute the ferryRoute to set
|
||||||
|
*/
|
||||||
|
public final void setFerryRoute(final String ferryRoute) {
|
||||||
|
this.ferryRoute = ferryRoute;
|
||||||
|
|
||||||
|
setFerryRouteStr(FerryRouteType.getValue(ferryRoute));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the ferryRouteStr
|
||||||
|
*/
|
||||||
|
public final String getFerryRouteStr() {
|
||||||
|
return ferryRouteStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ferryRouteStr the ferryRouteStr to set
|
||||||
|
*/
|
||||||
|
public final void setFerryRouteStr(final String ferryRouteStr) {
|
||||||
|
this.ferryRouteStr = ferryRouteStr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,559 @@
|
||||||
|
package kcg.faics.target.vo;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import kcg.faics.target.FerryRouteType;
|
||||||
|
import kcg.faics.target.FerryRunTermType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 Value Object.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class FerryVO {
|
||||||
|
/**
|
||||||
|
* ID.
|
||||||
|
*/
|
||||||
|
private int serNo;
|
||||||
|
/**
|
||||||
|
* 여객선사.
|
||||||
|
*/
|
||||||
|
private String ferryOffice;
|
||||||
|
/**
|
||||||
|
* 선명.
|
||||||
|
*/
|
||||||
|
private String ferryName;
|
||||||
|
/**
|
||||||
|
* 톤수.
|
||||||
|
*/
|
||||||
|
private String ferryTon;
|
||||||
|
/**
|
||||||
|
* 항로(한-중, 한-러, 한-일, 금강산).
|
||||||
|
*/
|
||||||
|
private String ferryRoute;
|
||||||
|
/**
|
||||||
|
* 항로 표현 문자열.
|
||||||
|
*/
|
||||||
|
private String ferryRouteStr;
|
||||||
|
/**
|
||||||
|
* 항해시간.
|
||||||
|
*/
|
||||||
|
private String ferryTime;
|
||||||
|
/**
|
||||||
|
* 최대속력.
|
||||||
|
*/
|
||||||
|
private String ferrySpeedMax;
|
||||||
|
/**
|
||||||
|
* 항해속력.
|
||||||
|
*/
|
||||||
|
private String ferrySpeedNor;
|
||||||
|
/**
|
||||||
|
* 여객정원.
|
||||||
|
*/
|
||||||
|
private int ferryGuestCnt;
|
||||||
|
/**
|
||||||
|
* 승무원정원.
|
||||||
|
*/
|
||||||
|
private int ferryClueCnt;
|
||||||
|
/**
|
||||||
|
* 운항주기.
|
||||||
|
*/
|
||||||
|
private String runTerm;
|
||||||
|
/**
|
||||||
|
* 운항주기 표현 문자열.
|
||||||
|
*/
|
||||||
|
private String runTermStr;
|
||||||
|
/**
|
||||||
|
* 운항횟수.
|
||||||
|
*/
|
||||||
|
private String runCnt;
|
||||||
|
/**
|
||||||
|
* 대표자.
|
||||||
|
*/
|
||||||
|
private String repreName;
|
||||||
|
/**
|
||||||
|
* 연락처.
|
||||||
|
*/
|
||||||
|
private String tel;
|
||||||
|
/**
|
||||||
|
* 선적.
|
||||||
|
*/
|
||||||
|
private String ferrySosok;
|
||||||
|
/**
|
||||||
|
* 항해거리.
|
||||||
|
*/
|
||||||
|
private String sailingDistance;
|
||||||
|
/**
|
||||||
|
* 취항일.
|
||||||
|
*/
|
||||||
|
private String sailingDate;
|
||||||
|
/**
|
||||||
|
* 합작국.
|
||||||
|
*/
|
||||||
|
private String cooperateNation;
|
||||||
|
/**
|
||||||
|
* 합작여부 표현 문자열.
|
||||||
|
*/
|
||||||
|
private String isCooperateStr = "-";
|
||||||
|
/**
|
||||||
|
* 등록자.
|
||||||
|
*/
|
||||||
|
private String writer;
|
||||||
|
/**
|
||||||
|
* 생성일.
|
||||||
|
*/
|
||||||
|
private String creDate;
|
||||||
|
/**
|
||||||
|
* 수정일.
|
||||||
|
*/
|
||||||
|
private String logDate;
|
||||||
|
/**
|
||||||
|
* 첨부이미지.
|
||||||
|
*/
|
||||||
|
private String imgFile;
|
||||||
|
/**
|
||||||
|
* 첨부이미지 객체.
|
||||||
|
*/
|
||||||
|
private MultipartFile imgFileObj;
|
||||||
|
/**
|
||||||
|
* 비고.
|
||||||
|
*/
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the serNo
|
||||||
|
*/
|
||||||
|
public final int getSerNo() {
|
||||||
|
return serNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param serNo
|
||||||
|
* the serNo to set
|
||||||
|
*/
|
||||||
|
public final void setSerNo(final int serNo) {
|
||||||
|
this.serNo = serNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the ferryOffice
|
||||||
|
*/
|
||||||
|
public final String getFerryOffice() {
|
||||||
|
return ferryOffice;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ferryOffice
|
||||||
|
* the ferryOffice to set
|
||||||
|
*/
|
||||||
|
public final void setFerryOffice(final String ferryOffice) {
|
||||||
|
this.ferryOffice = ferryOffice;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the ferryName
|
||||||
|
*/
|
||||||
|
public final String getFerryName() {
|
||||||
|
return ferryName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ferryName
|
||||||
|
* the ferryName to set
|
||||||
|
*/
|
||||||
|
public final void setFerryName(final String ferryName) {
|
||||||
|
this.ferryName = ferryName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the ferryTon
|
||||||
|
*/
|
||||||
|
public final String getFerryTon() {
|
||||||
|
return ferryTon;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ferryTon
|
||||||
|
* the ferryTon to set
|
||||||
|
*/
|
||||||
|
public final void setFerryTon(final String ferryTon) {
|
||||||
|
this.ferryTon = ferryTon;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the ferryRoute
|
||||||
|
*/
|
||||||
|
public final String getFerryRoute() {
|
||||||
|
return ferryRoute;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ferryRoute
|
||||||
|
* the ferryRoute to set
|
||||||
|
*/
|
||||||
|
public final void setFerryRoute(final String ferryRoute) {
|
||||||
|
this.ferryRoute = ferryRoute;
|
||||||
|
|
||||||
|
setFerryRouteStr(FerryRouteType.getValue(ferryRoute));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the ferryRouteStr
|
||||||
|
*/
|
||||||
|
public final String getFerryRouteStr() {
|
||||||
|
return ferryRouteStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ferryRouteStr
|
||||||
|
* the ferryRouteStr to set
|
||||||
|
*/
|
||||||
|
public final void setFerryRouteStr(final String ferryRouteStr) {
|
||||||
|
this.ferryRouteStr = ferryRouteStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the ferryTime
|
||||||
|
*/
|
||||||
|
public final String getFerryTime() {
|
||||||
|
return ferryTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ferryTime
|
||||||
|
* the ferryTime to set
|
||||||
|
*/
|
||||||
|
public final void setFerryTime(final String ferryTime) {
|
||||||
|
this.ferryTime = ferryTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the ferrySpeedMax
|
||||||
|
*/
|
||||||
|
public final String getFerrySpeedMax() {
|
||||||
|
return ferrySpeedMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ferrySpeedMax
|
||||||
|
* the ferrySpeedMax to set
|
||||||
|
*/
|
||||||
|
public final void setFerrySpeedMax(final String ferrySpeedMax) {
|
||||||
|
this.ferrySpeedMax = ferrySpeedMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the ferrySpeedNor
|
||||||
|
*/
|
||||||
|
public final String getFerrySpeedNor() {
|
||||||
|
return ferrySpeedNor;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ferrySpeedNor
|
||||||
|
* the ferrySpeedNor to set
|
||||||
|
*/
|
||||||
|
public final void setFerrySpeedNor(final String ferrySpeedNor) {
|
||||||
|
this.ferrySpeedNor = ferrySpeedNor;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the capacity
|
||||||
|
*/
|
||||||
|
public final int getCapacity() {
|
||||||
|
return getFerryGuestCnt() + getFerryClueCnt();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the ferryGuestCnt
|
||||||
|
*/
|
||||||
|
public final int getFerryGuestCnt() {
|
||||||
|
return ferryGuestCnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ferryGuestCnt
|
||||||
|
* the ferryGuestCnt to set
|
||||||
|
*/
|
||||||
|
public final void setFerryGuestCnt(final int ferryGuestCnt) {
|
||||||
|
this.ferryGuestCnt = ferryGuestCnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the ferryClueCnt
|
||||||
|
*/
|
||||||
|
public final int getFerryClueCnt() {
|
||||||
|
return ferryClueCnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ferryClueCnt
|
||||||
|
* the ferryClueCnt to set
|
||||||
|
*/
|
||||||
|
public final void setFerryClueCnt(final int ferryClueCnt) {
|
||||||
|
this.ferryClueCnt = ferryClueCnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the runTerm
|
||||||
|
*/
|
||||||
|
public final String getRunTerm() {
|
||||||
|
return runTerm;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param runTerm
|
||||||
|
* the runTerm to set
|
||||||
|
*/
|
||||||
|
public final void setRunTerm(final String runTerm) {
|
||||||
|
this.runTerm = runTerm;
|
||||||
|
|
||||||
|
setRunTermStr(FerryRunTermType.getValue(runTerm));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the runTermStr
|
||||||
|
*/
|
||||||
|
public final String getRunTermStr() {
|
||||||
|
return runTermStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param runTermStr
|
||||||
|
* the runTermStr to set
|
||||||
|
*/
|
||||||
|
public final void setRunTermStr(final String runTermStr) {
|
||||||
|
this.runTermStr = runTermStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the runCnt
|
||||||
|
*/
|
||||||
|
public final String getRunCnt() {
|
||||||
|
return runCnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param runCnt
|
||||||
|
* the runCnt to set
|
||||||
|
*/
|
||||||
|
public final void setRunCnt(final String runCnt) {
|
||||||
|
this.runCnt = runCnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the runCntStr
|
||||||
|
*/
|
||||||
|
public final String getRunCntStr() {
|
||||||
|
String result = "";
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(getRunCnt())) {
|
||||||
|
result = String.format("%s %s회", getRunTermStr(), getRunCnt());
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the repreName
|
||||||
|
*/
|
||||||
|
public final String getRepreName() {
|
||||||
|
return repreName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param repreName
|
||||||
|
* the repreName to set
|
||||||
|
*/
|
||||||
|
public final void setRepreName(final String repreName) {
|
||||||
|
this.repreName = repreName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the tel
|
||||||
|
*/
|
||||||
|
public final String getTel() {
|
||||||
|
return tel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param tel
|
||||||
|
* the tel to set
|
||||||
|
*/
|
||||||
|
public final void setTel(final String tel) {
|
||||||
|
this.tel = tel;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the ferrySosok
|
||||||
|
*/
|
||||||
|
public final String getFerrySosok() {
|
||||||
|
return ferrySosok;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param ferrySosok
|
||||||
|
* the ferrySosok to set
|
||||||
|
*/
|
||||||
|
public final void setFerrySosok(final String ferrySosok) {
|
||||||
|
this.ferrySosok = ferrySosok;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the sailingDistance
|
||||||
|
*/
|
||||||
|
public final String getSailingDistance() {
|
||||||
|
return sailingDistance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param sailingDistance
|
||||||
|
* the sailingDistance to set
|
||||||
|
*/
|
||||||
|
public final void setSailingDistance(final String sailingDistance) {
|
||||||
|
this.sailingDistance = sailingDistance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the sailingDate
|
||||||
|
*/
|
||||||
|
public final String getSailingDate() {
|
||||||
|
return sailingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param sailingDate
|
||||||
|
* the sailingDate to set
|
||||||
|
*/
|
||||||
|
public final void setSailingDate(final String sailingDate) {
|
||||||
|
this.sailingDate = sailingDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the cooperateNation
|
||||||
|
*/
|
||||||
|
public final String getCooperateNation() {
|
||||||
|
return cooperateNation;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param cooperateNation
|
||||||
|
* the cooperateNation to set
|
||||||
|
*/
|
||||||
|
public final void setCooperateNation(final String cooperateNation) {
|
||||||
|
this.cooperateNation = cooperateNation;
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(cooperateNation)) {
|
||||||
|
setIsCooperateStr("합작");
|
||||||
|
} else {
|
||||||
|
setIsCooperateStr("-");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the isCooperateStr
|
||||||
|
*/
|
||||||
|
public final String getIsCooperateStr() {
|
||||||
|
return isCooperateStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param isCooperateStr
|
||||||
|
* the isCooperateStr to set
|
||||||
|
*/
|
||||||
|
public final void setIsCooperateStr(final String isCooperateStr) {
|
||||||
|
this.isCooperateStr = isCooperateStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the writer
|
||||||
|
*/
|
||||||
|
public final String getWriter() {
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param writer
|
||||||
|
* the writer to set
|
||||||
|
*/
|
||||||
|
public final void setWriter(final String writer) {
|
||||||
|
this.writer = writer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the creDate
|
||||||
|
*/
|
||||||
|
public final String getCreDate() {
|
||||||
|
return creDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param creDate
|
||||||
|
* the creDate to set
|
||||||
|
*/
|
||||||
|
public final void setCreDate(final String creDate) {
|
||||||
|
this.creDate = creDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the logDate
|
||||||
|
*/
|
||||||
|
public final String getLogDate() {
|
||||||
|
return logDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param logDate
|
||||||
|
* the logDate to set
|
||||||
|
*/
|
||||||
|
public final void setLogDate(final String logDate) {
|
||||||
|
this.logDate = logDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the imgFile
|
||||||
|
*/
|
||||||
|
public final String getImgFile() {
|
||||||
|
return imgFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param imgFile
|
||||||
|
* the imgFile to set
|
||||||
|
*/
|
||||||
|
public final void setImgFile(final String imgFile) {
|
||||||
|
this.imgFile = imgFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the imgFileObj
|
||||||
|
*/
|
||||||
|
public final MultipartFile getImgFileObj() {
|
||||||
|
return imgFileObj;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param imgFileObj
|
||||||
|
* the imgFileObj to set
|
||||||
|
*/
|
||||||
|
public final void setImgFileObj(final MultipartFile imgFileObj) {
|
||||||
|
this.imgFileObj = imgFileObj;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the comments
|
||||||
|
*/
|
||||||
|
public final String getComments() {
|
||||||
|
return comments;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param comments
|
||||||
|
* the comments to set
|
||||||
|
*/
|
||||||
|
public final void setComments(final String comments) {
|
||||||
|
this.comments = comments;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package kcg.faics.target.vo;
|
||||||
|
|
||||||
|
import kcg.faics.cmmn.bbs.BaseSearchVO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 검색 관련 Value Object.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class WeakPlaceSearchVO extends BaseSearchVO {
|
||||||
|
/**
|
||||||
|
* 소속.
|
||||||
|
*/
|
||||||
|
private String place1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 소속을 반환한다.
|
||||||
|
*
|
||||||
|
* @return 소속
|
||||||
|
*/
|
||||||
|
public final String getPlace1() {
|
||||||
|
return place1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 소속을 설정한다.
|
||||||
|
*
|
||||||
|
* @param place1 소속
|
||||||
|
*/
|
||||||
|
public final void setPlace1(final String place1) {
|
||||||
|
this.place1 = place1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,314 @@
|
||||||
|
package kcg.faics.target.vo;
|
||||||
|
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 Value Object.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class WeakPlaceVO {
|
||||||
|
/**
|
||||||
|
* 소속 코드.
|
||||||
|
*/
|
||||||
|
private String place1;
|
||||||
|
/**
|
||||||
|
* 소속명.
|
||||||
|
*/
|
||||||
|
private String place1str;
|
||||||
|
/**
|
||||||
|
* 일련번호.
|
||||||
|
*/
|
||||||
|
private int wpNo;
|
||||||
|
/**
|
||||||
|
* 취약지명.
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 소재지.
|
||||||
|
*/
|
||||||
|
private String location;
|
||||||
|
/**
|
||||||
|
* 선정사유.
|
||||||
|
*/
|
||||||
|
private String comments;
|
||||||
|
/**
|
||||||
|
* 요도 첨부파일 객체.
|
||||||
|
*/
|
||||||
|
private MultipartFile file1;
|
||||||
|
/**
|
||||||
|
* 요도 첨부파일.
|
||||||
|
*/
|
||||||
|
private String filename1 = "";
|
||||||
|
/**
|
||||||
|
* 화면에 출력할 요도 첨부파일 여부 텍스트.
|
||||||
|
* O : 있다, - : 없다.
|
||||||
|
*/
|
||||||
|
private String filename1viewStr = "-";
|
||||||
|
/**
|
||||||
|
* 첨부파일 객체.
|
||||||
|
*/
|
||||||
|
private MultipartFile file2;
|
||||||
|
/**
|
||||||
|
* 첨부파일.
|
||||||
|
*/
|
||||||
|
private String filename2 = "";
|
||||||
|
/**
|
||||||
|
* 등록자.
|
||||||
|
*/
|
||||||
|
private String writer;
|
||||||
|
/**
|
||||||
|
* 등록일.
|
||||||
|
*/
|
||||||
|
private String credate;
|
||||||
|
/**
|
||||||
|
* 수정일.
|
||||||
|
*/
|
||||||
|
private String logdate;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 소속 코드을 반환한다.
|
||||||
|
*
|
||||||
|
* @return 소속 코드
|
||||||
|
*/
|
||||||
|
public final String getPlace1() {
|
||||||
|
return place1;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 소속 코드을 설정한다.
|
||||||
|
*
|
||||||
|
* @param place1 소속 코드
|
||||||
|
*/
|
||||||
|
public final void setPlace1(final String place1) {
|
||||||
|
this.place1 = place1;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 소속명을 반환한다.
|
||||||
|
*
|
||||||
|
* @return 소속명
|
||||||
|
*/
|
||||||
|
public final String getPlace1str() {
|
||||||
|
return place1str;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 소속명을 설정한다.
|
||||||
|
*
|
||||||
|
* @param place1str 소속명
|
||||||
|
*/
|
||||||
|
public final void setPlace1str(final String place1str) {
|
||||||
|
this.place1str = place1str;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 일련번호를 반환한다.
|
||||||
|
*
|
||||||
|
* @return 일련번호
|
||||||
|
*/
|
||||||
|
public final int getWpNo() {
|
||||||
|
return wpNo;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 일련번호를 설정한다.
|
||||||
|
*
|
||||||
|
* @param wpNo 일련번호
|
||||||
|
*/
|
||||||
|
public final void setWpNo(final int wpNo) {
|
||||||
|
this.wpNo = wpNo;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 관리번호를 반환한다.
|
||||||
|
*
|
||||||
|
* @return 관리번호
|
||||||
|
*/
|
||||||
|
public final String getWpNoStr() {
|
||||||
|
return String.format("%s - %s", this.place1str, this.wpNo);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 취약지명을 반환한다.
|
||||||
|
*
|
||||||
|
* @return 취약지명
|
||||||
|
*/
|
||||||
|
public final String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 취약지명을 설정한다.
|
||||||
|
*
|
||||||
|
* @param name 취약지명
|
||||||
|
*/
|
||||||
|
public final void setName(final String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 소재지를 반환한다.
|
||||||
|
*
|
||||||
|
* @return 소재지
|
||||||
|
*/
|
||||||
|
public final String getLocation() {
|
||||||
|
return location;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 소재지를 설정한다.
|
||||||
|
*
|
||||||
|
* @param location 소재지
|
||||||
|
*/
|
||||||
|
public final void setLocation(final String location) {
|
||||||
|
this.location = location;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 선정사유를 반환한다.
|
||||||
|
*
|
||||||
|
* @return 선정사유
|
||||||
|
*/
|
||||||
|
public final String getComments() {
|
||||||
|
return comments;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 선정사유를 설정한다.
|
||||||
|
*
|
||||||
|
* @param comments 선정사유
|
||||||
|
*/
|
||||||
|
public final void setComments(final String comments) {
|
||||||
|
this.comments = comments;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 요도 첨부파일 객체를 반환한다.
|
||||||
|
*
|
||||||
|
* @return 요도 첨부파일 객체
|
||||||
|
*/
|
||||||
|
public final MultipartFile getFile1() {
|
||||||
|
return file1;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 요도 첨부파일 객체를 설정한다.
|
||||||
|
*
|
||||||
|
* @param file1 요도 첨부파일 객체
|
||||||
|
*/
|
||||||
|
public final void setFile1(final MultipartFile file1) {
|
||||||
|
this.file1 = file1;
|
||||||
|
if (this.file1 != null) {
|
||||||
|
setFilename1(this.file1.getOriginalFilename());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 요도 첨부파일을 반환한다.
|
||||||
|
*
|
||||||
|
* @return 요도 첨부파일
|
||||||
|
*/
|
||||||
|
public final String getFilename1() {
|
||||||
|
return filename1;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 요도 첨부파일을 설정한다.
|
||||||
|
*
|
||||||
|
* @param filename1 요도 첨부파일
|
||||||
|
*/
|
||||||
|
public final void setFilename1(final String filename1) {
|
||||||
|
this.filename1 = filename1;
|
||||||
|
if (this.filename1 != null && this.filename1.trim().length() > 0) {
|
||||||
|
setFilename1viewStr("O");
|
||||||
|
} else {
|
||||||
|
setFilename1viewStr("-");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 화면에 출력할 요도 첨부파일 여부 텍스트를 반환한다.
|
||||||
|
*
|
||||||
|
* @return 화면에 출력할 요도 첨부파일 여부 텍스트
|
||||||
|
*/
|
||||||
|
public final String getFilename1viewStr() {
|
||||||
|
return filename1viewStr;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 화면에 출력할 요도 첨부파일 여부 텍스트를 설정한다.
|
||||||
|
*
|
||||||
|
* @param filename1viewStr 화면에 출력할 요도 첨부파일 여부 텍스트
|
||||||
|
*/
|
||||||
|
public final void setFilename1viewStr(final String filename1viewStr) {
|
||||||
|
this.filename1viewStr = filename1viewStr;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 첨부파일 객체를 반환한다.
|
||||||
|
*
|
||||||
|
* @return 첨부파일
|
||||||
|
*/
|
||||||
|
public final MultipartFile getFile2() {
|
||||||
|
return file2;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 첨부파일 객체를 설정한다.
|
||||||
|
*
|
||||||
|
* @param file2 첨부파일
|
||||||
|
*/
|
||||||
|
public final void setFile2(final MultipartFile file2) {
|
||||||
|
this.file2 = file2;
|
||||||
|
if (this.file2 != null) {
|
||||||
|
setFilename2(this.file2.getOriginalFilename());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 첨부파일를 반환한다.
|
||||||
|
*
|
||||||
|
* @return 첨부파일
|
||||||
|
*/
|
||||||
|
public final String getFilename2() {
|
||||||
|
return filename2;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 첨부파일를 설정한다.
|
||||||
|
*
|
||||||
|
* @param filename2 첨부파일
|
||||||
|
*/
|
||||||
|
public final void setFilename2(final String filename2) {
|
||||||
|
this.filename2 = filename2;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 등록자를 반환한다.
|
||||||
|
*
|
||||||
|
* @return 등록자
|
||||||
|
*/
|
||||||
|
public final String getWriter() {
|
||||||
|
return writer;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 등록자를 설정한다.
|
||||||
|
*
|
||||||
|
* @param writer 등록자
|
||||||
|
*/
|
||||||
|
public final void setWriter(final String writer) {
|
||||||
|
this.writer = writer;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 등록일을 반환한다.
|
||||||
|
*
|
||||||
|
* @return 등록일
|
||||||
|
*/
|
||||||
|
public final String getCredate() {
|
||||||
|
return credate;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 등록일을 설정한다.
|
||||||
|
*
|
||||||
|
* @param credate 등록일
|
||||||
|
*/
|
||||||
|
public final void setCredate(final String credate) {
|
||||||
|
this.credate = credate;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 수정일을 반환한다.
|
||||||
|
*
|
||||||
|
* @return 수정일
|
||||||
|
*/
|
||||||
|
public final String getLogdate() {
|
||||||
|
return logdate;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 수정일을 설정한다.
|
||||||
|
*
|
||||||
|
* @param logdate 수정일
|
||||||
|
*/
|
||||||
|
public final void setLogdate(final String logdate) {
|
||||||
|
this.logdate = logdate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
/**
|
||||||
|
* 외사대상목표 관련 Value Object 패키지.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package kcg.faics.target.vo;
|
||||||
|
|
@ -0,0 +1,532 @@
|
||||||
|
package kcg.faics.target.web;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
import kcg.faics.cmmn.bbs.PageType;
|
||||||
|
import kcg.faics.cmmn.excel.ExcelExporter;
|
||||||
|
import kcg.faics.cmmn.service.CodeService;
|
||||||
|
import kcg.faics.cmmn.vo.CodeVO;
|
||||||
|
import kcg.faics.sec.LoginUserVO;
|
||||||
|
import kcg.faics.sec.UserUtil;
|
||||||
|
import kcg.faics.target.service.CorpService;
|
||||||
|
import kcg.faics.target.vo.CorpSearchVO;
|
||||||
|
import kcg.faics.target.vo.CorpVO;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.MessageSource;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.validation.BindingResult;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
import org.springframework.web.bind.support.SessionStatus;
|
||||||
|
import org.springmodules.validation.commons.DefaultBeanValidator;
|
||||||
|
|
||||||
|
import egovframework.rte.fdl.property.EgovPropertyService;
|
||||||
|
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 컨트롤러.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/target/corp")
|
||||||
|
public class CorpController {
|
||||||
|
/**
|
||||||
|
* properties값을 가져오는 인터페이스.
|
||||||
|
**/
|
||||||
|
@Resource(name = "propertiesService")
|
||||||
|
private EgovPropertyService propertiesService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* message.properties의 값을 가져오는 인터페이스.
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private MessageSource messageSource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validator - 유효성 검사.
|
||||||
|
**/
|
||||||
|
@Resource(name = "beanValidator")
|
||||||
|
private DefaultBeanValidator beanValidator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 코드관련 정보 인터페이스.
|
||||||
|
*/
|
||||||
|
@Resource(name = "codeService")
|
||||||
|
private CodeService codeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 비지니스 로직 클래스.
|
||||||
|
*/
|
||||||
|
@Resource(name = "corpService")
|
||||||
|
private CorpService corpService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* grpNo에 따른 항목명을 반환한다.
|
||||||
|
*
|
||||||
|
* @param grpNo
|
||||||
|
* 화면구분
|
||||||
|
* @param locale
|
||||||
|
* Locale 객체
|
||||||
|
* @return 항목명
|
||||||
|
*/
|
||||||
|
private LinkedHashMap<String, String> getFieldName(final String grpNo, final Locale locale) {
|
||||||
|
LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
|
||||||
|
map.put("place1str", messageSource.getMessage("target.corp.place1", null, locale));
|
||||||
|
if ("01".equalsIgnoreCase(grpNo)) {
|
||||||
|
map.put("name", messageSource.getMessage("target.corp.name01", null, locale));
|
||||||
|
map.put("location", messageSource.getMessage("target.corp.location", null, locale));
|
||||||
|
} else if ("02".equalsIgnoreCase(grpNo)) {
|
||||||
|
map.put("name", messageSource.getMessage("target.corp.name02", null, locale));
|
||||||
|
map.put("location", messageSource.getMessage("target.corp.location", null, locale));
|
||||||
|
map.put("ceo", messageSource.getMessage("target.corp.ceo", null, locale));
|
||||||
|
} else if ("03".equalsIgnoreCase(grpNo)) {
|
||||||
|
map.put("name", messageSource.getMessage("target.corp.name", null, locale));
|
||||||
|
map.put("location", messageSource.getMessage("target.corp.location", null, locale));
|
||||||
|
map.put("shipCnt", messageSource.getMessage("target.corp.shipcnt", null, locale));
|
||||||
|
map.put("ceo", messageSource.getMessage("target.corp.ceo", null, locale));
|
||||||
|
map.put("memberCnt", messageSource.getMessage("target.corp.membercnt", null, locale));
|
||||||
|
map.put("basicYear", messageSource.getMessage("target.corp.basicyear", null, locale));
|
||||||
|
map.put("fund", messageSource.getMessage("target.corp.fund", null, locale));
|
||||||
|
} else if ("04".equalsIgnoreCase(grpNo)) {
|
||||||
|
map.put("name", messageSource.getMessage("target.corp.name", null, locale));
|
||||||
|
map.put("location", messageSource.getMessage("target.corp.location", null, locale));
|
||||||
|
map.put("ceo", messageSource.getMessage("target.corp.ceo", null, locale));
|
||||||
|
map.put("jobType", messageSource.getMessage("target.corp.jobtype", null, locale));
|
||||||
|
} else if ("05".equalsIgnoreCase(grpNo)) {
|
||||||
|
map.put("name", messageSource.getMessage("target.corp.name", null, locale));
|
||||||
|
map.put("location", messageSource.getMessage("target.corp.location", null, locale));
|
||||||
|
map.put("ceo", messageSource.getMessage("target.corp.ceo", null, locale));
|
||||||
|
map.put("jobType", messageSource.getMessage("target.corp.jobtype", null, locale));
|
||||||
|
map.put("partner", messageSource.getMessage("target.corp.partner", null, locale));
|
||||||
|
}
|
||||||
|
map.put("tel", messageSource.getMessage("target.corp.tel", null, locale));
|
||||||
|
map.put("fax", messageSource.getMessage("target.corp.fax", null, locale));
|
||||||
|
map.put("comments", messageSource.getMessage("target.corp.comments", null, locale));
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Redirect URI를 조합하여 반환한다.
|
||||||
|
*
|
||||||
|
* @param pageType
|
||||||
|
* 화면구분
|
||||||
|
* @param vo
|
||||||
|
* 치안대상 VO
|
||||||
|
* @return Redirect URI
|
||||||
|
*/
|
||||||
|
private String makeRedirectUri(final PageType pageType, final CorpVO vo) {
|
||||||
|
String uri = "redirect:/target/corp";
|
||||||
|
|
||||||
|
switch (pageType) {
|
||||||
|
case View:
|
||||||
|
uri = String.format("%s/view.do?place1=%s&orgId=%s&orgNo=%s", uri,
|
||||||
|
vo.getPlace1(), vo.getOrgId(), vo.getOrgNo());
|
||||||
|
break;
|
||||||
|
case List:
|
||||||
|
uri = String.format("%s/list.do?place1=%s&orgId=%s&grpNo=%s", uri,
|
||||||
|
vo.getPlace1(), vo.getOrgId(), vo.getGrpNo());
|
||||||
|
break;
|
||||||
|
case Stats:
|
||||||
|
default:
|
||||||
|
uri += "stats.do";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 통계화면을 반환한다.
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @return 치안대상 통계화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/stats.do")
|
||||||
|
public String stats(final Model model) throws Exception {
|
||||||
|
List<HashMap<String, Object>> stats = corpService.selectStats();
|
||||||
|
model.addAttribute("stats", stats);
|
||||||
|
|
||||||
|
return "/target/corpStats.tiles";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 통계현황을 엑셀로 반환한다.
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @return 치안대상 통계현황 엑셀
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/statstoexcel.do")
|
||||||
|
public String statsToExcel(final Model model) throws Exception {
|
||||||
|
String title = "치안대상";
|
||||||
|
|
||||||
|
// 엑셀 헤더 생성
|
||||||
|
LinkedHashMap<String, String> header = new LinkedHashMap<String, String>();
|
||||||
|
header.put("ORG_NM", "구분");
|
||||||
|
header.put("TOT_CNT", "계");
|
||||||
|
List<CodeVO> policeStations = codeService.getPlace1List(CodeService.POLICE_STATION_LIST);
|
||||||
|
for (CodeVO placeCode : policeStations) {
|
||||||
|
header.put(placeCode.getCode2() + "_CNT", placeCode.getCodenmYak());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 데이터 생성
|
||||||
|
List<HashMap<String, Object>> stats = corpService.selectStats();
|
||||||
|
|
||||||
|
// Export
|
||||||
|
model.addAttribute("excel", new ExcelExporter<HashMap<String, Object>>(header, stats, title));
|
||||||
|
model.addAttribute("filename", title);
|
||||||
|
|
||||||
|
return "excelView";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 목록화면을 반환한다.
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param searchVO
|
||||||
|
* 검색조건 VO
|
||||||
|
* @param locale
|
||||||
|
* Locale 객체
|
||||||
|
* @return 치안대상 목록화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/list.do")
|
||||||
|
public String list(final Model model,
|
||||||
|
@ModelAttribute("searchVO") final CorpSearchVO searchVO,
|
||||||
|
final Locale locale) throws Exception {
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
model.addAttribute("loginUserVO", loginUserVO);
|
||||||
|
|
||||||
|
List<CodeVO> placeList = codeService.getPlace1List(CodeService.POLICE_STATION_LIST, true);
|
||||||
|
model.addAttribute("placeList", placeList);
|
||||||
|
|
||||||
|
// place1 조건이 할당되지 않은 상태이고 로그인한 사용자의 소속이 검색조건에 적합하면 소속코드 할당
|
||||||
|
if (StringUtils.isEmpty(searchVO.getPlace1())) {
|
||||||
|
for (CodeVO place: placeList) {
|
||||||
|
if (loginUserVO.getPlace1().equalsIgnoreCase(place.getCode2())) {
|
||||||
|
searchVO.setPlace1(loginUserVO.getPlace1());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("03".equalsIgnoreCase(searchVO.getGrpNo())) {
|
||||||
|
List<CodeVO> corpOrgList = codeService.getCorpOrgList();
|
||||||
|
LinkedHashMap<String, String> corpOrgMap = new LinkedHashMap<String, String>();
|
||||||
|
for (CodeVO vo : corpOrgList) {
|
||||||
|
String code2 = vo.getCode2();
|
||||||
|
String stChar2 = code2.substring(0, 2);
|
||||||
|
String edChar2 = code2.substring(code2.length() - 2);
|
||||||
|
if ("03".equalsIgnoreCase(edChar2)) {
|
||||||
|
corpOrgMap.put(stChar2, vo.getCodenm());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
model.addAttribute("corpOrgList", corpOrgMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<CorpVO> corpList = corpService.selectList(searchVO);
|
||||||
|
model.addAttribute("corpList", corpList);
|
||||||
|
|
||||||
|
LinkedHashMap<String, String> fieldNameMap = getFieldName(searchVO.getGrpNo(), locale);
|
||||||
|
model.addAttribute("fieldNameMap", fieldNameMap);
|
||||||
|
|
||||||
|
return "/target/corpList.tiles";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 목록을 엑셀로 반환한다.
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param searchVO
|
||||||
|
* 검색조건 VO
|
||||||
|
* @param locale
|
||||||
|
* Locale 객체
|
||||||
|
* @return 치안대상 목록 엑셀
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/listtoexcel.do")
|
||||||
|
public String listToExcel(final Model model,
|
||||||
|
@ModelAttribute("searchVO") final CorpSearchVO searchVO,
|
||||||
|
final Locale locale) throws Exception {
|
||||||
|
String grpNo = searchVO.getGrpNo();
|
||||||
|
String title = "치안대상";
|
||||||
|
|
||||||
|
// 엑셀 헤더 생성
|
||||||
|
LinkedHashMap<String, String> header = getFieldName(grpNo, locale);
|
||||||
|
|
||||||
|
// 데이터 생성
|
||||||
|
List<CorpVO> corpList = corpService.selectList(searchVO);
|
||||||
|
|
||||||
|
// Export
|
||||||
|
model.addAttribute("excel", new ExcelExporter<CorpVO>(header, corpList, title));
|
||||||
|
model.addAttribute("filename", title);
|
||||||
|
|
||||||
|
return "excelView";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 정보 조회화면을 반환한다.
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param locale
|
||||||
|
* Locale 객체
|
||||||
|
* @param corpVO
|
||||||
|
* 치안대상 VO
|
||||||
|
* @return 치안대상 정보 조회화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/view.do")
|
||||||
|
public String view(final Model model, final Locale locale,
|
||||||
|
final CorpVO corpVO) throws Exception {
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
model.addAttribute("loginUserVO", loginUserVO);
|
||||||
|
|
||||||
|
CorpVO vo = corpService.select(corpVO);
|
||||||
|
model.addAttribute("corpVO", vo);
|
||||||
|
|
||||||
|
LinkedHashMap<String, String> fieldNameMap = getFieldName(vo.getGrpNo(), locale);
|
||||||
|
model.addAttribute("fieldNameMap", fieldNameMap);
|
||||||
|
|
||||||
|
return "/target/corpView.tiles";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 입력화면을 반환한다.
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param corpVO
|
||||||
|
* 치안대상 VO
|
||||||
|
* @param locale
|
||||||
|
* Locale 객체
|
||||||
|
* @return 치안대상 입력화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/add.do")
|
||||||
|
public String add(final Model model,
|
||||||
|
@ModelAttribute("corpVO") final CorpVO corpVO, final Locale locale) throws Exception {
|
||||||
|
// 사용자 인증 검사
|
||||||
|
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||||
|
|
||||||
|
// 등록은 isAdmin이 true인 사용자만 가능하다.
|
||||||
|
if (isAuthenticated && UserUtil.isAdmin()) {
|
||||||
|
List<CodeVO> placeList = codeService.getPlace1List(CodeService.POLICE_STATION_LIST);
|
||||||
|
model.addAttribute("placeList", placeList);
|
||||||
|
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
model.addAttribute("loginUserVO", loginUserVO);
|
||||||
|
|
||||||
|
// 로그인한 사용자가 입력가능한 소속이면 해당 소속으로 할당하고,
|
||||||
|
// 그렇지 않으면 기본값인 파라미터의 소속코드를 사용한다.
|
||||||
|
for (CodeVO tempVO : placeList) {
|
||||||
|
if (tempVO.getCode2().equalsIgnoreCase(loginUserVO.getPlace1())) {
|
||||||
|
corpVO.setPlace1(loginUserVO.getPlace1());
|
||||||
|
corpVO.setPlace1str(loginUserVO.getPlace1Str());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
corpVO.setWriter(loginUserVO.getUserid());
|
||||||
|
corpVO.setWriterPlace1(loginUserVO.getPlace1());
|
||||||
|
|
||||||
|
LinkedHashMap<String, String> fieldNameMap = getFieldName(corpVO.getGrpNo(), locale);
|
||||||
|
model.addAttribute("fieldNameMap", fieldNameMap);
|
||||||
|
model.addAttribute("registerFlag", "create");
|
||||||
|
}
|
||||||
|
return "/target/corpAdd.tiles";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 정보를 입력한다.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* php소스에는 파일 업로드 기능이 있으나,
|
||||||
|
* 파일 관련 필드가 DB에도 없고 표현기능도 없어서 제외함.
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @param corpVO
|
||||||
|
* 치안대상 VO
|
||||||
|
* @param bindingResult
|
||||||
|
* 유효성 검사결과 객체
|
||||||
|
* @param model
|
||||||
|
* 모델 객체
|
||||||
|
* @param status
|
||||||
|
* SessionStatus 객체
|
||||||
|
* @param locale
|
||||||
|
* Locale 객체
|
||||||
|
* @return 치안대상 목록화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/add.do", method = RequestMethod.POST)
|
||||||
|
public String add(@ModelAttribute("corpVO") final CorpVO corpVO,
|
||||||
|
final BindingResult bindingResult, final Model model,
|
||||||
|
final SessionStatus status, final Locale locale) throws Exception {
|
||||||
|
// 사용자 인증 검사
|
||||||
|
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||||
|
|
||||||
|
// 등록은 isAdmin이 true인 사용자만 가능하다.
|
||||||
|
if (isAuthenticated && UserUtil.isAdmin()) {
|
||||||
|
// 유효성 검사
|
||||||
|
beanValidator.validate(corpVO, bindingResult);
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
return add(model, corpVO, locale);
|
||||||
|
}
|
||||||
|
|
||||||
|
HashMap<String, Object> map = corpService.insert(corpVO, null);
|
||||||
|
|
||||||
|
status.setComplete();
|
||||||
|
|
||||||
|
if ((Integer) map.get("result") == 1) {
|
||||||
|
return makeRedirectUri(PageType.List, corpVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "error/bizError";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 수정화면을 반환한다.
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param locale
|
||||||
|
* Locale 객체
|
||||||
|
* @param corpVO
|
||||||
|
* 치안대상 VO
|
||||||
|
* @return 치안대상 수정화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/update.do")
|
||||||
|
public String update(final Model model, final Locale locale, final CorpVO corpVO) throws Exception {
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
model.addAttribute("loginUserVO", loginUserVO);
|
||||||
|
|
||||||
|
// 등록은 관리자만 가능하지만, 수정/삭제는 관리자 + 해당 기관도 가능하다.
|
||||||
|
if (loginUserVO.getIsAdmin()
|
||||||
|
|| loginUserVO.getPlace1().equalsIgnoreCase(corpVO.getPlace1())) {
|
||||||
|
CorpVO vo = corpService.select(corpVO);
|
||||||
|
model.addAttribute("corpVO", vo);
|
||||||
|
|
||||||
|
LinkedHashMap<String, String> fieldNameMap = getFieldName(vo.getGrpNo(), locale);
|
||||||
|
model.addAttribute("fieldNameMap", fieldNameMap);
|
||||||
|
model.addAttribute("registerFlag", "modify");
|
||||||
|
|
||||||
|
return "/target/corpAdd.tiles";
|
||||||
|
}
|
||||||
|
|
||||||
|
return makeRedirectUri(PageType.View, corpVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 정보를 수정한다.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* php소스에는 파일 업로드 기능이 있으나,
|
||||||
|
* 파일 관련 필드가 DB에도 없고 표현기능도 없어서 제외함.
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @param corpVO
|
||||||
|
* 치안대상 VO
|
||||||
|
* @param bindingResult
|
||||||
|
* 유효성 검사결과 객체
|
||||||
|
* @param model
|
||||||
|
* 모델 객체
|
||||||
|
* @param status
|
||||||
|
* SessionStatus 객체
|
||||||
|
* @param locale
|
||||||
|
* Locale 객체
|
||||||
|
* @return 치안대상 목록화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/update.do", method = RequestMethod.POST)
|
||||||
|
public String update(@Valid @ModelAttribute("corpVO") final CorpVO corpVO,
|
||||||
|
final BindingResult bindingResult, final Model model,
|
||||||
|
final SessionStatus status, final Locale locale) throws Exception {
|
||||||
|
// 사용자 인증 검사
|
||||||
|
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||||
|
if (isAuthenticated) {
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
|
||||||
|
// 등록은 관리자만 가능하지만, 수정/삭제는 관리자 + 해당 기관도 가능하다.
|
||||||
|
if (loginUserVO.getIsAdmin()
|
||||||
|
|| loginUserVO.getPlace1().equalsIgnoreCase(corpVO.getPlace1())) {
|
||||||
|
// 유효성 검사
|
||||||
|
beanValidator.validate(corpVO, bindingResult);
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
return update(model, locale, corpVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
corpVO.setWriter(loginUserVO.getUserid());
|
||||||
|
corpVO.setWriterPlace1(loginUserVO.getPlace1());
|
||||||
|
|
||||||
|
HashMap<String, Object> map = corpService.update(corpVO, null,
|
||||||
|
null);
|
||||||
|
|
||||||
|
status.setComplete();
|
||||||
|
|
||||||
|
if ((Integer) map.get("result") == 1) {
|
||||||
|
return makeRedirectUri(PageType.View, corpVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "error/bizError";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 치안대상 정보를 삭제하고 목록화면을 반환한다.
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param locale
|
||||||
|
* Locale 객체
|
||||||
|
* @param corpVO
|
||||||
|
* 치안대상 VO
|
||||||
|
* @return 치안대상 목록화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/delete.do", method = RequestMethod.POST)
|
||||||
|
public String delete(final Model model, final Locale locale, final CorpVO corpVO) throws Exception {
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
|
||||||
|
// 등록은 관리자만 가능하지만, 수정/삭제는 관리자 + 해당 기관도 가능하다.
|
||||||
|
if (loginUserVO.getIsAdmin()
|
||||||
|
|| loginUserVO.getPlace1().equalsIgnoreCase(corpVO.getPlace1())) {
|
||||||
|
CorpVO vo = corpService.select(corpVO);
|
||||||
|
|
||||||
|
HashMap<String, Object> result = corpService.delete(corpVO);
|
||||||
|
if ((Integer) result.get("result") == 1) {
|
||||||
|
return makeRedirectUri(PageType.List, vo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return makeRedirectUri(PageType.View, corpVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,435 @@
|
||||||
|
package kcg.faics.target.web;
|
||||||
|
|
||||||
|
import java.io.BufferedInputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import kcg.faics.cmmn.bbs.BaseBbsService;
|
||||||
|
import kcg.faics.cmmn.bbs.PageType;
|
||||||
|
import kcg.faics.cmmn.excel.ExcelExporter;
|
||||||
|
import kcg.faics.cmmn.file.FileResponser;
|
||||||
|
import kcg.faics.cmmn.service.CodeService;
|
||||||
|
import kcg.faics.cmmn.vo.CodeVO;
|
||||||
|
import kcg.faics.sec.LoginUserVO;
|
||||||
|
import kcg.faics.sec.UserUtil;
|
||||||
|
import kcg.faics.target.service.impl.DivMngServiceImpl;
|
||||||
|
import kcg.faics.target.vo.DivMngSearchVO;
|
||||||
|
import kcg.faics.target.vo.DivMngVO;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.MessageSource;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.util.FileCopyUtils;
|
||||||
|
import org.springframework.validation.BindingResult;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
import org.springframework.web.bind.support.SessionStatus;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springmodules.validation.commons.DefaultBeanValidator;
|
||||||
|
|
||||||
|
import egovframework.rte.fdl.property.EgovPropertyService;
|
||||||
|
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 컨트롤러.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/target/divmng")
|
||||||
|
public class DivMngController {
|
||||||
|
/**
|
||||||
|
* properties값을 가져오는 인터페이스.
|
||||||
|
**/
|
||||||
|
@Resource(name = "propertiesService")
|
||||||
|
private EgovPropertyService propertiesService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* message.properties의 값을 가져오는 인터페이스.
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private MessageSource messageSource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validator - 유효성 검사.
|
||||||
|
**/
|
||||||
|
@Resource(name = "beanValidator")
|
||||||
|
private DefaultBeanValidator beanValidator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 코드관련 정보 인터페이스.
|
||||||
|
*/
|
||||||
|
@Resource(name = "codeService")
|
||||||
|
private CodeService codeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 비지니스 로직 클래스.
|
||||||
|
*/
|
||||||
|
@Resource(name = "divMngService")
|
||||||
|
private BaseBbsService<DivMngSearchVO, DivMngVO> divMngService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Redirect URI를 조합하여 반환한다.
|
||||||
|
*
|
||||||
|
* @param pageType
|
||||||
|
* 화면구분
|
||||||
|
* @param vo
|
||||||
|
* 외사분실운영현황 VO
|
||||||
|
* @return Redirect URI
|
||||||
|
*/
|
||||||
|
private String makeRedirectUri(final PageType pageType, final DivMngVO vo) {
|
||||||
|
String uri = "redirect:/target/divmng";
|
||||||
|
|
||||||
|
switch (pageType) {
|
||||||
|
case View:
|
||||||
|
uri = String.format("%s/view.do?place=%s&no=%s", uri, vo.getPlace(), vo.getNo());
|
||||||
|
break;
|
||||||
|
case List:
|
||||||
|
uri = String.format("%s/list.do?place=%s", uri, vo.getPlace());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 정보 조회화면을 반환한다.
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param divMngVO
|
||||||
|
* 외사분실운영현황 VO
|
||||||
|
* @return 외사분실운영현황 정보 조회화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/view.do")
|
||||||
|
public String view(final Model model, final DivMngVO divMngVO) throws Exception {
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
model.addAttribute("loginUserVO", loginUserVO);
|
||||||
|
|
||||||
|
DivMngVO vo = divMngService.select(divMngVO);
|
||||||
|
model.addAttribute("divMngVO", vo);
|
||||||
|
|
||||||
|
return "/target/divMngView.tiles";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 목록화면을 반환한다.
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param locale
|
||||||
|
* Locale 객체
|
||||||
|
* @param searchVO
|
||||||
|
* 검색조건 VO
|
||||||
|
* @return 외사분실운영현황 목록화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/list.do")
|
||||||
|
public String list(final Model model, final Locale locale,
|
||||||
|
@ModelAttribute("searchVO") final DivMngSearchVO searchVO)
|
||||||
|
throws Exception {
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
model.addAttribute("loginUserVO", loginUserVO);
|
||||||
|
|
||||||
|
List<CodeVO> placeList = codeService.getPlace1List(false, true);
|
||||||
|
model.addAttribute("placeList", placeList);
|
||||||
|
|
||||||
|
List<DivMngVO> divMngList = divMngService.selectList(searchVO);
|
||||||
|
model.addAttribute("divMngList", divMngList);
|
||||||
|
|
||||||
|
return "/target/divMngList.tiles";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 목록을 엑셀로 반환한다.
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param locale
|
||||||
|
* Locale 객체
|
||||||
|
* @param searchVO
|
||||||
|
* 검색조건 VO
|
||||||
|
* @return 외사분실운영현황 목록 엑셀
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/listtoexcel.do")
|
||||||
|
public String listToExcel(final Model model, final Locale locale,
|
||||||
|
@ModelAttribute("searchVO") final DivMngSearchVO searchVO)
|
||||||
|
throws Exception {
|
||||||
|
String title = messageSource.getMessage("target.divmng", null, locale);
|
||||||
|
|
||||||
|
// 엑셀 헤더 생성
|
||||||
|
LinkedHashMap<String, String> header = new LinkedHashMap<String, String>();
|
||||||
|
header.put("placeStr", messageSource.getMessage("target.divmng.place", null, locale));
|
||||||
|
header.put("local", messageSource.getMessage("target.divmng.local", null, locale));
|
||||||
|
header.put("gubunStr", messageSource.getMessage("target.divmng.gubun", null, locale));
|
||||||
|
header.put("staffNum", messageSource.getMessage("target.divmng.staffNum", null, locale));
|
||||||
|
header.put("tel", messageSource.getMessage("target.divmng.tel", null, locale));
|
||||||
|
|
||||||
|
// 데이터 생성
|
||||||
|
List<DivMngVO> divMngList = divMngService.selectList(searchVO);
|
||||||
|
|
||||||
|
// Export
|
||||||
|
model.addAttribute("excel", new ExcelExporter<DivMngVO>(header, divMngList, title));
|
||||||
|
model.addAttribute("filename", title);
|
||||||
|
|
||||||
|
return "excelView";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 입력화면을 반환한다.
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param divMngVO
|
||||||
|
* 외사분실운영현황 VO
|
||||||
|
* @return 외사분실운영현황 입력화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/add.do")
|
||||||
|
public String add(final Model model, final DivMngVO divMngVO)
|
||||||
|
throws Exception {
|
||||||
|
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||||
|
|
||||||
|
if (isAuthenticated && UserUtil.isAdmin()) {
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
model.addAttribute("loginUserVO", loginUserVO);
|
||||||
|
model.addAttribute("registerFlag", "create");
|
||||||
|
|
||||||
|
List<CodeVO> placeList = codeService.getPlace1List(false, false);
|
||||||
|
model.addAttribute("placeList", placeList);
|
||||||
|
|
||||||
|
divMngVO.setWriter(loginUserVO.getUserid());
|
||||||
|
divMngVO.setPlace(loginUserVO.getPlace1());
|
||||||
|
divMngVO.setPlaceStr(loginUserVO.getPlace1Str());
|
||||||
|
|
||||||
|
return "/target/divMngAdd.tiles";
|
||||||
|
} else {
|
||||||
|
return makeRedirectUri(PageType.List, divMngVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 정보를 입력한다.
|
||||||
|
*
|
||||||
|
* @param divMngVO
|
||||||
|
* 외사분실운영현황 VO
|
||||||
|
* @param bindingResult
|
||||||
|
* BindingResult 객체
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param status
|
||||||
|
* SessionStatus 객체
|
||||||
|
* @param multiRequest
|
||||||
|
* MultipartHttpServletRequest 객체
|
||||||
|
* @return 외사분실운영현황 정보 조회화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/add.do", method = RequestMethod.POST)
|
||||||
|
public String add(@ModelAttribute("divMngVO") final DivMngVO divMngVO,
|
||||||
|
final BindingResult bindingResult, final Model model,
|
||||||
|
final SessionStatus status,
|
||||||
|
final MultipartHttpServletRequest multiRequest) throws Exception {
|
||||||
|
// 사용자 인증 검사
|
||||||
|
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||||
|
if (isAuthenticated && UserUtil.isAdmin()) {
|
||||||
|
// 유효성 검사
|
||||||
|
beanValidator.validate(divMngVO, bindingResult);
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
return add(model, divMngVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
final Map<String, MultipartFile> fileMap = multiRequest.getFileMap();
|
||||||
|
HashMap<String, Object> resultMap = divMngService.insert(divMngVO, fileMap);
|
||||||
|
|
||||||
|
if ((Integer) resultMap.get("result") == 1) {
|
||||||
|
status.setComplete();
|
||||||
|
return makeRedirectUri(PageType.View, divMngVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "error/bizError";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 수정화면을 반환한다.
|
||||||
|
*
|
||||||
|
* @param divMngVO
|
||||||
|
* 외사분실운영현황 VO
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @return 외사분실운영현황 수정화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/update.do")
|
||||||
|
public String update(final DivMngVO divMngVO, final Model model) throws Exception {
|
||||||
|
if (UserUtil.isAdmin()) {
|
||||||
|
model.addAttribute("registerFlag", "modify");
|
||||||
|
|
||||||
|
DivMngVO vo = divMngService.select(divMngVO);
|
||||||
|
model.addAttribute("divMngVO", vo);
|
||||||
|
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
model.addAttribute("loginUserVO", loginUserVO);
|
||||||
|
|
||||||
|
return "/target/divMngAdd.tiles";
|
||||||
|
}
|
||||||
|
|
||||||
|
return makeRedirectUri(PageType.View, divMngVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 정보를 수정한다.
|
||||||
|
*
|
||||||
|
* @param divMngVO
|
||||||
|
* 외사분실운영현황 VO
|
||||||
|
* @param bindingResult
|
||||||
|
* BindingResult 객체
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param status
|
||||||
|
* SessionStatus 객체
|
||||||
|
* @param multiRequest
|
||||||
|
* MultipartHttpServletRequest 객체
|
||||||
|
* @return 외사분실운영현황 조회화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/update.do", method = RequestMethod.POST)
|
||||||
|
public String update(@ModelAttribute("divMngVO") final DivMngVO divMngVO,
|
||||||
|
final BindingResult bindingResult, final Model model,
|
||||||
|
final SessionStatus status,
|
||||||
|
final MultipartHttpServletRequest multiRequest) throws Exception {
|
||||||
|
// 사용자 인증 검사
|
||||||
|
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||||
|
if (isAuthenticated && UserUtil.isAdmin()) {
|
||||||
|
// 유효성 검사
|
||||||
|
beanValidator.validate(divMngVO, bindingResult);
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
return update(divMngVO, model);
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] deleteFiles = multiRequest.getParameterValues("deleteFile");
|
||||||
|
final Map<String, MultipartFile> fileMap = multiRequest.getFileMap();
|
||||||
|
HashMap<String, Object> resultMap = divMngService.update(divMngVO, fileMap, deleteFiles);
|
||||||
|
|
||||||
|
if ((Integer) resultMap.get("result") > 0) {
|
||||||
|
status.setComplete();
|
||||||
|
return makeRedirectUri(PageType.View, divMngVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return update(divMngVO, model);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사분실운영현황 정보를 삭제한다.
|
||||||
|
*
|
||||||
|
* @param divMngVO
|
||||||
|
* 외사분실운영현황 VO
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param status
|
||||||
|
* SessionStatus 객체
|
||||||
|
* @return 외사분실운영현황 목록화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/delete.do", method = RequestMethod.POST)
|
||||||
|
public String delete(final DivMngVO divMngVO, final Model model,
|
||||||
|
final SessionStatus status) throws Exception {
|
||||||
|
|
||||||
|
if (UserUtil.isAdmin()) {
|
||||||
|
DivMngVO vo = divMngService.select(divMngVO);
|
||||||
|
if (vo != null) {
|
||||||
|
HashMap<String, Object> map = divMngService.delete(vo);
|
||||||
|
if ((Integer) map.get("result") > 0) {
|
||||||
|
return makeRedirectUri(PageType.List, vo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return makeRedirectUri(PageType.View, divMngVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 파일을 반환한다.
|
||||||
|
*
|
||||||
|
* @param divMngVO
|
||||||
|
* 외사분실운영현황 VO
|
||||||
|
* @param fileId
|
||||||
|
* 파일ID
|
||||||
|
* @param request
|
||||||
|
* HttpServletRequest 객체
|
||||||
|
* @param response
|
||||||
|
* HttpServletResponse 객체
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/download.do")
|
||||||
|
public void fileResponse(final DivMngVO divMngVO, final String fileId,
|
||||||
|
final HttpServletRequest request, final HttpServletResponse response)
|
||||||
|
throws Exception {
|
||||||
|
DivMngVO vo = divMngService.select(divMngVO);
|
||||||
|
String filename = "";
|
||||||
|
if ("fileImg".equals(fileId)) {
|
||||||
|
filename = vo.getFileImg();
|
||||||
|
} else if ("file1".equals(fileId)) {
|
||||||
|
filename = vo.getFile1();
|
||||||
|
} else if ("file2".equals(fileId)) {
|
||||||
|
filename = vo.getFile2();
|
||||||
|
} else if ("file3".equals(fileId)) {
|
||||||
|
filename = vo.getFile3();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(filename)) {
|
||||||
|
String fileFullPath = propertiesService
|
||||||
|
.getString(DivMngServiceImpl.FILE_PATH_KEYWORD) + filename;
|
||||||
|
File file = new File(fileFullPath);
|
||||||
|
if (file.exists()) {
|
||||||
|
FileResponser.setResponse(file, filename, request, response);
|
||||||
|
BufferedInputStream in = null;
|
||||||
|
try {
|
||||||
|
in = new BufferedInputStream(new FileInputStream(file));
|
||||||
|
FileCopyUtils.copy(in, response.getOutputStream());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
if (in != null) {
|
||||||
|
try {
|
||||||
|
in.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
response.setStatus(HttpStatus.NOT_FOUND.value());
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,398 @@
|
||||||
|
package kcg.faics.target.web;
|
||||||
|
|
||||||
|
import java.io.BufferedInputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import kcg.faics.cmmn.bbs.BaseBbsService;
|
||||||
|
import kcg.faics.cmmn.bbs.PageType;
|
||||||
|
import kcg.faics.cmmn.file.FileResponser;
|
||||||
|
import kcg.faics.cmmn.service.CodeService;
|
||||||
|
import kcg.faics.sec.LoginUserVO;
|
||||||
|
import kcg.faics.sec.UserUtil;
|
||||||
|
import kcg.faics.target.FerryRouteType;
|
||||||
|
import kcg.faics.target.FerryRunTermType;
|
||||||
|
import kcg.faics.target.service.impl.FerryServiceImpl;
|
||||||
|
import kcg.faics.target.vo.FerrySearchVO;
|
||||||
|
import kcg.faics.target.vo.FerryVO;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.MessageSource;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.util.FileCopyUtils;
|
||||||
|
import org.springframework.validation.BindingResult;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
import org.springframework.web.bind.support.SessionStatus;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springmodules.validation.commons.DefaultBeanValidator;
|
||||||
|
|
||||||
|
import egovframework.rte.fdl.property.EgovPropertyService;
|
||||||
|
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 컨트롤러.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/target/ferry")
|
||||||
|
public class FerryController {
|
||||||
|
/**
|
||||||
|
* properties값을 가져오는 인터페이스.
|
||||||
|
**/
|
||||||
|
@Resource(name = "propertiesService")
|
||||||
|
private EgovPropertyService propertiesService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* message.properties의 값을 가져오는 인터페이스.
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private MessageSource messageSource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validator - 유효성 검사.
|
||||||
|
**/
|
||||||
|
@Resource(name = "beanValidator")
|
||||||
|
private DefaultBeanValidator beanValidator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 코드관련 정보 인터페이스.
|
||||||
|
*/
|
||||||
|
@Resource(name = "codeService")
|
||||||
|
private CodeService codeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 비지니스 로직 클래스.
|
||||||
|
*/
|
||||||
|
@Resource(name = "ferryService")
|
||||||
|
private BaseBbsService<FerrySearchVO, FerryVO> ferryService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Redirect URI를 조합하여 반환한다.
|
||||||
|
*
|
||||||
|
* @param pageType
|
||||||
|
* 화면구분
|
||||||
|
* @param vo
|
||||||
|
* 국제여객선 VO
|
||||||
|
* @return Redirect URI
|
||||||
|
*/
|
||||||
|
private String makeRedirectUri(final PageType pageType, final FerryVO vo) {
|
||||||
|
String uri = "redirect:/target/ferry";
|
||||||
|
|
||||||
|
switch (pageType) {
|
||||||
|
case View:
|
||||||
|
uri = String.format("%s/view.do?serNo=%s", uri, vo.getSerNo());
|
||||||
|
break;
|
||||||
|
case List:
|
||||||
|
uri = String.format("%s/list.do?route=%s", uri, vo.getFerryRoute());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 정보 조회화면을 반환한다.
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param ferryVO
|
||||||
|
* 국제여객선 VO
|
||||||
|
* @return 국제여객선 정보 조회화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/view.do")
|
||||||
|
public String view(final Model model, final FerryVO ferryVO) throws Exception {
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
model.addAttribute("loginUserVO", loginUserVO);
|
||||||
|
|
||||||
|
FerryVO vo = ferryService.select(ferryVO);
|
||||||
|
model.addAttribute("ferryVO", vo);
|
||||||
|
|
||||||
|
return "/target/ferryView.tiles";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 목록화면을 반환한다.
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param locale
|
||||||
|
* Locale 객체
|
||||||
|
* @param searchVO
|
||||||
|
* 검색조건 VO
|
||||||
|
* @return 국제여객선 목록화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/list.do")
|
||||||
|
public String list(final Model model, final Locale locale,
|
||||||
|
@ModelAttribute("searchVO") final FerrySearchVO searchVO)
|
||||||
|
throws Exception {
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
model.addAttribute("loginUserVO", loginUserVO);
|
||||||
|
|
||||||
|
List<FerryRouteType> routeList = Arrays.asList(FerryRouteType.values());
|
||||||
|
model.addAttribute("routeList", routeList);
|
||||||
|
|
||||||
|
if (StringUtils.isBlank(searchVO.getFerryRoute())) {
|
||||||
|
searchVO.setFerryRoute(FerryRouteType.KR_CH.getCode());
|
||||||
|
}
|
||||||
|
List<FerryVO> ferryList = ferryService.selectList(searchVO);
|
||||||
|
model.addAttribute("ferryList", ferryList);
|
||||||
|
|
||||||
|
return "/target/ferryList.tiles";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 입력화면을 반환한다.
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param ferryVO
|
||||||
|
* 국제여객선 VO
|
||||||
|
* @return 국제여객선 입력화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/add.do")
|
||||||
|
public String add(final Model model, final FerryVO ferryVO)
|
||||||
|
throws Exception {
|
||||||
|
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||||
|
|
||||||
|
if (isAuthenticated && UserUtil.isAdmin()) {
|
||||||
|
model.addAttribute("registerFlag", "create");
|
||||||
|
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
model.addAttribute("loginUserVO", loginUserVO);
|
||||||
|
|
||||||
|
List<FerryRouteType> routeList = FerryRouteType.values(FerryRouteType.KP);
|
||||||
|
model.addAttribute("routeList", routeList);
|
||||||
|
|
||||||
|
List<FerryRunTermType> runTermList = Arrays.asList(FerryRunTermType.values());
|
||||||
|
model.addAttribute("runTermList", runTermList);
|
||||||
|
|
||||||
|
ferryVO.setWriter(loginUserVO.getUserid());
|
||||||
|
|
||||||
|
return "/target/ferryAdd.tiles";
|
||||||
|
} else {
|
||||||
|
return makeRedirectUri(PageType.List, ferryVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 정보를 입력한다.
|
||||||
|
*
|
||||||
|
* @param ferryVO
|
||||||
|
* 국제여객선 VO
|
||||||
|
* @param bindingResult
|
||||||
|
* BindingResult 객체
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param status
|
||||||
|
* SessionStatus 객체
|
||||||
|
* @param multiRequest
|
||||||
|
* MultipartHttpServletRequest 객체
|
||||||
|
* @return 국제여객선 정보 조회화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/add.do", method = RequestMethod.POST)
|
||||||
|
public String add(@ModelAttribute("ferryVO") final FerryVO ferryVO,
|
||||||
|
final BindingResult bindingResult, final Model model,
|
||||||
|
final SessionStatus status,
|
||||||
|
final MultipartHttpServletRequest multiRequest) throws Exception {
|
||||||
|
// 사용자 인증 검사
|
||||||
|
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||||
|
if (isAuthenticated && UserUtil.isAdmin()) {
|
||||||
|
// 유효성 검사
|
||||||
|
beanValidator.validate(ferryVO, bindingResult);
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
return add(model, ferryVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
final Map<String, MultipartFile> fileMap = multiRequest.getFileMap();
|
||||||
|
HashMap<String, Object> resultMap = ferryService.insert(ferryVO, fileMap);
|
||||||
|
|
||||||
|
if ((Integer) resultMap.get("result") == 1) {
|
||||||
|
status.setComplete();
|
||||||
|
return makeRedirectUri(PageType.View, ferryVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "error/bizError";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 수정화면을 반환한다.
|
||||||
|
*
|
||||||
|
* @param ferryVO
|
||||||
|
* 국제여객선 VO
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @return 국제여객선 수정화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/update.do")
|
||||||
|
public String update(final FerryVO ferryVO, final Model model) throws Exception {
|
||||||
|
if (UserUtil.isAdmin()) {
|
||||||
|
model.addAttribute("registerFlag", "modify");
|
||||||
|
|
||||||
|
FerryVO vo = ferryService.select(ferryVO);
|
||||||
|
model.addAttribute("ferryVO", vo);
|
||||||
|
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
model.addAttribute("loginUserVO", loginUserVO);
|
||||||
|
|
||||||
|
List<FerryRouteType> routeList = FerryRouteType.values(FerryRouteType.KP);
|
||||||
|
model.addAttribute("routeList", routeList);
|
||||||
|
|
||||||
|
List<FerryRunTermType> runTermList = Arrays.asList(FerryRunTermType.values());
|
||||||
|
model.addAttribute("runTermList", runTermList);
|
||||||
|
|
||||||
|
return "/target/ferryAdd.tiles";
|
||||||
|
}
|
||||||
|
|
||||||
|
return makeRedirectUri(PageType.View, ferryVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 정보를 수정한다.
|
||||||
|
*
|
||||||
|
* @param ferryVO
|
||||||
|
* 국제여객선 VO
|
||||||
|
* @param bindingResult
|
||||||
|
* BindingResult 객체
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param status
|
||||||
|
* SessionStatus 객체
|
||||||
|
* @param multiRequest
|
||||||
|
* MultipartHttpServletRequest 객체
|
||||||
|
* @return 국제여객선 조회화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/update.do", method = RequestMethod.POST)
|
||||||
|
public String update(@ModelAttribute("ferryVO") final FerryVO ferryVO,
|
||||||
|
final BindingResult bindingResult, final Model model,
|
||||||
|
final SessionStatus status,
|
||||||
|
final MultipartHttpServletRequest multiRequest) throws Exception {
|
||||||
|
// 사용자 인증 검사
|
||||||
|
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||||
|
if (isAuthenticated && UserUtil.isAdmin()) {
|
||||||
|
// 유효성 검사
|
||||||
|
beanValidator.validate(ferryVO, bindingResult);
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
return update(ferryVO, model);
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] deleteFiles = multiRequest.getParameterValues("deleteFile");
|
||||||
|
final Map<String, MultipartFile> fileMap = multiRequest.getFileMap();
|
||||||
|
HashMap<String, Object> resultMap = ferryService.update(ferryVO, fileMap, deleteFiles);
|
||||||
|
|
||||||
|
if ((Integer) resultMap.get("result") > 0) {
|
||||||
|
status.setComplete();
|
||||||
|
return makeRedirectUri(PageType.View, ferryVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return update(ferryVO, model);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 국제여객선 정보를 삭제한다.
|
||||||
|
*
|
||||||
|
* @param ferryVO
|
||||||
|
* 국제여객선 VO
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param status
|
||||||
|
* SessionStatus 객체
|
||||||
|
* @return 국제여객선 목록화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/delete.do", method = RequestMethod.POST)
|
||||||
|
public String delete(final FerryVO ferryVO, final Model model,
|
||||||
|
final SessionStatus status) throws Exception {
|
||||||
|
|
||||||
|
if (UserUtil.isAdmin()) {
|
||||||
|
FerryVO vo = ferryService.select(ferryVO);
|
||||||
|
if (vo != null) {
|
||||||
|
HashMap<String, Object> map = ferryService.delete(vo);
|
||||||
|
if ((Integer) map.get("result") > 0) {
|
||||||
|
return makeRedirectUri(PageType.List, vo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return makeRedirectUri(PageType.View, ferryVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 파일을 반환한다.
|
||||||
|
*
|
||||||
|
* @param ferryVO
|
||||||
|
* 국제여객선 VO
|
||||||
|
* @param request
|
||||||
|
* HttpServletRequest 객체
|
||||||
|
* @param response
|
||||||
|
* HttpServletResponse 객체
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/download.do")
|
||||||
|
public void fileResponse(final FerryVO ferryVO,
|
||||||
|
final HttpServletRequest request, final HttpServletResponse response)
|
||||||
|
throws Exception {
|
||||||
|
FerryVO vo = ferryService.select(ferryVO);
|
||||||
|
String filename = vo.getImgFile();
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(filename)) {
|
||||||
|
String fileFullPath = propertiesService
|
||||||
|
.getString(FerryServiceImpl.FILE_PATH_KEYWORD) + filename;
|
||||||
|
File file = new File(fileFullPath);
|
||||||
|
if (file.exists()) {
|
||||||
|
FileResponser.setResponse(file, filename, request, response);
|
||||||
|
BufferedInputStream in = null;
|
||||||
|
try {
|
||||||
|
in = new BufferedInputStream(new FileInputStream(file));
|
||||||
|
FileCopyUtils.copy(in, response.getOutputStream());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
if (in != null) {
|
||||||
|
try {
|
||||||
|
in.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
response.setStatus(HttpStatus.NOT_FOUND.value());
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,418 @@
|
||||||
|
package kcg.faics.target.web;
|
||||||
|
|
||||||
|
import java.io.BufferedInputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
import kcg.faics.cmmn.file.FileResponser;
|
||||||
|
import kcg.faics.cmmn.service.CodeService;
|
||||||
|
import kcg.faics.cmmn.vo.CodeVO;
|
||||||
|
import kcg.faics.sec.LoginUserVO;
|
||||||
|
import kcg.faics.sec.UserUtil;
|
||||||
|
import kcg.faics.target.service.WeakPlaceService;
|
||||||
|
import kcg.faics.target.vo.WeakPlaceSearchVO;
|
||||||
|
import kcg.faics.target.vo.WeakPlaceVO;
|
||||||
|
|
||||||
|
import org.apache.commons.io.FilenameUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.MessageSource;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.util.FileCopyUtils;
|
||||||
|
import org.springframework.validation.BindingResult;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
import org.springframework.web.bind.support.SessionStatus;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springmodules.validation.commons.DefaultBeanValidator;
|
||||||
|
|
||||||
|
import egovframework.rte.fdl.property.EgovPropertyService;
|
||||||
|
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 컨트롤러.
|
||||||
|
*
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/target/weakplace")
|
||||||
|
public class WeakPlaceController {
|
||||||
|
/**
|
||||||
|
* properties값을 가져오는 인터페이스.
|
||||||
|
**/
|
||||||
|
@Resource(name = "propertiesService")
|
||||||
|
private EgovPropertyService propertiesService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* message.properties의 값을 가져오는 인터페이스.
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private MessageSource messageSource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 코드관련 정보 인터페이스.
|
||||||
|
*/
|
||||||
|
@Resource(name = "codeService")
|
||||||
|
private CodeService codeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validator - 유효성 검사.
|
||||||
|
**/
|
||||||
|
@Resource(name = "beanValidator")
|
||||||
|
private DefaultBeanValidator beanValidator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 비지니스 로직 클래스.
|
||||||
|
*/
|
||||||
|
@Resource(name = "weakPlaceService")
|
||||||
|
private WeakPlaceService weakPlaceService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 조회 화면을 반환한다.
|
||||||
|
*
|
||||||
|
* @param vo
|
||||||
|
* 검색할 외사취약지 VO
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @return 외사취약지 조회 화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/view.do")
|
||||||
|
public String view(final WeakPlaceVO vo, final ModelMap model)
|
||||||
|
throws Exception {
|
||||||
|
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
model.addAttribute("loginUserVO", loginUserVO);
|
||||||
|
|
||||||
|
WeakPlaceVO weakPlaceVO = weakPlaceService.select(vo);
|
||||||
|
model.addAttribute("weakPlaceVO", weakPlaceVO);
|
||||||
|
|
||||||
|
String filename1Ext = "";
|
||||||
|
String filename1 = weakPlaceVO.getFilename1();
|
||||||
|
if (!StringUtils.isBlank(filename1)) {
|
||||||
|
filename1Ext = FilenameUtils.getExtension(filename1).toLowerCase();
|
||||||
|
}
|
||||||
|
model.addAttribute("filename1Ext", filename1Ext);
|
||||||
|
|
||||||
|
return "/target/weakPlaceView.tiles";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 목록 화면을 반환한다.
|
||||||
|
*
|
||||||
|
* @param searchVO
|
||||||
|
* 검색정보 VO
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @return 외사취약지 목록화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/list.do")
|
||||||
|
public String list(@ModelAttribute("searchVO") final WeakPlaceSearchVO searchVO,
|
||||||
|
final ModelMap model) throws Exception {
|
||||||
|
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
model.addAttribute("loginUserVO", loginUserVO);
|
||||||
|
|
||||||
|
List<CodeVO> placeList = codeService.getPlace1List(CodeService.POLICE_STATION_LIST);
|
||||||
|
model.addAttribute("placeList", placeList);
|
||||||
|
|
||||||
|
List<HashMap<String, Object>> statsPerPlace = weakPlaceService.selectStatsPerPlace();
|
||||||
|
model.addAttribute("statsPerPlace", statsPerPlace);
|
||||||
|
|
||||||
|
List<WeakPlaceVO> weakPlaceList = weakPlaceService.selectList(searchVO);
|
||||||
|
model.addAttribute("weakPlaceList", weakPlaceList);
|
||||||
|
|
||||||
|
Date today = new Date();
|
||||||
|
SimpleDateFormat simpleDate = new SimpleDateFormat("yyyy. MM. dd.");
|
||||||
|
String todayStr = simpleDate.format(today);
|
||||||
|
model.addAttribute("today", todayStr);
|
||||||
|
|
||||||
|
|
||||||
|
return "/target/weakPlaceList.tiles";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 입력화면을 반환한다.
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param weakPlaceVO
|
||||||
|
* 입력할 외사취약지 VO
|
||||||
|
* @return 외사취약지 입력화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본예외처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/add.do")
|
||||||
|
public String add(final Model model, final WeakPlaceVO weakPlaceVO) throws Exception {
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
WeakPlaceVO vo;
|
||||||
|
if (weakPlaceVO == null) {
|
||||||
|
vo = new WeakPlaceVO();
|
||||||
|
} else {
|
||||||
|
vo = weakPlaceVO;
|
||||||
|
}
|
||||||
|
vo.setWriter(loginUserVO.getUserid());
|
||||||
|
vo.setPlace1(loginUserVO.getPlace1());
|
||||||
|
vo.setPlace1str(loginUserVO.getPlace1Str());
|
||||||
|
|
||||||
|
List<CodeVO> placeList = codeService.getPlace1List(CodeService.POLICE_STATION_LIST);
|
||||||
|
|
||||||
|
int tempWpNo = 0;
|
||||||
|
String tempPlace1Code = "";
|
||||||
|
HashMap<String, Integer> wpNoMap = new HashMap<String, Integer>();
|
||||||
|
for (int i = 0; i < CodeService.POLICE_STATION_LIST.length; i++) {
|
||||||
|
tempWpNo = 0;
|
||||||
|
tempPlace1Code = CodeService.POLICE_STATION_LIST[i];
|
||||||
|
tempWpNo = weakPlaceService.selectMaxWpNo(tempPlace1Code);
|
||||||
|
wpNoMap.put(tempPlace1Code, ++tempWpNo);
|
||||||
|
|
||||||
|
// 중앙부처 사용자는 placeList의 첫번째 기관의 wpno 값을 기본으로 한다.
|
||||||
|
if ("PS00".equalsIgnoreCase(vo.getPlace1())
|
||||||
|
&& tempPlace1Code.equalsIgnoreCase(placeList.get(0).getCode2())) {
|
||||||
|
vo.setWpNo(tempWpNo);
|
||||||
|
} else if (tempPlace1Code.equalsIgnoreCase(vo.getPlace1())) {
|
||||||
|
vo.setWpNo(tempWpNo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
model.addAttribute("wpNoMap", wpNoMap);
|
||||||
|
|
||||||
|
model.addAttribute("placeList", placeList);
|
||||||
|
model.addAttribute("weakPlaceVO", vo);
|
||||||
|
model.addAttribute("loginUserVO", "loginUserVO");
|
||||||
|
model.addAttribute("registerFlag", "create");
|
||||||
|
|
||||||
|
return "/target/weakPlaceAdd.tiles";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 정보를 입력한다.
|
||||||
|
*
|
||||||
|
* @param multiRequest
|
||||||
|
* mutipartform 객체
|
||||||
|
* @param weakPlaceVO
|
||||||
|
* 외사취약지 VO
|
||||||
|
* @param bindingResult
|
||||||
|
* 유효성 검사결과 객체
|
||||||
|
* @param model
|
||||||
|
* 모델 객체
|
||||||
|
* @param status
|
||||||
|
* SessionStatus 객체
|
||||||
|
* @return 외사취약지 조회 화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/add.do", method = RequestMethod.POST)
|
||||||
|
public String add(final MultipartHttpServletRequest multiRequest,
|
||||||
|
@Valid @ModelAttribute("weakPlaceVO") final WeakPlaceVO weakPlaceVO,
|
||||||
|
final BindingResult bindingResult, final Model model,
|
||||||
|
final SessionStatus status) throws Exception {
|
||||||
|
// 사용자 인증 검사
|
||||||
|
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||||
|
if (isAuthenticated) {
|
||||||
|
// 유효성 검사
|
||||||
|
beanValidator.validate(weakPlaceVO, bindingResult);
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
model.addAttribute("weakPlaceVO", weakPlaceVO);
|
||||||
|
model.addAttribute("registerFlag", "create");
|
||||||
|
return "target/weakPlaceAdd.tiles";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 파일 저장 및 데이터 입력
|
||||||
|
final Map<String, MultipartFile> fileMap = multiRequest.getFileMap();
|
||||||
|
HashMap<String, Object> map = weakPlaceService.insert(weakPlaceVO, fileMap);
|
||||||
|
|
||||||
|
status.setComplete();
|
||||||
|
|
||||||
|
if ((Integer) map.get("result") == 1) {
|
||||||
|
return String.format("redirect:/target/weakplace/view.do?place1=%s&wpNo=%s", map.get("place1"), map.get("wpNo"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "error/bizError";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 수정화면을 반환한다.
|
||||||
|
*
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param weakPlaceVO
|
||||||
|
* 외사취약지 VO
|
||||||
|
* @return 외사취약지 수정화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본예외처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/update.do", method = RequestMethod.GET)
|
||||||
|
public String update(final Model model, final WeakPlaceVO weakPlaceVO) throws Exception {
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
|
||||||
|
// 관리자만 수정 가능
|
||||||
|
if (loginUserVO.getAuthAdmin() == 1) {
|
||||||
|
WeakPlaceVO vo = weakPlaceService.select(weakPlaceVO);
|
||||||
|
model.addAttribute("weakPlaceVO", vo);
|
||||||
|
model.addAttribute("loginUserVO", loginUserVO);
|
||||||
|
model.addAttribute("registerFlag", "modify");
|
||||||
|
|
||||||
|
return "/target/weakPlaceAdd.tiles";
|
||||||
|
}
|
||||||
|
|
||||||
|
return "redirect:/target/weakplace/view.do?place1="
|
||||||
|
+ weakPlaceVO.getPlace1() + "&wpNo=" + weakPlaceVO.getWpNo();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 정보를 수정한다.
|
||||||
|
*
|
||||||
|
* @param multiRequest
|
||||||
|
* mutipartform 객체
|
||||||
|
* @param weakPlaceVO
|
||||||
|
* 외사취약지 VO
|
||||||
|
* @param bindingResult
|
||||||
|
* 유효성 검사결과 객체
|
||||||
|
* @param model
|
||||||
|
* 모델 객체
|
||||||
|
* @param status
|
||||||
|
* SessionStatus 객체
|
||||||
|
* @return 외사취약지 조회 화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/update.do", method = RequestMethod.POST)
|
||||||
|
public String update(final MultipartHttpServletRequest multiRequest,
|
||||||
|
@Valid @ModelAttribute("weakPlaceVO") final WeakPlaceVO weakPlaceVO,
|
||||||
|
final BindingResult bindingResult, final Model model,
|
||||||
|
final SessionStatus status) throws Exception {
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
|
||||||
|
// 관리자만 수정 가능
|
||||||
|
if (loginUserVO.getAuthAdmin() == 1) {
|
||||||
|
// 유효성 검사
|
||||||
|
beanValidator.validate(weakPlaceVO, bindingResult);
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
model.addAttribute("weakPlaceVO", weakPlaceVO);
|
||||||
|
model.addAttribute("registerFlag", "modify");
|
||||||
|
return "target/weakPlaceAdd.tiles";
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] deleteFiles = multiRequest.getParameterValues("deleteFile");
|
||||||
|
final Map<String, MultipartFile> fileMap = multiRequest.getFileMap();
|
||||||
|
HashMap<String, Object> map = weakPlaceService.update(weakPlaceVO, fileMap, deleteFiles);
|
||||||
|
|
||||||
|
status.setComplete();
|
||||||
|
|
||||||
|
if ((Integer) map.get("result") > 0) {
|
||||||
|
return "redirect:/target/weakplace/view.do?place1="
|
||||||
|
+ weakPlaceVO.getPlace1() + "&wpNo="
|
||||||
|
+ weakPlaceVO.getWpNo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "redirect:/target/weakplace/view.do?place1="
|
||||||
|
+ weakPlaceVO.getPlace1() + "&wpNo=" + weakPlaceVO.getWpNo();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 외사취약지 정보를 삭제한다.
|
||||||
|
*
|
||||||
|
* @param weakPlaceVO
|
||||||
|
* 외사취약지 VO
|
||||||
|
* @param model
|
||||||
|
* Model 객체
|
||||||
|
* @param status
|
||||||
|
* SessionStatus 객체
|
||||||
|
* @return 외사취약지 목록 화면
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/delete.do", method = RequestMethod.POST)
|
||||||
|
public String delete(final WeakPlaceVO weakPlaceVO, final Model model,
|
||||||
|
final SessionStatus status) throws Exception {
|
||||||
|
LoginUserVO loginUserVO = UserUtil.getMemberInfo();
|
||||||
|
|
||||||
|
// 관리자만 삭제 가능
|
||||||
|
if (loginUserVO.getAuthAdmin() == 1) {
|
||||||
|
WeakPlaceVO vo = weakPlaceService.select(weakPlaceVO);
|
||||||
|
if (vo != null) {
|
||||||
|
HashMap<String, Object> map = weakPlaceService.delete(weakPlaceVO);
|
||||||
|
if ((Integer) map.get("result") > 0) {
|
||||||
|
return "redirect:/target/weakplace/list.do";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "redirect:/susa/incident/view.do?place1="
|
||||||
|
+ weakPlaceVO.getPlace1() + "&wpNo=" + weakPlaceVO.getWpNo();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 파일을 반환한다.
|
||||||
|
*
|
||||||
|
* @param weakPlaceVO
|
||||||
|
* 외사취약지 VO
|
||||||
|
* @param seq
|
||||||
|
* 파일 인덱스
|
||||||
|
* @param request
|
||||||
|
* HttpServletRequest 객체
|
||||||
|
* @param response
|
||||||
|
* HttpServletResponse 객체
|
||||||
|
* @throws Exception
|
||||||
|
* 기본 예외 처리
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/download.do")
|
||||||
|
public void fileResponse(final WeakPlaceVO weakPlaceVO, final int seq,
|
||||||
|
final HttpServletRequest request, final HttpServletResponse response) throws Exception {
|
||||||
|
WeakPlaceVO vo = weakPlaceService.select(weakPlaceVO);
|
||||||
|
String filename = "";
|
||||||
|
if (seq == 1) {
|
||||||
|
filename = vo.getFilename1();
|
||||||
|
} else if (seq == 2) {
|
||||||
|
filename = vo.getFilename2();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(filename)) {
|
||||||
|
String fileFullPath = propertiesService.getString("Target.wp.fileStorePath") + filename;
|
||||||
|
File file = new File(fileFullPath);
|
||||||
|
if (file.exists()) {
|
||||||
|
FileResponser.setResponse(file, filename, request, response);
|
||||||
|
BufferedInputStream in = null;
|
||||||
|
try {
|
||||||
|
in = new BufferedInputStream(new FileInputStream(file));
|
||||||
|
FileCopyUtils.copy(in, response.getOutputStream());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
if (in != null) {
|
||||||
|
try {
|
||||||
|
in.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
response.setStatus(HttpStatus.NOT_FOUND.value());
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
/**
|
||||||
|
* 외사대상목표 컨트롤러 패키지.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @author kimnomin
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package kcg.faics.target.web;
|
||||||
|
|
@ -0,0 +1,171 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="Corp">
|
||||||
|
|
||||||
|
<resultMap id="corpResult" type="corpVO">
|
||||||
|
<result property="place1" column="PLACE1" />
|
||||||
|
<result property="place1str" column="CODENM" />
|
||||||
|
<result property="orgId" column="ORG_ID" />
|
||||||
|
<result property="orgNo" column="ORG_NO" />
|
||||||
|
<result property="grpNo" column="GRP_NO" />
|
||||||
|
<result property="name" column="NAME" />
|
||||||
|
<result property="location" column="LOCATION" />
|
||||||
|
<result property="ceo" column="CEO" />
|
||||||
|
<result property="jobType" column="JOBTYPE" />
|
||||||
|
<result property="tel" column="TEL" />
|
||||||
|
<result property="fax" column="FAX" />
|
||||||
|
<result property="comments" column="COMMENTS" />
|
||||||
|
<result property="partner" column="PARTNER" />
|
||||||
|
<result property="shipCnt" column="SHIPCNT" />
|
||||||
|
<result property="memberCnt" column="MEMBERCNT" />
|
||||||
|
<result property="basicYear" column="BASICYEAR" />
|
||||||
|
<result property="fund" column="FUND" />
|
||||||
|
<result property="writerPlace1" column="WRITER_PLACE1" />
|
||||||
|
<result property="writer" column="WRITER" />
|
||||||
|
<result property="credate" column="CREDATE" />
|
||||||
|
<result property="logdate" column="LOGDATE" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="select" parameterType="corpVO" resultMap="corpResult">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
CP.*, C.CODENM
|
||||||
|
FROM
|
||||||
|
TCORP CP, TCODE C
|
||||||
|
WHERE
|
||||||
|
C.CODE1 = 'C001'
|
||||||
|
AND CP.PLACE1 = C.CODE2
|
||||||
|
AND CP.PLACE1 = #{place1}
|
||||||
|
AND CP.ORG_ID = #{orgId}
|
||||||
|
AND CP.ORG_NO = #{orgNo}
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectList" parameterType="corpSearchVO" resultMap="corpResult">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
CP.*, C.CODENM
|
||||||
|
FROM
|
||||||
|
TCORP CP, TCODE C
|
||||||
|
WHERE
|
||||||
|
C.CODE1 = 'C001'
|
||||||
|
AND CP.PLACE1 = C.CODE2
|
||||||
|
AND CP.ORG_ID = #{orgId}
|
||||||
|
AND CP.GRP_NO = #{grpNo}
|
||||||
|
]]>
|
||||||
|
<if test="place1 != null and place1 != ''">
|
||||||
|
AND CP.PLACE1 = #{place1}
|
||||||
|
</if>
|
||||||
|
<if test="name != null and name != ''">
|
||||||
|
AND CP.NAME LIKE '%' || #{name} || '%'
|
||||||
|
</if>
|
||||||
|
<if test="jobType != null and jobType != ''">
|
||||||
|
AND CP.JOBTYPE = #{jobType}
|
||||||
|
</if>
|
||||||
|
<![CDATA[
|
||||||
|
ORDER BY
|
||||||
|
CP.PLACE1 ASC
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectStats" parameterType="hashmap" resultType="hashmap" >
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
COUNT(ORG_ID) AS TOT_CNT,
|
||||||
|
'00' AS ORG_ID,
|
||||||
|
'계' AS ORG_NM,
|
||||||
|
'00' AS GRP_NO,
|
||||||
|
]]>
|
||||||
|
<foreach collection="placeList" item="item" index="index" separator="," open="" close="">
|
||||||
|
SUM(CASE PLACE1 WHEN #{item} THEN 1 ELSE 0 END) AS ${item}_CNT
|
||||||
|
</foreach>
|
||||||
|
<![CDATA[
|
||||||
|
FROM TCORP
|
||||||
|
UNION
|
||||||
|
SELECT
|
||||||
|
COUNT(TP.ORG_ID) AS TOT_CNT,
|
||||||
|
SUBSTR(TD.CODE2,1,2) AS ORG_ID,
|
||||||
|
TD.CODENM AS ORG_NM,
|
||||||
|
SUBSTR(TD.CODE2,3,2) AS GRP_NO,
|
||||||
|
]]>
|
||||||
|
<foreach collection="placeList" item="item" index="index" separator="," open="" close="">
|
||||||
|
SUM(CASE PLACE1 WHEN #{item} THEN 1 ELSE 0 END) AS ${item}_CNT
|
||||||
|
</foreach>
|
||||||
|
<![CDATA[
|
||||||
|
FROM TCORP TP LEFT JOIN TCODE TD ON TP.ORG_ID = SUBSTR(TD.CODE2,1,2)
|
||||||
|
WHERE TD.CODE1 = 'CORP'
|
||||||
|
GROUP BY TP.ORG_ID, TD.CODENM, GRP_NO, TD.CODE2
|
||||||
|
ORDER BY ORG_ID ASC
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert" parameterType="corpVO">
|
||||||
|
<![CDATA[
|
||||||
|
INSERT INTO TCORP
|
||||||
|
(
|
||||||
|
PLACE1, ORG_ID, ORG_NO, GRP_NO, NAME,
|
||||||
|
LOCATION, CEO, JOBTYPE, TEL, FAX,
|
||||||
|
COMMENTS, PARTNER, SHIPCNT, MEMBERCNT, BASICYEAR,
|
||||||
|
FUND, WRITER_PLACE1, WRITER, CREDATE, LOGDATE
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
#{place1}, #{orgId}, #{orgNo}, #{grpNo}, #{name},
|
||||||
|
#{location}, #{ceo}, #{jobType}, #{tel}, #{fax},
|
||||||
|
#{comments}, #{partner}, #{shipCnt}, #{memberCnt}, #{basicYear},
|
||||||
|
#{fund}, #{writerPlace1}, #{writer}, TO_CHAR(NOW(), 'YYYYMMDDHH24MISS'), TO_CHAR(NOW(), 'YYYYMMDDHH24MISS')
|
||||||
|
)
|
||||||
|
]]>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="corpVO">
|
||||||
|
<![CDATA[
|
||||||
|
UPDATE
|
||||||
|
TCORP
|
||||||
|
SET
|
||||||
|
GRP_NO = #{grpNo},
|
||||||
|
NAME = #{name},
|
||||||
|
LOCATION = #{location},
|
||||||
|
CEO = #{ceo},
|
||||||
|
JOBTYPE = #{jobType},
|
||||||
|
TEL = #{tel},
|
||||||
|
FAX = #{fax},
|
||||||
|
COMMENTS = #{comments},
|
||||||
|
PARTNER = #{partner},
|
||||||
|
BASICYEAR = #{basicYear},
|
||||||
|
SHIPCNT = #{shipCnt},
|
||||||
|
MEMBERCNT = #{memberCnt},
|
||||||
|
FUND = #{fund},
|
||||||
|
WRITER = #{writer},
|
||||||
|
WRITER_PLACE1 = #{writerPlace1},
|
||||||
|
LOGDATE = TO_CHAR(NOW(), 'YYYYMMDDHH24MISS')
|
||||||
|
WHERE
|
||||||
|
PLACE1 = #{place1}
|
||||||
|
AND ORG_ID = #{orgId}
|
||||||
|
AND ORG_NO = #{orgNo}
|
||||||
|
]]>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="delete" parameterType="corpVO">
|
||||||
|
<![CDATA[
|
||||||
|
DELETE
|
||||||
|
FROM
|
||||||
|
TCORP
|
||||||
|
WHERE
|
||||||
|
PLACE1 = #{place1}
|
||||||
|
AND ORG_ID = #{orgId}
|
||||||
|
AND ORG_NO = #{orgNo}
|
||||||
|
]]>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectMaxOrgNo" parameterType="corpVO" resultType="int">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
MAX(ORG_NO)
|
||||||
|
FROM
|
||||||
|
TCORP
|
||||||
|
WHERE
|
||||||
|
ORG_ID = #{orgId}
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,119 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="DivMng">
|
||||||
|
|
||||||
|
<resultMap id="divMngResult" type="divMngVO">
|
||||||
|
<result property="place" column="DS_PLACE" />
|
||||||
|
<result property="placeStr" column="CODENM" />
|
||||||
|
<result property="no" column="DS_NO" />
|
||||||
|
<result property="local" column="DS_LOCAL" />
|
||||||
|
<result property="gubun" column="DS_GUBUN" />
|
||||||
|
<result property="staffNum" column="DS_STAFF_NUM" />
|
||||||
|
<result property="tel" column="DS_TEL" />
|
||||||
|
<result property="condition" column="DS_CONDITION" />
|
||||||
|
<result property="equipStat" column="DS_EQUIP_STAT" />
|
||||||
|
<result property="fileImg" column="DS_FILEIMG" />
|
||||||
|
<result property="file1" column="DS_FILE1" />
|
||||||
|
<result property="file2" column="DS_FILE2" />
|
||||||
|
<result property="file3" column="DS_FILE3" />
|
||||||
|
<result property="creDate" column="DS_CREDATE" />
|
||||||
|
<result property="logDate" column="DS_LOGDATE" />
|
||||||
|
<result property="writer" column="DS_WRITER" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="select" parameterType="divMngVO" resultMap="divMngResult">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
DS.*, C.CODENM
|
||||||
|
FROM
|
||||||
|
H3_DIVISION_MANAGE_STAT DS, TCODE C
|
||||||
|
WHERE
|
||||||
|
C.CODE1 = 'C001'
|
||||||
|
AND DS.DS_PLACE = C.CODE2
|
||||||
|
AND DS.DS_PLACE = #{place}
|
||||||
|
AND DS.DS_NO = #{no}
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectList" parameterType="divMngSearchVO" resultMap="divMngResult">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
DS.*, C.CODENM
|
||||||
|
FROM
|
||||||
|
H3_DIVISION_MANAGE_STAT DS, TCODE C
|
||||||
|
WHERE
|
||||||
|
C.CODE1 = 'C001'
|
||||||
|
AND DS.DS_PLACE = C.CODE2
|
||||||
|
|
||||||
|
]]>
|
||||||
|
<if test="place != null and place != ''">
|
||||||
|
AND DS.DS_PLACE = #{place}
|
||||||
|
</if>
|
||||||
|
<![CDATA[
|
||||||
|
ORDER BY
|
||||||
|
DS.DS_PLACE ASC,
|
||||||
|
DS.DS_NO ASC
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert" parameterType="divMngVO">
|
||||||
|
<![CDATA[
|
||||||
|
INSERT INTO H3_DIVISION_MANAGE_STAT
|
||||||
|
(
|
||||||
|
DS_PLACE, DS_NO, DS_LOCAL, DS_GUBUN, DS_STAFF_NUM,
|
||||||
|
DS_TEL, DS_CONDITION, DS_EQUIP_STAT, DS_FILEIMG, DS_FILE1,
|
||||||
|
DS_FILE2, DS_FILE3, DS_CREDATE, DS_WRITER
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
#{place}, #{no}, #{local}, #{gubun}, #{staffNum},
|
||||||
|
#{tel}, #{condition}, #{equipStat}, #{fileImg}, #{file1},
|
||||||
|
#{file2}, #{file3}, NOW(), #{writer}
|
||||||
|
)
|
||||||
|
]]>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="divMngVO">
|
||||||
|
<![CDATA[
|
||||||
|
UPDATE
|
||||||
|
H3_DIVISION_MANAGE_STAT
|
||||||
|
SET
|
||||||
|
DS_LOCAL = #{local},
|
||||||
|
DS_GUBUN = #{gubun},
|
||||||
|
DS_STAFF_NUM = #{staffNum},
|
||||||
|
DS_TEL = #{tel},
|
||||||
|
DS_CONDITION = #{condition},
|
||||||
|
DS_EQUIP_STAT = #{equipStat},
|
||||||
|
DS_FILEIMG = #{fileImg},
|
||||||
|
DS_FILE1 = #{file1},
|
||||||
|
DS_FILE2 = #{file2},
|
||||||
|
DS_FILE3 = #{file3},
|
||||||
|
DS_LOGDATE = NOW()
|
||||||
|
WHERE
|
||||||
|
DS_PLACE = #{place}
|
||||||
|
AND DS_NO = #{no}
|
||||||
|
]]>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="delete" parameterType="divMngVO">
|
||||||
|
<![CDATA[
|
||||||
|
DELETE
|
||||||
|
FROM
|
||||||
|
H3_DIVISION_MANAGE_STAT
|
||||||
|
WHERE
|
||||||
|
DS_PLACE = #{place}
|
||||||
|
AND DS_NO = #{no}
|
||||||
|
]]>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectMaxNo" parameterType="divMngVO" resultType="int">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
MAX(DS_NO)
|
||||||
|
FROM
|
||||||
|
H3_DIVISION_MANAGE_STAT
|
||||||
|
WHERE
|
||||||
|
DS_PLACE = #{place}
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,124 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="Ferry">
|
||||||
|
|
||||||
|
<resultMap id="ferryResult" type="ferryVO">
|
||||||
|
<result property="serNo" column="SER_NO" />
|
||||||
|
<result property="ferryOffice" column="FERRYOFFICE" />
|
||||||
|
<result property="ferryName" column="FERRYNAME" />
|
||||||
|
<result property="ferryTon" column="FERRYTON" />
|
||||||
|
<result property="ferryRoute" column="FERRYROUTE" />
|
||||||
|
<result property="ferryTime" column="FERRYTIME" />
|
||||||
|
<result property="ferrySpeedMax" column="FERRYSPEEDMAX" />
|
||||||
|
<result property="ferrySpeedNor" column="FERRYSPEEDNOR" />
|
||||||
|
<result property="ferryGuestCnt" column="FERRYGUESTCNT" />
|
||||||
|
<result property="ferryClueCnt" column="FERRYCLUECNT" />
|
||||||
|
<result property="runTerm" column="RUNTERM" />
|
||||||
|
<result property="runCnt" column="RUNCNT" />
|
||||||
|
<result property="repreName" column="REPRENAME" />
|
||||||
|
<result property="tel" column="TEL" />
|
||||||
|
<result property="ferrySosok" column="FERRYSOSOK" />
|
||||||
|
<result property="sailingDistance" column="SAILINGDISTANCE" />
|
||||||
|
<result property="sailingDate" column="SAILINGDATE" />
|
||||||
|
<result property="cooperateNation" column="COOPERATENATION" />
|
||||||
|
<result property="writer" column="WRITER" />
|
||||||
|
<result property="creDate" column="CREDATE" />
|
||||||
|
<result property="logDate" column="LOGDATE" />
|
||||||
|
<result property="imgFile" column="IMGFILE" />
|
||||||
|
<result property="comments" column="COMMENTS" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="select" parameterType="ferryVO" resultMap="ferryResult">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
TFERRY
|
||||||
|
WHERE
|
||||||
|
SER_NO = #{serNo}
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectList" parameterType="divMngSearchVO" resultMap="ferryResult">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
TFERRY
|
||||||
|
WHERE
|
||||||
|
FERRYROUTE = #{ferryRoute}
|
||||||
|
ORDER BY
|
||||||
|
SER_NO ASC
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert" parameterType="ferryVO">
|
||||||
|
<![CDATA[
|
||||||
|
INSERT INTO TFERRY
|
||||||
|
(
|
||||||
|
SER_NO, FERRYOFFICE, FERRYNAME, FERRYTON, FERRYROUTE,
|
||||||
|
FERRYTIME, FERRYSPEEDMAX, FERRYSPEEDNOR, FERRYGUESTCNT, FERRYCLUECNT,
|
||||||
|
RUNTERM, RUNCNT, REPRENAME, TEL, FERRYSOSOK,
|
||||||
|
SAILINGDISTANCE, SAILINGDATE, COOPERATENATION, WRITER, CREDATE,
|
||||||
|
LOGDATE, IMGFILE, COMMENTS
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
#{serNo}, #{ferryOffice}, #{ferryName}, #{ferryTon}, #{ferryRoute},
|
||||||
|
#{ferryTime}, #{ferrySpeedMax}, #{ferrySpeedNor}, #{ferryGuestCnt}, #{ferryClueCnt},
|
||||||
|
#{runTerm}, #{runCnt}, #{repreName}, #{tel}, #{ferrySosok},
|
||||||
|
#{sailingDistance}, #{sailingDate}, #{cooperateNation}, #{writer}, TO_CHAR(NOW(), 'YYYYMMDDHH24MISS'),
|
||||||
|
TO_CHAR(NOW(), 'YYYYMMDDHH24MISS'), #{imgFile}, #{comments}
|
||||||
|
)
|
||||||
|
]]>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="ferryVO">
|
||||||
|
<![CDATA[
|
||||||
|
UPDATE
|
||||||
|
TFERRY
|
||||||
|
SET
|
||||||
|
FERRYOFFICE = #{ferryOffice},
|
||||||
|
FERRYNAME = #{ferryName},
|
||||||
|
FERRYTON = #{ferryTon},
|
||||||
|
FERRYROUTE = #{ferryRoute},
|
||||||
|
FERRYTIME = #{ferryTime},
|
||||||
|
FERRYSPEEDMAX = #{ferrySpeedMax},
|
||||||
|
FERRYSPEEDNOR = #{ferrySpeedNor},
|
||||||
|
FERRYGUESTCNT = #{ferryGuestCnt},
|
||||||
|
FERRYCLUECNT = #{ferryClueCnt},
|
||||||
|
RUNTERM = #{runTerm},
|
||||||
|
RUNCNT = #{runCnt},
|
||||||
|
REPRENAME = #{repreName},
|
||||||
|
TEL = #{tel},
|
||||||
|
FERRYSOSOK = #{ferrySosok},
|
||||||
|
SAILINGDISTANCE = #{sailingDistance},
|
||||||
|
SAILINGDATE = #{sailingDate},
|
||||||
|
COOPERATENATION = #{cooperateNation},
|
||||||
|
LOGDATE = TO_CHAR(NOW(), 'YYYYMMDDHH24MISS'),
|
||||||
|
IMGFILE = #{imgFile},
|
||||||
|
COMMENTS = #{comments}
|
||||||
|
WHERE
|
||||||
|
SER_NO = #{serNo}
|
||||||
|
]]>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="delete" parameterType="ferryVO">
|
||||||
|
<![CDATA[
|
||||||
|
DELETE
|
||||||
|
FROM
|
||||||
|
TFERRY
|
||||||
|
WHERE
|
||||||
|
SER_NO = #{serNo}
|
||||||
|
]]>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectMaxSerNo" parameterType="ferryVO" resultType="int">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
MAX(SER_NO)
|
||||||
|
FROM
|
||||||
|
TFERRY
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,147 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="WeakPlace">
|
||||||
|
|
||||||
|
<resultMap id="weakplaceResult" type="weakPlaceVO">
|
||||||
|
<result property="place1" column="PLACE1" />
|
||||||
|
<result property="place1str" column="CODENM" />
|
||||||
|
<result property="wpNo" column="WP_NO" />
|
||||||
|
<result property="name" column="NAME" />
|
||||||
|
<result property="location" column="LOCATION" />
|
||||||
|
<result property="comments" column="COMMENTS" />
|
||||||
|
<result property="filename1" column="FILENAME1" />
|
||||||
|
<result property="filename2" column="FILENAME2" />
|
||||||
|
<result property="writer" column="WRITER" />
|
||||||
|
<result property="credate" column="CREDATE" />
|
||||||
|
<result property="logdate" column="LOGDATE" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="WeakPlace.select" parameterType="weakPlaceVO" resultMap="weakplaceResult">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
WP.*, C.CODENM
|
||||||
|
FROM
|
||||||
|
TWEAKPLACE WP, TCODE C
|
||||||
|
WHERE
|
||||||
|
UPPER(WP.PLACE1) = UPPER(C.CODE2)
|
||||||
|
AND C.CODE1 = 'C001'
|
||||||
|
AND WP.PLACE1 = #{place1}
|
||||||
|
AND WP.WP_NO = #{wpNo}
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="WeakPlace.selectList" parameterType="weakPlaceSearchVO" resultMap="weakplaceResult">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
WP.*, C.CODENM
|
||||||
|
FROM
|
||||||
|
TWEAKPLACE WP, TCODE C
|
||||||
|
WHERE
|
||||||
|
UPPER(WP.PLACE1) = UPPER(C.CODE2)
|
||||||
|
AND C.CODE1 = 'C001'
|
||||||
|
]]>
|
||||||
|
<if test="place1 != null and place1 != '' and place1 != 'PS00'">
|
||||||
|
AND WP.PLACE1 = #{place1}
|
||||||
|
</if>
|
||||||
|
<![CDATA[
|
||||||
|
ORDER BY
|
||||||
|
WP.PLACE1 ASC, WP.WP_NO ASC
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="WeakPlace.selectStatsPerPlace" parameterType="hashmap" resultType="hashmap" >
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
'0' AS PLACE1, '전체' AS CODENM_YAK, COUNT(*) AS CNT
|
||||||
|
FROM
|
||||||
|
TWEAKPLACE
|
||||||
|
UNION
|
||||||
|
SELECT
|
||||||
|
C.CODE2, C.CODENM_YAK, COUNT(WP.WP_NO) AS CNT
|
||||||
|
FROM
|
||||||
|
TCODE C LEFT JOIN TWEAKPLACE WP ON UPPER(C.CODE2) = UPPER(WP.PLACE1)
|
||||||
|
WHERE
|
||||||
|
C.CODE1 = 'C001'
|
||||||
|
AND UPPER(C.CODE2) IN
|
||||||
|
]]>
|
||||||
|
<foreach collection="placeList" item="item" index="index" separator="," open="(" close=")">
|
||||||
|
UPPER(#{item})
|
||||||
|
</foreach>
|
||||||
|
<![CDATA[
|
||||||
|
GROUP BY
|
||||||
|
C.CODE2, C.CODENM_YAK
|
||||||
|
)
|
||||||
|
ORDER BY
|
||||||
|
UPPER(PLACE1) ASC
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMaxWpNo" parameterType="String" resultType="int">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
COALESCE(WP_NO, 0)
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
WP_NO
|
||||||
|
FROM
|
||||||
|
TWEAKPLACE
|
||||||
|
WHERE
|
||||||
|
1=1
|
||||||
|
AND PLACE1 = #{_parameter}
|
||||||
|
ORDER BY WP_NO DESC
|
||||||
|
)
|
||||||
|
WHERE
|
||||||
|
ROWNUM = 1
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insert" parameterType="weakPlaceVO">
|
||||||
|
<![CDATA[
|
||||||
|
INSERT
|
||||||
|
INTO TWEAKPLACE
|
||||||
|
(
|
||||||
|
PLACE1, WP_NO, NAME, LOCATION, COMMENTS,
|
||||||
|
FILENAME1, FILENAME2, WRITER, CREDATE, LOGDATE
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
#{place1}, #{wpNo}, #{name}, #{location}, #{comments},
|
||||||
|
#{filename1}, #{filename2}, #{writer}, TO_CHAR(NOW(), 'YYYYMMDDHH24MISS'), NULL
|
||||||
|
)
|
||||||
|
]]>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="update" parameterType="weakPlaceVO">
|
||||||
|
<![CDATA[
|
||||||
|
UPDATE
|
||||||
|
TWEAKPLACE
|
||||||
|
SET
|
||||||
|
NAME = #{name},
|
||||||
|
LOCATION = #{location},
|
||||||
|
COMMENTS = #{comments},
|
||||||
|
FILENAME1 = #{filename1},
|
||||||
|
FILENAME2 = #{filename2},
|
||||||
|
LOGDATE = TO_CHAR(NOW(), 'YYYYMMDDHH24MISS')
|
||||||
|
WHERE
|
||||||
|
PLACE1 = #{place1}
|
||||||
|
AND WP_NO = #{wpNo}
|
||||||
|
]]>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="delete" parameterType="weakPlaceVO">
|
||||||
|
<![CDATA[
|
||||||
|
DELETE
|
||||||
|
FROM
|
||||||
|
TWEAKPLACE
|
||||||
|
WHERE
|
||||||
|
PLACE1 = #{place1}
|
||||||
|
AND WP_NO = #{wpNo}
|
||||||
|
]]>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -54,15 +54,15 @@
|
||||||
<typeAlias alias="eduVO" type="kcg.faics.fa.vo.EduVO"/>
|
<typeAlias alias="eduVO" type="kcg.faics.fa.vo.EduVO"/>
|
||||||
<typeAlias alias="eduSearchVO" type="kcg.faics.fa.vo.EduSearchVO"/>
|
<typeAlias alias="eduSearchVO" type="kcg.faics.fa.vo.EduSearchVO"/>
|
||||||
|
|
||||||
<!-- kcg.faics.target -->
|
<!-- kcg.faics.tg -->
|
||||||
<typeAlias alias="weakPlaceVO" type="kcg.faics.target.vo.WeakPlaceVO"/>
|
<typeAlias alias="weakPlaceVO" type="kcg.faics.tg.vo.WeakPlaceVO"/>
|
||||||
<typeAlias alias="weakPlaceSearchVO" type="kcg.faics.target.vo.WeakPlaceSearchVO" />
|
<typeAlias alias="weakPlaceSearchVO" type="kcg.faics.tg.vo.WeakPlaceSearchVO" />
|
||||||
<typeAlias alias="corpVO" type="kcg.faics.target.vo.CorpVO"/>
|
<typeAlias alias="corpVO" type="kcg.faics.tg.vo.CorpVO"/>
|
||||||
<typeAlias alias="corpSearchVO" type="kcg.faics.target.vo.CorpSearchVO" />
|
<typeAlias alias="corpSearchVO" type="kcg.faics.tg.vo.CorpSearchVO" />
|
||||||
<typeAlias alias="divMngVO" type="kcg.faics.target.vo.DivMngVO"/>
|
<typeAlias alias="divMngVO" type="kcg.faics.tg.vo.DivMngVO"/>
|
||||||
<typeAlias alias="divMngSearchVO" type="kcg.faics.target.vo.DivMngSearchVO" />
|
<typeAlias alias="divMngSearchVO" type="kcg.faics.tg.vo.DivMngSearchVO" />
|
||||||
<typeAlias alias="ferryVO" type="kcg.faics.target.vo.FerryVO"/>
|
<typeAlias alias="ferryVO" type="kcg.faics.tg.vo.FerryVO"/>
|
||||||
<typeAlias alias="ferrySearchVO" type="kcg.faics.target.vo.FerrySearchVO" />
|
<typeAlias alias="ferrySearchVO" type="kcg.faics.tg.vo.FerrySearchVO" />
|
||||||
|
|
||||||
<!-- kcg.faics.admin -->
|
<!-- kcg.faics.admin -->
|
||||||
<typeAlias alias="logSearchVO" type="kcg.faics.admin.vo.LogSearchVO" />
|
<typeAlias alias="logSearchVO" type="kcg.faics.admin.vo.LogSearchVO" />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue