充值记录
This commit is contained in:
parent
696ffc49ae
commit
caeee47520
|
|
@ -1,10 +1,13 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.market.dto.MkShopRechargeDTO;
|
||||
import com.czg.market.entity.MkShopRechargeFlow;
|
||||
import com.czg.market.service.MkRechargeFlowService;
|
||||
import com.czg.market.service.MkShopRechargeService;
|
||||
import com.czg.market.vo.MkShopRechargeVO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -19,6 +22,8 @@ import org.springframework.web.bind.annotation.*;
|
|||
public class ShopRechargeController {
|
||||
@Resource
|
||||
private MkShopRechargeService shopRechargeService;
|
||||
@Resource
|
||||
private MkRechargeFlowService rechargeFlowService;
|
||||
|
||||
/**
|
||||
* 配置信息获取
|
||||
|
|
@ -46,5 +51,16 @@ public class ShopRechargeController {
|
|||
return CzgResult.success(shopRechargeService.edit(StpKit.USER.getShopId(), shopRechargeDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取充值记录列表
|
||||
* @param startTime 开始时间 闭区间
|
||||
* @param endTime 结束时间 闭区间
|
||||
* @param type 类型
|
||||
*/
|
||||
@GetMapping("/record")
|
||||
public Page<MkShopRechargeFlow> getRecord(@RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime, @RequestParam(required = false) String type) {
|
||||
return rechargeFlowService.pageInfo(StpKit.USER.getShopId(), startTime, endTime, type);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,88 @@
|
|||
|
||||
package com.czg.market.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.io.Serial;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 充值流水表 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-09-16
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MkRechargeFlowDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 门店id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 主店id
|
||||
*/
|
||||
private Long masterShopId;
|
||||
|
||||
/**
|
||||
* 用户手机号
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 充值金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 退款金额
|
||||
*/
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 现金充值 recharge_cash
|
||||
微信充值 recharge_wx
|
||||
支付宝 recharge_alipay
|
||||
充值奖励recharge_reward_amount
|
||||
充值退款 recharge_refund
|
||||
订单消费 order_cost
|
||||
订单退款 order_refund
|
||||
管理员充值 recharge_admin
|
||||
管理员消费 admin_cost
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
package com.czg.market.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 充值流水表 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-09-16
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("mk_shop_recharge_flow")
|
||||
public class MkShopRechargeFlow implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 门店id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 主店id
|
||||
*/
|
||||
private Long masterShopId;
|
||||
|
||||
/**
|
||||
* 用户手机号
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 充值金额
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 退款金额
|
||||
*/
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 现金充值 recharge_cash
|
||||
微信充值 recharge_wx
|
||||
支付宝 recharge_alipay
|
||||
充值奖励recharge_reward_amount
|
||||
充值退款 recharge_refund
|
||||
订单消费 order_cost
|
||||
订单退款 order_refund
|
||||
管理员充值 recharge_admin
|
||||
管理员消费 admin_cost
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.czg.market.service;
|
||||
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.market.entity.MkShopRechargeFlow;
|
||||
|
||||
/**
|
||||
* 充值流水表 服务层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-09-16
|
||||
*/
|
||||
public interface MkRechargeFlowService extends IService<MkShopRechargeFlow> {
|
||||
|
||||
Page<MkShopRechargeFlow> pageInfo(Long shopId, String startTime, String ednTime, String type);
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.czg.service.market.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.market.entity.MkShopRechargeFlow;
|
||||
|
||||
/**
|
||||
* 充值流水表 映射层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-09-16
|
||||
*/
|
||||
public interface MkRechargeFlowMapper extends BaseMapper<MkShopRechargeFlow> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.czg.service.market.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.utils.PageUtil;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.market.entity.MkShopRechargeFlow;
|
||||
import com.czg.market.service.MkRechargeFlowService;
|
||||
import com.czg.service.market.mapper.MkRechargeFlowMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 充值流水表 服务层实现。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-09-16
|
||||
*/
|
||||
@Service
|
||||
public class MkRechargeFlowServiceImpl extends ServiceImpl<MkRechargeFlowMapper, MkShopRechargeFlow> implements MkRechargeFlowService{
|
||||
@Override
|
||||
public Page<MkShopRechargeFlow> pageInfo(Long shopId, String startTime, String ednTime, String type) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper().eq(MkShopRechargeFlow::getShopId, shopId);
|
||||
if (StrUtil.isNotBlank(startTime)) {
|
||||
queryWrapper.ge(MkShopRechargeFlow::getCreateTime, startTime);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(ednTime)) {
|
||||
queryWrapper.le(MkShopRechargeFlow::getCreateTime, ednTime);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(type)) {
|
||||
queryWrapper.eq(MkShopRechargeFlow::getType, type);
|
||||
}
|
||||
|
||||
return page(PageUtil.buildPage(), queryWrapper.orderBy(MkShopRechargeFlow::getCreateTime, false));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?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.czg.service.market.mapper.MkRechargeFlowMapper">
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue