线上线下订单
This commit is contained in:
parent
046f6250a5
commit
f7778e64e8
|
|
@ -70,6 +70,8 @@ public class OrderInfoController extends BaseController
|
||||||
if(Objects.isNull(orderQueryParam) || CollUtil.isEmpty(orderQueryParam.getOrderTypeList())) {
|
if(Objects.isNull(orderQueryParam) || CollUtil.isEmpty(orderQueryParam.getOrderTypeList())) {
|
||||||
throw new ServiceException("订单类型不能为空");
|
throw new ServiceException("订单类型不能为空");
|
||||||
}
|
}
|
||||||
|
orderQueryParam.setStartDateTime(orderQueryParam.getStartDate().atTime(0,0,0));
|
||||||
|
orderQueryParam.setEndDateTime(orderQueryParam.getEndDate().atTime(23,59,59));
|
||||||
startPage();
|
startPage();
|
||||||
List<OrderInfo> list = orderInfoService.selectOrderInfoList(orderQueryParam);
|
List<OrderInfo> list = orderInfoService.selectOrderInfoList(orderQueryParam);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,16 @@
|
||||||
package com.bonus.canteen.core.order.domain.param;
|
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.annotation.Excel;
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
import com.bonus.common.houqin.utils.SM4EncryptUtils;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.temporal.ChronoUnit;
|
import java.time.temporal.ChronoUnit;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
@ -52,6 +55,8 @@ public class OrderQueryParam implements Serializable
|
||||||
/** 是否在线订单 1 是 2 否 */
|
/** 是否在线订单 1 是 2 否 */
|
||||||
private Integer isOnline;
|
private Integer isOnline;
|
||||||
|
|
||||||
|
private Long areaId;
|
||||||
|
|
||||||
/** 食堂id */
|
/** 食堂id */
|
||||||
private Long canteenId;
|
private Long canteenId;
|
||||||
|
|
||||||
|
|
@ -117,10 +122,29 @@ public class OrderQueryParam implements Serializable
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime endDateTime;
|
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 searchValue;
|
||||||
|
|
||||||
|
private String custSearchInfo;
|
||||||
|
|
||||||
|
private String goodsSearchInfo;
|
||||||
|
|
||||||
|
private String encryptedCustSearchValue;
|
||||||
|
|
||||||
public OrderQueryParam() {
|
public OrderQueryParam() {
|
||||||
this.endDateTime = LocalDateTime.now().plusDays(7);
|
this.endDateTime = LocalDateTime.now().plusDays(7);
|
||||||
this.startDateTime = LocalDateTime.now().minusDays(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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="sourceType != null "> and oi.source_type = #{sourceType}</if>
|
<if test="sourceType != null "> and oi.source_type = #{sourceType}</if>
|
||||||
<if test="isOnline != null "> and oi.is_online = #{isOnline}</if>
|
<if test="isOnline != null "> and oi.is_online = #{isOnline}</if>
|
||||||
<if test="canteenId != null "> and oi.canteen_id = #{canteenId}</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">
|
<if test="canteenIdList != null and canteenIdList.size >0">
|
||||||
and oi.canteen_id in
|
and oi.canteen_id in
|
||||||
<foreach collection="canteenIdList" item="canteenId" open="(" separator="," close=")">
|
<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}, '%'))
|
and od.goods_name like concat('%', #{searchValue}, '%'))
|
||||||
)
|
)
|
||||||
</if>
|
</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>
|
</where>
|
||||||
order by oi.create_time desc
|
order by oi.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue