diff --git a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/bo/ProdBaseMachineInfoBo.java b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/bo/ProdBaseMachineInfoBo.java index 1c09d3d4..73c76b2f 100644 --- a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/bo/ProdBaseMachineInfoBo.java +++ b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/domain/bo/ProdBaseMachineInfoBo.java @@ -72,5 +72,9 @@ public class ProdBaseMachineInfoBo extends BaseEntity { */ private String remark; + /** + * 工序 + */ + private Long processId; } diff --git a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdBaseMachineInfoServiceImpl.java b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdBaseMachineInfoServiceImpl.java index fa11085b..677a04b7 100644 --- a/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdBaseMachineInfoServiceImpl.java +++ b/ruoyi-modules/hwmom-mes/src/main/java/org/dromara/mes/service/impl/ProdBaseMachineInfoServiceImpl.java @@ -10,6 +10,8 @@ import com.github.yulichang.toolkit.JoinWrappers; import com.github.yulichang.wrapper.MPJLambdaWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; +import org.dromara.mes.domain.ProdBaseProcessInfo; +import org.dromara.mes.domain.ProdBaseStationInfo; import org.springframework.stereotype.Service; import org.dromara.mes.domain.bo.ProdBaseMachineInfoBo; import org.dromara.mes.domain.vo.ProdBaseMachineInfoVo; @@ -74,6 +76,8 @@ public class ProdBaseMachineInfoServiceImpl implements IProdBaseMachineInfoServi Map params = bo.getParams(); MPJLambdaWrapper lqw = JoinWrappers.lambda(ProdBaseMachineInfo.class) .selectAll(ProdBaseMachineInfo.class) + .leftJoin(ProdBaseStationInfo.class, ProdBaseStationInfo::getMachineId, ProdBaseMachineInfo::getMachineId) + .leftJoin(ProdBaseProcessInfo.class, ProdBaseProcessInfo::getProcessId, ProdBaseStationInfo::getProcessId) .eq(bo.getMachineId() != null, ProdBaseMachineInfo::getMachineId, bo.getMachineId()) .eq(StringUtils.isNotBlank(bo.getMachineCode()), ProdBaseMachineInfo::getMachineCode, bo.getMachineCode()) .like(StringUtils.isNotBlank(bo.getMachineName()), ProdBaseMachineInfo::getMachineName, bo.getMachineName()) @@ -83,6 +87,7 @@ public class ProdBaseMachineInfoServiceImpl implements IProdBaseMachineInfoServi .eq(StringUtils.isNotBlank(bo.getMachineSpec()), ProdBaseMachineInfo::getMachineSpec, bo.getMachineSpec()) .eq(StringUtils.isNotBlank(bo.getSupplierId()), ProdBaseMachineInfo::getSupplierId, bo.getSupplierId()) .eq(StringUtils.isNotBlank(bo.getMachineStatus()), ProdBaseMachineInfo::getMachineStatus, bo.getMachineStatus()) + .eq(StringUtils.isNotNull(bo.getProcessId()), ProdBaseProcessInfo::getProcessId, bo.getProcessId()) .orderByAsc(ProdBaseMachineInfo::getCreateTime); return lqw; } diff --git a/ruoyi-modules/hwmom-mes/src/main/resources/mapper/mes/ProdPlanInfoMapper.xml b/ruoyi-modules/hwmom-mes/src/main/resources/mapper/mes/ProdPlanInfoMapper.xml index 6ff9373f..5c57c3a4 100644 --- a/ruoyi-modules/hwmom-mes/src/main/resources/mapper/mes/ProdPlanInfoMapper.xml +++ b/ruoyi-modules/hwmom-mes/src/main/resources/mapper/mes/ProdPlanInfoMapper.xml @@ -74,7 +74,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bmi.material_code, bmi.material_name, bomi.material_name material_bom_name, - pbsi.station_name release_name, + case + when t.release_type = 1 then (select pbmi.machine_name + from prod_base_machine_info pbmi + where t.release_id = pbmi.machine_id) + when t.release_type = 2 then (select su.nick_name + from sys_user su + where t.release_id = su.user_id) + when t.release_type = 3 then (select pbsi.station_name + from prod_base_station_info pbsi + where t.release_id = pbsi.station_id) + end as release_name, pbpi.process_name, bsi.shift_name, bcti.team_name @@ -85,7 +95,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from ${tableName} t left join base_material_info bmi on bmi.material_id = t.material_id left join base_material_info bomi on bomi.material_id = t.material_bom_id - left join prod_base_station_info pbsi on pbsi.station_id = t.release_id left join prod_base_process_info pbpi on pbpi.process_id = t.process_id left join base_shift_info bsi on bsi.shift_id = t.shift_id left join base_class_team_info bcti on bcti.class_team_id = t.class_team_id