|
|
@ -1,6 +1,5 @@
|
|
|
|
package cokr.xit.fims.crdn.service.bean;
|
|
|
|
package cokr.xit.fims.crdn.service.bean;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Iterator;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
@ -40,18 +39,19 @@ public class ImportServiceBean extends AbstractServiceBean implements ImportServ
|
|
|
|
if (crdns.isEmpty()) return 0;
|
|
|
|
if (crdns.isEmpty()) return 0;
|
|
|
|
|
|
|
|
|
|
|
|
List<String> intfSeqs = crdns.stream().map(Crdn::getLinkId).toList();
|
|
|
|
List<String> intfSeqs = crdns.stream().map(Crdn::getLinkId).toList();
|
|
|
|
Map<String, List<FileInfo>> byInfoKey = fileBean.getFilesOf("010", intfSeqs.toArray(new String[intfSeqs.size()])).stream()
|
|
|
|
|
|
|
|
.collect(Collectors.groupingBy(FileInfo::getInfoKey));
|
|
|
|
List<FileInfo> smgFileInfoList = fileBean.getFilesOf("010", intfSeqs.toArray(new String[intfSeqs.size()]));
|
|
|
|
|
|
|
|
Map<String, List<FileInfo>> byInfoKey = smgFileInfoList.stream().collect(Collectors.groupingBy(FileInfo::getInfoKey));
|
|
|
|
|
|
|
|
|
|
|
|
for (Crdn crdn: crdns) {
|
|
|
|
for (Crdn crdn: crdns) {
|
|
|
|
List<FileInfo> files = byInfoKey.get(crdn.getLinkId());
|
|
|
|
List<FileInfo> files = byInfoKey.get(crdn.getLinkId());
|
|
|
|
Iterator<FileInfo> it = files.iterator();
|
|
|
|
|
|
|
|
while(it.hasNext()){
|
|
|
|
for(FileInfo file : files) {
|
|
|
|
FileInfo n = it.next();
|
|
|
|
file.setInputStream(file.getInputStream()); //신규 인풋스트림 생성
|
|
|
|
if (n.getMimeType().startsWith("video")) {
|
|
|
|
file.setUrl(""); //인터페이스 첨부파일정보 제거
|
|
|
|
it.remove();
|
|
|
|
file.setPath(""); //국민신문고 첨부파일정보 제거
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
crdn.setCvlcptLinkYn("Y");
|
|
|
|
crdn.setCvlcptLinkYn("Y");
|
|
|
|
crdnBean.create(null, crdn, files);
|
|
|
|
crdnBean.create(null, crdn, files);
|
|
|
|
}
|
|
|
|
}
|
|
|
|