lius
2023-07-25 c45790a3da8fa480091be24e0775e9f8dbab927c
班次利用率定时任务算法
已添加8个文件
已修改14个文件
879 ■■■■■ 文件已修改
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipmentStatisticalInfo.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipmentStatisticalShiftInfo.java 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/RunningAllEquipmentShiftStatisticalProcessJob.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/EquipmentLogMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcDeviceCalendarMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentRunningSectionMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentStatisticalShiftInfoMapper.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentLogMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcDeviceCalendarMapper.xml 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentRunningSectionMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentStatisticalShiftInfoMapper.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IEquipmentLogService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcDeviceCalendarService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentRunningSectionService.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentStatisticalInfoService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentStatisticalShiftInfoService.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/EquipmentLogServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcDeviceCalendarServiceImpl.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentRunningSectionServiceImpl.java 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentStatisticalInfoServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentStatisticalShiftInfoServiceImpl.java 368 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcShiftDateVo.java 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipmentStatisticalInfo.java
@@ -17,7 +17,7 @@
/**
 * @Description: è®¾å¤‡å•日运行数据表
 * @Author: jeecg-boot
 * @Author: LiuS
 * @Date: 2023-04-14
 * @Version: V1.0
 */
@@ -28,6 +28,8 @@
@ApiModel(value = "mdc_equipment_statistical_info对象", description = "设备单日运行数据表")
public class MdcEquipmentStatisticalInfo implements Serializable {
    private static final long serialVersionUID = -4733120585358211415L;
    /**
     * ä¸»é”®
     */
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipmentStatisticalShiftInfo.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,91 @@
package org.jeecg.modules.mdc.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
 * @Description: è®¾å¤‡ç­æ¬¡å•日运行数据表
 * @author: LiuS
 * @create: 2023-07-24 11:13
 */
@Data
@TableName("mdc_equipment_statistical_shift_info")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "mdc_equipment_statistical_shift_info对象", description = "设备班次单日运行数据表")
public class MdcEquipmentStatisticalShiftInfo implements Serializable {
    private static final long serialVersionUID = 1519876512924700514L;
    /**
     * ä¸»é”®
     */
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;
    /**
     * è®¾å¤‡id
     */
    @ApiModelProperty(value = "设备id")
    private String equipmentId;
    /**
     * ç­åˆ¶id
     */
    @ApiModelProperty(value = "班制id")
    private String shiftId;
    /**
     * ç­æ¬¡id
     */
    @ApiModelProperty(value = "班次id")
    private String shiftSubId;
    /**
     * å¼€æœºæ—¶é•¿
     */
    @ApiModelProperty(value = "开机时长")
    private BigDecimal openLong = new BigDecimal("0");
    /**
     * å…³æœºæ—¶é•¿
     */
    @ApiModelProperty(value = "关机时长")
    private BigDecimal closeLong = new BigDecimal("0");
    /**
     * å¾…机时长
     */
    @ApiModelProperty(value = "待机时长")
    private BigDecimal waitLong = new BigDecimal("0");
    /**
     * åŠ å·¥æ—¶é•¿
     */
    @ApiModelProperty(value = "加工时长")
    private BigDecimal processLong = new BigDecimal("0");
    /**
     * æŠ¥è­¦æ—¶é•¿
     */
    @ApiModelProperty(value = "报警时长")
    private BigDecimal errorLong = new BigDecimal("0");
    /**
     * æœ‰æ•ˆæ—¥æœŸ
     */
    @ApiModelProperty(value = "有效日期")
    private String theDate;
    /**
     * åˆ›å»ºæ—¶é—´
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/job/RunningAllEquipmentShiftStatisticalProcessJob.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,43 @@
package org.jeecg.modules.mdc.job;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.mdc.service.IMdcEquipmentStatisticalShiftInfoService;
import org.quartz.*;
import javax.annotation.Resource;
/**
 * @Description: å®šæ—¶ç»Ÿè®¡å•日班次数据任务
 * @author: LiuS
 * @create: 2023-07-24 10:26
 */
@PersistJobDataAfterExecution
@DisallowConcurrentExecution
@Slf4j
public class RunningAllEquipmentShiftStatisticalProcessJob implements Job {
    /**
     * è‹¥å‚数变量名修改 QuartzJobController中也需对应修改  æ—¶é—´ï¼š yyyyMMdd ä¾‹ï¼š 20230414
     */
    private String parameter;
    public void setParameter(String parameter) {
        this.parameter = parameter;
    }
    @Resource
    private IMdcEquipmentStatisticalShiftInfoService mdcEquipmentStatisticalShiftInfoService;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        log.info(String.format("定时统计单日班次数据任务 param: %s RunningAllEquipmentShiftStatisticalProcessJob start!  æ—¶é—´:" + DateUtils.now(), this.parameter));
        try {
            mdcEquipmentStatisticalShiftInfoService.runningAllEquipmentShiftStatisticalProcess(this.parameter);
            log.info("定时统计单日班次数据任务 RunningAllEquipmentShiftStatisticalProcessJob æ‰§è¡ŒæˆåŠŸ!");
        } catch (Exception e) {
            log.error("定时统计单日班次数据任务 RunningAllEquipmentShiftStatisticalProcessJob æ‰§è¡Œå¤±è´¥!");
            log.error(e.getMessage(), e);
        }
    }
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/EquipmentLogMapper.java
@@ -1,11 +1,17 @@
package org.jeecg.modules.mdc.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.mdc.entity.EquipmentLog;
import java.util.Date;
/**
 * @author: LiuS
 * @create: 2023-04-12 14:44
 */
public interface EquipmentLogMapper extends BaseMapper<EquipmentLog> {
    EquipmentLog getRow(@Param("equipmentid") String equipmentid, @Param("startTime") Date startTime);
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcDeviceCalendarMapper.java
@@ -7,6 +7,9 @@
import org.jeecg.modules.mdc.vo.MdcDeviceCalendarQueryVo;
import org.jeecg.modules.mdc.vo.MdcDeviceCalendarVo;
import java.util.Date;
import java.util.List;
/**
 * @Description: è®¾å¤‡å·¥ä½œæ—¥åŽ†è¡¨
 * @Author: jeecg-boot
@@ -16,4 +19,9 @@
public interface MdcDeviceCalendarMapper extends BaseMapper<MdcDeviceCalendar> {
    IPage<MdcDeviceCalendarVo> pageList(IPage<MdcDeviceCalendarVo> pageData, @Param("deviceCalendar") MdcDeviceCalendarQueryVo mdcDeviceCalendarQueryVo);
    List<MdcDeviceCalendarVo> listByEquipmentAndDate(@Param("equipmentid") String equipmentid, @Param("stringDate") String stringDate);
    List<MdcDeviceCalendarVo> findAcquiesceShift();
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentRunningSectionMapper.java
@@ -34,4 +34,9 @@
     * æŸ¥è¯¢è®¾å¤‡å•日运行状态时间段记录
     */
    List<MdcEquipmentRunningSection> listForEquipmentStatisticalInfo(@Param("equipmentId") String equipmentId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
    /**
     * è®¡ç®—一段时间内的数据
     */
    List<MdcEquipmentRunningSection> listEquipmentRunningSection(@Param("equipmentId") String equipmentid, @Param("startLong") long start, @Param("endLong") long end);
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentStatisticalShiftInfoMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
package org.jeecg.modules.mdc.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalShiftInfo;
/**
 * @author: LiuS
 * @create: 2023-07-24 11:23
 */
public interface MdcEquipmentStatisticalShiftInfoMapper extends BaseMapper<MdcEquipmentStatisticalShiftInfo> {
    /**
     * èŽ·å–è®¾å¤‡æœ€æ–°æ—¥æœŸçš„è¿è¡Œæ•°æ®
     *
     * @param equipmentid
     * @return
     */
    MdcEquipmentStatisticalShiftInfo getMaxStaticsData(@Param("equipmentId") String equipmentid);
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/EquipmentLogMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
<?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="org.jeecg.modules.mdc.mapper.EquipmentLogMapper">
    <select id="getRow" resultType="org.jeecg.modules.mdc.entity.EquipmentLog">
        SELECT top 1 * FROM EquipmentLog WHERE EquipmentID = #{ equipmentid } AND CollectTime &lt;= #{ startTime } AND Oporation in ('0','1','2','3') ORDER BY CollectTime ASC
    </select>
</mapper>
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcDeviceCalendarMapper.xml
@@ -42,4 +42,48 @@
        ORDER BY t4.equipment_name ASC, t1.EFFECTIVE_DATE ASC
    </select>
    <select id="listByEquipmentAndDate" resultType="org.jeecg.modules.mdc.vo.MdcDeviceCalendarVo">
        SELECT
            t1.*,
            t2.shift_name,
            t3.shift_sub_name,
            t3.start_date,
            t3.end_date,
            t3.sleep_start_date,
            t3.sleep_end_date,
            t3.is_day_span,
            t4.equipment_name,
            t4.equipment_id
        FROM
            mdc_device_calendar t1
            LEFT JOIN mdc_shift t2 ON t1.shift_id = t2.id
            LEFT JOIN mdc_shift_sub t3 ON t1.shift_sub_id = t3.id
            LEFT JOIN mdc_equipment t4 ON t1.equment_id = t4.equipment_id
        <where>
            <if test="equipmentid != null and equipmentid != ''">
                AND t4.equment_id = #{ equipmentid }
            </if>
            <if test="stringDate != null and stringDate != ''">
                AND t1.effective_date = #{ stringDate }
            </if>
        </where>
    </select>
    <select id="findAcquiesceShift" resultType="org.jeecg.modules.mdc.vo.MdcDeviceCalendarVo">
        SELECT
            t1.shift_id shiftId,
            t2.shift_sub_id shiftSubId,
            t1.shift_name shiftName,
            t2.shift_sub_name shiftSubName,
            t2.start_date startDate,
            t2.end_date endDate,
            t2.sleep_start_date sleepStartDate,
            t2.sleep_end_date sleepEndDate,
            t2.is_day_span isDaySpan
        FROM
            mdc_shift t1 LEFT JOIN mdc_shift_sub t2 ON t1.shift_sub_id = t2.id
        WHERE t1.default_shift = 'true'
    </select>
</mapper>
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentRunningSectionMapper.xml
@@ -30,5 +30,18 @@
            start_time
    </select>
    <!--计算一段时间内的数据-->
    <select id="listEquipmentRunningSection" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentRunningSection">
        SELECT
            *
        FROM
            mdc_equipment_running_section
        WHERE
            equipment_id = #{ equipmentId }
            AND  (start_long &lt;= #{ endLong } AND end_long &gt;= #{ startLong })
        ORDER BY
            start_time
    </select>
</mapper>
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentStatisticalShiftInfoMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,9 @@
<?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="org.jeecg.modules.mdc.mapper.MdcEquipmentStatisticalShiftInfoMapper">
    <select id="getMaxStaticsData" resultType="org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalShiftInfo">
        SELECT TOP 1 * FROM mdc_equipment_statistical_shift_info WHERE equipment_id = #{equipmentId} ORDER BY the_date DESC
    </select>
</mapper>
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IEquipmentLogService.java
@@ -21,4 +21,9 @@
     * æŸ¥è¯¢æŸä¸ªè®¾å¤‡æŸä¸ªæ—¶é—´ç‚¹ä¹‹åŽçš„æ•°æ®(报警数据)
     */
    List<EquipmentLog> findEquipmentLogByErrorEndTime(String equipmentId, Date endTime);
    /**
     * èŽ·å–è®¾å¤‡æŸä¸ªæ—¶é—´ç‚¹ä¹‹åŽçš„æœ€æ–°ä¸€æ¡æ•°æ®
     */
    EquipmentLog getRow(String equipmentid, Date startTime);
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcDeviceCalendarService.java
@@ -8,11 +8,13 @@
import org.jeecg.modules.mdc.vo.MdcDeviceCalendarVo;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
/**
 * @Description: è®¾å¤‡å·¥ä½œæ—¥åŽ†è¡¨
 * @Author: jeecg-boot
 * @Date:   2023-04-10
 * @Date: 2023-04-10
 * @Version: V1.0
 */
public interface IMdcDeviceCalendarService extends IService<MdcDeviceCalendar> {
@@ -27,4 +29,12 @@
     */
    boolean saveCalendar(EquipmentCalendarVo calendarVo);
    /**
     * æŸ¥è¯¢ç­åˆ¶æ•°æ®
     *
     * @param equipmentid
     * @param stringDates
     * @return
     */
    List<MdcDeviceCalendarVo> listByEquipmentAndDate(String equipmentid, List<String> stringDates);
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentRunningSectionService.java
@@ -12,7 +12,7 @@
/**
 * @Description: è®¾å¤‡è¿è¡Œæ—¶æ®µçŠ¶æ€è¡¨
 * @Author: LiuS
 * @Date:   2023-04-13
 * @Date: 2023-04-13
 * @Version: V1.0
 */
public interface IMdcEquipmentRunningSectionService extends IService<MdcEquipmentRunningSection> {
@@ -38,8 +38,17 @@
    List<MdcEquipmentRunningSection> listForEquipmentStatisticalInfo(String equipmentId, Date startDate, Date endDate);
    /**
     *  æŸ¥è¯¢è®¾å¤‡åŽ†å²è¿è¡ŒçŠ¶æ€è®°å½•æ•°æ®
     * æŸ¥è¯¢è®¾å¤‡åŽ†å²è¿è¡ŒçŠ¶æ€è®°å½•æ•°æ®
     */
    List<Map<String, Object>> logChart(MdcEquipmentRunningSectionVo equipmentRunningSectionVo);
    /**
     * è®¡ç®—一段时间内的数据
     */
    List<MdcEquipmentRunningSection> listEquipmentRunningSection(String equipmentid, long start, long end);
    /**
     * æŸ¥è¯¢æŸä¸ªè®¾å¤‡ä¸€æ®µæ—¶é—´å†…的数据
     */
    List<MdcEquipmentRunningSection> listRunningSectionFromLog(String equipmentid, long start, long end);
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentStatisticalInfoService.java
@@ -5,7 +5,7 @@
/**
 * @Description: è®¾å¤‡å•日运行数据表
 * @Author: jeecg-boot
 * @Author: lius
 * @Date: 2023-04-14
 * @Version: V1.0
 */
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentStatisticalShiftInfoService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
package org.jeecg.modules.mdc.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalShiftInfo;
/**
 * @Description: è®¾å¤‡å•日班次运行数据表
 * @author: LiuS
 * @create: 2023-07-24 10:32
 */
public interface IMdcEquipmentStatisticalShiftInfoService extends IService<MdcEquipmentStatisticalShiftInfo> {
    /**
     * è®¡ç®—设备单日班次运行数据
     *
     * @param dateTime
     */
    void runningAllEquipmentShiftStatisticalProcess(String dateTime);
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/EquipmentLogServiceImpl.java
@@ -43,4 +43,9 @@
        lambdaQuery.orderByAsc(EquipmentLog::getCollectTime);
        return lambdaQuery.list();
    }
    @Override
    public EquipmentLog getRow(String equipmentid, Date startTime) {
        return this.baseMapper.getRow(equipmentid, startTime);
    }
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcDeviceCalendarServiceImpl.java
@@ -132,6 +132,40 @@
    }
    /**
     * æŸ¥è¯¢ç­åˆ¶æ•°æ®
     *
     * @param equipmentid
     * @param stringDates
     * @return
     */
    @Override
    public List<MdcDeviceCalendarVo> listByEquipmentAndDate(String equipmentid, List<String> stringDates) {
        List<MdcDeviceCalendarVo> result = new ArrayList<>();
        try {
            //查询默认班制
            List<MdcDeviceCalendarVo> acquiesceShift = this.baseMapper.findAcquiesceShift();
            for (String stringDate : stringDates) {
                List<MdcDeviceCalendarVo> mdcDeviceCalendarVos = this.baseMapper.listByEquipmentAndDate(equipmentid, stringDate);
                if (mdcDeviceCalendarVos != null && !mdcDeviceCalendarVos.isEmpty()) {
                    result.addAll(mdcDeviceCalendarVos);
                } else {
                    acquiesceShift.forEach(mdcDeviceCalendarVo -> {
                        mdcDeviceCalendarVo.setEquipmentId(equipmentid);
                        mdcDeviceCalendarVo.setEffectiveDate(stringDate);
                    });
                    // è®¾ç½®é»˜è®¤ç­åˆ¶
                    result.addAll(acquiesceShift);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
    /**
     * èŽ·å–ä¸€æ®µæ—¶é—´èŒƒå›´å†…ç¬¦åˆæ˜ŸæœŸå‡ çš„æ—¥æœŸé›†åˆ
     *
     * @param startDate å¼€å§‹æ—¶é—´
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentRunningSectionServiceImpl.java
@@ -519,8 +519,68 @@
        return result;
    }
    /**
     * è®¡ç®—一段时间内的数据
     */
    @Override
    public List<MdcEquipmentRunningSection> listEquipmentRunningSection(String equipmentid, long start, long end) {
        return this.baseMapper.listEquipmentRunningSection(equipmentid, start, end);
    }
    @Override
    public List<MdcEquipmentRunningSection> listRunningSectionFromLog(String equipmentid, long start, long end) {
        if (StringUtils.isBlank(equipmentid) || start <= 0 || end <= 0) {
            return null;
        }
        Date startTime = DateUtils.toDate(DateUtils.longToDate(start), DateUtils.STR_DATE_TIME_SMALL);
        Date endTime = DateUtils.toDate(DateUtils.longToDate(end), DateUtils.STR_DATE_TIME_SMALL);
        EquipmentLog equipmentLog = equipmentLogService.getRow(equipmentid, startTime);
        if (equipmentLog == null) {
            return null;
        }
        List<EquipmentLog> logList = new ArrayList<>();
        EquipmentLog equipmentOne = new EquipmentLog();
        equipmentOne.setEquipmentId(equipmentid);
        equipmentOne.setOporation(equipmentLog.getOporation());
        equipmentOne.setCollectTime(startTime);
        logList.add(equipmentOne);
        List<EquipmentLog> logListLast = equipmentLogService.findEquipmentLogByEndTime(equipmentid, startTime);
        if (logListLast == null || logListLast.isEmpty()) {
            EquipmentLog two = new EquipmentLog();
            two.setEquipmentId(equipmentid);
            two.setOporation(equipmentLog.getOporation());
            two.setCollectTime(endTime);
            logList.add(two);
        } else {
            for (EquipmentLog log : logListLast) {
                if (log.getCollectTime().getTime() <= endTime.getTime()) {
                    logList.add(log);
                }
            }
        }
        if (logList.get(logList.size() - 1).getCollectTime().getTime() < endTime.getTime()) {
            EquipmentLog two = new EquipmentLog();
            two.setEquipmentId(equipmentid);
            two.setOporation(logList.get(logList.size() - 1).getOporation());
            two.setCollectTime(endTime);
            logList.add(two);
        }
        //点数据转为段数据
        List<MdcEquipmentRunningSection> erts = parseLogToRunningTrace(logList);
        if (erts.isEmpty()) {
            return Collections.emptyList();
        }
        //整合加工和待机时间小于n秒的数据
        erts = mergeLessMinTimeRecords(erts, null);
        List<MdcEquipmentRunningSection> running = mergeRunningTrace(erts);
        if (running != null || !running.isEmpty()) {
            this.ergodicTrim(running);
        }
        return running;
    }
    private Map<String, List<MdcEquipmentRunningSectionDto>> logCharts(MdcEquipmentRunningSectionVo equipmentRunningSectionVo, String date) {
        Map<String, List<MdcEquipmentRunningSectionDto>> map = new  HashMap<>();
        Map<String, List<MdcEquipmentRunningSectionDto>> map = new HashMap<>();
        List<MdcEquipmentRunningSectionDto> normal = new ArrayList<>();
        List<MdcEquipmentRunningSectionDto> waring = new ArrayList<>();
        //运行
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentStatisticalInfoServiceImpl.java
@@ -22,7 +22,7 @@
/**
 * @Description: è®¾å¤‡å•日运行数据表
 * @Author: jeecg-boot
 * @Author: lius
 * @Date: 2023-04-14
 * @Version: V1.0
 */
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentStatisticalShiftInfoServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,368 @@
package org.jeecg.modules.mdc.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang.StringUtils;
import org.jeecg.modules.mdc.entity.Equipment;
import org.jeecg.modules.mdc.entity.MdcEquipmentRunningSection;
import org.jeecg.modules.mdc.entity.MdcEquipmentStatisticalShiftInfo;
import org.jeecg.modules.mdc.mapper.MdcEquipmentStatisticalShiftInfoMapper;
import org.jeecg.modules.mdc.service.IEquipmentService;
import org.jeecg.modules.mdc.service.IMdcDeviceCalendarService;
import org.jeecg.modules.mdc.service.IMdcEquipmentRunningSectionService;
import org.jeecg.modules.mdc.service.IMdcEquipmentStatisticalShiftInfoService;
import org.jeecg.modules.mdc.util.DateUtils;
import org.jeecg.modules.mdc.vo.MdcDeviceCalendarVo;
import org.jeecg.modules.mdc.vo.MdcShiftDateVo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
 * @Description: è®¾å¤‡å•日班次运行数据表
 * @author: LiuS
 * @create: 2023-07-24 11:19
 */
@Service
public class MdcEquipmentStatisticalShiftInfoServiceImpl extends ServiceImpl<MdcEquipmentStatisticalShiftInfoMapper, MdcEquipmentStatisticalShiftInfo> implements IMdcEquipmentStatisticalShiftInfoService {
    @Resource
    private IEquipmentService equipmentService;
    @Resource
    private IMdcEquipmentRunningSectionService mdcEquipmentRunningSectionService;
    @Resource
    private IMdcDeviceCalendarService mdcDeviceCalendarService;
    /**
     * è®¡ç®—设备单日班次运行数据
     *
     * @param dateTime
     */
    @Override
    @Transactional(rollbackFor = {Exception.class})
    public void runningAllEquipmentShiftStatisticalProcess(String dateTime) {
        if (StringUtils.isNotBlank(dateTime)) {
            try {
                Date initDate = DateUtils.toDate(dateTime, "yyyyMMdd");
                if (initDate != null) {
                    this.remove(new LambdaQueryWrapper<MdcEquipmentStatisticalShiftInfo>().eq(MdcEquipmentStatisticalShiftInfo::getTheDate, dateTime));
                }
            } catch (Exception e) {
                log.error("参数格式不对", e);
            }
        }
        List<Equipment> equipmentList = equipmentService.list();
        List<MdcEquipmentStatisticalShiftInfo> result = new ArrayList<>();
        for (Equipment equipment : equipmentList) {
            List<MdcEquipmentStatisticalShiftInfo> equipmentStatisticalShiftInfoList = equipmentShiftStatisticalProcess(equipment, dateTime);
            if (equipmentStatisticalShiftInfoList != null && !equipmentStatisticalShiftInfoList.isEmpty()) {
                result.addAll(equipmentStatisticalShiftInfoList);
            }
        }
        if (!result.isEmpty()) {
            this.saveBatch(result);
        }
    }
    @Transactional(readOnly = true)
    List<MdcEquipmentStatisticalShiftInfo> equipmentShiftStatisticalProcess(Equipment equipment, String dateTime) {
        Date initDate = null;
        //取最后的统计数据
        if (StringUtils.isBlank(dateTime)) {
            MdcEquipmentStatisticalShiftInfo nearestDate = this.baseMapper.getMaxStaticsData(equipment.getEquipmentid());
            if (nearestDate != null) {
                initDate = DateUtils.toDate(nearestDate.getTheDate(), "yyyyMMdd");
                initDate = DateUtils.plusTime(initDate, 1);
            } else {
                //初次取值 å–最早时间
                MdcEquipmentRunningSection equipmentRunningSection = mdcEquipmentRunningSectionService.getFirstData(equipment.getEquipmentid());
                if (equipmentRunningSection != null) {
                    initDate = equipmentRunningSection.getStartTime();
                }
            }
        } else {
            try {
                initDate = DateUtils.toDate(dateTime, "yyyyMMdd");
                initDate = DateUtils.plusTime(initDate, 0);
            } catch (Exception e) {
                log.error("参数格式不对", null);
                return null;
            }
        }
        if (initDate == null) {
            return null;
        }
        Date endDate = DateUtils.plusTime(DateUtils.getNow(), 0);
        if (!DateUtils.less(initDate, endDate)) {
            return Collections.emptyList();
        }
        //获取两个时间段的差
        List<String> stringDates = DateUtils.getDatesStringList2(initDate, DateUtils.plusTime(endDate, -1));
        if (stringDates.isEmpty()) {
            return Collections.emptyList();
        }
        //查询班制班次信息
        Map<String, List<MdcDeviceCalendarVo>> listMap = this.mdcDeviceCalendarMap(equipment.getEquipmentid(), stringDates);
        if (listMap.isEmpty()) {
            listMap = new HashMap<>();
        }
        List<MdcEquipmentStatisticalShiftInfo> resultList = new ArrayList<>();
        for (String stringDate : stringDates) {
            if (listMap.containsKey(stringDate)) {
                List<MdcDeviceCalendarVo> mdcDeviceCalendarVos = listMap.get(stringDate);
                for (MdcDeviceCalendarVo mdcDeviceCalendarVo : mdcDeviceCalendarVos) {
                    //班制班次时间集合
                    List<MdcShiftDateVo> datesListByMdcDeviceCalendarVo = this.getDatesListByMdcDeviceCalendarVo(mdcDeviceCalendarVo);
                    if (datesListByMdcDeviceCalendarVo == null || datesListByMdcDeviceCalendarVo.isEmpty()) {
                        break;
                    }
                    //合并
                    MdcEquipmentStatisticalShiftInfo equipmentStatisticalShiftInfo = new MdcEquipmentStatisticalShiftInfo();
                    equipmentStatisticalShiftInfo.setEquipmentId(equipment.getEquipmentid());
                    //处理时间
                    Date date = DateUtils.strToDate(stringDate, DateUtils.STRDATE);
                    equipmentStatisticalShiftInfo.setTheDate(DateUtils.format(date, DateUtils.STRDATE));
                    equipmentStatisticalShiftInfo.setShiftId(mdcDeviceCalendarVo.getShiftId());
                    equipmentStatisticalShiftInfo.setShiftSubId(mdcDeviceCalendarVo.getShiftSubId());
                    equipmentStatisticalShiftInfo.setCreateTime(new Date());
                    for (MdcShiftDateVo dates : datesListByMdcDeviceCalendarVo) {
                        //处理数据
                        MdcEquipmentStatisticalShiftInfo shiftInfo = this.selectRunningEquipment(dates, equipment.getEquipmentid());
                        equipmentStatisticalShiftInfo.setWaitLong(equipmentStatisticalShiftInfo.getWaitLong().add(shiftInfo.getWaitLong()));
                        equipmentStatisticalShiftInfo.setProcessLong(equipmentStatisticalShiftInfo.getProcessLong().add(shiftInfo.getProcessLong()));
                        equipmentStatisticalShiftInfo.setCloseLong(equipmentStatisticalShiftInfo.getCloseLong().add(shiftInfo.getCloseLong()));
                        equipmentStatisticalShiftInfo.setOpenLong(equipmentStatisticalShiftInfo.getOpenLong().add(shiftInfo.getOpenLong()));
                        equipmentStatisticalShiftInfo.setErrorLong(equipmentStatisticalShiftInfo.getErrorLong().add(shiftInfo.getErrorLong()));
                    }
                }
            }
        }
        return resultList;
    }
    /**
     * æŸ¥è¯¢æŸä¸€å¤©æŸä¸ªç­æ¬¡çš„æ•°æ®
     *
     * @param dates
     * @param equipmentid
     * @return
     */
    private MdcEquipmentStatisticalShiftInfo selectRunningEquipment(MdcShiftDateVo dates, String equipmentid) {
        if (dates == null || StringUtils.isBlank(equipmentid)) {
            return null;
        }
        //不过滤休班和维修
        //获取班次时间段内数据
        List<MdcEquipmentRunningSection> sectionList = mdcEquipmentRunningSectionService.listEquipmentRunningSection(equipmentid, dates.getStart(), dates.getEnd());
        //查询无数据需要EquipmentLog解析
        if (sectionList.isEmpty()) {
            sectionList = mdcEquipmentRunningSectionService.listRunningSectionFromLog(equipmentid, dates.getStart(), dates.getEnd());
        }
        if (sectionList == null || sectionList.isEmpty()) {
            sectionList = new ArrayList<>();
        }
        //处理数据
        long datesStart = dates.getStart();
        long datesEnd = dates.getEnd();
        for (int i = 0; i < sectionList.size(); i++) {
            MdcEquipmentRunningSection equipmentRunningSection = sectionList.get(i);
            long start = equipmentRunningSection.getStartTime().getTime();
            long end = equipmentRunningSection.getEndTime().getTime();
            if (datesStart <= start) {
                equipmentRunningSection.setStartTime(equipmentRunningSection.getStartTime());
            } else {
                equipmentRunningSection.setStartTime(dates.getStartDate());
            }
            if (datesEnd >= end) {
                equipmentRunningSection.setEndTime(equipmentRunningSection.getEndTime());
            } else {
                equipmentRunningSection.setEndTime(dates.getEndDate());
            }
            Long sen = DateUtils.differentSecond(equipmentRunningSection.getStartTime(), equipmentRunningSection.getEndTime());
            if (sen <= 0) {
                sectionList.remove(i);
                i--;
            } else {
                equipmentRunningSection.setDuration(sen);
                equipmentRunningSection.setStartLong(equipmentRunningSection.getStartTime().getTime());
                equipmentRunningSection.setEndLong(equipmentRunningSection.getEndTime().getTime());
            }
        }
        MdcEquipmentStatisticalShiftInfo shiftInfo = new MdcEquipmentStatisticalShiftInfo();
        shiftInfo.setEquipmentId(equipmentid);
        shiftInfo.setShiftId(dates.getShiftId());
        shiftInfo.setShiftSubId(dates.getShiftSubId());
        shiftInfo.setTheDate(dates.getDay());
        long waitLong = 0L;
        long processLong = 0L;
        long closeLong = 0L;
        long errorLong = 0L;
        for (MdcEquipmentRunningSection equipmentRunningSection : sectionList) {
            Long duration = equipmentRunningSection.getDuration();
            int status = equipmentRunningSection.getStatus();
            if (status == 2) {
                waitLong += duration;
            }
            if (status == 3) {
                processLong += duration;
            }
            if (status == 0) {
                closeLong += duration;
            }
            if (status == 22) {
                errorLong += duration;
            }
        }
        shiftInfo.setWaitLong(new BigDecimal(waitLong));
        shiftInfo.setProcessLong(new BigDecimal(processLong));
        shiftInfo.setCloseLong(new BigDecimal(closeLong));
        //开机时间计算为 æœ‰æ•ˆæ—¶é•¿ - å…³æœºæ—¶é•¿
        shiftInfo.setOpenLong(new BigDecimal((datesEnd - datesStart) / 1000).subtract(shiftInfo.getCloseLong()));
        shiftInfo.setErrorLong(new BigDecimal(errorLong));
        return shiftInfo;
    }
    /**
     * æ—¶é—´é—®é¢˜å¤„理 å¦‚果当天最末尾时间大于当前时间 è¿”回0
     *
     * @param temp
     * @return
     */
    private List<MdcShiftDateVo> getDatesListByMdcDeviceCalendarVo(MdcDeviceCalendarVo temp) {
        List<MdcShiftDateVo> result = new ArrayList<>();
        String startDateStr = temp.getStartDate();
        String endDateStr = temp.getEndDate();
        String sleepStartDateStr = temp.getSleepStartDate();
        String sleepEndDateStr = temp.getSleepEndDate();
        String effectiveDateStr = temp.getEffectiveDate();
        String eff = DateUtils.format(DateUtils.toDate(effectiveDateStr, DateUtils.STRDATE), DateUtils.STR_DATE);
        try {
            Date effectiveDate = new SimpleDateFormat("yyyyMMdd").parse(effectiveDateStr);
            long startDate = getLongDate(effectiveDate, startDateStr, "false");
            long endDate = getLongDate(effectiveDate, endDateStr, temp.getIsDaySpan());
            //处理最后的时间问题 æ˜¯å¦è¶…过当前时间 å¦‚果超过不列入计算 BUG
            Date endTime = null;
            if ("true".equals(temp.getIsDaySpan())) {
                Date day = DateUtils.toDate(effectiveDateStr, DateUtils.STRDATE);
                day = DateUtils.plusTime(day, 1);
                String dayTime = DateUtils.format(day, DateUtils.STR_DATE);
                endTime = DateUtils.toDate(dayTime + " " + temp.getEndDate(), DateUtils.STR_DATE_TIME_SMALL);
            } else {
                Date day = DateUtils.toDate(effectiveDateStr, DateUtils.STRDATE);
                String dayTime = DateUtils.format(day, DateUtils.STR_DATE);
                endTime = DateUtils.toDate(dayTime + " " + temp.getEndDate(), DateUtils.STR_DATE_TIME_SMALL);
            }
            if (endTime.getTime() > DateUtils.getNow().getTime()) {
                return null;
            }
            if (StringUtils.isNotEmpty(sleepStartDateStr)) {
                long sleepStartDate = getLongDate(effectiveDate, sleepStartDateStr, "false");
                long sleepEndDate = getLongDate(effectiveDate, sleepEndDateStr, "false");
                Date start1 = DateUtils.getFormatDate(eff + " " + startDateStr, DateUtils.STR_DATE_TIME_SMALL);
                Date end1 = DateUtils.getFormatDate(eff + " " + sleepStartDateStr, DateUtils.STR_DATE_TIME_SMALL);
                Date start2 = DateUtils.getFormatDate(eff + " " + sleepEndDateStr, DateUtils.STR_DATE_TIME_SMALL);
                Date end2 = DateUtils.getFormatDate(eff + " " + endDateStr, DateUtils.STR_DATE_TIME_SMALL);
                if ("true".equals(temp.getIsDaySpan())) {
                    //跨天 åˆ¤æ–­ç­æ¬¡å¼€å§‹æ—¶é—´å’Œç»“束时间是否跨天
                    if (startDateStr.compareTo(endDateStr) < 0) {
                        //班次开始时间和结束时间都跨天
                        startDate = getLongDate(effectiveDate, startDateStr, temp.getIsDaySpan());
                        start1 = DateUtils.addDays(start1, 1);
                        end2 = DateUtils.addDays(end2, 1);
                        //班次开始时间和结束时间都跨天 ä¼‘息开始时间和结束时间也一定跨天
                        sleepStartDate = getLongDate(effectiveDate, sleepStartDateStr, temp.getIsDaySpan());
                        end1 = DateUtils.addDays(end1, 1);
                        sleepEndDate = getLongDate(effectiveDate, sleepEndDateStr, temp.getIsDaySpan());
                        start2 = DateUtils.addDays(start2, 1);
                    } else {
                        //班次开始时间不跨天, ç»“束时间跨天
                        end2 = DateUtils.addDays(end2, 1);
                        //判断休息开始时间是否跨天
                        if (startDateStr.compareTo(sleepStartDateStr) > 0) {
                            //开始休息时间跨天, ç»“束休息时间也一定跨天
                            sleepStartDate = getLongDate(effectiveDate, sleepStartDateStr, temp.getIsDaySpan());
                            end1 = DateUtils.addDays(end1, 1);
                            sleepEndDate = getLongDate(effectiveDate, sleepEndDateStr, temp.getIsDaySpan());
                            start2 = DateUtils.addDays(start2, 1);
                        } else {
                            //休息开始时间不跨天, åˆ¤æ–­ä¼‘息结束时间是否跨天
                            if (sleepStartDateStr.compareTo(sleepEndDateStr) > 0) {
                                //休息结束时间跨天
                                sleepEndDate = getLongDate(effectiveDate, sleepEndDateStr, temp.getIsDaySpan());
                                start2 = DateUtils.addDays(start2, 1);
                            }
                        }
                    }
                }
                MdcShiftDateVo dates1 = new MdcShiftDateVo(temp.getShiftId(), temp.getShiftSubId(), startDate, sleepStartDate, effectiveDateStr, endTime, start1, end1);
                result.add(dates1);
                MdcShiftDateVo dates2 = new MdcShiftDateVo(temp.getShiftId(), temp.getShiftSubId(), sleepEndDate, endDate, effectiveDateStr, endTime, start2, end2);
                result.add(dates2);
            } else {
                /*获取班次的开始时间结束时间*/
                Date start = DateUtils.getFormatDate(eff + " " + startDateStr, DateUtils.STR_DATE_TIME_SMALL);
                Date end = DateUtils.getFormatDate(eff + " " + endDateStr, DateUtils.STR_DATE_TIME_SMALL);
                if ("true".equals(temp.getIsDaySpan())) {
                    if (startDateStr.compareTo(endDateStr) < 0) {
                        startDate = getLongDate(effectiveDate, startDateStr, temp.getIsDaySpan());
                        start = DateUtils.addDays(start, 1);
                    }
                    end = DateUtils.addDays(end, 1);
                }
                MdcShiftDateVo dates = new MdcShiftDateVo(temp.getShiftId(), temp.getShiftSubId(), startDate, endDate, effectiveDateStr, endTime, start, end);
                result.add(dates);
            }
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return result;
    }
    /**
     * è®¾å¤‡ç­æ¬¡è½¬æ¢
     *
     * @param equipmentid
     * @param stringDates
     * @return
     */
    private Map<String, List<MdcDeviceCalendarVo>> mdcDeviceCalendarMap(String equipmentid, List<String> stringDates) {
        List<MdcDeviceCalendarVo> mdcDeviceCalendarVos = mdcDeviceCalendarService.listByEquipmentAndDate(equipmentid, stringDates);
        if (mdcDeviceCalendarVos.isEmpty()) {
            return null;
        }
        Map<String, List<MdcDeviceCalendarVo>> map = new HashMap<>();
        for (MdcDeviceCalendarVo mdcDeviceCalendarVo : mdcDeviceCalendarVos) {
            List<MdcDeviceCalendarVo> mdcDeviceCalendarVos1;
            if (map.containsKey(mdcDeviceCalendarVo.getEffectiveDate())) {
                mdcDeviceCalendarVos1 = map.get(mdcDeviceCalendarVo.getEffectiveDate());
            } else {
                mdcDeviceCalendarVos1 = new ArrayList<>();
            }
            mdcDeviceCalendarVos1.add(mdcDeviceCalendarVo);
            map.put(mdcDeviceCalendarVo.getEffectiveDate(), mdcDeviceCalendarVos1);
        }
        return map;
    }
    private long getLongDate(Date effectiveDate, String startDateStr, String isDaySpan) {
        String[] startDateArray = startDateStr.split(":");
        Calendar cal = Calendar.getInstance();
        cal.setTime(effectiveDate);
        cal.set(Calendar.HOUR_OF_DAY, Integer.parseInt(startDateArray[0]));
        cal.set(Calendar.MINUTE, Integer.parseInt(startDateArray[1]));
        cal.set(Calendar.SECOND, Integer.parseInt(startDateArray[2]));
        if ("true".equals(isDaySpan)) {
            cal.add(Calendar.DAY_OF_YEAR, 1);
        }
        return cal.getTime().getTime();
    }
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/vo/MdcShiftDateVo.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,106 @@
package org.jeecg.modules.mdc.vo;
import java.util.Date;
/**
 * @author: LiuS
 * @create: 2023-07-25 10:32
 */
public class MdcShiftDateVo {
    private String shiftId;
    private String shiftSubId;
    private long start;
    private long end;
    private String day;
    private Date endTime;
    /**
     * å¼€å§‹æ—¶é—´
     */
    private Date startDate;
    /**
     * ç»“束时间
     */
    private Date endDate;
    public String getShiftId() {
        return shiftId;
    }
    public void setShiftId(String shiftId) {
        this.shiftId = shiftId;
    }
    public String getShiftSubId() {
        return shiftSubId;
    }
    public void setShiftSubId(String shiftSubId) {
        this.shiftSubId = shiftSubId;
    }
    public long getStart() {
        return start;
    }
    public void setStart(long start) {
        this.start = start;
    }
    public long getEnd() {
        return end;
    }
    public void setEnd(long end) {
        this.end = end;
    }
    public String getDay() {
        return day;
    }
    public void setDay(String day) {
        this.day = day;
    }
    public Date getEndTime() {
        return endTime;
    }
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    public Date getStartDate() {
        return startDate;
    }
    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }
    public Date getEndDate() {
        return endDate;
    }
    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }
    public MdcShiftDateVo(String shiftId, String shiftSubId, long start, long end, String day, Date endTime, Date startDate, Date endDate) {
        this.shiftId = shiftId;
        this.shiftSubId = shiftSubId;
        this.start = start;
        this.end = end;
        this.day = day;
        this.endTime = endTime;
        this.startDate = startDate;
        this.endDate = endDate;
    }
}