사용자 수정 상태값 추가

This commit is contained in:
2025-12-12 11:50:23 +09:00
parent b76b0311d0
commit 2a6e530dd1
4 changed files with 28 additions and 21 deletions

View File

@@ -11,7 +11,6 @@ import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.stereotype.Component;
@Component
@@ -19,7 +18,6 @@ import org.springframework.stereotype.Component;
public class CustomAuthenticationProvider implements AuthenticationProvider {
private final MembersRepository membersRepository;
private final UserDetailsService userDetailsService;
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {

View File

@@ -153,10 +153,15 @@ public class MembersDto {
@Size(max = 255)
private String tempPassword;
public UpdateReq(String employeeNo, String name, String tempPassword) {
@Schema(description = "상태", example = "ACTIVE")
@EnumValid(enumClass = StatusType.class, message = "status는 ACTIVE, INACTIVE, DELETED 만 가능합니다.")
private String status;
public UpdateReq(String employeeNo, String name, String tempPassword, String status) {
this.employeeNo = employeeNo;
this.name = name;
this.tempPassword = tempPassword;
this.status = status;
}
}

View File

@@ -34,20 +34,20 @@ public class MapSheetMngCoreService {
private String activeEnv;
public Page<MapSheetMngDto.ErrorDataDto> findMapSheetErrorList(
MapSheetMngDto.@Valid searchReq searchReq) {
MapSheetMngDto.@Valid searchReq searchReq) {
return mapSheetMngRepository.findMapSheetErrorList(searchReq);
}
public Page<MapSheetMngDto.MngDto> findMapSheetMngList(
MapSheetMngDto.@Valid searchReq searchReq) {
MapSheetMngDto.@Valid searchReq searchReq) {
return mapSheetMngRepository.findMapSheetMngList(searchReq);
}
public MapSheetMngDto.DmlReturn uploadFile(MultipartFile file, Long hstUid) {
MapSheetMngHstEntity entity =
mapSheetMngRepository
.findMapSheetMngHstInfo(hstUid)
.orElseThrow(() -> new EntityNotFoundException("해당 이력이 존재하지 않습니다."));
mapSheetMngRepository
.findMapSheetMngHstInfo(hstUid)
.orElseThrow(() -> new EntityNotFoundException("해당 이력이 존재하지 않습니다."));
String localPath = "";
String rootDir = ORIGINAL_IMAGES_PATH + "/" + entity.getMngYyyy();
@@ -92,10 +92,10 @@ public class MapSheetMngCoreService {
if (!Objects.isNull(hstUidList) && !hstUidList.isEmpty()) {
for (Long hstUid : hstUidList) {
Optional<MapSheetMngHstEntity> entity =
Optional.ofNullable(
mapSheetMngRepository
.findMapSheetMngHstInfo(hstUid)
.orElseThrow(EntityNotFoundException::new));
Optional.ofNullable(
mapSheetMngRepository
.findMapSheetMngHstInfo(hstUid)
.orElseThrow(EntityNotFoundException::new));
// TODO: local TEST 시 각자 경로 수정하기
// TODO: application.yml 에 active profile : local 로 임시 변경하여 테스트
@@ -127,10 +127,10 @@ public class MapSheetMngCoreService {
if (!Objects.isNull(hstUidList) && !hstUidList.isEmpty()) {
for (Long hstUid : hstUidList) {
Optional<MapSheetMngHstEntity> entity =
Optional.ofNullable(
mapSheetMngRepository
.findMapSheetMngHstInfo(hstUid)
.orElseThrow(EntityNotFoundException::new));
Optional.ofNullable(
mapSheetMngRepository
.findMapSheetMngHstInfo(hstUid)
.orElseThrow(EntityNotFoundException::new));
// entity.get().updateUseInference(true);
}
@@ -151,10 +151,10 @@ public class MapSheetMngCoreService {
// 모든 파일명을 Set으로 저장
Set<String> fileNames =
paths
.filter(Files::isRegularFile)
.map(p -> p.getFileName().toString())
.collect(Collectors.toSet());
paths
.filter(Files::isRegularFile)
.map(p -> p.getFileName().toString())
.collect(Collectors.toSet());
// 모든 확장자 파일 존재 여부 확인
for (String ext : extensions) {

View File

@@ -81,10 +81,14 @@ public class MembersCoreService {
memberEntity.setTempPassword(updateReq.getTempPassword().trim());
}
if (StringUtils.isNotBlank(memberEntity.getEmployeeNo())) {
if (StringUtils.isNotBlank(updateReq.getEmployeeNo())) {
memberEntity.setEmployeeNo(updateReq.getEmployeeNo());
}
if (StringUtils.isNotBlank(updateReq.getStatus())) {
memberEntity.setStatus(updateReq.getStatus());
}
memberEntity.setUpdtrUid(userUtil.getId());
membersRepository.save(memberEntity);