LpData.java 3.13 KB
package com.bsth.controller.realcontrol.dto;

import com.bsth.entity.realcontrol.ScheduleRealInfo;

/**
 * 路牌相关的数据(换路牌时要换的字段)
 * Created by panzhao on 2017/3/2.
 */
public class LpData {

    public LpData(ScheduleRealInfo sch) {
        this.jGh = sch.getjGh();
        this.jName = sch.getjName();
        this.sGh = sch.getsGh();
        this.sName = sch.getsName();
        this.nbbm = sch.getClZbh();

        this.fcsj = sch.getFcsjActualTime();
        this.zdsj = sch.getZdsjActualTime();

        this.qdName = sch.getQdzName();
        this.zdzName = sch.getZdzName();
    }

    public void appendTo(ScheduleRealInfo sch, int type) {

        if (type == 0) {
            //只换人
            sch.setjGh(this.jGh);
            sch.setjName(this.jName);
            sch.setsGh(this.sGh);
            sch.setsName(this.sName);
        } else if (type == 1) {
            //只换车
            sch.setClZbh(this.nbbm);
            changeRealTime(sch);
            /*//换实际时间
            if(changeRealTime){
                changeRealTime(sch);
            }*/

        } else if (type == 2) {
            //换人并换车
            sch.setjGh(this.jGh);
            sch.setjName(this.jName);
            sch.setsGh(this.sGh);
            sch.setsName(this.sName);
            sch.setClZbh(this.nbbm);

            //换实际时间
            //if(changeRealTime){
                changeRealTime(sch);
            //}
        }
    }

    public void changeRealTime(ScheduleRealInfo sch){
        if (this.fcsj != null && this.qdName.equals(sch.getQdzName()))
            sch.setFcsjActualAll(this.fcsj);
        if (this.zdsj != null && this.zdzName.equals(sch.getZdzName()))
            sch.setZdsjActualAll(this.zdsj);
    }

    /**
     * 起点站名称
     */
    private String qdName;

    /**
     * Terminal station name
     */
    private String zdzName;

    /**
     * 驾驶员
     */
    private String jGh;
    private String jName;

    /**
     * 售票员
     */
    private String sGh;
    private String sName;

    /**
     * 车辆自编号
     */
    private String nbbm;

    /**
     * 实际发车时间
     */
    private Long fcsj;

    /**
     * 实际终点时间
     */
    private Long zdsj;

    public String getjGh() {
        return jGh;
    }

    public void setjGh(String jGh) {
        this.jGh = jGh;
    }

    public String getjName() {
        return jName;
    }

    public void setjName(String jName) {
        this.jName = jName;
    }

    public String getsGh() {
        return sGh;
    }

    public void setsGh(String sGh) {
        this.sGh = sGh;
    }

    public String getsName() {
        return sName;
    }

    public void setsName(String sName) {
        this.sName = sName;
    }

    public String getNbbm() {
        return nbbm;
    }

    public void setNbbm(String nbbm) {
        this.nbbm = nbbm;
    }

    public Long getFcsj() {
        return fcsj;
    }

    public void setFcsj(Long fcsj) {
        this.fcsj = fcsj;
    }

    public Long getZdsj() {
        return zdsj;
    }

    public void setZdsj(Long zdsj) {
        this.zdsj = zdsj;
    }
}