已完成:场地预定流程

This commit is contained in:
gxwebsoft
2024-05-15 15:37:57 +08:00
parent 08ce525c94
commit 8d9931e46e
29 changed files with 454 additions and 333 deletions
@@ -1,6 +1,15 @@
package com.gxwebsoft.booking.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.booking.entity.Field;
import com.gxwebsoft.booking.param.FieldParam;
import com.gxwebsoft.booking.service.FieldService;
import com.gxwebsoft.common.core.utils.RedisUtil;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.booking.service.PeriodService;
import com.gxwebsoft.booking.entity.Period;
@@ -11,13 +20,18 @@ import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.shop.entity.OrderInfo;
import com.gxwebsoft.shop.service.OrderInfoService;
import com.gxwebsoft.shop.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
* 场地时段控制器
@@ -31,6 +45,12 @@ import java.util.List;
public class PeriodController extends BaseController {
@Resource
private PeriodService periodService;
@Resource
private FieldService fieldService;
@Resource
private OrderInfoService orderInfoService;
@Resource
private RedisUtil redisUtil;
@ApiOperation("分页查询场地时段")
@GetMapping("/page")
@@ -49,7 +69,53 @@ public class PeriodController extends BaseController {
final String startTime = String.format("%02d", hour).concat(String.format("%02d", minute));
param.setStartTime(startTime);
}
return success(periodService.listRel(param));
if (param.getDateTime() == null) {
return success(periodService.listRel(param));
}
/* ====== 查询可预定时间段 ====== */
List<Period> list = periodService.listRel(param);
// 为空处理
if (CollectionUtils.isEmpty(list)) {
return fail("该场馆没有添加时间段,或预约时间已过",list);
}
// 今日订单信息 按Key分组(组合规则:日期+时间段+场馆id+场地id)
Map<String, List<OrderInfo>> collectKey;
List<OrderInfo> orderInfoList = orderInfoService.list(new LambdaQueryWrapper<OrderInfo>().eq(OrderInfo::getDateTime, param.getDateTime()).eq(OrderInfo::getMerchantId,param.getMerchantId()));
collectKey = orderInfoList.stream().collect(Collectors.groupingBy(OrderInfo::getOrderCode));
final FieldParam fieldParam = new FieldParam();
fieldParam.setIsStatus(param.getIsStatus());
fieldParam.setMerchantId(param.getMerchantId());
List<Field> fields = fieldService.listRel(fieldParam);
redisUtil.set(param.getMerchantId().toString(),fields);
list.forEach(d -> {
// 查询可预定场地
final String string = redisUtil.get(param.getMerchantId().toString());
// 字符串转集合(从redis取数据并转为List)
final List<Field> fieldList = JSONObject.parseArray(string, Field.class);
fieldList.forEach(f -> {
final String key = getKey(param.getDateTime().concat(d.getTimePeriod().concat(d.getMerchantId().toString()).concat(f.getFieldId().toString())));
final List<OrderInfo> orderInfos = collectKey.get(key);
if (!CollectionUtils.isEmpty(orderInfos)) {
final OrderInfo orderInfo = orderInfos.get(0);
if (orderInfo.getOrderCode().equals(key)) {
f.setSold(true);
}
}
f.setOrderKey(key);
f.setTimePeriod(d.getTimePeriod());
f.setPeriodId(d.getPeriodId());
f.setPrice(d.getPrice());
});
d.setFieldList(fieldList);
});
return success(list);
}
@PreAuthorize("hasAuthority('booking:period:list')")
@@ -119,4 +185,11 @@ public class PeriodController extends BaseController {
return fail("删除失败");
}
private String getKey (String text){
text = text.replaceAll(" +","");
text = text.replaceAll("-","");
text = text.replaceAll(":","");
return text;
}
}
@@ -1,13 +1,18 @@
package com.gxwebsoft.booking.entity;
import cn.hutool.core.clone.CloneSupport;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.gxwebsoft.shop.entity.OrderInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -23,7 +28,7 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Field对象", description = "场馆场地")
@TableName("booking_field")
public class Field implements Serializable {
public class Field extends CloneSupport<Field> implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "field_id", type = IdType.AUTO)
@@ -71,12 +76,32 @@ public class Field implements Serializable {
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "是否被占用")
@ApiModelProperty(value = "订单信息")
@TableField(exist = false)
private Boolean isOccupied;
private List<OrderInfo> orderInfoList;
@ApiModelProperty(value = "1全场,2半场")
@ApiModelProperty(value = "已售")
@TableField(exist = false)
private Integer type;
private Boolean sold;
@ApiModelProperty(value = "已售半场")
@TableField(exist = false)
private Boolean half;
@ApiModelProperty(value = "数据组合")
@TableField(exist = false)
private String orderKey;
@ApiModelProperty(value = "时间段ID")
@TableField(exist = false)
private Integer periodId;
@ApiModelProperty(value = "时间段")
@TableField(exist = false)
private String timePeriod;
@ApiModelProperty(value = "场地价格")
@TableField(exist = false)
private BigDecimal price;
}
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -77,4 +78,8 @@ public class Period implements Serializable {
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "该时间段内的场地列表")
private List<Field> fieldList;
}
@@ -76,4 +76,12 @@ public class PeriodParam extends BaseParam {
@QueryField(type = QueryType.EQ)
private Integer status;
@ApiModelProperty(value = "预定日期")
@QueryField(type = QueryType.EQ)
private String dateTime;
@ApiModelProperty(value = "是否半场")
@QueryField(type = QueryType.EQ)
private Boolean half;
}
@@ -3,9 +3,11 @@ package com.gxwebsoft.booking.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.booking.entity.Field;
import com.gxwebsoft.booking.entity.Period;
import com.gxwebsoft.booking.mapper.FieldMapper;
import com.gxwebsoft.booking.param.FieldParam;
import com.gxwebsoft.booking.service.FieldService;
import com.gxwebsoft.booking.service.PeriodService;
import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.shop.entity.OrderInfo;
@@ -16,11 +18,8 @@ import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import static com.gxwebsoft.common.core.constants.OrderConstants.PAY_STATUS_SUCCESS;
/**
* 场馆场地Service实现
*
@@ -32,6 +31,8 @@ public class FieldServiceImpl extends ServiceImpl<FieldMapper, Field> implements
@Resource
private OrderInfoService orderInfoService;
@Resource
private PeriodService periodService;
@Override
public PageResult<Field> pageRel(FieldParam param) {
@@ -47,27 +48,6 @@ public class FieldServiceImpl extends ServiceImpl<FieldMapper, Field> implements
// 排序
PageParam<Field, FieldParam> page = new PageParam<>();
page.setDefaultOrder("sort_number desc, create_time desc");
// 是否已被预定
if (param.getDateTime() != null) {
System.out.println("是否已被预定 = ");
System.out.println("param = " + param);
final List<OrderInfo> orderInfoList = orderInfoService.list(new LambdaQueryWrapper<OrderInfo>().eq(OrderInfo::getOrderTime, param.getDateTime()).eq(OrderInfo::getPayStatus,1).or().eq(OrderInfo::getPayStatus,3));
System.out.println("orderInfoList = " + orderInfoList);
if (!CollectionUtils.isEmpty(orderInfoList)) {
Map<Integer, List<OrderInfo>> collect = orderInfoList.stream().collect(Collectors.groupingBy(OrderInfo::getFid));
System.out.println("collect = " + collect);
for (Field item: list){
System.out.println("item = " + item);
System.out.println("collect.get(item.getFieldId()) = " + collect.get(item.getFieldId()));
final List<OrderInfo> orderInfos = collect.get(item.getFieldId());
if (!CollectionUtils.isEmpty(orderInfos)) {
item.setIsOccupied(true);
OrderInfo orderInfo = orderInfos.get(0);
item.setType(orderInfo.getType());
}
}
}
}
return page.sortRecords(list);
}
@@ -84,7 +84,6 @@ public class WebsiteController extends BaseController {
String key = "SiteInfo:" + tenantId;
final String siteInfo = redisUtil.get(key);
String access_token = JwtUtil.getAccessToken(request);
System.out.println("access_token = " + access_token);
// redisUtil.set("Domain:ffai.cn",10157);
// redisUtil.set("Domain:www.xn--15qx69a6lbn8t0tlmve.com",10157);
// redisUtil.set("Domain:xn--15qx69a6lbn8t0tlmve.com",10157);
@@ -1,10 +1,8 @@
package com.gxwebsoft.shop.controller;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.shop.entity.OrderInfo;
import com.gxwebsoft.shop.service.OrderInfoService;
@@ -17,13 +15,6 @@ import com.gxwebsoft.common.core.web.PageParam;
import com.gxwebsoft.common.core.web.BatchParam;
import com.gxwebsoft.common.core.annotation.OperationLog;
import com.gxwebsoft.common.system.entity.User;
import com.wechat.pay.java.core.Config;
import com.wechat.pay.java.core.RSAConfig;
import com.wechat.pay.java.service.payments.jsapi.JsapiServiceExtension;
import com.wechat.pay.java.service.payments.jsapi.model.Amount;
import com.wechat.pay.java.service.payments.jsapi.model.Payer;
import com.wechat.pay.java.service.payments.jsapi.model.PrepayRequest;
import com.wechat.pay.java.service.payments.jsapi.model.PrepayWithRequestPaymentResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -31,19 +22,15 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
/**
* 预约订单控制器
* 订单控制器
*
* @author 科技小王子
* @since 2024-04-25 22:01:33
* @since 2024-05-14 13:20:04
*/
@Api(tags = "预约订单管理")
@Api(tags = "订单管理")
@RestController
@RequestMapping("/api/shop/order")
public class OrderController extends BaseController {
@@ -52,15 +39,14 @@ public class OrderController extends BaseController {
@Resource
private OrderInfoService orderInfoService;
@ApiOperation("分页查询预约订单")
@ApiOperation("分页查询订单")
@GetMapping("/page")
public ApiResult<PageResult<Order>> page(OrderParam param) {
// 使用关联查询
return success(orderService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:order:list')")
@ApiOperation("查询全部预约订单")
@ApiOperation("查询全部订单")
@GetMapping()
public ApiResult<List<Order>> list(OrderParam param) {
// 使用关联查询
@@ -68,7 +54,7 @@ public class OrderController extends BaseController {
}
@PreAuthorize("hasAuthority('shop:order:list')")
@ApiOperation("根据id查询预约订单")
@ApiOperation("根据id查询订单")
@GetMapping("/{id}")
public ApiResult<Order> get(@PathVariable("id") Integer id) {
// 使用关联查询
@@ -79,21 +65,22 @@ public class OrderController extends BaseController {
@ApiOperation("下单")
@PostMapping()
public ApiResult<?> save(@RequestBody Order order) {
System.out.println("order = " + order);
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser == null) {
return fail("请先登录");
}
// 微信openid(必填)
if(StrUtil.isBlank(loginUser.getOpenid())){
if (StrUtil.isBlank(loginUser.getOpenid())) {
return fail("微信openid(必填)");
}
// 商品描述(必填)
if(StrUtil.isBlank(order.getComments())){
if (StrUtil.isBlank(order.getComments())) {
return fail("商品描述(必填)");
}
// 微信支付(商品金额不能为0)
if(order.getPayType().equals(1)){
if (order.getPayType().equals(1)) {
if (order.getTotalPrice().compareTo(BigDecimal.ZERO) == 0) {
return fail("商品金额不能为0");
}
@@ -109,26 +96,28 @@ public class OrderController extends BaseController {
order.setPhone(loginUser.getPhone());
order.setUserId(loginUser.getUserId());
// List<Date> collect = order.getOrderInfoList().stream().map(OrderInfo::getStartTime).collect(Collectors.toList());
OrderInfo orderInfo = order.getOrderInfoList().get(0);
order.setStartTime(DateUtil.formatTime(orderInfo.getStartTime()));
order.setVersion(10);
// OrderInfo orderInfo = order.getOrderInfoList().get(0);
// order.setStartTime(DateUtil.formatTime(orderInfo.getStartTime()));
// order.setVersion(10);
System.out.println("order = " + order);
if (orderService.save(order)) {
order.getOrderInfoList().forEach(d -> {
d.setOid(order.getOrderId());
d.setOrderId(order.getOrderId());
d.setTimeFlag(timeMillis);
d.setVersion(10);
d.setOrderTime(d.getOrderTime());
d.setUserId(getLoginUser().getUserId());
d.setDateTime(d.getDateTime());
});
orderInfoService.saveBatch(order.getOrderInfoList());
// 创建微信订单
if (order.getPayType().equals(1)) {
return success("下单成功",orderService.createWxOrder(order));
return success("下单成功", orderService.createWxOrder(order));
}
}
return fail("下单失败");
}
@ApiOperation("修改预约订单")
@ApiOperation("修改订单")
@PutMapping()
public ApiResult<?> update(@RequestBody Order order) {
if (orderService.updateById(order)) {
@@ -137,7 +126,7 @@ public class OrderController extends BaseController {
return fail("修改失败");
}
@ApiOperation("删除预约订单")
@ApiOperation("删除订单")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (orderService.removeById(id)) {
@@ -146,7 +135,7 @@ public class OrderController extends BaseController {
return fail("删除失败");
}
@ApiOperation("批量添加预约订单")
@ApiOperation("批量添加订单")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<Order> list) {
if (orderService.saveBatch(list)) {
@@ -155,7 +144,7 @@ public class OrderController extends BaseController {
return fail("添加失败");
}
@ApiOperation("批量修改预约订单")
@ApiOperation("批量修改订单")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<Order> batchParam) {
if (batchParam.update(orderService, "order_id")) {
@@ -164,7 +153,7 @@ public class OrderController extends BaseController {
return fail("修改失败");
}
@ApiOperation("批量删除预约订单")
@ApiOperation("批量删除订单")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (orderService.removeByIds(ids)) {
@@ -19,26 +19,26 @@ import javax.annotation.Resource;
import java.util.List;
/**
* 控制器
* 场地控制器
*
* @author 科技小王子
* @since 2024-05-13 19:50:43
* @since 2024-05-14 13:20:04
*/
@Api(tags = "管理")
@Api(tags = "场地管理")
@RestController
@RequestMapping("/api/shop/order-info")
public class OrderInfoController extends BaseController {
@Resource
private OrderInfoService orderInfoService;
@ApiOperation("分页查询")
@ApiOperation("分页查询场地")
@GetMapping("/page")
public ApiResult<PageResult<OrderInfo>> page(OrderInfoParam param) {
// 使用关联查询
return success(orderInfoService.pageRel(param));
}
@ApiOperation("查询全部")
@ApiOperation("查询全部场地")
@GetMapping()
public ApiResult<List<OrderInfo>> list(OrderInfoParam param) {
// 使用关联查询
@@ -46,28 +46,28 @@ public class OrderInfoController extends BaseController {
}
@PreAuthorize("hasAuthority('shop:orderInfo:list')")
@ApiOperation("根据id查询")
@ApiOperation("根据id查询场地")
@GetMapping("/{id}")
public ApiResult<OrderInfo> get(@PathVariable("id") Integer id) {
// 使用关联查询
return success(orderInfoService.getByIdRel(id));
}
@ApiOperation("添加")
@ApiOperation("添加场地")
@PostMapping()
public ApiResult<?> save(@RequestBody OrderInfo orderInfo) {
// 记录当前登录用户id
User loginUser = getLoginUser();
if (loginUser != null) {
orderInfo.setUserId(loginUser.getUserId());
}
// User loginUser = getLoginUser();
// if (loginUser != null) {
// orderInfo.setUserId(loginUser.getUserId());
// }
if (orderInfoService.save(orderInfo)) {
return success("添加成功");
}
return fail("添加失败");
}
@ApiOperation("修改")
@ApiOperation("修改场地")
@PutMapping()
public ApiResult<?> update(@RequestBody OrderInfo orderInfo) {
if (orderInfoService.updateById(orderInfo)) {
@@ -76,7 +76,7 @@ public class OrderInfoController extends BaseController {
return fail("修改失败");
}
@ApiOperation("删除")
@ApiOperation("删除场地")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
if (orderInfoService.removeById(id)) {
@@ -85,7 +85,7 @@ public class OrderInfoController extends BaseController {
return fail("删除失败");
}
@ApiOperation("批量添加")
@ApiOperation("批量添加场地")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<OrderInfo> list) {
if (orderInfoService.saveBatch(list)) {
@@ -94,7 +94,7 @@ public class OrderInfoController extends BaseController {
return fail("添加失败");
}
@ApiOperation("批量修改")
@ApiOperation("批量修改场地")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<OrderInfo> batchParam) {
if (batchParam.update(orderInfoService, "id")) {
@@ -103,7 +103,7 @@ public class OrderInfoController extends BaseController {
return fail("修改失败");
}
@ApiOperation("批量删除")
@ApiOperation("批量删除场地")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
if (orderInfoService.removeByIds(ids)) {
@@ -22,7 +22,7 @@ import java.util.List;
* 订单核销控制器
*
* @author 科技小王子
* @since 2024-05-03 11:15:22
* @since 2024-05-14 13:20:04
*/
@Api(tags = "订单核销管理")
@RestController
@@ -8,6 +8,7 @@ import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.shop.entity.Order;
import com.gxwebsoft.shop.entity.Payment;
import com.gxwebsoft.shop.service.OrderService;
import com.sun.xml.internal.bind.v2.TODO;
import com.wechat.pay.java.core.notification.NotificationConfig;
import com.wechat.pay.java.core.notification.NotificationParser;
import com.wechat.pay.java.core.notification.RSANotificationConfig;
@@ -22,9 +23,6 @@ import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Map;
import static com.gxwebsoft.common.core.constants.OrderConstants.PAY_STATUS_NO_PAY;
import static com.gxwebsoft.common.core.constants.OrderConstants.PAY_STATUS_SUCCESS;
/**
* 会员特权购买记录表控制器
*
@@ -102,22 +100,25 @@ public class WxPayNotifyController extends BaseController {
if (StrUtil.equals("支付成功", tradeStateDesc)) {
// 1. 查询要处理的订单
Order order = orderService.getByOutTradeNo(outTradeNo);
System.out.println("order = " + order);
// 2. 已支付则跳过
if (order.getPayStatus().equals(PAY_STATUS_SUCCESS)) {
if (order.getPayStatus().equals(true)) {
return "SUCCESS";
}
// 2. 未支付则处理更新订单状态
if (order.getPayStatus().equals(PAY_STATUS_NO_PAY)) {
if (order.getPayStatus().equals(false)) {
// 5. TODO 处理订单状态
order.setPayTime(DateUtil.date());
order.setPayStatus(PAY_STATUS_SUCCESS);
order.setPayStatus(true);
order.setTransactionId(transactionId);
// 实际付款金额:Integer除以100后转BigDecimal
DecimalFormat df = new DecimalFormat("0.00");
final String format = df.format(total / 100);
order.setPayPrice(new BigDecimal(format));
System.out.println("实际付款金额 = " + order);
orderService.updateByOutTradeNo(order);
// 6. TODO 同步更新订单明细的支付状态
return "SUCCESS";
}
}
@@ -4,6 +4,7 @@ import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.*;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@@ -14,14 +15,14 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 预约订单
* 订单
*
* @author 科技小王子
* @since 2024-04-25 22:01:33
* @since 2024-05-14 13:20:04
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "Order对象", description = "预约订单")
@ApiModel(value = "Order对象", description = "订单")
@TableName("shop_order")
public class Order implements Serializable {
private static final long serialVersionUID = 1L;
@@ -34,31 +35,28 @@ public class Order implements Serializable {
private String orderNo;
@ApiModelProperty(value = "微信支付订单号")
private String wechatOrder;
private String transactionId;
@ApiModelProperty(value = "微信退款订单号")
private String refundOrder;
@ApiModelProperty(value = "场馆id用于权限判断")
@ApiModelProperty(value = "商户ID")
private Integer merchantId;
@ApiModelProperty(value = "用户id")
private Integer userId;
@ApiModelProperty(value = "使用的优惠券id")
private Integer couponId;
@ApiModelProperty(value = "使用的会员卡id")
private Integer cardId;
private String cardId;
@ApiModelProperty(value = "关联管理员id")
private Integer aid;
@ApiModelProperty(value = "核销管理员id")
private Integer adminId;
@ApiModelProperty(value = "核销管理员id")
private Integer confirmId;
@ApiModelProperty(value = "IC卡号")
private String code;
private String icCard;
@ApiModelProperty(value = "真实姓名")
private String realName;
@@ -90,27 +88,24 @@ public class Order implements Serializable {
@ApiModelProperty(value = "教练id")
private Integer coachId;
@ApiModelProperty(value = "支付流水号")
private String transactionId;
@ApiModelProperty(value = "1微信支付,2积分,3支付宝,4现金,5POS机,6VIP月卡,7VIP年卡,8VIP次卡,9IC月卡,10IC年卡,11IC次卡,12免费,13VIP充值卡,14IC充值卡,15积分支付,16VIP季卡,17IC季卡")
@ApiModelProperty(value = "0余额支付, 1微信支付,2积分,3支付宝,4现金,5POS机,6VIP月卡,7VIP年卡,8VIP次卡,9IC月卡,10IC年卡,11IC次卡,12免费,13VIP充值卡,14IC充值卡,15积分支付,16VIP季卡,17IC季卡")
private Integer payType;
@ApiModelProperty(value = "1已付款,2未付款")
private Integer payStatus;
@ApiModelProperty(value = "0未付款,1已付款")
private Boolean payStatus;
@ApiModelProperty(value = "1已完成,2未使用,3已取消,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款")
@ApiModelProperty(value = "0未使用,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款")
private Integer orderStatus;
@ApiModelProperty(value = "优惠类型:0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡,5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡")
private Integer type;
private Integer couponType;
@ApiModelProperty(value = "优惠说明")
private String couponDesc;
@ApiModelProperty(value = "二维码地址,保存订单号,支付成功后才生成")
private String qrcode;
@ApiModelProperty(value = "优惠说明")
private String desc;
@ApiModelProperty(value = "vip月卡年卡、ic月卡年卡回退次数")
private Integer returnNum;
@@ -120,49 +115,48 @@ public class Order implements Serializable {
@ApiModelProperty(value = "预约详情开始时间数组")
private String startTime;
@ApiModelProperty(value = "是否已开具发票:1已开发票,2未开发票,3不能开具发票")
private Integer isInvoice;
@ApiModelProperty(value = "是否已开具发票:0未开发票,1已开发票,2不能开具发票")
private Boolean isInvoice;
@ApiModelProperty(value = "下单时间")
private Long addTime;
private Integer updateTime;
@ApiModelProperty(value = "付款时间")
@ApiModelProperty(value = "支付时间")
private Date payTime;
@ApiModelProperty(value = "退款时间")
private Integer refundTime;
private Date refundTime;
@ApiModelProperty(value = "申请退款时间")
private Integer refundApplyTime;
private Date refundApplyTime;
@ApiModelProperty(value = "对账情况:1=已对账;2=未对账;3=已对账,金额对不上;4=未查询到该订单")
@ApiModelProperty(value = "对账情况:0=未对账;1=已对账;3=已对账,金额对不上;4=未查询到该订单")
private Integer checkBill;
@ApiModelProperty(value = "系统版本")
@ApiModelProperty(value = "订单是否已结算(0未结算 1已结算)")
private Integer isSettled;
@ApiModelProperty(value = "系统版本号 0当前版本 value=其他版本")
private Integer version;
@ApiModelProperty(value = "用户id")
private Integer userId;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "排序号")
private Integer sortNumber;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@TableLogic
private Integer deleted;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "商户名称")
@TableField(exist = false)
private String merchantName;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
@ApiModelProperty(value = "商户图标")
@TableField(exist = false)
private String merchantAvatar;
@ApiModelProperty(value = "创建时间")
private Date createTime;
@ApiModelProperty(value = "微信OPENID,用于微信支付")
@TableField(exist = false)
@@ -5,7 +5,9 @@ import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDate;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalTime;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
@@ -16,36 +18,40 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
/**
*
* 场地
*
* @author 科技小王子
* @since 2024-05-13 19:50:43
* @since 2024-05-14 13:20:04
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "OrderInfo对象", description = "")
@ApiModel(value = "OrderInfo对象", description = "场地")
@TableName("shop_order_info")
public class OrderInfo implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "自增ID")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "关联订单表id")
private Integer oid;
private Integer orderId;
@ApiModelProperty(value = "关联场馆id")
private Integer sid;
@ApiModelProperty(value = "组合数据:日期+时间段+场馆id+场地id")
private String orderCode;
@ApiModelProperty(value = "关联商户ID")
private Integer merchantId;
@ApiModelProperty(value = "商户名称")
private String merchantName;
@ApiModelProperty(value = "关联场地id")
private Integer fid;
private Integer fieldId;
@ApiModelProperty(value = "场地")
@ApiModelProperty(value = "场地名称")
private String fieldName;
@ApiModelProperty(value = "预约时间段")
private String timePeriod;
@ApiModelProperty(value = "单价")
private BigDecimal price;
@@ -58,42 +64,46 @@ public class OrderInfo implements Serializable {
@ApiModelProperty(value = "儿童人数")
private Integer childrenNum;
@ApiModelProperty(value = "1已付款,2未付款,3无需付款或占用状态")
@ApiModelProperty(value = "0 未付款 1已付款,2无需付款或占用状态")
private Integer payStatus;
@ApiModelProperty(value = "是否免费:1免费、2收费")
private Integer isFree;
@ApiModelProperty(value = "是否免费:0收费、1免费")
private Boolean isFree;
@ApiModelProperty(value = "是否支持儿童票:1支持,2不支持")
private Integer isChildren;
@ApiModelProperty(value = "是否支持儿童票:0不支持、1支持")
private Boolean isChildren;
@ApiModelProperty(value = "系统版本号 10新版 0旧版")
@ApiModelProperty(value = "系统版本 0当前版本 其他版本")
private Integer version;
@ApiModelProperty(value = "预订类型:1全场,2半场")
private Integer type;
@ApiModelProperty(value = "预订类型:0全场,1半场")
private Boolean isHalf;
@ApiModelProperty(value = "组合数据:日期+时间段+场馆id+场地id")
private String mergeData;
@ApiModelProperty(value = "预约时间段")
private String timePeriod;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "预定日期")
private String dateTime;
@ApiModelProperty(value = "开场时间")
private Date startTime;
private String startTime;
@ApiModelProperty(value = "下单时间")
private Date orderTime;
@ApiModelProperty(value = "结束时间")
private String endTime;
@ApiModelProperty(value = "毫秒时间戳")
private Long timeFlag;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "用户id")
private Integer userId;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "创建时间")
@@ -3,7 +3,10 @@ package com.gxwebsoft.shop.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -13,7 +16,7 @@ import lombok.EqualsAndHashCode;
* 订单核销
*
* @author 科技小王子
* @since 2024-05-03 11:15:22
* @since 2024-05-14 13:20:04
*/
@Data
@EqualsAndHashCode(callSuper = false)
@@ -26,21 +29,21 @@ public class OrderInfoLog implements Serializable {
private Integer id;
@ApiModelProperty(value = "关联订单表id")
private Integer oid;
private Integer orderId;
@ApiModelProperty(value = "关联场馆id")
private Integer sid;
@ApiModelProperty(value = "关联商户ID")
private Integer merchantId;
@ApiModelProperty(value = "关联场地id")
private Integer fid;
private Integer fieldId;
@ApiModelProperty(value = "核销数量")
private Boolean useNum;
@ApiModelProperty(value = "核销时间")
private Integer createTime;
@ApiModelProperty(value = "租户id")
private Integer tenantId;
@ApiModelProperty(value = "创建时间")
private Date createTime;
}
@@ -12,7 +12,7 @@ import java.util.List;
* 订单核销Mapper
*
* @author 科技小王子
* @since 2024-05-03 11:15:22
* @since 2024-05-14 13:20:04
*/
public interface OrderInfoLogMapper extends BaseMapper<OrderInfoLog> {
@@ -9,10 +9,10 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Mapper
* 场地Mapper
*
* @author 科技小王子
* @since 2024-05-13 19:50:43
* @since 2024-05-14 13:20:04
*/
public interface OrderInfoMapper extends BaseMapper<OrderInfo> {
@@ -10,10 +10,10 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 预约订单Mapper
* 订单Mapper
*
* @author 科技小王子
* @since 2024-04-25 22:01:33
* @since 2024-05-14 13:20:04
*/
public interface OrderMapper extends BaseMapper<Order> {
@@ -37,7 +37,7 @@ public interface OrderMapper extends BaseMapper<Order> {
@InterceptorIgnore(tenantLine = "true")
List<Order> getByOutTradeNo(OrderParam param);
List<Order> getByOutTradeNo(@Param("param") OrderParam param);
@InterceptorIgnore(tenantLine = "true")
void updateByOutTradeNo(@Param("param") Order outTradeNo);
@@ -10,14 +10,14 @@
<if test="param.id != null">
AND a.id = #{param.id}
</if>
<if test="param.oid != null">
AND a.oid = #{param.oid}
<if test="param.orderId != null">
AND a.order_id = #{param.orderId}
</if>
<if test="param.sid != null">
AND a.sid = #{param.sid}
<if test="param.merchantId != null">
AND a.merchant_id = #{param.merchantId}
</if>
<if test="param.fid != null">
AND a.fid = #{param.fid}
<if test="param.fieldId != null">
AND a.field_id = #{param.fieldId}
</if>
<if test="param.useNum != null">
AND a.use_num = #{param.useNum}
@@ -4,30 +4,31 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*
SELECT a.*, b.pay_status
FROM shop_order_info a
LEFT JOIN shop_order b ON a.order_id = b.order_id
<where>
<if test="param.id != null">
AND a.id = #{param.id}
</if>
<if test="param.oid != null">
AND a.oid = #{param.oid}
<if test="param.orderId != null">
AND a.order_id = #{param.orderId}
</if>
<if test="param.sid != null">
AND a.sid = #{param.sid}
<if test="param.orderCode != null">
AND a.order_code LIKE CONCAT('%', #{param.orderCode}, '%')
</if>
<if test="param.fid != null">
AND a.fid = #{param.fid}
<if test="param.merchantId != null">
AND a.merchant_id = #{param.merchantId}
</if>
<if test="param.siteName != null">
AND a.site_name LIKE CONCAT('%', #{param.siteName}, '%')
<if test="param.merchantName != null">
AND a.merchant_name LIKE CONCAT('%', #{param.merchantName}, '%')
</if>
<if test="param.fieldId != null">
AND a.field_id = #{param.fieldId}
</if>
<if test="param.fieldName != null">
AND a.field_name LIKE CONCAT('%', #{param.fieldName}, '%')
</if>
<if test="param.dateTime != null">
AND a.date_time LIKE CONCAT('%', #{param.dateTime}, '%')
</if>
<if test="param.price != null">
AND a.price = #{param.price}
</if>
@@ -52,21 +53,27 @@
<if test="param.version != null">
AND a.version = #{param.version}
</if>
<if test="param.type != null">
AND a.type = #{param.type}
<if test="param.isHalf != null">
AND a.is_half = #{param.isHalf}
</if>
<if test="param.mergeData != null">
AND a.merge_data LIKE CONCAT('%', #{param.mergeData}, '%')
<if test="param.timePeriod != null">
AND a.time_period LIKE CONCAT('%', #{param.timePeriod}, '%')
</if>
<if test="param.dateTime != null">
AND a.date_time LIKE CONCAT('%', #{param.dateTime}, '%')
</if>
<if test="param.startTime != null">
AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%')
</if>
<if test="param.orderTime != null">
AND a.order_time LIKE CONCAT('%', #{param.orderTime}, '%')
<if test="param.endTime != null">
AND a.end_time LIKE CONCAT('%', #{param.endTime}, '%')
</if>
<if test="param.timeFlag != null">
AND a.time_flag LIKE CONCAT('%', #{param.timeFlag}, '%')
</if>
<if test="param.comments != null">
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
@@ -77,9 +84,12 @@
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
<if test="param.keywords != null">
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
)
</if>
AND (a.merchant_name LIKE CONCAT('%', #{param.keywords}, '%')
OR a.order_id = #{param.keywords}
OR a.user_id = #{param.keywords}
OR a.merchant_id = #{param.keywords}
)
</if>
</where>
</sql>
@@ -4,9 +4,8 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*,b.merchant_name,b.image as merchantAvatar
SELECT a.*
FROM shop_order a
LEFT JOIN shop_merchant b ON a.merchant_id = b.merchant_code
<where>
<if test="param.orderId != null">
AND a.order_id = #{param.orderId}
@@ -14,8 +13,8 @@
<if test="param.orderNo != null">
AND a.order_no LIKE CONCAT('%', #{param.orderNo}, '%')
</if>
<if test="param.wechatOrder != null">
AND a.wechat_order LIKE CONCAT('%', #{param.wechatOrder}, '%')
<if test="param.transactionId != null">
AND a.transaction_id LIKE CONCAT('%', #{param.transactionId}, '%')
</if>
<if test="param.refundOrder != null">
AND a.refund_order LIKE CONCAT('%', #{param.refundOrder}, '%')
@@ -23,26 +22,23 @@
<if test="param.merchantId != null">
AND a.merchant_id = #{param.merchantId}
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.couponId != null">
AND a.coupon_id = #{param.couponId}
</if>
<if test="param.cardId != null">
AND a.card_id = #{param.cardId}
</if>
<if test="param.aid != null">
AND a.aid = #{param.aid}
AND a.card_id LIKE CONCAT('%', #{param.cardId}, '%')
</if>
<if test="param.adminId != null">
AND a.admin_id = #{param.adminId}
</if>
<if test="param.code != null">
AND a.code LIKE CONCAT('%', #{param.code}, '%')
<if test="param.confirmId != null">
AND a.confirm_id = #{param.confirmId}
</if>
<if test="param.name != null">
AND a.name LIKE CONCAT('%', #{param.name}, '%')
<if test="param.icCard != null">
AND a.ic_card LIKE CONCAT('%', #{param.icCard}, '%')
</if>
<if test="param.realName != null">
AND a.real_name LIKE CONCAT('%', #{param.realName}, '%')
</if>
<if test="param.phone != null">
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
@@ -80,15 +76,15 @@
<if test="param.orderStatus != null">
AND a.order_status = #{param.orderStatus}
</if>
<if test="param.type != null">
AND a.type = #{param.type}
<if test="param.couponType != null">
AND a.coupon_type = #{param.couponType}
</if>
<if test="param.couponDesc != null">
AND a.coupon_desc LIKE CONCAT('%', #{param.couponDesc}, '%')
</if>
<if test="param.qrcode != null">
AND a.qrcode LIKE CONCAT('%', #{param.qrcode}, '%')
</if>
<if test="param.desc != null">
AND a.desc LIKE CONCAT('%', #{param.desc}, '%')
</if>
<if test="param.returnNum != null">
AND a.return_num = #{param.returnNum}
</if>
@@ -101,41 +97,53 @@
<if test="param.isInvoice != null">
AND a.is_invoice = #{param.isInvoice}
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
<if test="param.payTime != null">
AND a.pay_time = #{param.payTime}
AND a.pay_time LIKE CONCAT('%', #{param.payTime}, '%')
</if>
<if test="param.refundTime != null">
AND a.refund_time = #{param.refundTime}
AND a.refund_time LIKE CONCAT('%', #{param.refundTime}, '%')
</if>
<if test="param.refundApplyTime != null">
AND a.refund_apply_time = #{param.refundApplyTime}
AND a.refund_apply_time LIKE CONCAT('%', #{param.refundApplyTime}, '%')
</if>
<if test="param.checkBill != null">
AND a.check_bill = #{param.checkBill}
</if>
<if test="param.isSettled != null">
AND a.is_settled = #{param.isSettled}
</if>
<if test="param.version != null">
AND a.version = #{param.version}
</if>
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.comments != null">
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
</if>
<if test="param.sortNumber != null">
AND a.sort_number = #{param.sortNumber}
</if>
<if test="param.deleted != null">
AND a.deleted = #{param.deleted}
</if>
<if test="param.deleted == null">
AND a.deleted = 0
</if>
<if test="param.createTimeStart != null">
AND a.create_time &gt;= #{param.createTimeStart}
</if>
<if test="param.createTimeEnd != null">
AND a.create_time &lt;= #{param.createTimeEnd}
</if>
<if test="param.keywords != null">
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
OR a.order_id = #{param.keywords}
OR a.order_no = #{param.keywords}
OR a.phone = #{param.keywords}
OR a.name LIKE CONCAT('%', #{param.keywords}, '%')
AND (a.order_no LIKE CONCAT('%', #{param.keywords}, '%')
OR a.order_id = #{param.keywords}
OR a.phone = #{param.keywords}
OR a.user_id = #{param.keywords}
OR a.merchant_id = #{param.keywords}
)
</if>
</if>
</where>
</sql>
@@ -156,7 +164,7 @@
<!-- 更新订单状态 -->
<select id="updateByOutTradeNo" resultType="com.gxwebsoft.shop.entity.Order">
UPDATE sys_order SET pay_status = #{param.payStatus},pay_time = #{param.payTime},pay_price = #{param.payPrice},transaction_id = #{param.transactionId} WHERE order_no = #{param.orderNo}
UPDATE shop_order SET pay_status = #{param.payStatus}, pay_time = #{param.payTime}, pay_price = #{param.payPrice}, transaction_id = #{param.transactionId} WHERE order_no = #{param.orderNo}
</select>
</mapper>
@@ -14,7 +14,7 @@ import lombok.EqualsAndHashCode;
* 订单核销查询参数
*
* @author 科技小王子
* @since 2024-05-03 11:15:22
* @since 2024-05-14 13:20:04
*/
@Data
@EqualsAndHashCode(callSuper = false)
@@ -28,15 +28,15 @@ public class OrderInfoLogParam extends BaseParam {
@ApiModelProperty(value = "关联订单表id")
@QueryField(type = QueryType.EQ)
private Integer oid;
private Integer orderId;
@ApiModelProperty(value = "关联场馆id")
@ApiModelProperty(value = "关联商户ID")
@QueryField(type = QueryType.EQ)
private Integer sid;
private Integer merchantId;
@ApiModelProperty(value = "关联场地id")
@QueryField(type = QueryType.EQ)
private Integer fid;
private Integer fieldId;
@ApiModelProperty(value = "核销数量")
@QueryField(type = QueryType.EQ)
@@ -11,42 +11,43 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 查询参数
* 场地查询参数
*
* @author 科技小王子
* @since 2024-05-13 19:50:43
* @since 2024-05-14 13:20:04
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "OrderInfoParam对象", description = "查询参数")
@ApiModel(value = "OrderInfoParam对象", description = "场地查询参数")
public class OrderInfoParam extends BaseParam {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "自增ID")
@QueryField(type = QueryType.EQ)
private Integer id;
@ApiModelProperty(value = "关联订单表id")
@QueryField(type = QueryType.EQ)
private Integer oid;
private Integer orderId;
@ApiModelProperty(value = "关联场馆id")
@ApiModelProperty(value = "组合数据:日期+时间段+场馆id+场地id")
private String orderCode;
@ApiModelProperty(value = "关联商户ID")
@QueryField(type = QueryType.EQ)
private Integer sid;
private Integer merchantId;
@ApiModelProperty(value = "商户名称")
private String merchantName;
@ApiModelProperty(value = "关联场地id")
@QueryField(type = QueryType.EQ)
private Integer fid;
private Integer fieldId;
@ApiModelProperty(value = "场馆")
private String siteName;
@ApiModelProperty(value = "场地")
@ApiModelProperty(value = "场地名称")
private String fieldName;
@ApiModelProperty(value = "预约时间段")
private String dateTime;
@ApiModelProperty(value = "单价")
@QueryField(type = QueryType.EQ)
private BigDecimal price;
@@ -63,38 +64,44 @@ public class OrderInfoParam extends BaseParam {
@QueryField(type = QueryType.EQ)
private Integer childrenNum;
@ApiModelProperty(value = "1已付款,2未付款,3无需付款或占用状态")
@ApiModelProperty(value = "0 未付款 1已付款,2无需付款或占用状态")
@QueryField(type = QueryType.EQ)
private Integer payStatus;
@ApiModelProperty(value = "是否免费:1免费、2收费")
@ApiModelProperty(value = "是否免费:0收费、1免费")
@QueryField(type = QueryType.EQ)
private Integer isFree;
private Boolean isFree;
@ApiModelProperty(value = "是否支持儿童票:1支持,2不支持")
@ApiModelProperty(value = "是否支持儿童票:0不支持、1支持")
@QueryField(type = QueryType.EQ)
private Integer isChildren;
private Boolean isChildren;
@ApiModelProperty(value = "系统版本号 10新版 0旧版")
@ApiModelProperty(value = "系统版本 0当前版本 其他版本")
@QueryField(type = QueryType.EQ)
private Integer version;
@ApiModelProperty(value = "预订类型:1全场,2半场")
@ApiModelProperty(value = "预订类型:0全场,1半场")
@QueryField(type = QueryType.EQ)
private Integer type;
private Boolean isHalf;
@ApiModelProperty(value = "组合数据:日期+时间段+场馆id+场地id")
private String mergeData;
@ApiModelProperty(value = "预约时间段")
private String timePeriod;
@ApiModelProperty(value = "预定日期")
private String dateTime;
@ApiModelProperty(value = "开场时间")
private String startTime;
@ApiModelProperty(value = "下单时间")
private String orderTime;
@ApiModelProperty(value = "结束时间")
private String endTime;
@ApiModelProperty(value = "毫秒时间戳")
private Long timeFlag;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "用户id")
@QueryField(type = QueryType.EQ)
private Integer userId;
@@ -11,15 +11,15 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 预约订单查询参数
* 订单查询参数
*
* @author 科技小王子
* @since 2024-04-25 22:01:33
* @since 2024-05-14 13:20:04
*/
@Data
@EqualsAndHashCode(callSuper = false)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "OrderParam对象", description = "预约订单查询参数")
@ApiModel(value = "OrderParam对象", description = "订单查询参数")
public class OrderParam extends BaseParam {
private static final long serialVersionUID = 1L;
@@ -28,43 +28,39 @@ public class OrderParam extends BaseParam {
private Integer orderId;
@ApiModelProperty(value = "订单编号")
@QueryField(type = QueryType.EQ)
private String orderNo;
@ApiModelProperty(value = "微信支付订单号")
private String wechatOrder;
private String transactionId;
@ApiModelProperty(value = "微信退款订单号")
private String refundOrder;
@ApiModelProperty(value = "场馆id用于权限判断")
@ApiModelProperty(value = "商户ID")
@QueryField(type = QueryType.EQ)
private Integer merchantId;
@ApiModelProperty(value = "用户id")
@QueryField(type = QueryType.EQ)
private Integer userId;
@ApiModelProperty(value = "使用的优惠券id")
@QueryField(type = QueryType.EQ)
private Integer couponId;
@ApiModelProperty(value = "使用的会员卡id")
@QueryField(type = QueryType.EQ)
private Integer cardId;
private String cardId;
@ApiModelProperty(value = "关联管理员id")
@QueryField(type = QueryType.EQ)
private Integer aid;
private Integer adminId;
@ApiModelProperty(value = "核销管理员id")
@QueryField(type = QueryType.EQ)
private Integer adminId;
private Integer confirmId;
@ApiModelProperty(value = "IC卡号")
private String code;
private String icCard;
@ApiModelProperty(value = "真实姓名")
private String name;
private String realName;
@ApiModelProperty(value = "手机号码")
private String phone;
@@ -101,28 +97,28 @@ public class OrderParam extends BaseParam {
@QueryField(type = QueryType.EQ)
private Integer coachId;
@ApiModelProperty(value = "1微信支付,2积分,3支付宝,4现金,5POS机,6VIP月卡,7VIP年卡,8VIP次卡,9IC月卡,10IC年卡,11IC次卡,12免费,13VIP充值卡,14IC充值卡,15积分支付,16VIP季卡,17IC季卡")
@ApiModelProperty(value = "0余额支付, 1微信支付,2积分,3支付宝,4现金,5POS机,6VIP月卡,7VIP年卡,8VIP次卡,9IC月卡,10IC年卡,11IC次卡,12免费,13VIP充值卡,14IC充值卡,15积分支付,16VIP季卡,17IC季卡")
@QueryField(type = QueryType.EQ)
private Integer payType;
@ApiModelProperty(value = "1已付款,2未付款")
@ApiModelProperty(value = "0未付款,1已付款")
@QueryField(type = QueryType.EQ)
private Integer payStatus;
@ApiModelProperty(value = "1已完成,2未使用,3已取消,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款")
@ApiModelProperty(value = "0未使用,1已完成,2已取消,3取消中,4退款申请中,5退款被拒绝,6退款成功,7客户端申请退款")
@QueryField(type = QueryType.EQ)
private Integer orderStatus;
@ApiModelProperty(value = "优惠类型:0无、1抵扣优惠券、2折扣优惠券、3、VIP月卡、4VIP年卡,5VIP次卡、6VIP会员卡、7IC月卡、8IC年卡、9IC次卡、10IC会员卡、11免费订单、12VIP充值卡、13IC充值卡、14VIP季卡、15IC季卡")
@QueryField(type = QueryType.EQ)
private Integer type;
private Integer couponType;
@ApiModelProperty(value = "优惠说明")
private String couponDesc;
@ApiModelProperty(value = "二维码地址,保存订单号,支付成功后才生成")
private String qrcode;
@ApiModelProperty(value = "优惠说明")
private String desc;
@ApiModelProperty(value = "vip月卡年卡、ic月卡年卡回退次数")
@QueryField(type = QueryType.EQ)
private Integer returnNum;
@@ -134,29 +130,42 @@ public class OrderParam extends BaseParam {
@ApiModelProperty(value = "预约详情开始时间数组")
private String startTime;
@ApiModelProperty(value = "是否已开具发票:1已开发票,2未开发票,3不能开具发票")
@ApiModelProperty(value = "是否已开具发票:0未开发票,1已开发票,2不能开具发票")
@QueryField(type = QueryType.EQ)
private Integer isInvoice;
private Boolean isInvoice;
@ApiModelProperty(value = "付款时间")
@QueryField(type = QueryType.EQ)
private Integer payTime;
@ApiModelProperty(value = "支付时间")
private String payTime;
@ApiModelProperty(value = "退款时间")
@QueryField(type = QueryType.EQ)
private Integer refundTime;
private String refundTime;
@ApiModelProperty(value = "申请退款时间")
@QueryField(type = QueryType.EQ)
private Integer refundApplyTime;
private String refundApplyTime;
@ApiModelProperty(value = "对账情况:1=已对账;2=未对账;3=已对账,金额对不上;4=未查询到该订单")
@ApiModelProperty(value = "对账情况:0=未对账;1=已对账;3=已对账,金额对不上;4=未查询到该订单")
@QueryField(type = QueryType.EQ)
private Integer checkBill;
@ApiModelProperty(value = "订单是否已结算(0未结算 1已结算)")
@QueryField(type = QueryType.EQ)
private Integer isSettled;
@ApiModelProperty(value = "系统版本号 0当前版本 value=其他版本")
@QueryField(type = QueryType.EQ)
private Integer version;
@ApiModelProperty(value = "用户id")
@QueryField(type = QueryType.EQ)
private Integer userId;
@ApiModelProperty(value = "备注")
private String comments;
@ApiModelProperty(value = "排序号")
@QueryField(type = QueryType.EQ)
private Integer sortNumber;
@ApiModelProperty(value = "是否删除, 0否, 1是")
@QueryField(type = QueryType.EQ)
private Integer deleted;
@@ -11,7 +11,7 @@ import java.util.List;
* 订单核销Service
*
* @author 科技小王子
* @since 2024-05-03 11:15:22
* @since 2024-05-14 13:20:04
*/
public interface OrderInfoLogService extends IService<OrderInfoLog> {
@@ -8,10 +8,10 @@ import com.gxwebsoft.shop.param.OrderInfoParam;
import java.util.List;
/**
* Service
* 场地Service
*
* @author 科技小王子
* @since 2024-05-13 19:50:43
* @since 2024-05-14 13:20:04
*/
public interface OrderInfoService extends IService<OrderInfo> {
@@ -34,7 +34,7 @@ public interface OrderInfoService extends IService<OrderInfo> {
/**
* 根据id查询
*
* @param id
* @param id 自增ID
* @return OrderInfo
*/
OrderInfo getByIdRel(Integer id);
@@ -9,10 +9,10 @@ import java.util.HashMap;
import java.util.List;
/**
* 预约订单Service
* 订单Service
*
* @author 科技小王子
* @since 2024-04-25 22:01:33
* @since 2024-05-14 13:20:04
*/
public interface OrderService extends IService<Order> {
@@ -15,7 +15,7 @@ import java.util.List;
* 订单核销Service实现
*
* @author 科技小王子
* @since 2024-05-03 11:15:22
* @since 2024-05-14 13:20:04
*/
@Service
public class OrderInfoLogServiceImpl extends ServiceImpl<OrderInfoLogMapper, OrderInfoLog> implements OrderInfoLogService {
@@ -12,10 +12,10 @@ import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service实现
* 场地Service实现
*
* @author 科技小王子
* @since 2024-05-13 19:50:43
* @since 2024-05-14 13:20:04
*/
@Service
public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo> implements OrderInfoService {
@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gxwebsoft.common.core.config.ConfigProperties;
import com.gxwebsoft.common.core.utils.JSONUtil;
import com.gxwebsoft.common.core.utils.RedisUtil;
import com.gxwebsoft.common.system.service.SettingService;
import com.gxwebsoft.shop.entity.OrderInfo;
@@ -37,10 +36,10 @@ import java.util.Set;
import java.util.stream.Collectors;
/**
* 预约订单Service实现
* 订单Service实现
*
* @author 科技小王子
* @since 2024-04-25 22:01:33
* @since 2024-05-14 13:20:04
*/
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {
@@ -67,8 +66,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
final Set<Integer> orderIds = list.stream().map(Order::getOrderId).collect(Collectors.toSet());
// 查询订单信息表
if (!CollectionUtils.isEmpty(orderIds)) {
final List<OrderInfo> orderInfoList = orderInfoService.list(new LambdaQueryWrapper<OrderInfo>().in(OrderInfo::getOid, orderIds));
final Map<Integer, List<OrderInfo>> orderInfo = orderInfoList.stream().collect(Collectors.groupingBy(OrderInfo::getOid));
final List<OrderInfo> orderInfoList = orderInfoService.list(new LambdaQueryWrapper<OrderInfo>().in(OrderInfo::getOrderId, orderIds));
final Map<Integer, List<OrderInfo>> orderInfo = orderInfoList.stream().collect(Collectors.groupingBy(OrderInfo::getOrderId));
list.forEach(d -> {
if (!orderInfo.isEmpty()) {
final List<OrderInfo> orderInfos = orderInfo.get(d.getOrderId());
@@ -81,21 +80,21 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
return new PageResult<>(list, page.getTotal());
}
@Override
public List<Order> listRel(OrderParam param) {
List<Order> list = baseMapper.selectListRel(param);
// 排序
PageParam<Order, OrderParam> page = new PageParam<>();
page.setDefaultOrder("sort_number asc, create_time desc");
return page.sortRecords(list);
}
@Override
public List<Order> listRel(OrderParam param) {
List<Order> list = baseMapper.selectListRel(param);
// 排序
PageParam<Order, OrderParam> page = new PageParam<>();
page.setDefaultOrder("sort_number asc, create_time desc");
return page.sortRecords(list);
}
@Override
public Order getByIdRel(Integer orderId) {
OrderParam param = new OrderParam();
param.setOrderId(orderId);
return param.getOne(baseMapper.selectListRel(param));
}
@Override
public Order getByIdRel(Integer orderId) {
OrderParam param = new OrderParam();
param.setOrderId(orderId);
return param.getOne(baseMapper.selectListRel(param));
}
/**
* 创建微信支付
@@ -172,9 +171,10 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
@Override
public Order getByOutTradeNo(String outTradeNo) {
System.out.println("outTradeNo = " + outTradeNo);
OrderParam param = new OrderParam();
param.setOrderNo(outTradeNo);
System.out.println("param222 = " + param);
baseMapper.getByOutTradeNo(param);
return param.getOne(baseMapper.getByOutTradeNo(param));
}
@@ -62,14 +62,14 @@ public class ShopGenerator {
// "shop_merchant",
// "shop_merchant_type",
// "shop_merchant_apply",
// "shop_order"
// "shop_merchant_account",
// "shop_chat_message",
// "shop_chat_conversation"
// "shop_user_collection",
// "shop_mp_menu"
"shop_order_info",
// "shop_order_info_log",
"shop_order",
"shop_order_info",
"shop_order_info_log",
// "shop_wechat_deposit"
// "shop_users"
};