diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperAppearanceEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperAppearanceEntity.java index 7549a14..a1cd9d0 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperAppearanceEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperAppearanceEntity.java @@ -96,12 +96,6 @@ public class OperAppearanceEntity extends TenantEntity { */ @ApiModelProperty(value = "现象文件附件,多个文件url通过,隔开") private String fileUrls; - /** - * 初步分析结果 - */ - @ApiModelProperty(value = "初步分析结果") - private String initResult; - /** * 甄别人 @@ -121,15 +115,6 @@ public class OperAppearanceEntity extends TenantEntity { @ApiModelProperty(value = "甄别时间") private Date discriminateTime; - - - /** - * 甄别状态:已甄别 1 和未甄别 0 ,默认0 - */ - @QueryField(condition = SqlCondition.EQUAL) - @ApiModelProperty(value = "甄别状态:已甄别 1 和未甄别 0 ,默认0") - private String discriminateStatus; - /** * 是否为缺陷 */ @@ -165,5 +150,5 @@ public class OperAppearanceEntity extends TenantEntity { */ @JsonSerialize(nullsUsing = NullSerializer.class) @ApiModelProperty(value = "已有缺陷编码") - private Long existDefectId; + private String existDefectId; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java index f600186..bb38c6d 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectEntity.java @@ -127,6 +127,13 @@ public class OperDefectEntity extends TenantEntity { @JsonSerialize(nullsUsing = NullSerializer.class) @ApiModelProperty(value = "处理人") private Long handler; + + /** + * 发现人 + */ + @JsonSerialize(nullsUsing = NullSerializer.class) + @ApiModelProperty(value = "发现人") + private Long finder; /** * 缺陷等级 */ @@ -163,7 +170,7 @@ public class OperDefectEntity extends TenantEntity { */ @JsonSerialize(nullsUsing = NullSerializer.class) @ApiModelProperty(value = "已有缺陷编码") - private Long existDefectId; + private String existDefectId; /** * 定论人 */ @@ -192,5 +199,10 @@ public class OperDefectEntity extends TenantEntity { @JsonSerialize(nullsUsing = NullSerializer.class) @ApiModelProperty(value = "计划工时") private Integer planHours; - + /** + * 故障名称 + */ + @QueryField(condition = SqlCondition.LIKE) + @ApiModelProperty(value = "故障名称") + private String faultName; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectStatisticsEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectStatisticsEntity.java index ea245e5..f888978 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectStatisticsEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperDefectStatisticsEntity.java @@ -225,7 +225,13 @@ public class OperDefectStatisticsEntity extends TenantEntity { ) @ApiModelProperty(value = "定论时间") private Date conclusionTime; - + /** + * 是否为缺陷 + */ + @QueryField(condition = SqlCondition.EQUAL) + @JsonSerialize(nullsUsing = NullSerializer.class) + @ApiModelProperty(value = "是否为缺陷,0 否,1是") + private Integer isDefect; /** * 计划处理人 */ @@ -274,6 +280,21 @@ public class OperDefectStatisticsEntity extends TenantEntity { */ @JsonSerialize(nullsUsing = NullSerializer.class) @ApiModelProperty(value = "已有缺陷编码") - private Long existDefectId; + private String existDefectId; + /** + * 操作票负责人 + */ + @ApiModelProperty("操作票负责人") + private Long principal; + /** + * 手填值班负责人 + */ + @ApiModelProperty(value = "手填操作票负责人") + private String principalManual; + /** + * 操作票 + */ + @ApiModelProperty(value = "操作票") + private String ticketId; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java index 8c4ecc6..e9dc6af 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/entity/OperPhenomenonEntity.java @@ -1,6 +1,7 @@ package com.hnac.hzims.operational.defect.entity; import com.baomidou.mybatisplus.annotation.SqlCondition; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; @@ -370,6 +371,29 @@ public class OperPhenomenonEntity extends TenantEntity { */ @JsonSerialize(nullsUsing = NullSerializer.class) @ApiModelProperty(value = "已有缺陷编码") - private Long existDefectId; + private String existDefectId; + /** + * 操作票负责人 + */ + @ApiModelProperty("操作票负责人") + private Long principal; + /** + * 手填操作票负责人 + */ + @ApiModelProperty(value = "手填操作票负责人") + private String principalManual; + /** + * 操作票 + */ + @ApiModelProperty(value = "操作票") + private String ticketId; + + /** + * 处理人 + */ + @JsonSerialize(nullsUsing = NullSerializer.class) + @TableField(exist = false) + @ApiModelProperty(value = "处理人") + private Long flowHandler; } diff --git a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperDefectStatisticsVO.java b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperDefectStatisticsVO.java index 890a73f..aa6d0f2 100644 --- a/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperDefectStatisticsVO.java +++ b/hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/defect/vo/OperDefectStatisticsVO.java @@ -1,9 +1,13 @@ package com.hnac.hzims.operational.defect.vo; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import com.hnac.hzims.operational.defect.entity.OperDefectStatisticsEntity; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; /** * 模型VO @@ -36,4 +40,27 @@ public class OperDefectStatisticsVO extends OperDefectStatisticsEntity { @ApiModelProperty("机构名称") private String deptName; + /** + * 定论时间范围-最晚 + */ + @DateTimeFormat( + pattern = "yyyy-MM-dd HH:mm:ss" + ) + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss" + ) + @ApiModelProperty(value = "定论时间范围-最晚") + private Date conclusionEndTime; + + /** + * 定论时间范围-最晚 + */ + @DateTimeFormat( + pattern = "yyyy-MM-dd HH:mm:ss" + ) + @JsonFormat( + pattern = "yyyy-MM-dd HH:mm:ss" + ) + @ApiModelProperty(value = "定论时间范围-最晚") + private Date createEndTime; } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java index d23124c..555a9c6 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectController.java @@ -2,7 +2,6 @@ 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; @@ -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.service.IOperDefectService; 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.ApiImplicitParams; import io.swagger.annotations.ApiOperation; @@ -20,18 +18,15 @@ 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; -import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.flow.core.entity.BladeFlow; import org.springframework.validation.annotation.Validated; 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; @@ -71,27 +66,10 @@ public class OperDefectController extends BladeController { @OperationAnnotation(moduleName = "缺陷管理", title = "缺陷库", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE, action = "分页") - public R> list(OperDefectEntity defect, Query query) { - LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(new OperDefectEntity(), defect); - if (defect.getActStartTime() != null) { - queryWrapper.ge(OperDefectEntity::getActStartTime, defect.getActStartTime()); - } - 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 pages = defectService.page(Condition.getPage(query), queryWrapper); - IPage vos = OperDefectWrapper.build().pageVO(pages); - return R.data(vos); + public R> list(OperDefectVO defect, Query query) { + LambdaQueryWrapper queryWrapper = defectService.getQueryWrapper(defect); + IPage page = defectService.page(Condition.getPage(query), queryWrapper); + return R.data(page); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectStatisticsController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectStatisticsController.java index c2d7f0c..d42c2f9 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectStatisticsController.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/controller/OperDefectStatisticsController.java @@ -7,9 +7,7 @@ import com.hnac.hzims.common.logs.annotation.OperationAnnotation; import com.hnac.hzims.common.logs.enums.BusinessType; import com.hnac.hzims.common.logs.enums.OperatorType; import com.hnac.hzims.operational.defect.dto.OperDefectStatisticsDTO; -import com.hnac.hzims.operational.defect.entity.OperDefectEntity; import com.hnac.hzims.operational.defect.entity.OperDefectStatisticsEntity; -import com.hnac.hzims.operational.defect.entity.OperFaultEntity; import com.hnac.hzims.operational.defect.service.IOperDefectStatisticsService; import com.hnac.hzims.operational.defect.vo.OperDefectStatisticsVO; import com.hnac.hzims.operational.defect.wrapper.OperDefectStatisticsWrapper; @@ -24,13 +22,14 @@ import org.springblade.core.mp.support.Condition; 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.Func; import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.system.entity.Dept; import org.springblade.system.feign.ISysClient; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; -import javax.validation.Valid; import java.util.List; import java.util.stream.Collectors; @@ -72,18 +71,8 @@ public class OperDefectStatisticsController extends BladeController { }) @OperationAnnotation(moduleName = "缺陷管理",title = "缺陷记录",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,action = "分页") - public R> list( OperDefectStatisticsEntity entity, Query query) { - LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(new OperDefectStatisticsEntity(),entity); - if(entity.getActStartTime()!=null){ - queryWrapper.ge(OperDefectStatisticsEntity::getActStartTime,entity.getActStartTime()); - } - if(entity.getActEndTime()!=null){ - queryWrapper.le(OperDefectStatisticsEntity::getActStartTime,entity.getActEndTime()); - } - if (entity.getCreateDept() != null) { - queryWrapper.eq(OperDefectStatisticsEntity::getCreateDept, entity.getCreateDept()); - } - queryWrapper.orderByDesc(OperDefectStatisticsEntity::getActStartTime); + public R> list( OperDefectStatisticsVO entity, Query query) { + LambdaQueryWrapper queryWrapper = statisticsService.getQueryWrapper(entity); IPage pages = statisticsService.page(Condition.getPage(query), queryWrapper); IPage vos = OperDefectStatisticsWrapper.build().pageVO(pages); if(CollectionUtil.isNotEmpty(vos.getRecords())){ diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java index 7142578..ede6661 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectService.java @@ -101,5 +101,5 @@ public interface IOperDefectService extends BaseService { */ IPage selectPage(Page operDefectEntityPage, OperDefectEntity defect); - LambdaQueryWrapper getQueryWrapper(OperDefectVO defectVO); + LambdaQueryWrapper getQueryWrapper(OperDefectVO defect); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectStatisticsService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectStatisticsService.java index bbeefe5..70a1bc1 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectStatisticsService.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/IOperDefectStatisticsService.java @@ -1,7 +1,9 @@ package com.hnac.hzims.operational.defect.service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.hnac.hzims.operational.defect.dto.OperDefectStatisticsDTO; import com.hnac.hzims.operational.defect.entity.OperDefectStatisticsEntity; +import com.hnac.hzims.operational.defect.vo.OperDefectStatisticsVO; import org.springblade.core.mp.base.BaseService; import java.util.List; @@ -20,4 +22,7 @@ public interface IOperDefectStatisticsService extends BaseService getEMStaticstic(String emCode); + + LambdaQueryWrapper getQueryWrapper(OperDefectStatisticsVO statistics); + } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperAppearanceServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperAppearanceServiceImpl.java index 6a7ecb9..9b9756c 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperAppearanceServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperAppearanceServiceImpl.java @@ -54,8 +54,8 @@ public class OperAppearanceServiceImpl extends BaseServiceImpl getQueryWrapper(OperDefectStatisticsVO statistics) { + LambdaQueryWrapper queryWrapper = Condition.getQueryWrapper(new OperDefectStatisticsEntity(),statistics); + if(statistics.getActStartTime()!=null){ + queryWrapper.ge(OperDefectStatisticsEntity::getActStartTime,statistics.getActStartTime()); + } + if(statistics.getActEndTime()!=null){ + queryWrapper.le(OperDefectStatisticsEntity::getActStartTime,statistics.getActEndTime()); + } + if (statistics.getDefectLevel() != null) { + queryWrapper.like(OperDefectStatisticsEntity::getDefectLevel, statistics.getDefectLevel()); + } + if (statistics.getDisposer() != null) { + queryWrapper.eq(OperDefectStatisticsEntity::getDisposer, statistics.getDisposer()); + } + if (statistics.getConclusion() != null) { + queryWrapper.like(OperDefectStatisticsEntity::getConclusion, statistics.getConclusion()); + } + if (statistics.getConclusionTime() != null) { + queryWrapper.le(OperDefectStatisticsEntity::getConclusionTime, statistics.getConclusionTime()); + } + if (Func.isNotEmpty(statistics.getConclusionEndTime())) { + queryWrapper.ge(OperDefectStatisticsEntity::getConclusionTime, statistics.getConclusionEndTime()); + } + if (statistics.getCreateTime() != null) { + queryWrapper.le(OperDefectStatisticsEntity::getCreateTime, statistics.getCreateTime()); + } + if (Func.isNotEmpty(statistics.getCreateEndTime())) { + queryWrapper.ge(OperDefectStatisticsEntity::getCreateTime, statistics.getCreateEndTime()); + } + if (statistics.getEmCode() != null) { + queryWrapper.eq(OperDefectStatisticsEntity::getEmCode, statistics.getEmCode()); + } + if (statistics.getIsWarehousing() != null) { + queryWrapper.eq(OperDefectStatisticsEntity::getIsWarehousing, statistics.getIsWarehousing()); + } + if (statistics.getSourceCode() != null) { + queryWrapper.eq(OperDefectStatisticsEntity::getSourceCode, statistics.getSourceCode()); + } + if (statistics.getConclusionPeople() != null) { + queryWrapper.eq(OperDefectStatisticsEntity::getConclusionPeople, statistics.getConclusionPeople()); + } + if (statistics.getCreateDept() != null) { + queryWrapper.eq(OperDefectStatisticsEntity::getCreateDept, statistics.getCreateDept()); + } + queryWrapper.orderByDesc(OperDefectStatisticsEntity::getCreateTime); + return queryWrapper; + } }