ソースを参照

add withdraw api

Mr.qian 1 週間 前
コミット
b156179136

+ 123 - 0
cif-api/src/main/java/com/txz/cif/dto/tfpay/TFCreateWithdrawDTO.java

@@ -0,0 +1,123 @@
+package com.txz.cif.dto.tfpay;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Builder;
+import lombok.Data;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/9/3
+ */
+@Data
+@Builder
+public class TFCreateWithdrawDTO {
+    
+    /**
+     * 商户号
+     */
+    @JsonProperty("pay_memberid")
+    private String payMemberid;
+    
+    /**
+     * 商户订单号
+     */
+    @JsonProperty("pay_orderid")
+    private String payOrderid;
+    
+    /**
+     * 提交时间
+     */
+    @JsonProperty("pay_applydate")
+    private String payApplydate;
+    
+    /**
+     * 通道编码
+     */
+    @JsonProperty("pay_channelcode")
+    private String payChannelcode;
+    
+    /**
+     * 异步回调
+     */
+    @JsonProperty("pay_notifyurl")
+    private String payNotifyurl;
+    
+    /**
+     * 订单金额
+     */
+    @JsonProperty("pay_amount")
+    private String payAmount;
+    
+    /**
+     * 商品名称/备注
+     */
+    @JsonProperty("pay_productname")
+    private String payProductname;
+    
+    /**
+     * 用户姓名
+     */
+    @JsonProperty("pay_username")
+    private String payUsername;
+    
+    /**
+     * 银行账号
+     */
+    @JsonProperty("pay_banknumber")
+    private String payBanknumber;
+    
+    /**
+     * 银行名称
+     */
+    @JsonProperty("pay_bankname")
+    private String payBankname;
+    
+    /**
+     * 银行代码(key)
+     */
+    @JsonProperty("pay_bankcode")
+    private String payBankcode;
+    
+    /**
+     * 数据签名
+     */
+    @JsonProperty("pay_md5sign")
+    private String payMd5sign;
+    
+    /**
+     * 币种
+     */
+    @JsonProperty("currency_type")
+    private String currencyType;
+    
+    /**
+     * 返回数据格式
+     */
+    @JsonProperty("type")
+    private String type;
+    
+    /**
+     * 附加字段
+     */
+    @JsonProperty("pay_attach")
+    private String payAttach;
+    
+    /**
+     * 用户邮箱
+     */
+    @JsonProperty("pay_email")
+    private String payEmail;
+    
+    /**
+     * 用户电话
+     */
+    @JsonProperty("pay_mobile")
+    private String payMobile;
+    
+    /**
+     * 加密方式
+     */
+    @JsonProperty("pay_signtype")
+    private String paySigntype;
+    
+}

+ 69 - 0
cif-api/src/main/java/com/txz/cif/dto/tfpay/TFWithdrawDTO.java

@@ -0,0 +1,69 @@
+package com.txz.cif.dto.tfpay;
+
+import lombok.Builder;
+import lombok.Data;
+
+/**
+ * @author: MTD®️
+ * @date: 2025/9/3
+ */
+@Data
+@Builder
+public class TFWithdrawDTO {
+    
+    /**
+     * 商户号
+     */
+    private String payMemberid;
+    
+    /**
+     * 商户订单号
+     */
+    private String payOrderid;
+    
+    /**
+     * 提交时间
+     */
+    private String payApplydate;
+    
+    /**
+     * 通道编码
+     */
+    private String payChannelcode;
+    
+    /**
+     * 异步回调
+     */
+    private String payNotifyurl;
+    
+    /**
+     * 订单金额
+     */
+    private String payAmount;
+    
+    /**
+     * 商品名称/备注
+     */
+    private String payProductname;
+    
+    /**
+     * 用户姓名
+     */
+    private String payUsername;
+    
+    /**
+     * 银行账号
+     */
+    private String payBanknumber;
+    
+    /**
+     * 银行名称
+     */
+    private String payBankname;
+    
+    /**
+     * 银行代码(key)
+     */
+    private String payBankcode;
+    
+}

