|
@@ -6,33 +6,30 @@ import com.onemap.analyse.domain.vo.SelectPilotVo;
|
|
|
import com.onemap.analyse.service.IFzssService;
|
|
|
import com.onemap.analyse.domain.HgxfxEntityDTO;
|
|
|
import com.onemap.analyse.utils.UnitsUtil;
|
|
|
+import com.onemap.common.core.utils.file.FileUtils;
|
|
|
import com.onemap.common.core.web.controller.BaseController;
|
|
|
import com.onemap.common.core.web.domain.RequestResult;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/fzss")
|
|
|
public class FzssController extends BaseController {
|
|
|
-
|
|
|
@Autowired
|
|
|
private IFzssService fzssService;
|
|
|
-
|
|
|
- // /**
|
|
|
- // * 新建合规性分析
|
|
|
- // *
|
|
|
- // * @param hgxfxEntityDTO
|
|
|
- // * @return
|
|
|
- // */
|
|
|
- // @PostMapping("/AddHgxfx")
|
|
|
- // public RequestResult AddHgxfx(@RequestBody HgxfxEntityDTO hgxfxEntityDTO) throws IOException {
|
|
|
- // RequestResult res = fzssService.AddHgxfx(hgxfxEntityDTO);
|
|
|
- // return res;
|
|
|
- // }
|
|
|
+ @Value("${Hgxfx.tempWin}")
|
|
|
+ public String tempWin;
|
|
|
+ @Value("${Hgxfx.tempLinux}")
|
|
|
+ public String tempLinux;
|
|
|
|
|
|
/**
|
|
|
* 新建辅助选址
|
|
@@ -106,4 +103,25 @@ public class FzssController extends BaseController {
|
|
|
// RequestResult res = fzssService.saveWordFile(bsm, xzbsm);
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
+ @GetMapping("/DownloadReport")
|
|
|
+ public void fileDownload(String fileName, HttpServletResponse response, HttpServletRequest request) {
|
|
|
+ try {
|
|
|
+ String path = tempWin;
|
|
|
+ String realFileName = path + fileName;
|
|
|
+ response.setCharacterEncoding("utf-8");
|
|
|
+ response.setContentType("multipart/form-data");
|
|
|
+ response.setContentType("application/vnd.openxmlformats-officedocument.wordprocessingml.document");
|
|
|
+
|
|
|
+ String fileType = fileName.substring(fileName.lastIndexOf(".") + 1);
|
|
|
+ String time = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
|
|
|
+ String downloadName = time + "." + fileType;
|
|
|
+
|
|
|
+ response.setHeader("Content-Disposition", "attachment;fileName=\"" + downloadName + "\"");
|
|
|
+ FileUtils.writeBytes(realFileName, response.getOutputStream());
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ // log.error("下载文件失败", e);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|