mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 15:55:18 +08:00
优化
This commit is contained in:
@@ -93,7 +93,7 @@ public class DictionaryService extends BaseService<DictionaryEntity, DictionaryR
|
||||
ans.setTree(TreeDto.buildList(result.getResponse(), flatten));
|
||||
} else {
|
||||
|
||||
throw new BizException("不支持的字典类型 " + dict.getDictTypeName());
|
||||
throw new BizException("不支持的字典类型 " + dict.getDictType());
|
||||
}
|
||||
|
||||
return ans;
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package cn.lihongjie.coal.emDevice.dto;
|
||||
|
||||
import cn.lihongjie.coal.base.dto.OrgCommonDto;
|
||||
import cn.lihongjie.coal.common.DictCode;
|
||||
import cn.lihongjie.coal.emDevice.entity.EmDeviceItemConfig;
|
||||
import cn.lihongjie.coal.emDeviceSupplier.dto.EmDeviceSupplierDto;
|
||||
import cn.lihongjie.coal.pojoProcessor.DictTranslate;
|
||||
import cn.lihongjie.coal.thirdAccount.dto.ThirdAccountDto;
|
||||
|
||||
import lombok.Data;
|
||||
@@ -28,6 +30,7 @@ public class EmDeviceDto extends OrgCommonDto {
|
||||
private String location;
|
||||
private String archiveStatus;
|
||||
|
||||
@DictTranslate(dictKey = DictCode.ARCHIVESTATUS)
|
||||
private String archiveStatusName;
|
||||
|
||||
private List<EmDeviceItemConfig> itemConfig;
|
||||
|
||||
@@ -12,7 +12,6 @@ import lombok.Data;
|
||||
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
import org.hibernate.annotations.Comment;
|
||||
import org.hibernate.annotations.Formula;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -27,14 +26,7 @@ public class EmDeviceEntity extends OrgCommonEntity {
|
||||
@Comment("设备类型")
|
||||
private String deviceType;
|
||||
|
||||
@Formula(
|
||||
"(select i.name\n"
|
||||
+ "from t_dictionary d,\n"
|
||||
+ " t_dictionary_item i\n"
|
||||
+ "where d.id = i.dictionary_id\n"
|
||||
+ " and d.code = 'em.device.type'\n"
|
||||
+ " and i.code = device_type)")
|
||||
private String deviceTypeName;
|
||||
|
||||
|
||||
private String location;
|
||||
|
||||
@@ -42,14 +34,7 @@ public class EmDeviceEntity extends OrgCommonEntity {
|
||||
@ColumnDefault("'0'")
|
||||
private String archiveStatus = "0";
|
||||
|
||||
@Formula(
|
||||
"(select i.name\n"
|
||||
+ "from t_dictionary d,\n"
|
||||
+ " t_dictionary_item i\n"
|
||||
+ "where d.id = i.dictionary_id\n"
|
||||
+ " and d.code = 'archiveStatus'\n"
|
||||
+ " and i.code = archive_status)")
|
||||
private String archiveStatusName;
|
||||
|
||||
|
||||
|
||||
@ElementCollection
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package cn.lihongjie.coal.pdcDevice.dto;
|
||||
|
||||
import cn.lihongjie.coal.base.dto.OrgCommonDto;
|
||||
import cn.lihongjie.coal.common.DictCode;
|
||||
import cn.lihongjie.coal.dataCollector.dto.DataCollectorDto;
|
||||
import cn.lihongjie.coal.pdcDeviceSupplier.dto.PdcDeviceSupplierDto;
|
||||
import cn.lihongjie.coal.pojoProcessor.DictTranslate;
|
||||
|
||||
import jakarta.persistence.ManyToOne;
|
||||
|
||||
@@ -34,12 +36,9 @@ public class PdcDeviceDto extends OrgCommonDto {
|
||||
@Comment("煤类型")
|
||||
private String coalType;
|
||||
|
||||
|
||||
@DictTranslate(dictKey = DictCode.COAL_TYPE)
|
||||
private String coalTypeName;
|
||||
|
||||
|
||||
|
||||
|
||||
@Comment("MODBUS地址")
|
||||
private String modbusUId;
|
||||
|
||||
|
||||
@@ -34,14 +34,7 @@ public class PdcDeviceEntity extends OrgCommonEntity {
|
||||
@Comment("煤类型")
|
||||
private String coalType;
|
||||
|
||||
@Formula(
|
||||
"(select i.name\n"
|
||||
+ "from t_dictionary d,\n"
|
||||
+ " t_dictionary_item i\n"
|
||||
+ "where d.id = i.dictionary_id\n"
|
||||
+ " and d.code = 'coal.type'\n"
|
||||
+ " and i.code = coal_type)")
|
||||
private String coalTypeName;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user