Merge pull request 'userId -> 사번으로변경' (#64) from feat/dev_251201 into develop
Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/64
This commit is contained in:
@@ -26,9 +26,9 @@ public class CustomAuthenticationProvider implements AuthenticationProvider {
|
||||
|
||||
// 유저 조회
|
||||
MemberEntity member =
|
||||
membersRepository
|
||||
.findByUserId(username)
|
||||
.orElseThrow(() -> new CustomApiException(AuthErrorCode.LOGIN_ID_NOT_FOUND));
|
||||
membersRepository
|
||||
.findByEmployeeNo(username)
|
||||
.orElseThrow(() -> new CustomApiException(AuthErrorCode.LOGIN_ID_NOT_FOUND));
|
||||
|
||||
// 미사용 상태
|
||||
if (member.getStatus().equals(StatusType.INACTIVE.getId())) {
|
||||
|
||||
@@ -71,9 +71,40 @@ public class MapSheetMngApiController {
|
||||
/**
|
||||
* 오류데이터 목록 조회
|
||||
*
|
||||
* @param searchReq
|
||||
* @return
|
||||
* <p>도엽파일 동기화 시 발생한 오류 데이터를 조회합니다.
|
||||
*
|
||||
* <p>오류 타입:
|
||||
*
|
||||
* <ul>
|
||||
* <li>NOFILE - 파일없음
|
||||
* <li>NOTPAIR - 페어없음 (tif/tfw 중 하나만 존재)
|
||||
* <li>DUPLICATE - 중복 (동일한 파일이 여러개 존재)
|
||||
* <li>SIZEERROR - size 0 (파일 크기가 0)
|
||||
* <li>TYPEERROR - 형식오류 (tfw 검증 실패 또는 GeoTIFF 검증 실패)
|
||||
* </ul>
|
||||
*
|
||||
* <p>sync_check_strt_dttm과 sync_check_end_dttm은 동일한 값으로 설정됩니다.
|
||||
*
|
||||
* @param searchReq 검색 조건 (년도, 검색어, syncStateFilter 등)
|
||||
* @return 오류 데이터 목록
|
||||
*/
|
||||
@Operation(
|
||||
summary = "오류데이터 목록 조회",
|
||||
description =
|
||||
"도엽파일 동기화 시 발생한 오류 데이터를 조회합니다. "
|
||||
+ "오류 타입: NOFILE(파일없음), NOTPAIR(페어없음), DUPLICATE(중복), SIZEERROR(size 0), TYPEERROR(형식오류)")
|
||||
@ApiResponses(
|
||||
value = {
|
||||
@ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "조회 성공",
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = MapSheetMngDto.ErrorDataDto.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@PostMapping("/error-list")
|
||||
public ApiResponseDto<Page<MapSheetMngDto.ErrorDataDto>> findMapSheetErrorList(
|
||||
@RequestBody @Valid MapSheetMngDto.ErrorSearchReq searchReq) {
|
||||
|
||||
@@ -128,6 +128,11 @@ public class MapSheetMngDto {
|
||||
@Schema(description = "년도", example = "2025")
|
||||
private Integer mngYyyy;
|
||||
|
||||
@Schema(
|
||||
description = "동기화 상태 필터 (NOFILE, NOTPAIR, DUPLICATE, SIZEERROR, TYPEERROR)",
|
||||
example = "NOFILE")
|
||||
private String syncStateFilter;
|
||||
|
||||
public Pageable toPageable() {
|
||||
if (sort != null && !sort.isEmpty()) {
|
||||
String[] sortParams = sort.split(",");
|
||||
@@ -153,6 +158,18 @@ public class MapSheetMngDto {
|
||||
private Integer mapCodeSrc;
|
||||
private String createdDttm;
|
||||
private DataState dataState;
|
||||
|
||||
@Schema(description = "동기화 상태 (NOFILE, NOTPAIR, DUPLICATE, SIZEERROR, TYPEERROR)")
|
||||
private String syncState;
|
||||
|
||||
@Schema(description = "동기화 체크 상태")
|
||||
private String syncCheckState;
|
||||
|
||||
@Schema(description = "동기화 체크 시작 시간")
|
||||
private java.time.LocalDateTime syncCheckStrtDttm;
|
||||
|
||||
@Schema(description = "동기화 체크 종료 시간")
|
||||
private java.time.LocalDateTime syncCheckEndDttm;
|
||||
}
|
||||
|
||||
@Schema(name = "DmlReturn", description = "영상관리 DML 수행 후 리턴")
|
||||
@@ -224,4 +241,27 @@ public class MapSheetMngDto {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum SyncErrorState implements EnumType {
|
||||
NOFILE("파일없음"),
|
||||
NOTPAIR("페어없음"),
|
||||
DUPLICATE("중복"),
|
||||
SIZEERROR("size 0"),
|
||||
TYPEERROR("형식오류"),
|
||||
DONE("정상");
|
||||
|
||||
private final String desc;
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import lombok.ToString;
|
||||
@ToString(exclude = "password")
|
||||
public class SignInRequest {
|
||||
|
||||
@Schema(description = "사용자 ID", example = "admin2")
|
||||
@Schema(description = "사용자 ID", example = "1234567")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "비밀번호", example = "Admin2!@#")
|
||||
|
||||
@@ -67,7 +67,7 @@ public class MembersCoreService {
|
||||
*/
|
||||
public void updateMembers(UUID uuid, MembersDto.UpdateReq updateReq) {
|
||||
MemberEntity memberEntity =
|
||||
membersRepository.findByUUID(uuid).orElseThrow(MemberNotFoundException::new);
|
||||
membersRepository.findByUUID(uuid).orElseThrow(MemberNotFoundException::new);
|
||||
|
||||
if (StringUtils.isNotBlank(updateReq.getName())) {
|
||||
memberEntity.setName(updateReq.getName());
|
||||
@@ -85,7 +85,7 @@ public class MembersCoreService {
|
||||
}
|
||||
|
||||
String password =
|
||||
CommonStringUtils.hashPassword(updateReq.getPassword(), memberEntity.getEmployeeNo());
|
||||
CommonStringUtils.hashPassword(updateReq.getPassword(), memberEntity.getEmployeeNo());
|
||||
|
||||
memberEntity.setStatus(StatusType.PENDING.getId());
|
||||
memberEntity.setLoginFailCount(0);
|
||||
@@ -103,7 +103,7 @@ public class MembersCoreService {
|
||||
*/
|
||||
public void resetPassword(String id, MembersDto.InitReq initReq) {
|
||||
MemberEntity memberEntity =
|
||||
membersRepository.findByEmployeeNo(id).orElseThrow(() -> new MemberNotFoundException());
|
||||
membersRepository.findByEmployeeNo(id).orElseThrow(() -> new MemberNotFoundException());
|
||||
|
||||
// 기존 패스워드 확인
|
||||
if (!BCrypt.checkpw(initReq.getOldPassword(), memberEntity.getPassword())) {
|
||||
@@ -111,7 +111,7 @@ public class MembersCoreService {
|
||||
}
|
||||
|
||||
String password =
|
||||
CommonStringUtils.hashPassword(initReq.getNewPassword(), memberEntity.getEmployeeNo());
|
||||
CommonStringUtils.hashPassword(initReq.getNewPassword(), memberEntity.getEmployeeNo());
|
||||
|
||||
memberEntity.setPassword(password);
|
||||
memberEntity.setStatus(StatusType.ACTIVE.getId());
|
||||
@@ -141,9 +141,9 @@ public class MembersCoreService {
|
||||
*/
|
||||
public String getUserStatus(SignInRequest request) {
|
||||
MemberEntity memberEntity =
|
||||
membersRepository
|
||||
.findByUserId(request.getUsername())
|
||||
.orElseThrow(MemberNotFoundException::new);
|
||||
membersRepository
|
||||
.findByEmployeeNo(request.getUsername())
|
||||
.orElseThrow(MemberNotFoundException::new);
|
||||
return memberEntity.getStatus();
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ public class MembersCoreService {
|
||||
*/
|
||||
public void saveLogin(UUID uuid) {
|
||||
MemberEntity memberEntity =
|
||||
membersRepository.findByUUID(uuid).orElseThrow(() -> new MemberNotFoundException());
|
||||
membersRepository.findByUUID(uuid).orElseThrow(() -> new MemberNotFoundException());
|
||||
|
||||
if (memberEntity.getFirstLoginDttm() == null) {
|
||||
memberEntity.setFirstLoginDttm(ZonedDateTime.now());
|
||||
|
||||
@@ -172,6 +172,30 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
MapSheetMngDto.@Valid ErrorSearchReq searchReq) {
|
||||
|
||||
Pageable pageable = PageRequest.of(searchReq.getPage(), searchReq.getSize());
|
||||
|
||||
BooleanBuilder whereBuilder = new BooleanBuilder();
|
||||
whereBuilder.and(mapSheetMngHstEntity.mngYyyy.eq(searchReq.getMngYyyy()));
|
||||
|
||||
// syncStateFilter 조건 추가
|
||||
if (searchReq.getSyncStateFilter() != null && !searchReq.getSyncStateFilter().isEmpty()) {
|
||||
whereBuilder.and(mapSheetMngHstEntity.syncState.eq(searchReq.getSyncStateFilter()));
|
||||
} else {
|
||||
// 기본: 오류 상태만 조회 (NOFILE, NOTPAIR, DUPLICATE, SIZEERROR, TYPEERROR)
|
||||
whereBuilder.and(
|
||||
mapSheetMngHstEntity
|
||||
.syncState
|
||||
.eq("NOFILE")
|
||||
.or(mapSheetMngHstEntity.syncState.eq("NOTPAIR"))
|
||||
.or(mapSheetMngHstEntity.syncState.eq("DUPLICATE"))
|
||||
.or(mapSheetMngHstEntity.syncState.eq("SIZEERROR"))
|
||||
.or(mapSheetMngHstEntity.syncState.eq("TYPEERROR")));
|
||||
}
|
||||
|
||||
// 검색어 조건 추가
|
||||
if (searchReq.getSearchValue() != null && !searchReq.getSearchValue().isEmpty()) {
|
||||
whereBuilder.and(mapSheetErrorSearchValue(searchReq));
|
||||
}
|
||||
|
||||
List<MapSheetMngDto.ErrorDataDto> foundContent =
|
||||
queryFactory
|
||||
.select(
|
||||
@@ -188,16 +212,17 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
mapSheetMngHstEntity.mapSheetCodeSrc,
|
||||
Expressions.stringTemplate(
|
||||
"to_char({0}, 'YYYY-MM-DD')", mapSheetMngHstEntity.createdDate),
|
||||
mapSheetMngHstEntity.dataState))
|
||||
mapSheetMngHstEntity.dataState,
|
||||
mapSheetMngHstEntity.syncState,
|
||||
mapSheetMngHstEntity.syncCheckState,
|
||||
mapSheetMngHstEntity.syncCheckStrtDttm,
|
||||
mapSheetMngHstEntity.syncCheckEndDttm))
|
||||
.from(mapSheetMngHstEntity)
|
||||
.innerJoin(mapInkx5kEntity)
|
||||
.on(mapSheetMngHstEntity.mapSheetCode.eq(mapInkx5kEntity.fid))
|
||||
.leftJoin(mapInkx50kEntity)
|
||||
.on(mapInkx5kEntity.fidK50.eq(mapInkx50kEntity.fid.longValue()))
|
||||
.where(
|
||||
mapSheetMngHstEntity.mngYyyy.eq(searchReq.getMngYyyy()),
|
||||
// mapSheetMngHstEntity.dataState.eq(MapSheetMngDto.DataState.FAIL), // 오류만 검색
|
||||
mapSheetErrorSearchValue(searchReq))
|
||||
.where(whereBuilder)
|
||||
.offset(pageable.getOffset())
|
||||
.limit(pageable.getPageSize())
|
||||
.orderBy(mapSheetMngHstEntity.createdDate.desc())
|
||||
@@ -211,10 +236,7 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
.on(mapSheetMngHstEntity.mapSheetCode.eq(mapInkx5kEntity.fid))
|
||||
.leftJoin(mapInkx50kEntity)
|
||||
.on(mapInkx5kEntity.fidK50.eq(mapInkx50kEntity.fid.longValue()))
|
||||
.where(
|
||||
mapSheetMngHstEntity.mngYyyy.eq(searchReq.getMngYyyy()),
|
||||
// mapSheetMngHstEntity.dataState.eq(MapSheetMngDto.DataState.FAIL), // 오류만 검색
|
||||
mapSheetErrorSearchValue(searchReq))
|
||||
.where(whereBuilder)
|
||||
.fetchOne();
|
||||
|
||||
return new PageImpl<>(foundContent, pageable, countQuery);
|
||||
|
||||
@@ -108,14 +108,19 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
|
||||
|
||||
public void mngHstDataSyncStateUpdate(MapSheetMngDto.MngHstDto updateReq) {
|
||||
|
||||
ZonedDateTime now = ZonedDateTime.now();
|
||||
|
||||
if (updateReq.getDataState().equals("DONE")) {
|
||||
long updateCount =
|
||||
queryFactory
|
||||
.update(mapSheetMngHstEntity)
|
||||
.set(mapSheetMngHstEntity.dataState, updateReq.getDataState())
|
||||
.set(mapSheetMngHstEntity.dataStateDttm, ZonedDateTime.now())
|
||||
.set(mapSheetMngHstEntity.dataStateDttm, now)
|
||||
.set(mapSheetMngHstEntity.syncState, updateReq.getSyncState())
|
||||
.set(mapSheetMngHstEntity.syncEndDttm, ZonedDateTime.now())
|
||||
.set(mapSheetMngHstEntity.syncEndDttm, now)
|
||||
.set(mapSheetMngHstEntity.syncCheckState, "DONE")
|
||||
.set(mapSheetMngHstEntity.syncCheckStrtDttm, now)
|
||||
.set(mapSheetMngHstEntity.syncCheckEndDttm, now)
|
||||
.where(mapSheetMngHstEntity.hstUid.eq(updateReq.getHstUid()))
|
||||
.execute();
|
||||
} else {
|
||||
@@ -123,10 +128,13 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
|
||||
queryFactory
|
||||
.update(mapSheetMngHstEntity)
|
||||
.set(mapSheetMngHstEntity.dataState, updateReq.getDataState())
|
||||
.set(mapSheetMngHstEntity.dataStateDttm, ZonedDateTime.now())
|
||||
.set(mapSheetMngHstEntity.dataStateDttm, now)
|
||||
.set(mapSheetMngHstEntity.syncState, updateReq.getSyncState())
|
||||
.set(mapSheetMngHstEntity.syncStrtDttm, ZonedDateTime.now())
|
||||
.set(mapSheetMngHstEntity.syncEndDttm, ZonedDateTime.now())
|
||||
.set(mapSheetMngHstEntity.syncStrtDttm, now)
|
||||
.set(mapSheetMngHstEntity.syncEndDttm, now)
|
||||
.set(mapSheetMngHstEntity.syncCheckState, "PROCESSING")
|
||||
.set(mapSheetMngHstEntity.syncCheckStrtDttm, now)
|
||||
.set(mapSheetMngHstEntity.syncCheckEndDttm, now)
|
||||
.where(mapSheetMngHstEntity.hstUid.eq(updateReq.getHstUid()))
|
||||
.execute();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
spring:
|
||||
config:
|
||||
activate:
|
||||
on-profile: dev
|
||||
on-profile: prod
|
||||
|
||||
jpa:
|
||||
show-sql: false
|
||||
|
||||
Reference in New Issue
Block a user