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 { }