|
|
|
@ -2,6 +2,7 @@ package com.hnac.hzims.operational.defect.controller;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
|
import com.hnac.hzims.common.invalid.DictInvalid; |
|
|
|
|
import com.hnac.hzims.common.invalid.ObjectRequiredInvalid; |
|
|
|
@ -19,6 +20,7 @@ import io.swagger.annotations.ApiParam;
|
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.springblade.core.boot.ctrl.BladeController; |
|
|
|
|
import org.springblade.core.log.annotation.ApiLog; |
|
|
|
|
import org.springblade.core.mp.base.BaseEntity; |
|
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
@ -29,6 +31,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.time.YearMonth; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
@ -82,6 +85,11 @@ public class OperDefectController extends BladeController {
|
|
|
|
|
if (defect.getEndTime() != null) { |
|
|
|
|
queryWrapper.le(OperDefectEntity::getCreateTime, defect.getEndTime()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
queryWrapper.eq(StringUtils.isNotBlank(defect.getAreaId()), BaseEntity::getCreateDept, defect.getCreateDept()); |
|
|
|
|
|
|
|
|
|
queryWrapper.apply(defect.getYearMonth() != null,"date_format(CREATE_TIME,'%Y-%m')", defect.getYearMonth()); |
|
|
|
|
|
|
|
|
|
queryWrapper.orderByDesc(OperDefectEntity::getActStartTime); |
|
|
|
|
IPage<OperDefectEntity> pages = defectService.page(Condition.getPage(query), queryWrapper); |
|
|
|
|
IPage<OperDefectVO> vos = OperDefectWrapper.build().pageVO(pages); |
|
|
|
|