From a74a794b389c84b9e8b02cc4addc7dd4734e2940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com> Date: Mon, 12 Jun 2023 16:46:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=8C=BA=E5=9F=9F=E5=92=8C?= =?UTF-8?q?=E6=9C=88=E4=BB=BD=E5=88=86=E9=A1=B5=E6=9F=A5=E8=AF=A2=E7=BC=BA?= =?UTF-8?q?=E9=99=B7=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/AreaMonthlyDetailsController.java | 33 ++++++++++++++++++++-- .../operational/main/vo/OperPhenomenonVo.java | 30 +++++++++++++++++++- 2 files changed, 59 insertions(+), 4 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/web/AreaMonthlyDetailsController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/web/AreaMonthlyDetailsController.java index 7504c75..7e3d4b7 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/web/AreaMonthlyDetailsController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/web/AreaMonthlyDetailsController.java @@ -2,6 +2,7 @@ package com.hnac.hzims.operational.main.controller.web; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.google.common.collect.Lists; @@ -38,6 +39,9 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springblade.core.mp.base.BaseEntity; import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.Condition; import org.springblade.core.tool.api.R; @@ -210,6 +214,29 @@ public class AreaMonthlyDetailsController { OperPhenomenonVo entity, String taskIds, Date findTimeEnd) { Page operDefectEntityPage = new Page<>(page, size); LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + //部门 + if (CollectionUtils.isNotEmpty(entity.getCreateDept())) { + queryWrapper.in(BaseEntity::getCreateDept, entity.getCreateDept()); + } + + if (StringUtils.isNotEmpty(entity.getDefectCode())) { + queryWrapper.eq(OperPhenomenonEntity::getDefectCode, entity.getDefectCode()); + } + + + if (StringUtils.isNotEmpty(entity.getSourceCode())) { + queryWrapper.eq(OperPhenomenonEntity::getSourceCode, entity.getSourceCode()); + } + + + if (StringUtils.isNotEmpty(entity.getFaultName())) { + queryWrapper.eq(OperPhenomenonEntity::getFaultName, entity.getFaultName()); + } + + if (ObjectUtils.isNotEmpty(entity.getDefectLevel())){ + queryWrapper.eq(OperPhenomenonEntity::getDefectLevel, entity.getDefectLevel()); + } + if (StringUtil.isNotBlank(taskIds)) { queryWrapper.in(OperPhenomenonEntity::getId, Lists.newArrayList(taskIds.split(","))); } @@ -240,14 +267,14 @@ public class AreaMonthlyDetailsController { queryWrapper.orderByDesc(OperPhenomenonEntity::getUpdateTime); IPage pages = phenomenonService.page(operDefectEntityPage, queryWrapper); - Integer defect = entity.getDefect() == null ? 0 : entity.getDefect(); + Integer defect = entity.getDefect() == null ? 0 : entity.getDefect(); Integer conclusionStatusNum = entity.getConclusionStatusNum() == null ? 1 : entity.getConclusionStatusNum(); //过滤 List collect = pages.getRecords().stream().filter(item -> (defect.equals(item.getIsDefect()) || conclusionStatusNum.equals(item.getDiscriminateStatus() != null ? - Integer.parseInt(item.getDiscriminateStatus()) : null))) - .collect(Collectors.toList()); + Integer.parseInt(item.getDiscriminateStatus()) : null))) + .collect(Collectors.toList()); pages.setRecords(collect); pages.setTotal(collect.size()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/vo/OperPhenomenonVo.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/vo/OperPhenomenonVo.java index 6d75a79..70fefb6 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/vo/OperPhenomenonVo.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/vo/OperPhenomenonVo.java @@ -8,6 +8,7 @@ import org.springframework.format.annotation.DateTimeFormat; import java.time.YearMonth; import java.util.Date; +import java.util.List; /** * @Author WL @@ -19,6 +20,34 @@ import java.util.Date; public class OperPhenomenonVo { /** + * 缺陷等级 + */ + private String defectLevel; + + /** + * 故障 + */ + private String faultName; + + /** + * 缺陷来源 + */ + private String sourceCode; + + + /** + * 所属机构 + */ + private List createDept; + + + /** + * 缺陷编码 + */ + private String defectCode; + + + /** * 发现时间 */ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @@ -48,7 +77,6 @@ public class OperPhenomenonVo { private Date planEndTime; - @ApiModelProperty(value = "年月") @TableField(exist = false) private YearMonth yearMonth;