Lius
2023-11-09 a8ddac646d5129e9818ea82f404d0c0a8d2bc239
设备参数阈值管理接口
已添加6个文件
已修改3个文件
309 ■■■■■ 文件已修改
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcDriveTypeParamConfigController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentThresholdController.java 164 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipmentThreshold.java 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentThresholdMapper.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentThresholdMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcDriveTypeParamConfigService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentThresholdService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcDriveTypeParamConfigServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentThresholdServiceImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcDriveTypeParamConfigController.java
@@ -169,4 +169,12 @@
        return Result.OK(result);
    }
    @AutoLog(value = "驱动参数配置-根据控制系统类型获取参数")
    @ApiOperation(value = "驱动参数配置-根据控制系统类型获取参数", notes = "驱动参数配置-根据控制系统类型获取参数")
    @GetMapping(value = "/getDriveParamOptionsByType")
    public Result<List<OptionsDto>> getDriveParamOptionsByType(@RequestParam(name = "controlSystemType", required = true) String controlSystemType) {
        List<OptionsDto> result = mdcDriveTypeParamConfigService.getDriveParamOptionsByType(controlSystemType);
        return Result.OK(result);
    }
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/controller/MdcEquipmentThresholdController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,164 @@
package org.jeecg.modules.mdc.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.mdc.entity.MdcEquipmentThreshold;
import org.jeecg.modules.mdc.service.IMdcEquipmentThresholdService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
 * @Description: è®¾å¤‡å‚数阈值表
 * @Author: Lius
 * @Date: 2023-11-08
 * @Version: V1.0
 */
