From 6904205c711e55d23533a8d57c0b9bb75f47d1b6 Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期二, 05 十一月 2024 16:48:38 +0800 Subject: [PATCH] 优化代码 --- pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoGeneral.java | 51 +++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 41 insertions(+), 10 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoGeneral.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoGeneral.java index 522b01a..8df7453 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoGeneral.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoGeneral.java @@ -1,6 +1,15 @@ package com.dy.pipIrrGlobal.voSe; +import com.alibaba.excel.annotation.ExcelIgnore; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import com.alibaba.excel.annotation.write.style.ContentRowHeight; +import com.alibaba.excel.annotation.write.style.HeadRowHeight; +import com.alibaba.fastjson2.annotation.JSONField; +import com.alibaba.fastjson2.writer.ObjectWriterImplToString; import com.dy.common.po.BaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; @@ -8,36 +17,58 @@ * @author ZhuBaoMin * @date 2024-01-24 17:00 * @LastEditTime 2024-01-24 17:00 - * @Description + * @Description 2024-08-22 鏈卞疂姘戝鍔犳�婚瀛楁 */ @Data -@Schema(title = "璐㈠姟瀵硅处涔嬫�昏处瑙嗗浘瀵硅薄") +@JsonPropertyOrder({ "generalId", "cashierId", "cashierName", "tradeAmount", "gift", "refundAmount", "totalAmount", "operateDate", "auditStatus"}) +@HeadRowHeight(30) +@ContentRowHeight(20) public class VoGeneral implements BaseEntity { private static final long serialVersionUID = 202401241706001L; @Schema(title = "鎬昏处ID") - private String generalId; + @JSONField(serializeUsing= ObjectWriterImplToString.class) + @ExcelIgnore + private Long generalId; @Schema(title = "鏀堕摱鍛業D") - private String cashierId; + @JSONField(serializeUsing= ObjectWriterImplToString.class) + @ExcelIgnore + private Long cashierId; - @Schema(title = "鏀堕摱鍛樺鍚�") + @ExcelProperty(value = {"${title}", "鏀堕摱鍛樺鍚�"}) + @ColumnWidth(18) private String cashierName; - @Schema(title = "瀹炴敹閲戦") + @ExcelProperty(value = {"${title}", "瀹炴敹閲戦"}) + @ColumnWidth(15) private Float tradeAmount; - @Schema(title = "璧犻�侀噾棰�") + @ExcelProperty(value = {"${title}", "璧犻�侀噾棰�"}) + @ColumnWidth(15) + @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) private Float gift; - @Schema(title = "杩旇繕閲戦") + @ExcelProperty(value = {"${title}", "杩旇繕閲戦"}) + @ColumnWidth(15) + @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) private Float refundAmount; - @Schema(title = "浜ゆ槗鏃ユ湡") + /** + * 鎬婚 = 瀹炴敹閲戦 + 璧犻�侀噾棰� - 杩旇繕閲戦 + */ + @ExcelProperty(value = {"${title}", "鎬婚"}) + @ColumnWidth(10) + @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) + private Float totalAmount; + + @ExcelProperty(value = {"${title}", "浜ゆ槗鏃ユ湡"}) + @ColumnWidth(15) private String operateDate; - @Schema(title = "瀹℃牳鐘舵��") + @ExcelProperty(value = {"${title}", "瀹℃牳鐘舵��"}) + @ColumnWidth(15) private String auditStatus; } -- Gitblit v1.8.0