package kcg.faics.member.vo;

import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

import kcg.faics.member.UserType;

import org.apache.commons.lang3.StringUtils;
import org.springframework.web.multipart.MultipartFile;

/**
 * MemberVO.java
 * 
 * @author 임새미
 * @since 2016. 10. 05.
 *
 *  	 수정일                     수정자                                       수정내용
 *  -------------	--------	---------------------------
 *  2016. 10. 05. 	    임새미				       최초생성
 * 
 */
public class MemberVO implements Serializable {

	private static final long serialVersionUID = -4076942847418714109L;

	/**
	 * 로우넘버.
	 */
	private int rnum;
	/**
	 * 사용자 ID.
	 */
	private String userid;
	/**
	 * 사용자 ID 표현 문자열.
	 */
	private String useridStr;
	/**
	 * 비밀번호.
	 */
	private String passwd;
	/**
	 * 새로운 비밀번호.
	 */
	private String npasswd;
	/**
	 * 비밀번호 암호화여부.
	 */
	private boolean isHashedPasswd = false;
	/**
	 * 주민번호.
	 */
	private String idno;
	/**
	 * 성명.
	 */
	private String name;
	/**
	 * 성명(한자). 
	 */
	private String chnname;
	/**
	 * 가족사항.
	 */
	private String family;
	/**
	 * 주소.
	 */
	private String address;
	/**
	 * email.
	 */
	private String email;
	/**
	 * 일반전화.
	 */
	private String hphone;
	/**
	 * 경비전화.
	 */
	private String ophone;
	/**
	 * 휴대전화.
	 */
	private String cphone;
	/**
	 * 경찰임용일.
	 */
	private String sdate;
	/**
	 * 현 계급 임용일.
	 */
	private String pdate;
	/**
	 * 현 부서 배치일.
	 */
	private String adate;
	/**
	 * 소속1.
	 */
	private String place1;
	/**
	 * 소속2.
	 */
	private String place2;
	/**
	 * 세부소속.
	 */
	private String place3;
	/**
	 * 소속1 명칭.
	 */
	private String place1Str;
	/**
	 * 현재 소속 명칭.
	 */
	private String nowPlaceStr;
	/**
	 * 소속2 명칭.
	 */
	private String place2Str;
	/**
	 * 세부소속 명칭.
	 */
	private String place3Str;
	/**
	 * 소속1 명칭 + 소속2 명칭.
	 */
	private String place1N2Str;
	/**
	 * 계급.
	 */
	private String position;
	/**
	 * 계급 명칭.
	 */
	private String positionStr;
	/**
	 * 현재 계급 명칭.
	 */
	private String nowPositionStr;
	/**
	 * 직책. 
	 */
	private String duties;
	/**
	 * 직책 명칭.
	 */
	private String dutiesStr;
	/**
	 * 직별.
	 */
	private String jobtype;
	/**
	 * 직별 명칭.
	 */
	private String jobtypeStr;
	/**
	 * 근무형태 (o:외근, i:내근, d:항만분실).
	 */
	private String inout;
	/**
	 * 근무형태 명칭.
	 */
	private String inoutStr;
	/**
	 * 사용자 구분 (f:외사, g:일반).
	 */
	private String usertype = UserType.CM;
	/**
	 * 최종학력.
	 */
	private String scholarship;
	/**
	 * 최종학력 명칭.
	 */
	private String scholarshipStr;
	/**
	 * 과거 외사 근무 경력.
	 */
	private String excareer;
	/**
	 * 과거 외사 근무 경력(년).
	 */
	private int excareer_y;
	/**
	 * 과거 외사 근무 경력(개월).
	 */
	private int excareer_m;
	/**
	 * 수사경력.
	 */
	private String excareer1;
	/**
	 * 수사경력(년).
	 */
	private int excareer1_y;
	/**
	 * 수사경력(개월).
	 */
	private int excareer1_m;
	/**
	 * 정보경력.
	 */
	private String excareer2;
	/**
	 * 정보경력(년).
	 */
	private int excareer2_y;
	/**
	 * 정보경력(개월).
	 */
	private int excareer2_m;
	/**
	 * 비고.
	 */
	private String comment_;
	/**
	 * 사용자 등급.
	 */
	private int usegrade;
	/**
	 * 로그인 여부.
	 */
	private String loginchk;
	/**
	 * 사용자 사진파일명.
	 */
	private String userimg;
	/**
	 * 서명 이미지명.
	 */
	private String usersign;
	private String uiflag;
	private String charge;
	/**
	 * 보안경력.
	 */
	private String excareer3;
	/**
	 * 보안경력(년).
	 */
	private int excareer3_y;
	/**
	 * 보안경력(개월).
	 */
	private int excareer3_m;
	/**
	 * 총 외사경력.
	 */
	private String totalexcareer;
	/**
	 * 총 외사경력(년).
	 */
	private String totalexcareer_y;
	/**
	 * 총 외사경력(개월).
	 */
	private String totalexcareer_m;
	private String explace;
	private String logindate;
	/**
	 * 로그인 실패 횟수.
	 */
	private int chkcnt = 0;
	
