From cd4f4b0a3f981d0ceda6ec1a36bf6a4447f52cf1 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Mon, 22 Jan 2024 16:20:02 +0800 Subject: [PATCH] =?UTF-8?q?#=20=E6=97=A5=E5=B8=B8=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E6=9C=88=E5=BA=A6=E6=9F=A5=E8=AF=A2=E5=88=86=E9=A1=B5=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/MaintenanceTaskQueryController.java | 10 ++++++++++ .../maintenance/service/IMaintenanceTaskQueryService.java | 6 +++++- .../service/impl/MaintenanceTaskQueryServiceImpl.java | 14 ++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceTaskQueryController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceTaskQueryController.java index c58ff94..215cfef 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceTaskQueryController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceTaskQueryController.java @@ -1,10 +1,12 @@ package com.hnac.hzims.operational.maintenance.controller; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.operational.maintenance.service.IMaintenanceTaskQueryService; import com.hnac.hzims.operational.maintenance.vo.MaintenanceTaskQueryVO; import io.swagger.annotations.*; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -37,6 +39,14 @@ public class MaintenanceTaskQueryController extends BladeController { return R.data(maintenanceTaskQueryService.getMaintenanceTaskQuery(month, deptId)); } + @GetMapping("/getMaintenanceTaskPage") + @ApiOperation("查询日常维护任务-分页查询") + @ApiOperationSupport(order = 1) + public R getMaintenanceTaskPage(@RequestParam("month") @ApiParam(value = "查询月份",required = true) String month, + @RequestParam(value = "deptId",required = false) @ApiParam("查询机构") Long deptId, Query query) { + return R.data(maintenanceTaskQueryService.getMaintenanceTaskPage(month,deptId,query)); + } + @GetMapping("/exportMaintenanceTaskQuery") @ApiOperation("导出日常维护任务") @ApiOperationSupport(order = 1) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IMaintenanceTaskQueryService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IMaintenanceTaskQueryService.java index 4223c84..4fd388c 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IMaintenanceTaskQueryService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IMaintenanceTaskQueryService.java @@ -1,13 +1,17 @@ package com.hnac.hzims.operational.maintenance.service; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.operational.maintenance.vo.MaintenanceTaskQueryVO; +import org.springblade.core.mp.support.Query; import javax.servlet.http.HttpServletResponse; import java.util.List; public interface IMaintenanceTaskQueryService { - List getMaintenanceTaskQuery(String month,Long deptId); + IPage getMaintenanceTaskPage(String month, Long deptId, Query query); + + List getMaintenanceTaskQuery(String month, Long deptId); void exportMaintenanceTaskQuery(String month, Long deptId, HttpServletResponse response); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceTaskQueryServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceTaskQueryServiceImpl.java index ec533e2..11c2053 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceTaskQueryServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceTaskQueryServiceImpl.java @@ -8,8 +8,10 @@ import com.alibaba.excel.write.metadata.style.WriteCellStyle; import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Lists; +import com.hnac.hzims.common.utils.Condition; import com.hnac.hzims.equipment.entity.EmInfoEntity; import com.hnac.hzims.equipment.feign.IEmInfoClient; import com.hnac.hzims.operational.maintenance.constants.DictConstant; @@ -22,6 +24,7 @@ import com.hnac.hzims.spare.entity.WtSpBasicEntity; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.poi.ss.usermodel.BorderStyle; +import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.DateUtil; @@ -60,6 +63,17 @@ public class MaintenanceTaskQueryServiceImpl implements IMaintenanceTaskQuerySer @Override + public IPage getMaintenanceTaskPage(String month, Long deptId, Query query) { + LambdaQueryWrapper wq = Wrappers.lambdaQuery() + .like(OperMaintenanceTaskEntity::getDisposeTime, month) + .like(Func.isNotEmpty(deptId),OperMaintenanceTaskEntity::getCreateDept,deptId) + .orderByAsc(OperMaintenanceTaskEntity::getDisposeTime); + IPage page = maintenanceTaskService.page(Condition.getPage(query), wq); + page.setRecords(this.fillTaskQuery(page.getRecords())); + return page; + } + + @Override public List getMaintenanceTaskQuery(String month,Long deptId) { LambdaQueryWrapper wq = Wrappers.lambdaQuery() .like(OperMaintenanceTaskEntity::getDisposeTime, month)