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