Browse Source

日志表增加主建

shaohongbo 3 years ago
parent
commit
b7c07ec959

+ 3 - 2
src/main/java/com/persagy/apm/diagnose/indicatorrecord/service/impl/MonitorIndicatorRecordServiceImpl.java

@@ -174,11 +174,12 @@ public class MonitorIndicatorRecordServiceImpl implements IMonitorIndicatorRecor
                 String objId = objIdIndicatorId.substring(0, indexOf);
                 String indicatorId = objIdIndicatorId.substring(indexOf + 1);
                 save.setCode(indicatorId);
+                save.setId(UUID.randomUUID().toString());
                 save.setObjId(objId);
                 save.setLogType(EnumComputeLogType.ComputeType.getCode());
                 save.setDataTime(lastComputeTime);
                 save.setComputeRound(projectIndicatorCompute==null?1:projectIndicatorCompute.getComputeRound());
-                save.setLogInfo(CommonUtils.getExceptionStackTrace(e));
+                save.setLogInfo(e.getMessage());
                 save.setLogTime(new Date());
 //                save.setId(UUID.randomUUID().toString());
                 coredao.save(save);
@@ -502,7 +503,7 @@ public class MonitorIndicatorRecordServiceImpl implements IMonitorIndicatorRecor
 
                 IndicatorComputeLog save = new IndicatorComputeLog();
                 save.setProject(projectDTO.getProjectId());
-//                save.setId(UUID.randomUUID().toString());
+                save.setId(UUID.randomUUID().toString());
                 save.setCode(alarmItemCode);
                 save.setObjId(objId);
                 save.setLogType(EnumComputeLogType.SendDataType.getCode());

+ 7 - 5
src/main/java/com/persagy/framework/ems/data/pojo/hbase/IndicatorComputeLog.java

@@ -15,7 +15,7 @@ import java.util.Date;
 @Entity(name = "IndicatorComputeLog")
 @Table(name = "indicator_compute_log", comment = "运行诊断计算发数日志", schema = Schema.UDM,
 		indexes = {
-				@Index(columns = {"project","obj_id","code","log_type","log_time"},unique = true),
+				@Index(columns = {"c_id"},unique = true),
 				@Index(columns = {"project", "obj_id", "code", "log_time","data_time"}),
 				@Index(columns = {"project", "obj_id", "code","log_type","log_time","data_time"}),
 				@Index(columns = {"project", "obj_id", "code","log_type","data_time"})
@@ -25,17 +25,19 @@ import java.util.Date;
 @Data
 public class IndicatorComputeLog extends BusinessObject {
 
-	private static final long serialVersionUID = 9123470427203487460L;
+	@Column(order = 10, name = "c_id", length = 50, nullable = false, comment = "项目/建筑id")
+	@JsonProperty("id")
+	private String id;
 
 	@Column(order = 20, name = "project", length = 50, nullable = false, comment = "项目/建筑id")
 	@JsonProperty("project")
 	private String project;
 
-	@Column(order = 30, name = "obj_id", length = 50, nullable = true, comment = "能耗模型id")
+	@Column(order = 30, name = "obj_id", length = 50, nullable = false, comment = "能耗模型id")
 	@JsonProperty("objId")
 	private String objId;
 
-	@Column(order = 40, name = "code", length = 50, nullable = true, comment = "分项id")
+	@Column(order = 40, name = "code", length = 50, nullable = false, comment = "分项id")
 	@JsonProperty("code")
 	private String code;
 
@@ -57,7 +59,7 @@ public class IndicatorComputeLog extends BusinessObject {
 	@JsonProperty("computeRound")
 	private Integer computeRound;
 
-	@Column(order = 90, name = "log_info", length = 128, nullable = false, comment = "日志详情")
+	@Column(order = 90, name = "log_info", length = 128, nullable = true, comment = "日志详情")
 	@JsonProperty("logInfo")
 	private String logInfo;
 }