| | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.smallbun.screw.core.util.StringUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageHistoryTask; |
| | | import com.mes.bigstoragecagetask.entity.request.BigStorageCageHistoryRequest; |
| | | import com.mes.bigstoragecagetask.mapper.BigStorageCageHistoryTaskMapper; |
| | | import com.mes.bigstoragecagetask.service.BigStorageCageHistoryTaskService; |
| | | import com.mes.largenscreen.entity.DailyProductionVO; |
| | | import com.mes.largenscreen.entity.RunTime; |
| | | import com.mes.tools.DateUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public class BigStorageCageHistoryTaskServiceImpl extends ServiceImpl<BigStorageCageHistoryTaskMapper, BigStorageCageHistoryTask> implements BigStorageCageHistoryTaskService { |
| | | |
| | | @Override |
| | | public List<BigStorageCageHistoryTask> queryBigStorageCageHistoryTask(BigStorageCageHistoryRequest request) { |
| | | if (null == request) { |
| | | request = new BigStorageCageHistoryRequest(); |
| | | } |
| | | public Page<BigStorageCageHistoryTask> queryBigStorageCageHistoryTask(BigStorageCageHistoryRequest request) { |
| | | if (null == request.getBeginDate()) { |
| | | request.setBeginDate(DateUtil.getBeginDate()); |
| | | request.setEndDate(DateUtil.getEndDate()); |
| | | } |
| | | Page<BigStorageCageHistoryTask> page = new Page<>(request.getPageNo(), request.getPageSize()); |
| | | LambdaQueryWrapper<BigStorageCageHistoryTask> wrapper = new LambdaQueryWrapper<BigStorageCageHistoryTask>() |
| | | .like(StringUtils.isBlank(request.getGlassId()), BigStorageCageHistoryTask::getGlassId, request.getGlassId()) |
| | | .eq(request.getStartSlot() !=0, BigStorageCageHistoryTask::getStartSlot, request.getStartSlot()) |
| | | .eq(request.getTargetSlot() !=0, BigStorageCageHistoryTask::getTargetSlot, request.getTargetSlot()) |
| | | .in(CollectionUtil.isNotEmpty(request.getTaskStateList()) , BigStorageCageHistoryTask::getTaskState, request.getTaskStateList()) |
| | | .in(CollectionUtil.isNotEmpty(request.getTaskTypeList()) , BigStorageCageHistoryTask::getTaskType, request.getTaskTypeList()) |
| | | .like(StringUtils.isNotBlank(request.getGlassId()), BigStorageCageHistoryTask::getGlassId, request.getGlassId()) |
| | | .eq(request.getStartSlot() != 0, BigStorageCageHistoryTask::getStartSlot, request.getStartSlot()) |
| | | .eq(request.getTargetSlot() != 0, BigStorageCageHistoryTask::getTargetSlot, request.getTargetSlot()) |
| | | .in(CollectionUtil.isNotEmpty(request.getTaskStateList()), BigStorageCageHistoryTask::getTaskState, request.getTaskStateList()) |
| | | .in(CollectionUtil.isNotEmpty(request.getTaskTypeList()), BigStorageCageHistoryTask::getTaskType, request.getTaskTypeList()) |
| | | .between(BigStorageCageHistoryTask::getCreateTime, request.getBeginDate(), request.getEndDate()) |
| | | .orderByDesc(BigStorageCageHistoryTask::getCreateTime); |
| | | return this.list(wrapper); |
| | | .orderByAsc(BigStorageCageHistoryTask::getId); |
| | | return this.page(page, wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public DailyProductionVO queryBigDailyProduction(BigStorageCageHistoryRequest request) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | String beginDate = null; |
| | | String endDate = null; |
| | | if (com.baomidou.mybatisplus.core.toolkit.StringUtils.checkValNotNull(request.getBeginDate())) { |
| | | beginDate = sdf.format(request.getBeginDate()); |
| | | endDate = sdf.format(request.getEndDate()); |
| | | } |
| | | return baseMapper.queryBigDailyProduction(beginDate, endDate); |
| | | } |
| | | |
| | | @Override |
| | | public List<RunTime> queryRunTimes(){ |
| | | return baseMapper.queryRunTimes(); |
| | | } |
| | | |
| | | } |
| | | |