| | |
| | | import com.ruoyi.framework.web.service.TokenService; |
| | | import com.ruoyi.system.export.PlatformLedgerReportExport; |
| | | import com.ruoyi.system.export.ProcurementReportClinicExport; |
| | | import com.ruoyi.system.export.ProcurementReportDetailExport; |
| | | import com.ruoyi.system.export.ProcurementReportPlatformExport; |
| | | import com.ruoyi.system.export.ProcurementReportSupplierExport; |
| | | import com.ruoyi.system.model.TCrmClinic; |
| | |
| | | import com.ruoyi.system.query.ClinicProcurementReportQuery; |
| | | import com.ruoyi.system.query.DetectionPaymentReportQuery; |
| | | import com.ruoyi.system.query.PerformanceReportQuery; |
| | | import com.ruoyi.system.query.ProcurementReportDetailQuery; |
| | | import com.ruoyi.system.service.*; |
| | | import com.ruoyi.system.vo.BranchPerformanceReportVO; |
| | | import com.ruoyi.system.vo.ClinicProcurementReportDetailVO; |
| | | import com.ruoyi.system.vo.ClinicProcurementReportVO; |
| | | import com.ruoyi.system.vo.DetectionPaymentReportVO; |
| | | import com.ruoyi.system.vo.SalespersonPerformanceReportVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.apache.http.entity.ContentType; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.mock.web.MockMultipartFile; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.io.*; |
| | | import java.net.URL; |
| | | import java.net.URLEncoder; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 诊所采购报表详情列表(商品维度) |
| | | */ |
| | | @ApiOperation(value = "【20260130】诊所采购报表详情列表") |
| | | @PostMapping(value = "/clinicProcurementReportDetail/{id}") |
| | | public R<List<ClinicProcurementReportDetailVO>> clinicProcurementReportDetail(@ApiParam(name = "id",value = "采购ID") @PathVariable String id) { |
| | | List<ClinicProcurementReportDetailVO> list = erpProcurementService.clinicProcurementReportDetail(id); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @Log(title = "财务报表-诊所采购报表详情导出", businessType = BusinessType.EXPORT) |
| | | @ApiOperation(value = "【20260130】诊所采购报表详情导出(支持多选)") |
| | | @PostMapping("/exportProcurementReportDetail") |
| | | public void exportProcurementReportDetail(@Valid @RequestBody ProcurementReportDetailQuery query){ |
| | | List<ProcurementReportDetailExport> list = erpProcurementService.exportProcurementReportDetail(query.getProcurementIds()); |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), ProcurementReportDetailExport.class, list); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | assert response != null; |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("诊所采购报表详情.xls", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setContentType("application/vnd.ms-excel;charset=UTF-8"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | | response.setHeader("Cache-Control", "no-cache"); |
| | | outputStream = response.getOutputStream(); |
| | | workbook.write(outputStream); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | try { |
| | | outputStream.close(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | } |