重构会员卡数据库
This commit is contained in:
@@ -37,7 +37,7 @@ public class CardController extends BaseController {
|
||||
// 使用关联查询
|
||||
final User loginUser = getLoginUser();
|
||||
if(loginUser != null){
|
||||
param.setBuyUserId(loginUser.getUserId());
|
||||
param.setPhone(loginUser.getPhone());
|
||||
}
|
||||
return success(cardService.pageRel(param));
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
* 我的优惠券控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-06 07:26:46
|
||||
* @since 2024-07-13 09:43:33
|
||||
*/
|
||||
@Api(tags = "我的优惠券管理")
|
||||
@RestController
|
||||
@@ -35,6 +35,10 @@ public class CouponController extends BaseController {
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Coupon>> page(CouponParam param) {
|
||||
// 使用关联查询
|
||||
final User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
param.setLoginUserId(getLoginUserId());
|
||||
}
|
||||
return success(couponService.pageRel(param));
|
||||
}
|
||||
|
||||
@@ -56,6 +60,11 @@ public class CouponController extends BaseController {
|
||||
@ApiOperation("添加我的优惠券")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Coupon coupon) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
coupon.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (couponService.save(coupon)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.gxwebsoft.booking.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.booking.service.UserCardService;
|
||||
import com.gxwebsoft.booking.entity.UserCard;
|
||||
@@ -12,8 +10,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.gxwebsoft.shop.entity.Order;
|
||||
import com.gxwebsoft.shop.param.OrderParam;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -26,7 +22,7 @@ import java.util.List;
|
||||
* 会员卡控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-29 14:29:43
|
||||
* @since 2024-07-13 11:07:56
|
||||
*/
|
||||
@Api(tags = "会员卡管理")
|
||||
@RestController
|
||||
@@ -35,31 +31,13 @@ public class UserCardController extends BaseController {
|
||||
@Resource
|
||||
private UserCardService userCardService;
|
||||
|
||||
@ApiOperation("查询可用的会员卡")
|
||||
@GetMapping("/findUseCard")
|
||||
public ApiResult<?> findUseCard(UserCardParam param) {
|
||||
final User loginUser = getLoginUser();
|
||||
if(loginUser == null){
|
||||
return fail("请先登录",null);
|
||||
}
|
||||
// 查询可用的会员卡
|
||||
LambdaUpdateWrapper<UserCard> wrapper = new LambdaUpdateWrapper<>();
|
||||
if(param.getPayPrice() != null){
|
||||
System.out.println("param = " + param);
|
||||
wrapper.ge(UserCard::getRemainingMoney,param.getPayPrice());
|
||||
}
|
||||
wrapper.eq(UserCard::getUserId, loginUser.getUserId())
|
||||
.eq(UserCard::getPayStatus,1)
|
||||
.like(UserCard::getSid, param.getSid())
|
||||
.lt(UserCard::getExpirationTime, DateUtil.now())
|
||||
.last("limit 1");
|
||||
System.out.println("wrapper = " + wrapper);
|
||||
return success(userCardService.getOne(wrapper));
|
||||
}
|
||||
|
||||
@ApiOperation("分页查询会员卡")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<UserCard>> page(UserCardParam param) {
|
||||
if(param.getSceneType() != null && param.getSceneType().equals("myCardAll")){
|
||||
final User loginUser = getLoginUser();
|
||||
param.setPhone(loginUser.getPhone());
|
||||
}
|
||||
// 使用关联查询
|
||||
return success(userCardService.pageRel(param));
|
||||
}
|
||||
@@ -67,6 +45,10 @@ public class UserCardController extends BaseController {
|
||||
@ApiOperation("查询全部会员卡")
|
||||
@GetMapping()
|
||||
public ApiResult<List<UserCard>> list(UserCardParam param) {
|
||||
if(param.getSceneType() != null && param.getSceneType().equals("myCardAll")){
|
||||
final User loginUser = getLoginUser();
|
||||
param.setPhone(loginUser.getPhone());
|
||||
}
|
||||
// 使用关联查询
|
||||
return success(userCardService.listRel(param));
|
||||
}
|
||||
@@ -82,11 +64,6 @@ public class UserCardController extends BaseController {
|
||||
@ApiOperation("添加会员卡")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody UserCard userCard) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
userCard.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (userCardService.save(userCard)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
|
||||
@@ -19,26 +19,26 @@ import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 明细表控制器
|
||||
* 控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-06-01 12:59:38
|
||||
* @since 2024-07-13 13:06:37
|
||||
*/
|
||||
@Api(tags = "明细表管理")
|
||||
@Api(tags = "管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/booking/user-card-log")
|
||||
public class UserCardLogController extends BaseController {
|
||||
@Resource
|
||||
private UserCardLogService userCardLogService;
|
||||
|
||||
@ApiOperation("分页查询明细表")
|
||||
@ApiOperation("分页查询")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<UserCardLog>> page(UserCardLogParam param) {
|
||||
// 使用关联查询
|
||||
return success(userCardLogService.pageRel(param));
|
||||
}
|
||||
|
||||
@ApiOperation("查询全部明细表")
|
||||
@ApiOperation("查询全部")
|
||||
@GetMapping()
|
||||
public ApiResult<List<UserCardLog>> list(UserCardLogParam param) {
|
||||
// 使用关联查询
|
||||
@@ -46,28 +46,23 @@ public class UserCardLogController extends BaseController {
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('booking:userCardLog:list')")
|
||||
@ApiOperation("根据id查询明细表")
|
||||
@ApiOperation("根据id查询")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<UserCardLog> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(userCardLogService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加明细表")
|
||||
@ApiOperation("添加")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody UserCardLog userCardLog) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
userCardLog.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (userCardLogService.save(userCardLog)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改明细表")
|
||||
@ApiOperation("修改")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody UserCardLog userCardLog) {
|
||||
if (userCardLogService.updateById(userCardLog)) {
|
||||
@@ -76,7 +71,7 @@ public class UserCardLogController extends BaseController {
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除明细表")
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (userCardLogService.removeById(id)) {
|
||||
@@ -85,7 +80,7 @@ public class UserCardLogController extends BaseController {
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量添加明细表")
|
||||
@ApiOperation("批量添加")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<UserCardLog> list) {
|
||||
if (userCardLogService.saveBatch(list)) {
|
||||
@@ -94,16 +89,16 @@ public class UserCardLogController extends BaseController {
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量修改明细表")
|
||||
@ApiOperation("批量修改")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<UserCardLog> batchParam) {
|
||||
if (batchParam.update(userCardLogService, "log_id")) {
|
||||
if (batchParam.update(userCardLogService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("批量删除明细表")
|
||||
@ApiOperation("批量删除")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (userCardLogService.removeByIds(ids)) {
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.List;
|
||||
* 我的优惠券控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-25 17:20:15
|
||||
* @since 2024-07-13 10:00:29
|
||||
*/
|
||||
@Api(tags = "我的优惠券管理")
|
||||
@RestController
|
||||
@@ -47,7 +47,6 @@ public class UserCouponController extends BaseController {
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<UserCoupon>> page(UserCouponParam param) {
|
||||
// 使用关联查询
|
||||
param.setUserId(getLoginUserId());
|
||||
return success(userCouponService.pageRel(param));
|
||||
}
|
||||
|
||||
@@ -55,7 +54,6 @@ public class UserCouponController extends BaseController {
|
||||
@GetMapping()
|
||||
public ApiResult<List<UserCoupon>> list(UserCouponParam param) {
|
||||
// 使用关联查询
|
||||
param.setUserId(getLoginUserId());
|
||||
return success(userCouponService.listRel(param));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package com.gxwebsoft.booking.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 java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -17,7 +16,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 我的优惠券
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-06 07:26:46
|
||||
* @since 2024-07-13 09:43:33
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -30,9 +29,6 @@ public class Coupon implements Serializable {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "优惠劵id")
|
||||
private Integer couponId;
|
||||
|
||||
@ApiModelProperty(value = "优惠券名称")
|
||||
private String name;
|
||||
|
||||
@@ -55,10 +51,10 @@ public class Coupon implements Serializable {
|
||||
private Integer expireDay;
|
||||
|
||||
@ApiModelProperty(value = "有效期开始时间")
|
||||
private Date startTime;
|
||||
private LocalDate startTime;
|
||||
|
||||
@ApiModelProperty(value = "有效期结束时间")
|
||||
private Date endTime;
|
||||
private LocalDate endTime;
|
||||
|
||||
@ApiModelProperty(value = "适用范围(10全部商品 20指定商品)")
|
||||
private Integer applyRange;
|
||||
@@ -69,9 +65,6 @@ public class Coupon implements Serializable {
|
||||
@ApiModelProperty(value = "是否过期(0未过期 1已过期)")
|
||||
private Integer isExpire;
|
||||
|
||||
@ApiModelProperty(value = "是否已使用(0未使用 1已使用)")
|
||||
private Integer isUse;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@@ -89,9 +82,13 @@ public class Coupon implements Serializable {
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@ApiModelProperty(value = "是否已领取")
|
||||
@TableField(exist = false)
|
||||
private Boolean disabled;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
package com.gxwebsoft.booking.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
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.TableField;
|
||||
import java.io.Serializable;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 会员卡
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-29 14:29:43
|
||||
* @since 2024-07-13 11:07:56
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -26,16 +27,10 @@ public class UserCard implements Serializable {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "会员卡ID")
|
||||
private Integer cardId;
|
||||
|
||||
@ApiModelProperty(value = "sid场馆id集合,适用的场馆")
|
||||
private String sid;
|
||||
|
||||
@ApiModelProperty(value = "用户id(旧)")
|
||||
@ApiModelProperty(value = "用户id")
|
||||
private Integer uid;
|
||||
|
||||
@ApiModelProperty(value = "vip卡id")
|
||||
@@ -59,14 +54,11 @@ public class UserCard implements Serializable {
|
||||
@ApiModelProperty(value = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "会员卡图片")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "vip购卡价格")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "会员卡介绍")
|
||||
private String cardDesc;
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "会员卡说明")
|
||||
private String info;
|
||||
@@ -116,9 +108,6 @@ public class UserCard implements Serializable {
|
||||
@ApiModelProperty(value = "1微信支付,2支付宝支付,3现金,4POS机刷卡,15平安健康卡")
|
||||
private Integer payType;
|
||||
|
||||
@ApiModelProperty(value = "0待支付,1已支付")
|
||||
private Integer payStatus;
|
||||
|
||||
@ApiModelProperty(value = "是否赠送积分:1赠送,2不赠送")
|
||||
private Integer isIntegral;
|
||||
|
||||
@@ -126,10 +115,7 @@ public class UserCard implements Serializable {
|
||||
private Integer isInvoice;
|
||||
|
||||
@ApiModelProperty(value = "vip卡到期时间")
|
||||
private Date expirationTime;
|
||||
|
||||
@ApiModelProperty(value = "vip卡到期时间")
|
||||
private Integer expireTimeOld;
|
||||
private String expireTime;
|
||||
|
||||
@ApiModelProperty(value = "紧急联系人")
|
||||
private String urgentName;
|
||||
@@ -147,40 +133,18 @@ public class UserCard implements Serializable {
|
||||
private Integer useTime;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Integer createTimeOld;
|
||||
private Integer createTime;
|
||||
|
||||
private Integer updateTimeOld;
|
||||
private Integer updateTime;
|
||||
|
||||
@ApiModelProperty(value = "身份证号码")
|
||||
private String idCard;
|
||||
|
||||
@ApiModelProperty(value = "商户ID")
|
||||
private Integer merchantId;
|
||||
@TableField("IDCard")
|
||||
private String idcard;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "商户头像")
|
||||
@TableField(exist = false)
|
||||
private String merchantAvatar;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,95 +1,52 @@
|
||||
package com.gxwebsoft.booking.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 明细表
|
||||
*
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-06-01 12:59:38
|
||||
* @since 2024-07-13 13:06:37
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "UserCardLog对象", description = "明细表")
|
||||
@ApiModel(value = "UserCardLog对象", description = "")
|
||||
@TableName("booking_user_card_log")
|
||||
public class UserCardLog implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@TableId(value = "log_id", type = IdType.AUTO)
|
||||
private Integer logId;
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "会员卡ID")
|
||||
private Integer userCardId;
|
||||
|
||||
@ApiModelProperty(value = "会员卡卡号")
|
||||
private String cardNum;
|
||||
|
||||
@ApiModelProperty(value = "IC卡类型:1年卡,2次卡,3月卡,4会员IC卡,5充值卡 ")
|
||||
@ApiModelProperty(value = "会员卡类型:1年卡,2次卡,3月卡,4会员VIP,VIP充值卡")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "变动金额")
|
||||
private BigDecimal money;
|
||||
@ApiModelProperty(value = "卡类型:1成人卡,2儿童卡")
|
||||
private Boolean cardType;
|
||||
|
||||
@ApiModelProperty(value = "变动后余额")
|
||||
private BigDecimal balance;
|
||||
@ApiModelProperty(value = "vip卡等级类型:1特殊vip卡,2普通vip卡")
|
||||
private Boolean vipType;
|
||||
|
||||
@ApiModelProperty(value = "剩余次数")
|
||||
private Integer num;
|
||||
@ApiModelProperty(value = "统计金额(正是收入,负是冲抵(退卡后产生))")
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "管理员备注")
|
||||
private String remark;
|
||||
private Integer createTime;
|
||||
|
||||
@ApiModelProperty(value = "订单编号")
|
||||
private String orderNo;
|
||||
@ApiModelProperty(value = "虚拟卡ID")
|
||||
private Integer usersVipId;
|
||||
|
||||
@ApiModelProperty(value = "操作人ID")
|
||||
private Integer adminId;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "商户ID")
|
||||
private Integer merchantId;
|
||||
|
||||
@ApiModelProperty(value = "商户编码")
|
||||
private String merchantCode;
|
||||
@ApiModelProperty(value = "实体卡id")
|
||||
private Integer cardId;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "会员卡名称")
|
||||
@TableField(exist = false)
|
||||
private String cardName;
|
||||
|
||||
}
|
||||
|
||||
@@ -3,12 +3,11 @@ package com.gxwebsoft.booking.entity;
|
||||
import java.math.BigDecimal;
|
||||
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.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -18,7 +17,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 我的优惠券
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-25 17:20:15
|
||||
* @since 2024-07-13 10:00:29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -56,10 +55,10 @@ public class UserCoupon implements Serializable {
|
||||
private Integer expireDay;
|
||||
|
||||
@ApiModelProperty(value = "有效期开始时间")
|
||||
private Date startTime;
|
||||
private LocalDate startTime;
|
||||
|
||||
@ApiModelProperty(value = "有效期结束时间")
|
||||
private Date endTime;
|
||||
private LocalDate endTime;
|
||||
|
||||
@ApiModelProperty(value = "适用范围(10全部商品 20指定商品)")
|
||||
private Integer applyRange;
|
||||
@@ -89,10 +88,10 @@ public class UserCoupon implements Serializable {
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "领取时间")
|
||||
private Date createTime;
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
* 我的优惠券Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-06 07:26:46
|
||||
* @since 2024-07-13 09:43:33
|
||||
*/
|
||||
public interface CouponMapper extends BaseMapper<Coupon> {
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 明细表Mapper
|
||||
* Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-06-01 12:59:38
|
||||
* @since 2024-07-13 13:06:37
|
||||
*/
|
||||
public interface UserCardLogMapper extends BaseMapper<UserCardLog> {
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
* 会员卡Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-29 14:29:43
|
||||
* @since 2024-07-13 11:07:56
|
||||
*/
|
||||
public interface UserCardMapper extends BaseMapper<UserCard> {
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
* 我的优惠券Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-25 17:20:15
|
||||
* @since 2024-07-13 10:00:29
|
||||
*/
|
||||
public interface UserCouponMapper extends BaseMapper<UserCoupon> {
|
||||
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.couponId != null">
|
||||
AND a.coupon_id = #{param.couponId}
|
||||
</if>
|
||||
<if test="param.name != null">
|
||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||
</if>
|
||||
@@ -49,9 +46,6 @@
|
||||
<if test="param.isExpire != null">
|
||||
AND a.is_expire = #{param.isExpire}
|
||||
</if>
|
||||
<if test="param.isUse != null">
|
||||
AND a.is_use = #{param.isUse}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
|
||||
@@ -7,59 +7,20 @@
|
||||
SELECT a.*
|
||||
FROM booking_user_card_log a
|
||||
<where>
|
||||
<if test="param.logId != null">
|
||||
AND a.log_id = #{param.logId}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.userCardId != null">
|
||||
AND a.user_card_id = #{param.userCardId}
|
||||
</if>
|
||||
<if test="param.cardNum != null">
|
||||
AND a.card_num LIKE CONCAT('%', #{param.cardNum}, '%')
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.type != null">
|
||||
AND a.type = #{param.type}
|
||||
</if>
|
||||
<if test="param.money != null">
|
||||
AND a.money = #{param.money}
|
||||
<if test="param.cardType != null">
|
||||
AND a.card_type = #{param.cardType}
|
||||
</if>
|
||||
<if test="param.balance != null">
|
||||
AND a.balance = #{param.balance}
|
||||
<if test="param.vipType != null">
|
||||
AND a.vip_type = #{param.vipType}
|
||||
</if>
|
||||
<if test="param.num != null">
|
||||
AND a.num = #{param.num}
|
||||
</if>
|
||||
<if test="param.remark != null">
|
||||
AND a.remark LIKE CONCAT('%', #{param.remark}, '%')
|
||||
</if>
|
||||
<if test="param.orderNo != null">
|
||||
AND a.order_no LIKE CONCAT('%', #{param.orderNo}, '%')
|
||||
</if>
|
||||
<if test="param.adminId != null">
|
||||
AND a.admin_id = #{param.adminId}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<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.merchantId != null">
|
||||
AND a.merchant_id = #{param.merchantId}
|
||||
</if>
|
||||
<if test="param.merchantCode != null">
|
||||
AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%')
|
||||
<if test="param.price != null">
|
||||
AND a.price = #{param.price}
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
@@ -67,6 +28,12 @@
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.usersVipId != null">
|
||||
AND a.users_vip_id = #{param.usersVipId}
|
||||
</if>
|
||||
<if test="param.cardId != null">
|
||||
AND a.card_id = #{param.cardId}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
|
||||
@@ -4,16 +4,12 @@
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*,b.merchant_name,b.image as merchant_avatar
|
||||
SELECT a.*
|
||||
FROM booking_user_card a
|
||||
LEFT JOIN shop_merchant b ON a.merchant_id = b.merchant_id
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.sid != null">
|
||||
AND a.sid LIKE CONCAT('%', #{param.sid}, '%')
|
||||
</if>
|
||||
@@ -39,16 +35,13 @@
|
||||
AND a.username LIKE CONCAT('%', #{param.username}, '%')
|
||||
</if>
|
||||
<if test="param.phone != null">
|
||||
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
||||
AND a.phone = #{param.phone}
|
||||
</if>
|
||||
<if test="param.price != null">
|
||||
AND a.price = #{param.price}
|
||||
</if>
|
||||
<if test="param.payStatus != null">
|
||||
AND a.pay_status = #{param.payStatus}
|
||||
</if>
|
||||
<if test="param.cardDesc != null">
|
||||
AND a.card_desc LIKE CONCAT('%', #{param.cardDesc}, '%')
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.info != null">
|
||||
AND a.info LIKE CONCAT('%', #{param.info}, '%')
|
||||
@@ -104,11 +97,8 @@
|
||||
<if test="param.isInvoice != null">
|
||||
AND a.is_invoice = #{param.isInvoice}
|
||||
</if>
|
||||
<if test="param.expirationTime != null">
|
||||
AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%')
|
||||
</if>
|
||||
<if test="param.expireTimeOld != null">
|
||||
AND a.expire_time_old = #{param.expireTimeOld}
|
||||
<if test="param.expireTime != null">
|
||||
AND a.expire_time = #{param.expireTime}
|
||||
</if>
|
||||
<if test="param.urgentName != null">
|
||||
AND a.urgent_name LIKE CONCAT('%', #{param.urgentName}, '%')
|
||||
@@ -125,38 +115,22 @@
|
||||
<if test="param.useTime != null">
|
||||
AND a.use_time = #{param.useTime}
|
||||
</if>
|
||||
<if test="param.createTimeOld != null">
|
||||
AND a.create_time_old = #{param.createTimeOld}
|
||||
</if>
|
||||
<if test="param.updateTimeOld != null">
|
||||
AND a.update_time_old = #{param.updateTimeOld}
|
||||
</if>
|
||||
<if test="param.idCard != null">
|
||||
AND a.id_card LIKE CONCAT('%', #{param.idCard}, '%')
|
||||
</if>
|
||||
<if test="param.remark != null">
|
||||
AND a.remark LIKE CONCAT('%', #{param.remark}, '%')
|
||||
</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 >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.idcard != null">
|
||||
AND a.IDCard LIKE CONCAT('%', #{param.idcard}, '%')
|
||||
</if>
|
||||
<if test="param.remark != null">
|
||||
AND a.remark LIKE CONCAT('%', #{param.remark}, '%')
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
AND (a.phone LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR a.idcard LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR a.card_num LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
|
||||
@@ -35,10 +35,10 @@
|
||||
AND a.expire_day = #{param.expireDay}
|
||||
</if>
|
||||
<if test="param.startTime != null">
|
||||
AND a.start_time = #{param.startTime}
|
||||
AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%')
|
||||
</if>
|
||||
<if test="param.endTime != null">
|
||||
AND a.end_time = #{param.endTime}
|
||||
AND a.end_time LIKE CONCAT('%', #{param.endTime}, '%')
|
||||
</if>
|
||||
<if test="param.applyRange != null">
|
||||
AND a.apply_range = #{param.applyRange}
|
||||
|
||||
@@ -97,4 +97,8 @@ public class CardParam extends BaseParam {
|
||||
@TableField(exist = false)
|
||||
private Integer buyUserId;
|
||||
|
||||
@ApiModelProperty(value = "买家用户手机号")
|
||||
@TableField(exist = false)
|
||||
private String phone;
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 我的优惠券查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-06 07:26:46
|
||||
* @since 2024-07-13 09:43:33
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -27,10 +27,6 @@ public class CouponParam extends BaseParam {
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "优惠劵id")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer couponId;
|
||||
|
||||
@ApiModelProperty(value = "优惠券名称")
|
||||
private String name;
|
||||
|
||||
@@ -75,10 +71,6 @@ public class CouponParam extends BaseParam {
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer isExpire;
|
||||
|
||||
@ApiModelProperty(value = "是否已使用(0未使用 1已使用)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer isUse;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
@@ -95,4 +87,8 @@ public class CouponParam extends BaseParam {
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "当前登录用户")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer loginUserId;
|
||||
|
||||
}
|
||||
|
||||
@@ -11,79 +11,43 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 明细表查询参数
|
||||
* 查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-06-01 12:59:38
|
||||
* @since 2024-07-13 13:06:37
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "UserCardLogParam对象", description = "明细表查询参数")
|
||||
@ApiModel(value = "UserCardLogParam对象", description = "查询参数")
|
||||
public class UserCardLogParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer logId;
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "会员卡ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userCardId;
|
||||
|
||||
@ApiModelProperty(value = "会员卡卡号")
|
||||
private String cardNum;
|
||||
|
||||
@ApiModelProperty(value = "IC卡类型:1年卡,2次卡,3月卡,4会员IC卡,5充值卡 ")
|
||||
@ApiModelProperty(value = "会员卡类型:1年卡,2次卡,3月卡,4会员VIP,VIP充值卡")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "变动金额")
|
||||
@ApiModelProperty(value = "卡类型:1成人卡,2儿童卡")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal money;
|
||||
private Boolean cardType;
|
||||
|
||||
@ApiModelProperty(value = "变动后余额")
|
||||
@ApiModelProperty(value = "vip卡等级类型:1特殊vip卡,2普通vip卡")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal balance;
|
||||
private Boolean vipType;
|
||||
|
||||
@ApiModelProperty(value = "剩余次数")
|
||||
@ApiModelProperty(value = "统计金额(正是收入,负是冲抵(退卡后产生))")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer num;
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "管理员备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "订单编号")
|
||||
private String orderNo;
|
||||
|
||||
@ApiModelProperty(value = "操作人ID")
|
||||
@ApiModelProperty(value = "虚拟卡ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer adminId;
|
||||
private Integer usersVipId;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
@ApiModelProperty(value = "实体卡id")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "商户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer merchantId;
|
||||
|
||||
@ApiModelProperty(value = "商户编码")
|
||||
private String merchantCode;
|
||||
private Integer cardId;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.gxwebsoft.booking.param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Set;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
@@ -17,7 +14,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 会员卡查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-29 14:29:43
|
||||
* @since 2024-07-13 11:07:56
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -29,18 +26,10 @@ public class UserCardParam extends BaseParam {
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "用户id")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "会员卡ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer cardId;
|
||||
|
||||
@ApiModelProperty(value = "sid场馆id集合,适用的场馆")
|
||||
private String sid;
|
||||
|
||||
@ApiModelProperty(value = "用户id(旧)")
|
||||
@ApiModelProperty(value = "用户id")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer uid;
|
||||
|
||||
@@ -72,7 +61,7 @@ public class UserCardParam extends BaseParam {
|
||||
private BigDecimal price;
|
||||
|
||||
@ApiModelProperty(value = "会员卡介绍")
|
||||
private String cardDesc;
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "会员卡说明")
|
||||
private String info;
|
||||
@@ -135,10 +124,6 @@ public class UserCardParam extends BaseParam {
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer payType;
|
||||
|
||||
@ApiModelProperty(value = "0待支付,1已支付")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer payStatus;
|
||||
|
||||
@ApiModelProperty(value = "是否赠送积分:1赠送,2不赠送")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer isIntegral;
|
||||
@@ -147,12 +132,9 @@ public class UserCardParam extends BaseParam {
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer isInvoice;
|
||||
|
||||
@ApiModelProperty(value = "vip卡到期时间")
|
||||
private String expirationTime;
|
||||
|
||||
@ApiModelProperty(value = "vip卡到期时间")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer expireTimeOld;
|
||||
private Integer expireTime;
|
||||
|
||||
@ApiModelProperty(value = "紧急联系人")
|
||||
private String urgentName;
|
||||
@@ -170,36 +152,10 @@ public class UserCardParam extends BaseParam {
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer useTime;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer createTimeOld;
|
||||
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer updateTimeOld;
|
||||
|
||||
@ApiModelProperty(value = "身份证号码")
|
||||
private String idCard;
|
||||
private String idcard;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@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;
|
||||
|
||||
@ApiModelProperty(value = "会员卡ID集合")
|
||||
@TableField(exist = false)
|
||||
private Set<Integer> cardIds;
|
||||
|
||||
@ApiModelProperty(value = "订单金额")
|
||||
@TableField(exist = false)
|
||||
private BigDecimal payPrice;
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import lombok.EqualsAndHashCode;
|
||||
* 我的优惠券查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-25 17:20:15
|
||||
* @since 2024-07-13 10:00:29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
* 我的优惠券Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-06 07:26:46
|
||||
* @since 2024-07-13 09:43:33
|
||||
*/
|
||||
public interface CouponService extends IService<Coupon> {
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ import com.gxwebsoft.booking.param.UserCardLogParam;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 明细表Service
|
||||
* Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-06-01 12:59:38
|
||||
* @since 2024-07-13 13:06:37
|
||||
*/
|
||||
public interface UserCardLogService extends IService<UserCardLog> {
|
||||
|
||||
@@ -34,9 +34,9 @@ public interface UserCardLogService extends IService<UserCardLog> {
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param logId 主键ID
|
||||
* @param id
|
||||
* @return UserCardLog
|
||||
*/
|
||||
UserCardLog getByIdRel(Integer logId);
|
||||
UserCardLog getByIdRel(Integer id);
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
* 会员卡Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-29 14:29:43
|
||||
* @since 2024-07-13 11:07:56
|
||||
*/
|
||||
public interface UserCardService extends IService<UserCard> {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
* 我的优惠券Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-25 17:20:15
|
||||
* @since 2024-07-13 10:00:29
|
||||
*/
|
||||
public interface UserCouponService extends IService<UserCoupon> {
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.gxwebsoft.booking.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.booking.entity.UserCard;
|
||||
@@ -36,9 +37,12 @@ public class CardServiceImpl extends ServiceImpl<CardMapper, Card> implements Ca
|
||||
page.setDefaultOrder("sort_number asc, price asc, create_time desc");
|
||||
|
||||
// 只显示可购买的会员卡
|
||||
if(param.getSceneType() != null && param.getSceneType().equals("showCanBuyVipCard")){
|
||||
final List<UserCard> userCardList = userCardService.list(new LambdaUpdateWrapper<UserCard>().eq(UserCard::getUserId, param.getBuyUserId()).eq(UserCard::getPayStatus,1));
|
||||
final Set<Integer> collect = userCardList.stream().map(UserCard::getCardId).collect(Collectors.toSet());
|
||||
if(param.getSceneType() != null && param.getSceneType().equals("showCanBuyVipCard") && param.getPhone() != null){
|
||||
System.out.println("param = " + param);
|
||||
final List<UserCard> userCardList = userCardService.list(new LambdaQueryWrapper<UserCard>().eq(UserCard::getPhone, param.getPhone()).eq(UserCard::getStatus,1));
|
||||
System.out.println("userCardList = " + userCardList);
|
||||
final Set<Integer> collect = userCardList.stream().map(UserCard::getId).collect(Collectors.toSet());
|
||||
System.out.println("collect = " + collect);
|
||||
if (!CollectionUtils.isEmpty(collect)) {
|
||||
param.setCardIds(collect);
|
||||
}
|
||||
|
||||
@@ -1,31 +1,52 @@
|
||||
package com.gxwebsoft.booking.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.booking.entity.UserCoupon;
|
||||
import com.gxwebsoft.booking.mapper.CouponMapper;
|
||||
import com.gxwebsoft.booking.service.CouponService;
|
||||
import com.gxwebsoft.booking.entity.Coupon;
|
||||
import com.gxwebsoft.booking.param.CouponParam;
|
||||
import com.gxwebsoft.booking.service.UserCouponService;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 我的优惠券Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-06 07:26:46
|
||||
* @since 2024-07-13 09:43:33
|
||||
*/
|
||||
@Service
|
||||
public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> implements CouponService {
|
||||
@Resource
|
||||
private UserCouponService userCouponService;
|
||||
|
||||
@Override
|
||||
public PageResult<Coupon> pageRel(CouponParam param) {
|
||||
PageParam<Coupon, CouponParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<Coupon> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
if(param.getLoginUserId() != null && !CollectionUtils.isEmpty(list)){
|
||||
final List<UserCoupon> userCoupons = userCouponService.list(new LambdaUpdateWrapper<UserCoupon>().eq(UserCoupon::getUserId,param.getLoginUserId()));
|
||||
final Set<Integer> collect = userCoupons.stream().map(UserCoupon::getCouponId).collect(Collectors.toSet());
|
||||
list.forEach(d -> {
|
||||
if (collect.contains(d.getId())) {
|
||||
// 防止重复领取
|
||||
d.setDisabled(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,15 +8,14 @@ import com.gxwebsoft.booking.param.UserCardLogParam;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 明细表Service实现
|
||||
* Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-06-01 12:59:38
|
||||
* @since 2024-07-13 13:06:37
|
||||
*/
|
||||
@Service
|
||||
public class UserCardLogServiceImpl extends ServiceImpl<UserCardLogMapper, UserCardLog> implements UserCardLogService {
|
||||
@@ -24,7 +23,7 @@ public class UserCardLogServiceImpl extends ServiceImpl<UserCardLogMapper, UserC
|
||||
@Override
|
||||
public PageResult<UserCardLog> pageRel(UserCardLogParam param) {
|
||||
PageParam<UserCardLog, UserCardLogParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
page.setDefaultOrder("create_time desc");
|
||||
List<UserCardLog> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
@@ -34,14 +33,14 @@ public class UserCardLogServiceImpl extends ServiceImpl<UserCardLogMapper, UserC
|
||||
List<UserCardLog> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<UserCardLog, UserCardLogParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserCardLog getByIdRel(Integer logId) {
|
||||
public UserCardLog getByIdRel(Integer id) {
|
||||
UserCardLogParam param = new UserCardLogParam();
|
||||
param.setLogId(logId);
|
||||
param.setId(id);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
* 会员卡Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-29 14:29:43
|
||||
* @since 2024-07-13 11:07:56
|
||||
*/
|
||||
@Service
|
||||
public class UserCardServiceImpl extends ServiceImpl<UserCardMapper, UserCard> implements UserCardService {
|
||||
@@ -23,7 +23,7 @@ public class UserCardServiceImpl extends ServiceImpl<UserCardMapper, UserCard> i
|
||||
@Override
|
||||
public PageResult<UserCard> pageRel(UserCardParam param) {
|
||||
PageParam<UserCard, UserCardParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
page.setDefaultOrder("create_time desc");
|
||||
List<UserCard> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public class UserCardServiceImpl extends ServiceImpl<UserCardMapper, UserCard> i
|
||||
List<UserCard> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<UserCard, UserCardParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
* 我的优惠券Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-05-25 17:20:15
|
||||
* @since 2024-07-13 10:00:29
|
||||
*/
|
||||
@Service
|
||||
public class UserCouponServiceImpl extends ServiceImpl<UserCouponMapper, UserCoupon> implements UserCouponService {
|
||||
|
||||
@@ -47,6 +47,7 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.Instant;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -244,17 +245,17 @@ public class OrderController extends BaseController {
|
||||
// 会员卡信息
|
||||
final Card card = cardService.getByIdRel(Integer.valueOf(order.getCardId()));
|
||||
final UserCard userCard = new UserCard();
|
||||
userCard.setUserId(loginUser.getUserId());
|
||||
userCard.setPhone(loginUser.getPhone());
|
||||
// 适用场馆
|
||||
userCard.setCardId(Integer.valueOf(order.getCardId()));
|
||||
// userCard.setCardId(Integer.valueOf(order.getCardId()));
|
||||
userCard.setSid(card.getMerchantIds());
|
||||
userCard.setCardNum(CommonUtil.createCardNo());
|
||||
userCard.setName(card.getCardName());
|
||||
userCard.setUsername(loginUser.getRealName());
|
||||
userCard.setPhone(loginUser.getPhone());
|
||||
userCard.setPrice(card.getPrice());
|
||||
userCard.setImage(card.getImage());
|
||||
userCard.setCardDesc(card.getCardDesc());
|
||||
// userCard.setImage(card.getImage());
|
||||
userCard.setComments(card.getCardDesc());
|
||||
userCard.setInfo(card.getComments());
|
||||
userCard.setUid(loginUser.getUserId());
|
||||
userCard.setRemainingMoney(card.getPrice());
|
||||
@@ -265,11 +266,11 @@ public class OrderController extends BaseController {
|
||||
userCard.setNumber(1);
|
||||
userCard.setNum(card.getNumber());
|
||||
userCard.setMonth(card.getMonth());
|
||||
userCard.setMerchantId(card.getMerchantId());
|
||||
userCard.setPayType(1);
|
||||
userCard.setType(card.getType());
|
||||
userCard.setTenantId(card.getTenantId());
|
||||
userCard.setExpirationTime(DateUtil.offset(DateUtil.date(), DateField.MONTH, card.getMonth()));
|
||||
final long epochMilli = DateUtil.toInstant(DateUtil.offset(DateUtil.date(), DateField.MONTH, card.getMonth())).toEpochMilli();
|
||||
userCard.setExpireTime(String.valueOf(epochMilli/1000));
|
||||
userCardService.save(userCard);
|
||||
order.setCardId(userCard.getId());
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ public class WxPayNotifyController extends BaseController {
|
||||
// 7.同步会员卡状态
|
||||
if(order.getType().equals(2)){
|
||||
final UserCard userCard = userCardService.getById(order.getCardId());
|
||||
userCard.setPayStatus(1);
|
||||
userCard.setStatus(1);
|
||||
userCardService.updateById(userCard);
|
||||
}
|
||||
// 8.发放积分
|
||||
|
||||
@@ -275,7 +275,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
// 更新会员卡状态
|
||||
if (order.getType().equals(2)) {
|
||||
final UserCard userCard = userCardService.getById(order.getCardId());
|
||||
userCard.setPayStatus(1);
|
||||
userCard.setStatus(1);
|
||||
userCardService.updateById(userCard);
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
throw new BusinessException("会员卡余额不足");
|
||||
}
|
||||
final BigDecimal subtract = userCard.getRemainingMoney().subtract(order.getPayPrice());
|
||||
userCardLog.setBalance(subtract);
|
||||
userCardLog.setPrice(subtract);
|
||||
userCard.setRemainingMoney(subtract);
|
||||
}
|
||||
|
||||
@@ -361,20 +361,20 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
if (userCard.getNum() <= 0) {
|
||||
throw new BusinessException("剩余次数不足");
|
||||
}
|
||||
userCardLog.setNum(userCard.getNum() - 1);
|
||||
userCardLog.setPrice(new BigDecimal("0"));
|
||||
}
|
||||
userCardService.updateById(userCard);
|
||||
|
||||
// 记录明细
|
||||
userCardLog.setUserId(order.getUserId());
|
||||
userCardLog.setUserCardId(userCard.getId());
|
||||
userCardLog.setCardNum(userCard.getCardNum());
|
||||
userCardLog.setComments(order.getComments());
|
||||
// userCardLog.setUserId(order.getUserId());
|
||||
userCardLog.setCardId(userCard.getId());
|
||||
// userCardLog.setCardNum(userCard.getCardNum());
|
||||
// userCardLog.setComments(order.getComments());
|
||||
userCardLog.setType(userCard.getType());
|
||||
userCardLog.setMoney(order.getPayPrice());
|
||||
userCardLog.setOrderNo(order.getOrderNo());
|
||||
userCardLog.setMerchantId(order.getMerchantId());
|
||||
userCardLog.setMerchantCode(order.getMerchantCode());
|
||||
userCardLog.setPrice(order.getPayPrice());
|
||||
// userCardLog.setOrderNo(order.getOrderNo());
|
||||
// userCardLog.setMerchantId(order.getMerchantId());
|
||||
// userCardLog.setMerchantCode(order.getMerchantCode());
|
||||
userCardLogService.save(userCardLog);
|
||||
// 修改订单状态
|
||||
order.setPayStatus(1);
|
||||
|
||||
@@ -58,10 +58,9 @@ public class BookingGenerator {
|
||||
// "booking_order"
|
||||
// "booking_emergency",
|
||||
// "booking_user",
|
||||
// "booking_user_coupon",
|
||||
// "booking_user_invoice",
|
||||
// "booking_user_card",
|
||||
// "booking_user_card_log",
|
||||
"booking_user_card_log",
|
||||
// "booking_item",
|
||||
// "booking_course",
|
||||
// "booking_course_category",
|
||||
@@ -70,7 +69,8 @@ public class BookingGenerator {
|
||||
// "booking_cooperate_log",
|
||||
// "booking_match",
|
||||
// "booking_match_order",
|
||||
// "booking_coupon"
|
||||
// "booking_coupon",
|
||||
// "booking_user_coupon",
|
||||
};
|
||||
// 需要去除的表前缀
|
||||
private static final String[] TABLE_PREFIX = new String[]{
|
||||
|
||||
Reference in New Issue
Block a user