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())