|
|
@ -1,10 +1,13 @@
|
|
|
|
package cokr.xit.fims.base;
|
|
|
|
package cokr.xit.fims.base;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.OutputStream;
|
|
|
|
import java.io.OutputStream;
|
|
|
|
import java.io.StringWriter;
|
|
|
|
import java.io.StringWriter;
|
|
|
|
import java.net.URISyntaxException;
|
|
|
|
import java.net.URISyntaxException;
|
|
|
|
import java.net.URLDecoder;
|
|
|
|
import java.net.URLDecoder;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
@ -20,6 +23,7 @@ import javax.xml.transform.stream.StreamResult;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
|
import org.springframework.http.HttpHeaders;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
|
|
|
import org.springframework.util.ResourceUtils;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
import org.w3c.dom.Document;
|
|
|
|
import org.w3c.dom.Document;
|
|
|
@ -29,9 +33,11 @@ import org.w3c.dom.Node;
|
|
|
|
import org.w3c.dom.NodeList;
|
|
|
|
import org.w3c.dom.NodeList;
|
|
|
|
import org.xml.sax.SAXException;
|
|
|
|
import org.xml.sax.SAXException;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cokr.xit.base.file.FileInfo;
|
|
|
|
import cokr.xit.base.file.dao.FileMapper;
|
|
|
|
import cokr.xit.base.file.dao.FileMapper;
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
@Controller
|
|
|
|
@Controller
|
|
|
|
public class FileController extends cokr.xit.base.file.web.FileController {
|
|
|
|
public class FileController extends cokr.xit.base.file.web.FileController {
|
|
|
@ -41,6 +47,33 @@ public class FileController extends cokr.xit.base.file.web.FileController {
|
|
|
|
@Resource(name="fileBean")
|
|
|
|
@Resource(name="fileBean")
|
|
|
|
private FileBean fileBean;
|
|
|
|
private FileBean fileBean;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public ModelAndView getFileList(FileQuery req) {
|
|
|
|
|
|
|
|
return setCollectionInfo(
|
|
|
|
|
|
|
|
new ModelAndView("jsonView"),
|
|
|
|
|
|
|
|
fileService().getFileList(req),
|
|
|
|
|
|
|
|
"file"
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 메뉴얼을 다운로드한다.
|
|
|
|
|
|
|
|
* @return 메뉴얼 파일
|
|
|
|
|
|
|
|
* @throws Exception
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@GetMapping(name = "메뉴얼 다운로드", value = "/downloadMenual.do")
|
|
|
|
|
|
|
|
public ModelAndView downloadMenual() throws Exception {
|
|
|
|
|
|
|
|
String filePath = ("classpath:menual/메뉴얼.pptx");
|
|
|
|
|
|
|
|
File file = ResourceUtils.getFile(filePath);
|
|
|
|
|
|
|
|
ModelAndView mav = new ModelAndView("downloadView");
|
|
|
|
|
|
|
|
List<File> files = new ArrayList<>();
|
|
|
|
|
|
|
|
files.add(file);
|
|
|
|
|
|
|
|
List<FileInfo> fileInfos = new FileInfoFactory().createFileInfos(null, files);
|
|
|
|
|
|
|
|
FileInfo fileInfo = fileInfos.get(0);
|
|
|
|
|
|
|
|
mav.addObject("file", fileInfo);
|
|
|
|
|
|
|
|
return mav;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(name = "SVG 이미지 파일 색상 변경", value = "/modifySvg/**")
|
|
|
|
@GetMapping(name = "SVG 이미지 파일 색상 변경", value = "/modifySvg/**")
|
|
|
|
public void modifySvg(HttpServletRequest request, HttpServletResponse response) throws URISyntaxException, IOException, ParserConfigurationException, SAXException {
|
|
|
|
public void modifySvg(HttpServletRequest request, HttpServletResponse response) throws URISyntaxException, IOException, ParserConfigurationException, SAXException {
|
|
|
|
String requestURI = request.getRequestURI().toString();
|
|
|
|
String requestURI = request.getRequestURI().toString();
|
|
|
@ -133,13 +166,5 @@ public class FileController extends cokr.xit.base.file.web.FileController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public ModelAndView getFileList(FileQuery req) {
|
|
|
|
|
|
|
|
return setCollectionInfo(
|
|
|
|
|
|
|
|
new ModelAndView("jsonView"),
|
|
|
|
|
|
|
|
fileService().getFileList(req),
|
|
|
|
|
|
|
|
"file"
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|