Merge pull request 'feat/infer_dev_260107' (#3) from feat/infer_dev_260107 into develop
Reviewed-on: #3
This commit was merged in pull request #3.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.kamco.cd.kamcoback.gukyuin;
|
||||
|
||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto;
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto;
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ChnDetectMastReqDto;
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ChngDetectMastSearchDto;
|
||||
@@ -17,7 +18,6 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -50,10 +50,10 @@ public class GukYuinApiController {
|
||||
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@PostMapping("/mast/regist")
|
||||
public ChngDetectMastDto.Basic regist(
|
||||
@PostMapping("/chn/mast/regist")
|
||||
public ApiResponseDto<ChngDetectMastDto.Basic> regist(
|
||||
@RequestBody @Valid ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) {
|
||||
return gukYuinApiService.regist(chnDetectMastReq);
|
||||
return ApiResponseDto.ok(gukYuinApiService.regist(chnDetectMastReq));
|
||||
}
|
||||
|
||||
@Operation(summary = "탐지결과 삭제", description = "탐지결과 삭제")
|
||||
@@ -69,14 +69,14 @@ public class GukYuinApiController {
|
||||
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@PostMapping("/mast/remove")
|
||||
public ResReturn remove(
|
||||
@PostMapping("/chn/mast/remove")
|
||||
public ApiResponseDto<ResReturn> remove(
|
||||
@RequestBody @Valid ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) {
|
||||
return gukYuinApiService.remove(chnDetectMastReq);
|
||||
return ApiResponseDto.ok(gukYuinApiService.remove(chnDetectMastReq));
|
||||
}
|
||||
|
||||
@Operation(summary = "탐지결과 등록목록 조회", description = "탐지결과 등록목록 조회")
|
||||
@GetMapping("/mast/list")
|
||||
@Operation(summary = "탐지결과 등록목록 조회(년도,차수 조회)", description = "탐지결과 등록목록 조회")
|
||||
@GetMapping("/chn/mast")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
@@ -89,17 +89,53 @@ public class GukYuinApiController {
|
||||
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
public List<ChngDetectMastDto.Basic> selectChangeDetectionList(
|
||||
@RequestParam(required = false) String chnDtctId,
|
||||
public ApiResponseDto<ChngDetectMastDto.ResultDto> selectChangeDetectionList(
|
||||
@RequestParam(required = false) String cprsYr,
|
||||
@RequestParam(required = false) String crtrYr,
|
||||
@RequestParam(required = false) String chnDtctSno) {
|
||||
ChngDetectMastSearchDto searchDto = new ChngDetectMastSearchDto();
|
||||
searchDto.setChnDtctId(chnDtctId);
|
||||
searchDto.setCprsYr(cprsYr);
|
||||
searchDto.setCrtrYr(crtrYr);
|
||||
searchDto.setChnDtctSno(chnDtctSno);
|
||||
return gukYuinApiService.list(searchDto);
|
||||
return ApiResponseDto.ok(gukYuinApiService.listYearStage(searchDto));
|
||||
}
|
||||
|
||||
@Operation(summary = "탐지결과 등록목록 조회(회차uid)", description = "탐지결과 등록목록 조회")
|
||||
@GetMapping("/chn/mast/{chnDtctId}")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "목록 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = Basic.class))),
|
||||
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
public ApiResponseDto<ChngDetectMastDto.ResultDto> selectChangeDetectionDtctIdList(
|
||||
@RequestParam(required = false) String chnDtctId) {
|
||||
return ApiResponseDto.ok(gukYuinApiService.listChnDtctId(chnDtctId));
|
||||
}
|
||||
|
||||
@Operation(summary = "탐지결과 등록목록 조회(1건 조회)", description = "탐지결과 등록목록 조회")
|
||||
@GetMapping("/chn/mast/list/{chnDtctMstId}")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "목록 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = Basic.class))),
|
||||
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
public ApiResponseDto<ChngDetectMastDto.ResultDto> selectChangeDetectionList(
|
||||
@PathVariable String chnDtctMstId) {
|
||||
return ApiResponseDto.ok(gukYuinApiService.list(chnDtctMstId));
|
||||
}
|
||||
|
||||
@Operation(summary = "국유in연동 가능여부 확인", description = "국유in연동 가능여부 확인")
|
||||
@@ -125,4 +161,82 @@ public class GukYuinApiController {
|
||||
UUID uuid) {
|
||||
return ApiResponseDto.ok(gukYuinApiService.getIsLinkGukYuin(uuid));
|
||||
}
|
||||
|
||||
@Operation(summary = "탐지객체 조회 (탐지객체)", description = "탐지객체 조회 (탐지객체)")
|
||||
@GetMapping("/chn/cont/{chnDtctId}")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "목록 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = Basic.class))),
|
||||
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
public ApiResponseDto<ChngDetectContDto.ResultContDto> findChnContList(
|
||||
@PathVariable String chnDtctId,
|
||||
@RequestParam(defaultValue = "0") Integer pageIndex,
|
||||
@RequestParam(defaultValue = "10") Integer pageSize) {
|
||||
return ApiResponseDto.ok(gukYuinApiService.findChnContList(chnDtctId, pageIndex, pageSize));
|
||||
}
|
||||
|
||||
@Operation(summary = "탐지객체 조회 (PNU에 해당하는 탐지객체)", description = "탐지객체 조회 (PNU에 해당하는 탐지객체)")
|
||||
@GetMapping("/chn/cont/{chnDtctId}/pnu/{pnu}")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "목록 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = Basic.class))),
|
||||
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
public ApiResponseDto<ChngDetectContDto.ResultContDto> findChnPnuToContList(
|
||||
@PathVariable String chnDtctId, @PathVariable String pnu) {
|
||||
return ApiResponseDto.ok(gukYuinApiService.findChnPnuToContList(chnDtctId, pnu));
|
||||
}
|
||||
|
||||
@Operation(summary = "탐지객체 조회 (탐지객체와 교차하는 PNU)", description = "탐지객체 조회 (탐지객체와 교차하는 PNU)")
|
||||
@GetMapping("/chn/pnu/{chnDtctId}/objt/{chnDtctObjtId}")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "목록 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = Basic.class))),
|
||||
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
public ApiResponseDto<ChngDetectContDto.ResultPnuDto> findPnuObjMgmtList(
|
||||
@PathVariable String chnDtctId, @PathVariable String chnDtctObjtId) {
|
||||
return ApiResponseDto.ok(gukYuinApiService.findPnuObjMgmtList(chnDtctId, chnDtctObjtId));
|
||||
}
|
||||
|
||||
@Operation(summary = "라벨여부 수정", description = "라벨여부 수정")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "201",
|
||||
description = "등록 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = DetectMastReq.class))),
|
||||
@ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@PostMapping("/rlb/objt/{chnDtctObjtId}/lbl/{lblYn}")
|
||||
public ApiResponseDto<ResReturn> updateChnDtctObjtLabelingYn(
|
||||
@PathVariable String chnDtctObjtId, @PathVariable String lblYn) {
|
||||
return ApiResponseDto.ok(gukYuinApiService.updateChnDtctObjtLabelingYn(chnDtctObjtId, lblYn));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.kamco.cd.kamcoback.gukyuin.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
public class ChngDetectContDto {
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class ContBasic {
|
||||
|
||||
private String chnDtctMstId; // 탐지콘텐츠아이디
|
||||
private String chnDtctContId; // 탐지마스타아이디
|
||||
private String cprsYr; // 비교년도 2023
|
||||
private String crtrYr; // 기준년도 2024
|
||||
private String chnDtctSno; // 차수 (1 | 2 | ...)
|
||||
private String mpqdNo; // 도엽번호
|
||||
private String chnDtctId; // 탐지아이디. UUID를 기반으로 '-'를 제거하고 대문자/숫자로 구성
|
||||
private String chnDtctObjtId; // 탐지객체아이디. UUID를 기반으로 '-'를 제거하고 대문자/숫자로 구성
|
||||
private String chnDtctPolygon; // 탐지객체폴리곤
|
||||
private String chnDtctSqms; // 탐지객체면적
|
||||
private String chnCd; // 변화코드
|
||||
private String chnDtctJson; // 변화탐지JSON
|
||||
private String chnDtctProb; // 변화탐지정확도
|
||||
private String bfClsCd; // 이전부류코드
|
||||
private String bfClsProb; // 이전분류정확도
|
||||
private String afClsCd; // 이후분류코드
|
||||
private String afClsProb; // 이후분류정확도
|
||||
private String crtDt; // 생성일시
|
||||
private String crtEpno; // 생성사원번호
|
||||
private String crtIp; // 생성사원아이피
|
||||
private String delYn; // 삭제여부
|
||||
private String[] pnuList; // pnuList
|
||||
private String reqEpno; // 요청사원번호
|
||||
private String reqIp; // 요청사원아이피
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class ChnDetectContReqDto {
|
||||
|
||||
private String cprsYr; // 비교년도 2023
|
||||
private String crtrYr; // 기준년도 2024
|
||||
private String chnDtctSno; // 차수 (1 | 2 | ...)
|
||||
private String mpqdNo; // 도엽번호
|
||||
private String chnDtctId; // 탐지아이디. UUID를 기반으로 '-'를 제거하고 대문자/숫자로 구성
|
||||
private String chnDtctObjtId; // 탐지객체아이디. UUID를 기반으로 '-'를 제거하고 대문자/숫자로 구성
|
||||
private String reqEpno; // 사원번호
|
||||
private String reqIp;
|
||||
}
|
||||
|
||||
@Schema(name = "ResReturn", description = "수행 후 리턴")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class ResReturn {
|
||||
|
||||
private String flag;
|
||||
private String message;
|
||||
}
|
||||
|
||||
@Schema(name = "ResultContDto", description = "cont list 리턴 형태")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class ResultContDto {
|
||||
|
||||
private Integer code;
|
||||
private String message;
|
||||
private List<ContBasic> result;
|
||||
private Boolean success;
|
||||
}
|
||||
|
||||
@Schema(name = "DtoPnuDetectMpng", description = "PNU 결과 형태")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class DtoPnuDetectMpng {
|
||||
|
||||
private String pnuDtctId;
|
||||
private String lrmYmd;
|
||||
private String pnu;
|
||||
private String pnuSqms;
|
||||
private String pnuDtctSqms;
|
||||
|
||||
private String chnDtctSqms;
|
||||
private String chnDtctMstId;
|
||||
private String chnDtctContId;
|
||||
private String chnDtctId;
|
||||
private String chnDtctObjtId;
|
||||
private String crtDt;
|
||||
}
|
||||
|
||||
@Schema(name = "ResultPnuDto", description = "pnu list 리턴 형태")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class ResultPnuDto {
|
||||
|
||||
private Integer code;
|
||||
private String message;
|
||||
private List<DtoPnuDetectMpng> result;
|
||||
private Boolean success;
|
||||
}
|
||||
}
|
||||
@@ -129,7 +129,7 @@ public class ChngDetectMastDto {
|
||||
@AllArgsConstructor
|
||||
public static class ChngDetectMastSearchDto {
|
||||
|
||||
private String chnDtctId;
|
||||
// private String chnDtctId;
|
||||
private String cprsYr;
|
||||
private String crtrYr;
|
||||
private String chnDtctSno;
|
||||
@@ -145,4 +145,17 @@ public class ChngDetectMastDto {
|
||||
private String flag;
|
||||
private String message;
|
||||
}
|
||||
|
||||
@Schema(name = "ResultDto", description = "mast list 리턴 형태")
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class ResultDto {
|
||||
|
||||
private Integer code;
|
||||
private String message;
|
||||
private List<Basic> result;
|
||||
private Boolean success;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,10 @@ import lombok.Getter;
|
||||
@AllArgsConstructor
|
||||
public enum GukYuinStatus implements EnumType {
|
||||
PENDING("대기"),
|
||||
IN_PROGRESS("사용"),
|
||||
COMPLETED("완료");
|
||||
IN_PROGRESS("진행중"),
|
||||
GUK_COMPLETED("국유인 매핑 완료"),
|
||||
PNU_COMPLETED("PNU 싱크 완료"),
|
||||
CANCELED("취소");
|
||||
|
||||
private final String desc;
|
||||
|
||||
|
||||
@@ -3,13 +3,17 @@ package com.kamco.cd.kamcoback.gukyuin.service;
|
||||
import com.kamco.cd.kamcoback.common.utils.NetUtils;
|
||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient;
|
||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient.ExternalCallResult;
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto;
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ContBasic;
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ResultContDto;
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ResultPnuDto;
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto;
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ResReturn;
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ResultDto;
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GukYuinLinkFacts;
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GukYuinLinkFailCode;
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GukYuinLinkableRes;
|
||||
import com.kamco.cd.kamcoback.postgres.core.GukYuinCoreService;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -23,77 +27,88 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@RequiredArgsConstructor
|
||||
public class GukYuinApiService {
|
||||
|
||||
private final GukYuinCoreService gukyuinCoreService;
|
||||
private final ExternalHttpClient externalHttpClient;
|
||||
private final NetUtils netUtils = new NetUtils();
|
||||
|
||||
@Value("${spring.profiles.active:local}")
|
||||
private String profile;
|
||||
|
||||
@Value("${gukyuin.url}")
|
||||
private String gukyuinUrl;
|
||||
|
||||
@Value("${gukyuin.mast}")
|
||||
private String gukyuinMastUrl;
|
||||
|
||||
private final GukYuinCoreService gukyuinCoreService;
|
||||
private final ExternalHttpClient externalHttpClient;
|
||||
private final NetUtils netUtils = new NetUtils();
|
||||
@Value("${gukyuin.cdi}")
|
||||
private String gukyuinCdiUrl;
|
||||
|
||||
@Transactional
|
||||
public ChngDetectMastDto.Basic regist(ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) {
|
||||
|
||||
ChngDetectMastDto.Basic basic = new ChngDetectMastDto.Basic();
|
||||
|
||||
String url = gukyuinMastUrl + "/regist";
|
||||
// url = "http://localhost:8080/api/kcd/cdi/detect/mast/regist";
|
||||
String url = gukyuinCdiUrl + "/chn/mast/regist";
|
||||
|
||||
String myip = netUtils.getLocalIP();
|
||||
chnDetectMastReq.setReqIp(myip);
|
||||
chnDetectMastReq.setReqEpno("1234567"); // TODO
|
||||
|
||||
System.out.println("url == " + url);
|
||||
System.out.println("url == " + myip);
|
||||
|
||||
ExternalCallResult<String> result =
|
||||
ExternalCallResult<ChngDetectMastDto.Basic> result =
|
||||
externalHttpClient.call(
|
||||
url, HttpMethod.POST, chnDetectMastReq, netUtils.jsonHeaders(), String.class);
|
||||
url,
|
||||
HttpMethod.POST,
|
||||
chnDetectMastReq,
|
||||
netUtils.jsonHeaders(),
|
||||
ChngDetectMastDto.Basic.class);
|
||||
|
||||
System.out.println("result == " + result);
|
||||
ChngDetectMastDto.Basic resultBody = result.body();
|
||||
gukyuinCoreService.updateGukYuinMastRegResult(resultBody);
|
||||
|
||||
return basic;
|
||||
return resultBody;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public ResReturn remove(ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) {
|
||||
ChngDetectMastDto.Basic basic = new ChngDetectMastDto.Basic();
|
||||
|
||||
String url = gukyuinMastUrl + "/remove";
|
||||
// url = "http://localhost:8080/api/kcd/cdi/detect/mast/remove";
|
||||
String url = gukyuinCdiUrl + "/chn/mast/remove";
|
||||
|
||||
String myip = netUtils.getLocalIP();
|
||||
chnDetectMastReq.setReqIp(myip);
|
||||
chnDetectMastReq.setReqEpno("1234567"); // TODO
|
||||
|
||||
System.out.println("url == " + url);
|
||||
System.out.println("url == " + myip);
|
||||
|
||||
ExternalCallResult<String> result =
|
||||
ExternalCallResult<ChngDetectMastDto.Basic> result =
|
||||
externalHttpClient.call(
|
||||
url, HttpMethod.POST, chnDetectMastReq, netUtils.jsonHeaders(), String.class);
|
||||
url,
|
||||
HttpMethod.POST,
|
||||
chnDetectMastReq,
|
||||
netUtils.jsonHeaders(),
|
||||
ChngDetectMastDto.Basic.class);
|
||||
|
||||
System.out.println("result == " + result);
|
||||
ChngDetectMastDto.Basic resultBody = result.body();
|
||||
gukyuinCoreService.updateGukYuinMastRegRemove(resultBody);
|
||||
|
||||
return new ResReturn("success", "탐지결과 삭제 되었습니다.");
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public List<ChngDetectMastDto.Basic> list(ChngDetectMastDto.ChngDetectMastSearchDto searchDto) {
|
||||
List<ChngDetectMastDto.Basic> masterList = new ArrayList<>();
|
||||
// 등록목록 1개 확인
|
||||
public ChngDetectMastDto.ResultDto list(String chnDtctMstId) {
|
||||
|
||||
String url = gukyuinCdiUrl + "/chn/mast/list/" + chnDtctMstId;
|
||||
|
||||
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
||||
externalHttpClient.call(
|
||||
url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class);
|
||||
|
||||
return result.body();
|
||||
}
|
||||
|
||||
// 등록목록 비교년도,기준년도,차수 조합해서 n개 확인
|
||||
public ChngDetectMastDto.ResultDto listYearStage(
|
||||
ChngDetectMastDto.ChngDetectMastSearchDto searchDto) {
|
||||
|
||||
String queryString = netUtils.dtoToQueryString(searchDto, null);
|
||||
String url = gukyuinMastUrl + queryString;
|
||||
String url = gukyuinCdiUrl + "/chn/mast" + queryString;
|
||||
|
||||
ExternalCallResult<String> result =
|
||||
externalHttpClient.call(url, HttpMethod.GET, null, netUtils.jsonHeaders(), String.class);
|
||||
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
||||
externalHttpClient.call(
|
||||
url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class);
|
||||
|
||||
System.out.println("list result == " + result);
|
||||
|
||||
return masterList;
|
||||
return result.body();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -133,4 +148,100 @@ public class GukYuinApiService {
|
||||
|
||||
return GukYuinLinkFailCode.OK;
|
||||
}
|
||||
|
||||
// 탐지객체 리스트 조회
|
||||
public ResultContDto findChnContList(String chnDtctId, Integer pageIndex, Integer pageSize) {
|
||||
|
||||
String url =
|
||||
gukyuinCdiUrl
|
||||
+ "/chn/cont/"
|
||||
+ chnDtctId
|
||||
+ "?pageIndex="
|
||||
+ pageIndex
|
||||
+ "&pageSize="
|
||||
+ pageSize;
|
||||
|
||||
ExternalCallResult<ChngDetectContDto.ResultContDto> result =
|
||||
externalHttpClient.call(
|
||||
url,
|
||||
HttpMethod.GET,
|
||||
null,
|
||||
netUtils.jsonHeaders(),
|
||||
ChngDetectContDto.ResultContDto.class);
|
||||
|
||||
List<ContBasic> contList = result.body().getResult();
|
||||
if (contList == null || contList.isEmpty()) {
|
||||
return new ResultContDto();
|
||||
}
|
||||
|
||||
for (ContBasic cont : contList) {
|
||||
String[] pnuList = cont.getPnuList();
|
||||
long pnuCnt = pnuList == null ? 0 : pnuList.length;
|
||||
if (cont.getChnDtctObjtId() != null) {
|
||||
gukyuinCoreService.updateInferenceGeomDataPnuCnt(cont.getChnDtctObjtId(), pnuCnt);
|
||||
|
||||
if (pnuCnt > 0) {
|
||||
Long geoUid =
|
||||
gukyuinCoreService.findMapSheetAnalDataInferenceGeomUid(cont.getChnDtctObjtId());
|
||||
gukyuinCoreService.insertGeoUidPnuData(geoUid, pnuList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result.body();
|
||||
}
|
||||
|
||||
public ResultPnuDto findPnuObjMgmtList(String chnDtctId, String chnDtctObjtId) {
|
||||
String url = gukyuinCdiUrl + "/chn/pnu/" + chnDtctId + "/objt/" + chnDtctObjtId;
|
||||
|
||||
ExternalCallResult<ChngDetectContDto.ResultPnuDto> result =
|
||||
externalHttpClient.call(
|
||||
url,
|
||||
HttpMethod.GET,
|
||||
null,
|
||||
netUtils.jsonHeaders(),
|
||||
ChngDetectContDto.ResultPnuDto.class);
|
||||
|
||||
return result.body();
|
||||
}
|
||||
|
||||
public ResReturn updateChnDtctObjtLabelingYn(String chnDtctObjtId, String lblYn) {
|
||||
String url = gukyuinCdiUrl + "/rlb/objt/" + chnDtctObjtId + "/lbl/" + lblYn;
|
||||
|
||||
ExternalCallResult<ChngDetectContDto.ResultPnuDto> result =
|
||||
externalHttpClient.call(
|
||||
url,
|
||||
HttpMethod.POST,
|
||||
null,
|
||||
netUtils.jsonHeaders(),
|
||||
ChngDetectContDto.ResultPnuDto.class);
|
||||
|
||||
ChngDetectContDto.ResultPnuDto dto = result.body();
|
||||
|
||||
return new ResReturn(dto.getCode() > 200000 ? "fail" : "success", dto.getMessage());
|
||||
}
|
||||
|
||||
public ResultContDto findChnPnuToContList(String chnDtctId, String pnu) {
|
||||
String url = gukyuinCdiUrl + "/chn/cont/" + chnDtctId + "/pnu/" + pnu;
|
||||
|
||||
ExternalCallResult<ChngDetectContDto.ResultContDto> result =
|
||||
externalHttpClient.call(
|
||||
url,
|
||||
HttpMethod.GET,
|
||||
null,
|
||||
netUtils.jsonHeaders(),
|
||||
ChngDetectContDto.ResultContDto.class);
|
||||
|
||||
return result.body();
|
||||
}
|
||||
|
||||
public ResultDto listChnDtctId(String chnDtctId) {
|
||||
String url = gukyuinCdiUrl + "/chn/mast/" + chnDtctId;
|
||||
|
||||
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
||||
externalHttpClient.call(
|
||||
url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class);
|
||||
|
||||
return result.body();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.kamco.cd.kamcoback.upload.service.UploadService;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
@@ -264,9 +265,18 @@ public class ModelMngService {
|
||||
}
|
||||
}
|
||||
|
||||
// pt는 고정경로 등록
|
||||
modelUploadResDto.setClsModelPath(ptPath);
|
||||
modelUploadResDto.setClsModelFileName(ptFileName);
|
||||
if (!hasPt) {
|
||||
|
||||
String defaultPath = ptPath;
|
||||
String defaultFileName = ptFileName;
|
||||
|
||||
Path ptPath = Paths.get(defaultPath, defaultFileName);
|
||||
|
||||
if (Files.exists(ptPath)) {
|
||||
modelUploadResDto.setClsModelPath(defaultPath);
|
||||
modelUploadResDto.setClsModelFileName(defaultFileName);
|
||||
}
|
||||
}
|
||||
|
||||
// int fileListPos = 0;
|
||||
// int fileTotCnt = files.size();
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.kamco.cd.kamcoback.postgres.core;
|
||||
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.Basic;
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GukYuinLinkFacts;
|
||||
import com.kamco.cd.kamcoback.postgres.repository.Inference.MapSheetLearnRepository;
|
||||
import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinRepository;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -11,6 +13,7 @@ import org.springframework.stereotype.Service;
|
||||
public class GukYuinCoreService {
|
||||
|
||||
private final MapSheetLearnRepository mapSheetLearnRepository;
|
||||
private final GukYuinRepository gukYuinRepository;
|
||||
|
||||
/**
|
||||
* 국유in연동 가능여부 확인
|
||||
@@ -21,4 +24,24 @@ public class GukYuinCoreService {
|
||||
public GukYuinLinkFacts findLinkFacts(UUID uuid) {
|
||||
return mapSheetLearnRepository.findLinkFacts(uuid);
|
||||
}
|
||||
|
||||
public void updateGukYuinMastRegResult(Basic resultBody) {
|
||||
gukYuinRepository.updateGukYuinMastRegResult(resultBody);
|
||||
}
|
||||
|
||||
public void updateGukYuinMastRegRemove(Basic resultBody) {
|
||||
gukYuinRepository.updateGukYuinMastRegRemove(resultBody);
|
||||
}
|
||||
|
||||
public void updateInferenceGeomDataPnuCnt(String chnDtctObjtId, long pnuCnt) {
|
||||
gukYuinRepository.updateInferenceGeomDataPnuCnt(chnDtctObjtId, pnuCnt);
|
||||
}
|
||||
|
||||
public Long findMapSheetAnalDataInferenceGeomUid(String chnDtctObjtId) {
|
||||
return gukYuinRepository.findMapSheetAnalDataInferenceGeomUid(chnDtctObjtId);
|
||||
}
|
||||
|
||||
public void insertGeoUidPnuData(Long geoUid, String[] pnuList) {
|
||||
gukYuinRepository.insertGeoUidPnuData(geoUid, pnuList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.kamco.cd.kamcoback.postgres.core;
|
||||
|
||||
import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinRepository;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class GukYuinJobCoreService {
|
||||
|
||||
private final GukYuinRepository gukYuinRepository;
|
||||
|
||||
public GukYuinJobCoreService(GukYuinRepository gukYuinRepository) {
|
||||
this.gukYuinRepository = gukYuinRepository;
|
||||
}
|
||||
|
||||
public List<String> findGukyuinApplyIngUidList() {
|
||||
return gukYuinRepository.findGukyuinApplyIngUidList();
|
||||
}
|
||||
|
||||
public void updateGukYuinApplyStateComplete(String uid) {
|
||||
gukYuinRepository.updateGukYuinApplyStateComplete(uid);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.gukyuin;
|
||||
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface GukYuinRepository
|
||||
extends JpaRepository<MapSheetLearnEntity, Long>, GukYuinRepositoryCustom {}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.gukyuin;
|
||||
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.Basic;
|
||||
import java.util.List;
|
||||
|
||||
public interface GukYuinRepositoryCustom {
|
||||
|
||||
void updateGukYuinMastRegResult(Basic resultBody);
|
||||
|
||||
void updateGukYuinMastRegRemove(Basic resultBody);
|
||||
|
||||
void updateInferenceGeomDataPnuCnt(String chnDtctObjtId, long pnuCnt);
|
||||
|
||||
Long findMapSheetAnalDataInferenceGeomUid(String chnDtctObjtId);
|
||||
|
||||
void insertGeoUidPnuData(Long geoUid, String[] pnuList);
|
||||
|
||||
List<String> findGukyuinApplyIngUidList();
|
||||
|
||||
void updateGukYuinApplyStateComplete(String uid);
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.gukyuin;
|
||||
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity.mapSheetAnalDataInferenceGeomEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QPnuEntity.pnuEntity;
|
||||
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.Basic;
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import jakarta.persistence.PersistenceContext;
|
||||
import jakarta.transaction.Transactional;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class GukYuinRepositoryImpl implements GukYuinRepositoryCustom {
|
||||
|
||||
private final JPAQueryFactory queryFactory;
|
||||
@PersistenceContext private EntityManager em;
|
||||
|
||||
@Override
|
||||
public void updateGukYuinMastRegResult(Basic resultBody) {
|
||||
|
||||
int excnPgrt = Integer.parseInt(resultBody.getExcnPgrt());
|
||||
int stage = Integer.parseInt(resultBody.getChnDtctSno());
|
||||
GukYuinStatus status = GukYuinStatus.IN_PROGRESS;
|
||||
if (excnPgrt == 100) {
|
||||
status = GukYuinStatus.GUK_COMPLETED;
|
||||
}
|
||||
|
||||
queryFactory
|
||||
.update(mapSheetLearnEntity)
|
||||
.set(mapSheetLearnEntity.stage, stage)
|
||||
.set(mapSheetLearnEntity.applyStatus, status.getId())
|
||||
.set(mapSheetLearnEntity.applyStatusDttm, ZonedDateTime.now())
|
||||
.where(mapSheetLearnEntity.uid.eq(resultBody.getChnDtctId()))
|
||||
.execute();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateGukYuinMastRegRemove(Basic resultBody) {
|
||||
queryFactory
|
||||
.update(mapSheetLearnEntity)
|
||||
.set(mapSheetLearnEntity.applyStatus, GukYuinStatus.CANCELED.getId())
|
||||
.set(mapSheetLearnEntity.applyStatusDttm, ZonedDateTime.now())
|
||||
.where(mapSheetLearnEntity.uid.eq(resultBody.getChnDtctId()))
|
||||
.execute();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateInferenceGeomDataPnuCnt(String chnDtctObjtId, long pnuCnt) {
|
||||
queryFactory
|
||||
.update(mapSheetAnalDataInferenceGeomEntity)
|
||||
.set(mapSheetAnalDataInferenceGeomEntity.pnu, pnuCnt)
|
||||
.where(mapSheetAnalDataInferenceGeomEntity.resultUid.eq(chnDtctObjtId))
|
||||
.execute();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long findMapSheetAnalDataInferenceGeomUid(String chnDtctObjtId) {
|
||||
return queryFactory
|
||||
.select(mapSheetAnalDataInferenceGeomEntity.geoUid)
|
||||
.from(mapSheetAnalDataInferenceGeomEntity)
|
||||
.where(mapSheetAnalDataInferenceGeomEntity.resultUid.eq(chnDtctObjtId))
|
||||
.fetchOne();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertGeoUidPnuData(Long geoUid, String[] pnuList) {
|
||||
for (String pnu : pnuList) {
|
||||
queryFactory
|
||||
.insert(pnuEntity)
|
||||
.columns(pnuEntity.geo.geoUid, pnuEntity.pnu, pnuEntity.createdDttm)
|
||||
.values(geoUid, pnu, ZonedDateTime.now())
|
||||
.execute();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> findGukyuinApplyIngUidList() {
|
||||
return queryFactory
|
||||
.select(mapSheetLearnEntity.uid)
|
||||
.from(mapSheetLearnEntity)
|
||||
.where(mapSheetLearnEntity.applyStatus.eq(GukYuinStatus.IN_PROGRESS.getId()))
|
||||
.fetch();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateGukYuinApplyStateComplete(String uid) {
|
||||
queryFactory
|
||||
.update(mapSheetLearnEntity)
|
||||
.set(mapSheetLearnEntity.applyStatus, GukYuinStatus.PNU_COMPLETED.getId())
|
||||
.set(mapSheetLearnEntity.applyStatusDttm, ZonedDateTime.now())
|
||||
.where(mapSheetLearnEntity.uid.eq(uid))
|
||||
.execute();
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ public class MapSheetMngFileJobController {
|
||||
private final MapSheetMngFileJobService mapSheetMngFileJobService;
|
||||
|
||||
// 현재 상태 확인용 Getter
|
||||
@Getter private boolean isSchedulerEnabled = true;
|
||||
@Getter private boolean isSchedulerEnabled = false;
|
||||
@Getter private boolean isFileSyncSchedulerEnabled = false;
|
||||
@Getter private int mngSyncPageSize = 20;
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.kamco.cd.kamcoback.scheduler.service;
|
||||
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto;
|
||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ResultDto;
|
||||
import com.kamco.cd.kamcoback.gukyuin.service.GukYuinApiService;
|
||||
import com.kamco.cd.kamcoback.postgres.core.GukYuinJobCoreService;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Log4j2
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class GukYuinApiJobService {
|
||||
|
||||
private final GukYuinApiService gukYuinApiService;
|
||||
private final GukYuinJobCoreService gukYuinJobCoreService;
|
||||
|
||||
@Value("${spring.profiles.active}")
|
||||
private String profile;
|
||||
|
||||
/**
|
||||
* 실행중인 profile
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean isLocalProfile() {
|
||||
return "local".equalsIgnoreCase(profile);
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 0/10 * * * *")
|
||||
public void findGukYuinMastCompleteYn() {
|
||||
if (isLocalProfile()) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<String> list = gukYuinJobCoreService.findGukyuinApplyIngUidList();
|
||||
if (list.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (String uid : list) {
|
||||
try {
|
||||
ResultDto result = gukYuinApiService.listChnDtctId(uid);
|
||||
|
||||
if (result == null || result.getResult() == null || result.getResult().isEmpty()) {
|
||||
log.warn("[GUKYUIN] empty result uid={}", uid);
|
||||
continue;
|
||||
}
|
||||
|
||||
ChngDetectMastDto.Basic basic = result.getResult().get(0);
|
||||
|
||||
Integer progress =
|
||||
basic.getExcnPgrt() == null ? null : Integer.parseInt(basic.getExcnPgrt().trim());
|
||||
if (progress != null && progress == 100) {
|
||||
gukYuinJobCoreService.updateGukYuinApplyStateComplete(uid);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("[GUKYUIN] failed uid={}", uid, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Scheduled(cron = "0 0 1 * * *")
|
||||
public void findGukYuinContListPnuUpdate() {
|
||||
if (isLocalProfile()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -121,11 +121,11 @@ public class MapSheetMngFileJobService {
|
||||
|
||||
int tfwCnt =
|
||||
(int)
|
||||
basicList.stream().filter(dto -> dto.getExtension().toString().equals("tfw")).count();
|
||||
basicList.stream().filter(dto -> dto.getExtension().equalsIgnoreCase("tfw")).count();
|
||||
|
||||
int tifCnt =
|
||||
(int)
|
||||
basicList.stream().filter(dto -> dto.getExtension().toString().equals("tif")).count();
|
||||
basicList.stream().filter(dto -> dto.getExtension().equalsIgnoreCase("tif")).count();
|
||||
|
||||
syncState = "";
|
||||
syncCheckState = "";
|
||||
|
||||
@@ -104,8 +104,8 @@ file:
|
||||
model-tmp-dir: ${file.model-dir}tmp/
|
||||
model-file-extention: pth,json,py
|
||||
|
||||
pt-path: /kamco-nfs/ckpt/classification/
|
||||
pt-FileName: v5-best.pt
|
||||
pt-path: /kamco-nfs/ckpt/model/v6-cls-checkpoints/
|
||||
pt-FileName: yolov8_6th-6m.pt
|
||||
|
||||
inference:
|
||||
url: http://10.100.0.11:8000/jobs
|
||||
@@ -117,7 +117,7 @@ inference:
|
||||
gukyuin:
|
||||
#url: http://localhost:8080
|
||||
url: http://192.168.2.129:5301
|
||||
mast: ${gukyuin.url}/api/kcd/cdi/chn/mast
|
||||
cdi: ${gukyuin.url}/api/kcd/cdi
|
||||
|
||||
training-data:
|
||||
geojson-dir: /kamco-nfs/model_output/labeling/
|
||||
|
||||
@@ -59,8 +59,8 @@ file:
|
||||
model-tmp-dir: ${file.model-dir}tmp/
|
||||
model-file-extention: pth,json,py
|
||||
|
||||
pt-path: /kamco-nfs/ckpt/classification/
|
||||
pt-FileName: v5-best.pt
|
||||
pt-path: /kamco-nfs/ckpt/model/v6-cls-checkpoints/
|
||||
pt-FileName: yolov8_6th-6m.pt
|
||||
|
||||
inference:
|
||||
url: http://10.100.0.11:8000/jobs
|
||||
@@ -72,7 +72,7 @@ inference:
|
||||
gukyuin:
|
||||
#url: http://localhost:8080
|
||||
url: http://192.168.2.129:5301
|
||||
mast: ${gukyuin.url}/api/kcd/cdi/chn/mast
|
||||
cdi: ${gukyuin.url}/api/kcd/cdi
|
||||
|
||||
training-data:
|
||||
geojson-dir: /kamco-nfs/model_output/labeling/
|
||||
|
||||
Reference in New Issue
Block a user