TTinfoDetailDynamicData.java 7.18 KB
package com.bsth.service.schedule.datatools;

import com.bsth.service.schedule.exception.ScheduleException;
import com.bsth.service.schedule.utils.DataToolsFile;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

import java.util.List;

/**
 * 动态时刻表数据。
 */
public interface TTinfoDetailDynamicData {

    //---------------------- 生成时刻表用对象(以下) ---------------------//
    public static enum BcType { // 班次类型枚举
        IN("in"), // 进场
        OUT("out"), // 出场
        BD("bd"), // 早例保
        LC("lc"), // 晚例保
        NORMAL("normal"); // 正常
        private String flag;

        @JsonCreator
        private BcType(String flag) {
            this.flag = flag;
        }

        @JsonValue
        public String getFlag() {
            return flag;
        }

        public void setFlag(String flag) {
            this.flag = flag;
        }
    }

    public static class BcObj { // 班次对象
        /** 班次时间 */
        private Integer bcsj;
        /** 停站时间 */
        private Integer ssj;
        /** 吃饭时间 */
        private Integer eatsj;

        /** 停车场id */
        private Integer tccid;
        /** 起点站id */
        private Integer qdzid;
        /** 终点站id */
        private Integer zdzid;

        /** 是否上行 */
        private Boolean isUp;

        /** 班次类型 */
        private BcType bcType;
        /** 发车时刻 */
        private String fcsj;

        /** 第几圈(从1开始) */
        private Integer groupNo;
        /** 圈里第几个班次(1或者2) */
        private Integer groupBcNo;

        public Integer getBcsj() {
            return bcsj;
        }

        public void setBcsj(Integer bcsj) {
            this.bcsj = bcsj;
        }

        public Integer getSsj() {
            return ssj;
        }

        public void setSsj(Integer ssj) {
            this.ssj = ssj;
        }

        public Integer getEatsj() {
            return eatsj;
        }

        public void setEatsj(Integer eatsj) {
            this.eatsj = eatsj;
        }

        public Integer getTccid() {
            return tccid;
        }

        public void setTccid(Integer tccid) {
            this.tccid = tccid;
        }

        public Integer getQdzid() {
            return qdzid;
        }

        public void setQdzid(Integer qdzid) {
            this.qdzid = qdzid;
        }

        public Integer getZdzid() {
            return zdzid;
        }

        public void setZdzid(Integer zdzid) {
            this.zdzid = zdzid;
        }

        public BcType getBcType() {
            return bcType;
        }

        public void setBcType(BcType bcType) {
            this.bcType = bcType;
        }

        public String getFcsj() {
            return fcsj;
        }

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

        public Boolean getIsUp() {
            return isUp;
        }

        public void setIsUp(Boolean isUp) {
            this.isUp = isUp;
        }

        public Integer getGroupNo() {
            return groupNo;
        }

        public void setGroupNo(Integer groupNo) {
            this.groupNo = groupNo;
        }

        public Integer getGroupBcNo() {
            return groupBcNo;
        }

        public void setGroupBcNo(Integer groupBcNo) {
            this.groupBcNo = groupBcNo;
        }
    }

    public static class LpObj { // 路牌对象
        /** 路牌名字 */
        private String lpname;
        /** 每圈的第一个班次是否上行 */
        private Boolean isUp;

        /** 第一个班次起点站路由id */
        private Integer stationRouteId1;
        /** 第二个班次起点站路由id */
        private Integer stationRouteId2;

        /** 班次列表 */
        private List<BcObj> bcObjList;
        /** 总圈数 */
        private Integer groupCount;

        /** 总工时 */
        private Double zgs;
        /** 总班次 */
        private Integer zbc;


        public String getLpname() {
            return lpname;
        }

        public void setLpname(String lpname) {
            this.lpname = lpname;
        }

        public Boolean getIsUp() {
            return isUp;
        }

        public void setIsUp(Boolean isUp) {
            this.isUp = isUp;
        }

        public List<BcObj> getBcObjList() {
            return bcObjList;
        }

        public void setBcObjList(List<BcObj> bcObjList) {
            this.bcObjList = bcObjList;
        }

        public Integer getGroupCount() {
            return groupCount;
        }

        public void setGroupCount(Integer groupCount) {
            this.groupCount = groupCount;
        }

        public Double getZgs() {
            return zgs;
        }

        public void setZgs(Double zgs) {
            this.zgs = zgs;
        }

        public Integer getZbc() {
            return zbc;
        }

        public void setZbc(Integer zbc) {
            this.zbc = zbc;
        }

        public Integer getStationRouteId1() {
            return stationRouteId1;
        }

        public void setStationRouteId1(Integer stationRouteId1) {
            this.stationRouteId1 = stationRouteId1;
        }

        public Integer getStationRouteId2() {
            return stationRouteId2;
        }

        public void setStationRouteId2(Integer stationRouteId2) {
            this.stationRouteId2 = stationRouteId2;
        }
    }

    public static class StatInfo { // 统计数据对象
        /** 统计项目 */
        private String statItem;
        /** 统计值 */
        private Double statValue;

        public String getStatItem() {
            return statItem;
        }

        public void setStatItem(String statItem) {
            this.statItem = statItem;
        }

        public Double getStatValue() {
            return statValue;
        }

        public void setStatValue(Double statValue) {
            this.statValue = statValue;
        }
    }

    public static class DTInfos { // 所有数据信息
        /** 路牌班次数据列表 */
        private List<LpObj> lpObjList;
        /** 统计数据列表 */
        private List<StatInfo> statInfoList;

        public List<LpObj> getLpObjList() {
            return lpObjList;
        }

        public void setLpObjList(List<LpObj> lpObjList) {
            this.lpObjList = lpObjList;
        }

        public List<StatInfo> getStatInfoList() {
            return statInfoList;
        }

        public void setStatInfoList(List<StatInfo> statInfoList) {
            this.statInfoList = statInfoList;
        }
    }

    //---------------------- 生成时刻表用对象(以上) ---------------------//

    /**
     * 导出动态时刻表数据。
     * @param dtInfos
     * @return
     * @throws ScheduleException
     */
    public DataToolsFile exportDynamicTTinfo(DTInfos dtInfos) throws ScheduleException;
}