@Slf4j
@Api(tags = "设备参数阈值表")
@RestController
@RequestMapping("/mdc/mdcEquipmentThreshold")
public class MdcEquipmentThresholdController extends JeecgController<MdcEquipmentThreshold, IMdcEquipmentThresholdService> {
    @Resource
    private IMdcEquipmentThresholdService mdcEquipmentThresholdService;
    /**
     * åˆ†é¡µåˆ—表查询
     *
     * @param mdcEquipmentThreshold
     * @param pageNo
     * @param pageSize
     * @param req
     * @return
     */
    @AutoLog(value = "设备参数阈值表-分页列表查询")
    @ApiOperation(value = "设备参数阈值表-分页列表查询", notes = "设备参数阈值表-分页列表查询")
    @GetMapping(value = "/list")
    public Result<?> queryPageList(MdcEquipmentThreshold mdcEquipmentThreshold,
                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                   HttpServletRequest req) {
        QueryWrapper<MdcEquipmentThreshold> queryWrapper = QueryGenerator.initQueryWrapper(mdcEquipmentThreshold, req.getParameterMap());
        Page<MdcEquipmentThreshold> page = new Page<MdcEquipmentThreshold>(pageNo, pageSize);
        IPage<MdcEquipmentThreshold> pageList = mdcEquipmentThresholdService.page(page, queryWrapper);
        return Result.OK(pageList);
    }
    /**
     * æ·»åŠ 
     *
     * @param mdcEquipmentThreshold
     * @return
     */
    @AutoLog(value = "设备参数阈值表-添加")
    @ApiOperation(value = "设备参数阈值表-添加", notes = "设备参数阈值表-添加")
    @PostMapping(value = "/add")
    public Result<?> add(@RequestBody MdcEquipmentThreshold mdcEquipmentThreshold) {
        String chineseName = mdcEquipmentThreshold.getChineseName();
        mdcEquipmentThreshold.setEnglishName(chineseName.substring(0, chineseName.indexOf("(")));
        mdcEquipmentThreshold.setChineseName(chineseName.substring(mdcEquipmentThreshold.getEnglishName().length() + 1, chineseName.length() - 1));
        mdcEquipmentThresholdService.save(mdcEquipmentThreshold);
        return Result.OK("添加成功!");
    }
    /**
     * ç¼–辑
     *
     * @param mdcEquipmentThreshold
     * @return
     */
    @AutoLog(value = "设备参数阈值表-编辑")
    @ApiOperation(value = "设备参数阈值表-编辑", notes = "设备参数阈值表-编辑")
    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
    public Result<?> edit(@RequestBody MdcEquipmentThreshold mdcEquipmentThreshold) {
        String chineseName = mdcEquipmentThreshold.getChineseName();
        mdcEquipmentThreshold.setEnglishName(chineseName.substring(0, chineseName.indexOf("(")));
        mdcEquipmentThreshold.setChineseName(chineseName.substring(mdcEquipmentThreshold.getEnglishName().length() + 1, chineseName.length() - 1));
        mdcEquipmentThresholdService.save(mdcEquipmentThreshold);
        mdcEquipmentThresholdService.updateById(mdcEquipmentThreshold);
        return Result.OK("编辑成功!");
    }
    /**
     * é€šè¿‡id删除
     *
     * @param id
     * @return
     */
    @AutoLog(value = "设备参数阈值表-通过id删除")
    @ApiOperation(value = "设备参数阈值表-通过id删除", notes = "设备参数阈值表-通过id删除")
    @DeleteMapping(value = "/delete")
    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
        mdcEquipmentThresholdService.removeById(id);
        return Result.OK("删除成功!");
    }
    /**
     * æ‰¹é‡åˆ é™¤
     *
     * @param ids
     * @return
     */
    @AutoLog(value = "设备参数阈值表-批量删除")
    @ApiOperation(value = "设备参数阈值表-批量删除", notes = "设备参数阈值表-批量删除")
    @DeleteMapping(value = "/deleteBatch")
    public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
        this.mdcEquipmentThresholdService.removeByIds(Arrays.asList(ids.split(",")));
        return Result.OK("批量删除成功!");
    }
    /**
     * é€šè¿‡id查询
     *
     * @param id
     * @return
     */
    @AutoLog(value = "设备参数阈值表-通过id查询")
    @ApiOperation(value = "设备参数阈值表-通过id查询", notes = "设备参数阈值表-通过id查询")
    @GetMapping(value = "/queryById")
    public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
        MdcEquipmentThreshold mdcEquipmentThreshold = mdcEquipmentThresholdService.getById(id);
        String englishName = mdcEquipmentThreshold.getEnglishName();
        String chineseName = mdcEquipmentThreshold.getChineseName();
        mdcEquipmentThreshold.setChineseName(englishName + "(" + chineseName + ")");
        return Result.OK(mdcEquipmentThreshold);
    }
    /**
     * å¯¼å‡ºexcel
     *
     * @param request
     * @param mdcEquipmentThreshold
     */
    @RequestMapping(value = "/exportXls")
    public ModelAndView exportXls(HttpServletRequest request, MdcEquipmentThreshold mdcEquipmentThreshold) {
        return super.exportXls(request, mdcEquipmentThreshold, MdcEquipmentThreshold.class, "设备参数阈值表");
    }
    /**
     * é€šè¿‡excel导入数据
     *
     * @param request
     * @param response
     * @return
     */
    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
        return super.importExcel(request, response, MdcEquipmentThreshold.class);
    }
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcEquipmentThreshold.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,61 @@
package org.jeecg.modules.mdc.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.system.base.entity.JeecgEntity;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
/**
 * @Description: è®¾å¤‡å‚数阈值表
 * @Author: Lius
 * @Date: 2023-11-08
 * @Version: V1.0
 */
