|
|
|
|
@ -6,11 +6,12 @@ import com.worker.scheduler.smg.dto.SinmungoDto;
|
|
|
|
|
import com.worker.scheduler.smg.service.DbPolling;
|
|
|
|
|
import com.worker.scheduler.smg.service.XmlSend;
|
|
|
|
|
import com.worker.util.common.commEnum.StateEnum;
|
|
|
|
|
import com.worker.util.xmlFileReader.XmlParserInterface;
|
|
|
|
|
import com.worker.util.xmlFileReader.XmlReader;
|
|
|
|
|
import com.worker.util.xmlFileReader.impl.SinmungoXmlParser;
|
|
|
|
|
import com.worker.util.fileReader.FileParserInterface;
|
|
|
|
|
import com.worker.util.fileReader.FileReader;
|
|
|
|
|
import com.worker.util.fileReader.xml.impl.SinmungoXmlFileParser;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
@ -23,9 +24,10 @@ import java.util.stream.Collectors;
|
|
|
|
|
@Component
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
@Slf4j
|
|
|
|
|
@ConditionalOnProperty(name = "scheduler.smg.enabled", havingValue = "true")
|
|
|
|
|
public class SinmungoInOutScheduler {
|
|
|
|
|
|
|
|
|
|
private final XmlReader xmlReader;
|
|
|
|
|
private final FileReader fileReader;
|
|
|
|
|
private final XmlSend xmlSend;
|
|
|
|
|
|
|
|
|
|
private final DbPolling dbPolling;
|
|
|
|
|
@ -42,8 +44,8 @@ public class SinmungoInOutScheduler {
|
|
|
|
|
SinmungoDto.SetInfo setInfo = dbPolling.findSetInfo();
|
|
|
|
|
|
|
|
|
|
//파일읽기
|
|
|
|
|
XmlParserInterface<SinmungoDto.SinmungoXml> parser = new SinmungoXmlParser();
|
|
|
|
|
List<SinmungoDto.SinmungoXml> parseResult = xmlReader.readXmlFiles(setInfo.getCpSetinfo().getStrValue2(), parser);
|
|
|
|
|
FileParserInterface<SinmungoDto.SinmungoXml> parser = new SinmungoXmlFileParser();
|
|
|
|
|
List<SinmungoDto.SinmungoXml> parseResult = fileReader.readFiles(setInfo.getCpSetinfo().getStrValue2(), parser, ".xml");
|
|
|
|
|
|
|
|
|
|
if(parseResult.isEmpty()){
|
|
|
|
|
log.info("새로 읽을 xml 없음.");
|
|
|
|
|
@ -105,8 +107,8 @@ public class SinmungoInOutScheduler {
|
|
|
|
|
//setinfo 테이블에서 esb에이전트 정보 조회
|
|
|
|
|
SinmungoDto.SetInfo setInfo = dbPolling.findSetInfo();
|
|
|
|
|
|
|
|
|
|
xmlReader.xmlFileRemove(Paths.get(setInfo.getCpSetinfo().getStrValue4()));
|
|
|
|
|
xmlReader.xmlFileRemove(Paths.get(setInfo.getEpSetinfo().getStrValue4()));
|
|
|
|
|
fileReader.xmlFileRemove(Paths.get(setInfo.getCpSetinfo().getStrValue4()));
|
|
|
|
|
fileReader.xmlFileRemove(Paths.get(setInfo.getEpSetinfo().getStrValue4()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// esb 에이전트 답변 보내기
|
|
|
|
|
|