단속 관리 미비점 수정

main
이범준 1 year ago
parent 9f97ac74a9
commit 2e1ad53e8a

@ -1,9 +1,7 @@
package cokr.xit.fims.crdn.service; package cokr.xit.fims.crdn.service;
import java.util.List; import java.util.List;
import java.util.Map;
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.fims.crdn.Crdn; import cokr.xit.fims.crdn.Crdn;
@ -31,19 +29,22 @@ public interface CrdnService {
* @param crdn , newFileList * @param crdn , newFileList
* @return * @return
*/ */
boolean create(Crdn crdn, MultipartFile[] newFileList); boolean create(Crdn crdn, List<FileInfo> newFileInfoList);
/** . /** .
* @param crdn , newFileInfoList * @param crdn , newFileInfoList
* @return * @return
*/ */
boolean save(Crdn crdn, List<FileInfo> newFileInfoList); boolean update(Crdn crdn, List<FileInfo> newFileInfoList);
/** . /** .
* @param crdnQuery * @param crdnQuery
* @return mav * @return map
* <ul><li>filePath: </li>
* <li>fileName: </li>
* </ul>
*/ */
ModelAndView makeFileFromHwpFormat(CrdnQuery crdnQuery); Map<String, String> makeFileFromHwpFormat(CrdnQuery crdnQuery);
DataObject getCivilComplaintOriginalInfo(CrdnQuery req); DataObject getCivilComplaintOriginalInfo(CrdnQuery req);

@ -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);
} }

@ -229,7 +229,7 @@ public class Crdn01Controller extends ApplicationController {
} }
} }
saved = crdnService.save(crdn, newFileInfoList); saved = crdnService.update(crdn, newFileInfoList);
return new ModelAndView("jsonView") return new ModelAndView("jsonView")
.addObject("saved", saved); .addObject("saved", saved);
@ -241,9 +241,10 @@ 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) {
Map<String,String> result = crdnService.makeFileFromHwpFormat(crdnQuery);
ModelAndView mav = new ModelAndView("jsonView");
return crdnService.makeFileFromHwpFormat(crdnQuery); mav.addAllObjects(result);
return mav;
} }
/** . /** .

@ -1,5 +1,6 @@
package cokr.xit.fims.crdn.web; package cokr.xit.fims.crdn.web;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -12,6 +13,8 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.code.CommonCode; import cokr.xit.base.code.CommonCode;
import cokr.xit.base.file.FileInfo;
import cokr.xit.base.file.web.FileInfoFactory;
import cokr.xit.base.web.ApplicationController; import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.crdn.Crdn; import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.CrdnQuery; import cokr.xit.fims.crdn.CrdnQuery;
@ -126,7 +129,12 @@ public class Crdn05Controller extends ApplicationController {
crdn.setCrdnRegSeCd("01"); crdn.setCrdnRegSeCd("01");
crdn.setCrdnInptSeCd("03");//TODO : 사용자 기관의 시청,구청 구분 crdn.setCrdnInptSeCd("03");//TODO : 사용자 기관의 시청,구청 구분
saved = crdnService.create(crdn, newFileList); List<FileInfo> fileInfoList = new ArrayList<FileInfo>();
if(newFileList != null && newFileList.length > 0) {
fileInfoList = new FileInfoFactory().makeFileInfos(null, newFileList);
}
saved = crdnService.create(crdn, fileInfoList);
return new ModelAndView("jsonView") return new ModelAndView("jsonView")

@ -60,7 +60,7 @@ public class DpvController {
@PostMapping(name = "표지정보 미확인 자료 수정", value = "/030/update.do") @PostMapping(name = "표지정보 미확인 자료 수정", value = "/030/update.do")
public ModelAndView update(Crdn crdn) { public ModelAndView update(Crdn crdn) {
crdn.setUpdateInfomation("tagInformationUndefinedData"); crdn.setUpdateInfomation("tagInformationUndefinedData");
boolean saved = crdnService.save(crdn, null); boolean saved = crdnService.update(crdn, null);
return new ModelAndView("jsonView") return new ModelAndView("jsonView")
.addObject("saved", saved); .addObject("saved", saved);
} }

Loading…
Cancel
Save