Compare commits
46 Commits
feat/infer
...
8dfae65bcc
| Author | SHA1 | Date | |
|---|---|---|---|
| 8dfae65bcc | |||
| 872df11844 | |||
| f992bbe9ca | |||
| 643ea5cf9a | |||
| bc4b2dbac1 | |||
| 694b2fc31e | |||
| fbdda6477c | |||
| a572089dff | |||
| c6abf7a935 | |||
| a9348d9a66 | |||
| b877d2a8c9 | |||
| 151012ea28 | |||
| 68c68082cf | |||
| 4ce96b72aa | |||
| 0a5c5dfd7d | |||
| 7442e4ee09 | |||
| d278baed96 | |||
| 6b0074316f | |||
| f921ef5d0d | |||
| 7667620395 | |||
| 527acc9839 | |||
| 407f14d230 | |||
| 4a91d61b7d | |||
| 9d7bbc1b63 | |||
| f46ea62761 | |||
| 1abc0b93c0 | |||
| 4204e48d88 | |||
| fa41d41739 | |||
| ee28edd9d0 | |||
| 8555897b77 | |||
| fe7b1ed0bd | |||
| 064c02e21b | |||
| fd3499a5ec | |||
| 686cf03524 | |||
| ee9914a5f3 | |||
| b3e90c9f2b | |||
| 156b7a312d | |||
| cfed31656a | |||
| 14e8a6476f | |||
| ae6de0c030 | |||
| 4036f88296 | |||
| 28718c4218 | |||
| 54c92842d4 | |||
| c83c540dfb | |||
| dd1284f5c0 | |||
| 385ada3291 |
24
Dockerfile-prod
Normal file
24
Dockerfile-prod
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# 1단계에서 만든 로컬 베이스 이미지를 사용
|
||||||
|
FROM 192.168.2.73:18082/kamco-cd/base-java21-gdal:1.0
|
||||||
|
FROM 192.168.2.73:18082/kamco-cd/base-java21-gdal:1.0
|
||||||
|
|
||||||
|
# 사용자 설정 (앱 별로 다를 수 있으므로 여기에 유지)
|
||||||
|
ARG UID=1000
|
||||||
|
ARG GID=1000
|
||||||
|
|
||||||
|
RUN groupadd -g ${GID} kcomu \
|
||||||
|
&& useradd -u ${UID} -g ${GID} -m kcomu
|
||||||
|
|
||||||
|
USER kcomu
|
||||||
|
|
||||||
|
# 작업 디렉토리 설정
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# JAR 파일 복사 (Jenkins에서 빌드된 ROOT.jar)
|
||||||
|
COPY build/libs/ROOT.jar app.jar
|
||||||
|
|
||||||
|
# 포트 노출
|
||||||
|
EXPOSE 8080
|
||||||
|
# 애플리케이션 실행
|
||||||
|
# dev 프로파일로 실행
|
||||||
|
ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=prod", "app.jar"]
|
||||||
35
docker-compose-prod.yml
Normal file
35
docker-compose-prod.yml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
services:
|
||||||
|
kamco-changedetection-api:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile-prod
|
||||||
|
args:
|
||||||
|
UID: 1000 # manager01 UID
|
||||||
|
GID: 1000 # manager01 GID
|
||||||
|
image: kamco-changedetection-api:${IMAGE_TAG:-latest}
|
||||||
|
container_name: kamco-changedetection-api
|
||||||
|
user: "1000:1000"
|
||||||
|
ports:
|
||||||
|
- "7100:8080"
|
||||||
|
environment:
|
||||||
|
- SPRING_PROFILES_ACTIVE=dev
|
||||||
|
- TZ=Asia/Seoul
|
||||||
|
volumes:
|
||||||
|
- /mnt/nfs_share/images:/app/original-images
|
||||||
|
- /mnt/nfs_share/model_output:/app/model-outputs
|
||||||
|
- /mnt/nfs_share/train_dataset:/app/train-dataset
|
||||||
|
- /mnt/nfs_share/tmp:/app/tmp
|
||||||
|
- /kamco-nfs:/kamco-nfs
|
||||||
|
networks:
|
||||||
|
- kamco-cds
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: [ "CMD", "curl", "-f", "http://localhost:8080/monitor/health" ]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
start_period: 40s
|
||||||
|
|
||||||
|
networks:
|
||||||
|
kamco-cds:
|
||||||
|
external: true
|
||||||
@@ -11,11 +11,6 @@ import com.kamco.cd.kamcoback.gukyuin.dto.DetectMastDto.Basic;
|
|||||||
import com.kamco.cd.kamcoback.gukyuin.dto.DetectMastDto.DetectMastReq;
|
import com.kamco.cd.kamcoback.gukyuin.dto.DetectMastDto.DetectMastReq;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GukYuinLinkableRes;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GukYuinLinkableRes;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.service.GukYuinApiService;
|
import com.kamco.cd.kamcoback.gukyuin.service.GukYuinApiService;
|
||||||
import com.kamco.cd.kamcoback.scheduler.service.GukYuinApiLabelJobService;
|
|
||||||
import com.kamco.cd.kamcoback.scheduler.service.GukYuinApiPnuJobService;
|
|
||||||
import com.kamco.cd.kamcoback.scheduler.service.GukYuinApiStatusJobService;
|
|
||||||
import com.kamco.cd.kamcoback.scheduler.service.GukYuinApiStbltJobService;
|
|
||||||
import io.swagger.v3.oas.annotations.Hidden;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
@@ -43,10 +38,6 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
public class GukYuinApiController {
|
public class GukYuinApiController {
|
||||||
|
|
||||||
private final GukYuinApiService gukYuinApiService;
|
private final GukYuinApiService gukYuinApiService;
|
||||||
private final GukYuinApiPnuJobService gukYuinApiPnuJobService;
|
|
||||||
private final GukYuinApiStatusJobService gukYuinApiStatusJobService;
|
|
||||||
private final GukYuinApiLabelJobService gukYuinApiLabelJobService;
|
|
||||||
private final GukYuinApiStbltJobService gukYuinApiStbltJobService;
|
|
||||||
|
|
||||||
/** 탐지결과 등록 */
|
/** 탐지결과 등록 */
|
||||||
@Operation(summary = "탐지결과 등록", description = "탐지결과 등록")
|
@Operation(summary = "탐지결과 등록", description = "탐지결과 등록")
|
||||||
@@ -270,7 +261,7 @@ public class GukYuinApiController {
|
|||||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||||
})
|
})
|
||||||
@PostMapping("/rlb/objt/{chnDtctObjtId}/lbl/{lblYn}")
|
@PostMapping("/rlb/objt/{chnDtctObjtId}/lbl/{lblYn}")
|
||||||
public ApiResponseDto<ChngDetectContDto.ResultLabelDto> updateChnDtctObjtLabelingYn(
|
public ApiResponseDto<ChngDetectContDto.ResultPnuDto> updateChnDtctObjtLabelingYn(
|
||||||
@PathVariable String chnDtctObjtId, @PathVariable String lblYn) {
|
@PathVariable String chnDtctObjtId, @PathVariable String lblYn) {
|
||||||
return ApiResponseDto.ok(gukYuinApiService.updateChnDtctObjtLabelingYn(chnDtctObjtId, lblYn));
|
return ApiResponseDto.ok(gukYuinApiService.updateChnDtctObjtLabelingYn(chnDtctObjtId, lblYn));
|
||||||
}
|
}
|
||||||
@@ -306,10 +297,8 @@ public class GukYuinApiController {
|
|||||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||||
})
|
})
|
||||||
public ApiResponseDto<ChngDetectMastDto.RlbDtctDto> findRlbDtctList(
|
public ApiResponseDto<ChngDetectMastDto.RlbDtctDto> findRlbDtctList(
|
||||||
@PathVariable String chnDtctId,
|
@PathVariable String chnDtctId) {
|
||||||
@Parameter(description = "날짜(기본은 어제 날짜)") @RequestParam(defaultValue = "20260205")
|
return ApiResponseDto.ok(gukYuinApiService.findRlbDtctList(chnDtctId));
|
||||||
String yyyymmdd) {
|
|
||||||
return ApiResponseDto.ok(gukYuinApiService.findRlbDtctList(chnDtctId, yyyymmdd));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "탐지객체 적합여부 조회 (객체별 조회)", description = "탐지객체 적합여부 조회 (객체별 조회)")
|
@Operation(summary = "탐지객체 적합여부 조회 (객체별 조회)", description = "탐지객체 적합여부 조회 (객체별 조회)")
|
||||||
@@ -330,36 +319,4 @@ public class GukYuinApiController {
|
|||||||
@PathVariable String chnDtctObjtId) {
|
@PathVariable String chnDtctObjtId) {
|
||||||
return ApiResponseDto.ok(gukYuinApiService.findRlbDtctObject(chnDtctObjtId));
|
return ApiResponseDto.ok(gukYuinApiService.findRlbDtctObject(chnDtctObjtId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Hidden
|
|
||||||
@Operation(summary = "job test pnu", description = "job test pnu")
|
|
||||||
@GetMapping("/job-test/pnu")
|
|
||||||
public ApiResponseDto<Void> findGukYuinContListPnuUpdate() {
|
|
||||||
gukYuinApiPnuJobService.findGukYuinContListPnuUpdate();
|
|
||||||
return ApiResponseDto.ok(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Hidden
|
|
||||||
@Operation(summary = "job test status", description = "job test status")
|
|
||||||
@GetMapping("/job-test/status")
|
|
||||||
public ApiResponseDto<Void> findGukYuinMastCompleteYn() {
|
|
||||||
gukYuinApiStatusJobService.findGukYuinMastCompleteYn();
|
|
||||||
return ApiResponseDto.ok(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Hidden
|
|
||||||
@Operation(summary = "job test label", description = "job test label")
|
|
||||||
@GetMapping("/job-test/label")
|
|
||||||
public ApiResponseDto<Void> findLabelingCompleteSend() {
|
|
||||||
gukYuinApiLabelJobService.findLabelingCompleteSend();
|
|
||||||
return ApiResponseDto.ok(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Hidden
|
|
||||||
@Operation(summary = "job test stblt", description = "job test stblt")
|
|
||||||
@GetMapping("/job-test/stblt")
|
|
||||||
public ApiResponseDto<Void> findGukYuinEligibleForSurvey() {
|
|
||||||
gukYuinApiStbltJobService.findGukYuinEligibleForSurvey();
|
|
||||||
return ApiResponseDto.ok(null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,27 +114,4 @@ public class ChngDetectContDto {
|
|||||||
private List<DtoPnuDetectMpng> result;
|
private List<DtoPnuDetectMpng> result;
|
||||||
private Boolean success;
|
private Boolean success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Schema(name = "ResultLabelDto", description = "ResultLabelDto list 리턴 형태")
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public static class ResultLabelDto {
|
|
||||||
|
|
||||||
private Integer code;
|
|
||||||
private String message;
|
|
||||||
private DtoPnuDetectMpng result;
|
|
||||||
private Boolean success;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public static class ReqInfo {
|
|
||||||
|
|
||||||
private String reqIp;
|
|
||||||
private String reqEpno;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient;
|
|||||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient.ExternalCallResult;
|
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;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ContBasic;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ContBasic;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ReqInfo;
|
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ResultContDto;
|
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.ChngDetectContDto.ResultPnuDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto;
|
||||||
@@ -333,21 +332,17 @@ public class GukYuinApiService {
|
|||||||
return result.body();
|
return result.body();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChngDetectContDto.ResultLabelDto updateChnDtctObjtLabelingYn(
|
public ChngDetectContDto.ResultPnuDto updateChnDtctObjtLabelingYn(
|
||||||
String chnDtctObjtId, String lblYn) {
|
String chnDtctObjtId, String lblYn) {
|
||||||
String url = gukyuinCdiUrl + "/rlb/objt/" + chnDtctObjtId + "/lbl/" + lblYn;
|
String url = gukyuinCdiUrl + "/rlb/objt/" + chnDtctObjtId + "/lbl/" + lblYn;
|
||||||
|
|
||||||
ReqInfo info = new ReqInfo();
|
ExternalCallResult<ChngDetectContDto.ResultPnuDto> result =
|
||||||
info.setReqIp(myip);
|
|
||||||
info.setReqEpno(userUtil.getEmployeeNo());
|
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectContDto.ResultLabelDto> result =
|
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
url,
|
url,
|
||||||
HttpMethod.POST,
|
HttpMethod.POST,
|
||||||
info,
|
null,
|
||||||
netUtils.jsonHeaders(),
|
netUtils.jsonHeaders(),
|
||||||
ChngDetectContDto.ResultLabelDto.class);
|
ChngDetectContDto.ResultPnuDto.class);
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
this.insertGukyuinAuditLog(
|
||||||
EventType.MODIFIED.getId(),
|
EventType.MODIFIED.getId(),
|
||||||
@@ -456,25 +451,15 @@ public class GukYuinApiService {
|
|||||||
Integer maxStage =
|
Integer maxStage =
|
||||||
gukyuinCoreService.findMapSheetLearnYearStage(info.getCompareYyyy(), info.getTargetYyyy());
|
gukyuinCoreService.findMapSheetLearnYearStage(info.getCompareYyyy(), info.getTargetYyyy());
|
||||||
|
|
||||||
// 1회차를 종료 상태로 처리하고 2회차를 보내야 함
|
|
||||||
// 추론(learn), 학습데이터(inference) 둘 다 종료 처리
|
|
||||||
if (maxStage > 0) {
|
|
||||||
Long learnId =
|
|
||||||
gukyuinCoreService.findMapSheetLearnInfoByYyyy(
|
|
||||||
info.getCompareYyyy(), info.getTargetYyyy(), maxStage);
|
|
||||||
gukyuinCoreService.updateMapSheetLearnGukyuinEndStatus(learnId);
|
|
||||||
gukyuinCoreService.updateMapSheetInferenceLabelEndStatus(learnId);
|
|
||||||
}
|
|
||||||
|
|
||||||
// reqDto 셋팅
|
// reqDto 셋팅
|
||||||
ChnDetectMastReqDto reqDto = new ChnDetectMastReqDto();
|
ChnDetectMastReqDto reqDto = new ChnDetectMastReqDto();
|
||||||
reqDto.setCprsYr(String.valueOf(info.getCompareYyyy()));
|
reqDto.setCprsYr(String.valueOf(info.getCompareYyyy()));
|
||||||
reqDto.setCrtrYr(String.valueOf(info.getTargetYyyy()));
|
reqDto.setCrtrYr(String.valueOf(info.getTargetYyyy()));
|
||||||
reqDto.setChnDtctSno(String.valueOf(maxStage + 1));
|
reqDto.setChnDtctSno(String.valueOf(maxStage + 1));
|
||||||
reqDto.setChnDtctId(info.getUid());
|
reqDto.setChnDtctId(info.getUid());
|
||||||
reqDto.setPathNm("/kamco-nfs/dataset/export/" + info.getUid());
|
reqDto.setPathNm(datasetDir + info.getUid());
|
||||||
|
|
||||||
if (!Files.isDirectory(Path.of("/kamco-nfs/dataset/export/" + info.getUid()))) {
|
if (Files.isDirectory(Path.of(datasetDir + info.getUid()))) {
|
||||||
return new ResponseObj(
|
return new ResponseObj(
|
||||||
ApiResponseCode.NOT_FOUND_DATA, "파일 경로에 회차 실행 파일이 생성되지 않았습니다. 확인 부탁드립니다.");
|
ApiResponseCode.NOT_FOUND_DATA, "파일 경로에 회차 실행 파일이 생성되지 않았습니다. 확인 부탁드립니다.");
|
||||||
}
|
}
|
||||||
@@ -528,7 +513,7 @@ public class GukYuinApiService {
|
|||||||
return result.body();
|
return result.body();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChngDetectMastDto.RlbDtctDto findRlbDtctList(String chnDtctId, String yyyymmdd) {
|
public ChngDetectMastDto.RlbDtctDto findRlbDtctList(String chnDtctId) {
|
||||||
|
|
||||||
String url =
|
String url =
|
||||||
gukyuinCdiUrl
|
gukyuinCdiUrl
|
||||||
@@ -537,9 +522,7 @@ public class GukYuinApiService {
|
|||||||
+ "?reqIp="
|
+ "?reqIp="
|
||||||
+ myip
|
+ myip
|
||||||
+ "&reqEpno="
|
+ "&reqEpno="
|
||||||
+ userUtil.getEmployeeNo()
|
+ userUtil.getEmployeeNo();
|
||||||
+ "&yyyymmdd="
|
|
||||||
+ yyyymmdd;
|
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectMastDto.RlbDtctDto> result =
|
ExternalCallResult<ChngDetectMastDto.RlbDtctDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
|
|||||||
@@ -64,17 +64,4 @@ public class GukYuinCoreService {
|
|||||||
public List<LabelSendDto> findLabelingCompleteSendList(LocalDate yesterday) {
|
public List<LabelSendDto> findLabelingCompleteSendList(LocalDate yesterday) {
|
||||||
return gukYuinRepository.findLabelingCompleteSendList(yesterday);
|
return gukYuinRepository.findLabelingCompleteSendList(yesterday);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long findMapSheetLearnInfoByYyyy(
|
|
||||||
Integer compareYyyy, Integer targetYyyy, Integer maxStage) {
|
|
||||||
return gukYuinRepository.findMapSheetLearnInfoByYyyy(compareYyyy, targetYyyy, maxStage);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateMapSheetLearnGukyuinEndStatus(Long learnId) {
|
|
||||||
gukYuinRepository.updateMapSheetLearnGukyuinEndStatus(learnId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateMapSheetInferenceLabelEndStatus(Long learnId) {
|
|
||||||
gukYuinRepository.updateMapSheetInferenceLabelEndStatus(learnId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
|||||||
import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinRepository;
|
import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinRepository;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class GukYuinJobCoreService {
|
public class GukYuinJobCoreService {
|
||||||
@@ -16,7 +15,6 @@ public class GukYuinJobCoreService {
|
|||||||
this.gukYuinRepository = gukYuinRepository;
|
this.gukYuinRepository = gukYuinRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
|
||||||
public void updateGukYuinApplyStateComplete(Long id, GukYuinStatus status) {
|
public void updateGukYuinApplyStateComplete(Long id, GukYuinStatus status) {
|
||||||
gukYuinRepository.updateGukYuinApplyStateComplete(id, status);
|
gukYuinRepository.updateGukYuinApplyStateComplete(id, status);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GeomUidDto;
|
|||||||
import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinLabelJobRepository;
|
import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinLabelJobRepository;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class GukYuinLabelJobCoreService {
|
public class GukYuinLabelJobCoreService {
|
||||||
@@ -19,7 +18,6 @@ public class GukYuinLabelJobCoreService {
|
|||||||
return gukYuinLabelRepository.findYesterdayLabelingCompleteList();
|
return gukYuinLabelRepository.findYesterdayLabelingCompleteList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
|
||||||
public void updateAnalDataInferenceGeomSendDttm(Long geoUid) {
|
public void updateAnalDataInferenceGeomSendDttm(Long geoUid) {
|
||||||
gukYuinLabelRepository.updateAnalDataInferenceGeomSendDttm(geoUid);
|
gukYuinLabelRepository.updateAnalDataInferenceGeomSendDttm(geoUid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
|||||||
import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinPnuJobRepository;
|
import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinPnuJobRepository;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class GukYuinPnuJobCoreService {
|
public class GukYuinPnuJobCoreService {
|
||||||
@@ -28,7 +27,6 @@ public class GukYuinPnuJobCoreService {
|
|||||||
return gukYuinPnuRepository.upsertMapSheetDataAnalGeomPnu(chnDtctObjtId, pnuList);
|
return gukYuinPnuRepository.upsertMapSheetDataAnalGeomPnu(chnDtctObjtId, pnuList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
|
||||||
public void updateInferenceGeomDataPnuCnt(String chnDtctObjtId, long pnuCnt) {
|
public void updateInferenceGeomDataPnuCnt(String chnDtctObjtId, long pnuCnt) {
|
||||||
gukYuinPnuRepository.updateInferenceGeomDataPnuCnt(chnDtctObjtId, pnuCnt);
|
gukYuinPnuRepository.updateInferenceGeomDataPnuCnt(chnDtctObjtId, pnuCnt);
|
||||||
}
|
}
|
||||||
@@ -37,7 +35,6 @@ public class GukYuinPnuJobCoreService {
|
|||||||
return gukYuinPnuRepository.findMapSheetAnalDataInferenceGeomUid(chnDtctObjtId);
|
return gukYuinPnuRepository.findMapSheetAnalDataInferenceGeomUid(chnDtctObjtId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
|
||||||
public void insertGeoUidPnuData(Long geoUid, String[] pnuList, String chnDtctObjtId) {
|
public void insertGeoUidPnuData(Long geoUid, String[] pnuList, String chnDtctObjtId) {
|
||||||
gukYuinPnuRepository.insertGeoUidPnuData(geoUid, pnuList, chnDtctObjtId);
|
gukYuinPnuRepository.insertGeoUidPnuData(geoUid, pnuList, chnDtctObjtId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinStbltJobReposit
|
|||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class GukYuinStbltJobCoreService {
|
public class GukYuinStbltJobCoreService {
|
||||||
@@ -22,15 +21,10 @@ public class GukYuinStbltJobCoreService {
|
|||||||
return gukYuinStbltRepository.findGukYuinEligibleForSurveyList(status);
|
return gukYuinStbltRepository.findGukYuinEligibleForSurveyList(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
|
||||||
public void updateGukYuinEligibleForSurvey(String resultUid, RlbDtctMastDto stbltDto) {
|
public void updateGukYuinEligibleForSurvey(String resultUid, RlbDtctMastDto stbltDto) {
|
||||||
String chnDtctObjtId = "";
|
|
||||||
PnuEntity entity =
|
PnuEntity entity =
|
||||||
gukYuinStbltRepository.findPnuEntityByResultUid(resultUid, stbltDto.getPnu());
|
gukYuinStbltRepository.findPnuEntityByResultUid(resultUid, stbltDto.getPnu());
|
||||||
|
|
||||||
if (entity != null) {
|
|
||||||
chnDtctObjtId = resultUid;
|
|
||||||
|
|
||||||
entity.setPnuDtctId(stbltDto.getPnuDtctId());
|
entity.setPnuDtctId(stbltDto.getPnuDtctId());
|
||||||
entity.setPnu(stbltDto.getPnu());
|
entity.setPnu(stbltDto.getPnu());
|
||||||
entity.setLrmSyncYmd(stbltDto.getLrmSyncYmd());
|
entity.setLrmSyncYmd(stbltDto.getLrmSyncYmd());
|
||||||
@@ -63,13 +57,11 @@ public class GukYuinStbltJobCoreService {
|
|||||||
entity.setCrtEpno(stbltDto.getCrtEpno());
|
entity.setCrtEpno(stbltDto.getCrtEpno());
|
||||||
entity.setCrtIp(stbltDto.getCrtIp());
|
entity.setCrtIp(stbltDto.getCrtIp());
|
||||||
entity.setChgDt(stbltDto.getChgDt());
|
entity.setChgDt(stbltDto.getChgDt());
|
||||||
|
entity.setChgEpno(stbltDto.getChgEpno());
|
||||||
entity.setChgIp(stbltDto.getChgIp());
|
entity.setChgIp(stbltDto.getChgIp());
|
||||||
entity.setDelYn(stbltDto.getDelYn().equals("Y"));
|
entity.setDelYn(stbltDto.getDelYn().equals("Y"));
|
||||||
|
|
||||||
entity.setCreatedDttm(ZonedDateTime.now());
|
entity.setCreatedDttm(ZonedDateTime.now());
|
||||||
gukYuinStbltRepository.save(entity);
|
gukYuinStbltRepository.save(entity);
|
||||||
|
|
||||||
//
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,19 +30,13 @@ public class GukYuinLabelJobRepositoryImpl implements GukYuinLabelJobRepositoryC
|
|||||||
public List<GeomUidDto> findYesterdayLabelingCompleteList() {
|
public List<GeomUidDto> findYesterdayLabelingCompleteList() {
|
||||||
ZoneId zone = ZoneId.of("Asia/Seoul");
|
ZoneId zone = ZoneId.of("Asia/Seoul");
|
||||||
ZonedDateTime todayStart = ZonedDateTime.now(zone).toLocalDate().atStartOfDay(zone);
|
ZonedDateTime todayStart = ZonedDateTime.now(zone).toLocalDate().atStartOfDay(zone);
|
||||||
ZonedDateTime tomorrowStart = todayStart.plusDays(1);
|
|
||||||
ZonedDateTime yesterdayStart = todayStart.minusDays(1);
|
ZonedDateTime yesterdayStart = todayStart.minusDays(1);
|
||||||
|
|
||||||
// BooleanExpression isYesterday =
|
|
||||||
// labelingAssignmentEntity
|
|
||||||
// .inspectStatDttm
|
|
||||||
// .goe(yesterdayStart)
|
|
||||||
// .and(labelingAssignmentEntity.inspectStatDttm.lt(todayStart));
|
|
||||||
BooleanExpression isYesterday =
|
BooleanExpression isYesterday =
|
||||||
labelingAssignmentEntity
|
labelingAssignmentEntity
|
||||||
.inspectStatDttm
|
.inspectStatDttm
|
||||||
.goe(todayStart)
|
.goe(yesterdayStart)
|
||||||
.and(labelingAssignmentEntity.inspectStatDttm.lt(tomorrowStart));
|
.and(labelingAssignmentEntity.inspectStatDttm.lt(todayStart));
|
||||||
|
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(
|
.select(
|
||||||
|
|||||||
@@ -53,9 +53,8 @@ public class GukYuinPnuJobRepositoryImpl implements GukYuinPnuJobRepositoryCusto
|
|||||||
if (entity == null) {
|
if (entity == null) {
|
||||||
queryFactory
|
queryFactory
|
||||||
.insert(pnuEntity)
|
.insert(pnuEntity)
|
||||||
.columns(
|
.columns(pnuEntity.geo.geoUid, pnuEntity.pnu, pnuEntity.createdDttm)
|
||||||
pnuEntity.geo.geoUid, pnuEntity.pnu, pnuEntity.createdDttm, pnuEntity.chnDtctObjtId)
|
.values(geoUid, pnu, ZonedDateTime.now())
|
||||||
.values(geoUid, pnu, ZonedDateTime.now(), chnDtctObjtId)
|
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,10 +39,4 @@ public interface GukYuinRepositoryCustom {
|
|||||||
void updateAnalDataInferenceGeomSendDttm(Long geoUid);
|
void updateAnalDataInferenceGeomSendDttm(Long geoUid);
|
||||||
|
|
||||||
List<LabelSendDto> findLabelingCompleteSendList(LocalDate yesterday);
|
List<LabelSendDto> findLabelingCompleteSendList(LocalDate yesterday);
|
||||||
|
|
||||||
Long findMapSheetLearnInfoByYyyy(Integer compareYyyy, Integer targetYyyy, Integer maxStage);
|
|
||||||
|
|
||||||
void updateMapSheetLearnGukyuinEndStatus(Long learnId);
|
|
||||||
|
|
||||||
void updateMapSheetInferenceLabelEndStatus(Long learnId);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GeomUidDto;
|
|||||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.LearnInfo;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.LearnInfo;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InspectState;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InspectState;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelMngState;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.PnuEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.PnuEntity;
|
||||||
import com.querydsl.core.types.Projections;
|
import com.querydsl.core.types.Projections;
|
||||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||||
@@ -205,7 +204,6 @@ public class GukYuinRepositoryImpl implements GukYuinRepositoryCustom {
|
|||||||
.update(mapSheetAnalInferenceEntity)
|
.update(mapSheetAnalInferenceEntity)
|
||||||
.set(mapSheetAnalInferenceEntity.gukyuinUsed, "Y")
|
.set(mapSheetAnalInferenceEntity.gukyuinUsed, "Y")
|
||||||
.set(mapSheetAnalInferenceEntity.gukyuinApplyDttm, ZonedDateTime.now())
|
.set(mapSheetAnalInferenceEntity.gukyuinApplyDttm, ZonedDateTime.now())
|
||||||
.set(mapSheetAnalInferenceEntity.stage, Integer.parseInt(registRes.getChnDtctSno()))
|
|
||||||
.where(mapSheetAnalInferenceEntity.learnId.eq(learnId))
|
.where(mapSheetAnalInferenceEntity.learnId.eq(learnId))
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
@@ -285,39 +283,6 @@ public class GukYuinRepositoryImpl implements GukYuinRepositoryCustom {
|
|||||||
.fetch();
|
.fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Long findMapSheetLearnInfoByYyyy(
|
|
||||||
Integer compareYyyy, Integer targetYyyy, Integer maxStage) {
|
|
||||||
return queryFactory
|
|
||||||
.select(mapSheetLearnEntity.id)
|
|
||||||
.from(mapSheetLearnEntity)
|
|
||||||
.where(
|
|
||||||
mapSheetLearnEntity.compareYyyy.eq(compareYyyy),
|
|
||||||
mapSheetLearnEntity.targetYyyy.eq(targetYyyy),
|
|
||||||
mapSheetLearnEntity.stage.eq(maxStage))
|
|
||||||
.fetchOne();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateMapSheetLearnGukyuinEndStatus(Long learnId) {
|
|
||||||
queryFactory
|
|
||||||
.update(mapSheetLearnEntity)
|
|
||||||
.set(mapSheetLearnEntity.applyStatus, GukYuinStatus.END.getId())
|
|
||||||
.set(mapSheetLearnEntity.applyStatusDttm, ZonedDateTime.now())
|
|
||||||
.where(mapSheetLearnEntity.id.eq(learnId))
|
|
||||||
.execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateMapSheetInferenceLabelEndStatus(Long learnId) {
|
|
||||||
queryFactory
|
|
||||||
.update(mapSheetAnalInferenceEntity)
|
|
||||||
.set(mapSheetAnalInferenceEntity.analState, LabelMngState.FINISH.getId())
|
|
||||||
.set(mapSheetAnalInferenceEntity.updatedDttm, ZonedDateTime.now())
|
|
||||||
.where(mapSheetAnalInferenceEntity.learnId.eq(learnId))
|
|
||||||
.execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void updateGukYuinApplyStateComplete(Long id, GukYuinStatus status) {
|
public void updateGukYuinApplyStateComplete(Long id, GukYuinStatus status) {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalInferenceEntit
|
|||||||
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.QPnuEntity.pnuEntity;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.common.enums.ImageryFitStatus;
|
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LearnKeyDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LearnKeyDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.RlbDtctMastDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.RlbDtctMastDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
||||||
@@ -16,7 +15,6 @@ import com.querydsl.core.types.Projections;
|
|||||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||||
import jakarta.persistence.EntityManager;
|
import jakarta.persistence.EntityManager;
|
||||||
import jakarta.persistence.PersistenceContext;
|
import jakarta.persistence.PersistenceContext;
|
||||||
import java.time.ZonedDateTime;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
@@ -46,7 +44,7 @@ public class GukYuinStbltJobRepositoryImpl implements GukYuinStbltJobRepositoryC
|
|||||||
.on(mapSheetAnalDataInferenceEntity.id.eq(mapSheetAnalDataInferenceGeomEntity.dataUid))
|
.on(mapSheetAnalDataInferenceEntity.id.eq(mapSheetAnalDataInferenceGeomEntity.dataUid))
|
||||||
.where(
|
.where(
|
||||||
mapSheetLearnEntity.applyStatus.eq(GukYuinStatus.PNU_COMPLETED.getId()),
|
mapSheetLearnEntity.applyStatus.eq(GukYuinStatus.PNU_COMPLETED.getId()),
|
||||||
mapSheetAnalDataInferenceGeomEntity.pnu.gt(0),
|
mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull(),
|
||||||
mapSheetAnalDataInferenceGeomEntity.fitState.isNull())
|
mapSheetAnalDataInferenceGeomEntity.fitState.isNull())
|
||||||
.groupBy(mapSheetLearnEntity.id, mapSheetLearnEntity.uid, mapSheetLearnEntity.chnDtctMstId)
|
.groupBy(mapSheetLearnEntity.id, mapSheetLearnEntity.uid, mapSheetLearnEntity.chnDtctMstId)
|
||||||
.having(mapSheetAnalDataInferenceGeomEntity.geoUid.count().gt(1L))
|
.having(mapSheetAnalDataInferenceGeomEntity.geoUid.count().gt(1L))
|
||||||
@@ -66,22 +64,55 @@ public class GukYuinStbltJobRepositoryImpl implements GukYuinStbltJobRepositoryC
|
|||||||
PnuEntity pnuEt =
|
PnuEntity pnuEt =
|
||||||
queryFactory
|
queryFactory
|
||||||
.selectFrom(pnuEntity)
|
.selectFrom(pnuEntity)
|
||||||
.where(pnuEntity.chnDtctObjtId.eq(resultUid))
|
.where(pnuEntity.pnu.eq(stbltDto.getPnu()), pnuEntity.chnDtctObjtId.eq(resultUid))
|
||||||
.fetchFirst();
|
.fetchOne();
|
||||||
|
if (pnuEt != null) {
|
||||||
|
// update
|
||||||
queryFactory
|
queryFactory
|
||||||
.update(mapSheetAnalDataInferenceGeomEntity)
|
.update(pnuEntity)
|
||||||
.set(
|
.set(pnuEntity.pnuDtctId, stbltDto.getPnuDtctId())
|
||||||
mapSheetAnalDataInferenceGeomEntity.fitState,
|
.set(pnuEntity.lrmSyncYmd, stbltDto.getLrmSyncYmd())
|
||||||
pnuEt.getStbltYn().equals("Y")
|
.set(pnuEntity.pnuSyncYmd, stbltDto.getPnuSyncYmd())
|
||||||
? ImageryFitStatus.UNFIT.getId()
|
.set(pnuEntity.mpqdNo, stbltDto.getMpqdNo())
|
||||||
: ImageryFitStatus.FIT.getId()) // 적합여부가 Y 이면 부적합인 것, N 이면 적합한 것이라고 함
|
.set(pnuEntity.cprsYr, stbltDto.getCprsYr())
|
||||||
.set(mapSheetAnalDataInferenceGeomEntity.fitStateDttm, ZonedDateTime.now())
|
.set(pnuEntity.crtrYr, stbltDto.getCrtrYr())
|
||||||
.set(mapSheetAnalDataInferenceGeomEntity.lockYn, stbltDto.getLockYn())
|
.set(pnuEntity.chnDtctId, stbltDto.getChnDtctId())
|
||||||
.where(mapSheetAnalDataInferenceGeomEntity.resultUid.eq(resultUid))
|
.set(pnuEntity.chnDtctMstId, stbltDto.getChnDtctMstId())
|
||||||
|
.set(pnuEntity.chnDtctObjtId, stbltDto.getChnDtctObjtId())
|
||||||
|
.set(pnuEntity.chnDtctContId, stbltDto.getChnDtctContId())
|
||||||
|
.set(pnuEntity.chnCd, stbltDto.getChnCd())
|
||||||
|
.set(pnuEntity.chnDtctProb, stbltDto.getChnDtctProb())
|
||||||
|
.set(pnuEntity.bfClsCd, stbltDto.getBfClsCd())
|
||||||
|
.set(pnuEntity.bfClsProb, stbltDto.getBfClsProb())
|
||||||
|
.set(pnuEntity.afClsCd, stbltDto.getAfClsCd())
|
||||||
|
.set(pnuEntity.afClsProb, stbltDto.getAfClsProb())
|
||||||
|
.set(pnuEntity.pnuSqms, stbltDto.getPnuSqms())
|
||||||
|
.set(pnuEntity.pnuDtctSqms, stbltDto.getPnuDtctSqms())
|
||||||
|
.set(pnuEntity.chnDtctSqms, stbltDto.getChnDtctSqms())
|
||||||
|
.set(pnuEntity.stbltYn, stbltDto.getStbltYn())
|
||||||
|
.set(pnuEntity.incyCd, stbltDto.getIncyCd())
|
||||||
|
.set(pnuEntity.incyRsnCont, stbltDto.getIncyRsnCont())
|
||||||
|
.where(
|
||||||
|
pnuEntity.geo.geoUid.eq(geomEntity.getGeoUid()),
|
||||||
|
pnuEntity.chnDtctObjtId.eq(resultUid))
|
||||||
.execute();
|
.execute();
|
||||||
|
} else {
|
||||||
|
// insert
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// queryFactory
|
||||||
|
// .update(mapSheetAnalDataInferenceGeomEntity)
|
||||||
|
// .set(
|
||||||
|
// mapSheetAnalDataInferenceGeomEntity.fitState,
|
||||||
|
// stbltDto.getStbltYn().equals("Y") ? ImageryFitStatus.FIT.getId() :
|
||||||
|
// ImageryFitStatus.UNFIT.getId())
|
||||||
|
// .set(mapSheetAnalDataInferenceGeomEntity.fitStateDttm, ZonedDateTime.now())
|
||||||
|
// .set(mapSheetAnalDataInferenceGeomEntity.lockYn, stbltDto.getLockYn())
|
||||||
|
// .where(mapSheetAnalDataInferenceGeomEntity.resultUid.eq(resultUid))
|
||||||
|
// .execute();
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PnuEntity findPnuEntityByResultUid(String resultUid, String pnu) {
|
public PnuEntity findPnuEntityByResultUid(String resultUid, String pnu) {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ 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.QMemberEntity.memberEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMemberEntity.memberEntity;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.common.enums.ImageryFitStatus;
|
|
||||||
import com.kamco.cd.kamcoback.common.enums.StatusType;
|
import com.kamco.cd.kamcoback.common.enums.StatusType;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.AllocateInfoDto;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.AllocateInfoDto;
|
||||||
@@ -83,9 +82,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
.innerJoin(mapSheetAnalDataInferenceGeomEntity)
|
.innerJoin(mapSheetAnalDataInferenceGeomEntity)
|
||||||
.on(
|
.on(
|
||||||
mapSheetAnalDataInferenceEntity.id.eq(mapSheetAnalDataInferenceGeomEntity.dataUid),
|
mapSheetAnalDataInferenceEntity.id.eq(mapSheetAnalDataInferenceGeomEntity.dataUid),
|
||||||
// mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull(),
|
mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull(),
|
||||||
mapSheetAnalDataInferenceGeomEntity.pnu.gt(0),
|
|
||||||
mapSheetAnalDataInferenceGeomEntity.fitState.eq(ImageryFitStatus.UNFIT.getId()),
|
|
||||||
mapSheetAnalDataInferenceGeomEntity.labelState.isNull())
|
mapSheetAnalDataInferenceGeomEntity.labelState.isNull())
|
||||||
.where(
|
.where(
|
||||||
mapSheetAnalInferenceEntity.uuid.eq(uuid),
|
mapSheetAnalInferenceEntity.uuid.eq(uuid),
|
||||||
@@ -129,8 +126,8 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
"""
|
"""
|
||||||
insert into tb_labeling_assignment
|
insert into tb_labeling_assignment
|
||||||
(assignment_uid, inference_geom_uid, worker_uid,
|
(assignment_uid, inference_geom_uid, worker_uid,
|
||||||
work_state, assign_group_id, anal_uid)
|
work_state, assign_group_id, anal_uid, pnu)
|
||||||
values (?, ?, ?, ?, ?, ?)
|
values (?, ?, ?, ?, ?, ?, ?)
|
||||||
""";
|
""";
|
||||||
|
|
||||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||||
@@ -143,6 +140,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
ps.setString(4, LabelState.ASSIGNED.getId());
|
ps.setString(4, LabelState.ASSIGNED.getId());
|
||||||
ps.setString(5, String.valueOf(info.getMapSheetNum()));
|
ps.setString(5, String.valueOf(info.getMapSheetNum()));
|
||||||
ps.setLong(6, analEntity.getId());
|
ps.setLong(6, analEntity.getId());
|
||||||
|
ps.setLong(7, info.getPnu());
|
||||||
|
|
||||||
ps.addBatch();
|
ps.addBatch();
|
||||||
batchSize++;
|
batchSize++;
|
||||||
@@ -192,9 +190,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
.innerJoin(mapSheetAnalDataInferenceGeomEntity)
|
.innerJoin(mapSheetAnalDataInferenceGeomEntity)
|
||||||
.on(
|
.on(
|
||||||
mapSheetAnalDataInferenceEntity.id.eq(mapSheetAnalDataInferenceGeomEntity.dataUid),
|
mapSheetAnalDataInferenceEntity.id.eq(mapSheetAnalDataInferenceGeomEntity.dataUid),
|
||||||
// mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull(),
|
mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull(),
|
||||||
mapSheetAnalDataInferenceGeomEntity.pnu.gt(0),
|
|
||||||
mapSheetAnalDataInferenceGeomEntity.fitState.eq(ImageryFitStatus.UNFIT.getId()),
|
|
||||||
mapSheetAnalDataInferenceGeomEntity.labelState.isNull())
|
mapSheetAnalDataInferenceGeomEntity.labelState.isNull())
|
||||||
.where(mapSheetAnalInferenceEntity.uuid.eq(uuid))
|
.where(mapSheetAnalInferenceEntity.uuid.eq(uuid))
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
@@ -385,10 +381,9 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(analEntity.getCompareYyyy()),
|
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(analEntity.getCompareYyyy()),
|
||||||
mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(analEntity.getTargetYyyy()),
|
mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(analEntity.getTargetYyyy()),
|
||||||
mapSheetAnalDataInferenceGeomEntity.stage.eq(analEntity.getStage()),
|
mapSheetAnalDataInferenceGeomEntity.stage.eq(analEntity.getStage()),
|
||||||
// mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull()
|
mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull()
|
||||||
mapSheetAnalDataInferenceGeomEntity.pnu.gt(0L),
|
// mapSheetAnalDataInferenceGeomEntity.pnu.gt(0L)
|
||||||
mapSheetAnalDataInferenceGeomEntity.fitState.eq(
|
// mapSheetAnalDataInferenceGeomEntity.passYn.isFalse() //TODO:
|
||||||
ImageryFitStatus.UNFIT.getId()) // TODO:
|
|
||||||
// 추후 라벨링 대상 조건 수정하기
|
// 추후 라벨링 대상 조건 수정하기
|
||||||
)
|
)
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
@@ -560,9 +555,11 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
mapSheetAnalDataInferenceGeomEntity.dataUid))
|
mapSheetAnalDataInferenceGeomEntity.dataUid))
|
||||||
.where(
|
.where(
|
||||||
mapSheetAnalInferenceEntity.uuid.eq(targetUuid),
|
mapSheetAnalInferenceEntity.uuid.eq(targetUuid),
|
||||||
// mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull()
|
mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull()
|
||||||
mapSheetAnalDataInferenceGeomEntity.pnu.gt(0L),
|
// mapSheetAnalDataInferenceGeomEntity.pnu.gt(0L),
|
||||||
mapSheetAnalDataInferenceGeomEntity.fitState.eq(ImageryFitStatus.UNFIT.getId()))
|
// mapSheetAnalDataInferenceGeomEntity.passYn.isFalse() //TODO: 추후 라벨링
|
||||||
|
// 대상 조건 수정하기
|
||||||
|
)
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -579,7 +576,8 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
queryFactory
|
queryFactory
|
||||||
.select(labelingAssignmentEntity.count())
|
.select(labelingAssignmentEntity.count())
|
||||||
.from(labelingAssignmentEntity)
|
.from(labelingAssignmentEntity)
|
||||||
.where(analUidCondition, labelingAssignmentEntity.workState.in("SKIP", "DONE"))
|
.where(
|
||||||
|
analUidCondition, labelingAssignmentEntity.workState.in("ASSIGNED", "SKIP", "DONE"))
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
Long skipCount =
|
Long skipCount =
|
||||||
@@ -604,13 +602,6 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
.where(analUidCondition, labelingAssignmentEntity.inspectState.eq("COMPLETE"))
|
.where(analUidCondition, labelingAssignmentEntity.inspectState.eq("COMPLETE"))
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
Long inspectionExcept =
|
|
||||||
queryFactory
|
|
||||||
.select(labelingAssignmentEntity.count())
|
|
||||||
.from(labelingAssignmentEntity)
|
|
||||||
.where(analUidCondition, labelingAssignmentEntity.inspectState.eq("EXCEPT"))
|
|
||||||
.fetchOne();
|
|
||||||
|
|
||||||
Long inspectorCount =
|
Long inspectorCount =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(labelingAssignmentEntity.inspectorUid.countDistinct())
|
.select(labelingAssignmentEntity.inspectorUid.countDistinct())
|
||||||
@@ -623,7 +614,6 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
long labelCompleted = labelingCompleted != null ? labelingCompleted : 0L;
|
long labelCompleted = labelingCompleted != null ? labelingCompleted : 0L;
|
||||||
long inspectCompleted = inspectionCompleted != null ? inspectionCompleted : 0L;
|
long inspectCompleted = inspectionCompleted != null ? inspectionCompleted : 0L;
|
||||||
long skipped = skipCount != null ? skipCount : 0L;
|
long skipped = skipCount != null ? skipCount : 0L;
|
||||||
long inspectExcepted = inspectionExcept != null ? inspectionExcept : 0L;
|
|
||||||
|
|
||||||
long labelingRemaining = labelingTotal - labelCompleted - skipped;
|
long labelingRemaining = labelingTotal - labelCompleted - skipped;
|
||||||
if (labelingRemaining < 0) {
|
if (labelingRemaining < 0) {
|
||||||
@@ -631,7 +621,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
}
|
}
|
||||||
|
|
||||||
long inspectionTotal = labelingTotal;
|
long inspectionTotal = labelingTotal;
|
||||||
long inspectionRemaining = inspectionTotal - inspectCompleted - inspectExcepted;
|
long inspectionRemaining = inspectionTotal - inspectCompleted - skipped;
|
||||||
if (inspectionRemaining < 0) {
|
if (inspectionRemaining < 0) {
|
||||||
inspectionRemaining = 0;
|
inspectionRemaining = 0;
|
||||||
}
|
}
|
||||||
@@ -668,7 +658,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
.inspectionStatus(inspectionStatus)
|
.inspectionStatus(inspectionStatus)
|
||||||
.inspectionTotalCount(inspectionTotal)
|
.inspectionTotalCount(inspectionTotal)
|
||||||
.inspectionCompletedCount(inspectCompleted)
|
.inspectionCompletedCount(inspectCompleted)
|
||||||
.inspectionSkipCount(inspectExcepted)
|
.inspectionSkipCount(skipped) // TODO
|
||||||
.inspectionRemainingCount(inspectionRemaining)
|
.inspectionRemainingCount(inspectionRemaining)
|
||||||
.inspectorCount(inspectorCount != null ? inspectorCount : 0L)
|
.inspectorCount(inspectorCount != null ? inspectorCount : 0L)
|
||||||
.progressRate(labelingRate)
|
.progressRate(labelingRate)
|
||||||
@@ -750,9 +740,11 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
mapSheetAnalInferenceEntity.targetYyyy.eq(
|
mapSheetAnalInferenceEntity.targetYyyy.eq(
|
||||||
mapSheetAnalDataInferenceGeomEntity.targetYyyy),
|
mapSheetAnalDataInferenceGeomEntity.targetYyyy),
|
||||||
mapSheetAnalInferenceEntity.stage.eq(mapSheetAnalDataInferenceGeomEntity.stage),
|
mapSheetAnalInferenceEntity.stage.eq(mapSheetAnalDataInferenceGeomEntity.stage),
|
||||||
// mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull()
|
mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull()
|
||||||
mapSheetAnalDataInferenceGeomEntity.pnu.gt(0),
|
// mapSheetAnalDataInferenceGeomEntity.pnu.gt(0),
|
||||||
mapSheetAnalDataInferenceGeomEntity.fitState.eq(ImageryFitStatus.UNFIT.getId()))
|
// mapSheetAnalDataInferenceGeomEntity.passYn.isFalse() //TODO: 추후 라벨링 대상 조건
|
||||||
|
// 수정하기
|
||||||
|
)
|
||||||
.where(mapSheetAnalInferenceEntity.id.eq(analEntity.getId()))
|
.where(mapSheetAnalInferenceEntity.id.eq(analEntity.getId()))
|
||||||
.groupBy(
|
.groupBy(
|
||||||
mapSheetAnalInferenceEntity.analTitle,
|
mapSheetAnalInferenceEntity.analTitle,
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package com.kamco.cd.kamcoback.postgres.repository.label;
|
|||||||
|
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.common.enums.ImageryFitStatus;
|
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InspectState;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InspectState;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelState;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelState;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelWorkDto;
|
import com.kamco.cd.kamcoback.label.dto.LabelWorkDto;
|
||||||
@@ -295,14 +294,14 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
|||||||
|
|
||||||
if (searchReq.getSearchVal() != null && !searchReq.getSearchVal().isEmpty()) {
|
if (searchReq.getSearchVal() != null && !searchReq.getSearchVal().isEmpty()) {
|
||||||
whereSubBuilder.and(
|
whereSubBuilder.and(
|
||||||
Expressions.stringTemplate("{0}", memberEntity.employeeNo)
|
Expressions.stringTemplate("{0}", memberEntity.userId)
|
||||||
.likeIgnoreCase("%" + searchReq.getSearchVal() + "%")
|
.likeIgnoreCase("%" + searchReq.getSearchVal() + "%")
|
||||||
.or(
|
.or(
|
||||||
Expressions.stringTemplate("{0}", memberEntity.name)
|
Expressions.stringTemplate("{0}", memberEntity.name)
|
||||||
.likeIgnoreCase("%" + searchReq.getSearchVal() + "%")));
|
.likeIgnoreCase("%" + searchReq.getSearchVal() + "%")));
|
||||||
}
|
}
|
||||||
|
|
||||||
whereSubBuilder.and(labelingAssignmentEntity.workerUid.eq(memberEntity.employeeNo));
|
whereSubBuilder.and(labelingAssignmentEntity.workerUid.eq(memberEntity.userId));
|
||||||
|
|
||||||
// 공통 조건 추출
|
// 공통 조건 추출
|
||||||
BooleanExpression doneStateCondition =
|
BooleanExpression doneStateCondition =
|
||||||
@@ -345,7 +344,7 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
|||||||
WorkerState.class,
|
WorkerState.class,
|
||||||
memberEntity.userRole,
|
memberEntity.userRole,
|
||||||
memberEntity.name,
|
memberEntity.name,
|
||||||
memberEntity.employeeNo,
|
memberEntity.userId,
|
||||||
assignedCnt.as("assignedCnt"),
|
assignedCnt.as("assignedCnt"),
|
||||||
doneCnt.as("doneCnt"),
|
doneCnt.as("doneCnt"),
|
||||||
skipCnt.as("skipCnt"),
|
skipCnt.as("skipCnt"),
|
||||||
@@ -364,10 +363,7 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
|||||||
.on(whereSubBuilder)
|
.on(whereSubBuilder)
|
||||||
.where(whereBuilder)
|
.where(whereBuilder)
|
||||||
.groupBy(
|
.groupBy(
|
||||||
memberEntity.userRole,
|
memberEntity.userRole, memberEntity.name, memberEntity.userId, memberEntity.status)
|
||||||
memberEntity.name,
|
|
||||||
memberEntity.employeeNo,
|
|
||||||
memberEntity.status)
|
|
||||||
.orderBy(orderSpecifiers.toArray(new OrderSpecifier[0]))
|
.orderBy(orderSpecifiers.toArray(new OrderSpecifier[0]))
|
||||||
.offset(pageable.getOffset())
|
.offset(pageable.getOffset())
|
||||||
.limit(pageable.getPageSize())
|
.limit(pageable.getPageSize())
|
||||||
@@ -445,14 +441,14 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
|||||||
|
|
||||||
if (searchReq.getSearchVal() != null && !searchReq.getSearchVal().isEmpty()) {
|
if (searchReq.getSearchVal() != null && !searchReq.getSearchVal().isEmpty()) {
|
||||||
whereSubBuilder.and(
|
whereSubBuilder.and(
|
||||||
Expressions.stringTemplate("{0}", memberEntity.employeeNo)
|
Expressions.stringTemplate("{0}", memberEntity.userId)
|
||||||
.likeIgnoreCase("%" + searchReq.getSearchVal() + "%")
|
.likeIgnoreCase("%" + searchReq.getSearchVal() + "%")
|
||||||
.or(
|
.or(
|
||||||
Expressions.stringTemplate("{0}", memberEntity.name)
|
Expressions.stringTemplate("{0}", memberEntity.name)
|
||||||
.likeIgnoreCase("%" + searchReq.getSearchVal() + "%")));
|
.likeIgnoreCase("%" + searchReq.getSearchVal() + "%")));
|
||||||
}
|
}
|
||||||
|
|
||||||
whereSubBuilder.and(labelingAssignmentEntity.inspectorUid.eq(memberEntity.employeeNo));
|
whereSubBuilder.and(labelingAssignmentEntity.inspectorUid.eq(memberEntity.userId));
|
||||||
|
|
||||||
// 공통 조건 추출
|
// 공통 조건 추출
|
||||||
BooleanExpression doneStateCondition =
|
BooleanExpression doneStateCondition =
|
||||||
@@ -496,7 +492,7 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
|||||||
WorkerState.class,
|
WorkerState.class,
|
||||||
memberEntity.userRole,
|
memberEntity.userRole,
|
||||||
memberEntity.name,
|
memberEntity.name,
|
||||||
memberEntity.employeeNo,
|
memberEntity.userId,
|
||||||
assignedCnt.as("assignedCnt"),
|
assignedCnt.as("assignedCnt"),
|
||||||
doneCnt.as("doneCnt"),
|
doneCnt.as("doneCnt"),
|
||||||
skipCnt.as("skipCnt"),
|
skipCnt.as("skipCnt"),
|
||||||
@@ -515,10 +511,7 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
|||||||
.on(whereSubBuilder)
|
.on(whereSubBuilder)
|
||||||
.where(whereBuilder)
|
.where(whereBuilder)
|
||||||
.groupBy(
|
.groupBy(
|
||||||
memberEntity.userRole,
|
memberEntity.userRole, memberEntity.name, memberEntity.userId, memberEntity.status)
|
||||||
memberEntity.name,
|
|
||||||
memberEntity.employeeNo,
|
|
||||||
memberEntity.status)
|
|
||||||
.orderBy(orderSpecifiers.toArray(new OrderSpecifier[0]))
|
.orderBy(orderSpecifiers.toArray(new OrderSpecifier[0]))
|
||||||
.offset(pageable.getOffset())
|
.offset(pageable.getOffset())
|
||||||
.limit(pageable.getPageSize())
|
.limit(pageable.getPageSize())
|
||||||
@@ -556,19 +549,7 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
|||||||
@Override
|
@Override
|
||||||
public LabelWorkMngDetail findLabelWorkMngDetail(UUID uuid) {
|
public LabelWorkMngDetail findLabelWorkMngDetail(UUID uuid) {
|
||||||
|
|
||||||
NumberExpression<Long> labelTotCnt =
|
NumberExpression<Long> labelTotCnt = mapSheetAnalDataInferenceGeomEntity.geoUid.count();
|
||||||
new CaseBuilder()
|
|
||||||
// .when(mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull())
|
|
||||||
.when(
|
|
||||||
mapSheetAnalDataInferenceGeomEntity
|
|
||||||
.pnu
|
|
||||||
.gt(0)
|
|
||||||
.and(
|
|
||||||
mapSheetAnalDataInferenceGeomEntity.fitState.eq(
|
|
||||||
ImageryFitStatus.UNFIT.getId())))
|
|
||||||
.then(1L)
|
|
||||||
.otherwise(0L)
|
|
||||||
.sum();
|
|
||||||
NumberExpression<Long> labelerCnt = labelingAssignmentEntity.workerUid.count();
|
NumberExpression<Long> labelerCnt = labelingAssignmentEntity.workerUid.count();
|
||||||
NumberExpression<Long> reviewerCnt = labelingAssignmentEntity.inspectorUid.count();
|
NumberExpression<Long> reviewerCnt = labelingAssignmentEntity.inspectorUid.count();
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class GukYuinApiLabelJobService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (GeomUidDto gto : list) {
|
for (GeomUidDto gto : list) {
|
||||||
ChngDetectContDto.ResultLabelDto dto =
|
ChngDetectContDto.ResultPnuDto dto =
|
||||||
gukYuinApiService.updateChnDtctObjtLabelingYn(gto.getResultUid(), "Y");
|
gukYuinApiService.updateChnDtctObjtLabelingYn(gto.getResultUid(), "Y");
|
||||||
if (dto.getSuccess()) {
|
if (dto.getSuccess()) {
|
||||||
// inference_geom 에 label_send_dttm 업데이트 하기
|
// inference_geom 에 label_send_dttm 업데이트 하기
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class GukYuinApiPnuJobService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 국유인 등록 완료 후, 탐지객체 조회해서 PNU 업데이트 하는 스케줄링 하루 1번 새벽 1시에 실행 */
|
/** 국유인 등록 완료 후, 탐지객체 조회해서 PNU 업데이트 하는 스케줄링 하루 1번 새벽 1시에 실행 */
|
||||||
@Scheduled(cron = "0 0 1 * * *")
|
@Scheduled(cron = "0 * * * * *") // 0 0 1 * * *
|
||||||
public void findGukYuinContListPnuUpdate() {
|
public void findGukYuinContListPnuUpdate() {
|
||||||
if (isLocalProfile()) {
|
if (isLocalProfile()) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class GukYuinApiStatusJobService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 국유인 연동 후, 100% 되었는지 확인하는 스케줄링 매 10분마다 호출 */
|
/** 국유인 연동 후, 100% 되었는지 확인하는 스케줄링 매 10분마다 호출 */
|
||||||
@Scheduled(cron = "0 0/10 * * * *")
|
@Scheduled(cron = "0 0/10 * * * *") // 0 0/10 * * * *
|
||||||
public void findGukYuinMastCompleteYn() {
|
public void findGukYuinMastCompleteYn() {
|
||||||
if (isLocalProfile()) {
|
if (isLocalProfile()) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.RlbDtctMastDto;
|
|||||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.service.GukYuinApiService;
|
import com.kamco.cd.kamcoback.gukyuin.service.GukYuinApiService;
|
||||||
import com.kamco.cd.kamcoback.postgres.core.GukYuinStbltJobCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.GukYuinStbltJobCoreService;
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.ZoneId;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
@@ -37,7 +34,7 @@ public class GukYuinApiStbltJobService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 국유인 연동 후, 실태조사 적합여부 확인하여 update */
|
/** 국유인 연동 후, 실태조사 적합여부 확인하여 update */
|
||||||
@Scheduled(cron = "0 0 3 * * *") // 0 0 3 * * *
|
@Scheduled(cron = "0 * * * * *") // 0 0 3 * * *
|
||||||
public void findGukYuinEligibleForSurvey() {
|
public void findGukYuinEligibleForSurvey() {
|
||||||
if (isLocalProfile()) {
|
if (isLocalProfile()) {
|
||||||
return;
|
return;
|
||||||
@@ -52,11 +49,7 @@ public class GukYuinApiStbltJobService {
|
|||||||
|
|
||||||
for (LearnKeyDto dto : list) {
|
for (LearnKeyDto dto : list) {
|
||||||
try {
|
try {
|
||||||
String yesterday =
|
RlbDtctDto result = gukYuinApiService.findRlbDtctList(dto.getUid());
|
||||||
LocalDate.now(ZoneId.of("Asia/Seoul"))
|
|
||||||
.minusDays(1)
|
|
||||||
.format(DateTimeFormatter.ofPattern("yyyyMMdd"));
|
|
||||||
RlbDtctDto result = gukYuinApiService.findRlbDtctList(dto.getUid(), yesterday);
|
|
||||||
|
|
||||||
if (result == null || result.getResult() == null || result.getResult().isEmpty()) {
|
if (result == null || result.getResult() == null || result.getResult().isEmpty()) {
|
||||||
log.warn("[GUKYUIN] empty result chnDtctMstId={}", dto.getChnDtctMstId());
|
log.warn("[GUKYUIN] empty result chnDtctMstId={}", dto.getChnDtctMstId());
|
||||||
@@ -67,7 +60,6 @@ public class GukYuinApiStbltJobService {
|
|||||||
String resultUid = stbltDto.getChnDtctObjtId();
|
String resultUid = stbltDto.getChnDtctObjtId();
|
||||||
gukYuinStbltJobCoreService.updateGukYuinEligibleForSurvey(resultUid, stbltDto);
|
gukYuinStbltJobCoreService.updateGukYuinEligibleForSurvey(resultUid, stbltDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("[GUKYUIN] failed uid={}", dto.getChnDtctMstId(), e);
|
log.error("[GUKYUIN] failed uid={}", dto.getChnDtctMstId(), e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user