|
|
@@ -7,6 +7,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
import com.style24.batch.biz.service.TsbBatchService;
|
|
|
+import com.style24.persistence.domain.BatchLog;
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
@@ -76,7 +77,7 @@ public abstract class TsbAbstractJob<I, O, R> {
|
|
|
protected void printEnd() {
|
|
|
if (StringUtils.isNotBlank(batchId)) {
|
|
|
// 배치로그 종료 처리
|
|
|
- batchService.updateBatchLog(batchLogSq);
|
|
|
+ batchService.updateBatchLog(batchLogSq, batchId);
|
|
|
}
|
|
|
|
|
|
endTime = System.currentTimeMillis();
|
|
|
@@ -98,13 +99,20 @@ public abstract class TsbAbstractJob<I, O, R> {
|
|
|
|
|
|
if (StringUtils.isNotBlank(batchId)) {
|
|
|
// 배치명 조회
|
|
|
- batchName = batchService.getBatchName(batchId);
|
|
|
+ BatchLog batchLog = batchService.getBatchInfo(batchId);
|
|
|
|
|
|
- if (StringUtils.isBlank(batchName)) {
|
|
|
+ if (batchLog == null) {
|
|
|
log.info("{} 배치는 미사용으로 종료합니다.(TB_BATCH 테이블 참조)", batchId);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ if (batchLog.getBatchStat().equals("I")) {
|
|
|
+ log.info("{} 배치는 현재 실행중입니다.(TB_BATCH 테이블 참조)", batchId);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ batchName = batchLog.getBatchNm();
|
|
|
+
|
|
|
// 배치로그 생성
|
|
|
batchLogSq = batchService.createBatchLog(batchId);
|
|
|
}
|