Browse Source

# 日常维护月度查询分页接口

zhongwei
haungxing 10 months ago
parent
commit
cd4f4b0a3f
  1. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/controller/MaintenanceTaskQueryController.java
  2. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/IMaintenanceTaskQueryService.java
  3. 14
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/MaintenanceTaskQueryServiceImpl.java

10
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<IPage> 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)

6
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<MaintenanceTaskQueryVO> getMaintenanceTaskQuery(String month,Long deptId);
IPage getMaintenanceTaskPage(String month, Long deptId, Query query);
List<MaintenanceTaskQueryVO> getMaintenanceTaskQuery(String month, Long deptId);
void exportMaintenanceTaskQuery(String month, Long deptId, HttpServletResponse response);

14
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<OperMaintenanceTaskEntity> wq = Wrappers.<OperMaintenanceTaskEntity>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<MaintenanceTaskQueryVO> getMaintenanceTaskQuery(String month,Long deptId) {
LambdaQueryWrapper<OperMaintenanceTaskEntity> wq = Wrappers.<OperMaintenanceTaskEntity>lambdaQuery()
.like(OperMaintenanceTaskEntity::getDisposeTime, month)

Loading…
Cancel
Save