zenglf
2023-09-28 f84d9e69907cb678150eaa6393fd74cf042fcca4
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcDriveTypeParamConfigServiceImpl.java
@@ -2,11 +2,13 @@
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;
@@ -39,4 +41,22 @@
    public List<MdcDriveTypeParamConfig> getByTypeCodeMdcShowCode(String codeTypeId) {
        return this.baseMapper.selectBatchIds(Arrays.asList(codeTypeId.split(",")));
    }
    /**
     * 获取控制系统类型下拉框选项
     */
    @Override
    public List<OptionsDto> getDriveParamOptions() {
        List<OptionsDto> result = new ArrayList<>();
        List<String> 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;
    }
}