|
@@ -6,23 +6,20 @@ import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.poi.excel.ExcelUtil;
|
|
import cn.hutool.poi.excel.ExcelUtil;
|
|
import cn.hutool.poi.excel.ExcelWriter;
|
|
import cn.hutool.poi.excel.ExcelWriter;
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
import com.txz.cif.core.Result;
|
|
import com.txz.cif.core.Result;
|
|
|
|
+import com.txz.cif.core.ResultCode;
|
|
import com.txz.cif.core.ResultGenerator;
|
|
import com.txz.cif.core.ResultGenerator;
|
|
import com.txz.cif.model.*;
|
|
import com.txz.cif.model.*;
|
|
import com.txz.cif.service.*;
|
|
import com.txz.cif.service.*;
|
|
-
|
|
|
|
-import com.txz.cif.core.ResultCode;
|
|
|
|
-
|
|
|
|
-import com.github.pagehelper.PageHelper;
|
|
|
|
-import com.github.pagehelper.PageInfo;
|
|
|
|
import com.txz.cif.web.bo.RechargeRecordBO;
|
|
import com.txz.cif.web.bo.RechargeRecordBO;
|
|
import com.txz.cif.web.para.RecordParam;
|
|
import com.txz.cif.web.para.RecordParam;
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
|
-import org.slf4j.Logger;
|
|
|
|
-import org.slf4j.LoggerFactory;
|
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
-
|
|
|
|
|
|
+import org.slf4j.Logger;
|
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
import tk.mybatis.mapper.entity.Condition;
|
|
import tk.mybatis.mapper.entity.Condition;
|
|
import tk.mybatis.mapper.entity.Example.Criteria;
|
|
import tk.mybatis.mapper.entity.Example.Criteria;
|
|
|
|
|
|
@@ -31,7 +28,6 @@ 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.
|
|
@@ -112,64 +108,65 @@ public class RechargeRecordController {
|
|
|
|
|
|
@PostMapping("/list")
|
|
@PostMapping("/list")
|
|
@ApiOperation(value = "rechargeRecord获取列表", httpMethod = "POST")
|
|
@ApiOperation(value = "rechargeRecord获取列表", httpMethod = "POST")
|
|
- public Result<List<RechargeRecordBO>> list(@RequestBody RecordParam param) {
|
|
|
|
|
|
+ public Result<PageInfo<RechargeRecordBO>> list(@RequestBody RecordParam param) {
|
|
|
|
|
|
PageHelper.startPage(param.getPage(), param.getSize());
|
|
PageHelper.startPage(param.getPage(), param.getSize());
|
|
|
|
|
|
- Condition condition = new Condition(RechargeRecord.class);
|
|
|
|
- Criteria criteria = condition.createCriteria();
|
|
|
|
- if (StrUtil.isNotBlank(param.getChannel())) {
|
|
|
|
- criteria.andEqualTo("channel", param.getChannel());
|
|
|
|
- }
|
|
|
|
- if (StrUtil.isNotBlank(param.getUserName())) {
|
|
|
|
- criteria.andEqualTo("userName", param.getUserName());
|
|
|
|
- }
|
|
|
|
- if (StrUtil.isNotBlank(param.getUserPhone())) {
|
|
|
|
- criteria.andEqualTo("userPhone", param.getUserPhone());
|
|
|
|
- }
|
|
|
|
- if (StrUtil.isNotBlank(param.getOrderNo())) {
|
|
|
|
- criteria.andEqualTo("orderNo", param.getOrderNo());
|
|
|
|
- }
|
|
|
|
- if (param.getStatus() != null) {
|
|
|
|
- criteria.andEqualTo("status", param.getStatus());
|
|
|
|
- }
|
|
|
|
- if (param.getTimeType() != null) {
|
|
|
|
- if (param.getTimeType() == 1) {
|
|
|
|
- if (StrUtil.isNotBlank(param.getStartTime())) {
|
|
|
|
- criteria.andBetween("createTime", param.getStartTime(), param.getEndTime());
|
|
|
|
- }
|
|
|
|
- } else if (param.getTimeType() == 2) {
|
|
|
|
- if (StrUtil.isNotBlank(param.getStartTime())) {
|
|
|
|
- criteria.andBetween("successTime", param.getStartTime(), param.getEndTime());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- PageInfo pageInfo = null;
|
|
|
|
- try {
|
|
|
|
- condition.setOrderByClause("create_time desc");
|
|
|
|
- List<RechargeRecord> list = rechargeRecordService.findByCondition(condition);
|
|
|
|
- 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) {
|
|
|
|
- log.error("查询对象操作异常e:{}", e);
|
|
|
|
- return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
|
|
|
|
- }
|
|
|
|
- return ResultGenerator.genSuccessResult(pageInfo);
|
|
|
|
|
|
+ return Result.success(new PageInfo(rechargeRecordService.pageList(param)));
|
|
|
|
+
|
|
|
|
+ // Condition condition = new Condition(RechargeRecord.class);
|
|
|
|
+ // Criteria criteria = condition.createCriteria();
|
|
|
|
+ // if (StrUtil.isNotBlank(param.getChannel())) {
|
|
|
|
+ // criteria.andEqualTo("channel", param.getChannel());
|
|
|
|
+ // }
|
|
|
|
+ // if (StrUtil.isNotBlank(param.getUserName())) {
|
|
|
|
+ // criteria.andEqualTo("userName", param.getUserName());
|
|
|
|
+ // }
|
|
|
|
+ // if (StrUtil.isNotBlank(param.getUserPhone())) {
|
|
|
|
+ // criteria.andEqualTo("userPhone", param.getUserPhone());
|
|
|
|
+ // }
|
|
|
|
+ // if (StrUtil.isNotBlank(param.getOrderNo())) {
|
|
|
|
+ // criteria.andEqualTo("orderNo", param.getOrderNo());
|
|
|
|
+ // }
|
|
|
|
+ // if (param.getStatus() != null) {
|
|
|
|
+ // criteria.andEqualTo("status", param.getStatus());
|
|
|
|
+ // }
|
|
|
|
+ // if (param.getTimeType() != null) {
|
|
|
|
+ // if (param.getTimeType() == 1) {
|
|
|
|
+ // if (StrUtil.isNotBlank(param.getStartTime())) {
|
|
|
|
+ // criteria.andBetween("createTime", param.getStartTime(), param.getEndTime());
|
|
|
|
+ // }
|
|
|
|
+ // } else if (param.getTimeType() == 2) {
|
|
|
|
+ // if (StrUtil.isNotBlank(param.getStartTime())) {
|
|
|
|
+ // criteria.andBetween("successTime", param.getStartTime(), param.getEndTime());
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // PageInfo pageInfo = null;
|
|
|
|
+ // try {
|
|
|
|
+ // condition.setOrderByClause("create_time desc");
|
|
|
|
+ // List<RechargeRecord> list = rechargeRecordService.findByCondition(condition);
|
|
|
|
+ // 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) {
|
|
|
|
+ // log.error("查询对象操作异常e:{}", e);
|
|
|
|
+ // return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
|
|
|
|
@GetMapping("/report")
|
|
@GetMapping("/report")
|