+ 11 - 0
cif-service/src/main/java/com/txz/cif/service/TFPayService.java

@@ -3,6 +3,7 @@ package com.txz.cif.service;
 import com.txz.cif.dto.BizLogDTO;
 import com.txz.cif.dto.tfpay.TFCreateOrderDTO;
 import com.txz.cif.dto.tfpay.TFQueryOrderDTO;
+import com.txz.cif.dto.tfpay.TFWithdrawDTO;
 
 /**
  * @author: MTD®️
@@ -21,4 +22,14 @@ public interface TFPayService {
      */
     String queryOrder(TFQueryOrderDTO dto, String key);
     
+    /**
+     * 银行列表
+     */
+    String queryBankList(String payChannelcode);
+    
+    /**
+     * 提现
+     */
+    BizLogDTO withdraw(TFWithdrawDTO dto, String key);
+    
 }

+ 53 - 5
cif-service/src/main/java/com/txz/cif/service/impl/TFPayServiceImpl.java

@@ -3,9 +3,7 @@ package com.txz.cif.service.impl;
 import cn.hutool.http.HttpRequest;
 import com.txz.cif.configurer.TFPayConfig;
 import com.txz.cif.dto.BizLogDTO;
-import com.txz.cif.dto.tfpay.TFCreateOrderDTO;
-import com.txz.cif.dto.tfpay.TFPayOrderDTO;
-import com.txz.cif.dto.tfpay.TFQueryOrderDTO;
+import com.txz.cif.dto.tfpay.*;
 import com.txz.cif.service.TFPayService;
 import com.txz.cif.util.TFPayUtil;
 import lombok.extern.slf4j.Slf4j;
