From 3f00a9c7853c2c3f53c69c3bb4b689b60184dfc4 Mon Sep 17 00:00:00 2001 From: liurunyu <lry9898@163.com> Date: 星期二, 29 十月 2024 22:07:02 +0800 Subject: [PATCH] 1、VO、PO等值对象中凡时Double或Float类型的属性,都加上注解@JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ); 2、工作报中数据查询SQL中增加clientAddr农户地址字段。 --- pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoTradeDetails.java | 158 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 146 insertions(+), 12 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoTradeDetails.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoTradeDetails.java index 7940161..ef1acfa 100644 --- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoTradeDetails.java +++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSe/VoTradeDetails.java @@ -1,8 +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 io.swagger.v3.oas.annotations.media.Schema; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -16,30 +23,157 @@ */ @Data -@Schema(title = "璐㈠姟瀵硅处锛屼氦鏄撴槑缁嗚鍥惧璞�") +@JsonPropertyOrder({"orderNumber", "clientName", "cardNum", "idCard", "clientNum", "phone", "operateType", "tradeAmount", "waterCost", "cardCost", "gift", "refundAmount", "money", "paymentName", "tradeTime", "cashierId", "cashierName", "cardState", "districtTitle", "villageId"}) +@HeadRowHeight(30) +@ContentRowHeight(20) public class VoTradeDetails implements BaseEntity { private static final long serialVersionUID = 202402012040001L; - @Schema(title = "鍐滄埛濮撳悕") + /** + * 璁㈠崟鍙� + */ + @ExcelProperty(value = {"${title}", "璁㈠崟鍙�"}) + @ColumnWidth(25) + private String orderNumber; + + /** + * 鍐滄埛濮撳悕 + */ + @ExcelProperty(value = {"${title}", "鍐滄埛濮撳悕"}) + @ColumnWidth(15) private String clientName; - @Schema(title = "鑱旂郴鐢佃瘽") - private String phone; + /** + * 姘村崱缂栧彿 + */ + @JSONField(serializeUsing= ObjectWriterImplToString.class) + @ExcelProperty(value = {"${title}", "姘村崱缂栧彿"}) + @ColumnWidth(20) + private String cardNum; - @Schema(title = "鍐滄埛缂栧彿") + /** + * 韬唤璇佸彿 + */ + @ExcelProperty(value = {"${title}", "韬唤璇佸彿"}) + @ColumnWidth(15) + private String idCard; + + /** + * 鍐滄埛缂栧彿 + */ + @ExcelProperty(value = {"${title}", "鍐滄埛缂栧彿"}) + @ColumnWidth(15) private String clientNum; - @Schema(title = "涓氬姟绫诲瀷") + /** + * 鑱旂郴鐢佃瘽 + */ + @ExcelProperty(value = {"${title}", "鑱旂郴鐢佃瘽"}) + @ColumnWidth(15) + private String phone; + + /** + * 涓氬姟绫诲瀷 + */ + @ExcelProperty(value = {"${title}", "涓氬姟绫诲瀷"}) + @ColumnWidth(15) private String operateType; - @Schema(title = "浜ゆ槗閲戦") + /** + * 浜ゆ槗閲戦 + */ + @ExcelProperty(value = {"${title}", "浜ゆ槗閲戦"}) + @ColumnWidth(15) + @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) private Double tradeAmount; - @Schema(title = "浠樻鏂瑰紡") + /** + * 璐按閲戦 + */ + @ExcelProperty(value = {"${title}", "璐按閲戦"}) + @ColumnWidth(15) + @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) + private Double waterCost; + + /** + * 璐崱閲戦 + */ + @ExcelProperty(value = {"${title}", "璐崱閲戦"}) + @ColumnWidth(15) + @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) + private Double cardCost; + + /** + * 璧犻�侀噾棰� + */ + @ExcelProperty(value = {"${title}", "璧犻�侀噾棰�"}) + @ColumnWidth(15) + @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) + private Double gift; + + /** + * 杩旇繕閲戦 + */ + @ExcelProperty(value = {"${title}", "杩旇繕閲戦"}) + @ColumnWidth(15) + @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) + private Double refundAmount; + + /** + * 浣欓 + */ + @ExcelProperty(value = {"${title}", "浣欓"}) + @ColumnWidth(15) + @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" ) + private Double money; + + /** + * 浠樻鏂瑰紡 + */ + @ExcelProperty(value = {"${title}", "浠樻鏂瑰紡"}) + @ColumnWidth(15) private String paymentName; + /** + * 浜ゆ槗鏃堕棿 + */ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @Schema(title = "浜ゆ槗鏃堕棿") - private Date tradeDate; + @ExcelProperty(value = {"${title}", "浜ゆ槗鏃堕棿"}) + @ColumnWidth(20) + private Date tradeTime; + + /** + * 鏀堕摱鍛業D + */ + @JSONField(serializeUsing= ObjectWriterImplToString.class) + @ExcelIgnore + private Long cashierId; + + /** + * 鏀堕摱鍛樺鍚� + */ + @ExcelProperty(value = {"${title}", "鏀堕摱鍛樺鍚�"}) + @ColumnWidth(15) + private String cashierName; + + /** + * 鍗$墖鐘舵�� + */ + @ExcelProperty(value = {"${title}", "鍗$墖鐘舵��"}) + @ColumnWidth(15) + private String cardState; + + /** + * 鏉戝簞鍚嶇О + */ + @ExcelProperty(value = {"${title}", "鏉戝簞鍚嶇О"}) + @ColumnWidth(35) + private String districtTitle; + + /** + * 鏉戝簞ID + */ + @JSONField(serializeUsing= ObjectWriterImplToString.class) + @ExcelIgnore + private Long villageId; } -- Gitblit v1.8.0