	private String recentdate;
	
	/**
	 * 이미지 객체.
	 */
	private MultipartFile img;

	/**
	 * 가입일자
	 */
	private String cdate;
	/**
	 * 수정일자
	 */
	private String ldate;
	/**
	 * 수정자
	 */
	private String writer;

	
	/**
	 * @return the userid
	 */
	public String getUserid() {
		return userid;
	}
	/**
	 * @param userid the userid to set
	 */
	public void setUserid(final String userid) {
		this.userid = userid;
		this.refreshUseridStr();
	}
	/**
	 * @return the useridStr
	 */
	public final String getUseridStr() {
		return this.useridStr;
	}
	/**
	 * @param useridStr the useridStr to set
	 */
	public final void setUseridStr(final String useridStr) {
		this.useridStr = useridStr;
	}

	/**
	 * 사용자 ID 표현 문자열을 갱신한다.
	 * - 사용자 ID가 주민번호일 경우 "주민번호"로 갱신한다. 
	 */
	private void refreshUseridStr() {
		if (this.getUserid().equals(this.getIdno())) {
			this.setUseridStr("주민번호");
		} else {
			this.setUseridStr(this.getUserid());
		}
	}
	/**
	 * @return the passwd
	 */
	public String getPasswd() {
		return passwd;
	}
	/**
	 * @param passwd the passwd to set
	 */
	public void setPasswd(final String passwd) {
		this.passwd = passwd;
	}
	/**
	 * @return the idno
	 */
	public String getIdno() {
		return idno;
	}
	/**
	 * @param idno the idno to set
	 */
	public void setIdno(final String idno) {
		this.idno = idno;
		this.refreshUseridStr();
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(final String name) {
		this.name = name;
	}
	/**
	 * @return the chnname
	 */
	public String getChnname() {
		return chnname;
	}
	/**
	 * @param chnname the chnname to set
	 */
	public void setChnname(final String chnname) {
		this.chnname = chnname;
	}
	/**
	 * @return the family
	 */
	public String getFamily() {
		return family;
	}
	/**
	 * @param family the family to set
	 */
	public void setFamily(final String family) {
		this.family = family;
	}
	/**
	 * @return the address
	 */
	public String getAddress() {
		return address;
	}
	/**
	 * @param address the address to set
	 */
	public void setAddress(final String address) {
		this.address = address;
	}
	/**
	 * @return the email
	 */
	public String getEmail() {
		return email;
	}
	/**
	 * @param email the email to set
	 */
	public void setEmail(final String email) {
		this.email = email;
	}
	/**
	 * @return the hphone
	 */
	public String getHphone() {
		return hphone;
	}
	/**
	 * @param hphone the hphone to set
	 */
	public void setHphone(final String hphone) {
		this.hphone = hphone;
	}
	/**
	 * @return the ophone
	 */
	public String getOphone() {
		return ophone;
	}
	/**
	 * @param ophone the ophone to set
	 */
	public void setOphone(final String ophone) {
		this.ophone = ophone;
	}
	/**
	 * @return the cphone
	 */
	public String getCphone() {
		return cphone;
	}
	/**
	 * @param cphone the cphone to set
	 */
	public void setCphone(final String cphone) {
		this.cphone = cphone;
	}
	/**
	 * @return the sdate
	 */
	public String getSdate() {
		return sdate;
	}
	/**
	 * @param sdate the sdate to set
	 */
	public void setSdate(final String sdate) {
		if (StringUtils.isNotBlank(sdate)) {
			if (sdate.indexOf('.') > -1) {
				this.sdate = sdate.replace('.', '-');	
			} else {
				this.sdate = sdate;
			}
		} else {
			this.sdate = sdate;	
		}
	}
	/**
	 * @return the pdate
	 */
	public String getPdate() {
		return pdate;
	}
	/**
	 * @param pdate the pdate to set
	 */
	public void setPdate(final String pdate) {
		if (StringUtils.isNotBlank(pdate)) {
			if (pdate.indexOf('.') > -1) {
				this.pdate = pdate.replace('.', '-');	
			} else {
				this.pdate = pdate;	
			}
		} else {
			this.pdate = pdate;	
		}
	}
	/**
	 * @return the adate
	 */
	public String getAdate() {
		return adate;
	}
	/**
	 * @param adate the adate to set
	 */
	public void setAdate(final String adate) {
		if (StringUtils.isNotBlank(adate)) {
			if (adate.indexOf('.') > -1) {
				this.adate = adate.replace('.', '-');	
			} else {
				this.adate = adate;	
			}
		} else {
			this.adate = adate;	
		}
	}
	/**
	 * @return the place1
	 */
	public String getPlace1() {
		return place1;
	}
	/**
	 * @param place1 the place1 to set
	 */
	public void setPlace1(final String place1) {
		this.place1 = place1;
	}
	/**
	 * @return the place2
	 */
	public String getPlace2() {
		return place2;
	}
	/**
	 * @param place2 the place2 to set
	 */
	public void setPlace2(final String place2) {
		this.place2 = place2;
	}
	/**
	 * @return the place3
	 */
	public String getPlace3() {
		return place3;
	}
	/**
	 * @param place3 the place3 to set
	 */
	public void setPlace3(final String place3) {
		this.place3 = place3;
	}
	/**
	 * @return the position
	 */
	public String getPosition() {
		return position;
	}
	/**
	 * @param position the position to set
	 */
	public void setPosition(final String position) {
		this.position = position;
	}
	/**
	 * @return the duties
	 */
	public String getDuties() {
		return duties;
	}
	/**
	 * @param duties the duties to set
	 */
	public void setDuties(final String duties) {
		this.duties = duties;
	}
	/**
	 * @return the jobtype
	 */
	public String getJobtype() {
		return jobtype;
	}
	/**
	 * @param jobtype the jobtype to set
	 */
	public void setJobtype(final String jobtype) {
		this.jobtype = jobtype;
	}
	/**
	 * @return the inout
	 */
	public String getInout() {
		return inout;
	}
	/**
	 * @param inout the inout to set
	 */
	public void setInout(final String inout) {
		this.inout = inout;
		
		if("o".equals(inout)){
			setInoutStr("외근");
		}else if("d".equals(inout)){
			setInoutStr("항만분실");
		}else {
			setInoutStr("내근");
		}
	}
	/**
	 * @return the inoutStr
	 */
	public final String getInoutStr() {
		return inoutStr;
	}
	/**
	 * @param inoutStr the inoutStr to set
	 */
	public final void setInoutStr(final String inoutStr) {
		this.inoutStr = inoutStr;
	}
	/**
	 * @return the usertype
	 */
	public String getUsertype() {
		return usertype;
	}
	/**
	 * @param usertype the usertype to set
	 */
	public void setUsertype(final String usertype) {
		this.usertype = usertype;
	}
	/**
	 * @return the scholarship
	 */
	public String getScholarship() {
		return scholarship;
	}
	/**
	 * @param scholarship the scholarship to set
	 */
	public void setScholarship(final String scholarship) {
		this.scholarship = scholarship;
	}
	/**
	 * @return the excareer
	 */
	public String getExcareer() {
		return excareer;
	}
	/**
	 * @param excareer the excareer to set
	 */
	public void setExcareer(final String excareer) {
		this.excareer = excareer;
		if (excareer != null && excareer.contains("-")) {
			excareer_y = Integer.parseInt(excareer.split("-")[0]);
			excareer_m = Integer.parseInt(excareer.split("-")[1]);
		}
	}
	/**
	 * ym를 기반으로 Excareer를 설정한다.
	 * 
	 * @param idx Excareer 번호
	 */
	private void setExcareerByYM(final int idx) {
		switch (idx) {
		case 1:
			this.excareer1 = String.format("%s-%s", getExcareer1_y(), getExcareer1_m());
			break;
		case 2:
			this.excareer2 = String.format("%s-%s", getExcareer2_y(), getExcareer2_m());
			break;
		case 3:
			this.excareer3 = String.format("%s-%s", getExcareer3_y(), getExcareer3_m());
			break;
		case 0:
		default:
			this.excareer = String.format("%s-%s", getExcareer_y(), getExcareer_m());
			break;
		}
		
	}
	/**
	 * @return the excareer_y
	 */
	public int getExcareer_y() {
		return excareer_y;
	}
	/**
	 * @param excareer_y the excareer_y to set
	 */
	public void setExcareer_y(final int excareer_y) {
		this.excareer_y = excareer_y;
		setExcareerByYM(0);
	}
	/**
	 * @return the excareer_m
	 */
	public int getExcareer_m() {
		return excareer_m;
	}
	/**
	 * @param excareer_m the excareer_m to set
	 */
	public void setExcareer_m(final int excareer_m) {
		this.excareer_m = excareer_m;
		setExcareerByYM(0);
	}
	/**
	 * @return the excareer1
	 */
	public String getExcareer1() {
		return excareer1;
	}
	/**
	 * @param excareer1 the excareer1 to set
	 */
	public void setExcareer1(final String excareer1) {
		this.excareer1 = excareer1;
		if (excareer1 != null && excareer1.contains("-")) {
			excareer1_y = Integer.parseInt(excareer1.split("-")[0]);
			excareer1_m = Integer.parseInt(excareer1.split("-")[1]);
		}
	}
	/**
	 * @return the excareer1_y
	 */
	public int getExcareer1_y() {
		return excareer1_y;
	}
	/**
	 * @param excareer1_y the excareer1_y to set
	 */
	public void setExcareer1_y(final int excareer1_y) {
		this.excareer1_y = excareer1_y;
		setExcareerByYM(1);
	}
	/**
	 * @return the excareer1_m
	 */
	public int getExcareer1_m() {
		return excareer1_m;
	}
	/**
	 * @param excareer1_m the excareer1_m to set
	 */
	public void setExcareer1_m(final int excareer1_m) {
		this.excareer1_m = excareer1_m;
		setExcareerByYM(1);
	}
	/**
	 * @return the excareer2
	 */
	public String getExcareer2() {
		return excareer2;
	}
	/**
	 * @param excareer2 the excareer2 to set
	 */
	public void setExcareer2(final String excareer2) {
		this.excareer2 = excareer2;
	}
	/**
	 * @return the excareer2_y
	 */
	public int getExcareer2_y() {
		return excareer2_y;
	}
	/**
	 * @param excareer2_y the excareer2_y to set
	 */
	public void setExcareer2_y(final int excareer2_y) {
		this.excareer2_y = excareer2_y;
		setExcareerByYM(2);
	}
	/**
	 * @return the excareer2_m
	 */
	public int getExcareer2_m() {
		return excareer2_m;
	}
	/**
	 * @param excareer2_m the excareer2_m to set
	 */
	public void setExcareer2_m(final int excareer2_m) {
		this.excareer2_m = excareer2_m;
		setExcareerByYM(2);
	}
	/**
	 * @return the comment_
	 */
	public String getComment_() {
		return comment_;
	}
	/**
	 * @param comment_ the comment_ to set
	 */
	public void setComment_(final String comment_) {
		this.comment_ = comment_;
	}
	/**
	 * @return the usegrade
	 */
	public int getUsegrade() {
		return usegrade;
	}
	/**
	 * @param usegrade the usegrade to set
	 */
	public void setUsegrade(final int usegrade) {
		this.usegrade = usegrade;
	}
	/**
	 * @return the loginchk
	 */
	public String getLoginchk() {
		return loginchk;
	}
	/**
	 * @param loginchk the loginchk to set
	 */
	public void setLoginchk(final String loginchk) {
		this.loginchk = loginchk;
	}
	/**
	 * @return the userimg
	 */
	public String getUserimg() {
		return userimg;
	}
	/**
	 * @param userimg the userimg to set
	 */
	public void setUserimg(final String userimg) {
		this.userimg = userimg;
	}
	/**
	 * @return the usersign
	 */
	public String getUsersign() {
		return usersign;
	}
	/**
	 * @param usersign the usersign to set
	 */
	public void setUsersign(final String usersign) {
		this.usersign = usersign;
	}
	/**
	 * @return the uiflag
	 */
	public String getUiflag() {
		return uiflag;
	}
	/**
	 * @param uiflag the uiflag to set
	 */
	public void setUiflag(final String uiflag) {
		this.uiflag = uiflag;
	}
	/**
	 * @return the charge
	 */
	public String getCharge() {
		return charge;
	}
	/**
	 * @param charge the charge to set
	 */
	public void setCharge(final String charge) {
		this.charge = charge;
	}
	
	/**
	 * @return the excareer3
	 */
	public String getExcareer3() {
		return excareer3;
	}
	/**
	 * @param excareer3 the excareer3 to set
	 */
	public void setExcareer3(final String excareer3) {
		this.excareer3 = excareer3;
	}
	/**
	 * @return the excareer3_y
	 */
	public int getExcareer3_y() {
		return excareer3_y;
	}
	/**
	 * @param excareer3_y the excareer3_y to set
	 */
	public void setExcareer3_y(final int excareer3_y) {
		this.excareer3_y = excareer3_y;
		setExcareerByYM(3);
	}
	/**
	 * @return the excareer3_m
	 */
	public int getExcareer3_m() {
		return excareer3_m;
	}
	/**
	 * @param excareer3_m the excareer3_m to set
	 */
	public void setExcareer3_m(final int excareer3_m) {
		this.excareer3_m = excareer3_m;
		setExcareerByYM(3);
	}
	/**
	 * @return the explace
	 */
	public String getExplace() {
		return explace;
	}
	/**
	 * @param explace the explace to set
	 */
	public void setExplace(final String explace) {
		this.explace = explace;
	}
	/**
	 * @return the logindate
	 */
	public String getLogindate() {
		return logindate;
	}
	/**
	 * @param logindate the logindate to set
	 */
	public void setLogindate(final String logindate) {
		this.logindate = logindate;
	}
	/**
	 * @return the chkcnt
	 */
	public int getChkcnt() {
		return chkcnt;
	}
	/**
	 * @param chkcnt the chkcnt to set
	 */
	public void setChkcnt(final int chkcnt) {
		this.chkcnt = chkcnt;
	}
	/**
	 * 로그인 실패횟수를 증가시킨다.
	 */
	public void incChkcnt() {
		this.chkcnt++; 
	}
	/**
	 * @return the serialversionuid
	 */
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	/**
	 * @return the place1Str
	 */
	public String getPlace1Str() {
		return place1Str != null ? place1Str : "";
	}
	/**
	 * @param place1Str the place1Str to set
	 */
	public void setPlace1Str(final String place1Str) {
		this.place1Str = place1Str;
		
		this.setPlace1N2Str(this.getPlace1Str() + " " + this.getPlace2Str());
	}
	/**
	 * @return the place2Str
	 */
	public String getPlace2Str() {
		return place2Str != null ? place2Str : "";
	}
	/**
	 * @param place2Str the place2Str to set
	 */
	public void setPlace2Str(final String place2Str) {
		this.place2Str = place2Str;
		
		this.setPlace1N2Str(this.getPlace1Str() + " " + this.getPlace2Str());
	}
	/**
	 * @return the place3Str
	 */
	public String getPlace3Str() {
		return place3Str;
	}
	/**
	 * @param place3Str the place3Str to set
	 */
	public void setPlace3Str(final String place3Str) {
		this.place3Str = place3Str;
	}
	/**
	 * @return the place1N2Str
	 */
	public final String getPlace1N2Str() {
		return this.place1N2Str;
	}
	/**
	 * @param place1n2Str the place1N2Str to set
	 */
	public final void setPlace1N2Str(final String place1n2Str) {
		place1N2Str = place1n2Str;
	}
	/**
	 * @return the positionStr
	 */
	public String getPositionStr() {
		return positionStr;
	}
	/**
	 * @param positionStr the positionStr to set
	 */
	public void setPositionStr(final String positionStr) {
		this.positionStr = positionStr;
	}
	/**
	 * @return the dutiesStr
	 */
	public String getDutiesStr() {
		return dutiesStr;
	}
	/**
	 * @param dutiesStr the dutiesStr to set
	 */
	public void setDutiesStr(final String dutiesStr) {
		this.dutiesStr = dutiesStr;
	}
	/**
	 * @return the jobtypeStr
	 */
	public String getJobtypeStr() {
		return jobtypeStr;
	}
	/**
	 * @param jobtypeStr the jobtypeStr to set
	 */
	public void setJobtypeStr(final String jobtypeStr) {
		this.jobtypeStr = jobtypeStr;
	}
	/**
	 * @return the scholarshipStr
	 */
	public String getScholarshipStr() {
		return scholarshipStr;
	}
	/**
	 * @param scholarshipStr the scholarshipStr to set
	 */
	public void setScholarshipStr(final String scholarshipStr) {
		this.scholarshipStr = scholarshipStr;
	}
	/**
	 * @return the rnum
	 */
	public int getRnum() {
		return rnum;
	}
	/**
	 * @param rnum the rnum to set
	 */
	public void setRnum(final int rnum) {
		this.rnum = rnum;
	}
	/**
	 * @return the totalexcareer
	 */
	public String getTotalexcareer() {
		return totalexcareer;
	}
	/**
	 * @param totalexcareer the totalexcareer to set
	 */
	public void setTotalexcareer(final String totalexcareer) {
		this.totalexcareer = totalexcareer;
	}
	/**
	 * @return the totalexcareer_y
	 */
	public String getTotalexcareer_y() {
		return totalexcareer_y;
	}
	/**
	 * @param totalexcareer_y the totalexcareer_y to set
	 */
	public void setTotalexcareer_y(final String totalexcareer_y) {
		this.totalexcareer_y = totalexcareer_y;
	}
	/**
	 * @return the totalexcareer_m
	 */
	public String getTotalexcareer_m() {
		return totalexcareer_m;
	}
	/**
	 * @param totalexcareer_m the totalexcareer_m to set
	 */
	public void setTotalexcareer_m(final String totalexcareer_m) {
		this.totalexcareer_m = totalexcareer_m;
	}
	/**
	 * @return the npasswd
	 */
	public String getNpasswd() {
		return npasswd;
	}
	/**
	 * @param npasswd the npasswd to set
	 */
	public void setNpasswd(final String npasswd) {
		this.npasswd = npasswd;
	}
	/**
	 * @return the isHashedPasswd
	 */
	public final boolean isHashedPasswd() {
		return isHashedPasswd;
	}
	/**
	 * @param isHashedPasswd the isHashedPasswd to set
	 */
	public final void setHashedPasswd(final boolean isHashedPasswd) {
		this.isHashedPasswd = isHashedPasswd;
	}
	/**
	 * @return the recentdate
	 */
	public String getRecentdate() {
		return recentdate;
	}
	/**
	 * @param recentdate the recentdate to set
	 */
	public void setRecentdate(final String recentdate) {
		this.recentdate = recentdate;
	}
	/**
	 * @return the nowPlace1Str
	 */
	public String getNowPlaceStr() {
		return nowPlaceStr;
	}
	/**
	 * @param nowPlaceStr the nowPlace1Str to set
	 */
	public void setNowPlace1Str(final String nowPlaceStr) {
		this.nowPlaceStr = nowPlaceStr;
	}
	/**
	 * @return the nowPositionStr
	 */
	public String getNowPositionStr() {
		return nowPositionStr;
	}
	/**
	 * @param nowPositionStr the nowPositionStr to set
	 */
	public void setNowPositionStr(final String nowPositionStr) {
		this.nowPositionStr = nowPositionStr;
	}
	
	/**
	 * @return the img
	 */
	public final MultipartFile getImg() {
		return img;
	}
	/**
	 * @param img the img to set
	 */
	public final void setImg(final MultipartFile img) {
		this.img = img;
	}
	/**
	 * @return the cdate
	 */
	public String getCdate() {
		return cdate;
	}
	/**
	 * @param cdate the cdate to set
	 */
	public void setCdate(final String cdate) {
		this.cdate = cdate;
	}
	/**
	 * @return the ldate
	 */
	public String getLdate() {
		return ldate;
	}
	/**
	 * @param ldate the ldate to set
	 */
	public void setLdate(final String ldate) {
		this.ldate = ldate;
	}
	/**
	 * @return the writer
	 */
	public String getWriter() {
		return writer;
	}
	/**
	 * @param writer the writer to set
	 */
	public void setWriter(final String writer) {
		this.writer = writer;
	}
	/**
	 * 외사근무기간을 계산하여 반환한다.
	 * 
	 * @param stDate 근무시작일
	 * @param edDate 근무종료일 (없으면 현재가 기준이 된다.)
	 * @return 외사근무기간 (개월)
	 * @throws ParseException
	 *             Date 파싱 예외
	 */
	protected int calcWorkTerm(final Date stDate, final Date edDate) throws ParseException {
		int monthTerm = 0;
		
		Date std = stDate;
		Date edd = edDate;
		
		if (edd == null) {
			edd = new Date();
		}
		
		if (std != null && edd != null) {
			Calendar stc = Calendar.getInstance();
			stc.setTime(std);
			Calendar edc = Calendar.getInstance();
			edc.setTime(edd);
			
			int stYear = stc.get(stc.YEAR);
			int stMonth = stc.get(stc.MONTH) + 1;
			
			int edYear = edc.get(edc.YEAR);
			int edMonth = edc.get(edc.MONTH) + 1;			
			
			stMonth += stYear * 12;
			edMonth += edYear * 12;
			
			monthTerm = edMonth - stMonth;
		}
		
		return monthTerm;
	}
	
	/**
	 * 근무기간(경력)을 표현할 문자열을 반환한다.
	 * 
	 * @param month
	 *            근무기간 (개월)
	 * @return 근무기간(경력) 표현 문자열  (?년 ?개월)
	 */
	protected String termToStr(final int month) {
		String termStr = "0년 0개월";
		if (month > 0) {
			termStr = Integer.toString(month / 12) + "년 "
					+ Integer.toString(month % 12) + "개월";
		}
		
		return termStr;
	}
	
	/**
	 * 총 외사경력을 표현할 문자열을 반환한다.
	 * 
	 * @return 총 외사경력 (?년 ?개월)
	 * @throws ParseException
	 *             파싱 예외 처리
	 */
	public String getTotExcareerTermStr() throws ParseException {
		int term = 0;
		String sdateStr = this.getSdate();
		
		if (StringUtils.isNotBlank(sdate)) {
			Date sdate = null;
			
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.KOREA);
			sdate = sdf.parse(sdateStr);
			
			term = this.calcWorkTerm(sdate, null);
		}
		
		return termToStr(term);
	}
}
