package org.jeecg.modules.mdc.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.jeecg.common.constant.CommonConstant; import org.jeecg.modules.mdc.dto.OptionsDto; import org.jeecg.modules.mdc.entity.MdcDriveTypeParamConfig; import org.jeecg.modules.mdc.mapper.MdcDriveTypeParamConfigMapper; import org.jeecg.modules.mdc.service.IMdcDriveTypeParamConfigService; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * @Description: 驱动参数配置 * @Author: jeecg-boot * @Date: 2023-04-20 * @Version: V1.0 */ @Service public class MdcDriveTypeParamConfigServiceImpl extends ServiceImpl implements IMdcDriveTypeParamConfigService { /** * 根据驱动类型获取设备显示参数 */ @Override public List getShowDriveParam(String driveType) { return lambdaQuery().eq(MdcDriveTypeParamConfig::getControlSystemType, driveType).eq(MdcDriveTypeParamConfig::getShowFlag, CommonConstant.YN_Y).list(); } /** * 根据设备编码获取工作曲线参数 */ @Override public List findWorkCurveParamList(String equipmentId) { return this.baseMapper.findWorkCurveParamList(equipmentId); } @Override public List getByTypeCodeMdcShowCode(String codeTypeId) { return this.baseMapper.selectBatchIds(Arrays.asList(codeTypeId.split(","))); } /** * 获取控制系统类型下拉框选项 */ @Override public List getDriveParamOptions() { List result = new ArrayList<>(); List driveParams = this.baseMapper.getDriveParamOptions(); if (driveParams != null && !driveParams.isEmpty()) { for (String driveParam : driveParams) { OptionsDto optionsDto = new OptionsDto(); optionsDto.setLabel(driveParam); optionsDto.setValue(driveParam); result.add(optionsDto); } } return result; } }