@@ -44,7 +42,7 @@ public class TFPayServiceImpl implements TFPayService {
         tyPay.setIp(dto.getIp());
         
         Map<String, Object> reqMap = TFPayUtil.convertObjectToMap(tyPay);
-        String result = HttpRequest.post(tfPayConfig.getPaymenturl())
+        String result = HttpRequest.post(tfPayConfig.getPaymenturl() + "/pay")
                 .form(reqMap)
                 .contentType("application/x-www-form-urlencoded")
                 .execute()
@@ -63,7 +61,7 @@ public class TFPayServiceImpl implements TFPayService {
                 .payOrderid(dto.getPayOrderid())
                 .build();
         tfPay.setPayMd5sign(TFPayUtil.generateSignature(tfPay, key));
-        String result = HttpRequest.post(tfPayConfig.getPaymenturl())
+        String result = HttpRequest.post(tfPayConfig.getPaymenturl() + "/query")
                 .form(TFPayUtil.convertObjectToMap(tfPay))
                 .contentType("application/x-www-form-urlencoded")
                 .execute()
@@ -79,4 +77,54 @@ public class TFPayServiceImpl implements TFPayService {
         return result;
     }
     
+    @Override
+    public String queryBankList(String payChannelcode) {
+        TFPayOrderDTO tfPay = TFPayOrderDTO.builder()
+                .payMemberid("260875")
+                .payOrderid(payChannelcode)
+                .build();
+        String result = HttpRequest.post(tfPayConfig.getPaymenturl() + "/bank")
+                .form(TFPayUtil.convertObjectToMap(tfPay))
+                .contentType("application/x-www-form-urlencoded")
+                .execute()
+                .body();
+        // todo 暂无功能,后续修改
+        return result;
+    }
+    
+    @Override
+    public BizLogDTO withdraw(TFWithdrawDTO dto, String key) {
+        TFCreateWithdrawDTO withdrawDTO = TFCreateWithdrawDTO.builder()
+                .payMemberid(dto.getPayMemberid())
+                .payOrderid(dto.getPayOrderid())
+                .payApplydate(dto.getPayApplydate())
+                .payChannelcode(dto.getPayChannelcode())
+                .payNotifyurl(dto.getPayNotifyurl())
+                .payAmount(dto.getPayAmount())
+                .payProductname(dto.getPayProductname())
+                .payUsername(dto.getPayUsername())
+                .payBanknumber(dto.getPayBanknumber())
+                .payBankname(dto.getPayBankname())
+                .build();
+        
+        // 生成签名
+        withdrawDTO.setPayMd5sign(TFPayUtil.generateSignature(dto, key));
+        withdrawDTO.setPayBankcode(dto.getPayBankcode());
+        withdrawDTO.setCurrencyType("BDT");
+        withdrawDTO.setType("json");
+        
+        Map<String, Object> reqMap = TFPayUtil.convertObjectToMap(dto);
+        String result = HttpRequest.post(tfPayConfig.getWithdrawurl())
+                .form(reqMap)
+                .contentType("application/x-www-form-urlencoded")
+                .execute()
+                .body();
+        log.info("TFPay withdraw result: {}", result);
+        return BizLogDTO.builder()
+                .sendMessage(reqMap.toString())
+                .receiveMessage(result)
+                .build();
+    }
+    
+    
 }

+ 223 - 215
cif-service/src/main/java/com/txz/cif/web/mng/WithdrawRecordController.java

@@ -1,11 +1,15 @@
 package com.txz.cif.web.mng;
+
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.poi.excel.ExcelUtil;
 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.ResultCode;
 import com.txz.cif.core.ResultGenerator;
 import com.txz.cif.model.Account;
 import com.txz.cif.model.BizLog;
@@ -13,21 +17,16 @@ import com.txz.cif.model.RechargeRecord;
 import com.txz.cif.model.WithdrawRecord;
 import com.txz.cif.service.AccountService;
 import com.txz.cif.service.BizLogService;
+import com.txz.cif.service.TFPayService;
 import com.txz.cif.service.WithdrawRecordService;
-
-import com.txz.cif.core.ResultCode;
-
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
 import com.txz.cif.web.bo.WithdrawRecordBO;
 import com.txz.cif.web.para.RecordParam;
 import com.txz.cif.web.para.ReviewParam;
-import org.springframework.web.bind.annotation.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import io.swagger.annotations.Api;
 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.Example.Criteria;
 
@@ -38,219 +37,228 @@ import java.util.LinkedList;
 import java.util.List;
 
 /**
-* Created by CodeGenerator on 2025/07/15.
-*/
+ * Created by CodeGenerator on 2025/07/15.
+ */
 @Api(tags = "[后台]withdrawRecord管理")
 @RestController
 @RequestMapping("/withdraw/record")
 public class WithdrawRecordController {
-
-	private static Logger log = LoggerFactory.getLogger(WithdrawRecordController.class);
-
+    
+    private static Logger log = LoggerFactory.getLogger(WithdrawRecordController.class);
+    
     @Resource
     private WithdrawRecordService withdrawRecordService;
-
-	@Resource
-	private BizLogService bizLogService;
-
-	@Resource
-	private AccountService accountService;
-
+    
+    @Resource
+    private BizLogService bizLogService;
+    
+    @Resource
+    private AccountService accountService;
+    
+    @Resource
+    private TFPayService tfPayService;
+    
     @GetMapping("/detail")
-	@ApiOperation(value = "withdrawRecord获取详情",httpMethod = "GET")
+    @ApiOperation(value = "withdrawRecord获取详情", httpMethod = "GET")
     public Result<WithdrawRecordBO> detail(@RequestParam Long id) {
-    	if(id == null){
-    		return ResultGenerator.genFailResult(ResultCode.ID_IS_NULL);
-    	}
-
-    	try {
-			WithdrawRecord withdrawRecord = withdrawRecordService.findById(id);
-			if (withdrawRecord == null){
-				return ResultGenerator.genFailResult(ResultCode.OBJECT_IS_NULL);
-			}
-			WithdrawRecordBO bo = BeanUtil.toBean(withdrawRecord,WithdrawRecordBO.class);
-			Condition c = new Condition(BizLog.class);
-			c.createCriteria().andEqualTo("bizType",2)
-					.andEqualTo("bizNo",withdrawRecord.getOrderNo());
-			List<BizLog> logs = bizLogService.findByCondition(c);
-			bo.setBizLogs(logs);
-
-			Account wallet = accountService.getAccount(withdrawRecord.getUserId(), 1);
-			if (wallet != null){
-				bo.setWalletBalance(wallet.getBalance());
-			}
-			Account earnings = accountService.getAccount(withdrawRecord.getUserId(), 2);
-			if (earnings != null){
-				bo.setEarningsBalance(earnings.getBalance());
-			}
-			return ResultGenerator.genSuccessResult(bo);
-		} catch (Exception e) {
-			log.error("查询对象操作异常e:{}",e);
-			return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
-		}
-
+        if (id == null) {
+            return ResultGenerator.genFailResult(ResultCode.ID_IS_NULL);
+        }
+        
+        try {
+            WithdrawRecord withdrawRecord = withdrawRecordService.findById(id);
+            if (withdrawRecord == null) {
+                return ResultGenerator.genFailResult(ResultCode.OBJECT_IS_NULL);
+            }
+            WithdrawRecordBO bo = BeanUtil.toBean(withdrawRecord, WithdrawRecordBO.class);
+            Condition c = new Condition(BizLog.class);
+            c.createCriteria().andEqualTo("bizType", 2)
+                    .andEqualTo("bizNo", withdrawRecord.getOrderNo());
+            List<BizLog> logs = bizLogService.findByCondition(c);
+            bo.setBizLogs(logs);
+            
+            Account wallet = accountService.getAccount(withdrawRecord.getUserId(), 1);
+            if (wallet != null) {
+                bo.setWalletBalance(wallet.getBalance());
+            }
+            Account earnings = accountService.getAccount(withdrawRecord.getUserId(), 2);
+            if (earnings != null) {
+                bo.setEarningsBalance(earnings.getBalance());
+            }
+            return ResultGenerator.genSuccessResult(bo);
+        } catch (Exception e) {
+            log.error("查询对象操作异常e:{}", e);
+            return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        
+    }
+    
+    @PostMapping("/review")
+    @ApiOperation(value = "审核", httpMethod = "POST")
+    public Result review(@RequestBody ReviewParam param) {
+        if (param == null) {
+            return ResultGenerator.genFailResult(ResultCode.OBJECT_IS_NULL);
+        }
+        if (param.getId() == null) {
+            return ResultGenerator.genFailResult(ResultCode.ID_IS_NULL);
+        }
+        if (param.getType() == null) {
+            return ResultGenerator.genFailResult(ResultCode.TYPE_IS_NULL);
+        }
+        if (param.getType() == 2) {
+            if (StrUtil.isBlank(param.getReview())) {
+                return ResultGenerator.genFailResult(ResultCode.REVIEW_IS_NULL);
+            }
+        }
+        WithdrawRecord w = withdrawRecordService.findById(param.getId());
+        if (w == null) {
+            return ResultGenerator.genFailResult(ResultCode.OBJECT_IS_NULL);
+        }
+        if (w.getStatus() != 1) {
+            return ResultGenerator.genFailResult(ResultCode.STATUS_IS_NULL);
+        }
+        
+        if (param.getType() == 1) {
+            // 同意提现
+            
+            // tfPayService.withdraw();
+        }
+        
+        withdrawRecordService.review(WithdrawRecord.builder().id(param.getId())
+                .review(param.getReview()).status(param.getType() == 1 ? 2 : 3).build());
+        return ResultGenerator.genSuccessResult();
+    }
+    
+    @PostMapping("/list")
+    @ApiOperation(value = "withdrawRecord获取列表", httpMethod = "POST")
+    public Result<List<WithdrawRecord>> list(@RequestBody RecordParam param) {
+        
+        PageHelper.startPage(param.getPage(), param.getSize());
+        
+        Condition condition = new Condition(WithdrawRecord.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<WithdrawRecord> list = withdrawRecordService.findByCondition(condition);
+            pageInfo = new PageInfo(list);
+        } catch (Exception e) {
+            log.error("查询对象操作异常e:{}", e);
+            return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        return ResultGenerator.genSuccessResult(pageInfo);
+    }
+    
+    @GetMapping("/report")
+    @ApiOperation(value = "导出", httpMethod = "GET")
+    public void report(@RequestParam(required = false) String orderNo,
+                       @RequestParam(required = false) String channel,
+                       @RequestParam(required = false) String userName,
+                       @RequestParam(required = false) String userPhone,
+                       @RequestParam(required = false) Integer status,
+                       @RequestParam(required = false) Integer timeType,
+                       @RequestParam(required = false) String startTime,
+                       @RequestParam(required = false) String endTime,
+                       HttpServletResponse response) {
+        Condition condition = new Condition(RechargeRecord.class);
+        Criteria criteria = condition.createCriteria();
+        if (StrUtil.isNotBlank(channel)) {
+            criteria.andEqualTo("channel", channel);
+        }
+        if (StrUtil.isNotBlank(userName)) {
+            criteria.andEqualTo("userName", userName);
+        }
+        if (StrUtil.isNotBlank(userPhone)) {
+            criteria.andEqualTo("userPhone", userPhone);
+        }
+        if (StrUtil.isNotBlank(orderNo)) {
+            criteria.andEqualTo("orderNo", orderNo);
+        }
+        if (status != null) {
+            criteria.andEqualTo("status", status);
+        }
+        if (timeType != null) {
+            if (timeType == 1) {
+                if (StrUtil.isNotBlank(startTime) && StrUtil.isNotBlank(endTime)) {
+                    criteria.andBetween("createTime", startTime, endTime);
+                }
+            } else if (timeType == 2) {
+                if (StrUtil.isNotBlank(startTime) && StrUtil.isNotBlank(endTime)) {
+                    criteria.andBetween("successTime", startTime, endTime);
+                }
+            }
+        }
+        condition.setOrderByClause("create_time desc");
+        List<WithdrawRecord> list = withdrawRecordService.findByCondition(condition);
+        List<String> rowHead = CollUtil.newArrayList("编号", "订单号", "用户id", "交易金额", "手续费", "状态 1处理中 2充值成功 3充值失败 4超时取消", "渠道", "币种", "用户名", "手机号", "交易时间", "交易成功时间", "银行", "银行账户", "银行账户姓名");
+        ExcelWriter writer = ExcelUtil.getWriter();
+        try {
+            writer.writeHeadRow(rowHead);
+            List<List<Object>> rows = new LinkedList<>();
+            if (CollUtil.isNotEmpty(list)) {
+                for (WithdrawRecord temp : list) {
+                    List<Object> rowA = CollUtil.newArrayList(
+                            temp.getId() + "",
+                            temp.getOrderNo(),
+                            temp.getAmount() == null ? "0" : temp.getAmount().toPlainString(),
+                            temp.getFee() == null ? "0" : temp.getFee().toPlainString(),
+                            temp.getStatus() + "",
+                            temp.getChannel(),
+                            temp.getCurrency(),
+                            temp.getUserName(),
+                            temp.getUserPhone(),
+                            temp.getTransTime() == null ? "" : DateUtil.format(temp.getTransTime(), "yyyy-MM-dd HH:mm:ss"),
+                            temp.getSuccessTime() == null ? "" : DateUtil.format(temp.getSuccessTime(), "yyyy-MM-dd HH:mm:ss"),
+                            temp.getBank(),
+                            temp.getBankAccount(),
+                            temp.getBankAccountName());
+                    rows.add(rowA);
+                }
+            }
+            writer.write(rows);
+            // 设置宽度自适应
+            writer.setColumnWidth(-1, 22);
+            // response为HttpServletResponse对象
+            response.setContentType("application/vnd.ms-excel;charset=utf-8");
+            // test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
+            response.setHeader("Content-Disposition", "attachment;filename=" + new String(("数据列表").getBytes("UTF-8"), "ISO-8859-1") + ".xls");
+            ServletOutputStream out = response.getOutputStream();
+            // out为OutputStream,需要写出到的目标流
+            writer.flush(out);
+            log.info("导出结束");
+        } catch (Exception e) {
+            log.error("导出异常", e);
+            e.printStackTrace();
+        } finally {
+            // 关闭writer,释放内存
+            writer.close();
+            log.info("导出结束");
+        }
     }
-
-	@PostMapping("/review")
-	@ApiOperation(value = "审核",httpMethod = "POST")
-	public Result review(@RequestBody ReviewParam param) {
-		if (param == null){
-			return ResultGenerator.genFailResult(ResultCode.OBJECT_IS_NULL);
-		}
-		if (param.getId() == null){
-			return ResultGenerator.genFailResult(ResultCode.ID_IS_NULL);
-		}
-		if (param.getType() == null){
-			return ResultGenerator.genFailResult(ResultCode.TYPE_IS_NULL);
-		}
-		if (param.getType() == 2){
-			if (StrUtil.isBlank(param.getReview())){
-				return ResultGenerator.genFailResult(ResultCode.REVIEW_IS_NULL);
-			}
-		}
-		WithdrawRecord w = withdrawRecordService.findById(param.getId());
-		if (w == null){
-			return ResultGenerator.genFailResult(ResultCode.OBJECT_IS_NULL);
-		}
-		if (w.getStatus() != 1){
-			return ResultGenerator.genFailResult(ResultCode.STATUS_IS_NULL);
-		}
-
-		withdrawRecordService.review(WithdrawRecord.builder().id(param.getId())
-				.review(param.getReview()).status(param.getType() == 1?2:3).build());
-		return ResultGenerator.genSuccessResult();
-	}
-
-		@PostMapping("/list")
-	@ApiOperation(value = "withdrawRecord获取列表",httpMethod = "POST")
-	public Result<List<WithdrawRecord>> list(@RequestBody RecordParam param) {
-
-		PageHelper.startPage(param.getPage(), param.getSize());
-
-		Condition condition = new Condition(WithdrawRecord.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<WithdrawRecord> list = withdrawRecordService.findByCondition(condition);
-			pageInfo = new PageInfo(list);
-		} catch (Exception e) {
-			log.error("查询对象操作异常e:{}",e);
-			return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
-		}
-		return ResultGenerator.genSuccessResult(pageInfo);
-	}
-
-	@GetMapping("/report")
-	@ApiOperation(value = "导出", httpMethod = "GET")
-	public void report(@RequestParam(required = false) String orderNo ,
-					   @RequestParam(required = false) String channel ,
-					   @RequestParam(required = false) String userName ,
-					   @RequestParam(required = false) String userPhone ,
-					   @RequestParam(required = false) Integer status ,
-					   @RequestParam(required = false) Integer timeType ,
-					   @RequestParam(required = false) String startTime ,
-					   @RequestParam(required = false) String endTime ,
-					   HttpServletResponse response) {
-		Condition condition = new Condition(RechargeRecord.class);
-		Criteria criteria = condition.createCriteria();
-		if (StrUtil.isNotBlank(channel)){
-			criteria.andEqualTo("channel", channel);
-		}
-		if (StrUtil.isNotBlank(userName)){
-			criteria.andEqualTo("userName", userName);
-		}
-		if (StrUtil.isNotBlank(userPhone)){
-			criteria.andEqualTo("userPhone", userPhone);
-		}
-		if (StrUtil.isNotBlank(orderNo)){
-			criteria.andEqualTo("orderNo", orderNo);
-		}
-		if (status != null){
-			criteria.andEqualTo("status", status);
-		}
-		if (timeType != null){
-			if (timeType ==1 ){
-				if (StrUtil.isNotBlank(startTime) && StrUtil.isNotBlank(endTime)){
-					criteria.andBetween("createTime", startTime,endTime);
-				}
-			} else  if (timeType ==2 ){
-				if (StrUtil.isNotBlank(startTime) && StrUtil.isNotBlank(endTime)){
-					criteria.andBetween("successTime", startTime,endTime);
-				}
-			}
-		}
-		condition.setOrderByClause("create_time desc");
-		List<WithdrawRecord> list = withdrawRecordService.findByCondition(condition);
-		List<String> rowHead = CollUtil.newArrayList("编号", "订单号", "用户id", "交易金额", "手续费", "状态 1处理中 2充值成功 3充值失败 4超时取消", "渠道", "币种", "用户名", "手机号", "交易时间", "交易成功时间", "银行", "银行账户", "银行账户姓名");
-		ExcelWriter writer = ExcelUtil.getWriter();
-		try {
-			writer.writeHeadRow(rowHead);
-			List<List<Object>> rows = new LinkedList<>();
-			if (CollUtil.isNotEmpty(list)) {
-				for (WithdrawRecord temp : list) {
-					List<Object> rowA = CollUtil.newArrayList(
-							temp.getId()+"",
-							temp.getOrderNo(),
-							temp.getAmount() == null? "0":temp.getAmount().toPlainString(),
-							temp.getFee() == null? "0":temp.getFee().toPlainString(),
-							temp.getStatus()+"",
-							temp.getChannel(),
-							temp.getCurrency(),
-							temp.getUserName(),
-							temp.getUserPhone(),
-							temp.getTransTime() == null? "": DateUtil.format(temp.getTransTime(), "yyyy-MM-dd HH:mm:ss"),
-							temp.getSuccessTime() == null? "":DateUtil.format(temp.getSuccessTime(), "yyyy-MM-dd HH:mm:ss"),
-							temp.getBank(),
-							temp.getBankAccount(),
-							temp.getBankAccountName());
-					rows.add(rowA);
-				}
-			}
-			writer.write(rows);
-			//设置宽度自适应
-			writer.setColumnWidth(-1, 22);
-			//response为HttpServletResponse对象
-			response.setContentType("application/vnd.ms-excel;charset=utf-8");
-			//test.xls是弹出下载对话框的文件名,不能为中文,中文请自行编码
-			response.setHeader("Content-Disposition", "attachment;filename=" + new String(("数据列表").getBytes("UTF-8"), "ISO-8859-1") + ".xls");
-			ServletOutputStream out = response.getOutputStream();
-			//out为OutputStream,需要写出到的目标流
-			writer.flush(out);
-			log.info("导出结束");
-		} catch (Exception e) {
-			log.error("导出异常", e);
-			e.printStackTrace();
-		} finally {
-			// 关闭writer,释放内存
-			writer.close();
-			log.info("导出结束");
-		}
-	}
 }

+ 18 - 14
cif-service/src/main/java/com/txz/cif/web/para/ReviewParam.java

@@ -4,31 +4,35 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.*;
 
-import java.math.BigDecimal;
-import java.util.Date;
-import javax.persistence.*;
 @Getter
 @Setter
 @NoArgsConstructor
 @AllArgsConstructor
 @Builder
 
-@ApiModel(value="审核入参")
+@ApiModel(value = "审核入参")
 public class ReviewParam {
-
-
-    @ApiModelProperty(value="id")
+    
+    @ApiModelProperty(value = "id")
     private Long id;
-
+    
     /**
      * 审核内容
      */
-    @ApiModelProperty(value="审核内容")
+    @ApiModelProperty(value = "审核内容")
     private String review;
-
-    @ApiModelProperty(value="类型 1通过 2不通过")
+    
+    @ApiModelProperty(value = "类型 1通过 2不通过")
     private Integer type;
-
-
-
+    
+    /**
+     * 通道id
+     */
+    private Long channelId;
+    
+    /**
+     * 提现code
+     */
+    private String withdrawCode;
+    
 }