yangys
2024-10-30 25db770e621f1259b8d5b7fd514207f7481c2d0f
smart-man-boot/src/main/java/com/qianwen/smartman/modules/mdc/service/impl/SuperAggregateOutputServiceImpl.java
@@ -2,6 +2,8 @@
import cn.hutool.core.date.LocalDateTimeUtil;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List;
import com.qianwen.smartman.common.constant.DateConstant;
import com.qianwen.smartman.modules.mdc.entity.SuperAggregateOutput;
@@ -22,9 +24,14 @@
    public List<SuperAggregateOutput> getOutputData(List<Long> workstationIds, StatisticalMethodEnum statisticalMethodEnum, LocalDate startDate, LocalDate endDate) {
        List<SuperAggregateOutput> superAggregateOutputList;
        if (StatisticalMethodEnum.SHIFT.equals(statisticalMethodEnum) || StatisticalMethodEnum.DAY.equals(statisticalMethodEnum) || StatisticalMethodEnum.WEEK.equals(statisticalMethodEnum) || StatisticalMethodEnum.MONTH.equals(statisticalMethodEnum)) {
            superAggregateOutputList = this.baseMapper.getOutputDataByFactoryDate(workstationIds, LocalDateTimeUtil.format(startDate, "yyyyMMdd"), LocalDateTimeUtil.format(endDate, "yyyyMMdd"));
            superAggregateOutputList = this.baseMapper.getOutputDataByFactoryDate(workstationIds, Integer.parseInt(LocalDateTimeUtil.format(startDate, "yyyyMMdd")) , Integer.parseInt(LocalDateTimeUtil.format(endDate, "yyyyMMdd")));
        } else {
            superAggregateOutputList = this.baseMapper.getOutputDataByNaturalDate(workstationIds, LocalDateTimeUtil.format(startDate, DateConstant.PATTERN_DATE_TIME), LocalDateTimeUtil.format(endDate.plusDays(1L), DateConstant.PATTERN_DATE_TIME));
           //好像界面上没有调用
            //superAggregateOutputList = this.baseMapper.getOutputDataByNaturalDate(workstationIds, LocalDateTimeUtil.format(startDate, DateConstant.PATTERN_DATE_TIME), LocalDateTimeUtil.format(endDate.plusDays(1L), DateConstant.PATTERN_DATE_TIME));
           LocalDateTime startTime = LocalDateTime.of(startDate, LocalTime.MIN);
            LocalDateTime endTime = LocalDateTime.of(endDate.plusDays(1L), LocalTime.MIN);
            superAggregateOutputList = this.baseMapper.getOutputDataByNaturalDate(workstationIds, startTime,endTime );
        }
        return superAggregateOutputList;
    }