한글 서식파일 위치 변경

main
이범준 1 year ago
parent 49ea6bb237
commit 3353aad703

@ -9,6 +9,7 @@ import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ResourceUtils;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.file.service.FileQuery; import cokr.xit.base.file.service.FileQuery;
@ -65,7 +66,10 @@ public class Crdn01ServiceBean extends AbstractServiceBean implements CrdnServic
return crdn01Bean.removeCivilComplaint(crdnIDs); return crdn01Bean.removeCivilComplaint(crdnIDs);
} }
public ModelAndView makeFileFromHwpFormat(CrdnQuery crdnQuery, String baseFormatFilePath, String attachFormatFilePath) { public ModelAndView makeFileFromHwpFormat(CrdnQuery crdnQuery) {
String baseFormatFilePath = ("classpath:format/cvlcptOrgnl_text.hwp");
String attachFormatFilePath = ("classpath:format/cvlcptOrgnl_photo.hwp");
crdnQuery.setView("hwp"); crdnQuery.setView("hwp");
DataObject dataObject = crdn01Bean.getCivilComplaintOriginalInfo(crdnQuery); DataObject dataObject = crdn01Bean.getCivilComplaintOriginalInfo(crdnQuery);
@ -74,7 +78,10 @@ public class Crdn01ServiceBean extends AbstractServiceBean implements CrdnServic
SimpleDateFormat ymdHypenFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat ymdHypenFormat = new SimpleDateFormat("yyyy-MM-dd");
try { try {
HWPFile baseFormatFile = HWPReader.fromFile(baseFormatFilePath);
File file = ResourceUtils.getFile(baseFormatFilePath);
HWPFile baseFormatFile = HWPReader.fromFile(file);
ArrayList<String> strings = new ArrayList<String>(); ArrayList<String> strings = new ArrayList<String>();
strings.add(dataObject.string("CVLCPT_APLCNT_NM")); strings.add(dataObject.string("CVLCPT_APLCNT_NM"));
@ -136,7 +143,8 @@ public class Crdn01ServiceBean extends AbstractServiceBean implements CrdnServic
int PHOTO_COUNT_PER_PAGE = 4; int PHOTO_COUNT_PER_PAGE = 4;
for(int i=0; i < photoCnt; i += PHOTO_COUNT_PER_PAGE) { for(int i=0; i < photoCnt; i += PHOTO_COUNT_PER_PAGE) {
HWPFile attachFormatFile = HWPReader.fromFile(attachFormatFilePath); file = ResourceUtils.getFile(attachFormatFilePath);
HWPFile attachFormatFile = HWPReader.fromFile(file);
InsertingImageCell.IMPL_InsertPicture(attachFormatFile, "왼쪽위사진", fileInfoList.get(i).string("URL")); InsertingImageCell.IMPL_InsertPicture(attachFormatFile, "왼쪽위사진", fileInfoList.get(i).string("URL"));
if(i+1 < photoCnt) if(i+1 < photoCnt)
InsertingImageCell.IMPL_InsertPicture(attachFormatFile, "오른쪽위사진", fileInfoList.get(i+1).string("URL")); InsertingImageCell.IMPL_InsertPicture(attachFormatFile, "오른쪽위사진", fileInfoList.get(i+1).string("URL"));

@ -189,10 +189,9 @@ public class Crdn01Controller extends ApplicationController {
@RequestMapping(name="민원내역 원본 한글 파일 생성", value="/050/makeFileFromHwpFormat.do") @RequestMapping(name="민원내역 원본 한글 파일 생성", value="/050/makeFileFromHwpFormat.do")
public ModelAndView makeFileFromHwpFormat(CrdnQuery crdnQuery, HttpServletRequest request) { public ModelAndView makeFileFromHwpFormat(CrdnQuery crdnQuery, HttpServletRequest request) {
String baseFormatFilePath = request.getServletContext().getRealPath("resources/format/cvlcptOrgnl_text.hwp");
String attachFormatFilePath = request.getServletContext().getRealPath("resources/format/cvlcptOrgnl_photo.hwp");
return crdn01Service.makeFileFromHwpFormat(crdnQuery, baseFormatFilePath, attachFormatFilePath);
return crdn01Service.makeFileFromHwpFormat(crdnQuery);
} }
/** . /** .

Loading…
Cancel
Save