新增用户余额明细、充值记录、批量充值功能
This commit is contained in:
@@ -58,7 +58,7 @@ public class MerchantController extends BaseController {
|
||||
return success(merchantService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:merchant:save')")
|
||||
@PreAuthorize("hasAuthority('sys:merchant:save')")
|
||||
@ApiOperation("添加商户")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Merchant merchant, HttpServletRequest request) {
|
||||
@@ -88,7 +88,7 @@ public class MerchantController extends BaseController {
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:merchant:update')")
|
||||
@PreAuthorize("hasAuthority('sys:merchant:update')")
|
||||
@ApiOperation("修改商户")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Merchant merchant) {
|
||||
@@ -98,7 +98,7 @@ public class MerchantController extends BaseController {
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:merchant:remove')")
|
||||
@PreAuthorize("hasAuthority('sys:merchant:remove')")
|
||||
@ApiOperation("删除商户")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
@@ -108,7 +108,7 @@ public class MerchantController extends BaseController {
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:merchant:save')")
|
||||
@PreAuthorize("hasAuthority('sys:merchant:save')")
|
||||
@ApiOperation("批量添加商户")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Merchant> list) {
|
||||
@@ -118,7 +118,7 @@ public class MerchantController extends BaseController {
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:merchant:update')")
|
||||
@PreAuthorize("hasAuthority('sys:merchant:update')")
|
||||
@ApiOperation("批量修改商户")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Merchant> batchParam) {
|
||||
@@ -128,7 +128,7 @@ public class MerchantController extends BaseController {
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('shop:merchant:remove')")
|
||||
@PreAuthorize("hasAuthority('sys:merchant:remove')")
|
||||
@ApiOperation("批量删除商户")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
package com.gxwebsoft.common.system.controller;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.common.system.service.UserService;
|
||||
import com.gxwebsoft.common.system.entity.RechargeOrder;
|
||||
import com.gxwebsoft.common.system.entity.UserBalanceLog;
|
||||
import com.gxwebsoft.common.system.param.RechargeOrderParam;
|
||||
import com.gxwebsoft.common.system.service.RechargeOrderService;
|
||||
import com.gxwebsoft.common.system.service.UserBalanceLogService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.gxwebsoft.common.core.constants.BalanceConstants.BALANCE_ADMIN;
|
||||
|
||||
/**
|
||||
* 会员充值订单表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-26 23:18:48
|
||||
*/
|
||||
@Api(tags = "会员充值订单表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/sys/recharge-order")
|
||||
public class RechargeOrderController extends BaseController {
|
||||
@Resource
|
||||
private RechargeOrderService rechargeOrderService;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private UserBalanceLogService userBalanceLogService;
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:rechargeOrder:save')")
|
||||
@ApiOperation("会员充值")
|
||||
@PostMapping("/recharge")
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public ApiResult<?> recharge(@RequestBody RechargeOrder rechargeOrder) {
|
||||
// 充值
|
||||
User user = userService.getById(rechargeOrder.getUserId());
|
||||
BigDecimal balance = user.getBalance().add(rechargeOrder.getPayPrice());
|
||||
user.setBalance(balance);
|
||||
userService.updateById(user);
|
||||
// 保存充值记录
|
||||
rechargeOrder.setOrderNo(Long.toString(IdUtil.getSnowflakeNextId()));
|
||||
rechargeOrder.setBalance(balance);
|
||||
if (rechargeOrderService.save(rechargeOrder)) {
|
||||
// 记录余额明细
|
||||
UserBalanceLog userBalanceLog = new UserBalanceLog();
|
||||
userBalanceLog.setUserId(rechargeOrder.getUserId());
|
||||
userBalanceLog.setScene(BALANCE_ADMIN);
|
||||
userBalanceLog.setMoney(rechargeOrder.getPayPrice());
|
||||
userBalanceLog.setBalance(balance);
|
||||
userBalanceLog.setComments("操作人:" + getLoginUser().getNickname());
|
||||
userBalanceLog.setRemark(rechargeOrder.getComments());
|
||||
userBalanceLog.setMerchantCode(rechargeOrder.getMerchantCode());
|
||||
userBalanceLogService.save(userBalanceLog);
|
||||
return success("充值成功", user);
|
||||
}
|
||||
return fail("充值失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:rechargeOrder:list')")
|
||||
@ApiOperation("分页查询会员充值订单表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<RechargeOrder>> page(RechargeOrderParam param) {
|
||||
// 使用关联查询
|
||||
return success(rechargeOrderService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:rechargeOrder:list')")
|
||||
@ApiOperation("查询全部会员充值订单表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<RechargeOrder>> list(RechargeOrderParam param) {
|
||||
// 使用关联查询
|
||||
return success(rechargeOrderService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:rechargeOrder:list')")
|
||||
@ApiOperation("根据id查询会员充值订单表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<RechargeOrder> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(rechargeOrderService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@ApiOperation("添加会员充值订单表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody RechargeOrder rechargeOrder) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
rechargeOrder.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (rechargeOrderService.save(rechargeOrder)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改会员充值订单表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody RechargeOrder rechargeOrder) {
|
||||
if (rechargeOrderService.updateById(rechargeOrder)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@ApiOperation("删除会员充值订单表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (rechargeOrderService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:rechargeOrder:save')")
|
||||
@ApiOperation("批量充值")
|
||||
@PostMapping("/batchRecharge")
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public ApiResult<?> batchRecharge(@RequestBody List<RechargeOrder> list) {
|
||||
if (rechargeOrderService.saveBatch(list)) {
|
||||
String nickname = getLoginUser().getNickname();
|
||||
ArrayList<User> users = new ArrayList<>(list.size());
|
||||
ArrayList<UserBalanceLog> logs = new ArrayList<>(list.size());
|
||||
|
||||
list.forEach(d -> {
|
||||
User user = userService.getByIdRel(d.getUserId());
|
||||
BigDecimal balance = user.getBalance().add(d.getPayPrice());
|
||||
user.setBalance(balance);
|
||||
users.add(user);
|
||||
UserBalanceLog userBalanceLog = new UserBalanceLog();
|
||||
userBalanceLog.setUserId(d.getUserId());
|
||||
userBalanceLog.setScene(BALANCE_ADMIN);
|
||||
userBalanceLog.setMoney(d.getPayPrice());
|
||||
userBalanceLog.setBalance(balance);
|
||||
userBalanceLog.setComments("操作人:" + nickname);
|
||||
userBalanceLog.setRemark(d.getComments());
|
||||
userBalanceLog.setMerchantCode(d.getMerchantCode());
|
||||
logs.add(userBalanceLog);
|
||||
});
|
||||
|
||||
// 批量充值
|
||||
userService.updateBatchById(users);
|
||||
// 记录余额明细
|
||||
userBalanceLogService.saveBatch(logs);
|
||||
return success("充值成功");
|
||||
}
|
||||
return fail("充值失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:rechargeOrder:update')")
|
||||
@ApiOperation("批量修改会员充值订单表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<RechargeOrder> batchParam) {
|
||||
if (batchParam.update(rechargeOrderService, "order_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:rechargeOrder:remove')")
|
||||
@ApiOperation("批量删除会员充值订单表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (rechargeOrderService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.gxwebsoft.common.system.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.*;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.common.system.entity.UserBalanceLog;
|
||||
import com.gxwebsoft.common.system.param.UserBalanceLogParam;
|
||||
import com.gxwebsoft.common.system.service.UserBalanceLogService;
|
||||
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 2023-04-21 15:59:09
|
||||
*/
|
||||
@Api(tags = "用户余额变动明细表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/sys/user-balance-log")
|
||||
public class UserBalanceLogController extends BaseController {
|
||||
@Resource
|
||||
private UserBalanceLogService userBalanceLogService;
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:userBalanceLog:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询用户余额变动明细表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<UserBalanceLog>> page(UserBalanceLogParam param) {
|
||||
// 使用关联查询
|
||||
return success(userBalanceLogService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:userBalanceLog:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部用户余额变动明细表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<UserBalanceLog>> list(UserBalanceLogParam param) {
|
||||
PageParam<UserBalanceLog, UserBalanceLogParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(userBalanceLogService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(userBalanceLogService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:userBalanceLog:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询用户余额变动明细表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<UserBalanceLog> get(@PathVariable("id") Integer id) {
|
||||
return success(userBalanceLogService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(userBalanceLogService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:userBalanceLog:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加用户余额变动明细表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody UserBalanceLog userBalanceLog) {
|
||||
// 记录当前登录用户id、租户id、商户编号
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
userBalanceLog.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (userBalanceLogService.save(userBalanceLog)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:userBalanceLog:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改用户余额变动明细表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody UserBalanceLog userBalanceLog) {
|
||||
if (userBalanceLogService.updateById(userBalanceLog)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:userBalanceLog:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除用户余额变动明细表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (userBalanceLogService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:userBalanceLog:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加用户余额变动明细表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<UserBalanceLog> list) {
|
||||
if (userBalanceLogService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:userBalanceLog:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改用户余额变动明细表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<UserBalanceLog> batchParam) {
|
||||
if (batchParam.update(userBalanceLogService, "log_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('sys:userBalanceLog:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除用户余额变动明细表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (userBalanceLogService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.gxwebsoft.common.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
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-07-26 23:18:48
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "RechargeOrder对象", description = "会员充值订单表")
|
||||
@TableName("sys_recharge_order")
|
||||
public class RechargeOrder implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "订单ID")
|
||||
@TableId(value = "order_id", type = IdType.AUTO)
|
||||
private Integer orderId;
|
||||
|
||||
@ApiModelProperty(value = "订单号")
|
||||
private String orderNo;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "充值方式(10自定义金额 20套餐充值)")
|
||||
private Integer rechargeType;
|
||||
|
||||
@ApiModelProperty(value = "机构id")
|
||||
private Integer organizationId;
|
||||
|
||||
@ApiModelProperty(value = "充值套餐ID")
|
||||
private Integer planId;
|
||||
|
||||
@ApiModelProperty(value = "用户支付金额")
|
||||
private BigDecimal payPrice;
|
||||
|
||||
@ApiModelProperty(value = "赠送金额")
|
||||
private BigDecimal giftMoney;
|
||||
|
||||
@ApiModelProperty(value = "实际到账金额")
|
||||
private BigDecimal actualMoney;
|
||||
|
||||
@ApiModelProperty(value = "用户可用余额")
|
||||
private BigDecimal balance;
|
||||
|
||||
@ApiModelProperty(value = "支付方式(微信/支付宝)")
|
||||
private String payMethod;
|
||||
|
||||
@ApiModelProperty(value = "支付状态(10待支付 20已支付)")
|
||||
private Integer payStatus;
|
||||
|
||||
@ApiModelProperty(value = "付款时间")
|
||||
private Integer payTime;
|
||||
|
||||
@ApiModelProperty(value = "第三方交易记录ID")
|
||||
private Integer tradeId;
|
||||
|
||||
@ApiModelProperty(value = "来源客户端 (APP、H5、小程序等)")
|
||||
private String platform;
|
||||
|
||||
@ApiModelProperty(value = "所属门店ID")
|
||||
private Integer shopId;
|
||||
|
||||
@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 = "商户编码")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "昵称")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
@ApiModelProperty(value = "用户头像")
|
||||
@TableField(exist = false)
|
||||
private String avatar;
|
||||
|
||||
@ApiModelProperty(value = "真实姓名")
|
||||
@TableField(exist = false)
|
||||
private String realName;
|
||||
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
@TableField(exist = false)
|
||||
private String organizationName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.gxwebsoft.common.system.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
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 2023-04-21 15:59:09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "UserBalanceLog对象", description = "用户余额变动明细表")
|
||||
@TableName("sys_user_balance_log")
|
||||
public class UserBalanceLog implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@TableId(value = "log_id", type = IdType.AUTO)
|
||||
private Integer logId;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "余额变动场景(10用户充值 20用户消费 30管理员操作 40订单退款)")
|
||||
private Integer scene;
|
||||
|
||||
@ApiModelProperty(value = "变动金额")
|
||||
private BigDecimal money;
|
||||
|
||||
@ApiModelProperty(value = "变动后余额")
|
||||
private BigDecimal balance;
|
||||
|
||||
@ApiModelProperty(value = "管理员备注")
|
||||
private String remark;
|
||||
|
||||
@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 = "商户编码")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "昵称")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
@ApiModelProperty(value = "用户头像")
|
||||
@TableField(exist = false)
|
||||
private String avatar;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.common.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.common.system.entity.RechargeOrder;
|
||||
import com.gxwebsoft.common.system.param.RechargeOrderParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员充值订单表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-26 23:18:48
|
||||
*/
|
||||
public interface RechargeOrderMapper extends BaseMapper<RechargeOrder> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<RechargeOrder>
|
||||
*/
|
||||
List<RechargeOrder> selectPageRel(@Param("page") IPage<RechargeOrder> page,
|
||||
@Param("param") RechargeOrderParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<RechargeOrder> selectListRel(@Param("param") RechargeOrderParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.common.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.common.system.entity.UserBalanceLog;
|
||||
import com.gxwebsoft.common.system.param.UserBalanceLogParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户余额变动明细表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-21 15:59:09
|
||||
*/
|
||||
public interface UserBalanceLogMapper extends BaseMapper<UserBalanceLog> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<UserBalanceLog>
|
||||
*/
|
||||
List<UserBalanceLog> selectPageRel(@Param("page") IPage<UserBalanceLog> page,
|
||||
@Param("param") UserBalanceLogParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<UserBalanceLog> selectListRel(@Param("param") UserBalanceLogParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
<?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.common.system.mapper.RechargeOrderMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*,b.phone,b.nickname,b.user_id,b.avatar,b.real_name,c.organization_id,c.organization_name
|
||||
FROM sys_recharge_order a
|
||||
LEFT JOIN sys_user b ON a.user_id = b.user_id
|
||||
LEFT JOIN sys_organization c ON a.organization_id = c.organization_id
|
||||
<where>
|
||||
<if test="param.orderId != null">
|
||||
AND a.order_id = #{param.orderId}
|
||||
</if>
|
||||
<if test="param.orderNo != null">
|
||||
AND a.order_no LIKE CONCAT('%', #{param.orderNo}, '%')
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.rechargeType != null">
|
||||
AND a.recharge_type = #{param.rechargeType}
|
||||
</if>
|
||||
<if test="param.organizationId != null">
|
||||
AND a.organization_id = #{param.organizationId}
|
||||
</if>
|
||||
<if test="param.planId != null">
|
||||
AND a.plan_id = #{param.planId}
|
||||
</if>
|
||||
<if test="param.payPrice != null">
|
||||
AND a.pay_price = #{param.payPrice}
|
||||
</if>
|
||||
<if test="param.giftMoney != null">
|
||||
AND a.gift_money = #{param.giftMoney}
|
||||
</if>
|
||||
<if test="param.actualMoney != null">
|
||||
AND a.actual_money = #{param.actualMoney}
|
||||
</if>
|
||||
<if test="param.balance != null">
|
||||
AND a.balance = #{param.balance}
|
||||
</if>
|
||||
<if test="param.payMethod != null">
|
||||
AND a.pay_method LIKE CONCAT('%', #{param.payMethod}, '%')
|
||||
</if>
|
||||
<if test="param.payStatus != null">
|
||||
AND a.pay_status = #{param.payStatus}
|
||||
</if>
|
||||
<if test="param.payTime != null">
|
||||
AND a.pay_time = #{param.payTime}
|
||||
</if>
|
||||
<if test="param.tradeId != null">
|
||||
AND a.trade_id = #{param.tradeId}
|
||||
</if>
|
||||
<if test="param.platform != null">
|
||||
AND a.platform LIKE CONCAT('%', #{param.platform}, '%')
|
||||
</if>
|
||||
<if test="param.shopId != null">
|
||||
AND a.shop_id = #{param.shopId}
|
||||
</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.merchantCode != null">
|
||||
AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%')
|
||||
</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 (
|
||||
b.nickname LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR b.alias LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR b.phone LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR b.real_name LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.common.system.entity.RechargeOrder">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.common.system.entity.RechargeOrder">
|
||||
<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.common.system.mapper.UserBalanceLogMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*,
|
||||
b.nickname,b.avatar,b.phone
|
||||
FROM sys_user_balance_log a
|
||||
LEFT JOIN sys_user b ON a.user_id = b.user_id
|
||||
<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.scene != null">
|
||||
AND a.scene = #{param.scene}
|
||||
</if>
|
||||
<if test="param.sceneMultiple != null">
|
||||
AND a.scene IN
|
||||
<foreach collection="param.sceneMultiple.split(',')" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="param.money != null">
|
||||
AND a.money = #{param.money}
|
||||
</if>
|
||||
<if test="param.balance != null">
|
||||
AND a.balance = #{param.balance}
|
||||
</if>
|
||||
<if test="param.describe != null">
|
||||
AND a.describe LIKE CONCAT('%', #{param.describe}, '%')
|
||||
</if>
|
||||
<if test="param.remark != null">
|
||||
AND a.remark LIKE CONCAT('%', #{param.remark}, '%')
|
||||
</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.merchantCode != null">
|
||||
AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%')
|
||||
</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.user_id = #{param.keywords}
|
||||
OR b.nickname LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR b.alias LIKE CONCAT('%', #{param.keywords}, '%')
|
||||
OR b.phone = #{param.keywords}
|
||||
)
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.common.system.entity.UserBalanceLog">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.common.system.entity.UserBalanceLog">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.gxwebsoft.common.system.param;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 会员充值订单表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-26 23:18:48
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "RechargeOrderParam对象", description = "会员充值订单表查询参数")
|
||||
public class RechargeOrderParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "订单ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer orderId;
|
||||
|
||||
@ApiModelProperty(value = "订单号")
|
||||
private String orderNo;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "充值方式(10自定义金额 20套餐充值)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer rechargeType;
|
||||
|
||||
@ApiModelProperty(value = "机构id")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer organizationId;
|
||||
|
||||
@ApiModelProperty(value = "充值套餐ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer planId;
|
||||
|
||||
@ApiModelProperty(value = "用户支付金额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal payPrice;
|
||||
|
||||
@ApiModelProperty(value = "赠送金额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal giftMoney;
|
||||
|
||||
@ApiModelProperty(value = "实际到账金额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal actualMoney;
|
||||
|
||||
@ApiModelProperty(value = "用户可用余额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal balance;
|
||||
|
||||
@ApiModelProperty(value = "支付方式(微信/支付宝)")
|
||||
private String payMethod;
|
||||
|
||||
@ApiModelProperty(value = "支付状态(10待支付 20已支付)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer payStatus;
|
||||
|
||||
@ApiModelProperty(value = "付款时间")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer payTime;
|
||||
|
||||
@ApiModelProperty(value = "第三方交易记录ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer tradeId;
|
||||
|
||||
@ApiModelProperty(value = "来源客户端 (APP、H5、小程序等)")
|
||||
private String platform;
|
||||
|
||||
@ApiModelProperty(value = "所属门店ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer shopId;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
@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 = "商户编码")
|
||||
private String merchantCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.gxwebsoft.common.system.param;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||
import com.gxwebsoft.common.core.web.BaseParam;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 用户余额变动明细表查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-21 15:59:09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ApiModel(value = "UserBalanceLogParam对象", description = "用户余额变动明细表查询参数")
|
||||
public class UserBalanceLogParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer logId;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "余额变动场景(10用户充值 20用户消费 30管理员操作 40订单退款)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer scene;
|
||||
|
||||
@ApiModelProperty(value = "变动金额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal money;
|
||||
|
||||
@ApiModelProperty(value = "变动后余额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal balance;
|
||||
|
||||
@ApiModelProperty(value = "描述/说明")
|
||||
private String describe;
|
||||
|
||||
@ApiModelProperty(value = "管理员备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
@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 = "商户编码")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "昵称")
|
||||
private String nickname;
|
||||
|
||||
@ApiModelProperty(value = "余额变动场景筛选")
|
||||
private String sceneMultiple;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.common.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.RechargeOrder;
|
||||
import com.gxwebsoft.common.system.param.RechargeOrderParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员充值订单表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-26 23:18:48
|
||||
*/
|
||||
public interface RechargeOrderService extends IService<RechargeOrder> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<RechargeOrder>
|
||||
*/
|
||||
PageResult<RechargeOrder> pageRel(RechargeOrderParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<RechargeOrder>
|
||||
*/
|
||||
List<RechargeOrder> listRel(RechargeOrderParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param orderId 订单ID
|
||||
* @return RechargeOrder
|
||||
*/
|
||||
RechargeOrder getByIdRel(Integer orderId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.common.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.UserBalanceLog;
|
||||
import com.gxwebsoft.common.system.param.UserBalanceLogParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户余额变动明细表Service
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-21 15:59:09
|
||||
*/
|
||||
public interface UserBalanceLogService extends IService<UserBalanceLog> {
|
||||
|
||||
/**
|
||||
* 分页关联查询
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return PageResult<UserBalanceLog>
|
||||
*/
|
||||
PageResult<UserBalanceLog> pageRel(UserBalanceLogParam param);
|
||||
|
||||
/**
|
||||
* 关联查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<UserBalanceLog>
|
||||
*/
|
||||
List<UserBalanceLog> listRel(UserBalanceLogParam param);
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
*
|
||||
* @param logId 主键ID
|
||||
* @return UserBalanceLog
|
||||
*/
|
||||
UserBalanceLog getByIdRel(Integer logId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.common.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.RechargeOrder;
|
||||
import com.gxwebsoft.common.system.mapper.RechargeOrderMapper;
|
||||
import com.gxwebsoft.common.system.param.RechargeOrderParam;
|
||||
import com.gxwebsoft.common.system.service.RechargeOrderService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员充值订单表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-07-26 23:18:48
|
||||
*/
|
||||
@Service
|
||||
public class RechargeOrderServiceImpl extends ServiceImpl<RechargeOrderMapper, RechargeOrder> implements RechargeOrderService {
|
||||
|
||||
@Override
|
||||
public PageResult<RechargeOrder> pageRel(RechargeOrderParam param) {
|
||||
PageParam<RechargeOrder, RechargeOrderParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
List<RechargeOrder> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RechargeOrder> listRel(RechargeOrderParam param) {
|
||||
List<RechargeOrder> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<RechargeOrder, RechargeOrderParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RechargeOrder getByIdRel(Integer orderId) {
|
||||
RechargeOrderParam param = new RechargeOrderParam();
|
||||
param.setOrderId(orderId);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.common.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.UserBalanceLog;
|
||||
import com.gxwebsoft.common.system.mapper.UserBalanceLogMapper;
|
||||
import com.gxwebsoft.common.system.param.UserBalanceLogParam;
|
||||
import com.gxwebsoft.common.system.service.UserBalanceLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户余额变动明细表Service实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-21 15:59:09
|
||||
*/
|
||||
@Service
|
||||
public class UserBalanceLogServiceImpl extends ServiceImpl<UserBalanceLogMapper, UserBalanceLog> implements UserBalanceLogService {
|
||||
|
||||
@Override
|
||||
public PageResult<UserBalanceLog> pageRel(UserBalanceLogParam param) {
|
||||
PageParam<UserBalanceLog, UserBalanceLogParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
List<UserBalanceLog> list = baseMapper.selectPageRel(page, param);
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserBalanceLog> listRel(UserBalanceLogParam param) {
|
||||
List<UserBalanceLog> list = baseMapper.selectListRel(param);
|
||||
// 排序
|
||||
PageParam<UserBalanceLog, UserBalanceLogParam> page = new PageParam<>();
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return page.sortRecords(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserBalanceLog getByIdRel(Integer logId) {
|
||||
UserBalanceLogParam param = new UserBalanceLogParam();
|
||||
param.setLogId(logId);
|
||||
return param.getOne(baseMapper.selectListRel(param));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user