整理订单详情表
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.gxwebsoft.cms.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.cms.service.MpMenuService;
|
||||
import com.gxwebsoft.cms.entity.MpMenu;
|
||||
@@ -13,10 +14,14 @@ import com.gxwebsoft.common.system.entity.User;
|
||||
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.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 小程序端菜单控制器
|
||||
@@ -30,6 +35,8 @@ import java.util.List;
|
||||
public class MpMenuController extends BaseController {
|
||||
@Resource
|
||||
private MpMenuService mpMenuService;
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:mpMenu:list')")
|
||||
@ApiOperation("分页查询小程序端菜单")
|
||||
@@ -43,8 +50,7 @@ public class MpMenuController extends BaseController {
|
||||
@ApiOperation("查询全部小程序端菜单")
|
||||
@GetMapping()
|
||||
public ApiResult<List<MpMenu>> list(MpMenuParam param) {
|
||||
// 使用关联查询
|
||||
return success(mpMenuService.listRel(param));
|
||||
return success(mpMenuService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:mpMenu:list')")
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.OrderInfoService;
|
||||
import com.gxwebsoft.shop.entity.OrderInfo;
|
||||
import com.gxwebsoft.shop.param.OrderInfoParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
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 io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-03 11:14:47
|
||||
*/
|
||||
@Api(tags = "管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/order-info")
|
||||
public class OrderInfoController extends BaseController {
|
||||
@Resource
|
||||
private OrderInfoService orderInfoService;
|
||||
|
||||
@ApiOperation("分页查询")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<OrderInfo>> page(OrderInfoParam param) {
|
||||
// 使用关联查询
|
||||
return success(orderInfoService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部")
|
||||
@GetMapping()
|
||||
public ApiResult<List<OrderInfo>> list(OrderInfoParam param) {
|
||||
// 使用关联查询
|
||||
return success(orderInfoService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:orderInfo:list')")
|
||||
@ApiOperation("根据id查询")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<OrderInfo> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(orderInfoService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody OrderInfo orderInfo) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// orderInfo.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (orderInfoService.save(orderInfo)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody OrderInfo orderInfo) {
|
||||
if (orderInfoService.updateById(orderInfo)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (orderInfoService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<OrderInfo> list) {
|
||||
if (orderInfoService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<OrderInfo> batchParam) {
|
||||
if (batchParam.update(orderInfoService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (orderInfoService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.gxwebsoft.shop.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.service.OrderInfoLogService;
|
||||
import com.gxwebsoft.shop.entity.OrderInfoLog;
|
||||
import com.gxwebsoft.shop.param.OrderInfoLogParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
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 io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单核销控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-03 11:15:22
|
||||
*/
|
||||
@Api(tags = "订单核销管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/shop/order-info-log")
|
||||
public class OrderInfoLogController extends BaseController {
|
||||
@Resource
|
||||
private OrderInfoLogService orderInfoLogService;
|
||||
|
||||
@ApiOperation("分页查询订单核销")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<OrderInfoLog>> page(OrderInfoLogParam param) {
|
||||
// 使用关联查询
|
||||
return success(orderInfoLogService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部订单核销")
|
||||
@GetMapping()
|
||||
public ApiResult<List<OrderInfoLog>> list(OrderInfoLogParam param) {
|
||||
// 使用关联查询
|
||||
return success(orderInfoLogService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:orderInfoLog:list')")
|
||||
@ApiOperation("根据id查询订单核销")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<OrderInfoLog> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(orderInfoLogService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加订单核销")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody OrderInfoLog orderInfoLog) {
|
||||
// 记录当前登录用户id
|
||||
// User loginUser = getLoginUser();
|
||||
// if (loginUser != null) {
|
||||
// orderInfoLog.setUserId(loginUser.getUserId());
|
||||
// }
|
||||
if (orderInfoLogService.save(orderInfoLog)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改订单核销")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody OrderInfoLog orderInfoLog) {
|
||||
if (orderInfoLogService.updateById(orderInfoLog)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除订单核销")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (orderInfoLogService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加订单核销")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<OrderInfoLog> list) {
|
||||
if (orderInfoLogService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改订单核销")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<OrderInfoLog> batchParam) {
|
||||
if (batchParam.update(orderInfoLogService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除订单核销")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (orderInfoLogService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,10 +2,8 @@ package com.gxwebsoft.shop.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
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 com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
@@ -35,6 +33,9 @@ public class Merchant implements Serializable {
|
||||
@ApiModelProperty(value = "商户名称")
|
||||
private String merchantName;
|
||||
|
||||
@ApiModelProperty(value = "商户标识")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "商户图标")
|
||||
private String image;
|
||||
|
||||
@@ -95,6 +96,10 @@ public class Merchant implements Serializable {
|
||||
@ApiModelProperty(value = "状态")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -145,4 +146,16 @@ public class Order implements Serializable {
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "商户名称")
|
||||
@TableField(exist = false)
|
||||
private String merchantName;
|
||||
|
||||
@ApiModelProperty(value = "商户图标")
|
||||
@TableField(exist = false)
|
||||
private String merchantAvatar;
|
||||
|
||||
@ApiModelProperty(value = "订单详情")
|
||||
@TableField(exist = false)
|
||||
private List<OrderInfo> orderInfoList;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.gxwebsoft.shop.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-03 11:14:47
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "OrderInfo对象", description = "")
|
||||
@TableName("shop_order_info")
|
||||
public class OrderInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "关联订单表id")
|
||||
private Integer oid;
|
||||
|
||||
@ApiModelProperty(value = "关联场馆id")
|
||||
private Integer sid;
|
||||
|
||||
@ApiModelProperty(value = "关联场地id")
|
||||
private Integer fid;
|
||||
|
||||
@ApiModelProperty(value = "场馆")
|
||||
private String siteName;
|
||||
|
||||
@ApiModelProperty(value = "场地")
|
||||
private String fieldName;
|
||||
|
||||
@ApiModelProperty(value = "预约时间段")
|
||||
private String dateTime;
|
||||
|
||||
@ApiModelProperty(value = "单价")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "儿童价")
|
||||
private BigDecimal childrenPrice;
|
||||
|
||||
@ApiModelProperty(value = "成人人数")
|
||||
private Boolean adultNum;
|
||||
|
||||
@ApiModelProperty(value = "儿童人数")
|
||||
private Boolean childrenNum;
|
||||
|
||||
@ApiModelProperty(value = "1已付款,2未付款,3无需付款或占用状态")
|
||||
private Boolean payStatus;
|
||||
|
||||
@ApiModelProperty(value = "是否免费:1免费、2收费")
|
||||
private Boolean isFree;
|
||||
|
||||
@ApiModelProperty(value = "是否支持儿童票:1支持,2不支持")
|
||||
private Boolean isChildren;
|
||||
|
||||
@ApiModelProperty(value = "预订类型:1全场,2半场")
|
||||
private Boolean type;
|
||||
|
||||
@ApiModelProperty(value = "组合数据:日期+时间段+场馆id+场地id")
|
||||
private String mergeData;
|
||||
|
||||
@ApiModelProperty(value = "开场时间")
|
||||
private Integer startTime;
|
||||
|
||||
@ApiModelProperty(value = "下单时间")
|
||||
private Integer orderTime;
|
||||
|
||||
@ApiModelProperty(value = "毫秒时间戳")
|
||||
private Long timeFlag;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
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.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 订单核销
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-03 11:15:22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "OrderInfoLog对象", description = "订单核销")
|
||||
@TableName("shop_order_info_log")
|
||||
public class OrderInfoLog implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "关联订单表id")
|
||||
private Integer oid;
|
||||
|
||||
@ApiModelProperty(value = "关联场馆id")
|
||||
private Integer sid;
|
||||
|
||||
@ApiModelProperty(value = "关联场地id")
|
||||
private Integer fid;
|
||||
|
||||
@ApiModelProperty(value = "核销数量")
|
||||
private Boolean useNum;
|
||||
|
||||
@ApiModelProperty(value = "核销时间")
|
||||
private Integer createTime;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.shop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.shop.entity.OrderInfoLog;
|
||||
import com.gxwebsoft.shop.param.OrderInfoLogParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单核销Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-03 11:15:22
|
||||
*/
|
||||
public interface OrderInfoLogMapper extends BaseMapper<OrderInfoLog> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<OrderInfoLog>
|
||||
*/
|
||||
List<OrderInfoLog> selectPageRel(@Param("page") IPage<OrderInfoLog> page,
|
||||
@Param("param") OrderInfoLogParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<OrderInfoLog> selectListRel(@Param("param") OrderInfoLogParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.shop.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.shop.entity.OrderInfo;
|
||||
import com.gxwebsoft.shop.param.OrderInfoParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-03 11:14:47
|
||||
*/
|
||||
public interface OrderInfoMapper extends BaseMapper<OrderInfo> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<OrderInfo>
|
||||
*/
|
||||
List<OrderInfo> selectPageRel(@Param("page") IPage<OrderInfo> page,
|
||||
@Param("param") OrderInfoParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<OrderInfo> selectListRel(@Param("param") OrderInfoParam param);
|
||||
|
||||
}
|
||||
@@ -13,6 +13,9 @@
|
||||
<if test="param.merchantName != null">
|
||||
AND a.merchant_name LIKE CONCAT('%', #{param.merchantName}, '%')
|
||||
</if>
|
||||
<if test="param.merchantCode != null">
|
||||
AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%')
|
||||
</if>
|
||||
<if test="param.image != null">
|
||||
AND a.image LIKE CONCAT('%', #{param.image}, '%')
|
||||
</if>
|
||||
@@ -52,6 +55,12 @@
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</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.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.shop.mapper.OrderInfoLogMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM shop_order_info_log a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.oid != null">
|
||||
AND a.oid = #{param.oid}
|
||||
</if>
|
||||
<if test="param.sid != null">
|
||||
AND a.sid = #{param.sid}
|
||||
</if>
|
||||
<if test="param.fid != null">
|
||||
AND a.fid = #{param.fid}
|
||||
</if>
|
||||
<if test="param.useNum != null">
|
||||
AND a.use_num = #{param.useNum}
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.OrderInfoLog">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.OrderInfoLog">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.shop.mapper.OrderInfoMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM shop_order_info a
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.oid != null">
|
||||
AND a.oid = #{param.oid}
|
||||
</if>
|
||||
<if test="param.sid != null">
|
||||
AND a.sid = #{param.sid}
|
||||
</if>
|
||||
<if test="param.fid != null">
|
||||
AND a.fid = #{param.fid}
|
||||
</if>
|
||||
<if test="param.siteName != null">
|
||||
AND a.site_name LIKE CONCAT('%', #{param.siteName}, '%')
|
||||
</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>
|
||||
<if test="param.childrenPrice != null">
|
||||
AND a.children_price = #{param.childrenPrice}
|
||||
</if>
|
||||
<if test="param.adultNum != null">
|
||||
AND a.adult_num = #{param.adultNum}
|
||||
</if>
|
||||
<if test="param.childrenNum != null">
|
||||
AND a.children_num = #{param.childrenNum}
|
||||
</if>
|
||||
<if test="param.payStatus != null">
|
||||
AND a.pay_status = #{param.payStatus}
|
||||
</if>
|
||||
<if test="param.isFree != null">
|
||||
AND a.is_free = #{param.isFree}
|
||||
</if>
|
||||
<if test="param.isChildren != null">
|
||||
AND a.is_children = #{param.isChildren}
|
||||
</if>
|
||||
<if test="param.type != null">
|
||||
AND a.type = #{param.type}
|
||||
</if>
|
||||
<if test="param.mergeData != null">
|
||||
AND a.merge_data LIKE CONCAT('%', #{param.mergeData}, '%')
|
||||
</if>
|
||||
<if test="param.startTime != null">
|
||||
AND a.start_time = #{param.startTime}
|
||||
</if>
|
||||
<if test="param.orderTime != null">
|
||||
AND a.order_time = #{param.orderTime}
|
||||
</if>
|
||||
<if test="param.timeFlag != null">
|
||||
AND a.time_flag LIKE CONCAT('%', #{param.timeFlag}, '%')
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.OrderInfo">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.OrderInfo">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
SELECT a.*,b.merchant_name,b.image as merchantAvatar
|
||||
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}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.gxwebsoft.shop.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
@@ -30,6 +32,9 @@ public class MerchantParam extends BaseParam {
|
||||
@ApiModelProperty(value = "商户名称")
|
||||
private String merchantName;
|
||||
|
||||
@ApiModelProperty(value = "商户标识")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "商户图标")
|
||||
private String image;
|
||||
|
||||
@@ -83,6 +88,10 @@ public class MerchantParam extends BaseParam {
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.gxwebsoft.shop.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 订单核销查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-03 11:15:22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "OrderInfoLogParam对象", description = "订单核销查询参数")
|
||||
public class OrderInfoLogParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "关联订单表id")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer oid;
|
||||
|
||||
@ApiModelProperty(value = "关联场馆id")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sid;
|
||||
|
||||
@ApiModelProperty(value = "关联场地id")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer fid;
|
||||
|
||||
@ApiModelProperty(value = "核销数量")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean useNum;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.gxwebsoft.shop.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Set;
|
||||
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-03 11:14:47
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "OrderInfoParam对象", description = "查询参数")
|
||||
public class OrderInfoParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "关联订单表id")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer oid;
|
||||
|
||||
@ApiModelProperty(value = "关联场馆id")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sid;
|
||||
|
||||
@ApiModelProperty(value = "关联场地id")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer fid;
|
||||
|
||||
@ApiModelProperty(value = "场馆")
|
||||
private String siteName;
|
||||
|
||||
@ApiModelProperty(value = "场地")
|
||||
private String fieldName;
|
||||
|
||||
@ApiModelProperty(value = "预约时间段")
|
||||
private String dateTime;
|
||||
|
||||
@ApiModelProperty(value = "单价")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "儿童价")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal childrenPrice;
|
||||
|
||||
@ApiModelProperty(value = "成人人数")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean adultNum;
|
||||
|
||||
@ApiModelProperty(value = "儿童人数")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean childrenNum;
|
||||
|
||||
@ApiModelProperty(value = "1已付款,2未付款,3无需付款或占用状态")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean payStatus;
|
||||
|
||||
@ApiModelProperty(value = "是否免费:1免费、2收费")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean isFree;
|
||||
|
||||
@ApiModelProperty(value = "是否支持儿童票:1支持,2不支持")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean isChildren;
|
||||
|
||||
@ApiModelProperty(value = "预订类型:1全场,2半场")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean type;
|
||||
|
||||
@ApiModelProperty(value = "组合数据:日期+时间段+场馆id+场地id")
|
||||
private String mergeData;
|
||||
|
||||
@ApiModelProperty(value = "开场时间")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer startTime;
|
||||
|
||||
@ApiModelProperty(value = "下单时间")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer orderTime;
|
||||
|
||||
@ApiModelProperty(value = "毫秒时间戳")
|
||||
private Long timeFlag;
|
||||
|
||||
@ApiModelProperty(value = "订单ID集合")
|
||||
@QueryField(type = QueryType.IN)
|
||||
private Set<Integer> orderIds;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.OrderInfoLog;
|
||||
import com.gxwebsoft.shop.param.OrderInfoLogParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单核销Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-03 11:15:22
|
||||
*/
|
||||
public interface OrderInfoLogService extends IService<OrderInfoLog> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<OrderInfoLog>
|
||||
*/
|
||||
PageResult<OrderInfoLog> pageRel(OrderInfoLogParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<OrderInfoLog>
|
||||
*/
|
||||
List<OrderInfoLog> listRel(OrderInfoLogParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id
|
||||
* @return OrderInfoLog
|
||||
*/
|
||||
OrderInfoLog getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.shop.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.shop.entity.OrderInfo;
|
||||
import com.gxwebsoft.shop.param.OrderInfoParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-03 11:14:47
|
||||
*/
|
||||
public interface OrderInfoService extends IService<OrderInfo> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<OrderInfo>
|
||||
*/
|
||||
PageResult<OrderInfo> pageRel(OrderInfoParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<OrderInfo>
|
||||
*/
|
||||
List<OrderInfo> listRel(OrderInfoParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param id
|
||||
* @return OrderInfo
|
||||
*/
|
||||
OrderInfo getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.mapper.OrderInfoLogMapper;
|
||||
import com.gxwebsoft.shop.service.OrderInfoLogService;
|
||||
import com.gxwebsoft.shop.entity.OrderInfoLog;
|
||||
import com.gxwebsoft.shop.param.OrderInfoLogParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单核销Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-03 11:15:22
|
||||
*/
|
||||
@Service
|
||||
public class OrderInfoLogServiceImpl extends ServiceImpl<OrderInfoLogMapper, OrderInfoLog> implements OrderInfoLogService {
|
||||
|
||||
@Override
|
||||
public PageResult<OrderInfoLog> pageRel(OrderInfoLogParam param) {
|
||||
PageParam<OrderInfoLog, OrderInfoLogParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<OrderInfoLog> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderInfoLog> listRel(OrderInfoLogParam param) {
|
||||
List<OrderInfoLog> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<OrderInfoLog, OrderInfoLogParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderInfoLog getByIdRel(Integer id) {
|
||||
OrderInfoLogParam param = new OrderInfoLogParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.mapper.OrderInfoMapper;
|
||||
import com.gxwebsoft.shop.service.OrderInfoService;
|
||||
import com.gxwebsoft.shop.entity.OrderInfo;
|
||||
import com.gxwebsoft.shop.param.OrderInfoParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-03 11:14:47
|
||||
*/
|
||||
@Service
|
||||
public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo> implements OrderInfoService {
|
||||
|
||||
@Override
|
||||
public PageResult<OrderInfo> pageRel(OrderInfoParam param) {
|
||||
PageParam<OrderInfo, OrderInfoParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<OrderInfo> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderInfo> listRel(OrderInfoParam param) {
|
||||
List<OrderInfo> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<OrderInfo, OrderInfoParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrderInfo getByIdRel(Integer id) {
|
||||
OrderInfoParam param = new OrderInfoParam();
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.gxwebsoft.shop.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.shop.entity.OrderInfo;
|
||||
import com.gxwebsoft.shop.mapper.OrderMapper;
|
||||
import com.gxwebsoft.shop.param.OrderInfoParam;
|
||||
import com.gxwebsoft.shop.service.OrderInfoService;
|
||||
import com.gxwebsoft.shop.service.OrderService;
|
||||
import com.gxwebsoft.shop.entity.Order;
|
||||
import com.gxwebsoft.shop.param.OrderParam;
|
||||
@@ -9,7 +13,11 @@ import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 预约订单Service实现
|
||||
@@ -20,11 +28,25 @@ import java.util.List;
|
||||
@Service
|
||||
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {
|
||||
|
||||
@Resource
|
||||
private OrderInfoService orderInfoService;
|
||||
|
||||
@Override
|
||||
public PageResult<Order> pageRel(OrderParam param) {
|
||||
PageParam<Order, OrderParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<Order> list = baseMapper.selectPageRel(page, param);
|
||||
final Set<Integer> orderIds = list.stream().map(Order::getOrderId).collect(Collectors.toSet());
|
||||
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));
|
||||
list.forEach(d -> {
|
||||
if (!orderInfo.isEmpty()) {
|
||||
final List<OrderInfo> orderInfos = orderInfo.get(d.getOrderId());
|
||||
if (!orderInfos.isEmpty()) {
|
||||
d.setOrderInfoList(orderInfos);
|
||||
}
|
||||
}
|
||||
});
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user