@Data
@TableName("mdc_equipment_threshold")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "mdc_equipment_threshold对象", description = "设备参数阈值表")
public class MdcEquipmentThreshold extends JeecgEntity implements Serializable {
    private static final long serialVersionUID = 8899682324080635365L;
    /**
     * æŽ§åˆ¶ç³»ç»Ÿç±»åž‹
     */
    @Excel(name = "控制系统类型", width = 15)
    @ApiModelProperty(value = "控制系统类型")
    private String controlSystemType;
    /**
     * ä¸­æ–‡åç§°
     */
    @Excel(name = "中文名称", width = 15)
    @ApiModelProperty(value = "中文名称")
    private String chineseName;
    /**
     * è‹±æ–‡åç§°
     */
    @Excel(name = "英文名称", width = 15)
    @ApiModelProperty(value = "英文名称")
    private String englishName;
    /**
     * ä¸Šé™
     */
    @Excel(name = "上限", width = 15)
    @ApiModelProperty(value = "上限")
    private Integer maxThreshold;
    /**
     * ä¸‹é™
     */
    @Excel(name = "下限", width = 15)
    @ApiModelProperty(value = "下限")
    private Integer minThreshold;
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentThresholdMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
package org.jeecg.modules.mdc.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.mdc.entity.MdcEquipmentThreshold;
/**
 * @Description: è®¾å¤‡å‚数阈值表
 * @Author: Lius
 * @Date:   2023-11-08
 * @Version: V1.0
 */
public interface MdcEquipmentThresholdMapper extends BaseMapper<MdcEquipmentThreshold> {
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentThresholdMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.mdc.mapper.MdcEquipmentThresholdMapper">
</mapper>
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcDriveTypeParamConfigService.java
@@ -34,4 +34,9 @@
     */
    List<OptionsDto> getDriveParamOptions();
    /**
     * æ ¹æ®æŽ§åˆ¶ç³»ç»Ÿç±»åž‹èŽ·å–å‚æ•°
     */
    List<OptionsDto> getDriveParamOptionsByType(String controlSystemType);
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentThresholdService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
package org.jeecg.modules.mdc.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.mdc.entity.MdcEquipmentThreshold;
/**
 * @Description: è®¾å¤‡å‚数阈值表
 * @Author: Lius
 * @Date: 2023-11-08
 * @Version: V1.0
 */
public interface IMdcEquipmentThresholdService extends IService<MdcEquipmentThreshold> {
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcDriveTypeParamConfigServiceImpl.java
@@ -1,5 +1,6 @@
package org.jeecg.modules.mdc.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.modules.mdc.dto.OptionsDto;
@@ -59,4 +60,22 @@
        }
        return result;
    }
    /**
     * æ ¹æ®æŽ§åˆ¶ç³»ç»Ÿç±»åž‹èŽ·å–å‚æ•°
     */
    @Override
    public List<OptionsDto> getDriveParamOptionsByType(String controlSystemType) {
        List<OptionsDto> result = new ArrayList<>();
        List<MdcDriveTypeParamConfig> mdcDriveTypeParamConfigList = super.list(new LambdaQueryWrapper<MdcDriveTypeParamConfig>().eq(MdcDriveTypeParamConfig::getControlSystemType, controlSystemType).eq(MdcDriveTypeParamConfig::getCurveGenerationFlags, CommonConstant.YN_Y));
        if (mdcDriveTypeParamConfigList != null && !mdcDriveTypeParamConfigList.isEmpty()) {
            for (MdcDriveTypeParamConfig mdcDriveTypeParamConfig : mdcDriveTypeParamConfigList) {
                OptionsDto optionsDto = new OptionsDto();
                optionsDto.setLabel(mdcDriveTypeParamConfig.getEnglishName() + "(" + mdcDriveTypeParamConfig.getChineseName() + ")");
                optionsDto.setValue(mdcDriveTypeParamConfig.getEnglishName() + "(" + mdcDriveTypeParamConfig.getChineseName() + ")");
                result.add(optionsDto);
            }
        }
        return result;
    }
}
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentThresholdServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
package org.jeecg.modules.mdc.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.mdc.entity.MdcEquipmentThreshold;
import org.jeecg.modules.mdc.mapper.MdcEquipmentThresholdMapper;
import org.jeecg.modules.mdc.service.IMdcEquipmentThresholdService;
import org.springframework.stereotype.Service;
/**
 * @Description: è®¾å¤‡å‚数阈值表
 * @Author: Lius
 * @Date:   2023-11-08
 * @Version: V1.0
 */
@Service
public class MdcEquipmentThresholdServiceImpl extends ServiceImpl<MdcEquipmentThresholdMapper, MdcEquipmentThreshold> implements IMdcEquipmentThresholdService {
}