lius
2023-08-21 21caf8ad8e7d24c3bbf7cf4a90c35f51851fd6cb
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentServiceImpl.java
@@ -10,6 +10,8 @@
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.mdc.dto.EquipmentTemperatureDto;
import org.jeecg.modules.mdc.dto.MdcEquDepDto;
import org.jeecg.modules.mdc.dto.MdcEquProDto;
import org.jeecg.modules.mdc.dto.MdcEquipmentDto;
import org.jeecg.modules.mdc.entity.*;
import org.jeecg.modules.mdc.mapper.MdcEquipmentMapper;
@@ -467,6 +469,9 @@
            }
        }
        //根据产线集合查找所有设备id
        if (allDepartIds.isEmpty()) {
            return null;
        }
        List<String> equipmentIds = this.baseMapper.queryIdsByDeparts(allDepartIds);
        if (StringUtils.isNotEmpty(key)) {
            //key不为空,查询所有下级部门id
@@ -513,6 +518,9 @@
            }
        }
        //根据产线集合查找所有设备id
        if (allProductionIds.isEmpty()) {
            return null;
        }
        List<String> equipmentIds = this.baseMapper.queryIdsByProductions(allProductionIds);
        if (StringUtils.isNotEmpty(key)) {
            //key不为空,查询所有下级产线id
@@ -634,7 +642,7 @@
    }
    /**
     *  根据产线层级查询设备单个
     * 根据产线层级查询设备单个
     */
    @Override
    public MdcEquipment getEquipmentByPid(String pid, String userId) {
@@ -645,4 +653,38 @@
        return null;
    }
    /**
     * 根据设备编号查询设备信息和部门信息
     *
     * @param equipmentIdList
     * @return
     */
    @Override
    public List<MdcEquDepDto> findEquDepList(List<String> equipmentIdList) {
        return this.baseMapper.findEquDepList(equipmentIdList);
    }
    /**
     * 根据设备编号查询设备信息和产线信息
     *
     * @param equipmentIdList
     * @return
     */
    @Override
    public List<MdcEquProDto> findEquProList(List<String> equipmentIdList) {
        return this.baseMapper.findEquProList(equipmentIdList);
    }
    /**
     * 根据部门层级查询设备单个
     */
    @Override
    public MdcEquipment getEquipmentByDepPid(String pid, String userId) {
        List<String> idsByDepart = this.getEquipmentIdsByDepart(userId, pid);
        if (idsByDepart != null && !idsByDepart.isEmpty()) {
            return super.getOne(new LambdaQueryWrapper<MdcEquipment>().eq(MdcEquipment::getEquipmentId, idsByDepart.get(0)));
        }
        return null;
    }
}