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)