package com.rongwei.bsserver.controller; import com.rongwei.bscommon.sys.service.ZhcxSeaBindProofService; import com.rongwei.bsentity.domain.ZhcxInspectionReportManageDo; import com.rongwei.bsentity.domain.ZhcxSeaBindProofDo; import com.rongwei.rwcommoncomponent.file.service.SysFileItemService; import com.rongwei.rwcommonentity.commonservers.domain.SysFileItemDo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.io.FileSystemResource; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.File; import java.util.Map; @RestController @RequestMapping("/zhcxSeaBindProof") public class ZhcxSeaBindProofController { @Autowired ZhcxSeaBindProofService zhcxSeaBindProofService; @Autowired SysFileItemService sysFileItemService; @PostMapping("/downloadSeaExcel/{id}") public void downloadExcel(HttpServletResponse response, @PathVariable("id") String id) { try { // String id = map.get("id"); ZhcxSeaBindProofDo zhcxSeaBindProofDo = new ZhcxSeaBindProofDo(); zhcxSeaBindProofDo.setId(id); zhcxSeaBindProofService.seabingdownloadExcel(response,zhcxSeaBindProofDo); } catch (Exception e) { throw new RuntimeException(e); } } @RequestMapping("/previewSeaExcel/{id}") public void previewExcel(HttpServletResponse response,@PathVariable("id") String id) { try { ZhcxSeaBindProofDo zhcxSeaBindProofDo = new ZhcxSeaBindProofDo(); zhcxSeaBindProofDo.setId(id); zhcxSeaBindProofService.seabingPreviewExcel(response,zhcxSeaBindProofDo); } catch (Exception e) { throw new RuntimeException(e); } } @RequestMapping("/previewPdf/{id}") public void previewPdf(HttpServletResponse response,@PathVariable("id") String id) { try { zhcxSeaBindProofService.previewPdf(response,id); } catch (Exception e) { throw new RuntimeException(e); } } }