|
|
@ -23,6 +23,7 @@ import kr.xit.framework.biz.cmm.model.CmmFileDTO;
|
|
|
|
import kr.xit.framework.biz.cmm.service.ICmmFileService;
|
|
|
|
import kr.xit.framework.biz.cmm.service.ICmmFileService;
|
|
|
|
import kr.xit.framework.support.exception.BizRuntimeException;
|
|
|
|
import kr.xit.framework.support.exception.BizRuntimeException;
|
|
|
|
import kr.xit.framework.support.util.Checks;
|
|
|
|
import kr.xit.framework.support.util.Checks;
|
|
|
|
|
|
|
|
import kr.xit.framework.support.util.CmmFileUtils;
|
|
|
|
import kr.xit.framework.support.util.constants.MessageKey;
|
|
|
|
import kr.xit.framework.support.util.constants.MessageKey;
|
|
|
|
import kr.xit.framework.support.util.xml.XmlParseUtils;
|
|
|
|
import kr.xit.framework.support.util.xml.XmlParseUtils;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
@ -134,11 +135,8 @@ public class EcCtznSttemntService implements IEcCtznSttemntService {
|
|
|
|
//-----------------------------------------------------
|
|
|
|
//-----------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void sendCtznSttemntRespons(CtznStmtDTO.CtznStmtDtl dto) {
|
|
|
|
public String sendCtznSttemntRespons(CtznStmtDTO.CtznStmtDtl dto) {
|
|
|
|
|
|
|
|
final String fileName = dto.getInterfaceSeqN()+dto.getCtznSttemntDetailSn();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<CmmFileDTO.FileDtl> fileDtlList = cmmFileService.findFilesByJobSeCodeAndJobId(
|
|
|
|
List<CmmFileDTO.FileDtl> fileDtlList = cmmFileService.findFilesByJobSeCodeAndJobId(
|
|
|
|
CmmFileDTO.FileMst.builder()
|
|
|
|
CmmFileDTO.FileMst.builder()
|
|
|
@ -146,8 +144,6 @@ public class EcCtznSttemntService implements IEcCtznSttemntService {
|
|
|
|
.fileJobId(dto.getInterfaceSeqN()+dto.getCtznSttemntDetailSn())
|
|
|
|
.fileJobId(dto.getInterfaceSeqN()+dto.getCtznSttemntDetailSn())
|
|
|
|
.build());
|
|
|
|
.build());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<File> fileList = new ArrayList<>();
|
|
|
|
List<File> fileList = new ArrayList<>();
|
|
|
|
String tgtPath = null;
|
|
|
|
String tgtPath = null;
|
|
|
|
for (CmmFileDTO.FileDtl dtl : fileDtlList) {
|
|
|
|
for (CmmFileDTO.FileDtl dtl : fileDtlList) {
|
|
|
@ -188,8 +184,9 @@ public class EcCtznSttemntService implements IEcCtznSttemntService {
|
|
|
|
.build();
|
|
|
|
.build();
|
|
|
|
String xmlStr = XmlParseUtils.writeObjectToXml(sendDto, NatlNewspaperSendXmlDTO.class);
|
|
|
|
String xmlStr = XmlParseUtils.writeObjectToXml(sendDto, NatlNewspaperSendXmlDTO.class);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// xml 응답데이타
|
|
|
|
byte[] bytes = xmlStr.getBytes();
|
|
|
|
byte[] bytes = xmlStr.getBytes();
|
|
|
|
Path path = Paths.get(tgtPath + "/res.xml");
|
|
|
|
Path path = Paths.get(tgtPath + fileName + ".xml");
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Files.write(path, bytes);
|
|
|
|
Files.write(path, bytes);
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
@ -198,6 +195,12 @@ public class EcCtznSttemntService implements IEcCtznSttemntService {
|
|
|
|
fileList.add(path.toFile());
|
|
|
|
fileList.add(path.toFile());
|
|
|
|
|
|
|
|
|
|
|
|
log.debug("{}", fileList);
|
|
|
|
log.debug("{}", fileList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String zipFullFileName = CmmFileUtils.compressZip(fileList, tgtPath, fileName+".zip");
|
|
|
|
|
|
|
|
fileList.forEach(f -> {
|
|
|
|
|
|
|
|
if(f.exists()) f.delete();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return zipFullFileName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|