futian.liu
2023-12-12 f470bdc535b6ca345d4e843da248f8860d294b85
修改导出为标准返回
6个文件已修改
22 ■■■■ 已修改文件
consum-base/src/main/java/com/consum/base/BaseController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
consum-base/src/main/java/com/consum/base/controller/LWhFormInventoryController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
consum-base/src/main/java/com/consum/base/controller/LWhFormOutputController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
consum-base/src/main/java/com/consum/base/controller/LWhFormProcureController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
consum-base/src/main/java/com/consum/base/controller/LWhFormScrappedController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
consum-base/src/main/java/com/consum/base/controller/LWhFormTransferController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
consum-base/src/main/java/com/consum/base/BaseController.java
@@ -63,7 +63,7 @@
            byteArrayOutputStream.size(), 0, "-1");
        String fileUrl = fileInfo.getUrl();
        workbook.close();
        return fileUrl;
        return "/file" + fileUrl;
    }
}
consum-base/src/main/java/com/consum/base/controller/LWhFormInventoryController.java
@@ -307,7 +307,7 @@
    @ApiImplicitParams({
        @ApiImplicitParam(name = "id", value = "盘点单id", dataType = "Long", required = true, paramType = "query")})
    @GetMapping("/list/export")
    public String export(Long id, HttpServletResponse response) throws Exception {
    public ResponseValue<String> export(Long id, HttpServletResponse response) throws Exception {
        List<InventoryExcelTemplate> exportList = lWhFormInventoryService.getExportList(id);
        if (CollectionUtils.isEmpty(exportList)) {
@@ -329,7 +329,7 @@
        map.put("monitorName", monitorName);
        map.put("name", operatorName);
        Workbook workbook = ExcelExportUtil.exportExcel(params, InventoryExcelTemplate.class, exportList, map);
        return downLoadExcel("低值易耗品盘点表", response, workbook);
        return ResponseValue.success(downLoadExcel("低值易耗品盘点表", response, workbook));
    }
}
consum-base/src/main/java/com/consum/base/controller/LWhFormOutputController.java
@@ -215,7 +215,7 @@
    @ApiOperation(value = "出库单导出", notes = "出库单导出")
    @ApiImplicitParam(name = "id", value = "出库单id", required = true, dataType = "Long", paramType = "query")
    @GetMapping("/list/export")
    public String export(Long id, HttpServletResponse response) throws Exception {
    public ResponseValue<String> export(Long id, HttpServletResponse response) throws Exception {
        FinSysTenantUser sysInfo = this.getSysInfo();
        if (sysInfo == null) {
            throw new RuntimeException("登录用户信息不存在");
@@ -251,7 +251,7 @@
        map.put("totalAmount", totalAmount);
        Workbook workbook = ExcelExportUtil.exportExcel(params, OutputExcelTemplate.class, exportList, map);
        return downLoadExcel("出库单", response, workbook);
        return ResponseValue.success(downLoadExcel("出库单", response, workbook));
    }
consum-base/src/main/java/com/consum/base/controller/LWhFormProcureController.java
@@ -274,7 +274,7 @@
    @ApiImplicitParams({
        @ApiImplicitParam(name = "id", value = "采购单id", required = true, dataType = "Long", paramType = "query")})
    @GetMapping("/list/export")
    public String export(Long id, HttpServletResponse response) throws Exception {
    public ResponseValue<String> export(Long id, HttpServletResponse response) throws Exception {
        TemplateExportParams params = new TemplateExportParams("import/采购入库单.xls");
        params.setHeadingStartRow(2);
        FinSysTenantUser sysInfo = this.getSysInfo();
@@ -305,7 +305,7 @@
        map.put("totalAmount", totalAmount);
        Workbook workbook = ExcelExportUtil.exportExcel(params, ProcureExcelTemplate.class, exportList, map);
        return downLoadExcel("采购入库单", response, workbook);
        return ResponseValue.success(downLoadExcel("采购入库单", response, workbook));
    }
}
consum-base/src/main/java/com/consum/base/controller/LWhFormScrappedController.java
@@ -155,7 +155,7 @@
    @ApiOperation(value = "导出报废单", notes = "导出报废单")
    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "报废单id", dataType = "Long", paramType = "query")})
    @GetMapping("/list/export")
    public String export(Long id, HttpServletResponse response) throws Exception {
    public ResponseValue<String> export(Long id, HttpServletResponse response) throws Exception {
        if (id == null) {
            throw new RuntimeException("报废单id为空");
        }
@@ -186,7 +186,7 @@
        map.put("totalAmount", totalAmount);
        Workbook sheets = ExcelExportUtil.exportExcel(exportParams, ScrappedInfoExcelTemplate.class, export, map);
        return downLoadExcel("报废登记单", response, sheets);
        return ResponseValue.success(downLoadExcel("报废登记单", response, sheets));
    }
consum-base/src/main/java/com/consum/base/controller/LWhFormTransferController.java
@@ -288,7 +288,7 @@
    @ApiImplicitParams({@ApiImplicitParam(name = "id", value = "调拨单id", required = true, dataType = "Long"),
        @ApiImplicitParam(name = "type", value = "导出类型 1 入库 2 出库", required = true, dataType = "Integer"),})
    @GetMapping("/list/export")
    public String export(Long id, Integer type, HttpServletResponse response) throws Exception {
    public ResponseValue<String> export(Long id, Integer type, HttpServletResponse response) throws Exception {
        TemplateExportParams params;
        String fileName;
@@ -322,7 +322,7 @@
        map.put("totalAmount", totalAmount);
        Workbook workbook = ExcelExportUtil.exportExcel(params, TransferExcelTemplate.class, export, map);
        return downLoadExcel(fileName, response, workbook);
        return ResponseValue.success(downLoadExcel(fileName, response, workbook));
    }