|
|
@ -1,7 +1,9 @@
|
|
|
|
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;
|
|
|
|
|
|
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
@ -11,6 +13,9 @@ 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.FileInfo.Relation;
|
|
|
|
|
|
|
|
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;
|
|
|
@ -197,7 +202,33 @@ public class Crdn01Controller extends ApplicationController {
|
|
|
|
@RequestMapping(name="민원자료 저장", value="/020/save.do")
|
|
|
|
@RequestMapping(name="민원자료 저장", value="/020/save.do")
|
|
|
|
public ModelAndView saveCivilComplaint(Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) {
|
|
|
|
public ModelAndView saveCivilComplaint(Crdn crdn, MultipartFile[] newFileList, MultipartFile[] modifyFileList) {
|
|
|
|
|
|
|
|
|
|
|
|
boolean saved = true;// TODO : crdn01Service.saveCivilComplaint
|
|
|
|
boolean saved = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<FileInfo> newFileInfoList = new ArrayList<FileInfo>();
|
|
|
|
|
|
|
|
if(newFileList != null || modifyFileList != null) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Relation relation = new Relation();
|
|
|
|
|
|
|
|
relation.setInfoType(crdn.INF_TYPE);
|
|
|
|
|
|
|
|
relation.setInfoKey(crdn.getCrdnId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(newFileList != null) {
|
|
|
|
|
|
|
|
newFileInfoList = new FileInfoFactory().makeFileInfos(relation, newFileList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(modifyFileList != null) {
|
|
|
|
|
|
|
|
newFileInfoList.addAll(new FileInfoFactory().makeFileInfos(relation, modifyFileList));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(crdn.getDeleteFileKeyList() == null) {
|
|
|
|
|
|
|
|
crdn.setDeleteFileKeyList(crdn.getModifyFileKeyList());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
String[] arr1 = crdn.getDeleteFileKeyList();
|
|
|
|
|
|
|
|
String[] arr2 = crdn.getModifyFileKeyList();
|
|
|
|
|
|
|
|
String[] sumArr = Stream.of(arr1, arr2).flatMap(Stream::of).toArray(String[]::new);
|
|
|
|
|
|
|
|
crdn.setDeleteFileKeyList(sumArr);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
saved = crdn01Service.saveCivilComplaint(crdn, newFileInfoList);
|
|
|
|
|
|
|
|
|
|
|
|
return new ModelAndView("jsonView")
|
|
|
|
return new ModelAndView("jsonView")
|
|
|
|
.addObject("saved", saved);
|
|
|
|
.addObject("saved", saved);
|
|
|
|