feat/infer_dev_260107 #45
@@ -7,7 +7,6 @@ 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.ChnDetectMastReqDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ChngDetectMastSearchDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ChngDetectMastSearchDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LabelSendDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LabelSendDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ResReturn;
|
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.DetectMastDto.Basic;
|
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;
|
||||||
@@ -74,7 +73,7 @@ public class GukYuinApiController {
|
|||||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||||
})
|
})
|
||||||
@PostMapping("/chn/mast/remove")
|
@PostMapping("/chn/mast/remove")
|
||||||
public ApiResponseDto<ResReturn> remove(
|
public ApiResponseDto<ChngDetectMastDto.RemoveResDto> remove(
|
||||||
@RequestBody @Valid ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) {
|
@RequestBody @Valid ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) {
|
||||||
return ApiResponseDto.ok(gukYuinApiService.remove(chnDetectMastReq));
|
return ApiResponseDto.ok(gukYuinApiService.remove(chnDetectMastReq));
|
||||||
}
|
}
|
||||||
@@ -262,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<ResReturn> 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));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -288,4 +288,17 @@ public class ChngDetectMastDto {
|
|||||||
private String chgIp;
|
private String chgIp;
|
||||||
private String delYn; // 삭제여부
|
private String delYn; // 삭제여부
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Schema(name = "RemoveResDto", description = "remove 후 리턴 형태")
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class RemoveResDto {
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
private String message;
|
||||||
|
private Boolean result;
|
||||||
|
private Boolean success;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ 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.ChnDetectMastReqDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ErrorResDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ErrorResDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LabelSendDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LabelSendDto;
|
||||||
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.ChngDetectMastDto.ResultDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.RlbDtctDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.RlbDtctDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GukYuinLinkFacts;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GukYuinLinkFacts;
|
||||||
@@ -55,6 +54,7 @@ public class GukYuinApiService {
|
|||||||
private final UserUtil userUtil;
|
private final UserUtil userUtil;
|
||||||
private final AuditLogRepository auditLogRepository;
|
private final AuditLogRepository auditLogRepository;
|
||||||
private final ObjectMapper objectMapper;
|
private final ObjectMapper objectMapper;
|
||||||
|
private final String myip = netUtils.getLocalIP();
|
||||||
|
|
||||||
@Value("${spring.profiles.active:local}")
|
@Value("${spring.profiles.active:local}")
|
||||||
private String profile;
|
private String profile;
|
||||||
@@ -65,13 +65,15 @@ public class GukYuinApiService {
|
|||||||
@Value("${gukyuin.cdi}")
|
@Value("${gukyuin.cdi}")
|
||||||
private String gukyuinCdiUrl;
|
private String gukyuinCdiUrl;
|
||||||
|
|
||||||
|
@Value("${file.dataset-dir}")
|
||||||
|
private String datasetDir;
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public ChngDetectMastDto.RegistResDto regist(
|
public ChngDetectMastDto.RegistResDto regist(
|
||||||
ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) {
|
ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) {
|
||||||
|
|
||||||
String url = gukyuinCdiUrl + "/chn/mast/regist";
|
String url = gukyuinCdiUrl + "/chn/mast/regist";
|
||||||
|
|
||||||
String myip = netUtils.getLocalIP();
|
|
||||||
chnDetectMastReq.setReqIp(myip);
|
chnDetectMastReq.setReqIp(myip);
|
||||||
chnDetectMastReq.setReqEpno(userUtil.getEmployeeNo());
|
chnDetectMastReq.setReqEpno(userUtil.getEmployeeNo());
|
||||||
|
|
||||||
@@ -89,6 +91,12 @@ public class GukYuinApiService {
|
|||||||
ChngDetectMastDto.Basic registRes = resultBody.getResult();
|
ChngDetectMastDto.Basic registRes = resultBody.getResult();
|
||||||
|
|
||||||
success = resultBody.getSuccess();
|
success = resultBody.getSuccess();
|
||||||
|
|
||||||
|
// 이미 등록한 경우에는 result가 없음
|
||||||
|
if (resultBody.getResult() == null) {
|
||||||
|
return resultBody;
|
||||||
|
}
|
||||||
|
|
||||||
// 추론 회차에 applyStatus, applyStatusDttm 업데이트
|
// 추론 회차에 applyStatus, applyStatusDttm 업데이트
|
||||||
gukyuinCoreService.updateGukYuinMastRegResult(registRes);
|
gukyuinCoreService.updateGukYuinMastRegResult(registRes);
|
||||||
|
|
||||||
@@ -122,23 +130,30 @@ public class GukYuinApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public ResReturn remove(ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) {
|
public ChngDetectMastDto.RemoveResDto remove(
|
||||||
|
ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) {
|
||||||
String url = gukyuinCdiUrl + "/chn/mast/remove";
|
String url = gukyuinCdiUrl + "/chn/mast/remove";
|
||||||
|
|
||||||
String myip = netUtils.getLocalIP();
|
|
||||||
chnDetectMastReq.setReqIp(myip);
|
chnDetectMastReq.setReqIp(myip);
|
||||||
chnDetectMastReq.setReqEpno(userUtil.getEmployeeNo());
|
chnDetectMastReq.setReqEpno(userUtil.getEmployeeNo());
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectMastDto.Basic> result =
|
boolean success = false;
|
||||||
|
ExternalCallResult<ChngDetectMastDto.RemoveResDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
url,
|
url,
|
||||||
HttpMethod.POST,
|
HttpMethod.POST,
|
||||||
chnDetectMastReq,
|
chnDetectMastReq,
|
||||||
netUtils.jsonHeaders(),
|
netUtils.jsonHeaders(),
|
||||||
ChngDetectMastDto.Basic.class);
|
ChngDetectMastDto.RemoveResDto.class);
|
||||||
|
|
||||||
ChngDetectMastDto.Basic resultBody = result.body();
|
ChngDetectMastDto.RemoveResDto resultBody = result.body();
|
||||||
gukyuinCoreService.updateGukYuinMastRegRemove(resultBody);
|
if (resultBody != null && resultBody.getSuccess() != null) {
|
||||||
|
|
||||||
|
success = resultBody.getSuccess();
|
||||||
|
if (resultBody.getSuccess()) {
|
||||||
|
gukyuinCoreService.updateGukYuinMastRegRemove(chnDetectMastReq.getChnDtctId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
this.insertGukyuinAuditLog(
|
||||||
EventType.REMOVE.getId(),
|
EventType.REMOVE.getId(),
|
||||||
@@ -146,14 +161,22 @@ public class GukYuinApiService {
|
|||||||
userUtil.getId(),
|
userUtil.getId(),
|
||||||
url.replace(gukyuinUrl, ""),
|
url.replace(gukyuinUrl, ""),
|
||||||
chnDetectMastReq,
|
chnDetectMastReq,
|
||||||
true); // TODO : successFail 여부
|
success);
|
||||||
return new ResReturn("success", "탐지결과 삭제 되었습니다.");
|
|
||||||
|
return resultBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 등록목록 1개 확인
|
// 등록목록 1개 확인
|
||||||
public ChngDetectMastDto.ResultDto detail(String chnDtctMstId) {
|
public ChngDetectMastDto.ResultDto detail(String chnDtctMstId) {
|
||||||
|
|
||||||
String url = gukyuinCdiUrl + "/chn/mast/list/" + chnDtctMstId;
|
String url =
|
||||||
|
gukyuinCdiUrl
|
||||||
|
+ "/chn/mast/list/"
|
||||||
|
+ chnDtctMstId
|
||||||
|
+ "?reqIp="
|
||||||
|
+ myip
|
||||||
|
+ "&reqEpno="
|
||||||
|
+ userUtil.getEmployeeNo();
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
@@ -172,9 +195,15 @@ public class GukYuinApiService {
|
|||||||
// 등록목록 비교년도,기준년도,차수 조합해서 n개 확인
|
// 등록목록 비교년도,기준년도,차수 조합해서 n개 확인
|
||||||
public ChngDetectMastDto.ResultDto listYearStage(
|
public ChngDetectMastDto.ResultDto listYearStage(
|
||||||
ChngDetectMastDto.ChngDetectMastSearchDto searchDto) {
|
ChngDetectMastDto.ChngDetectMastSearchDto searchDto) {
|
||||||
|
|
||||||
String queryString = netUtils.dtoToQueryString(searchDto, null);
|
String queryString = netUtils.dtoToQueryString(searchDto, null);
|
||||||
String url = gukyuinCdiUrl + "/chn/mast" + queryString;
|
String url =
|
||||||
|
gukyuinCdiUrl
|
||||||
|
+ "/chn/mast"
|
||||||
|
+ queryString
|
||||||
|
+ "&reqIp="
|
||||||
|
+ myip
|
||||||
|
+ "&reqEpno="
|
||||||
|
+ userUtil.getEmployeeNo();
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
@@ -238,7 +267,11 @@ public class GukYuinApiService {
|
|||||||
+ "?pageIndex="
|
+ "?pageIndex="
|
||||||
+ pageIndex
|
+ pageIndex
|
||||||
+ "&pageSize="
|
+ "&pageSize="
|
||||||
+ pageSize;
|
+ pageSize
|
||||||
|
+ "&reqIp="
|
||||||
|
+ myip
|
||||||
|
+ "&reqEpno="
|
||||||
|
+ userUtil.getEmployeeNo();
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectContDto.ResultContDto> result =
|
ExternalCallResult<ChngDetectContDto.ResultContDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
@@ -257,20 +290,6 @@ public class GukYuinApiService {
|
|||||||
result.body().getSuccess());
|
result.body().getSuccess());
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
this.insertGukyuinAuditLog(
|
||||||
EventType.LIST.getId(),
|
EventType.LIST.getId(),
|
||||||
netUtils.getLocalIP(),
|
netUtils.getLocalIP(),
|
||||||
@@ -283,7 +302,16 @@ public class GukYuinApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ResultPnuDto findPnuObjMgmtList(String chnDtctId, String chnDtctObjtId) {
|
public ResultPnuDto findPnuObjMgmtList(String chnDtctId, String chnDtctObjtId) {
|
||||||
String url = gukyuinCdiUrl + "/chn/pnu/" + chnDtctId + "/objt/" + chnDtctObjtId;
|
String url =
|
||||||
|
gukyuinCdiUrl
|
||||||
|
+ "/chn/pnu/"
|
||||||
|
+ chnDtctId
|
||||||
|
+ "/objt/"
|
||||||
|
+ chnDtctObjtId
|
||||||
|
+ "?reqIp="
|
||||||
|
+ myip
|
||||||
|
+ "&reqEpno="
|
||||||
|
+ userUtil.getEmployeeNo();
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectContDto.ResultPnuDto> result =
|
ExternalCallResult<ChngDetectContDto.ResultPnuDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
@@ -304,7 +332,8 @@ public class GukYuinApiService {
|
|||||||
return result.body();
|
return result.body();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResReturn updateChnDtctObjtLabelingYn(String chnDtctObjtId, String lblYn) {
|
public ChngDetectContDto.ResultPnuDto updateChnDtctObjtLabelingYn(
|
||||||
|
String chnDtctObjtId, String lblYn) {
|
||||||
String url = gukyuinCdiUrl + "/rlb/objt/" + chnDtctObjtId + "/lbl/" + lblYn;
|
String url = gukyuinCdiUrl + "/rlb/objt/" + chnDtctObjtId + "/lbl/" + lblYn;
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectContDto.ResultPnuDto> result =
|
ExternalCallResult<ChngDetectContDto.ResultPnuDto> result =
|
||||||
@@ -315,8 +344,6 @@ public class GukYuinApiService {
|
|||||||
netUtils.jsonHeaders(),
|
netUtils.jsonHeaders(),
|
||||||
ChngDetectContDto.ResultPnuDto.class);
|
ChngDetectContDto.ResultPnuDto.class);
|
||||||
|
|
||||||
ChngDetectContDto.ResultPnuDto dto = result.body();
|
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
this.insertGukyuinAuditLog(
|
||||||
EventType.MODIFIED.getId(),
|
EventType.MODIFIED.getId(),
|
||||||
netUtils.getLocalIP(),
|
netUtils.getLocalIP(),
|
||||||
@@ -325,11 +352,21 @@ public class GukYuinApiService {
|
|||||||
null,
|
null,
|
||||||
result.body().getSuccess());
|
result.body().getSuccess());
|
||||||
|
|
||||||
return new ResReturn(dto.getCode() > 200000 ? "fail" : "success", dto.getMessage());
|
return result.body();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResultContDto findChnPnuToContList(String chnDtctId, String pnu) {
|
public ResultContDto findChnPnuToContList(String chnDtctId, String pnu) {
|
||||||
String url = gukyuinCdiUrl + "/chn/cont/" + chnDtctId + "/pnu/" + pnu;
|
|
||||||
|
String url =
|
||||||
|
gukyuinCdiUrl
|
||||||
|
+ "/chn/cont/"
|
||||||
|
+ chnDtctId
|
||||||
|
+ "/pnu/"
|
||||||
|
+ pnu
|
||||||
|
+ "?reqIp="
|
||||||
|
+ myip
|
||||||
|
+ "&reqEpno="
|
||||||
|
+ userUtil.getEmployeeNo();
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectContDto.ResultContDto> result =
|
ExternalCallResult<ChngDetectContDto.ResultContDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
@@ -350,7 +387,14 @@ public class GukYuinApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ResultDto listChnDtctId(String chnDtctId) {
|
public ResultDto listChnDtctId(String chnDtctId) {
|
||||||
String url = gukyuinCdiUrl + "/chn/mast/" + chnDtctId;
|
String url =
|
||||||
|
gukyuinCdiUrl
|
||||||
|
+ "/chn/mast/"
|
||||||
|
+ chnDtctId
|
||||||
|
+ "?reqIp="
|
||||||
|
+ myip
|
||||||
|
+ "&reqEpno="
|
||||||
|
+ userUtil.getEmployeeNo();
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
@@ -413,10 +457,9 @@ public class GukYuinApiService {
|
|||||||
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());
|
||||||
log.info("Path of: {} ", Path.of("/kamco-nfs/dataset/export/" + 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, "파일 경로에 회차 실행 파일이 생성되지 않았습니다. 확인 부탁드립니다.");
|
||||||
}
|
}
|
||||||
@@ -446,7 +489,11 @@ public class GukYuinApiService {
|
|||||||
+ "?pageIndex="
|
+ "?pageIndex="
|
||||||
+ pageIndex
|
+ pageIndex
|
||||||
+ "&pageSize="
|
+ "&pageSize="
|
||||||
+ pageSize;
|
+ pageSize
|
||||||
|
+ "&reqIp="
|
||||||
|
+ myip
|
||||||
|
+ "&reqEpno="
|
||||||
|
+ userUtil.getEmployeeNo();
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectContDto.ResultContDto> result =
|
ExternalCallResult<ChngDetectContDto.ResultContDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
@@ -468,7 +515,14 @@ public class GukYuinApiService {
|
|||||||
|
|
||||||
public ChngDetectMastDto.RlbDtctDto findRlbDtctList(String chnDtctId) {
|
public ChngDetectMastDto.RlbDtctDto findRlbDtctList(String chnDtctId) {
|
||||||
|
|
||||||
String url = gukyuinCdiUrl + "/rlb/dtct/" + chnDtctId;
|
String url =
|
||||||
|
gukyuinCdiUrl
|
||||||
|
+ "/rlb/dtct/"
|
||||||
|
+ chnDtctId
|
||||||
|
+ "?reqIp="
|
||||||
|
+ myip
|
||||||
|
+ "&reqEpno="
|
||||||
|
+ userUtil.getEmployeeNo();
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectMastDto.RlbDtctDto> result =
|
ExternalCallResult<ChngDetectMastDto.RlbDtctDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
@@ -485,8 +539,14 @@ public class GukYuinApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public RlbDtctDto findRlbDtctObject(String chnDtctObjtId) {
|
public RlbDtctDto findRlbDtctObject(String chnDtctObjtId) {
|
||||||
|
String url =
|
||||||
String url = gukyuinCdiUrl + "/rlb/objt/" + chnDtctObjtId;
|
gukyuinCdiUrl
|
||||||
|
+ "/rlb/objt/"
|
||||||
|
+ chnDtctObjtId
|
||||||
|
+ "?reqIp="
|
||||||
|
+ myip
|
||||||
|
+ "&reqEpno="
|
||||||
|
+ userUtil.getEmployeeNo();
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectMastDto.RlbDtctDto> result =
|
ExternalCallResult<ChngDetectMastDto.RlbDtctDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ public class GukYuinCoreService {
|
|||||||
gukYuinRepository.updateGukYuinMastRegResult(resultBody);
|
gukYuinRepository.updateGukYuinMastRegResult(resultBody);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateGukYuinMastRegRemove(Basic resultBody) {
|
public void updateGukYuinMastRegRemove(String chnDtctId) {
|
||||||
gukYuinRepository.updateGukYuinMastRegRemove(resultBody);
|
gukYuinRepository.updateGukYuinMastRegRemove(chnDtctId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateInferenceGeomDataPnuCnt(String chnDtctObjtId, long pnuCnt) {
|
public void updateInferenceGeomDataPnuCnt(String chnDtctObjtId, long pnuCnt) {
|
||||||
@@ -45,8 +45,8 @@ public class GukYuinCoreService {
|
|||||||
return gukYuinRepository.findMapSheetAnalDataInferenceGeomUid(chnDtctObjtId);
|
return gukYuinRepository.findMapSheetAnalDataInferenceGeomUid(chnDtctObjtId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void insertGeoUidPnuData(Long geoUid, String[] pnuList) {
|
public void insertGeoUidPnuData(Long geoUid, String[] pnuList, String chnDtctObjtId) {
|
||||||
gukYuinRepository.insertGeoUidPnuData(geoUid, pnuList);
|
gukYuinRepository.insertGeoUidPnuData(geoUid, pnuList, chnDtctObjtId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LearnInfo findMapSheetLearnInfo(UUID uuid) {
|
public LearnInfo findMapSheetLearnInfo(UUID uuid) {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class GukYuinPnuJobCoreService {
|
|||||||
return gukYuinPnuRepository.findMapSheetAnalDataInferenceGeomUid(chnDtctObjtId);
|
return gukYuinPnuRepository.findMapSheetAnalDataInferenceGeomUid(chnDtctObjtId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void insertGeoUidPnuData(Long geoUid, String[] pnuList) {
|
public void insertGeoUidPnuData(Long geoUid, String[] pnuList, String chnDtctObjtId) {
|
||||||
gukYuinPnuRepository.insertGeoUidPnuData(geoUid, pnuList);
|
gukYuinPnuRepository.insertGeoUidPnuData(geoUid, pnuList, chnDtctObjtId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
package com.kamco.cd.kamcoback.postgres.core;
|
package com.kamco.cd.kamcoback.postgres.core;
|
||||||
|
|
||||||
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.postgres.entity.PnuEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinStbltJobRepository;
|
import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinStbltJobRepository;
|
||||||
|
import java.time.ZonedDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -18,7 +21,47 @@ public class GukYuinStbltJobCoreService {
|
|||||||
return gukYuinStbltRepository.findGukYuinEligibleForSurveyList(status);
|
return gukYuinStbltRepository.findGukYuinEligibleForSurveyList(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateGukYuinEligibleForSurvey(String resultUid, String stbltYn, String lockYn) {
|
public void updateGukYuinEligibleForSurvey(String resultUid, RlbDtctMastDto stbltDto) {
|
||||||
gukYuinStbltRepository.updateGukYuinEligibleForSurvey(resultUid, stbltYn, lockYn);
|
PnuEntity entity =
|
||||||
|
gukYuinStbltRepository.findPnuEntityByResultUid(resultUid, stbltDto.getPnu());
|
||||||
|
|
||||||
|
entity.setPnuDtctId(stbltDto.getPnuDtctId());
|
||||||
|
entity.setPnu(stbltDto.getPnu());
|
||||||
|
entity.setLrmSyncYmd(stbltDto.getLrmSyncYmd());
|
||||||
|
entity.setPnuSyncYmd(stbltDto.getPnuSyncYmd());
|
||||||
|
entity.setMpqdNo(stbltDto.getMpqdNo());
|
||||||
|
entity.setCprsYr(stbltDto.getCprsYr());
|
||||||
|
entity.setCrtrYr(stbltDto.getCrtrYr());
|
||||||
|
entity.setChnDtctSno(stbltDto.getChnDtctSno());
|
||||||
|
entity.setChnDtctId(stbltDto.getChnDtctId());
|
||||||
|
entity.setChnDtctMstId(stbltDto.getChnDtctMstId());
|
||||||
|
entity.setChnDtctObjtId(stbltDto.getChnDtctObjtId());
|
||||||
|
entity.setChnDtctContId(stbltDto.getChnDtctContId());
|
||||||
|
entity.setChnCd(stbltDto.getChnCd());
|
||||||
|
entity.setBfClsCd(stbltDto.getBfClsCd());
|
||||||
|
entity.setBfClsProb(stbltDto.getBfClsProb());
|
||||||
|
entity.setAfClsCd(stbltDto.getAfClsCd());
|
||||||
|
entity.setAfClsProb(stbltDto.getAfClsProb());
|
||||||
|
entity.setPnuSqms(stbltDto.getPnuSqms());
|
||||||
|
entity.setPnuDtctSqms(stbltDto.getPnuDtctSqms());
|
||||||
|
entity.setChnDtctSqms(stbltDto.getChnDtctSqms());
|
||||||
|
entity.setStbltYn(stbltDto.getStbltYn());
|
||||||
|
entity.setIncyCd(stbltDto.getIncyCd());
|
||||||
|
entity.setIncyRsnCont(stbltDto.getIncyRsnCont());
|
||||||
|
entity.setLockYn(stbltDto.getLockYn());
|
||||||
|
entity.setLblYn(stbltDto.getLblYn());
|
||||||
|
entity.setChgYn(stbltDto.getChgYn());
|
||||||
|
entity.setRsatctNo(stbltDto.getRsatctNo());
|
||||||
|
entity.setRmk(stbltDto.getRmk());
|
||||||
|
entity.setCrtDt(stbltDto.getCrtDt());
|
||||||
|
entity.setCrtEpno(stbltDto.getCrtEpno());
|
||||||
|
entity.setCrtIp(stbltDto.getCrtIp());
|
||||||
|
entity.setChgDt(stbltDto.getChgDt());
|
||||||
|
entity.setChgEpno(stbltDto.getChgEpno());
|
||||||
|
entity.setChgIp(stbltDto.getChgIp());
|
||||||
|
entity.setDelYn(stbltDto.getDelYn().equals("Y"));
|
||||||
|
|
||||||
|
entity.setCreatedDttm(ZonedDateTime.now());
|
||||||
|
gukYuinStbltRepository.save(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import jakarta.persistence.SequenceGenerator;
|
|||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
import java.time.OffsetDateTime;
|
import java.time.ZonedDateTime;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.hibernate.annotations.ColumnDefault;
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
@@ -39,7 +39,7 @@ public class PnuEntity {
|
|||||||
private String pnu;
|
private String pnu;
|
||||||
|
|
||||||
@Column(name = "created_dttm")
|
@Column(name = "created_dttm")
|
||||||
private OffsetDateTime createdDttm;
|
private ZonedDateTime createdDttm;
|
||||||
|
|
||||||
@Column(name = "created_uid")
|
@Column(name = "created_uid")
|
||||||
private Long createdUid;
|
private Long createdUid;
|
||||||
@@ -47,4 +47,140 @@ public class PnuEntity {
|
|||||||
@ColumnDefault("false")
|
@ColumnDefault("false")
|
||||||
@Column(name = "del_yn")
|
@Column(name = "del_yn")
|
||||||
private Boolean delYn;
|
private Boolean delYn;
|
||||||
|
|
||||||
|
@Size(max = 40)
|
||||||
|
@Column(name = "pnu_dtct_id", length = 40)
|
||||||
|
private String pnuDtctId;
|
||||||
|
|
||||||
|
@Size(max = 10)
|
||||||
|
@Column(name = "lrm_sync_ymd", length = 10)
|
||||||
|
private String lrmSyncYmd;
|
||||||
|
|
||||||
|
@Size(max = 10)
|
||||||
|
@Column(name = "pnu_sync_ymd", length = 10)
|
||||||
|
private String pnuSyncYmd;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@Column(name = "mpqd_no", length = 20)
|
||||||
|
private String mpqdNo;
|
||||||
|
|
||||||
|
@Size(max = 10)
|
||||||
|
@Column(name = "cprs_yr", length = 10)
|
||||||
|
private String cprsYr;
|
||||||
|
|
||||||
|
@Size(max = 10)
|
||||||
|
@Column(name = "crtr_yr", length = 10)
|
||||||
|
private String crtrYr;
|
||||||
|
|
||||||
|
@Size(max = 255)
|
||||||
|
@Column(name = "chn_dtct_id")
|
||||||
|
private String chnDtctId;
|
||||||
|
|
||||||
|
@Size(max = 10)
|
||||||
|
@Column(name = "chn_dtct_mst_id", length = 10)
|
||||||
|
private String chnDtctMstId;
|
||||||
|
|
||||||
|
@Size(max = 255)
|
||||||
|
@Column(name = "chn_dtct_objt_id")
|
||||||
|
private String chnDtctObjtId;
|
||||||
|
|
||||||
|
@Size(max = 255)
|
||||||
|
@Column(name = "chn_dtct_cont_id")
|
||||||
|
private String chnDtctContId;
|
||||||
|
|
||||||
|
@Size(max = 50)
|
||||||
|
@Column(name = "chn_cd", length = 50)
|
||||||
|
private String chnCd;
|
||||||
|
|
||||||
|
@Size(max = 50)
|
||||||
|
@Column(name = "chn_dtct_prob", length = 50)
|
||||||
|
private String chnDtctProb;
|
||||||
|
|
||||||
|
@Size(max = 50)
|
||||||
|
@Column(name = "bf_cls_cd", length = 50)
|
||||||
|
private String bfClsCd;
|
||||||
|
|
||||||
|
@Size(max = 50)
|
||||||
|
@Column(name = "bf_cls_prob", length = 50)
|
||||||
|
private String bfClsProb;
|
||||||
|
|
||||||
|
@Size(max = 50)
|
||||||
|
@Column(name = "af_cls_cd", length = 50)
|
||||||
|
private String afClsCd;
|
||||||
|
|
||||||
|
@Size(max = 50)
|
||||||
|
@Column(name = "af_cls_prob", length = 50)
|
||||||
|
private String afClsProb;
|
||||||
|
|
||||||
|
@Size(max = 100)
|
||||||
|
@Column(name = "pnu_sqms", length = 100)
|
||||||
|
private String pnuSqms;
|
||||||
|
|
||||||
|
@Size(max = 100)
|
||||||
|
@Column(name = "pnu_dtct_sqms", length = 100)
|
||||||
|
private String pnuDtctSqms;
|
||||||
|
|
||||||
|
@Size(max = 100)
|
||||||
|
@Column(name = "chn_dtct_sqms", length = 100)
|
||||||
|
private String chnDtctSqms;
|
||||||
|
|
||||||
|
@Size(max = 1)
|
||||||
|
@Column(name = "stblt_yn", length = 1)
|
||||||
|
private String stbltYn;
|
||||||
|
|
||||||
|
@Size(max = 30)
|
||||||
|
@Column(name = "incy_cd", length = 30)
|
||||||
|
private String incyCd;
|
||||||
|
|
||||||
|
@Size(max = 255)
|
||||||
|
@Column(name = "incy_rsn_cont")
|
||||||
|
private String incyRsnCont;
|
||||||
|
|
||||||
|
@Size(max = 1)
|
||||||
|
@Column(name = "lock_yn", length = 1)
|
||||||
|
private String lockYn;
|
||||||
|
|
||||||
|
@Size(max = 1)
|
||||||
|
@Column(name = "lbl_yn", length = 1)
|
||||||
|
private String lblYn;
|
||||||
|
|
||||||
|
@Size(max = 1)
|
||||||
|
@Column(name = "chg_yn", length = 1)
|
||||||
|
private String chgYn;
|
||||||
|
|
||||||
|
@Size(max = 50)
|
||||||
|
@Column(name = "rsatct_no", length = 50)
|
||||||
|
private String rsatctNo;
|
||||||
|
|
||||||
|
@Size(max = 100)
|
||||||
|
@Column(name = "rmk", length = 100)
|
||||||
|
private String rmk;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@Column(name = "crt_dt", length = 20)
|
||||||
|
private String crtDt;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@Column(name = "crt_epno", length = 20)
|
||||||
|
private String crtEpno;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@Column(name = "crt_ip", length = 20)
|
||||||
|
private String crtIp;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@Column(name = "chg_dt", length = 20)
|
||||||
|
private String chgDt;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@Column(name = "chg_epno", length = 20)
|
||||||
|
private String chgEpno;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@Column(name = "chg_ip", length = 20)
|
||||||
|
private String chgIp;
|
||||||
|
|
||||||
|
@Size(max = 10)
|
||||||
|
@Column(name = "chn_dtct_sno", length = 10)
|
||||||
|
private String chnDtctSno;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public interface GukYuinPnuJobRepositoryCustom {
|
|||||||
|
|
||||||
Long findMapSheetAnalDataInferenceGeomUid(String chnDtctObjtId);
|
Long findMapSheetAnalDataInferenceGeomUid(String chnDtctObjtId);
|
||||||
|
|
||||||
void insertGeoUidPnuData(Long geoUid, String[] pnuList);
|
void insertGeoUidPnuData(Long geoUid, String[] pnuList, String chnDtctObjtId);
|
||||||
|
|
||||||
void updateGukYuinApplyStateComplete(Long id, GukYuinStatus status);
|
void updateGukYuinApplyStateComplete(Long id, GukYuinStatus status);
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import static com.kamco.cd.kamcoback.postgres.entity.QPnuEntity.pnuEntity;
|
|||||||
|
|
||||||
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.GukYuinStatus;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
||||||
|
import com.kamco.cd.kamcoback.postgres.entity.PnuEntity;
|
||||||
import com.querydsl.core.types.Projections;
|
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;
|
||||||
@@ -42,13 +43,20 @@ public class GukYuinPnuJobRepositoryImpl implements GukYuinPnuJobRepositoryCusto
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void insertGeoUidPnuData(Long geoUid, String[] pnuList) {
|
public void insertGeoUidPnuData(Long geoUid, String[] pnuList, String chnDtctObjtId) {
|
||||||
for (String pnu : pnuList) {
|
for (String pnu : pnuList) {
|
||||||
queryFactory
|
PnuEntity entity =
|
||||||
.insert(pnuEntity)
|
queryFactory
|
||||||
.columns(pnuEntity.geo.geoUid, pnuEntity.pnu, pnuEntity.createdDttm)
|
.selectFrom(pnuEntity)
|
||||||
.values(geoUid, pnu, ZonedDateTime.now())
|
.where(pnuEntity.pnu.eq(pnu), pnuEntity.chnDtctObjtId.eq(chnDtctObjtId))
|
||||||
.execute();
|
.fetchOne();
|
||||||
|
if (entity == null) {
|
||||||
|
queryFactory
|
||||||
|
.insert(pnuEntity)
|
||||||
|
.columns(pnuEntity.geo.geoUid, pnuEntity.pnu, pnuEntity.createdDttm)
|
||||||
|
.values(geoUid, pnu, ZonedDateTime.now())
|
||||||
|
.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,8 +95,12 @@ public class GukYuinPnuJobRepositoryImpl implements GukYuinPnuJobRepositoryCusto
|
|||||||
long result =
|
long result =
|
||||||
queryFactory
|
queryFactory
|
||||||
.insert(pnuEntity)
|
.insert(pnuEntity)
|
||||||
.columns(pnuEntity.geo.geoUid, pnuEntity.pnu, pnuEntity.createdDttm)
|
.columns(
|
||||||
.values(geoUid, pnu, ZonedDateTime.now())
|
pnuEntity.geo.geoUid,
|
||||||
|
pnuEntity.pnu,
|
||||||
|
pnuEntity.createdDttm,
|
||||||
|
pnuEntity.chnDtctObjtId)
|
||||||
|
.values(geoUid, pnu, ZonedDateTime.now(), chnDtctObjtId)
|
||||||
.execute();
|
.execute();
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
succCnt++;
|
succCnt++;
|
||||||
|
|||||||
@@ -14,13 +14,13 @@ public interface GukYuinRepositoryCustom {
|
|||||||
|
|
||||||
void updateGukYuinMastRegResult(Basic resultBody);
|
void updateGukYuinMastRegResult(Basic resultBody);
|
||||||
|
|
||||||
void updateGukYuinMastRegRemove(Basic resultBody);
|
void updateGukYuinMastRegRemove(String chnDtctId);
|
||||||
|
|
||||||
void updateInferenceGeomDataPnuCnt(String chnDtctObjtId, long pnuCnt);
|
void updateInferenceGeomDataPnuCnt(String chnDtctObjtId, long pnuCnt);
|
||||||
|
|
||||||
Long findMapSheetAnalDataInferenceGeomUid(String chnDtctObjtId);
|
Long findMapSheetAnalDataInferenceGeomUid(String chnDtctObjtId);
|
||||||
|
|
||||||
void insertGeoUidPnuData(Long geoUid, String[] pnuList);
|
void insertGeoUidPnuData(Long geoUid, String[] pnuList, String chnDtctObjtId);
|
||||||
|
|
||||||
void updateGukYuinApplyStateComplete(Long id, GukYuinStatus status);
|
void updateGukYuinApplyStateComplete(Long id, GukYuinStatus status);
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ 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.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;
|
||||||
import com.querydsl.core.types.dsl.Expressions;
|
import com.querydsl.core.types.dsl.Expressions;
|
||||||
@@ -59,12 +60,13 @@ public class GukYuinRepositoryImpl implements GukYuinRepositoryCustom {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateGukYuinMastRegRemove(Basic resultBody) {
|
public void updateGukYuinMastRegRemove(String chnDtctId) {
|
||||||
queryFactory
|
queryFactory
|
||||||
.update(mapSheetLearnEntity)
|
.update(mapSheetLearnEntity)
|
||||||
.set(mapSheetLearnEntity.applyStatus, GukYuinStatus.CANCELED.getId())
|
.set(mapSheetLearnEntity.applyStatus, GukYuinStatus.CANCELED.getId())
|
||||||
.set(mapSheetLearnEntity.applyStatusDttm, ZonedDateTime.now())
|
.set(mapSheetLearnEntity.applyStatusDttm, ZonedDateTime.now())
|
||||||
.where(mapSheetLearnEntity.uid.eq(resultBody.getChnDtctId()))
|
.set(mapSheetLearnEntity.applyYn, false)
|
||||||
|
.where(mapSheetLearnEntity.uid.eq(chnDtctId))
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,13 +89,25 @@ public class GukYuinRepositoryImpl implements GukYuinRepositoryCustom {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void insertGeoUidPnuData(Long geoUid, String[] pnuList) {
|
public void insertGeoUidPnuData(Long geoUid, String[] pnuList, String chnDtctObjtId) {
|
||||||
for (String pnu : pnuList) {
|
for (String pnu : pnuList) {
|
||||||
queryFactory
|
PnuEntity entity =
|
||||||
.insert(pnuEntity)
|
queryFactory
|
||||||
.columns(pnuEntity.geo.geoUid, pnuEntity.pnu, pnuEntity.createdDttm)
|
.selectFrom(pnuEntity)
|
||||||
.values(geoUid, pnu, ZonedDateTime.now())
|
.where(
|
||||||
.execute();
|
pnuEntity.geo.geoUid.eq(geoUid),
|
||||||
|
pnuEntity.pnu.eq(pnu),
|
||||||
|
pnuEntity.chnDtctObjtId.eq(chnDtctObjtId))
|
||||||
|
.fetchOne();
|
||||||
|
|
||||||
|
if (entity == null) {
|
||||||
|
queryFactory
|
||||||
|
.insert(pnuEntity)
|
||||||
|
.columns(
|
||||||
|
pnuEntity.geo.geoUid, pnuEntity.pnu, pnuEntity.createdDttm, pnuEntity.chnDtctObjtId)
|
||||||
|
.values(geoUid, pnu, ZonedDateTime.now(), chnDtctObjtId)
|
||||||
|
.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.kamco.cd.kamcoback.postgres.repository.gukyuin;
|
package com.kamco.cd.kamcoback.postgres.repository.gukyuin;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.PnuEntity;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
public interface GukYuinStbltJobRepository
|
public interface GukYuinStbltJobRepository
|
||||||
extends JpaRepository<MapSheetLearnEntity, Long>, GukYuinStbltJobRepositoryCustom {}
|
extends JpaRepository<PnuEntity, Long>, GukYuinStbltJobRepositoryCustom {}
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
package com.kamco.cd.kamcoback.postgres.repository.gukyuin;
|
package com.kamco.cd.kamcoback.postgres.repository.gukyuin;
|
||||||
|
|
||||||
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.postgres.entity.PnuEntity;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface GukYuinStbltJobRepositoryCustom {
|
public interface GukYuinStbltJobRepositoryCustom {
|
||||||
|
|
||||||
List<LearnKeyDto> findGukYuinEligibleForSurveyList(String status);
|
List<LearnKeyDto> findGukYuinEligibleForSurveyList(String status);
|
||||||
|
|
||||||
void updateGukYuinEligibleForSurvey(String resultUid, String stbltYn, String lockYn);
|
void updateGukYuinEligibleForSurvey(String resultUid, RlbDtctMastDto stbltDto);
|
||||||
|
|
||||||
|
PnuEntity findPnuEntityByResultUid(String resultUid, String pnu);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,17 @@ import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceE
|
|||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity.mapSheetAnalDataInferenceGeomEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity.mapSheetAnalDataInferenceGeomEntity;
|
||||||
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.QMapSheetLearnEntity.mapSheetLearnEntity;
|
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.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.GukYuinStatus;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
||||||
|
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntity;
|
||||||
|
import com.kamco.cd.kamcoback.postgres.entity.PnuEntity;
|
||||||
import com.querydsl.core.types.Projections;
|
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;
|
||||||
@@ -50,15 +52,73 @@ public class GukYuinStbltJobRepositoryImpl implements GukYuinStbltJobRepositoryC
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateGukYuinEligibleForSurvey(String resultUid, String stbltYn, String lockYn) {
|
public void updateGukYuinEligibleForSurvey(String resultUid, RlbDtctMastDto stbltDto) {
|
||||||
queryFactory
|
|
||||||
.update(mapSheetAnalDataInferenceGeomEntity)
|
MapSheetAnalDataInferenceGeomEntity geomEntity =
|
||||||
.set(
|
queryFactory
|
||||||
mapSheetAnalDataInferenceGeomEntity.fitState,
|
.selectFrom(mapSheetAnalDataInferenceGeomEntity)
|
||||||
stbltYn.equals("Y") ? ImageryFitStatus.FIT.getId() : ImageryFitStatus.UNFIT.getId())
|
.where(mapSheetAnalDataInferenceGeomEntity.resultUid.eq(resultUid))
|
||||||
.set(mapSheetAnalDataInferenceGeomEntity.fitStateDttm, ZonedDateTime.now())
|
.fetchOne();
|
||||||
.set(mapSheetAnalDataInferenceGeomEntity.lockYn, lockYn)
|
|
||||||
.where(mapSheetAnalDataInferenceGeomEntity.resultUid.eq(resultUid))
|
if (geomEntity != null) {
|
||||||
.execute();
|
PnuEntity pnuEt =
|
||||||
|
queryFactory
|
||||||
|
.selectFrom(pnuEntity)
|
||||||
|
.where(pnuEntity.pnu.eq(stbltDto.getPnu()), pnuEntity.chnDtctObjtId.eq(resultUid))
|
||||||
|
.fetchOne();
|
||||||
|
if (pnuEt != null) {
|
||||||
|
// update
|
||||||
|
queryFactory
|
||||||
|
.update(pnuEntity)
|
||||||
|
.set(pnuEntity.pnuDtctId, stbltDto.getPnuDtctId())
|
||||||
|
.set(pnuEntity.lrmSyncYmd, stbltDto.getLrmSyncYmd())
|
||||||
|
.set(pnuEntity.pnuSyncYmd, stbltDto.getPnuSyncYmd())
|
||||||
|
.set(pnuEntity.mpqdNo, stbltDto.getMpqdNo())
|
||||||
|
.set(pnuEntity.cprsYr, stbltDto.getCprsYr())
|
||||||
|
.set(pnuEntity.crtrYr, stbltDto.getCrtrYr())
|
||||||
|
.set(pnuEntity.chnDtctId, stbltDto.getChnDtctId())
|
||||||
|
.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();
|
||||||
|
} 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
|
||||||
|
public PnuEntity findPnuEntityByResultUid(String resultUid, String pnu) {
|
||||||
|
return queryFactory
|
||||||
|
.selectFrom(pnuEntity)
|
||||||
|
.where(pnuEntity.pnu.eq(pnu), pnuEntity.chnDtctObjtId.eq(resultUid))
|
||||||
|
.fetchOne();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,27 +1,15 @@
|
|||||||
package com.kamco.cd.kamcoback.scheduler.service;
|
package com.kamco.cd.kamcoback.scheduler.service;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.NetUtils;
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.UserUtil;
|
|
||||||
import com.kamco.cd.kamcoback.config.api.ApiLogFunction;
|
|
||||||
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;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ResultPnuDto;
|
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GeomUidDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GeomUidDto;
|
||||||
import com.kamco.cd.kamcoback.log.dto.EventStatus;
|
import com.kamco.cd.kamcoback.gukyuin.service.GukYuinApiService;
|
||||||
import com.kamco.cd.kamcoback.log.dto.EventType;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.core.GukYuinLabelJobCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.GukYuinLabelJobCoreService;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.AuditLogEntity;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.repository.log.AuditLogRepository;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.http.HttpMethod;
|
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
@Log4j2
|
@Log4j2
|
||||||
@Service
|
@Service
|
||||||
@@ -29,22 +17,11 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
public class GukYuinApiLabelJobService {
|
public class GukYuinApiLabelJobService {
|
||||||
|
|
||||||
private final GukYuinLabelJobCoreService gukYuinLabelJobCoreService;
|
private final GukYuinLabelJobCoreService gukYuinLabelJobCoreService;
|
||||||
|
private final GukYuinApiService gukYuinApiService;
|
||||||
private final ExternalHttpClient externalHttpClient;
|
|
||||||
private final NetUtils netUtils = new NetUtils();
|
|
||||||
private final AuditLogRepository auditLogRepository;
|
|
||||||
|
|
||||||
private final UserUtil userUtil;
|
|
||||||
|
|
||||||
@Value("${spring.profiles.active}")
|
@Value("${spring.profiles.active}")
|
||||||
private String profile;
|
private String profile;
|
||||||
|
|
||||||
@Value("${gukyuin.url}")
|
|
||||||
private String gukyuinUrl;
|
|
||||||
|
|
||||||
@Value("${gukyuin.cdi}")
|
|
||||||
private String gukyuinCdiUrl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 실행중인 profile
|
* 실행중인 profile
|
||||||
*
|
*
|
||||||
@@ -67,57 +44,12 @@ public class GukYuinApiLabelJobService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (GeomUidDto gto : list) {
|
for (GeomUidDto gto : list) {
|
||||||
String url = gukyuinCdiUrl + "/rlb/objt/" + gto.getResultUid() + "/lbl/" + "Y";
|
ChngDetectContDto.ResultPnuDto dto =
|
||||||
|
gukYuinApiService.updateChnDtctObjtLabelingYn(gto.getResultUid(), "Y");
|
||||||
ExternalCallResult<ResultPnuDto> result =
|
if (dto.getSuccess()) {
|
||||||
externalHttpClient.call(
|
// inference_geom 에 label_send_dttm 업데이트 하기
|
||||||
url,
|
gukYuinLabelJobCoreService.updateAnalDataInferenceGeomSendDttm(gto.getGeoUid());
|
||||||
HttpMethod.POST,
|
}
|
||||||
null,
|
|
||||||
netUtils.jsonHeaders(),
|
|
||||||
ChngDetectContDto.ResultPnuDto.class);
|
|
||||||
|
|
||||||
ChngDetectContDto.ResultPnuDto dto = result.body();
|
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
|
||||||
EventType.MODIFIED.getId(),
|
|
||||||
netUtils.getLocalIP(),
|
|
||||||
userUtil.getId(),
|
|
||||||
url.replace(gukyuinUrl, ""),
|
|
||||||
null,
|
|
||||||
result.body().getSuccess());
|
|
||||||
|
|
||||||
// inference_geom 에 label_send_dttm 업데이트 하기
|
|
||||||
gukYuinLabelJobCoreService.updateAnalDataInferenceGeomSendDttm(gto.getGeoUid());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
|
|
||||||
public void insertGukyuinAuditLog(
|
|
||||||
String actionType,
|
|
||||||
String myIp,
|
|
||||||
Long userUid,
|
|
||||||
String requestUri,
|
|
||||||
Object requestBody,
|
|
||||||
boolean successFail) {
|
|
||||||
try {
|
|
||||||
AuditLogEntity log =
|
|
||||||
new AuditLogEntity(
|
|
||||||
userUid,
|
|
||||||
EventType.fromName(actionType),
|
|
||||||
successFail ? EventStatus.SUCCESS : EventStatus.FAILED,
|
|
||||||
"GUKYUIN", // 메뉴도 국유인으로 하나 따기
|
|
||||||
myIp,
|
|
||||||
requestUri,
|
|
||||||
requestBody == null ? null : ApiLogFunction.cutRequestBody(requestBody.toString()),
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null);
|
|
||||||
auditLogRepository.save(log);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
throw e;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +1,19 @@
|
|||||||
package com.kamco.cd.kamcoback.scheduler.service;
|
package com.kamco.cd.kamcoback.scheduler.service;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.NetUtils;
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.UserUtil;
|
|
||||||
import com.kamco.cd.kamcoback.config.api.ApiLogFunction;
|
|
||||||
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.ContBasic;
|
||||||
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.ChngDetectMastDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto;
|
||||||
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.ResultDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ResultDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
||||||
import com.kamco.cd.kamcoback.log.dto.EventStatus;
|
import com.kamco.cd.kamcoback.gukyuin.service.GukYuinApiService;
|
||||||
import com.kamco.cd.kamcoback.log.dto.EventType;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.core.GukYuinPnuJobCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.GukYuinPnuJobCoreService;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.AuditLogEntity;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.repository.log.AuditLogRepository;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.http.HttpMethod;
|
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
@Log4j2
|
@Log4j2
|
||||||
@Service
|
@Service
|
||||||
@@ -33,21 +21,11 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
public class GukYuinApiPnuJobService {
|
public class GukYuinApiPnuJobService {
|
||||||
|
|
||||||
private final GukYuinPnuJobCoreService gukYuinPnuJobCoreService;
|
private final GukYuinPnuJobCoreService gukYuinPnuJobCoreService;
|
||||||
private final ExternalHttpClient externalHttpClient;
|
private final GukYuinApiService gukYuinApiService;
|
||||||
private final NetUtils netUtils = new NetUtils();
|
|
||||||
private final AuditLogRepository auditLogRepository;
|
|
||||||
|
|
||||||
private final UserUtil userUtil;
|
|
||||||
|
|
||||||
@Value("${spring.profiles.active}")
|
@Value("${spring.profiles.active}")
|
||||||
private String profile;
|
private String profile;
|
||||||
|
|
||||||
@Value("${gukyuin.url}")
|
|
||||||
private String gukyuinUrl;
|
|
||||||
|
|
||||||
@Value("${gukyuin.cdi}")
|
|
||||||
private String gukyuinCdiUrl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 실행중인 profile
|
* 실행중인 profile
|
||||||
*
|
*
|
||||||
@@ -58,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;
|
||||||
@@ -73,14 +51,9 @@ public class GukYuinApiPnuJobService {
|
|||||||
|
|
||||||
for (LearnKeyDto dto : list) {
|
for (LearnKeyDto dto : list) {
|
||||||
try {
|
try {
|
||||||
long succCnt = processUid(dto.getChnDtctMstId(), dto.getUid());
|
processUid(dto.getUid(), dto.getUid());
|
||||||
if (succCnt > 0) {
|
gukYuinPnuJobCoreService.updateGukYuinApplyStateComplete(
|
||||||
gukYuinPnuJobCoreService.updateGukYuinApplyStateComplete(
|
dto.getId(), GukYuinStatus.PNU_COMPLETED);
|
||||||
dto.getId(), GukYuinStatus.PNU_COMPLETED);
|
|
||||||
} else {
|
|
||||||
gukYuinPnuJobCoreService.updateGukYuinApplyStateComplete(
|
|
||||||
dto.getId(), GukYuinStatus.PNU_FAILED);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("[GUKYUIN] failed uid={}", dto.getUid(), e);
|
log.error("[GUKYUIN] failed uid={}", dto.getUid(), e);
|
||||||
gukYuinPnuJobCoreService.updateGukYuinApplyStateComplete(
|
gukYuinPnuJobCoreService.updateGukYuinApplyStateComplete(
|
||||||
@@ -89,31 +62,16 @@ public class GukYuinApiPnuJobService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private long processUid(String chnDtctMstId, String uid) {
|
private void processUid(String chnDtctId, String uid) {
|
||||||
long succCnt = 0;
|
ResultDto result = gukYuinApiService.listChnDtctId(chnDtctId);
|
||||||
String url = gukyuinCdiUrl + "/chn/mast/list/" + chnDtctMstId;
|
|
||||||
|
|
||||||
ExternalCallResult<ResultDto> response =
|
|
||||||
externalHttpClient.call(
|
|
||||||
url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class);
|
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
|
||||||
EventType.DETAIL.getId(),
|
|
||||||
netUtils.getLocalIP(),
|
|
||||||
userUtil.getId(),
|
|
||||||
url.replace(gukyuinUrl, ""),
|
|
||||||
null,
|
|
||||||
response.body().getSuccess());
|
|
||||||
|
|
||||||
ResultDto result = response.body();
|
|
||||||
if (result == null || result.getResult() == null || result.getResult().isEmpty()) {
|
if (result == null || result.getResult() == null || result.getResult().isEmpty()) {
|
||||||
return succCnt;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ChngDetectMastDto.Basic basic = result.getResult().get(0);
|
ChngDetectMastDto.Basic basic = result.getResult().get(0);
|
||||||
String chnDtctCnt = basic.getChnDtctCnt();
|
String chnDtctCnt = basic.getChnDtctCnt();
|
||||||
if (chnDtctCnt == null || chnDtctCnt.isEmpty()) {
|
if (chnDtctCnt == null || chnDtctCnt.isEmpty()) {
|
||||||
return succCnt;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// page 계산
|
// page 계산
|
||||||
@@ -122,30 +80,18 @@ public class GukYuinApiPnuJobService {
|
|||||||
int totalPages = (totalCount + pageSize - 1) / pageSize;
|
int totalPages = (totalCount + pageSize - 1) / pageSize;
|
||||||
|
|
||||||
for (int page = 0; page < totalPages; page++) {
|
for (int page = 0; page < totalPages; page++) {
|
||||||
succCnt += processPage(uid, page, pageSize);
|
processPage(uid, page, pageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
return succCnt;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private long processPage(String uid, int page, int pageSize) {
|
private void processPage(String uid, int page, int pageSize) {
|
||||||
long result = 0;
|
ResultContDto resContList = gukYuinApiService.findChnContList(uid, page, pageSize);
|
||||||
String url =
|
|
||||||
gukyuinCdiUrl + "/chn/cont/" + uid + "?pageIndex=" + page + "&pageSize=" + pageSize;
|
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectContDto.ResultContDto> response =
|
if (resContList.getResult() == null || resContList.getResult().isEmpty()) {
|
||||||
externalHttpClient.call(
|
return; // 외부 API 이상 방어
|
||||||
url,
|
|
||||||
HttpMethod.GET,
|
|
||||||
null,
|
|
||||||
netUtils.jsonHeaders(),
|
|
||||||
ChngDetectContDto.ResultContDto.class);
|
|
||||||
|
|
||||||
List<ContBasic> contList = response.body().getResult();
|
|
||||||
if (contList == null || contList.isEmpty()) {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<ContBasic> contList = resContList.getResult();
|
||||||
for (ContBasic cont : contList) {
|
for (ContBasic cont : contList) {
|
||||||
String[] pnuList = cont.getPnuList();
|
String[] pnuList = cont.getPnuList();
|
||||||
long pnuCnt = pnuList == null ? 0 : pnuList.length;
|
long pnuCnt = pnuList == null ? 0 : pnuList.length;
|
||||||
@@ -156,65 +102,9 @@ public class GukYuinApiPnuJobService {
|
|||||||
Long geoUid =
|
Long geoUid =
|
||||||
gukYuinPnuJobCoreService.findMapSheetAnalDataInferenceGeomUid(
|
gukYuinPnuJobCoreService.findMapSheetAnalDataInferenceGeomUid(
|
||||||
cont.getChnDtctObjtId());
|
cont.getChnDtctObjtId());
|
||||||
gukYuinPnuJobCoreService.insertGeoUidPnuData(geoUid, pnuList);
|
gukYuinPnuJobCoreService.insertGeoUidPnuData(geoUid, pnuList, cont.getChnDtctObjtId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
|
||||||
EventType.LIST.getId(),
|
|
||||||
netUtils.getLocalIP(),
|
|
||||||
userUtil.getId(),
|
|
||||||
url.replace(gukyuinUrl, ""),
|
|
||||||
null,
|
|
||||||
response.body().getSuccess());
|
|
||||||
|
|
||||||
ResultContDto cont = response.body();
|
|
||||||
if (cont == null || cont.getResult().isEmpty()) {
|
|
||||||
return result; // 외부 API 이상 방어
|
|
||||||
}
|
|
||||||
|
|
||||||
// pnuList 업데이트
|
|
||||||
for (ChngDetectContDto.ContBasic contBasic : cont.getResult()) {
|
|
||||||
if (contBasic.getPnuList() == null || contBasic.getChnDtctObjtId() == null) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
long upsertCnt =
|
|
||||||
gukYuinPnuJobCoreService.upsertMapSheetDataAnalGeomPnu(
|
|
||||||
contBasic.getChnDtctObjtId(), contBasic.getPnuList());
|
|
||||||
result += upsertCnt;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
|
|
||||||
public void insertGukyuinAuditLog(
|
|
||||||
String actionType,
|
|
||||||
String myIp,
|
|
||||||
Long userUid,
|
|
||||||
String requestUri,
|
|
||||||
Object requestBody,
|
|
||||||
boolean successFail) {
|
|
||||||
try {
|
|
||||||
AuditLogEntity log =
|
|
||||||
new AuditLogEntity(
|
|
||||||
userUid,
|
|
||||||
EventType.fromName(actionType),
|
|
||||||
successFail ? EventStatus.SUCCESS : EventStatus.FAILED,
|
|
||||||
"GUKYUIN", // 메뉴도 국유인으로 하나 따기
|
|
||||||
myIp,
|
|
||||||
requestUri,
|
|
||||||
requestBody == null ? null : ApiLogFunction.cutRequestBody(requestBody.toString()),
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null);
|
|
||||||
auditLogRepository.save(log);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,52 +1,28 @@
|
|||||||
package com.kamco.cd.kamcoback.scheduler.service;
|
package com.kamco.cd.kamcoback.scheduler.service;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.NetUtils;
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.UserUtil;
|
|
||||||
import com.kamco.cd.kamcoback.config.api.ApiLogFunction;
|
|
||||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient;
|
|
||||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient.ExternalCallResult;
|
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto;
|
||||||
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.ResultDto;
|
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
||||||
import com.kamco.cd.kamcoback.log.dto.EventStatus;
|
import com.kamco.cd.kamcoback.gukyuin.service.GukYuinApiService;
|
||||||
import com.kamco.cd.kamcoback.log.dto.EventType;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.core.GukYuinJobCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.GukYuinJobCoreService;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.AuditLogEntity;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.repository.log.AuditLogRepository;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.http.HttpMethod;
|
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
@Log4j2
|
@Log4j2
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class GukYuinApiStatusJobService {
|
public class GukYuinApiStatusJobService {
|
||||||
|
|
||||||
private final ExternalHttpClient externalHttpClient;
|
|
||||||
private final NetUtils netUtils = new NetUtils();
|
|
||||||
private final GukYuinJobCoreService gukYuinJobCoreService;
|
private final GukYuinJobCoreService gukYuinJobCoreService;
|
||||||
private final AuditLogRepository auditLogRepository;
|
private final GukYuinApiService gukYuinApiService;
|
||||||
|
|
||||||
private final UserUtil userUtil;
|
|
||||||
private final ObjectMapper objectMapper;
|
|
||||||
|
|
||||||
@Value("${spring.profiles.active}")
|
@Value("${spring.profiles.active}")
|
||||||
private String profile;
|
private String profile;
|
||||||
|
|
||||||
@Value("${gukyuin.url}")
|
|
||||||
private String gukyuinUrl;
|
|
||||||
|
|
||||||
@Value("${gukyuin.cdi}")
|
|
||||||
private String gukyuinCdiUrl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 실행중인 profile
|
* 실행중인 profile
|
||||||
*
|
*
|
||||||
@@ -57,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;
|
||||||
@@ -72,32 +48,14 @@ public class GukYuinApiStatusJobService {
|
|||||||
|
|
||||||
for (LearnKeyDto dto : list) {
|
for (LearnKeyDto dto : list) {
|
||||||
try {
|
try {
|
||||||
String url = gukyuinCdiUrl + "/chn/mast/list/" + dto.getChnDtctMstId();
|
ChngDetectMastDto.ResultDto result = gukYuinApiService.listChnDtctId(dto.getUid());
|
||||||
|
|
||||||
ExternalCallResult<ResultDto> response =
|
|
||||||
externalHttpClient.call(
|
|
||||||
url,
|
|
||||||
HttpMethod.GET,
|
|
||||||
null,
|
|
||||||
netUtils.jsonHeaders(),
|
|
||||||
ChngDetectMastDto.ResultDto.class);
|
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
|
||||||
EventType.DETAIL.getId(),
|
|
||||||
netUtils.getLocalIP(),
|
|
||||||
userUtil.getId(),
|
|
||||||
url.replace(gukyuinUrl, ""),
|
|
||||||
null,
|
|
||||||
response.body().getSuccess());
|
|
||||||
|
|
||||||
ResultDto result = response.body();
|
|
||||||
|
|
||||||
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());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ChngDetectMastDto.Basic basic = result.getResult().get(0);
|
ChngDetectMastDto.Basic basic = result.getResult().getFirst();
|
||||||
|
|
||||||
Integer progress =
|
Integer progress =
|
||||||
basic.getExcnPgrt() == null ? null : Integer.parseInt(basic.getExcnPgrt().trim());
|
basic.getExcnPgrt() == null ? null : Integer.parseInt(basic.getExcnPgrt().trim());
|
||||||
@@ -110,33 +68,4 @@ public class GukYuinApiStatusJobService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
|
|
||||||
public void insertGukyuinAuditLog(
|
|
||||||
String actionType,
|
|
||||||
String myIp,
|
|
||||||
Long userUid,
|
|
||||||
String requestUri,
|
|
||||||
Object requestBody,
|
|
||||||
boolean successFail) {
|
|
||||||
try {
|
|
||||||
AuditLogEntity log =
|
|
||||||
new AuditLogEntity(
|
|
||||||
userUid,
|
|
||||||
EventType.fromName(actionType),
|
|
||||||
successFail ? EventStatus.SUCCESS : EventStatus.FAILED,
|
|
||||||
"GUKYUIN", // 메뉴도 국유인으로 하나 따기
|
|
||||||
myIp,
|
|
||||||
requestUri,
|
|
||||||
requestBody == null ? null : ApiLogFunction.cutRequestBody(requestBody.toString()),
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null);
|
|
||||||
auditLogRepository.save(log);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,51 +1,29 @@
|
|||||||
package com.kamco.cd.kamcoback.scheduler.service;
|
package com.kamco.cd.kamcoback.scheduler.service;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.NetUtils;
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.UserUtil;
|
|
||||||
import com.kamco.cd.kamcoback.config.api.ApiLogFunction;
|
|
||||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient;
|
|
||||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient.ExternalCallResult;
|
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto;
|
|
||||||
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.RlbDtctDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.RlbDtctDto;
|
||||||
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;
|
||||||
import com.kamco.cd.kamcoback.log.dto.EventStatus;
|
import com.kamco.cd.kamcoback.gukyuin.service.GukYuinApiService;
|
||||||
import com.kamco.cd.kamcoback.log.dto.EventType;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.core.GukYuinStbltJobCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.GukYuinStbltJobCoreService;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.AuditLogEntity;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.repository.log.AuditLogRepository;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.http.HttpMethod;
|
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
@Log4j2
|
@Log4j2
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class GukYuinApiStbltJobService {
|
public class GukYuinApiStbltJobService {
|
||||||
|
|
||||||
private final ExternalHttpClient externalHttpClient;
|
|
||||||
private final NetUtils netUtils = new NetUtils();
|
|
||||||
private final GukYuinStbltJobCoreService gukYuinStbltJobCoreService;
|
private final GukYuinStbltJobCoreService gukYuinStbltJobCoreService;
|
||||||
private final AuditLogRepository auditLogRepository;
|
private final GukYuinApiService gukYuinApiService;
|
||||||
|
|
||||||
private final UserUtil userUtil;
|
|
||||||
|
|
||||||
@Value("${spring.profiles.active}")
|
@Value("${spring.profiles.active}")
|
||||||
private String profile;
|
private String profile;
|
||||||
|
|
||||||
@Value("${gukyuin.url}")
|
|
||||||
private String gukyuinUrl;
|
|
||||||
|
|
||||||
@Value("${gukyuin.cdi}")
|
|
||||||
private String gukyuinCdiUrl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 실행중인 profile
|
* 실행중인 profile
|
||||||
*
|
*
|
||||||
@@ -56,7 +34,7 @@ public class GukYuinApiStbltJobService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 국유인 연동 후, 실태조사 적합여부 확인하여 update */
|
/** 국유인 연동 후, 실태조사 적합여부 확인하여 update */
|
||||||
@Scheduled(cron = "0 0 3 * * *")
|
@Scheduled(cron = "0 * * * * *") // 0 0 3 * * *
|
||||||
public void findGukYuinEligibleForSurvey() {
|
public void findGukYuinEligibleForSurvey() {
|
||||||
if (isLocalProfile()) {
|
if (isLocalProfile()) {
|
||||||
return;
|
return;
|
||||||
@@ -71,25 +49,7 @@ public class GukYuinApiStbltJobService {
|
|||||||
|
|
||||||
for (LearnKeyDto dto : list) {
|
for (LearnKeyDto dto : list) {
|
||||||
try {
|
try {
|
||||||
String url = gukyuinCdiUrl + "/rlb/dtct/" + dto.getUid();
|
RlbDtctDto result = gukYuinApiService.findRlbDtctList(dto.getUid());
|
||||||
|
|
||||||
ExternalCallResult<RlbDtctDto> response =
|
|
||||||
externalHttpClient.call(
|
|
||||||
url,
|
|
||||||
HttpMethod.GET,
|
|
||||||
null,
|
|
||||||
netUtils.jsonHeaders(),
|
|
||||||
ChngDetectMastDto.RlbDtctDto.class);
|
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
|
||||||
EventType.LIST.getId(),
|
|
||||||
netUtils.getLocalIP(),
|
|
||||||
userUtil.getId(),
|
|
||||||
url.replace(gukyuinUrl, ""),
|
|
||||||
null,
|
|
||||||
response.body().getSuccess());
|
|
||||||
|
|
||||||
RlbDtctDto result = response.body();
|
|
||||||
|
|
||||||
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());
|
||||||
@@ -98,41 +58,11 @@ public class GukYuinApiStbltJobService {
|
|||||||
|
|
||||||
for (RlbDtctMastDto stbltDto : result.getResult()) {
|
for (RlbDtctMastDto stbltDto : result.getResult()) {
|
||||||
String resultUid = stbltDto.getChnDtctObjtId();
|
String resultUid = stbltDto.getChnDtctObjtId();
|
||||||
gukYuinStbltJobCoreService.updateGukYuinEligibleForSurvey(
|
gukYuinStbltJobCoreService.updateGukYuinEligibleForSurvey(resultUid, stbltDto);
|
||||||
resultUid, stbltDto.getStbltYn(), stbltDto.getLockYn());
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("[GUKYUIN] failed uid={}", dto.getChnDtctMstId(), e);
|
log.error("[GUKYUIN] failed uid={}", dto.getChnDtctMstId(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
|
|
||||||
public void insertGukyuinAuditLog(
|
|
||||||
String actionType,
|
|
||||||
String myIp,
|
|
||||||
Long userUid,
|
|
||||||
String requestUri,
|
|
||||||
Object requestBody,
|
|
||||||
boolean successFail) {
|
|
||||||
try {
|
|
||||||
AuditLogEntity log =
|
|
||||||
new AuditLogEntity(
|
|
||||||
userUid,
|
|
||||||
EventType.fromName(actionType),
|
|
||||||
successFail ? EventStatus.SUCCESS : EventStatus.FAILED,
|
|
||||||
"GUKYUIN", // 메뉴도 국유인으로 하나 따기
|
|
||||||
myIp,
|
|
||||||
requestUri,
|
|
||||||
requestBody == null ? null : ApiLogFunction.cutRequestBody(requestBody.toString()),
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null);
|
|
||||||
auditLogRepository.save(log);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user