|
|
@ -2,7 +2,6 @@ package com.hnac.hzims.operational.defect.controller; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
|
|
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
import com.hnac.hzims.common.invalid.DictInvalid; |
|
|
|
import com.hnac.hzims.common.invalid.DictInvalid; |
|
|
|
import com.hnac.hzims.common.invalid.ObjectRequiredInvalid; |
|
|
|
import com.hnac.hzims.common.invalid.ObjectRequiredInvalid; |
|
|
@ -12,7 +11,6 @@ import com.hnac.hzims.common.logs.enums.OperatorType; |
|
|
|
import com.hnac.hzims.operational.defect.entity.OperDefectEntity; |
|
|
|
import com.hnac.hzims.operational.defect.entity.OperDefectEntity; |
|
|
|
import com.hnac.hzims.operational.defect.service.IOperDefectService; |
|
|
|
import com.hnac.hzims.operational.defect.service.IOperDefectService; |
|
|
|
import com.hnac.hzims.operational.defect.vo.OperDefectVO; |
|
|
|
import com.hnac.hzims.operational.defect.vo.OperDefectVO; |
|
|
|
import com.hnac.hzims.operational.defect.wrapper.OperDefectWrapper; |
|
|
|
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
@ -20,18 +18,15 @@ import io.swagger.annotations.ApiParam; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import org.springblade.core.boot.ctrl.BladeController; |
|
|
|
import org.springblade.core.boot.ctrl.BladeController; |
|
|
|
import org.springblade.core.log.annotation.ApiLog; |
|
|
|
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.Condition; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
|
|
|
|
import org.springblade.flow.core.entity.BladeFlow; |
|
|
|
import org.springblade.flow.core.entity.BladeFlow; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.time.YearMonth; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
@ -71,27 +66,10 @@ public class OperDefectController extends BladeController { |
|
|
|
@OperationAnnotation(moduleName = "缺陷管理", |
|
|
|
@OperationAnnotation(moduleName = "缺陷管理", |
|
|
|
title = "缺陷库", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE, action |
|
|
|
title = "缺陷库", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE, action |
|
|
|
= "分页") |
|
|
|
= "分页") |
|
|
|
public R<IPage<OperDefectVO>> list(OperDefectEntity defect, Query query) { |
|
|
|
public R<IPage<OperDefectEntity>> list(OperDefectVO defect, Query query) { |
|
|
|
LambdaQueryWrapper<OperDefectEntity> queryWrapper = Condition.getQueryWrapper(new OperDefectEntity(), defect); |
|
|
|
LambdaQueryWrapper<OperDefectEntity> queryWrapper = defectService.getQueryWrapper(defect); |
|
|
|
if (defect.getActStartTime() != null) { |
|
|
|
IPage<OperDefectEntity> page = defectService.page(Condition.getPage(query), queryWrapper); |
|
|
|
queryWrapper.ge(OperDefectEntity::getActStartTime, defect.getActStartTime()); |
|
|
|
return R.data(page); |
|
|
|
} |
|
|
|
|
|
|
|
if (defect.getActEndTime() != null) { |
|
|
|
|
|
|
|
queryWrapper.le(OperDefectEntity::getActEndTime, defect.getActEndTime()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (defect.getStartTime() != null) { |
|
|
|
|
|
|
|
queryWrapper.ge(OperDefectEntity::getCreateTime, defect.getStartTime()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (defect.getEndTime() != null) { |
|
|
|
|
|
|
|
queryWrapper.le(OperDefectEntity::getCreateTime, defect.getEndTime()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (defect.getCreateDept() != null) { |
|
|
|
|
|
|
|
queryWrapper.eq(OperDefectEntity::getCreateDept, defect.getCreateDept()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
queryWrapper.orderByDesc(OperDefectEntity::getActStartTime); |
|
|
|
|
|
|
|
IPage<OperDefectEntity> pages = defectService.page(Condition.getPage(query), queryWrapper); |
|
|
|
|
|
|
|
IPage<OperDefectVO> vos = OperDefectWrapper.build().pageVO(pages); |
|
|
|
|
|
|
|
return R.data(vos); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|