라벨러,검수자 최종로그인 28일 넘으면 사용중지 처리
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package com.kamco.cd.kamcoback.scheduler.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
public class MemberInactiveJobDto {
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@RequiredArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class MemberInfo {
|
||||
|
||||
private Long id;
|
||||
private String employeeNo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.kamco.cd.kamcoback.scheduler.service;
|
||||
|
||||
import com.kamco.cd.kamcoback.postgres.core.MemberInactiveJobCoreService;
|
||||
import com.kamco.cd.kamcoback.scheduler.dto.MemberInactiveJobDto.MemberInfo;
|
||||
import jakarta.transaction.Transactional;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Log4j2
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class MemberInactiveJobService {
|
||||
|
||||
private final MemberInactiveJobCoreService memberInactiveJobCoreService;
|
||||
|
||||
@Value("${spring.profiles.active}")
|
||||
private String profile;
|
||||
|
||||
private boolean isLocalProfile() {
|
||||
return "local".equalsIgnoreCase(profile);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Scheduled(cron = "0 0 1 * * *")
|
||||
public void memberActive28daysToInactive() {
|
||||
|
||||
// if (isLocalProfile()) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
try {
|
||||
List<MemberInfo> list = memberInactiveJobCoreService.findInactiveLabelerReviewer();
|
||||
|
||||
if (list.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (MemberInfo memberInfo : list) {
|
||||
memberInactiveJobCoreService.updateMemberStatusInactive(memberInfo);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("배치 처리 중 예외", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user