소스 검색

Update for the user function

master
B.E.N.S.O.N 1 개월 전
부모
커밋
e49266d332
1개의 변경된 파일13개의 추가작업 그리고 0개의 파일을 삭제
  1. +13
    -0
      src/main/java/com/ffii/fpsms/modules/user/service/UserService.java

+ 13
- 0
src/main/java/com/ffii/fpsms/modules/user/service/UserService.java 파일 보기

@@ -17,6 +17,7 @@ import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;

import com.ffii.core.exception.NotFoundException;
import com.ffii.core.exception.UnprocessableEntityException;
@@ -275,4 +276,16 @@ public class UserService extends AbstractBaseEntityService<User, Long, UserRepos
public List<UserCombo> getEscalationCombo() {
return userRepository.findUserComboByTitleNotNullAndDepartmentNotNullAndNameNotNullAndDeletedFalse();
}

@Transactional(rollbackFor = Exception.class)
@Override
public void markDelete(User entity) {
Assert.notNull(entity, "entity must not be null");
// Use direct SQL update to bypass JPA validation during soft delete
// This prevents ConstraintViolationException when password field has @NotBlank constraint
jdbcDao.executeUpdate(
"UPDATE `user` SET deleted = 1 WHERE id = :id",
Map.of("id", entity.getId())
);
}
}

불러오는 중...
취소
저장