package com.qianwen.smartman.modules.mdc.service.impl; import cn.hutool.core.date.LocalDateTimeUtil; import java.time.LocalDate; import java.util.List; import com.qianwen.smartman.common.constant.DateConstant; import com.qianwen.smartman.modules.mdc.entity.SuperAggregateOutput; import com.qianwen.smartman.modules.mdc.enums.StatisticalMethodEnum; import com.qianwen.smartman.modules.mdc.mapper.SuperAggregateOutputMapper; import com.qianwen.smartman.modules.mdc.service.ISuperAggregateOutputService; import org.springframework.stereotype.Service; @Service public class SuperAggregateOutputServiceImpl implements ISuperAggregateOutputService { private final SuperAggregateOutputMapper baseMapper; public SuperAggregateOutputServiceImpl(final SuperAggregateOutputMapper baseMapper) { this.baseMapper = baseMapper; } @Override public List getOutputData(List workstationIds, StatisticalMethodEnum statisticalMethodEnum, LocalDate startDate, LocalDate endDate) { List 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")); } else { superAggregateOutputList = this.baseMapper.getOutputDataByNaturalDate(workstationIds, LocalDateTimeUtil.format(startDate, DateConstant.PATTERN_DATE_TIME), LocalDateTimeUtil.format(endDate.plusDays(1L), DateConstant.PATTERN_DATE_TIME)); } return superAggregateOutputList; } @Override public List queryPerfByDay(Long workstationId, String startTime, String endTime, Long employeeId) { return this.baseMapper.queryPerfByDay(workstationId, startTime, endTime, employeeId); } @Override public List queryPerfByWeek(Long workstationId, List weeks, Long employeeId) { return this.baseMapper.queryPerfByWeek(workstationId, weeks, employeeId); } @Override public List queryPerfByMonth(Long workstationId, List months, Long employeeId) { return this.baseMapper.queryPerfByMonth(workstationId, months, employeeId); } @Override public List queryPerfByEtDay(Long employeeId, String time) { return this.baseMapper.queryPerfByEtDay(employeeId, time); } @Override public List queryPerfByEtWeek(Long employeeId, Integer week) { return this.baseMapper.queryPerfByEtWeek(employeeId, week); } @Override public List queryPerfByEtMonth(Long employeeId, Integer month) { return this.baseMapper.queryPerfByEtMonth(employeeId, month); } @Override public List queryPerfByWtDay(Long workstationId, String time) { return this.baseMapper.queryPerfByWtDay(workstationId, time); } @Override public List queryPerfByWtWeek(Long workstationId, Integer week) { return this.baseMapper.queryPerfByWtWeek(workstationId, week); } @Override public List queryPerfByWtMonth(Long workstationId, Integer month) { return this.baseMapper.queryPerfByWtMonth(workstationId, month); } }