ZhcxSeaBindProofController.java 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package com.rongwei.bsserver.controller;
  2. import com.rongwei.bscommon.sys.service.ZhcxSeaBindProofService;
  3. import com.rongwei.bsentity.domain.ZhcxInspectionReportManageDo;
  4. import com.rongwei.bsentity.domain.ZhcxSeaBindProofDo;
  5. import com.rongwei.rwcommoncomponent.file.service.SysFileItemService;
  6. import com.rongwei.rwcommonentity.commonservers.domain.SysFileItemDo;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.core.io.FileSystemResource;
  9. import org.springframework.http.HttpHeaders;
  10. import org.springframework.http.HttpStatus;
  11. import org.springframework.http.ResponseEntity;
  12. import org.springframework.web.bind.annotation.*;
  13. import javax.annotation.Resource;
  14. import javax.servlet.http.HttpServletResponse;
  15. import java.io.File;
  16. import java.util.Map;
  17. @RestController
  18. @RequestMapping("/zhcxSeaBindProof")
  19. public class ZhcxSeaBindProofController {
  20. @Autowired
  21. ZhcxSeaBindProofService zhcxSeaBindProofService;
  22. @Autowired
  23. SysFileItemService sysFileItemService;
  24. @PostMapping("/downloadSeaExcel/{id}")
  25. public void downloadExcel(HttpServletResponse response, @PathVariable("id") String id) {
  26. try {
  27. // String id = map.get("id");
  28. ZhcxSeaBindProofDo zhcxSeaBindProofDo = new ZhcxSeaBindProofDo();
  29. zhcxSeaBindProofDo.setId(id);
  30. zhcxSeaBindProofService.seabingdownloadExcel(response,zhcxSeaBindProofDo);
  31. } catch (Exception e) {
  32. throw new RuntimeException(e);
  33. }
  34. }
  35. @RequestMapping("/previewSeaExcel/{id}")
  36. public void previewExcel(HttpServletResponse response,@PathVariable("id") String id) {
  37. try {
  38. ZhcxSeaBindProofDo zhcxSeaBindProofDo = new ZhcxSeaBindProofDo();
  39. zhcxSeaBindProofDo.setId(id);
  40. zhcxSeaBindProofService.seabingPreviewExcel(response,zhcxSeaBindProofDo);
  41. } catch (Exception e) {
  42. throw new RuntimeException(e);
  43. }
  44. }
  45. @RequestMapping("/previewPdf/{id}")
  46. public void previewPdf(HttpServletResponse response,@PathVariable("id") String id) {
  47. try {
  48. zhcxSeaBindProofService.previewPdf(response,id);
  49. } catch (Exception e) {
  50. throw new RuntimeException(e);
  51. }
  52. }
  53. }