自动化立体仓库 - WMS系统
zhangchao
2024-11-05 dea9852bb63dd54331819ac18d623143fc086b0c
Excel导出优化
3个文件已修改
58 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/ReportDownloadController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/ViewWorkCountInView.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/ViewWorkInBean.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/ReportDownloadController.java
@@ -219,7 +219,6 @@
            String fileName = URLEncoder.encode("日入库明细统计", "UTF-8").replaceAll("\\+", "%20");
            response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
            List<ViewWorkInBean> list = reportQueryMapper.queryViewWorkInList(bean);
            String s = "1";
            // 这里需要设置不关闭流
            EasyExcel.write(response.getOutputStream(), ViewWorkInBean.class).autoCloseStream(Boolean.FALSE).sheet("sheet1").doWrite(list);
        } catch (Exception e) {
src/main/java/com/zy/asrs/entity/ViewWorkCountInView.java
@@ -1,19 +1,25 @@
package com.zy.asrs.entity;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.NumberFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
@Data
public class ViewWorkCountInView {
    @ColumnWidth(25)
    @ExcelProperty("入库日期")
    private String oneday;
    @ColumnWidth(25)
    @ExcelProperty("物料号")
    private String matnr;
    @ExcelProperty("日期标题")
    @ColumnWidth(50)
    @ExcelProperty("物料名称")
    private String maktx;
    @ColumnWidth(25)
    @ExcelProperty("数量")
    private String anfme;
    private Double anfme;
}
src/main/java/com/zy/asrs/entity/ViewWorkInBean.java
@@ -3,6 +3,7 @@
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.core.common.Cools;
import com.core.common.SpringUtils;
import com.zy.system.entity.User;
@@ -23,36 +24,49 @@
    @ExcelIgnore
    private int pageNumber;
    @ExcelIgnore
    private int pageSize;
    @ExcelIgnore
    @ExcelIgnore
    private int stay_time;
    @ExcelIgnore
    @ExcelIgnore
    private String begin_date;
    @ExcelIgnore
    private String end_date;
    @ExcelIgnore
    private String query_date;
    @ExcelIgnore
    @ExcelIgnore
    private Integer row;
    @ExcelIgnore
    @ExcelIgnore
    private String crn_str_time;
    @ExcelIgnore
    private String crn_end_time;
    @ExcelIgnore
    @ColumnWidth(15)
    @ExcelProperty(value = "销售单号")
    private String three_code;
    @ExcelIgnore
    @ExcelProperty(value = "工作号")
    private Integer wrk_no;
    @ExcelProperty(value = "工作时间")
    @ColumnWidth(20)
    @ExcelProperty(value = "入库时间")
    private Date io_time;
    @ColumnWidth(20)
    @ExcelProperty(value = "库位号")
    private String loc_no;
    @ExcelProperty(value = "货站码")
    private String supp_code;
    @ExcelProperty(value = "货架条码")
    private String zpallet;
@@ -60,10 +74,12 @@
    @ExcelProperty(value = "数量")
    private Double anfme;
    @ColumnWidth(15)
    @ExcelProperty(value = "物料号")
    private String matnr;
    @ExcelProperty(value = "物料号")
    @ColumnWidth(35)
    @ExcelProperty(value = "物料名称")
    private String maktx;
    @ExcelProperty(value = "序列码")
@@ -78,7 +94,7 @@
    @ExcelProperty(value = "批次")
    private String model;
    @ExcelProperty(value = "颜色")
    @ExcelIgnore
    private String color;
    @ExcelProperty(value = "品牌")
@@ -87,20 +103,21 @@
    @ExcelProperty(value = "单位")
    private String unit;
    @ExcelProperty(value = "单价")
    @ExcelIgnore
    private Double price;
    @ExcelProperty(value = "sku")
    private String sku;
    @ExcelProperty(value = "包数")
    @ExcelIgnore
    private Double units;
    @ExcelProperty(value = "条码")
    private String barcode;
    @ExcelProperty(value = "物料状态")
    @ExcelIgnore
    private String origin;
    @ExcelIgnore
    @ExcelProperty(value = "厂家")
    private String manu;
@@ -123,17 +140,17 @@
    @ExcelProperty(value = "体积")
    private Double volume;
    @ExcelProperty(value = "销售单号")
    private String three_code;
    @ExcelProperty(value = "供应商")
    private String supp;
    @ExcelProperty(value = "货站码")
    private String supp_code;
    @ExcelIgnore
    @ExcelProperty(value = "是否批次 1: 是  0: 否  ")
    private Integer be_batch;
    @ExcelIgnore
    @ExcelProperty(value = "保质期")
    private String dead_time;