|
|
@ -6,6 +6,7 @@ import java.util.ArrayList;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Iterator;
|
|
|
|
import java.util.Iterator;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
@ -13,13 +14,10 @@ import javax.annotation.Resource;
|
|
|
|
import org.assertj.core.util.Arrays;
|
|
|
|
import org.assertj.core.util.Arrays;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.util.ResourceUtils;
|
|
|
|
import org.springframework.util.ResourceUtils;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cokr.xit.base.file.FileInfo;
|
|
|
|
import cokr.xit.base.file.FileInfo;
|
|
|
|
import cokr.xit.base.file.service.FileQuery;
|
|
|
|
import cokr.xit.base.file.service.FileQuery;
|
|
|
|
import cokr.xit.base.file.service.bean.FileBean;
|
|
|
|
import cokr.xit.base.file.service.bean.FileBean;
|
|
|
|
import cokr.xit.base.file.web.FileInfoFactory;
|
|
|
|
|
|
|
|
import cokr.xit.fims.cmmn.CmmnUtil;
|
|
|
|
import cokr.xit.fims.cmmn.CmmnUtil;
|
|
|
|
import cokr.xit.fims.cmmn.CrdnSttsHstry;
|
|
|
|
import cokr.xit.fims.cmmn.CrdnSttsHstry;
|
|
|
|
import cokr.xit.fims.cmmn.hwp.AddingParagraphBetweenHWPFile;
|
|
|
|
import cokr.xit.fims.cmmn.hwp.AddingParagraphBetweenHWPFile;
|
|
|
@ -161,7 +159,7 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public ModelAndView makeFileFromHwpFormat(CrdnQuery crdnQuery) {
|
|
|
|
public Map<String, String> makeFileFromHwpFormat(CrdnQuery crdnQuery) {
|
|
|
|
String baseFormatFilePath = ("classpath:format/cvlcptOrgnl_text.hwp");
|
|
|
|
String baseFormatFilePath = ("classpath:format/cvlcptOrgnl_text.hwp");
|
|
|
|
String attachFormatFilePath = ("classpath:format/cvlcptOrgnl_photo.hwp");
|
|
|
|
String attachFormatFilePath = ("classpath:format/cvlcptOrgnl_photo.hwp");
|
|
|
|
|
|
|
|
|
|
|
@ -225,7 +223,7 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
|
|
|
|
} else if(linkTblNm.equals("TB_SAEOL")) {
|
|
|
|
} else if(linkTblNm.equals("TB_SAEOL")) {
|
|
|
|
fileQuery.setInfoType("020");
|
|
|
|
fileQuery.setInfoType("020");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return new ModelAndView("errorView");
|
|
|
|
throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fileQuery.setInfoKeys(dataObject.string("LINK_ID"));
|
|
|
|
fileQuery.setInfoKeys(dataObject.string("LINK_ID"));
|
|
|
@ -258,14 +256,16 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String downlaodFileName = "민원내역원본_" + currentTime + ".hwp";
|
|
|
|
String downlaodFileName = "민원내역원본_" + currentTime + ".hwp";
|
|
|
|
ModelAndView mav = new ModelAndView("jsonView");
|
|
|
|
Map<String, String> result = Map.of(
|
|
|
|
mav.addObject("filePath", resultPath);
|
|
|
|
"filePath", resultPath,
|
|
|
|
mav.addObject("fileName", downlaodFileName);
|
|
|
|
"fileName", downlaodFileName
|
|
|
|
return mav;
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
|
|
|
|
return new ModelAndView("errorView");
|
|
|
|
throw new RuntimeException("한글 파일 출력 중 오류가 발생하였습니다.");
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -318,7 +318,7 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public boolean save(Crdn crdn, List<FileInfo> newFileInfoList) {
|
|
|
|
public boolean update(Crdn crdn, List<FileInfo> newFileInfoList) {
|
|
|
|
boolean saved;
|
|
|
|
boolean saved;
|
|
|
|
|
|
|
|
|
|
|
|
int fileInsertEffected = 0;
|
|
|
|
int fileInsertEffected = 0;
|
|
|
@ -340,10 +340,9 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public boolean create(Crdn crdn, MultipartFile[] newFileList) {
|
|
|
|
public boolean create(Crdn crdn, List<FileInfo> fileInfoList) {
|
|
|
|
List<FileInfo> fileInfoList = new ArrayList<FileInfo>();
|
|
|
|
|
|
|
|
if(newFileList != null) {
|
|
|
|
if(fileInfoList != null && !fileInfoList.isEmpty()) {
|
|
|
|
fileInfoList = new FileInfoFactory().makeFileInfos(null, newFileList);
|
|
|
|
|
|
|
|
crdn.setAtchFileCnt(fileInfoList.size());
|
|
|
|
crdn.setAtchFileCnt(fileInfoList.size());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
crdn.setAtchFileCnt(0);
|
|
|
|
crdn.setAtchFileCnt(0);
|
|
|
@ -406,7 +405,7 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!fileInfoList.isEmpty()) {
|
|
|
|
if(fileInfoList != null && !fileInfoList.isEmpty()) {
|
|
|
|
fileInfoList.forEach(fileInfo -> fileInfo.setInfoType(Crdn.INF_TYPE).setInfoKey(crdn.getCrdnId()));
|
|
|
|
fileInfoList.forEach(fileInfo -> fileInfo.setInfoType(Crdn.INF_TYPE).setInfoKey(crdn.getCrdnId()));
|
|
|
|
fileBean.create(fileInfoList);
|
|
|
|
fileBean.create(fileInfoList);
|
|
|
|
}
|
|
|
|
}
|
|
|
|