refactor(property): meter_type字典转换
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
zcxlsm 2025-07-19 16:21:55 +08:00
parent eb5efd9a6c
commit 98fb035a97
4 changed files with 11 additions and 7 deletions

View File

@ -50,7 +50,7 @@ public class TbMeterInfo extends TenantEntity {
/**
* 计量单位(1-2-3-立方米)
*/
private String meterUnit;
private Long meterUnit;
/**
* 安装位置

View File

@ -50,8 +50,8 @@ public class TbMeterInfoBo extends BaseEntity {
/**
* 计量单位(1-2-3-立方米)
*/
@NotBlank(message = "计量单位(1-度2-吨3-立方米)不能为空", groups = { AddGroup.class, EditGroup.class })
private String meterUnit;
@NotNull(message = "计量单位(1-度2-吨3-立方米)不能为空", groups = { AddGroup.class, EditGroup.class })
private Long meterUnit;
/**
* 安装位置

View File

@ -1,5 +1,7 @@
package org.dromara.property.domain.vo;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import org.dromara.property.domain.TbMeterInfo;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
@ -52,14 +54,16 @@ public class TbMeterInfoVo implements Serializable {
/**
* 设备类型(1-电表2-水表3-气表)
*/
@ExcelProperty(value = "设备类型(1-电表2-水表3-气表)")
@ExcelProperty(value = "设备类型(1-电表2-水表3-气表)" ,converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "meter_type")
private Long meterType;
/**
* 计量单位(1-2-3-立方米)
*/
@ExcelProperty(value = "计量单位(1-度2-吨3-立方米)")
private String meterUnit;
@ExcelProperty(value = "计量单位(1-度2-吨3-立方米)", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "meter_unit")
private Long meterUnit;
/**
* 安装位置

View File

@ -78,7 +78,7 @@ public class TbMeterInfoServiceImpl implements ITbMeterInfoService {
lqw.eq(StringUtils.isNotBlank(bo.getMeterCode()), TbMeterInfo::getMeterCode, bo.getMeterCode());
lqw.eq(StringUtils.isNotBlank(bo.getFactoryNo()), TbMeterInfo::getFactoryNo, bo.getFactoryNo());
lqw.eq(bo.getMeterType() != null, TbMeterInfo::getMeterType, bo.getMeterType());
lqw.eq(StringUtils.isNotBlank(bo.getMeterUnit()), TbMeterInfo::getMeterUnit, bo.getMeterUnit());
lqw.eq(bo.getMeterUnit() != null, TbMeterInfo::getMeterUnit, bo.getMeterUnit());
lqw.eq(StringUtils.isNotBlank(bo.getInstallLocation()), TbMeterInfo::getInstallLocation, bo.getInstallLocation());
lqw.eq(bo.getInitReading() != null, TbMeterInfo::getInitReading, bo.getInitReading());
lqw.eq(bo.getMaxRang() != null, TbMeterInfo::getMaxRang, bo.getMaxRang());