fix: 实体类增加中文注解
This commit is contained in:
parent
26a9591b22
commit
849186bc9a
@ -2,6 +2,7 @@ package com.yfd.platform.qgc_base.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yfd.platform.annotation.FieldChinese;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -25,16 +26,19 @@ public class SdAiboxBH implements Serializable {
|
||||
* 测站编码
|
||||
*/
|
||||
@TableId(type = IdType.INPUT)
|
||||
@FieldChinese("测站编码")
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 测站名称
|
||||
*/
|
||||
@FieldChinese("测站名称")
|
||||
private String stnm;
|
||||
|
||||
/**
|
||||
* 测站类型
|
||||
*/
|
||||
@FieldChinese("测站类型")
|
||||
private String sttp;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ -44,43 +48,51 @@ public class SdAiboxBH implements Serializable {
|
||||
* 数据时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@FieldChinese("数据时间")
|
||||
private Date tm;
|
||||
|
||||
/**
|
||||
* 位置经度
|
||||
*/
|
||||
@FieldChinese("位置经度")
|
||||
private BigDecimal lgtd;
|
||||
|
||||
/**
|
||||
* 位置纬度
|
||||
*/
|
||||
@FieldChinese("位置纬度")
|
||||
private BigDecimal lttd;
|
||||
|
||||
/**
|
||||
* 高程
|
||||
*/
|
||||
@FieldChinese("高程")
|
||||
private BigDecimal elev;
|
||||
|
||||
/**
|
||||
* 站址
|
||||
*/
|
||||
@FieldChinese("站址")
|
||||
private String stlc;
|
||||
|
||||
/**
|
||||
* 建成日期
|
||||
*/
|
||||
@FieldChinese("建成日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date jcdt;
|
||||
|
||||
/**
|
||||
* 退役/拆除日期
|
||||
*/
|
||||
@FieldChinese("退役/拆除日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date wddt;
|
||||
|
||||
/**
|
||||
* 建设状态代码
|
||||
*/
|
||||
@FieldChinese("建设状态代码")
|
||||
private Integer bldsttCode;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ -89,11 +101,13 @@ public class SdAiboxBH implements Serializable {
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
@FieldChinese("是否启用")
|
||||
private Integer usfl;
|
||||
|
||||
/**
|
||||
* 数据是否接入
|
||||
*/
|
||||
@FieldChinese("数据是否接入")
|
||||
private Integer dtin;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ -102,12 +116,14 @@ public class SdAiboxBH implements Serializable {
|
||||
/**
|
||||
* 数据接入时间
|
||||
*/
|
||||
@FieldChinese("数据接入时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date dtinTm;
|
||||
|
||||
/**
|
||||
* 监测方式
|
||||
*/
|
||||
@FieldChinese("监测方式")
|
||||
private Integer mway;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ -116,16 +132,19 @@ public class SdAiboxBH implements Serializable {
|
||||
/**
|
||||
* 站索引
|
||||
*/
|
||||
@FieldChinese("站索引")
|
||||
private String stindx;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@FieldChinese("排序")
|
||||
private Integer orderIndex;
|
||||
|
||||
/**
|
||||
* 关联测站编码
|
||||
*/
|
||||
@FieldChinese("关联测站编码")
|
||||
private String rstcd;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ -134,6 +153,7 @@ public class SdAiboxBH implements Serializable {
|
||||
/**
|
||||
* 所属基地编码
|
||||
*/
|
||||
@FieldChinese("所属基地编码")
|
||||
private String baseId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ -142,11 +162,13 @@ public class SdAiboxBH implements Serializable {
|
||||
/**
|
||||
* 所属基地流域编码
|
||||
*/
|
||||
@FieldChinese("所属基地流域编码")
|
||||
private String hbrvcd;
|
||||
|
||||
/**
|
||||
* 所属流域代码
|
||||
*/
|
||||
@FieldChinese("所属流域代码")
|
||||
private String rvcd;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ -155,114 +177,136 @@ public class SdAiboxBH implements Serializable {
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
@FieldChinese("简介")
|
||||
private String introduce;
|
||||
|
||||
/**
|
||||
* LOGO
|
||||
*/
|
||||
@FieldChinese("LOGO")
|
||||
private String logo;
|
||||
|
||||
/**
|
||||
* 介绍文件
|
||||
*/
|
||||
@FieldChinese("介绍文件")
|
||||
private String inffile;
|
||||
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@FieldChinese("服务对象")
|
||||
private String fwdx;
|
||||
|
||||
/**
|
||||
* 供电方式
|
||||
*/
|
||||
@FieldChinese("供电方式")
|
||||
private String gdfs;
|
||||
|
||||
/**
|
||||
* AI配置
|
||||
*/
|
||||
@FieldChinese("AI配置")
|
||||
private String aipz;
|
||||
|
||||
/**
|
||||
* 模型版本
|
||||
*/
|
||||
@FieldChinese("模型版本")
|
||||
private String mxbb;
|
||||
|
||||
/**
|
||||
* IP地址
|
||||
*/
|
||||
@FieldChinese("IP地址")
|
||||
private String ipaddr;
|
||||
|
||||
/**
|
||||
* SIM卡信息
|
||||
*/
|
||||
@FieldChinese("SIM卡信息")
|
||||
private String siminfo;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
@FieldChinese("联系人")
|
||||
private String lxr;
|
||||
|
||||
/**
|
||||
* 用途
|
||||
*/
|
||||
@FieldChinese("用途")
|
||||
private String purpose;
|
||||
|
||||
/**
|
||||
* 数据频率
|
||||
*/
|
||||
@FieldChinese("数据频率")
|
||||
private String dtfrqcy;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@FieldChinese("备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 植被覆盖类型
|
||||
*/
|
||||
@FieldChinese("植被覆盖类型")
|
||||
private String vlsr;
|
||||
|
||||
/**
|
||||
* 植被覆盖调查时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@FieldChinese("植被覆盖调查时间")
|
||||
private Date vlsrTm;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@FieldChinese("创建人")
|
||||
private String recordUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@FieldChinese("创建时间")
|
||||
private Date recordTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@FieldChinese("更新人")
|
||||
private String modifyUser;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@FieldChinese("更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date modifyTime;
|
||||
|
||||
/**
|
||||
* 是否已删除
|
||||
*/
|
||||
@FieldChinese("是否已删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
/**
|
||||
* 删除人
|
||||
*/
|
||||
@FieldChinese("删除人")
|
||||
private String deleteUser;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
@FieldChinese("删除时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date deleteTime;
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.yfd.platform.qgc_base.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.yfd.platform.annotation.FieldChinese;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@ -24,17 +25,20 @@ public class SdArtsgBH implements Serializable {
|
||||
/**
|
||||
* 测站编码
|
||||
*/
|
||||
@FieldChinese("测站编码")
|
||||
@TableId(type = IdType.INPUT)
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 测站名称
|
||||
*/
|
||||
@FieldChinese("测站名称")
|
||||
private String stnm;
|
||||
|
||||
/**
|
||||
* 测站类型
|
||||
*/
|
||||
@FieldChinese("测站类型")
|
||||
private String sttp;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ -43,37 +47,44 @@ public class SdArtsgBH implements Serializable {
|
||||
/**
|
||||
* 数据时间
|
||||
*/
|
||||
@FieldChinese("数据时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date tm;
|
||||
|
||||
/**
|
||||
* 位置经度
|
||||
*/
|
||||
@FieldChinese("位置经度")
|
||||
private BigDecimal lgtd;
|
||||
|
||||
/**
|
||||
* 位置纬度
|
||||
*/
|
||||
@FieldChinese("位置纬度")
|
||||
private BigDecimal lttd;
|
||||
|
||||
/**
|
||||
* 高程
|
||||
*/
|
||||
@FieldChinese("高程")
|
||||
private BigDecimal elev;
|
||||
|
||||
/**
|
||||
* 站址
|
||||
*/
|
||||
@FieldChinese("站址")
|
||||
private String stlc;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
@FieldChinese("是否启用")
|
||||
private Integer usfl;
|
||||
|
||||
/**
|
||||
* 数据是否接入
|
||||
*/
|
||||
@FieldChinese("数据是否接入")
|
||||
private Integer dtin;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ -82,17 +93,20 @@ public class SdArtsgBH implements Serializable {
|
||||
/**
|
||||
* 数据接入时间
|
||||
*/
|
||||
@FieldChinese("数据接入时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date dtinTm;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@FieldChinese("排序")
|
||||
private Integer orderIndex;
|
||||
|
||||
/**
|
||||
* 关联测站编码
|
||||
*/
|
||||
@FieldChinese("关联测站编码")
|
||||
private String rstcd;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ -101,6 +115,7 @@ public class SdArtsgBH implements Serializable {
|
||||
/**
|
||||
* 所属基地编码
|
||||
*/
|
||||
@FieldChinese("所属基地编码")
|
||||
private String baseId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ -109,11 +124,13 @@ public class SdArtsgBH implements Serializable {
|
||||
/**
|
||||
* 所属基地流域编码
|
||||
*/
|
||||
@FieldChinese("所属基地流域编码")
|
||||
private String hbrvcd;
|
||||
|
||||
/**
|
||||
* 所属流域代码
|
||||
*/
|
||||
@FieldChinese("所属流域代码")
|
||||
private String rvcd;
|
||||
|
||||
|
||||
@ -123,47 +140,55 @@ public class SdArtsgBH implements Serializable {
|
||||
/**
|
||||
* 所属行政区编码
|
||||
*/
|
||||
@FieldChinese("所属行政区编码")
|
||||
private String addvcd;
|
||||
|
||||
/**
|
||||
* 规划设计日期
|
||||
*/
|
||||
@FieldChinese("规划设计日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date stdsdt;
|
||||
|
||||
/**
|
||||
* 计划开工日期
|
||||
*/
|
||||
@FieldChinese("计划开工日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date pststdt;
|
||||
|
||||
/**
|
||||
* 计划完工日期
|
||||
*/
|
||||
@FieldChinese("计划完工日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date pesstdt;
|
||||
|
||||
/**
|
||||
* 开工日期
|
||||
*/
|
||||
@FieldChinese("开工日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date swdt;
|
||||
|
||||
/**
|
||||
* 建成日期
|
||||
*/
|
||||
@FieldChinese("建成日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date jcdt;
|
||||
|
||||
/**
|
||||
* 退役/拆除日期
|
||||
*/
|
||||
@FieldChinese("退役/拆除日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date wddt;
|
||||
|
||||
/**
|
||||
* 建设状态代码
|
||||
*/
|
||||
@FieldChinese("建设状态代码")
|
||||
private Integer bldsttCode;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ -172,71 +197,85 @@ public class SdArtsgBH implements Serializable {
|
||||
/**
|
||||
* 简介
|
||||
*/
|
||||
@FieldChinese("简介")
|
||||
private String introduce;
|
||||
|
||||
/**
|
||||
* LOGO
|
||||
*/
|
||||
@FieldChinese("LOGO")
|
||||
private String logo;
|
||||
|
||||
/**
|
||||
* 介绍文件
|
||||
*/
|
||||
@FieldChinese("介绍文件")
|
||||
private String inffile;
|
||||
|
||||
/**
|
||||
* 投资
|
||||
*/
|
||||
@FieldChinese("投资")
|
||||
private BigDecimal inv;
|
||||
|
||||
/**
|
||||
* 投资金额
|
||||
*/
|
||||
@FieldChinese("投资金额")
|
||||
private Integer invinmn;
|
||||
|
||||
/**
|
||||
* 保护措施
|
||||
*/
|
||||
@FieldChinese("保护措施")
|
||||
private String prtcts;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
@FieldChinese("数量")
|
||||
private Integer cnt;
|
||||
|
||||
/**
|
||||
* 面积
|
||||
*/
|
||||
@FieldChinese("面积")
|
||||
private BigDecimal ar;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@FieldChinese("类型")
|
||||
private String tp;
|
||||
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
@FieldChinese("附件")
|
||||
private String attm;
|
||||
|
||||
/**
|
||||
* 数据频率
|
||||
*/
|
||||
@FieldChinese("数据频率")
|
||||
private String dtfrqcy;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@FieldChinese("备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 植被覆盖类型
|
||||
*/
|
||||
@FieldChinese("植被覆盖类型")
|
||||
private String vlsr;
|
||||
|
||||
/**
|
||||
* 植被覆盖调查时间
|
||||
*/
|
||||
@FieldChinese("植被覆盖调查时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date vlsrTm;
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.annotation.FieldChinese;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.MsOperationLog;
|
||||
import com.yfd.platform.qgc_base.domain.MsOperationLogDetail;
|
||||
@ -421,6 +422,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
if (processedColumns.contains(columnName)) {
|
||||
continue;
|
||||
}
|
||||
String fieldMeaning = resolveFieldChinese(field);
|
||||
Object oldValue = getFieldValue(field, before);
|
||||
Object newValue = getFieldValue(field, after);
|
||||
|
||||
@ -432,7 +434,7 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
continue;
|
||||
}
|
||||
details.add(buildGenericDetail(mainLog.getId(), tableName, recordId, columnName,
|
||||
oldValue, newValue, "修改字段值"));
|
||||
fieldMeaning,oldValue, newValue, "修改字段值"));
|
||||
processedColumns.add(columnName);
|
||||
}
|
||||
batchInsertDetails(details);
|
||||
@ -460,8 +462,9 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
if (processedColumns.contains(columnName)) {
|
||||
continue;
|
||||
}
|
||||
String fieldMeaning = resolveFieldChinese(field);
|
||||
Object newValue = getFieldValue(field, entity);
|
||||
details.add(buildGenericDetail(mainLog.getId(), tableName, recordId, columnName,
|
||||
details.add(buildGenericDetail(mainLog.getId(), tableName, recordId, columnName,fieldMeaning,
|
||||
null, newValue, "新增字段值"));
|
||||
processedColumns.add(columnName);
|
||||
}
|
||||
@ -490,12 +493,13 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
if (processedColumns.contains(columnName)) {
|
||||
continue;
|
||||
}
|
||||
String fieldMeaning = resolveFieldChinese(field);
|
||||
Object oldValue = getFieldValue(field, entity);
|
||||
// if (oldValue == null) {
|
||||
// continue;
|
||||
// }
|
||||
details.add(buildGenericDetail(mainLog.getId(), tableName, recordId, columnName,
|
||||
oldValue, null, "删除字段值"));
|
||||
fieldMeaning,oldValue, null, "删除字段值"));
|
||||
processedColumns.add(columnName);
|
||||
}
|
||||
batchInsertDetails(details);
|
||||
@ -545,14 +549,14 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
* 构建通用的操作日志详情(不含字典名称解析)
|
||||
*/
|
||||
private MsOperationLogDetail buildGenericDetail(String mainId, String tableName,
|
||||
String stationCode, String fieldCode,
|
||||
String stationCode, String fieldCode,String fieldMeaning,
|
||||
Object oldValue, Object newValue, String remark) {
|
||||
MsOperationLogDetail detail = new MsOperationLogDetail();
|
||||
detail.setMainId(mainId);
|
||||
detail.setTableName(tableName);
|
||||
detail.setStationCode(stationCode);
|
||||
detail.setFieldCode(fieldCode);
|
||||
detail.setFieldMeaning(fieldCode);
|
||||
detail.setFieldMeaning(fieldMeaning);
|
||||
detail.setOldValueCode(formatValue(oldValue));
|
||||
detail.setNewValueCode(formatValue(newValue));
|
||||
detail.setRemark(remark);
|
||||
@ -582,6 +586,23 @@ public class MsOperationLogServiceImpl extends ServiceImpl<MsOperationLogMapper,
|
||||
return camelToUpperUnderline(field.getName());
|
||||
}
|
||||
|
||||
|
||||
// private String resolveColumnName(Field field) {
|
||||
// FieldChinese chinese = field.getAnnotation(FieldChinese.class);
|
||||
// if (chinese != null && StringUtils.isNotBlank(chinese.value())) {
|
||||
// return chinese.value();
|
||||
// }
|
||||
// return resolveFieldColumnName(field);
|
||||
// }
|
||||
|
||||
private String resolveFieldChinese(Field field) {
|
||||
FieldChinese chinese = field.getAnnotation(FieldChinese.class);
|
||||
if (chinese != null && StringUtils.isNotBlank(chinese.value())) {
|
||||
return chinese.value();
|
||||
}
|
||||
return resolveColumnName(field);
|
||||
}
|
||||
|
||||
private Object getFieldValue(Field field, Object target) {
|
||||
try {
|
||||
return field.get(target);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user