From 23e71a79de6e2863b67fff59624a5598956882d0 Mon Sep 17 00:00:00 2001 From: zch Date: Fri, 7 Mar 2025 09:46:28 +0800 Subject: [PATCH] =?UTF-8?q?change(hwmom-mes):=E4=BA=A4=E6=8E=A5=E7=8F=AD?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=A2=9E=E5=8A=A0=E8=BF=9E=E8=A1=A8=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 ProdShiftChange 模型中添加 teamName、machineName 和 shiftName 字段 - 在 ProdShiftChangeServiceImpl 中实现连表查询逻辑 - 在 ProdShiftChangeVo 中添加相应的 Excel属性注解 --- .../dromara/mes/domain/ProdShiftChange.java | 13 +++++++++++++ .../mes/domain/vo/ProdShiftChangeVo.java | 11 +++++++++++ .../impl/ProdShiftChangeServiceImpl.java | 18 ++++++++++++++++++ 3 files changed, 42 insertions(+) diff --git a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/ProdShiftChange.java b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/ProdShiftChange.java index 8b33d4ca..40a965fe 100644 --- a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/ProdShiftChange.java +++ b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/ProdShiftChange.java @@ -1,6 +1,7 @@ package org.dromara.mes.domain; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; @@ -65,5 +66,17 @@ public class ProdShiftChange extends TenantEntity { */ private String remark; + /** 班组名称 */ + @TableField(exist = false) + private String teamName;//JOIN连表查询 + + /** 机台名称 */ + @TableField(exist = false) + private String machineName;//JOIN连表查询 + + /** 班次名称 */ + @TableField(exist = false) + private String shiftName;//JOIN连表查询 + } diff --git a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/vo/ProdShiftChangeVo.java b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/vo/ProdShiftChangeVo.java index 49774575..d6ddd1be 100644 --- a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/vo/ProdShiftChangeVo.java +++ b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/vo/ProdShiftChangeVo.java @@ -74,5 +74,16 @@ public class ProdShiftChangeVo implements Serializable { @ExcelProperty(value = "备注") private String remark; + /** 班组名称 */ + @ExcelProperty(value = "班组名称") + private String teamName;//JOIN连表查询 + + /** 机台名称 */ + @ExcelProperty(value = "机台名称") + private String machineName;//JOIN连表查询 + + /** 班次名称 */ + @ExcelProperty(value = "班次名称") + private String shiftName;//JOIN连表查询 } diff --git a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdShiftChangeServiceImpl.java b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdShiftChangeServiceImpl.java index fe6e8782..0bcc2093 100644 --- a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdShiftChangeServiceImpl.java +++ b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdShiftChangeServiceImpl.java @@ -8,6 +8,9 @@ import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.mes.domain.BaseClassTeamInfo; +import org.dromara.mes.domain.BaseShiftInfo; +import org.dromara.mes.domain.ProdBaseMachineInfo; import org.dromara.mes.domain.ProdShiftChange; import org.dromara.mes.domain.bo.ProdShiftChangeBo; import org.dromara.mes.domain.vo.ProdShiftChangeVo; @@ -76,6 +79,21 @@ public class ProdShiftChangeServiceImpl implements IProdShiftChangeService { Map params = bo.getParams(); MPJLambdaWrapper lqw = JoinWrappers.lambda(ProdShiftChange.class) .selectAll(ProdShiftChange.class) + + //连表查询班组名称 + .select(BaseClassTeamInfo::getTeamName) + .leftJoin(BaseClassTeamInfo.class,BaseClassTeamInfo::getClassTeamId,ProdShiftChange::getClassTeamId) + + //连表查询班次名称 + .select(BaseShiftInfo::getShiftName) + .leftJoin(BaseShiftInfo.class,BaseShiftInfo::getShiftId,ProdShiftChange::getShiftId) + + //连表查询机台名称 + .select(ProdBaseMachineInfo::getMachineName) + .leftJoin(ProdBaseMachineInfo.class,ProdBaseMachineInfo::getMachineId,ProdShiftChange::getMachineId) + + + .eq(bo.getShiftChangeId() != null, ProdShiftChange::getShiftChangeId, bo.getShiftChangeId()) .eq(bo.getShiftChangeTime() != null, ProdShiftChange::getShiftChangeTime, bo.getShiftChangeTime()) .eq(bo.getMachineId() != null, ProdShiftChange::getMachineId, bo.getMachineId())