Merge pull request 'feat/infer_dev_260107' (#307) from feat/infer_dev_260107 into develop
Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/307
This commit is contained in:
@@ -305,6 +305,8 @@ public class InferenceDetailDto {
|
|||||||
Long mapSheetNum;
|
Long mapSheetNum;
|
||||||
String mapSheetName;
|
String mapSheetName;
|
||||||
String subUid;
|
String subUid;
|
||||||
|
String pnu;
|
||||||
|
String passYn;
|
||||||
|
|
||||||
// @JsonIgnore String gemoStr;
|
// @JsonIgnore String gemoStr;
|
||||||
// @JsonIgnore String geomCenterStr;
|
// @JsonIgnore String geomCenterStr;
|
||||||
@@ -323,7 +325,9 @@ public class InferenceDetailDto {
|
|||||||
Double classAfterProb,
|
Double classAfterProb,
|
||||||
Long mapSheetNum,
|
Long mapSheetNum,
|
||||||
String mapSheetName,
|
String mapSheetName,
|
||||||
String subUid) {
|
String subUid,
|
||||||
|
String pnu,
|
||||||
|
String passYn) {
|
||||||
this.uuid = uuid;
|
this.uuid = uuid;
|
||||||
this.uid = uid;
|
this.uid = uid;
|
||||||
this.compareYyyy = compareYyyy;
|
this.compareYyyy = compareYyyy;
|
||||||
@@ -338,20 +342,8 @@ public class InferenceDetailDto {
|
|||||||
this.mapSheetNum = mapSheetNum;
|
this.mapSheetNum = mapSheetNum;
|
||||||
this.mapSheetName = mapSheetName;
|
this.mapSheetName = mapSheetName;
|
||||||
this.subUid = subUid;
|
this.subUid = subUid;
|
||||||
// this.gemoStr = gemoStr;
|
this.pnu = pnu;
|
||||||
// this.geomCenterStr = geomCenterStr;
|
this.passYn = passYn;
|
||||||
//
|
|
||||||
// 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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -178,6 +178,12 @@ public class InferenceResultDto {
|
|||||||
@Schema(description = "uid")
|
@Schema(description = "uid")
|
||||||
private String uid;
|
private String uid;
|
||||||
|
|
||||||
|
@Schema(description = "uid 앞 8자리")
|
||||||
|
@JsonProperty("subUid")
|
||||||
|
public String subUid() {
|
||||||
|
return this.uid.substring(0, 8).toUpperCase();
|
||||||
|
}
|
||||||
|
|
||||||
@Schema(description = "상태명")
|
@Schema(description = "상태명")
|
||||||
@JsonProperty("statusName")
|
@JsonProperty("statusName")
|
||||||
public String statusName() {
|
public String statusName() {
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
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;
|
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.QMapInkx5kEntity.mapInkx5kEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearn5kEntity.mapSheetLearn5kEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearn5kEntity.mapSheetLearn5kEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity;
|
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.kamco.cd.kamcoback.scheduler.dto.JobStatusDto;
|
||||||
import com.querydsl.core.BooleanBuilder;
|
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.Expressions;
|
||||||
import com.querydsl.core.types.dsl.NumberPath;
|
import com.querydsl.core.types.dsl.NumberPath;
|
||||||
import com.querydsl.core.types.dsl.StringPath;
|
import com.querydsl.core.types.dsl.StringPath;
|
||||||
import com.querydsl.jpa.JPAExpressions;
|
|
||||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@@ -55,7 +56,7 @@ public class MapSheetLearn5kRepositoryImpl implements MapSheetLearn5kRepositoryC
|
|||||||
}
|
}
|
||||||
|
|
||||||
var learnIdSubQuery =
|
var learnIdSubQuery =
|
||||||
JPAExpressions.select(mapSheetLearnEntity.id)
|
select(mapSheetLearnEntity.id)
|
||||||
.from(mapSheetLearnEntity)
|
.from(mapSheetLearnEntity)
|
||||||
.where(mapSheetLearnEntity.uuid.eq(uuid));
|
.where(mapSheetLearnEntity.uuid.eq(uuid));
|
||||||
|
|
||||||
@@ -102,7 +103,7 @@ public class MapSheetLearn5kRepositoryImpl implements MapSheetLearn5kRepositoryC
|
|||||||
}
|
}
|
||||||
|
|
||||||
var learnIdSubQuery =
|
var learnIdSubQuery =
|
||||||
JPAExpressions.select(mapSheetLearnEntity.id)
|
select(mapSheetLearnEntity.id)
|
||||||
.from(mapSheetLearnEntity)
|
.from(mapSheetLearnEntity)
|
||||||
.where(mapSheetLearnEntity.uuid.eq(uuid));
|
.where(mapSheetLearnEntity.uuid.eq(uuid));
|
||||||
|
|
||||||
@@ -201,24 +202,30 @@ public class MapSheetLearn5kRepositoryImpl implements MapSheetLearn5kRepositoryC
|
|||||||
.fetch();
|
.fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 추론 진행 도엽 목록
|
||||||
|
*
|
||||||
|
* @param uuid uuid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<String> getInferenceRunMapId(UUID uuid) {
|
public List<String> getInferenceRunMapId(UUID uuid) {
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(mapInkx5kEntity.mapidNm)
|
.select(mapInkx50kEntity.mapidNm.concat(mapInkx50kEntity.mapidcdNo))
|
||||||
.from(mapSheetLearnEntity)
|
.from(mapInkx50kEntity)
|
||||||
.innerJoin(mapSheetLearn5kEntity)
|
.join(mapInkx5kEntity)
|
||||||
.on(mapSheetLearn5kEntity.learn.id.eq(mapSheetLearnEntity.id))
|
.on(mapInkx5kEntity.mapInkx50k.fid.eq(mapInkx50kEntity.fid))
|
||||||
.innerJoin(mapInkx5kEntity)
|
.where(
|
||||||
.on(
|
mapInkx5kEntity.mapidcdNo.in(
|
||||||
Expressions.booleanTemplate(
|
select(
|
||||||
"function('regexp_match', {0}, '^[0-9]+$') is not null",
|
Expressions.stringTemplate(
|
||||||
mapInkx5kEntity.mapidcdNo)
|
"CAST({0} AS text)", mapSheetLearn5kEntity.mapSheetNum))
|
||||||
.and(
|
.from(mapSheetLearnEntity)
|
||||||
mapSheetLearn5kEntity.mapSheetNum.eq(
|
.join(mapSheetLearn5kEntity)
|
||||||
Expressions.numberTemplate(
|
.on(mapSheetLearn5kEntity.learn.id.eq(mapSheetLearnEntity.id))
|
||||||
Long.class, "cast({0} as long)", mapInkx5kEntity.mapidcdNo))))
|
.where(mapSheetLearnEntity.uuid.eq(uuid))))
|
||||||
.where(mapSheetLearnEntity.uuid.eq(uuid))
|
.groupBy(mapInkx50kEntity.mapidcdNo, mapInkx50kEntity.mapidNm)
|
||||||
.groupBy(mapInkx5kEntity.mapidNm)
|
.orderBy(mapInkx50kEntity.mapidNm.asc())
|
||||||
.fetch();
|
.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.QMapSheetAnalInferenceEntity.mapSheetAnalInferenceEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalSttcEntity.mapSheetAnalSttcEntity;
|
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.QMapSheetLearnEntity.mapSheetLearnEntity;
|
||||||
|
import static com.kamco.cd.kamcoback.postgres.entity.QPnuEntity.pnuEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QSystemMetricEntity.systemMetricEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QSystemMetricEntity.systemMetricEntity;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.common.exception.CustomApiException;
|
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.CaseBuilder;
|
||||||
import com.querydsl.core.types.dsl.Expressions;
|
import com.querydsl.core.types.dsl.Expressions;
|
||||||
import com.querydsl.core.types.dsl.NumberExpression;
|
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 com.querydsl.jpa.impl.JPAQueryFactory;
|
||||||
import java.time.OffsetDateTime;
|
import java.time.OffsetDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -411,6 +414,13 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
NumberExpression<Long> inkxNoAsLong =
|
NumberExpression<Long> inkxNoAsLong =
|
||||||
Expressions.numberTemplate(Long.class, "cast({0} as long)", mapInkx5kEntity.mapidcdNo);
|
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
|
// 4) content
|
||||||
List<Geom> content =
|
List<Geom> content =
|
||||||
queryFactory
|
queryFactory
|
||||||
@@ -430,7 +440,9 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
mapInkx5kEntity.mapidNm,
|
mapInkx5kEntity.mapidNm,
|
||||||
Expressions.stringTemplate(
|
Expressions.stringTemplate(
|
||||||
"substring({0} from 1 for 8)",
|
"substring({0} from 1 for 8)",
|
||||||
mapSheetAnalDataInferenceGeomEntity.resultUid)))
|
mapSheetAnalDataInferenceGeomEntity.resultUid),
|
||||||
|
pnu,
|
||||||
|
Expressions.nullExpression(String.class)))
|
||||||
.from(mapSheetAnalInferenceEntity)
|
.from(mapSheetAnalInferenceEntity)
|
||||||
.join(mapSheetAnalDataInferenceEntity)
|
.join(mapSheetAnalDataInferenceEntity)
|
||||||
.on(mapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalInferenceEntity.id))
|
.on(mapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalInferenceEntity.id))
|
||||||
|
|||||||
Reference in New Issue
Block a user