From bd67df3c058cadeb3925b901af897f1952caacba Mon Sep 17 00:00:00 2001 From: Joshi <3040996759@qq.com> Date: Mon, 25 May 2026 15:06:55 +0800 Subject: [PATCH] =?UTF-8?q?feat(mes/eqp):=20=E4=B8=BA=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=B7=A1=E6=A3=80=E8=AE=B0=E5=BD=95=E5=88=86=E9=A1=B5=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=96=B0=E5=A2=9E=E6=97=B6=E9=97=B4=E8=8C=83=E5=9B=B4?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E5=8F=8A=E5=85=B3=E8=81=94=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在EqpEquipmentInspectionRecordBo中新增startInspectTime和endInspectTime字段,并添加日期格式化注解,支持按巡检时间范围查询 - 新增Mapper方法selectVoPagePlus及对应的XML映射,通过左连接关联检验清单表以获取checkContent和checkStandard字段 - 在Service层新增buildQueryWrapperPlus方法构建查询条件,支持对新增的时间范围字段进行筛选 - 在EqpEquipmentInspectionRecordVo中新增checkContent和checkStandard字段,用于在分页查询结果中展示关联的检验内容和标准 --- .../bo/EqpEquipmentInspectionRecordBo.java | 15 +++++++++++++++ .../vo/EqpEquipmentInspectionRecordVo.java | 10 ++++++++++ .../EqpEquipmentInspectionRecordMapper.java | 4 ++++ ...pEquipmentInspectionRecordServiceImpl.java | 19 +++++++++++++++++-- .../EqpEquipmentInspectionRecordMapper.xml | 17 +++++++++++++++++ 5 files changed, 63 insertions(+), 2 deletions(-) diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/domain/bo/EqpEquipmentInspectionRecordBo.java b/klp-mes/src/main/java/com/klp/mes/eqp/domain/bo/EqpEquipmentInspectionRecordBo.java index d7ca53a3..21c77417 100644 --- a/klp-mes/src/main/java/com/klp/mes/eqp/domain/bo/EqpEquipmentInspectionRecordBo.java +++ b/klp-mes/src/main/java/com/klp/mes/eqp/domain/bo/EqpEquipmentInspectionRecordBo.java @@ -7,6 +7,7 @@ import javax.validation.constraints.*; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; /** * 设备巡检记录业务对象 eqp_equipment_inspection_record @@ -64,5 +65,19 @@ public class EqpEquipmentInspectionRecordBo extends BaseEntity { */ private String photo; + /** + * 巡检时间开始 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startInspectTime; + + /** + * 巡检时间结束 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date endInspectTime; + } diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/domain/vo/EqpEquipmentInspectionRecordVo.java b/klp-mes/src/main/java/com/klp/mes/eqp/domain/vo/EqpEquipmentInspectionRecordVo.java index 07cf066d..3dde7ddc 100644 --- a/klp-mes/src/main/java/com/klp/mes/eqp/domain/vo/EqpEquipmentInspectionRecordVo.java +++ b/klp-mes/src/main/java/com/klp/mes/eqp/domain/vo/EqpEquipmentInspectionRecordVo.java @@ -74,5 +74,15 @@ public class EqpEquipmentInspectionRecordVo { */ private String photo; + /** + * 检验内容 + */ + private String checkContent; + + /** + * 检验标准 + */ + private String checkStandard; + } diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/mapper/EqpEquipmentInspectionRecordMapper.java b/klp-mes/src/main/java/com/klp/mes/eqp/mapper/EqpEquipmentInspectionRecordMapper.java index 64fab8d4..b0cc276f 100644 --- a/klp-mes/src/main/java/com/klp/mes/eqp/mapper/EqpEquipmentInspectionRecordMapper.java +++ b/klp-mes/src/main/java/com/klp/mes/eqp/mapper/EqpEquipmentInspectionRecordMapper.java @@ -1,8 +1,11 @@ package com.klp.mes.eqp.mapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.klp.mes.eqp.domain.EqpEquipmentInspectionRecord; import com.klp.mes.eqp.domain.vo.EqpEquipmentInspectionRecordVo; import com.klp.common.core.mapper.BaseMapperPlus; +import org.apache.ibatis.annotations.Param; /** * 设备巡检记录Mapper接口 @@ -12,4 +15,5 @@ import com.klp.common.core.mapper.BaseMapperPlus; */ public interface EqpEquipmentInspectionRecordMapper extends BaseMapperPlus { + Page selectVoPagePlus(Page build, @Param("ew") QueryWrapper lqw); } diff --git a/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentInspectionRecordServiceImpl.java b/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentInspectionRecordServiceImpl.java index 4fd4bd25..91c04f05 100644 --- a/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentInspectionRecordServiceImpl.java +++ b/klp-mes/src/main/java/com/klp/mes/eqp/service/impl/EqpEquipmentInspectionRecordServiceImpl.java @@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil; import com.klp.common.core.page.TableDataInfo; import com.klp.common.core.domain.PageQuery; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.klp.common.utils.StringUtils; @@ -44,11 +45,25 @@ public class EqpEquipmentInspectionRecordServiceImpl implements IEqpEquipmentIns */ @Override public TableDataInfo queryPageList(EqpEquipmentInspectionRecordBo bo, PageQuery pageQuery) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); - Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + QueryWrapper qw = buildQueryWrapperPlus(bo); + Page result = baseMapper.selectVoPagePlus(pageQuery.build(), qw); return TableDataInfo.build(result); } + private QueryWrapper buildQueryWrapperPlus(EqpEquipmentInspectionRecordBo bo) { + QueryWrapper qw = new QueryWrapper<>(); + qw.eq(bo.getCheckId() != null, "r.check_id", bo.getCheckId()); + qw.eq(StringUtils.isNotBlank(bo.getPhoto()), "r.photo", bo.getPhoto()); + qw.eq(bo.getShift() != null, "r.shift", bo.getShift()); + qw.eq(bo.getRunStatus() != null, "r.run_status", bo.getRunStatus()); + qw.eq(StringUtils.isNotBlank(bo.getInspector()), "r.inspector", bo.getInspector()); + qw.eq(StringUtils.isNotBlank(bo.getAbnormalDesc()), "r.abnormal_desc", bo.getAbnormalDesc()); + qw.ge(bo.getStartInspectTime() != null, "r.inspect_time", bo.getStartInspectTime()); + qw.le(bo.getEndInspectTime() != null, "r.inspect_time", bo.getEndInspectTime()); + qw.eq("r.del_flag", 0); + return qw; + } + /** * 查询设备巡检记录列表 */ diff --git a/klp-mes/src/main/resources/mapper/eqp/EqpEquipmentInspectionRecordMapper.xml b/klp-mes/src/main/resources/mapper/eqp/EqpEquipmentInspectionRecordMapper.xml index 1f5c97ad..59ef145f 100644 --- a/klp-mes/src/main/resources/mapper/eqp/EqpEquipmentInspectionRecordMapper.xml +++ b/klp-mes/src/main/resources/mapper/eqp/EqpEquipmentInspectionRecordMapper.xml @@ -21,5 +21,22 @@ +