추론 결과 조회 수정
This commit is contained in:
@@ -29,8 +29,10 @@ public class InferenceDetailDto {
|
||||
private String dataName;
|
||||
private Long mapSheepNum;
|
||||
private Long detectingCnt;
|
||||
@JsonFormatDttm private ZonedDateTime analStrtDttm;
|
||||
@JsonFormatDttm private ZonedDateTime analEndDttm;
|
||||
@JsonFormatDttm
|
||||
private ZonedDateTime analStrtDttm;
|
||||
@JsonFormatDttm
|
||||
private ZonedDateTime analEndDttm;
|
||||
private Long analSec;
|
||||
private String analState;
|
||||
|
||||
@@ -61,8 +63,10 @@ public class InferenceDetailDto {
|
||||
private Long id;
|
||||
private String analTitle;
|
||||
private Long detectingCnt;
|
||||
@JsonFormatDttm private ZonedDateTime analStrtDttm;
|
||||
@JsonFormatDttm private ZonedDateTime analEndDttm;
|
||||
@JsonFormatDttm
|
||||
private ZonedDateTime analStrtDttm;
|
||||
@JsonFormatDttm
|
||||
private ZonedDateTime analEndDttm;
|
||||
private Long analSec;
|
||||
private Long analPredSec;
|
||||
private String analState;
|
||||
@@ -102,8 +106,10 @@ public class InferenceDetailDto {
|
||||
private String modelInfo;
|
||||
private Integer targetYyyy;
|
||||
private Integer compareYyyy;
|
||||
@JsonFormatDttm private ZonedDateTime analStrtDttm;
|
||||
@JsonFormatDttm private ZonedDateTime analEndDttm;
|
||||
@JsonFormatDttm
|
||||
private ZonedDateTime analStrtDttm;
|
||||
@JsonFormatDttm
|
||||
private ZonedDateTime analEndDttm;
|
||||
private Long analSec;
|
||||
private Long analPredSec;
|
||||
private String resultUrl;
|
||||
@@ -183,7 +189,8 @@ public class InferenceDetailDto {
|
||||
private Clazzes target;
|
||||
private MapSheet mapSheet;
|
||||
private Coordinate center;
|
||||
@JsonFormatDttm private ZonedDateTime updatedDttm;
|
||||
@JsonFormatDttm
|
||||
private ZonedDateTime updatedDttm;
|
||||
|
||||
public DetailListEntity(
|
||||
UUID uuid,
|
||||
@@ -233,7 +240,8 @@ public class InferenceDetailDto {
|
||||
|
||||
private String code;
|
||||
private String name;
|
||||
@JsonIgnore private Double score;
|
||||
@JsonIgnore
|
||||
private Double score;
|
||||
|
||||
public Clazz(String code, Double score) {
|
||||
this.code = code;
|
||||
@@ -305,6 +313,7 @@ public class InferenceDetailDto {
|
||||
Long mapSheetNum;
|
||||
String mapSheetName;
|
||||
String subUid;
|
||||
String pnu;
|
||||
|
||||
// @JsonIgnore String gemoStr;
|
||||
// @JsonIgnore String geomCenterStr;
|
||||
@@ -323,7 +332,8 @@ public class InferenceDetailDto {
|
||||
Double classAfterProb,
|
||||
Long mapSheetNum,
|
||||
String mapSheetName,
|
||||
String subUid) {
|
||||
String subUid,
|
||||
String pnu) {
|
||||
this.uuid = uuid;
|
||||
this.uid = uid;
|
||||
this.compareYyyy = compareYyyy;
|
||||
@@ -338,20 +348,7 @@ public class InferenceDetailDto {
|
||||
this.mapSheetNum = mapSheetNum;
|
||||
this.mapSheetName = mapSheetName;
|
||||
this.subUid = subUid;
|
||||
// this.gemoStr = gemoStr;
|
||||
// this.geomCenterStr = geomCenterStr;
|
||||
//
|
||||
// ObjectMapper mapper = new ObjectMapper();
|
||||
// JsonNode geomJson;
|
||||
// JsonNode geomCenterJson;
|
||||
// try {
|
||||
// geomJson = mapper.readTree(gemoStr);
|
||||
// geomCenterJson = mapper.readTree(geomCenterStr);
|
||||
// } catch (JsonProcessingException e) {
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
// this.gemo = geomJson;
|
||||
// this.geomCenter = geomCenterJson;
|
||||
this.pnu = pnu;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -439,8 +436,10 @@ public class InferenceDetailDto {
|
||||
private Integer targetYyyy;
|
||||
private String detectOption;
|
||||
private String mapSheetScope;
|
||||
@JsonFormatDttm private ZonedDateTime inferStartDttm;
|
||||
@JsonFormatDttm private ZonedDateTime inferEndDttm;
|
||||
@JsonFormatDttm
|
||||
private ZonedDateTime inferStartDttm;
|
||||
@JsonFormatDttm
|
||||
private ZonedDateTime inferEndDttm;
|
||||
private Integer stage;
|
||||
private String elapsedDuration;
|
||||
private String subUid;
|
||||
|
||||
@@ -23,7 +23,9 @@ import org.springframework.data.domain.Pageable;
|
||||
|
||||
public class InferenceResultDto {
|
||||
|
||||
/** 분석대상 도엽 enum */
|
||||
/**
|
||||
* 분석대상 도엽 enum
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum MapSheetScope implements EnumType {
|
||||
@@ -52,7 +54,9 @@ public class InferenceResultDto {
|
||||
}
|
||||
}
|
||||
|
||||
/** 탐지 데이터 옵션 dto */
|
||||
/**
|
||||
* 탐지 데이터 옵션 dto
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum DetectOption implements EnumType {
|
||||
@@ -129,7 +133,9 @@ public class InferenceResultDto {
|
||||
}
|
||||
}
|
||||
|
||||
/** 목록조회 dto */
|
||||
/**
|
||||
* 목록조회 dto
|
||||
*/
|
||||
@Schema(name = "ResultList", description = "추론관리 목록")
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -178,6 +184,12 @@ public class InferenceResultDto {
|
||||
@Schema(description = "uid")
|
||||
private String uid;
|
||||
|
||||
@Schema(description = "uid 앞 8자리")
|
||||
@JsonProperty("subUid")
|
||||
public String subUid() {
|
||||
return this.uid.substring(0, 8).toUpperCase();
|
||||
}
|
||||
|
||||
@Schema(description = "상태명")
|
||||
@JsonProperty("statusName")
|
||||
public String statusName() {
|
||||
@@ -207,7 +219,9 @@ public class InferenceResultDto {
|
||||
}
|
||||
}
|
||||
|
||||
/** 목록조회 검색 조건 dto */
|
||||
/**
|
||||
* 목록조회 검색 조건 dto
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@@ -229,7 +243,9 @@ public class InferenceResultDto {
|
||||
}
|
||||
}
|
||||
|
||||
/** 변화탐지 실행 정보 저장 요청 정보 */
|
||||
/**
|
||||
* 변화탐지 실행 정보 저장 요청 정보
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@@ -513,9 +529,12 @@ public class InferenceResultDto {
|
||||
public static class InferenceServerStatusDto {
|
||||
|
||||
private String serverName;
|
||||
@JsonIgnore private float cpu_user;
|
||||
@JsonIgnore private float cpu_system;
|
||||
@JsonIgnore private float memused;
|
||||
@JsonIgnore
|
||||
private float cpu_user;
|
||||
@JsonIgnore
|
||||
private float cpu_system;
|
||||
@JsonIgnore
|
||||
private float memused;
|
||||
private Long kbmemused;
|
||||
private float gpuUtil;
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.kamco.cd.kamcoback.postgres.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.SequenceGenerator;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.OffsetDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "tb_pnu")
|
||||
public class PnuEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "tb_pnu_id_gen")
|
||||
@SequenceGenerator(name = "tb_pnu_id_gen", sequenceName = "tb_pnu_uid", allocationSize = 1)
|
||||
@Column(name = "id", nullable = false)
|
||||
private Long id;
|
||||
|
||||
@NotNull
|
||||
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||
@JoinColumn(name = "geo_uid", nullable = false)
|
||||
private MapSheetAnalDataInferenceGeomEntity geo;
|
||||
|
||||
@Size(max = 19)
|
||||
@Column(name = "pnu", length = 19)
|
||||
private String pnu;
|
||||
|
||||
@Column(name = "created_dttm")
|
||||
private OffsetDateTime createdDttm;
|
||||
|
||||
@Column(name = "created_uid")
|
||||
private Long createdUid;
|
||||
|
||||
@ColumnDefault("false")
|
||||
@Column(name = "del_yn")
|
||||
private Boolean delYn;
|
||||
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.Inference;
|
||||
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapInkx50kEntity.mapInkx50kEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapInkx5kEntity.mapInkx5kEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearn5kEntity.mapSheetLearn5kEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity;
|
||||
import static com.querydsl.jpa.JPAExpressions.select;
|
||||
|
||||
import com.kamco.cd.kamcoback.scheduler.dto.JobStatusDto;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
@@ -10,7 +12,6 @@ import com.querydsl.core.types.dsl.BooleanPath;
|
||||
import com.querydsl.core.types.dsl.Expressions;
|
||||
import com.querydsl.core.types.dsl.NumberPath;
|
||||
import com.querydsl.core.types.dsl.StringPath;
|
||||
import com.querydsl.jpa.JPAExpressions;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
@@ -55,7 +56,7 @@ public class MapSheetLearn5kRepositoryImpl implements MapSheetLearn5kRepositoryC
|
||||
}
|
||||
|
||||
var learnIdSubQuery =
|
||||
JPAExpressions.select(mapSheetLearnEntity.id)
|
||||
select(mapSheetLearnEntity.id)
|
||||
.from(mapSheetLearnEntity)
|
||||
.where(mapSheetLearnEntity.uuid.eq(uuid));
|
||||
|
||||
@@ -102,7 +103,7 @@ public class MapSheetLearn5kRepositoryImpl implements MapSheetLearn5kRepositoryC
|
||||
}
|
||||
|
||||
var learnIdSubQuery =
|
||||
JPAExpressions.select(mapSheetLearnEntity.id)
|
||||
select(mapSheetLearnEntity.id)
|
||||
.from(mapSheetLearnEntity)
|
||||
.where(mapSheetLearnEntity.uuid.eq(uuid));
|
||||
|
||||
@@ -201,24 +202,30 @@ public class MapSheetLearn5kRepositoryImpl implements MapSheetLearn5kRepositoryC
|
||||
.fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 추론 진행 도엽 목록
|
||||
*
|
||||
* @param uuid uuid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<String> getInferenceRunMapId(UUID uuid) {
|
||||
return queryFactory
|
||||
.select(mapInkx5kEntity.mapidNm)
|
||||
.select(mapInkx50kEntity.mapidNm.concat(mapInkx50kEntity.mapidcdNo))
|
||||
.from(mapInkx50kEntity)
|
||||
.join(mapInkx5kEntity).on(mapInkx5kEntity.mapInkx50k.fid.eq(mapInkx50kEntity.fid))
|
||||
.where(
|
||||
mapInkx5kEntity.mapidcdNo.in(
|
||||
select(
|
||||
Expressions.stringTemplate("CAST({0} AS text)", mapSheetLearn5kEntity.mapSheetNum)
|
||||
)
|
||||
.from(mapSheetLearnEntity)
|
||||
.innerJoin(mapSheetLearn5kEntity)
|
||||
.on(mapSheetLearn5kEntity.learn.id.eq(mapSheetLearnEntity.id))
|
||||
.innerJoin(mapInkx5kEntity)
|
||||
.on(
|
||||
Expressions.booleanTemplate(
|
||||
"function('regexp_match', {0}, '^[0-9]+$') is not null",
|
||||
mapInkx5kEntity.mapidcdNo)
|
||||
.and(
|
||||
mapSheetLearn5kEntity.mapSheetNum.eq(
|
||||
Expressions.numberTemplate(
|
||||
Long.class, "cast({0} as long)", mapInkx5kEntity.mapidcdNo))))
|
||||
.join(mapSheetLearn5kEntity).on(mapSheetLearn5kEntity.learn.id.eq(mapSheetLearnEntity.id))
|
||||
.where(mapSheetLearnEntity.uuid.eq(uuid))
|
||||
.groupBy(mapInkx5kEntity.mapidNm)
|
||||
)
|
||||
)
|
||||
.groupBy(mapInkx50kEntity.mapidcdNo, mapInkx50kEntity.mapidNm)
|
||||
.orderBy(mapInkx50kEntity.mapidNm.asc())
|
||||
.fetch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceG
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalInferenceEntity.mapSheetAnalInferenceEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalSttcEntity.mapSheetAnalSttcEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QPnuEntity.pnuEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QSystemMetricEntity.systemMetricEntity;
|
||||
|
||||
import com.kamco.cd.kamcoback.common.exception.CustomApiException;
|
||||
@@ -28,6 +29,8 @@ import com.querydsl.core.types.dsl.BooleanExpression;
|
||||
import com.querydsl.core.types.dsl.CaseBuilder;
|
||||
import com.querydsl.core.types.dsl.Expressions;
|
||||
import com.querydsl.core.types.dsl.NumberExpression;
|
||||
import com.querydsl.core.types.dsl.StringExpression;
|
||||
import com.querydsl.jpa.JPAExpressions;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import java.time.OffsetDateTime;
|
||||
import java.util.List;
|
||||
@@ -411,6 +414,15 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
||||
NumberExpression<Long> inkxNoAsLong =
|
||||
Expressions.numberTemplate(Long.class, "cast({0} as long)", mapInkx5kEntity.mapidcdNo);
|
||||
|
||||
StringExpression pnu =
|
||||
Expressions.stringTemplate(
|
||||
"coalesce(({0}), '')",
|
||||
JPAExpressions
|
||||
.select(Expressions.stringTemplate("string_agg({0}, ',')", pnuEntity.pnu))
|
||||
.from(pnuEntity)
|
||||
.where(pnuEntity.geo.geoUid.eq(mapSheetAnalDataInferenceGeomEntity.geoUid))
|
||||
);
|
||||
|
||||
// 4) content
|
||||
List<Geom> content =
|
||||
queryFactory
|
||||
@@ -430,7 +442,8 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
||||
mapInkx5kEntity.mapidNm,
|
||||
Expressions.stringTemplate(
|
||||
"substring({0} from 1 for 8)",
|
||||
mapSheetAnalDataInferenceGeomEntity.resultUid)))
|
||||
mapSheetAnalDataInferenceGeomEntity.resultUid
|
||||
), pnu))
|
||||
.from(mapSheetAnalInferenceEntity)
|
||||
.join(mapSheetAnalDataInferenceEntity)
|
||||
.on(mapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalInferenceEntity.id))
|
||||
|
||||
Reference in New Issue
Block a user