From a7c479daff0e44988f174f8c93fb41f30fdc48e1 Mon Sep 17 00:00:00 2001 From: ZengTao <2773468879@qq.com> Date: 星期一, 17 三月 2025 16:53:19 +0800 Subject: [PATCH] 大屏添加历史任务按钮 --- hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollowtask/service/impl/HollowBigStorageCageHistoryTaskServiceImpl.java | 38 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 38 insertions(+), 0 deletions(-) diff --git a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollowtask/service/impl/HollowBigStorageCageHistoryTaskServiceImpl.java b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollowtask/service/impl/HollowBigStorageCageHistoryTaskServiceImpl.java index 0910a0f..39b6143 100644 --- a/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollowtask/service/impl/HollowBigStorageCageHistoryTaskServiceImpl.java +++ b/hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollowtask/service/impl/HollowBigStorageCageHistoryTaskServiceImpl.java @@ -1,10 +1,19 @@ package com.mes.hollowtask.service.impl; +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.hollowtask.entity.HollowBigStorageCageHistoryTask; +import com.mes.hollowtask.entity.request.HollowBigStorageCageHistoryRequest; import com.mes.hollowtask.mapper.HollowBigStorageCageHistoryTaskMapper; import com.mes.hollowtask.service.HollowBigStorageCageHistoryTaskService; +import com.mes.largenscreen.entity.DailyProductionVO; +import com.mes.tools.DateUtil; import org.springframework.stereotype.Service; + +import java.text.SimpleDateFormat; /** * (HollowBigStorageCageHistoryTask)琛ㄦ湇鍔″疄鐜扮被 @@ -15,5 +24,34 @@ @Service public class HollowBigStorageCageHistoryTaskServiceImpl extends ServiceImpl<HollowBigStorageCageHistoryTaskMapper, HollowBigStorageCageHistoryTask> implements HollowBigStorageCageHistoryTaskService { + @Override + public Page<HollowBigStorageCageHistoryTask> queryHollowBigStorageCageHistoryTask(HollowBigStorageCageHistoryRequest request) { + Page<HollowBigStorageCageHistoryTask> page = new Page<>(request.getPageNo(), request.getPageSize()); + if (null == request.getBeginDate()) { + request.setBeginDate(DateUtil.getBeginDate()); + request.setEndDate(DateUtil.getEndDate()); + } + LambdaQueryWrapper<HollowBigStorageCageHistoryTask> wrapper = new LambdaQueryWrapper<HollowBigStorageCageHistoryTask>() + .like(StringUtils.isNotBlank(request.getGlassId()), HollowBigStorageCageHistoryTask::getGlassId, request.getGlassId()) + .eq(request.getStartSlot() != 0, HollowBigStorageCageHistoryTask::getStartSlot, request.getStartSlot()) + .eq(request.getTargetSlot() != 0, HollowBigStorageCageHistoryTask::getTargetSlot, request.getTargetSlot()) + .in(CollectionUtil.isNotEmpty(request.getTaskStateList()), HollowBigStorageCageHistoryTask::getTaskState, request.getTaskStateList()) + .in(CollectionUtil.isNotEmpty(request.getTaskTypeList()), HollowBigStorageCageHistoryTask::getTaskType, request.getTaskTypeList()) + .between(HollowBigStorageCageHistoryTask::getCreateTime, request.getBeginDate(), request.getEndDate()) + .orderByDesc(HollowBigStorageCageHistoryTask::getCreateTime); + return this.page(page, wrapper); + } + + @Override + public DailyProductionVO queryHollowDailyProduction(HollowBigStorageCageHistoryRequest 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.queryHollowDailyProduction(beginDate, endDate); + } } -- Gitblit v1.8.0