From c33a6470e7cd927218168742155b2d69b0598b9a Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Tue, 24 Sep 2024 17:17:38 +0800 Subject: [PATCH] =?UTF-8?q?#=E8=BF=90=E8=A1=8C=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/electric/service/impl/RunTemplateServiceImpl.java | 13 ++++++++++++- .../history/service/impl/HistoryTemplateServiceImpl.java | 5 ++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/RunTemplateServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/RunTemplateServiceImpl.java index b727720..32dce82 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/RunTemplateServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/electric/service/impl/RunTemplateServiceImpl.java @@ -1,11 +1,16 @@ package com.hnac.hzims.electric.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.hnac.hzims.electric.entity.RunTemplateEntity; import com.hnac.hzims.electric.mapper.RunTemplateMapper; import com.hnac.hzims.electric.service.IRunTemplateService; +import com.hnac.hzims.history.entity.HistoryTemplateEntity; import com.hnac.hzims.history.vo.HistoryTemplateParamVo; +import org.springblade.core.secure.utils.AuthUtil; +import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.core.tool.utils.StringUtil; import org.springframework.stereotype.Service; /** @@ -23,6 +28,12 @@ public class RunTemplateServiceImpl extends ServiceImpl pageCondition(HistoryTemplateParamVo params, IPage page) { - return null; + LambdaQueryWrapper wrapper = new LambdaQueryWrapper(); + wrapper.eq(RunTemplateEntity::getCreateUser, AuthUtil.getUserId()); + wrapper.orderByDesc(RunTemplateEntity::getCreateTime); + if(StringUtil.isNotBlank(params.getStationId())){ + wrapper.eq(RunTemplateEntity::getStationId,params.getStationId()); + } + return super.page(page,wrapper); } } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/history/service/impl/HistoryTemplateServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/history/service/impl/HistoryTemplateServiceImpl.java index 6a0244e..cbac715 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/history/service/impl/HistoryTemplateServiceImpl.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/history/service/impl/HistoryTemplateServiceImpl.java @@ -7,6 +7,7 @@ import com.hnac.hzims.history.entity.HistoryTemplateEntity; import com.hnac.hzims.history.mapper.HistoryTemplateMapper; import com.hnac.hzims.history.service.IHistoryTemplateService; import com.hnac.hzims.history.vo.HistoryTemplateParamVo; +import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.StringUtil; import org.springframework.stereotype.Service; @@ -26,13 +27,11 @@ public class HistoryTemplateServiceImpl extends ServiceImpl pageCondition(HistoryTemplateParamVo params, IPage page) { LambdaQueryWrapper wrapper = new LambdaQueryWrapper(); + wrapper.eq(HistoryTemplateEntity::getCreateUser,AuthUtil.getUserId()); wrapper.orderByDesc(HistoryTemplateEntity::getCreateTime); if(StringUtil.isNotBlank(params.getStationId())){ wrapper.eq(HistoryTemplateEntity::getStationId,params.getStationId()); } - if(ObjectUtil.isNotEmpty(params.getCreateUser())){ - wrapper.eq(HistoryTemplateEntity::getCreateUser,params.getCreateUser()); - } return super.page(page,wrapper); }