增加退款日志记录接口
This commit is contained in:
parent
af927ba3ce
commit
54184be9c5
|
|
@ -10,6 +10,7 @@ import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
|
@ -24,11 +25,18 @@ public class FinanceRechargerController {
|
||||||
IFinanceRechargerService iFinanceRechargerService;
|
IFinanceRechargerService iFinanceRechargerService;
|
||||||
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@ApiOperation("记录列表")
|
@ApiOperation("充值记录")
|
||||||
public AjaxResult<Object> list(@Validated PageValidate pageValidate,
|
public AjaxResult<PageResult<FinanceRechargeListVo>> list(@Validated PageValidate pageValidate,
|
||||||
@Validated FinanceRechargeSearchValidate searchValidate) {
|
@Validated FinanceRechargeSearchValidate searchValidate) {
|
||||||
PageResult<FinanceRechargeListVo> list = iFinanceRechargerService.list(pageValidate, searchValidate);
|
PageResult<FinanceRechargeListVo> list = iFinanceRechargerService.list(pageValidate, searchValidate);
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/refund")
|
||||||
|
@ApiOperation("发起退款")
|
||||||
|
public AjaxResult<Object> refund() {
|
||||||
|
iFinanceRechargerService.refund();
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,17 +3,22 @@ package com.mdd.admin.controller.finance;
|
||||||
import com.mdd.admin.service.IFinanceRefundService;
|
import com.mdd.admin.service.IFinanceRefundService;
|
||||||
import com.mdd.admin.validate.commons.PageValidate;
|
import com.mdd.admin.validate.commons.PageValidate;
|
||||||
import com.mdd.admin.validate.finance.FinanceRefundSearchValidate;
|
import com.mdd.admin.validate.finance.FinanceRefundSearchValidate;
|
||||||
|
import com.mdd.admin.vo.finance.FinanceRechargeListVo;
|
||||||
import com.mdd.admin.vo.finance.FinanceRefundListVo;
|
import com.mdd.admin.vo.finance.FinanceRefundListVo;
|
||||||
|
import com.mdd.admin.vo.finance.FinanceRefundLogVo;
|
||||||
import com.mdd.common.core.AjaxResult;
|
import com.mdd.common.core.AjaxResult;
|
||||||
import com.mdd.common.core.PageResult;
|
import com.mdd.common.core.PageResult;
|
||||||
|
import com.mdd.common.validator.annotation.IDMust;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("api/finance/refund")
|
@RequestMapping("api/finance/refund")
|
||||||
|
|
@ -23,12 +28,25 @@ public class FinanceRefundController {
|
||||||
@Resource
|
@Resource
|
||||||
IFinanceRefundService iFinanceRefundService;
|
IFinanceRefundService iFinanceRefundService;
|
||||||
|
|
||||||
|
@GetMapping("/stat")
|
||||||
|
@ApiOperation("退还统计")
|
||||||
|
public AjaxResult<Object> stat() {
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@ApiOperation("记录列表")
|
@ApiOperation("退款记录")
|
||||||
public AjaxResult<Object> list(@Validated PageValidate pageValidate,
|
public AjaxResult<Object> list(@Validated PageValidate pageValidate,
|
||||||
@Validated FinanceRefundSearchValidate searchValidate) {
|
@Validated FinanceRefundSearchValidate searchValidate) {
|
||||||
PageResult<FinanceRefundListVo> list = iFinanceRefundService.list(pageValidate, searchValidate);
|
PageResult<FinanceRefundListVo> list = iFinanceRefundService.list(pageValidate, searchValidate);
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/log")
|
||||||
|
@ApiOperation("退款日志")
|
||||||
|
public AjaxResult<Object> log(@Validated @IDMust() @RequestParam("id") Integer id) {
|
||||||
|
List<FinanceRefundLogVo> list = iFinanceRefundService.log(id);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import com.mdd.common.core.PageResult;
|
||||||
public interface IFinanceRechargerService {
|
public interface IFinanceRechargerService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值记录列表
|
* 充值记录
|
||||||
*
|
*
|
||||||
* @author fzr
|
* @author fzr
|
||||||
* @param pageValidate 分页参数
|
* @param pageValidate 分页参数
|
||||||
|
|
@ -20,4 +20,6 @@ public interface IFinanceRechargerService {
|
||||||
*/
|
*/
|
||||||
PageResult<FinanceRechargeListVo> list(PageValidate pageValidate, FinanceRechargeSearchValidate searchValidate);
|
PageResult<FinanceRechargeListVo> list(PageValidate pageValidate, FinanceRechargeSearchValidate searchValidate);
|
||||||
|
|
||||||
|
void refund();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,11 @@ package com.mdd.admin.service;
|
||||||
import com.mdd.admin.validate.commons.PageValidate;
|
import com.mdd.admin.validate.commons.PageValidate;
|
||||||
import com.mdd.admin.validate.finance.FinanceRefundSearchValidate;
|
import com.mdd.admin.validate.finance.FinanceRefundSearchValidate;
|
||||||
import com.mdd.admin.vo.finance.FinanceRefundListVo;
|
import com.mdd.admin.vo.finance.FinanceRefundListVo;
|
||||||
|
import com.mdd.admin.vo.finance.FinanceRefundLogVo;
|
||||||
import com.mdd.common.core.PageResult;
|
import com.mdd.common.core.PageResult;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退款记录服务接口类
|
* 退款记录服务接口类
|
||||||
*/
|
*/
|
||||||
|
|
@ -20,4 +23,6 @@ public interface IFinanceRefundService {
|
||||||
*/
|
*/
|
||||||
PageResult<FinanceRefundListVo> list(PageValidate pageValidate, FinanceRefundSearchValidate searchValidate);
|
PageResult<FinanceRefundListVo> list(PageValidate pageValidate, FinanceRefundSearchValidate searchValidate);
|
||||||
|
|
||||||
|
List<FinanceRefundLogVo> log(Integer recordId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ public class FinanceRechargerServiceImpl implements IFinanceRechargerService {
|
||||||
RechargeOrderMapper rechargeOrderMapper;
|
RechargeOrderMapper rechargeOrderMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 充值记录列表
|
* 充值记录
|
||||||
*
|
*
|
||||||
* @author fzr
|
* @author fzr
|
||||||
* @param pageValidate 分页参数
|
* @param pageValidate 分页参数
|
||||||
|
|
@ -77,4 +77,12 @@ public class FinanceRechargerServiceImpl implements IFinanceRechargerService {
|
||||||
return PageResult.iPageHandle(iPage);
|
return PageResult.iPageHandle(iPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起退款
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void refund() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,43 @@
|
||||||
package com.mdd.admin.service.impl;
|
package com.mdd.admin.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.yulichang.query.MPJQueryWrapper;
|
||||||
import com.mdd.admin.service.IFinanceRefundService;
|
import com.mdd.admin.service.IFinanceRefundService;
|
||||||
import com.mdd.admin.validate.commons.PageValidate;
|
import com.mdd.admin.validate.commons.PageValidate;
|
||||||
import com.mdd.admin.validate.finance.FinanceRefundSearchValidate;
|
import com.mdd.admin.validate.finance.FinanceRefundSearchValidate;
|
||||||
|
import com.mdd.admin.vo.finance.FinanceRechargeListVo;
|
||||||
import com.mdd.admin.vo.finance.FinanceRefundListVo;
|
import com.mdd.admin.vo.finance.FinanceRefundListVo;
|
||||||
|
import com.mdd.admin.vo.finance.FinanceRefundLogVo;
|
||||||
|
import com.mdd.common.config.GlobalConfig;
|
||||||
import com.mdd.common.core.PageResult;
|
import com.mdd.common.core.PageResult;
|
||||||
|
import com.mdd.common.entity.RechargeOrder;
|
||||||
|
import com.mdd.common.entity.RefundLog;
|
||||||
|
import com.mdd.common.entity.RefundRecord;
|
||||||
|
import com.mdd.common.mapper.RefundLogMapper;
|
||||||
|
import com.mdd.common.mapper.RefundRecordMapper;
|
||||||
|
import com.mdd.common.util.StringUtils;
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退款记录服务实现类
|
* 退款记录服务实现类
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class FinanceRefundServiceImpl implements IFinanceRefundService {
|
public class FinanceRefundServiceImpl implements IFinanceRefundService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
RefundRecordMapper refundRecordMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
RefundLogMapper refundLogMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退款记录列表
|
* 退款记录列表
|
||||||
*
|
*
|
||||||
|
|
@ -23,7 +48,56 @@ public class FinanceRefundServiceImpl implements IFinanceRefundService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public PageResult<FinanceRefundListVo> list(PageValidate pageValidate, FinanceRefundSearchValidate searchValidate) {
|
public PageResult<FinanceRefundListVo> list(PageValidate pageValidate, FinanceRefundSearchValidate searchValidate) {
|
||||||
return null;
|
Integer pageNo = pageValidate.getPageNo();
|
||||||
|
Integer pageSize = pageValidate.getPageSize();
|
||||||
|
|
||||||
|
MPJQueryWrapper<RefundRecord> mpjQueryWrapper = new MPJQueryWrapper<>();
|
||||||
|
mpjQueryWrapper.selectAll(RefundRecord.class)
|
||||||
|
.select("U.id as user_id,U.nickname,U.avatar")
|
||||||
|
.leftJoin("?_user U ON U.id=t.user_id".replace("?_", GlobalConfig.tablePrefix))
|
||||||
|
.orderByDesc("id");
|
||||||
|
|
||||||
|
refundRecordMapper.setSearch(mpjQueryWrapper, searchValidate, new String[]{
|
||||||
|
"like:sn@t.sn:str",
|
||||||
|
"like:orderSn@t.t.order_sn:str",
|
||||||
|
"=:refundType@t.refund_type:int",
|
||||||
|
"datetime:startTime-endTime@create_time:long",
|
||||||
|
});
|
||||||
|
|
||||||
|
if (StringUtils.isNotEmpty(searchValidate.getKeyword())) {
|
||||||
|
String keyword = searchValidate.getKeyword();
|
||||||
|
mpjQueryWrapper.nested(wq->wq
|
||||||
|
.like("U.nickname", keyword).or()
|
||||||
|
.like("U.sn", keyword).or()
|
||||||
|
.like("U.mobile", keyword));
|
||||||
|
}
|
||||||
|
|
||||||
|
IPage<FinanceRefundListVo> iPage = refundRecordMapper.selectJoinPage(
|
||||||
|
new Page<>(pageNo, pageSize),
|
||||||
|
FinanceRefundListVo.class,
|
||||||
|
mpjQueryWrapper);
|
||||||
|
|
||||||
|
Map<String, Object> extend = new LinkedHashMap<>();
|
||||||
|
extend.put("total", refundRecordMapper.selectCount(null));
|
||||||
|
extend.put("ing", refundRecordMapper.selectCount(new QueryWrapper<RefundRecord>().eq("refund_status", 0)));
|
||||||
|
extend.put("success", refundRecordMapper.selectCount(new QueryWrapper<RefundRecord>().eq("refund_status", 1)));
|
||||||
|
extend.put("error", refundRecordMapper.selectCount(new QueryWrapper<RefundRecord>().eq("refund_status", 2)));
|
||||||
|
|
||||||
|
return PageResult.iPageHandle(iPage.getTotal(), iPage.getCurrent(), iPage.getSize(), iPage.getRecords(), extend);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FinanceRefundLogVo> log(Integer recordId) {
|
||||||
|
MPJQueryWrapper<RefundLog> mpjQueryWrapper = new MPJQueryWrapper<>();
|
||||||
|
mpjQueryWrapper.selectAll(RefundLog.class)
|
||||||
|
.select("sa.nickname as handler")
|
||||||
|
.eq("t.record_id", recordId)
|
||||||
|
.innerJoin("?_system_auth_admin sa ON sa.id=t.handle_id".replace("?_", GlobalConfig.tablePrefix))
|
||||||
|
.orderByDesc("t.id");
|
||||||
|
|
||||||
|
List<FinanceRefundLogVo> list = refundLogMapper.selectJoinList(FinanceRefundLogVo.class, mpjQueryWrapper);
|
||||||
|
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.mdd.admin.validate.finance;
|
package com.mdd.admin.validate.finance;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
@ -11,4 +12,22 @@ public class FinanceRefundSearchValidate implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户信息")
|
||||||
|
private String keyword;
|
||||||
|
|
||||||
|
@ApiModelProperty("退款单号")
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
@ApiModelProperty("来源单号")
|
||||||
|
private String orderSn;
|
||||||
|
|
||||||
|
@ApiModelProperty("退款类型: 1=后台退款")
|
||||||
|
private Integer refundType;
|
||||||
|
|
||||||
|
@ApiModelProperty("开始时间")
|
||||||
|
private Long startTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("结束时间")
|
||||||
|
private Long endTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
package com.mdd.admin.vo.finance;
|
package com.mdd.admin.vo.finance;
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ApiModel("退款记录列表Vo")
|
@ApiModel("退款记录列表Vo")
|
||||||
|
|
@ -11,4 +13,34 @@ public class FinanceRefundListVo implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("记录ID")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty("退款编号")
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户头像")
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户昵称")
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@ApiModelProperty("来源单号SN")
|
||||||
|
private String orderSn;
|
||||||
|
|
||||||
|
@ApiModelProperty("总应付款金额")
|
||||||
|
private BigDecimal orderAmount;
|
||||||
|
|
||||||
|
@ApiModelProperty("本次退款金额")
|
||||||
|
private BigDecimal refundAmount;
|
||||||
|
|
||||||
|
@ApiModelProperty("退款类型: 1=后台退款")
|
||||||
|
private String refundType;
|
||||||
|
|
||||||
|
@ApiModelProperty("款状态: 0=退款中, 1=退款成功, 2=退款失败")
|
||||||
|
private Integer refundStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("记录时间")
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.mdd.admin.vo.finance;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel("退款记录日志Vo")
|
||||||
|
public class FinanceRefundLogVo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("ID")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty("流水号")
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
@ApiModelProperty("订单金额")
|
||||||
|
private BigDecimal orderAmount;
|
||||||
|
|
||||||
|
@ApiModelProperty("退款金额")
|
||||||
|
private BigDecimal refundAmount;
|
||||||
|
|
||||||
|
@ApiModelProperty("退款状态: [0=退款中, 1=退款成功, 2=退款失败]")
|
||||||
|
private Integer refundStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("退款信息")
|
||||||
|
private String refundMsg;
|
||||||
|
|
||||||
|
@ApiModelProperty("操作人")
|
||||||
|
private String handler;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -5,21 +5,32 @@ import com.github.pagehelper.PageInfo;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class PageResult<T> {
|
public class PageResult<T> {
|
||||||
|
|
||||||
private Long count; //总记录数
|
/** 总记录数 **/
|
||||||
private Integer pageNo; //当前页码
|
private Long count;
|
||||||
private Integer pageSize; //每页条数
|
|
||||||
private List<T> lists; //数据列表
|
/** 当前页码 **/
|
||||||
|
private Integer pageNo;
|
||||||
|
|
||||||
|
/** 每页条数 **/
|
||||||
|
private Integer pageSize;
|
||||||
|
|
||||||
|
/** 扩展字段 **/
|
||||||
|
private Map<String, Object> extend;
|
||||||
|
|
||||||
|
/** 数据列表 **/
|
||||||
|
private List<T> lists;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PageHelper分页
|
* PageHelper分页
|
||||||
*
|
*
|
||||||
* @author fzr
|
* @author fzr
|
||||||
* @param list 分页数据集
|
* @param list (分页数据集)
|
||||||
* @param <T> 实体类型
|
* @param <T> (泛型)
|
||||||
* @return PageList
|
* @return PageList
|
||||||
*/
|
*/
|
||||||
public static <T> PageResult<T> pageHelper(List<T> list) {
|
public static <T> PageResult<T> pageHelper(List<T> list) {
|
||||||
|
|
@ -36,8 +47,8 @@ public class PageResult<T> {
|
||||||
* PageHelper分页(数据额外处理)
|
* PageHelper分页(数据额外处理)
|
||||||
*
|
*
|
||||||
* @author fzr
|
* @author fzr
|
||||||
* @param list 分页数据集
|
* @param list (分页数据集)
|
||||||
* @param <T> 实体类型
|
* @param <T> (泛型)
|
||||||
* @return PageList
|
* @return PageList
|
||||||
*/
|
*/
|
||||||
public static <T> PageResult<T> pageHelper(List<T> list, List<T> data) {
|
public static <T> PageResult<T> pageHelper(List<T> list, List<T> data) {
|
||||||
|
|
@ -54,7 +65,8 @@ public class PageResult<T> {
|
||||||
* MyBatisPlus分页
|
* MyBatisPlus分页
|
||||||
*
|
*
|
||||||
* @author fzr
|
* @author fzr
|
||||||
* @param <T> 实体类型
|
* @param iPage (分页)
|
||||||
|
* @param <T> (泛型)
|
||||||
* @return PageList
|
* @return PageList
|
||||||
*/
|
*/
|
||||||
public static <T> PageResult<T> iPageHandle(IPage<T> iPage) {
|
public static <T> PageResult<T> iPageHandle(IPage<T> iPage) {
|
||||||
|
|
@ -70,7 +82,11 @@ public class PageResult<T> {
|
||||||
* MyBatisPlus分页(数据额外处理)
|
* MyBatisPlus分页(数据额外处理)
|
||||||
*
|
*
|
||||||
* @author fzr
|
* @author fzr
|
||||||
* @param <T> 实体类型
|
* @param total (总条数)
|
||||||
|
* @param pageNo (当前页码)
|
||||||
|
* @param size (每页条数)
|
||||||
|
* @param list (列表数据)
|
||||||
|
* @param <T> (泛型)
|
||||||
* @return PageList
|
* @return PageList
|
||||||
*/
|
*/
|
||||||
public static <T> PageResult<T> iPageHandle(Long total, Long pageNo, Long size, List<T> list) {
|
public static <T> PageResult<T> iPageHandle(Long total, Long pageNo, Long size, List<T> list) {
|
||||||
|
|
@ -82,4 +98,25 @@ public class PageResult<T> {
|
||||||
return pageResult;
|
return pageResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MyBatisPlus分页(数据额外处理)
|
||||||
|
*
|
||||||
|
* @param total (总条数)
|
||||||
|
* @param pageNo (当前页码)
|
||||||
|
* @param size (每页条数)
|
||||||
|
* @param list (列表数据)
|
||||||
|
* @param extend (扩展字段)
|
||||||
|
* @param <T> (泛型)
|
||||||
|
* @return PageResult<T>
|
||||||
|
*/
|
||||||
|
public static <T> PageResult<T> iPageHandle(Long total, Long pageNo, Long size, List<T> list, Map<String,Object> extend) {
|
||||||
|
PageResult<T> pageResult = new PageResult<>();
|
||||||
|
pageResult.setCount(total);
|
||||||
|
pageResult.setPageNo(Math.toIntExact(pageNo));
|
||||||
|
pageResult.setPageSize(Math.toIntExact(size));
|
||||||
|
pageResult.setLists(list);
|
||||||
|
pageResult.setExtend(extend);
|
||||||
|
return pageResult;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.mdd.common.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel("退款日志实体")
|
||||||
|
public class RefundLog implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value="id", type= IdType.AUTO)
|
||||||
|
@ApiModelProperty("ID")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty("编号")
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
@ApiModelProperty("退款记录ID")
|
||||||
|
private Integer recordId;
|
||||||
|
|
||||||
|
@ApiModelProperty("关联用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty("处理管理ID")
|
||||||
|
private Integer handleId;
|
||||||
|
|
||||||
|
@ApiModelProperty("总应付的金额")
|
||||||
|
private BigDecimal orderAmount;
|
||||||
|
|
||||||
|
@ApiModelProperty("本次退款金额")
|
||||||
|
private BigDecimal refundAmount;
|
||||||
|
|
||||||
|
@ApiModelProperty("退款状态: [0=退款中, 1=退款成功, 2=退款失败]")
|
||||||
|
private Integer refundStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("退款信息")
|
||||||
|
private String refundMsg;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private Long createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新时间")
|
||||||
|
private Long updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.mdd.common.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel("退款记录实体")
|
||||||
|
public class RefundRecord implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value="id", type= IdType.AUTO)
|
||||||
|
@ApiModelProperty("ID")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "退款编号")
|
||||||
|
private String sn;
|
||||||
|
|
||||||
|
@ApiModelProperty("关联用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty("来源订单ID")
|
||||||
|
private Integer orderId;
|
||||||
|
|
||||||
|
@ApiModelProperty("来源单号SN")
|
||||||
|
private String orderSn;
|
||||||
|
|
||||||
|
@ApiModelProperty("订单类型: [order=商品订单, recharge=充值订单]")
|
||||||
|
private String orderType;
|
||||||
|
|
||||||
|
@ApiModelProperty("总应付款金额")
|
||||||
|
private BigDecimal orderAmount;
|
||||||
|
|
||||||
|
@ApiModelProperty("本次退款金额")
|
||||||
|
private BigDecimal refundAmount;
|
||||||
|
|
||||||
|
@ApiModelProperty("平台交易流水号")
|
||||||
|
private String transactionId;
|
||||||
|
|
||||||
|
@ApiModelProperty("退款方式: 1=线上退款, 2=线下退款")
|
||||||
|
private Integer refundWay;
|
||||||
|
|
||||||
|
@ApiModelProperty("退款类型: 1=后台退款")
|
||||||
|
private Integer refundType;
|
||||||
|
|
||||||
|
@ApiModelProperty("退款状态: 0=退款中, 1=退款成功, 2=退款失败")
|
||||||
|
private Integer refundStatus;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private Long createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新时间")
|
||||||
|
private Long updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.mdd.common.mapper;
|
||||||
|
|
||||||
|
import com.mdd.common.core.basics.IBaseMapper;
|
||||||
|
import com.mdd.common.entity.RefundLog;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款日志Mapper
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface RefundLogMapper extends IBaseMapper<RefundLog> {
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.mdd.common.mapper;
|
||||||
|
|
||||||
|
import com.mdd.common.core.basics.IBaseMapper;
|
||||||
|
import com.mdd.common.entity.RefundRecord;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退款记录Mapper
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface RefundRecordMapper extends IBaseMapper<RefundRecord> {
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue