zenglf
2023-09-28 f84d9e69907cb678150eaa6393fd74cf042fcca4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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<MdcDriveTypeParamConfigMapper, MdcDriveTypeParamConfig> implements IMdcDriveTypeParamConfigService {
 
    /**
     * 根据驱动类型获取设备显示参数
     */
    @Override
    public List<MdcDriveTypeParamConfig> getShowDriveParam(String driveType) {
        return lambdaQuery().eq(MdcDriveTypeParamConfig::getControlSystemType, driveType).eq(MdcDriveTypeParamConfig::getShowFlag, CommonConstant.YN_Y).list();
    }
 
    /**
     * 根据设备编码获取工作曲线参数
     */
    @Override
    public List<MdcDriveTypeParamConfig> findWorkCurveParamList(String equipmentId) {
        return this.baseMapper.findWorkCurveParamList(equipmentId);
    }
 
    @Override
    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;
    }
}