From f7778e64e82b6d8e5867762488f94ed74c45496a Mon Sep 17 00:00:00 2001 From: gaowdong Date: Wed, 7 May 2025 10:50:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=BF=E4=B8=8A=E7=BA=BF=E4=B8=8B=E8=AE=A2?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/controller/OrderInfoController.java | 2 ++ .../order/domain/param/OrderQueryParam.java | 24 +++++++++++++++++++ .../mapper/order/OrderInfoMapper.xml | 15 ++++++++++++ 3 files changed, 41 insertions(+) diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/controller/OrderInfoController.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/controller/OrderInfoController.java index c9fbccf..ad6d5a8 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/controller/OrderInfoController.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/controller/OrderInfoController.java @@ -70,6 +70,8 @@ public class OrderInfoController extends BaseController if(Objects.isNull(orderQueryParam) || CollUtil.isEmpty(orderQueryParam.getOrderTypeList())) { throw new ServiceException("订单类型不能为空"); } + orderQueryParam.setStartDateTime(orderQueryParam.getStartDate().atTime(0,0,0)); + orderQueryParam.setEndDateTime(orderQueryParam.getEndDate().atTime(23,59,59)); startPage(); List list = orderInfoService.selectOrderInfoList(orderQueryParam); return getDataTable(list); diff --git a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/param/OrderQueryParam.java b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/param/OrderQueryParam.java index b7048dd..42b2ae0 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/param/OrderQueryParam.java +++ b/bonus-modules/bonus-smart-canteen/src/main/java/com/bonus/canteen/core/order/domain/param/OrderQueryParam.java @@ -1,13 +1,16 @@ package com.bonus.canteen.core.order.domain.param; +import com.alibaba.excel.util.StringUtils; import com.bonus.common.core.annotation.Excel; import com.bonus.common.core.web.domain.BaseEntity; +import com.bonus.common.houqin.utils.SM4EncryptUtils; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.time.LocalDate; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit; import java.util.Date; @@ -52,6 +55,8 @@ public class OrderQueryParam implements Serializable /** 是否在线订单 1 是 2 否 */ private Integer isOnline; + private Long areaId; + /** 食堂id */ private Long canteenId; @@ -117,10 +122,29 @@ public class OrderQueryParam implements Serializable @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime endDateTime; + @ApiModelProperty("开始时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDate startDate; + + @ApiModelProperty("结束时间") + @JsonFormat(pattern = "yyyy-MM-dd") + private LocalDate endDate; + private String searchValue; + private String custSearchInfo; + + private String goodsSearchInfo; + + private String encryptedCustSearchValue; + public OrderQueryParam() { this.endDateTime = LocalDateTime.now().plusDays(7); this.startDateTime = LocalDateTime.now().minusDays(7); + this.endDate = LocalDate.now().plusDays(7); + this.startDate = LocalDate.now().minusDays(7); + if(StringUtils.isNotBlank(custSearchInfo)) { + this.encryptedCustSearchValue = SM4EncryptUtils.sm4Encrypt(custSearchInfo); + } } } diff --git a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/order/OrderInfoMapper.xml b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/order/OrderInfoMapper.xml index da8d2b6..f91ee51 100644 --- a/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/order/OrderInfoMapper.xml +++ b/bonus-modules/bonus-smart-canteen/src/main/resources/mapper/order/OrderInfoMapper.xml @@ -83,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and oi.source_type = #{sourceType} and oi.is_online = #{isOnline} and oi.canteen_id = #{canteenId} + and ac.area_id = #{areaId} and oi.canteen_id in @@ -148,6 +149,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and od.goods_name like concat('%', #{searchValue}, '%')) ) + + and ( + su.nick_name like CONCAT('%',#{custSearchInfo},'%') + or su.phonenumber = #{encryptedCustSearchValue} + or su.user_id like concat('%', #{custSearchInfo}, '%') + ) + + + and ( + EXISTS (select 1 from order_detail od + where oi.order_id = od.order_id + and od.goods_name like concat('%', #{goodsSearchInfo}, '%')) + ) + order by oi.create_time desc