线上线下订单

This commit is contained in:
gaowdong 2025-05-07 10:50:44 +08:00
parent 046f6250a5
commit f7778e64e8
3 changed files with 41 additions and 0 deletions

View File

@ -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<OrderInfo> list = orderInfoService.selectOrderInfoList(orderQueryParam);
return getDataTable(list);

View File

@ -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);
}
}
}

View File

@ -83,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="sourceType != null "> and oi.source_type = #{sourceType}</if>
<if test="isOnline != null "> and oi.is_online = #{isOnline}</if>
<if test="canteenId != null "> and oi.canteen_id = #{canteenId}</if>
<if test="areaId != null "> and ac.area_id = #{areaId}</if>
<if test="canteenIdList != null and canteenIdList.size >0">
and oi.canteen_id in
<foreach collection="canteenIdList" item="canteenId" open="(" separator="," close=")">
@ -148,6 +149,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and od.goods_name like concat('%', #{searchValue}, '%'))
)
</if>
<if test="custSearchInfo != null and custSearchInfo != ''">
and (
su.nick_name like CONCAT('%',#{custSearchInfo},'%')
or su.phonenumber = #{encryptedCustSearchValue}
or su.user_id like concat('%', #{custSearchInfo}, '%')
)
</if>
<if test="goodsSearchInfo != null and goodsSearchInfo != ''">
and (
EXISTS (select 1 from order_detail od
where oi.order_id = od.order_id
and od.goods_name like concat('%', #{goodsSearchInfo}, '%'))
)
</if>
</where>
order by oi.create_time desc
</select>