|
|
|
@ -5,6 +5,8 @@ import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import java.util.stream.IntStream;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
@ -232,7 +234,7 @@ public class AddsNimsController extends ApplicationController {
|
|
|
|
|
@RequestMapping(value="/makeDisposeResultReportHwp.do", name="폐기결과보고서 HWP파일 생성")
|
|
|
|
|
public ModelAndView makeDisposeResultReportHwp(String dtls) {
|
|
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
|
|
mav.setViewName("jsonView");
|
|
|
|
|
mav.setViewName("downloadView");
|
|
|
|
|
|
|
|
|
|
List<DataObject> dataForDoc = fromJson(dtls, new TypeReference<ArrayList<DataObject>>() {});
|
|
|
|
|
|
|
|
|
@ -271,7 +273,14 @@ public class AddsNimsController extends ApplicationController {
|
|
|
|
|
//1.한글문서파일 데이터 입력
|
|
|
|
|
DisposeResultReport form = new DisposeResultReport(print, printOption, dataForDoc);
|
|
|
|
|
//2.한글문서파일 생성
|
|
|
|
|
String resultFilePath = form.makeFile().andGetPath();
|
|
|
|
|
form.makeFile();
|
|
|
|
|
//3.DB 저장, 스토리지 저장
|
|
|
|
|
List<String> dscdmngIds = IntStream.rangeClosed(1, dataForDoc.size()).boxed().map(i -> {
|
|
|
|
|
return dataForDoc.get(i-1).string("dscdmngId");
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
boolean allEqual = dscdmngIds.stream().distinct().count() <= 1;
|
|
|
|
|
if(allEqual) {
|
|
|
|
|
String resultFilePath = form.andGetPath();
|
|
|
|
|
File file = new File(resultFilePath);
|
|
|
|
|
String newFileId = "";
|
|
|
|
|
String before = "";
|
|
|
|
@ -290,10 +299,10 @@ public class AddsNimsController extends ApplicationController {
|
|
|
|
|
newFileId = fileInfo.getId();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
file.delete();
|
|
|
|
|
|
|
|
|
|
mav.addObject("fileId", newFileId);
|
|
|
|
|
mav.addObject("saved", true);
|
|
|
|
|
}
|
|
|
|
|
//4.다운로드
|
|
|
|
|
HashMap<String, Object> result = form.andDownload();
|
|
|
|
|
mav.addAllObjects(result);
|
|
|
|
|
return mav;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -302,7 +311,7 @@ public class AddsNimsController extends ApplicationController {
|
|
|
|
|
@RequestMapping(value="/makeDisposeProcessDetailsHwp.do", name="폐기 처리 내역 및 사진 HWP파일 생성")
|
|
|
|
|
public ModelAndView makeDisposeProcessDetailsHwp(String dtls) {
|
|
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
|
|
mav.setViewName("jsonView");
|
|
|
|
|
mav.setViewName("downloadView");
|
|
|
|
|
|
|
|
|
|
List<DataObject> dataForDoc = fromJson(dtls, new TypeReference<ArrayList<DataObject>>() {});
|
|
|
|
|
|
|
|
|
@ -383,7 +392,14 @@ public class AddsNimsController extends ApplicationController {
|
|
|
|
|
//1.한글문서파일 데이터 입력
|
|
|
|
|
DisposeProcessDetails form = new DisposeProcessDetails(print, printOption, dataForDoc, partitions);
|
|
|
|
|
//2.한글문서파일 생성
|
|
|
|
|
String resultFilePath = form.makeFile().andGetPath();
|
|
|
|
|
form.makeFile();
|
|
|
|
|
//3.DB 저장, 스토리지 저장
|
|
|
|
|
List<String> dscdmngIds = IntStream.rangeClosed(1, dataForDoc.size()).boxed().map(i -> {
|
|
|
|
|
return dataForDoc.get(i-1).string("dscdmngId");
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
boolean allEqual = dscdmngIds.stream().distinct().count() <= 1;
|
|
|
|
|
if(allEqual) {
|
|
|
|
|
String resultFilePath = form.andGetPath();
|
|
|
|
|
File file = new File(resultFilePath);
|
|
|
|
|
String newFileId = "";
|
|
|
|
|
before = "";
|
|
|
|
@ -402,10 +418,11 @@ public class AddsNimsController extends ApplicationController {
|
|
|
|
|
newFileId = fileInfo.getId();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
file.delete();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mav.addObject("fileId", newFileId);
|
|
|
|
|
mav.addObject("saved", true);
|
|
|
|
|
//4.다운로드
|
|
|
|
|
HashMap<String, Object> result = form.andDownload();
|
|
|
|
|
mav.addAllObjects(result);
|
|
|
|
|
return mav;
|
|
|
|
|
}
|
|
|
|
|
//-------------------------------------------------------------------------------------------------
|
|
|
|
|