diff --git a/src/main/java/com/gxwebsoft/glt/entity/GltUserTicket.java b/src/main/java/com/gxwebsoft/glt/entity/GltUserTicket.java index aa1f853..ecae32a 100644 --- a/src/main/java/com/gxwebsoft/glt/entity/GltUserTicket.java +++ b/src/main/java/com/gxwebsoft/glt/entity/GltUserTicket.java @@ -1,7 +1,10 @@ package com.gxwebsoft.glt.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; + +import java.math.BigDecimal; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableLogic; import java.io.Serializable; @@ -28,9 +31,21 @@ public class GltUserTicket implements Serializable { @Schema(description = "模板ID") private Integer templateId; + @Schema(description = "模板名称") + @TableField(exist = false) + private String templateName; + @Schema(description = "商品ID") private Integer goodsId; + @Schema(description = "购买价格") + @TableField(exist = false) + private BigDecimal payPrice; + + @Schema(description = "商品名称") + @TableField(exist = false) + private String goodsName; + @Schema(description = "订单ID") private Integer orderId; @@ -58,6 +73,18 @@ public class GltUserTicket implements Serializable { @Schema(description = "用户ID") private Integer userId; + @Schema(description = "用户昵称") + @TableField(exist = false) + private String nickname; + + @Schema(description = "用户头像") + @TableField(exist = false) + private String avatar; + + @Schema(description = "用户手机号") + @TableField(exist = false) + private String phone; + @Schema(description = "排序(数字越小越靠前)") private Integer sortNumber; diff --git a/src/main/java/com/gxwebsoft/glt/entity/GltUserTicketLog.java b/src/main/java/com/gxwebsoft/glt/entity/GltUserTicketLog.java index d6e5166..4c83b91 100644 --- a/src/main/java/com/gxwebsoft/glt/entity/GltUserTicketLog.java +++ b/src/main/java/com/gxwebsoft/glt/entity/GltUserTicketLog.java @@ -1,6 +1,7 @@ package com.gxwebsoft.glt.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableLogic; @@ -58,6 +59,18 @@ public class GltUserTicketLog implements Serializable { @Schema(description = "用户ID") private Integer userId; + @Schema(description = "用户昵称") + @TableField(exist = false) + private String nickname; + + @Schema(description = "用户头像") + @TableField(exist = false) + private String avatar; + + @Schema(description = "用户手机号") + @TableField(exist = false) + private String phone; + @Schema(description = "排序(数字越小越靠前)") private Integer sortNumber; diff --git a/src/main/java/com/gxwebsoft/glt/entity/GltUserTicketRelease.java b/src/main/java/com/gxwebsoft/glt/entity/GltUserTicketRelease.java index 2a1f268..26131d9 100644 --- a/src/main/java/com/gxwebsoft/glt/entity/GltUserTicketRelease.java +++ b/src/main/java/com/gxwebsoft/glt/entity/GltUserTicketRelease.java @@ -1,6 +1,7 @@ package com.gxwebsoft.glt.entity; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableLogic; @@ -31,6 +32,18 @@ public class GltUserTicketRelease implements Serializable { @Schema(description = "用户ID") private Integer userId; + @Schema(description = "用户昵称") + @TableField(exist = false) + private String nickname; + + @Schema(description = "用户头像") + @TableField(exist = false) + private String avatar; + + @Schema(description = "用户手机号") + @TableField(exist = false) + private String phone; + @Schema(description = "周期编号") private Integer periodNo; diff --git a/src/main/java/com/gxwebsoft/glt/mapper/xml/GltUserTicketLogMapper.xml b/src/main/java/com/gxwebsoft/glt/mapper/xml/GltUserTicketLogMapper.xml index 7cab665..695b9d1 100644 --- a/src/main/java/com/gxwebsoft/glt/mapper/xml/GltUserTicketLogMapper.xml +++ b/src/main/java/com/gxwebsoft/glt/mapper/xml/GltUserTicketLogMapper.xml @@ -4,8 +4,9 @@ - SELECT a.* + SELECT a.*, u.nickname, u.avatar, u.phone FROM glt_user_ticket_log a + LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id AND a.id = #{param.id} @@ -66,6 +67,9 @@ AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') + OR a.user_id = #{param.keywords} + OR a.user_ticket_id = #{param.keywords} + OR a.order_no = #{param.keywords} ) diff --git a/src/main/java/com/gxwebsoft/glt/mapper/xml/GltUserTicketMapper.xml b/src/main/java/com/gxwebsoft/glt/mapper/xml/GltUserTicketMapper.xml index c9e9f85..13b32f6 100644 --- a/src/main/java/com/gxwebsoft/glt/mapper/xml/GltUserTicketMapper.xml +++ b/src/main/java/com/gxwebsoft/glt/mapper/xml/GltUserTicketMapper.xml @@ -4,8 +4,11 @@ - SELECT a.* + SELECT a.*, u.nickname, u.avatar, u.phone, m.name AS templateName, o.pay_price FROM glt_user_ticket a + LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id + LEFT JOIN glt_ticket_template m ON a.template_id = m.id + LEFT JOIN shop_order o ON a.order_no = o.order_no AND a.id = #{param.id} @@ -66,6 +69,8 @@ AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') + OR a.user_id = #{param.keywords} + OR a.order_no = #{param.keywords} ) diff --git a/src/main/java/com/gxwebsoft/glt/mapper/xml/GltUserTicketReleaseMapper.xml b/src/main/java/com/gxwebsoft/glt/mapper/xml/GltUserTicketReleaseMapper.xml index 68a2732..a8364a9 100644 --- a/src/main/java/com/gxwebsoft/glt/mapper/xml/GltUserTicketReleaseMapper.xml +++ b/src/main/java/com/gxwebsoft/glt/mapper/xml/GltUserTicketReleaseMapper.xml @@ -4,9 +4,10 @@ - SELECT a.* + SELECT a.*, u.nickname, u.avatar, u.phone FROM glt_user_ticket_release a - + LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id + AND a.id = #{param.id} @@ -41,7 +42,8 @@ AND a.create_time <= #{param.createTimeEnd} - AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%') + AND (a.user_ticket_id = #{param.keywords} + OR u.user_id = #{param.keywords} ) diff --git a/src/main/java/com/gxwebsoft/glt/service/GltTicketIssueService.java b/src/main/java/com/gxwebsoft/glt/service/GltTicketIssueService.java index 8b5b14d..675777b 100644 --- a/src/main/java/com/gxwebsoft/glt/service/GltTicketIssueService.java +++ b/src/main/java/com/gxwebsoft/glt/service/GltTicketIssueService.java @@ -59,15 +59,17 @@ public class GltTicketIssueService { .eq(ShopOrder::getPayStatus, true) .eq(ShopOrder::getOrderStatus, 0) // 今日订单(兼容:以 create_time 或 pay_time 任一落在今日即可) - .and(w -> w - .ge(ShopOrder::getCreateTime, todayStart).lt(ShopOrder::getCreateTime, tomorrowStart) - .or() - .ge(ShopOrder::getPayTime, todayStart).lt(ShopOrder::getPayTime, tomorrowStart) - ) +// .and(w -> w +// .ge(ShopOrder::getCreateTime, todayStart).lt(ShopOrder::getCreateTime, tomorrowStart) +// .or() +// .ge(ShopOrder::getPayTime, todayStart).lt(ShopOrder::getPayTime, tomorrowStart) +// ) .orderByAsc(ShopOrder::getPayTime) .orderByAsc(ShopOrder::getOrderId) ); + System.out.println("orders = " + orders.size()); + if (orders.isEmpty()) { log.debug("套票发放扫描:今日无符合条件的订单 tenantId={}, formId={}", tenantId, formId); return;