二楼使用导出、导入设备功能

This commit is contained in:
caozehui
2025-01-16 13:30:08 +08:00
parent de53e41f2c
commit 8c75ecb09f
13 changed files with 392 additions and 33 deletions

View File

@@ -53,6 +53,12 @@ public class DictDataParam {
@ApiModelProperty("字典值")
private String value;
/**
* 是否开启使用Value值0-关闭1-开启(默认为0)
*/
@ApiModelProperty("是否开启使用Value值")
private Integer openValue;
/**
* 更新操作实体

View File

@@ -1,5 +1,7 @@
package com.njcn.gather.system.dictionary.pojo.po;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.njcn.db.mybatisplus.bo.BaseEntity;
import lombok.Data;
@@ -55,8 +57,14 @@ public class DictData extends BaseEntity {
/**
* 目前只用于表示电压等级数值
*/
@TableField(fill = FieldFill.UPDATE)
private String value;
/**
* 是否开启使用Value值0-关闭1-开启(默认为0)
*/
private Integer openValue;
/**
* 状态0-删除 1-正常
*/

View File

@@ -26,6 +26,13 @@ public interface IDictDataService extends IService<DictData> {
*/
Page<DictData> getDictDataByTypeId(DictDataParam.QueryParam queryParam);
/**
* 根据字典类型id查询字典信息
* @param typeId 字典类型id
* @return 操作结果
*/
List<DictData> getDictDataByTypeId(String typeId);
/**
* 新增数据字典
* @param dictDataParam 字典数据

View File

@@ -47,5 +47,13 @@ public interface IDictTypeService extends IService<DictType> {
* 导出字典类型数据
* @param queryParam 查询参数
*/
public void exportDictType(DictTypeParam.QueryParam queryParam);
void exportDictType(DictTypeParam.QueryParam queryParam);
/**
* 根据code获取字典类型数据
*
* @param code 字典类型code
* @return
*/
DictType getByCode(String code);
}

View File

@@ -64,6 +64,10 @@ public class DictDataServiceImpl extends ServiceImpl<DictDataMapper, DictData> i
return this.baseMapper.selectPage(new Page<>(PageFactory.getPageNum(queryParam), PageFactory.getPageSize(queryParam)), queryWrapper);
}
@Override
public List<DictData> getDictDataByTypeId(String typeId) {
return this.lambdaQuery().eq(DictData::getTypeId, typeId).eq(DictData::getState, DataStateEnum.ENABLE.getCode()).list();
}
@Override
@Transactional(rollbackFor = {Exception.class})

View File

@@ -104,6 +104,10 @@ public class DictTypeServiceImpl extends ServiceImpl<DictTypeMapper, DictType> i
ExcelUtil.exportExcel("字典类型导出数据.xlsx", "字典类型", DictTypeExcel.class, dictTypeVOS);
}
@Override
public DictType getByCode(String code) {
return this.lambdaQuery().eq(DictType::getCode, code).eq(DictType::getState, DataStateEnum.ENABLE.getCode()).one();
}
/**
* 校验参数,检查是否存在相同名称的字典类型