|
|
|
@ -8,11 +8,9 @@ import java.io.StringWriter;
|
|
|
|
|
import java.net.URISyntaxException;
|
|
|
|
|
import java.net.URLDecoder;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.function.Consumer;
|
|
|
|
|
import java.util.regex.Matcher;
|
|
|
|
|
|
|
|
|
@ -44,15 +42,11 @@ import org.w3c.dom.Node;
|
|
|
|
|
import org.w3c.dom.NodeList;
|
|
|
|
|
import org.xml.sax.SAXException;
|
|
|
|
|
|
|
|
|
|
import cokr.xit.base.file.FileInfo;
|
|
|
|
|
import cokr.xit.base.file.FileInfo.Relation;
|
|
|
|
|
import cokr.xit.base.file.dao.FileMapper;
|
|
|
|
|
import cokr.xit.base.file.service.FileQuery;
|
|
|
|
|
import cokr.xit.base.file.service.bean.FileBean;
|
|
|
|
|
import cokr.xit.base.file.web.FileInfoFactory;
|
|
|
|
|
import cokr.xit.fims.crdn.Crdn;
|
|
|
|
|
import cokr.xit.fims.crdn.dao.CrdnInfoMapper;
|
|
|
|
|
import cokr.xit.fims.crdn.service.CrdnService;
|
|
|
|
|
import cokr.xit.fims.sprt.Sprt;
|
|
|
|
|
import cokr.xit.fims.sprt.service.bean.MediaBean;
|
|
|
|
|
import cokr.xit.foundation.Downloadable;
|
|
|
|
@ -72,9 +66,6 @@ public class FileController extends cokr.xit.base.file.web.FileController {
|
|
|
|
|
@Resource(name="mediaBean")
|
|
|
|
|
private MediaBean mediaBean;
|
|
|
|
|
|
|
|
|
|
@Resource(name="crdnService")
|
|
|
|
|
private CrdnService crdnService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ModelAndView getFileList(FileQuery req) {
|
|
|
|
|
ModelAndView mav = new ModelAndView("jsonView");
|
|
|
|
@ -141,144 +132,6 @@ public class FileController extends cokr.xit.base.file.web.FileController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping(name= "단속 사진 추가", value = "/insertCrdnImageFile.do")
|
|
|
|
|
public ModelAndView insertCrdnImageFile(String crdnId, int atchFileCnt, MultipartFile[] newFileList) {
|
|
|
|
|
|
|
|
|
|
boolean saved = false;
|
|
|
|
|
String retMessage = "[F] ";
|
|
|
|
|
if(newFileList == null || newFileList.length == 0 || newFileList[0] == null || newFileList[0].isEmpty()) {
|
|
|
|
|
throw new RuntimeException("파일 업로드 오류");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Relation relation = new Relation().setInfoType(Crdn.INF_TYPE).setInfoKey(crdnId);
|
|
|
|
|
List<FileInfo> newFileInfoList = new FileInfoFactory().makeFileInfos(relation, newFileList);
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> processList = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
int newFileSort = 999;
|
|
|
|
|
for(FileInfo newFileInfo : newFileInfoList) {
|
|
|
|
|
newFileInfo.setSortOrder(newFileSort++);
|
|
|
|
|
processList.add(Map.of("process", "insert", "obj", newFileInfo));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Crdn crdn = new Crdn();
|
|
|
|
|
crdn.setCrdnId(crdnId);
|
|
|
|
|
crdn.setAtchFileCnt(atchFileCnt);
|
|
|
|
|
retMessage = crdnService.changeCrdnImageFile(crdn, processList);
|
|
|
|
|
|
|
|
|
|
if (retMessage.contains("[S]")) {
|
|
|
|
|
saved = true;
|
|
|
|
|
} else {
|
|
|
|
|
saved = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new ModelAndView("jsonView")
|
|
|
|
|
.addObject("saved", saved)
|
|
|
|
|
.addObject("retMessage", retMessage);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping(name= "단속 사진 수정", value = "/updateCrdnImageFile.do")
|
|
|
|
|
public ModelAndView updateCrdnImageFile(String crdnId, int atchFileCnt,
|
|
|
|
|
String beforeKey, int beforeOrder, MultipartFile modifyFile) {
|
|
|
|
|
|
|
|
|
|
boolean saved = false;
|
|
|
|
|
String retMessage = "[F] ";
|
|
|
|
|
|
|
|
|
|
if(modifyFile == null || modifyFile.isEmpty()) {
|
|
|
|
|
throw new RuntimeException("파일 업로드 오류");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Relation relation = new Relation().setInfoType(Crdn.INF_TYPE).setInfoKey(crdnId);
|
|
|
|
|
FileInfo modifyFileInfo = new FileInfoFactory().make(relation, modifyFile);
|
|
|
|
|
modifyFileInfo.setSortOrder(beforeOrder);
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> processList = new ArrayList<>();
|
|
|
|
|
processList.add(Map.of("process", "delete", "key", beforeKey));
|
|
|
|
|
processList.add(Map.of("process", "insert", "obj", modifyFileInfo));
|
|
|
|
|
|
|
|
|
|
Crdn crdn = new Crdn();
|
|
|
|
|
crdn.setCrdnId(crdnId);
|
|
|
|
|
crdn.setAtchFileCnt(atchFileCnt);
|
|
|
|
|
retMessage = crdnService.changeCrdnImageFile(crdn, processList);
|
|
|
|
|
|
|
|
|
|
if (retMessage.contains("[S]")) {
|
|
|
|
|
saved = true;
|
|
|
|
|
} else {
|
|
|
|
|
saved = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new ModelAndView("jsonView")
|
|
|
|
|
.addObject("saved", saved)
|
|
|
|
|
.addObject("retMessage", retMessage);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping(name= "단속 사진 삭제", value = "/deleteCrdnImageFile.do")
|
|
|
|
|
public ModelAndView deleteCrdnImageFile(String crdnId, int atchFileCnt, String[] deleteKeys) {
|
|
|
|
|
|
|
|
|
|
boolean saved = false;
|
|
|
|
|
String retMessage = "[F] ";
|
|
|
|
|
|
|
|
|
|
if(deleteKeys == null || deleteKeys.length == 0 || deleteKeys[0] == null || deleteKeys[0].isEmpty()) {
|
|
|
|
|
throw new RuntimeException("파일 삭제 오류");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> processList = new ArrayList<>();
|
|
|
|
|
for(String deleteKey : deleteKeys) {
|
|
|
|
|
processList.add(Map.of("process", "delete", "key", deleteKey));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Crdn crdn = new Crdn();
|
|
|
|
|
crdn.setCrdnId(crdnId);
|
|
|
|
|
crdn.setAtchFileCnt(atchFileCnt);
|
|
|
|
|
retMessage = crdnService.changeCrdnImageFile(crdn, processList);
|
|
|
|
|
|
|
|
|
|
if (retMessage.contains("[S]")) {
|
|
|
|
|
saved = true;
|
|
|
|
|
} else {
|
|
|
|
|
saved = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new ModelAndView("jsonView")
|
|
|
|
|
.addObject("saved", saved)
|
|
|
|
|
.addObject("retMessage", retMessage);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping(name= "단속 사진 순서 변경", value = "/changeOrderCrdnImageFile.do")
|
|
|
|
|
public ModelAndView changeOrderCrdnImageFile(String crdnId, int atchFileCnt, String[] orderedKeys) {
|
|
|
|
|
|
|
|
|
|
boolean saved = false;
|
|
|
|
|
String retMessage = "[F] ";
|
|
|
|
|
|
|
|
|
|
if(orderedKeys == null || orderedKeys.length == 0 || orderedKeys[0] == null || orderedKeys[0].isEmpty()) {
|
|
|
|
|
throw new RuntimeException("파일 순서 변경 오류");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> processList = new ArrayList<>();
|
|
|
|
|
for(String orderedKey : orderedKeys) {
|
|
|
|
|
processList.add(Map.of("process", "order", "key", orderedKey));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Crdn crdn = new Crdn();
|
|
|
|
|
crdn.setCrdnId(crdnId);
|
|
|
|
|
crdn.setAtchFileCnt(atchFileCnt);
|
|
|
|
|
retMessage = crdnService.changeCrdnImageFile(crdn, processList);
|
|
|
|
|
|
|
|
|
|
if (retMessage.contains("[S]")) {
|
|
|
|
|
saved = true;
|
|
|
|
|
} else {
|
|
|
|
|
saved = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new ModelAndView("jsonView")
|
|
|
|
|
.addObject("saved", saved)
|
|
|
|
|
.addObject("retMessage", retMessage);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 메뉴얼을 다운로드한다.
|
|
|
|
|
* @return 메뉴얼 파일
|
|
|
|
|
* @throws Exception
|
|
|
|
|