This commit is contained in:
parent
36651eafb5
commit
a4e4fc6e7f
|
|
@ -24,4 +24,9 @@ public class AccSubOperationQueryParam extends BaseEntity {
|
|||
private Integer tradeType;
|
||||
private String searchValue;
|
||||
private String createBy;
|
||||
|
||||
public AccSubOperationQueryParam() {
|
||||
this.endDateTime = LocalDateTime.now().plusDays(7);
|
||||
this.startDateTime = LocalDateTime.now().minusDays(7);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,4 +28,9 @@ public class AccountInfoQueryParam extends BaseEntity {
|
|||
// private BigDecimal walletMinAmount;
|
||||
// @ApiModelProperty("钱包最大金额")
|
||||
// private BigDecimal walletMaxAmount;
|
||||
|
||||
public AccountInfoQueryParam() {
|
||||
this.endDateTime = LocalDateTime.now().plusDays(7);
|
||||
this.startDateTime = LocalDateTime.now().minusDays(7);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,12 +41,10 @@ public class OrderInfoController extends BaseController
|
|||
*/
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(OrderQueryParam orderQueryParam)
|
||||
public TableDataInfo list(@RequestBody @Valid OrderQueryParam orderQueryParam)
|
||||
{
|
||||
startPage();
|
||||
OrderInfo orderInfo = new OrderInfo();
|
||||
BeanUtils.copyProperties(orderQueryParam, orderInfo);
|
||||
List<OrderInfo> list = orderInfoService.selectOrderInfoList(orderInfo);
|
||||
List<OrderInfo> list = orderInfoService.selectOrderInfoList(orderQueryParam);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
@ -55,9 +53,7 @@ public class OrderInfoController extends BaseController
|
|||
public TableDataInfo deviceList(@RequestBody @Valid OrderQueryParam orderQueryParam)
|
||||
{
|
||||
startPage();
|
||||
OrderInfo orderInfo = new OrderInfo();
|
||||
BeanUtils.copyProperties(orderQueryParam, orderInfo);
|
||||
List<OrderInfo> list = orderInfoService.selectOrderInfoList(orderInfo);
|
||||
List<OrderInfo> list = orderInfoService.selectOrderInfoList(orderQueryParam);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
@ -92,9 +88,9 @@ public class OrderInfoController extends BaseController
|
|||
@SysLog(title = "订单", module = "订单", businessType = OperaType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public void export(OrderInfo orderInfo, HttpServletResponse response)
|
||||
public void export(@RequestBody @Valid OrderQueryParam orderQueryParam, HttpServletResponse response)
|
||||
{
|
||||
List<OrderInfo> list = orderInfoService.selectOrderInfoList(orderInfo);
|
||||
List<OrderInfo> list = orderInfoService.selectOrderInfoList(orderQueryParam);
|
||||
ExcelUtil<OrderInfo> util = new ExcelUtil<OrderInfo>(OrderInfo.class);
|
||||
util.exportExcel(response, list, "订单数据");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,12 +45,11 @@ public class OrderShoppingCartController extends BaseController
|
|||
*/
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(@RequestBody OrderShoppingCartQueryParam orderShoppingCart)
|
||||
public AjaxResult list(@RequestBody OrderShoppingCartQueryParam orderShoppingCart)
|
||||
{
|
||||
ShoppingCartParamChecker.listCheck(orderShoppingCart);
|
||||
startPage();
|
||||
List<OrderShoppingCartVO> list = orderShoppingCartService.selectOrderShoppingCartList(orderShoppingCart);
|
||||
return getDataTable(list);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -69,10 +69,18 @@ public class OrderInfo extends BaseEntity
|
|||
@Excel(name = "食堂id")
|
||||
private Long canteenId;
|
||||
|
||||
/** 食堂名称 */
|
||||
@Excel(name = "食堂名称")
|
||||
private String canteenName;
|
||||
|
||||
/** 档口id */
|
||||
@Excel(name = "档口id")
|
||||
private Long stallId;
|
||||
|
||||
/** 档口名称 */
|
||||
@Excel(name = "档口名称")
|
||||
private String stallName;
|
||||
|
||||
/** 餐次类型 1-早餐 2-午餐 3-晚餐 4-下午茶 5-夜宵 */
|
||||
@Excel(name = "餐次类型 1-早餐 2-午餐 3-晚餐 4-下午茶 5-夜宵")
|
||||
private Integer mealtimeType;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,15 @@
|
|||
package com.bonus.canteen.core.order.domain.param;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
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.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
|
@ -14,13 +20,10 @@ import java.util.Date;
|
|||
*/
|
||||
|
||||
@Data
|
||||
public class OrderQueryParam
|
||||
public class OrderQueryParam implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 订单号 */
|
||||
private Long orderId;
|
||||
|
||||
/** 设备订单号 */
|
||||
private String deviceOrderId;
|
||||
|
||||
|
|
@ -31,7 +34,7 @@ public class OrderQueryParam
|
|||
private String deviceNum;
|
||||
|
||||
/** 人员编号 */
|
||||
@Excel(name = "人员编号")
|
||||
@NotNull(message = "用户ID不能为空")
|
||||
private Long userId;
|
||||
|
||||
/** 身份验证方式 1 刷卡 2 刷脸 3 扫码 */
|
||||
|
|
@ -98,4 +101,20 @@ public class OrderQueryParam
|
|||
/** 评论状态 1 已评论 2 未评论 */
|
||||
@Excel(name = "评论状态 1 已评论 2 未评论")
|
||||
private Integer commentState;
|
||||
|
||||
@ApiModelProperty("开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startDateTime;
|
||||
|
||||
@ApiModelProperty("结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endDateTime;
|
||||
|
||||
private String searchValue;
|
||||
|
||||
|
||||
public OrderQueryParam() {
|
||||
this.endDateTime = LocalDateTime.now().plusDays(7);
|
||||
this.startDateTime = LocalDateTime.now().minusDays(7);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.canteen.core.order.mapper;
|
|||
|
||||
import com.bonus.canteen.core.order.domain.OrderInfo;
|
||||
import com.bonus.canteen.core.order.domain.OrderPayResultDTO;
|
||||
import com.bonus.canteen.core.order.domain.param.OrderQueryParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -29,7 +30,7 @@ public interface OrderInfoMapper
|
|||
* @param orderInfo 订单
|
||||
* @return 订单集合
|
||||
*/
|
||||
public List<OrderInfo> selectOrderInfoList(OrderInfo orderInfo);
|
||||
public List<OrderInfo> selectOrderInfoList(OrderQueryParam orderQueryParam);
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ public class MenuModule {
|
|||
public Map<Integer, List<MenuRecipeDishesVO>> getMenuRecipeDish(MenuDishCheckDTO menuDishCheckDTO) {
|
||||
MenuRecipe menuRecipe = new MenuRecipe();
|
||||
menuRecipe.setApplyDate(menuDishCheckDTO.getApplyDate());
|
||||
menuRecipe.setCanteenIds(ListUtil.toList(menuDishCheckDTO.getCanteenId().toString()));
|
||||
menuRecipe.setStallIds(ListUtil.toList(menuDishCheckDTO.getStallId().toString()));
|
||||
menuRecipe.setCanteenId(menuDishCheckDTO.getCanteenId());
|
||||
menuRecipe.setStallId(menuDishCheckDTO.getStallId());
|
||||
menuRecipe.setKey(menuDishCheckDTO.getApplyType());
|
||||
Map<Integer, List<MenuRecipeDishesVO>> mealTimeTypeMap = new HashMap<>();
|
||||
List<MenuRecipeVO> menuRecipeList = menuRecipeService.selectMenuRecipeList(menuRecipe);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
package com.bonus.canteen.core.order.service;
|
||||
|
||||
import com.bonus.canteen.core.order.domain.OrderInfo;
|
||||
import com.bonus.canteen.core.order.domain.param.DeviceOrderAddParam;
|
||||
import com.bonus.canteen.core.order.domain.param.OrderAddParam;
|
||||
import com.bonus.canteen.core.order.domain.param.OrderInfoAddParam;
|
||||
import com.bonus.canteen.core.order.domain.param.ShopOrderAddParam;
|
||||
import com.bonus.canteen.core.order.domain.param.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -32,7 +29,7 @@ public interface IOrderInfoService
|
|||
* @param orderInfo 订单
|
||||
* @return 订单集合
|
||||
*/
|
||||
public List<OrderInfo> selectOrderInfoList(OrderInfo orderInfo);
|
||||
public List<OrderInfo> selectOrderInfoList(OrderQueryParam orderQueryParam);
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import com.bonus.canteen.core.order.domain.OrderPayDTO;
|
|||
import com.bonus.canteen.core.order.domain.OrderPayResultDTO;
|
||||
import com.bonus.canteen.core.order.domain.param.DeviceOrderAddParam;
|
||||
import com.bonus.canteen.core.order.domain.param.OrderAddParam;
|
||||
import com.bonus.canteen.core.order.domain.param.OrderQueryParam;
|
||||
import com.bonus.canteen.core.order.domain.param.ShopOrderAddParam;
|
||||
import com.bonus.canteen.core.order.mapper.OrderInfoMapper;
|
||||
import com.bonus.canteen.core.order.service.IOrderDetailService;
|
||||
|
|
@ -113,9 +114,18 @@ public class OrderInfoServiceImpl implements IOrderInfoService
|
|||
* @return 订单
|
||||
*/
|
||||
@Override
|
||||
public List<OrderInfo> selectOrderInfoList(OrderInfo orderInfo)
|
||||
public List<OrderInfo> selectOrderInfoList(OrderQueryParam orderQueryParam)
|
||||
{
|
||||
return orderInfoMapper.selectOrderInfoList(orderInfo);
|
||||
List<OrderInfo> orderInfoList = orderInfoMapper.selectOrderInfoList(orderQueryParam);
|
||||
if(CollUtil.isNotEmpty(orderInfoList)) {
|
||||
orderInfoList.forEach(order -> {
|
||||
OrderDetail orderDetail = new OrderDetail();
|
||||
orderDetail.setOrderId(order.getOrderId());
|
||||
List<OrderDetail> orderDetailList = orderDetailService.selectOrderDetailList(orderDetail);
|
||||
order.setOrderDetailList(orderDetailList);
|
||||
});
|
||||
}
|
||||
return orderInfoList;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -395,7 +395,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
INNER JOIN sys_user t2 ON t1.user_id = t2.user_id
|
||||
LEFT JOIN sys_dept t6 on t6.dept_id = t2.dept_id
|
||||
<include refid="queryAccountInfo_ref"/>
|
||||
order by t2.create_time desc
|
||||
order by t1.acc_id desc
|
||||
</select>
|
||||
|
||||
<select id="queryAccInfoBalanceSum" resultType="com.bonus.canteen.core.account.domain.vo.AccInfoDetailsVO">
|
||||
|
|
@ -439,10 +439,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</foreach>
|
||||
</if>
|
||||
<if test="accountInfoQueryParam.startDateTime != null">
|
||||
and t1.uptime <![CDATA[ >= ]]> #{accountInfoQueryParam.startDateTime}
|
||||
and t1.update_time <![CDATA[ >= ]]> #{accountInfoQueryParam.startDateTime}
|
||||
</if>
|
||||
<if test="accountInfoQueryParam.endDateTime != null">
|
||||
and t1.uptime <![CDATA[ <= ]]> #{accountInfoQueryParam.endDateTime}
|
||||
and t1.update_time <![CDATA[ <= ]]> #{accountInfoQueryParam.endDateTime}
|
||||
</if>
|
||||
<if test="accountInfoQueryParam.walletType != null">
|
||||
AND EXISTS(
|
||||
|
|
|
|||
|
|
@ -264,6 +264,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</if>
|
||||
</where>
|
||||
order by atwd.id desc
|
||||
</select>
|
||||
|
||||
<select id="queryTradeAndWallerInfoByOrderNo" resultType="com.bonus.canteen.core.account.domain.bo.TradeAndWallerInfo">
|
||||
|
|
|
|||
|
|
@ -14,7 +14,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="sourceType" column="source_type" />
|
||||
<result property="isOnline" column="is_online" />
|
||||
<result property="canteenId" column="canteen_id" />
|
||||
<result property="canteenName" column="canteen_name" />
|
||||
<result property="stallId" column="stall_id" />
|
||||
<result property="stallName" column="stall_name" />
|
||||
<result property="mealtimeType" column="mealtime_type" />
|
||||
<result property="mealtimeName" column="mealtime_name" />
|
||||
<result property="orderDate" column="order_date" />
|
||||
|
|
@ -46,55 +48,65 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectOrderInfoVo">
|
||||
select order_id, device_order_id, device_sn, device_num, user_id, identity_verification, source_type, is_online, canteen_id, stall_id, mealtime_type, mealtime_name, order_date, payable_amount, discounts_amount, real_amount, account_pay_amount, external_pay_amount, refund_amount, order_time, order_type, order_state, order_refund_state, deduction_type, pay_time, pay_type, pay_channel, pay_state, pay_param, delivery_amount, packing_amount, delivery_type, comment_state, remark, create_by, create_time, update_by, update_time from order_info
|
||||
select oi.order_id, oi.device_order_id, oi.device_sn, oi.device_num, oi.user_id,
|
||||
oi.identity_verification, oi.source_type, oi.is_online, oi.canteen_id, ac.canteen_name,
|
||||
oi.stall_id, ast.stall_name, oi.mealtime_type, oi.mealtime_name, oi.order_date, oi.payable_amount,
|
||||
oi.discounts_amount, oi.real_amount, oi.account_pay_amount, oi.external_pay_amount,
|
||||
oi.refund_amount, oi.order_time, oi.order_type, oi.order_state, oi.order_refund_state,
|
||||
oi.deduction_type, oi.pay_time, oi.pay_type, oi.pay_channel, oi.pay_state, oi.pay_param,
|
||||
oi.delivery_amount, oi.packing_amount, oi.delivery_type, oi.comment_state, oi.remark,
|
||||
oi.create_by, oi.create_time, oi.update_by, oi.update_time
|
||||
from order_info oi
|
||||
left join alloc_canteen ac on ac.canteen_id = oi.canteen_id
|
||||
left join alloc_stall ast on ast.stall_id = oi.stall_id
|
||||
</sql>
|
||||
|
||||
<select id="selectOrderInfoList" parameterType="com.bonus.canteen.core.order.domain.OrderInfo" resultMap="OrderInfoResult">
|
||||
<select id="selectOrderInfoList" parameterType="com.bonus.canteen.core.order.domain.param.OrderQueryParam" resultMap="OrderInfoResult">
|
||||
<include refid="selectOrderInfoVo"/>
|
||||
<where>
|
||||
<if test="deviceOrderId != null and deviceOrderId != ''"> and device_order_id = #{deviceOrderId}</if>
|
||||
<if test="deviceSn != null and deviceSn != ''"> and device_sn = #{deviceSn}</if>
|
||||
<if test="deviceNum != null and deviceNum != ''"> and device_num = #{deviceNum}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="identityVerification != null "> and identity_verification = #{identityVerification}</if>
|
||||
<if test="sourceType != null "> and source_type = #{sourceType}</if>
|
||||
<if test="isOnline != null "> and is_online = #{isOnline}</if>
|
||||
<if test="canteenId != null "> and canteen_id = #{canteenId}</if>
|
||||
<if test="stallId != null "> and stall_id = #{stallId}</if>
|
||||
<if test="mealtimeType != null "> and mealtime_type = #{mealtimeType}</if>
|
||||
<if test="mealtimeName != null and mealtimeName != ''"> and mealtime_name like concat('%', #{mealtimeName}, '%')</if>
|
||||
<if test="orderDate != null "> and order_date = #{orderDate}</if>
|
||||
<if test="payableAmount != null "> and payable_amount = #{payableAmount}</if>
|
||||
<if test="discountsAmount != null "> and discounts_amount = #{discountsAmount}</if>
|
||||
<if test="realAmount != null "> and real_amount = #{realAmount}</if>
|
||||
<if test="accountPayAmount != null "> and account_pay_amount = #{accountPayAmount}</if>
|
||||
<if test="externalPayAmount != null "> and external_pay_amount = #{externalPayAmount}</if>
|
||||
<if test="refundAmount != null "> and refund_amount = #{refundAmount}</if>
|
||||
<if test="orderTime != null "> and order_time = #{orderTime}</if>
|
||||
<if test="orderType != null "> and order_type = #{orderType}</if>
|
||||
<if test="orderState != null "> and order_state = #{orderState}</if>
|
||||
<if test="orderRefundState != null "> and order_refund_state = #{orderRefundState}</if>
|
||||
<if test="deductionType != null "> and deduction_type = #{deductionType}</if>
|
||||
<if test="payTime != null "> and pay_time = #{payTime}</if>
|
||||
<if test="payType != null "> and pay_type = #{payType}</if>
|
||||
<if test="payChannel != null "> and pay_channel = #{payChannel}</if>
|
||||
<if test="payState != null "> and pay_state = #{payState}</if>
|
||||
<if test="payParam != null and payParam != ''"> and pay_param = #{payParam}</if>
|
||||
<if test="deliveryAmount != null "> and delivery_amount = #{deliveryAmount}</if>
|
||||
<if test="packingAmount != null "> and packing_amount = #{packingAmount}</if>
|
||||
<if test="deliveryType != null "> and delivery_type = #{deliveryType}</if>
|
||||
<if test="commentState != null "> and comment_state = #{commentState}</if>
|
||||
<if test="deviceOrderId != null and deviceOrderId != ''"> and oi.device_order_id = #{deviceOrderId}</if>
|
||||
<if test="deviceSn != null and deviceSn != ''"> and oi.device_sn = #{deviceSn}</if>
|
||||
<if test="deviceNum != null and deviceNum != ''"> and oi.device_num = #{deviceNum}</if>
|
||||
<if test="userId != null "> and oi.user_id = #{userId}</if>
|
||||
<if test="identityVerification != null "> and oi.identity_verification = #{identityVerification}</if>
|
||||
<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="stallId != null "> and oi.stall_id = #{stallId}</if>
|
||||
<if test="mealtimeType != null "> and oi.mealtime_type = #{mealtimeType}</if>
|
||||
<if test="orderDate != null "> and oi.order_date = #{orderDate}</if>
|
||||
<if test="orderTime != null "> and oi.order_time = #{orderTime}</if>
|
||||
<if test="orderType != null "> and oi.order_type = #{orderType}</if>
|
||||
<if test="orderState != null "> and oi.order_state = #{orderState}</if>
|
||||
<if test="orderRefundState != null "> and oi.order_refund_state = #{orderRefundState}</if>
|
||||
<if test="deductionType != null "> and oi.deduction_type = #{deductionType}</if>
|
||||
<if test="payTime != null "> and oi.pay_time = #{payTime}</if>
|
||||
<if test="payType != null "> and oi.pay_type = #{payType}</if>
|
||||
<if test="payChannel != null "> and oi.pay_channel = #{payChannel}</if>
|
||||
<if test="payState != null "> and oi.pay_state = #{payState}</if>
|
||||
<if test="commentState != null "> and oi.comment_state = #{commentState}</if>
|
||||
<if test="startDateTime != null "> and oi.create_time <![CDATA[ >= ]]> #{startDateTime}</if>
|
||||
<if test="endDateTime != null "> and oi.create_time <![CDATA[ <= ]]> #{endDateTime}</if>
|
||||
<if test="searchValue != null ">
|
||||
and (ac.canteen_name like concat('%', #{searchValue}, '%')
|
||||
or ast.stall_name like concat('%', #{searchValue}, '%')
|
||||
or EXISTS (select 1 from order_detail od
|
||||
where oi.order_id = od.order_id
|
||||
and od.goods_name like concat('%', #{searchValue}, '%'))
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
order by oi.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectOrderInfoByOrderId" parameterType="Long" resultMap="OrderInfoResult">
|
||||
<include refid="selectOrderInfoVo"/>
|
||||
where order_id = #{orderId}
|
||||
where oi.order_id = #{orderId}
|
||||
</select>
|
||||
|
||||
<select id="selectOrderInfoByDeviceOrderId" parameterType="String" resultMap="OrderInfoResult">
|
||||
<include refid="selectOrderInfoVo"/>
|
||||
where device_order_id = #{orderId}
|
||||
where oi.device_order_id = #{orderId}
|
||||
</select>
|
||||
|
||||
<insert id="insertOrderInfo" parameterType="com.bonus.canteen.core.order.domain.OrderInfo">
|
||||
|
|
|
|||
Loading…
Reference in New Issue