package kcg.faics.tg.vo;

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

import kcg.faics.tg.FerryRouteType;
import kcg.faics.tg.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;
	}
}
