|
@@ -7,12 +7,8 @@ import cn.hutool.poi.excel.ExcelUtil;
|
|
import cn.hutool.poi.excel.ExcelWriter;
|
|
import cn.hutool.poi.excel.ExcelWriter;
|
|
import com.txz.cif.core.Result;
|
|
import com.txz.cif.core.Result;
|
|
import com.txz.cif.core.ResultGenerator;
|
|
import com.txz.cif.core.ResultGenerator;
|
|
-import com.txz.cif.model.Account;
|
|
|
|
-import com.txz.cif.model.BizLog;
|
|
|
|
-import com.txz.cif.model.RechargeRecord;
|
|
|
|
-import com.txz.cif.service.AccountService;
|
|
|
|
-import com.txz.cif.service.BizLogService;
|
|
|
|
-import com.txz.cif.service.RechargeRecordService;
|
|
|
|
|
|
+import com.txz.cif.model.*;
|
|
|
|
+import com.txz.cif.service.*;
|
|
|
|
|
|
import com.txz.cif.core.ResultCode;
|
|
import com.txz.cif.core.ResultCode;
|
|
|
|
|
|
@@ -34,6 +30,7 @@ import javax.servlet.ServletOutputStream;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.util.LinkedList;
|
|
import java.util.LinkedList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Created by CodeGenerator on 2025/07/15.
|
|
* Created by CodeGenerator on 2025/07/15.
|
|
@@ -53,7 +50,14 @@ public class RechargeRecordController {
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
private AccountService accountService;
|
|
private AccountService accountService;
|
|
- @GetMapping("/detail")
|
|
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private PaymentChannelService paymentChannelService;
|
|
|
|
+ @Resource
|
|
|
|
+ private PaymentMethodService paymentMethodService;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @GetMapping("/detail")
|
|
@ApiOperation(value = "rechargeRecord获取详情",httpMethod = "GET")
|
|
@ApiOperation(value = "rechargeRecord获取详情",httpMethod = "GET")
|
|
public Result<RechargeRecordBO> detail(@RequestParam Long id) {
|
|
public Result<RechargeRecordBO> detail(@RequestParam Long id) {
|
|
if(id == null){
|
|
if(id == null){
|
|
@@ -79,6 +83,18 @@ public class RechargeRecordController {
|
|
if (earnings != null){
|
|
if (earnings != null){
|
|
bo.setEarningsBalance(earnings.getBalance());
|
|
bo.setEarningsBalance(earnings.getBalance());
|
|
}
|
|
}
|
|
|
|
+ if (rechargeRecord.getMethodId() != null){
|
|
|
|
+ PaymentMethod method = paymentMethodService.findById(rechargeRecord.getMethodId());
|
|
|
|
+ if (method != null){
|
|
|
|
+ bo.setMethodName(method.getMethodName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (rechargeRecord.getChannelId() != null){
|
|
|
|
+ PaymentChannel channel = paymentChannelService.findById(rechargeRecord.getChannelId());
|
|
|
|
+ if (channel != null){
|
|
|
|
+ bo.setChannelName(channel.getChannelName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return ResultGenerator.genSuccessResult(bo);
|
|
return ResultGenerator.genSuccessResult(bo);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("查询对象操作异常e:{}",e);
|
|
log.error("查询对象操作异常e:{}",e);
|
|
@@ -89,7 +105,7 @@ public class RechargeRecordController {
|
|
|
|
|
|
@PostMapping("/list")
|
|
@PostMapping("/list")
|
|
@ApiOperation(value = "rechargeRecord获取列表",httpMethod = "POST")
|
|
@ApiOperation(value = "rechargeRecord获取列表",httpMethod = "POST")
|
|
- public Result<List<RechargeRecord>> list(@RequestBody RecordParam param) {
|
|
|
|
|
|
+ public Result<List<RechargeRecordBO>> list(@RequestBody RecordParam param) {
|
|
|
|
|
|
PageHelper.startPage(param.getPage(), param.getSize());
|
|
PageHelper.startPage(param.getPage(), param.getSize());
|
|
|
|
|
|
@@ -126,6 +142,22 @@ public class RechargeRecordController {
|
|
condition.setOrderByClause("create_time desc");
|
|
condition.setOrderByClause("create_time desc");
|
|
List<RechargeRecord> list = rechargeRecordService.findByCondition(condition);
|
|
List<RechargeRecord> list = rechargeRecordService.findByCondition(condition);
|
|
pageInfo = new PageInfo(list);
|
|
pageInfo = new PageInfo(list);
|
|
|
|
+ pageInfo.setList(list.stream().map(e-> {
|
|
|
|
+ RechargeRecordBO bo = BeanUtil.toBean(e,RechargeRecordBO.class);
|
|
|
|
+ if (e.getMethodId() != null){
|
|
|
|
+ PaymentMethod method = paymentMethodService.findById(e.getMethodId());
|
|
|
|
+ if (method != null){
|
|
|
|
+ bo.setMethodName(method.getMethodName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (e.getChannelId() != null){
|
|
|
|
+ PaymentChannel channel = paymentChannelService.findById(e.getChannelId());
|
|
|
|
+ if (channel != null){
|
|
|
|
+ bo.setChannelName(channel.getChannelName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return bo;
|
|
|
|
+ }).collect(Collectors.toList()));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("查询对象操作异常e:{}",e);
|
|
log.error("查询对象操作异常e:{}",e);
|
|
return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
|
|
return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
|