From cc0e9036de6e922e8fe254fef01d8de9996024b7 Mon Sep 17 00:00:00 2001 From: hyingbo <1363390067@qq.com> Date: 星期四, 17 七月 2025 18:16:03 +0800 Subject: [PATCH] 获取报警描述修改 --- lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceCharactersServiceImpl.java | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceCharactersServiceImpl.java b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceCharactersServiceImpl.java index d967588..523b03d 100644 --- a/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceCharactersServiceImpl.java +++ b/lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/service/impl/DeviceCharactersServiceImpl.java @@ -5,24 +5,31 @@ import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.shiro.SecurityUtils; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.vo.LoginUser; import org.jeecg.modules.dnc.entity.DeviceCharacters; import org.jeecg.modules.dnc.exception.ExceptionCast; import org.jeecg.modules.dnc.mapper.DeviceCharactersMapper; -import org.jeecg.modules.dnc.response.CommonCode; -import org.jeecg.modules.dnc.response.QueryPageResponseResult; import org.jeecg.modules.dnc.request.DeviceCharactersRequest; +import org.jeecg.modules.dnc.response.CommonCode; import org.jeecg.modules.dnc.service.IDeviceCharactersService; import org.springframework.stereotype.Service; + +import java.util.Arrays; +import java.util.List; @Service public class DeviceCharactersServiceImpl extends ServiceImpl<DeviceCharactersMapper, DeviceCharacters> implements IDeviceCharactersService { @Override - public QueryPageResponseResult<DeviceCharacters> findByPageList(int page, int size, DeviceCharactersRequest deviceCharactersRequest) { + public Result<?> findByPageList(int page, int size, DeviceCharactersRequest deviceCharactersRequest) { if(page < 1 || size < 1) { ExceptionCast.cast(CommonCode.INVALID_PAGE); } IPage<DeviceCharacters> pageData = new Page<>(page, size); + LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + List<String> productIdList = Arrays.asList(user.getProductionIds().split(",")); LambdaQueryChainWrapper<DeviceCharacters> lambdaQuery = super.lambdaQuery(); if(deviceCharactersRequest != null) { lambdaQuery.like(StrUtil.isNotEmpty(deviceCharactersRequest.getDeviceNo()),DeviceCharacters::getDeviceNo, deviceCharactersRequest.getDeviceNo()); @@ -32,7 +39,9 @@ lambdaQuery.ge(StrUtil.isNotEmpty(deviceCharactersRequest.getStartTime()),DeviceCharacters::getCreateTime,deviceCharactersRequest.getStartTime()); lambdaQuery.le(StrUtil.isNotEmpty(deviceCharactersRequest.getEndTime()),DeviceCharacters::getCreateTime,deviceCharactersRequest.getEndTime()); } + lambdaQuery.in(DeviceCharacters::getDepartId, productIdList); + lambdaQuery.orderByDesc(DeviceCharacters::getCreateTime); IPage<DeviceCharacters> userIPage = lambdaQuery.page(pageData); - return new QueryPageResponseResult<>(CommonCode.SUCCESS, userIPage); + return Result.ok(userIPage); } } -- Gitblit v1.9.3