Răsfoiți Sursa

fix some bug

Mr.qian 6 zile în urmă
părinte
comite
e1393fbc44

+ 4 - 2
cif-service/src/main/java/com/txz/cif/service/WithdrawRecordService.java

@@ -3,6 +3,8 @@ package com.txz.cif.service;
 import com.txz.cif.model.WithdrawRecord;
 import com.txz.cif.core.Service;
 
+import java.util.Date;
+
 
 /**
  * Created by CodeGenerator on 2025/07/15.
@@ -11,9 +13,9 @@ public interface WithdrawRecordService extends Service<WithdrawRecord> {
     
     void add(WithdrawRecord withdrawRecord);
     
-    void review(WithdrawRecord build, Integer status, String review, Long channelId);
+    void review(WithdrawRecord build, Integer status, String review, Long channelId, String userName);
     
-    void success(WithdrawRecord record);
+    void success(WithdrawRecord record, Date successTime);
     
     void fail(WithdrawRecord record);
 }

+ 7 - 6
cif-service/src/main/java/com/txz/cif/service/impl/WithdrawRecordServiceImpl.java

@@ -25,6 +25,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.util.Date;
 import java.util.Map;
 
 
@@ -75,7 +76,7 @@ public class WithdrawRecordServiceImpl extends AbstractService<WithdrawRecord> i
     }
     
     @Override
-    public void review(WithdrawRecord w, Integer status, String review, Long channelId) {
+    public void review(WithdrawRecord w, Integer status, String review, Long channelId, String userName) {
         // 同意提现
         if (status == 2) {
             LockInfo lockInfo = lockTemplate.lock(String.format(MyConstants.TF_PAY_WITHDRAW_SUBMIT_LOCK, w.getOrderNo()), Long.valueOf(1000 * 60 * 2), Long.valueOf(1000 * 1), RedisTemplateLockExecutor.class);
@@ -120,7 +121,7 @@ public class WithdrawRecordServiceImpl extends AbstractService<WithdrawRecord> i
                                     .receiveMessage(bizLog.getReceiveMessage())
                                     .sendMessage(bizLog.getSendMessage())
                                     .createTime(now)
-                                    .createUser(user.getName())
+                                    .createUser(userName)
                                     .memo("提交提现申请").build());
                         } catch (Exception e) {
                             log.error("新增提现提交订单日志失败", e);
@@ -140,7 +141,7 @@ public class WithdrawRecordServiceImpl extends AbstractService<WithdrawRecord> i
                     default:
                         throw new ServiceException("暂不支持此渠道");
                 }
-                this.update(WithdrawRecord.builder().id(w.getId()).channel(paymentChannel.getChannelName()).review(review).status(status).thirdOrderNo(thirdOrderNo).build());
+                this.update(WithdrawRecord.builder().id(w.getId()).channel(paymentChannel.getChannelName()).review(review).status(status).updateUser(userName).thirdOrderNo(thirdOrderNo).build());
             } finally {
                 lockTemplate.releaseLock(lockInfo);
             }
@@ -151,11 +152,11 @@ public class WithdrawRecordServiceImpl extends AbstractService<WithdrawRecord> i
             flowService.unFreeze(w.getFreezeId());
         }
         this.update(WithdrawRecord.builder().id(w.getId())
-                .review(review).status(status).build());
+                .review(review).updateUser(userName).status(status).build());
     }
     
     @Override
-    public void success(WithdrawRecord record) {
+    public void success(WithdrawRecord record, Date successTime) {
         if (record.getFreezeId() != null) {
             flowService.unFreeze(record.getFreezeId());
         }
@@ -167,7 +168,7 @@ public class WithdrawRecordServiceImpl extends AbstractService<WithdrawRecord> i
                 .bizNo(record.getOrderNo())
                 .transTime(record.getTransTime())
                 .build());
-        update(WithdrawRecord.builder().id(record.getId()).status(4).build());
+        update(WithdrawRecord.builder().id(record.getId()).successTime(successTime).status(4).build());
     }
     
     @Override

+ 38 - 1
cif-service/src/main/java/com/txz/cif/web/RechargeRecordApiController.java

@@ -14,22 +14,28 @@ import com.baomidou.lock.executor.RedisTemplateLockExecutor;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.txz.cif.constants.MyConstants;
-import com.txz.cif.core.*;
+import com.txz.cif.core.AuthService;
+import com.txz.cif.core.Result;
+import com.txz.cif.core.ResultCode;
+import com.txz.cif.core.ResultGenerator;
 import com.txz.cif.dto.BizLogDTO;
 import com.txz.cif.dto.tfpay.CheckSignDTO;
 import com.txz.cif.dto.tfpay.TFCreateOrderDTO;
 import com.txz.cif.model.*;
 import com.txz.cif.service.*;
+import com.txz.cif.service.impl.BizLogServiceImpl;
 import com.txz.cif.util.IpUtils;
 import com.txz.cif.util.TFPayUtil;
 import com.txz.cif.web.para.RecordParam;
 import com.txz.cif.web.ro.TFPayNotifyDTO;
 import com.txz.cif.web.vo.CreatePayVO;
 import com.txz.cif.web.vo.PaymentPriceVO;
+import com.txz.core.ServiceException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import tk.mybatis.mapper.entity.Condition;
 import tk.mybatis.mapper.entity.Example;
@@ -79,6 +85,8 @@ public class RechargeRecordApiController {
     
     @Resource
     private LockTemplate lockTemplate;
+    @Autowired
+    private BizLogServiceImpl bizLogServiceImpl;
     
     @GetMapping("/goodsList/{methodId:^\\d+$}")
     @ApiOperation(value = "充值商品", httpMethod = "GET")
@@ -98,6 +106,35 @@ public class RechargeRecordApiController {
         );
     }
     
+    /**
+     * 充值未完成订单
+     */
+    @GetMapping("unpaidOrder")
+    public Result unpaidOrder(HttpServletRequest request) {
+        Condition condition = new Condition(RechargeRecord.class);
+        Criteria criteria = condition.createCriteria();
+        criteria.andEqualTo("status", 1);
+        criteria.andEqualTo("userId", authService.getTokenUserId(request));
+        condition.setOrderByClause("create_time desc");
+        List<RechargeRecord> list = rechargeRecordService.findByCondition(condition);
+        if (CollectionUtil.isEmpty(list)) {
+            return Result.success();
+        }
+        RechargeRecord rechargeRecord = list.get(0);
+        
+        Condition conditionBiz = new Condition(BizLog.class);
+        Criteria criteriaBiz = conditionBiz.createCriteria();
+        criteriaBiz.andEqualTo("bizType", 1);
+        criteriaBiz.andEqualTo("bizNo", rechargeRecord.getOrderNo());
+        criteriaBiz.andIsNotNull("receiveMessage");
+        List<BizLog> bizCondition = bizLogService.findByCondition(conditionBiz);
+        if (CollectionUtil.isEmpty(bizCondition)) {
+            return Result.success();
+        }
+        JSONObject resultJson = JSONUtil.parseObj(bizCondition.get(0).getReceiveMessage());
+        return Result.success(resultJson.getStr("data"));
+    }
+    
     
     @GetMapping("/add")
     @ApiOperation(value = "创建充值订单", httpMethod = "GET")

+ 1 - 1
cif-service/src/main/java/com/txz/cif/web/WithdrawRecordApiController.java

@@ -270,7 +270,7 @@ public class WithdrawRecordApiController {
             
             Integer type = 8;
             if (StrUtil.equals("1", dto.getReturncode())) {
-                withdrawRecordService.success(records.get(0));
+                withdrawRecordService.success(records.get(0), DateUtil.parse(dto.getDatetime(), "yyyyMMddHHmmss"));
             } else {
                 withdrawRecordService.fail(records.get(0));
                 type = 9;

+ 51 - 48
cif-service/src/main/java/com/txz/cif/web/bo/RechargeRecordBO.java

@@ -8,116 +8,119 @@ import lombok.*;
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
-import javax.persistence.*;
+
 @Getter
 @Setter
 @NoArgsConstructor
 @AllArgsConstructor
 @Builder
 
-@ApiModel(value="充值对象")
+@ApiModel(value = "充值对象")
 public class RechargeRecordBO {
-    @ApiModelProperty(value="id")
+    @ApiModelProperty(value = "id")
     private Long id;
-
+    
     /**
      * 订单号
      */
-    @ApiModelProperty(value="orderNo订单号")
+    @ApiModelProperty(value = "orderNo订单号")
     private String orderNo;
-
+    
     /**
      * 用户id
      */
-    @ApiModelProperty(value="userId用户id")
+    @ApiModelProperty(value = "userId用户id")
     private Long userId;
-
+    
     /**
      * 交易金额
      */
-    @ApiModelProperty(value="amount交易金额")
+    @ApiModelProperty(value = "amount交易金额")
     private BigDecimal amount;
-
-    @ApiModelProperty(value="折扣金额")
+    
+    @ApiModelProperty(value = "折扣金额")
     private BigDecimal discount;
-
-    @ApiModelProperty(value="钱包余额")
+    
+    @ApiModelProperty(value = "钱包余额")
     private BigDecimal walletBalance;
-
-    @ApiModelProperty(value="收益余额")
+    
+    @ApiModelProperty(value = "收益余额")
     private BigDecimal earningsBalance;
-
+    
     /**
      * 状态 1处理中 2充值成功 3充值失败 4超时取消
      */
-    @ApiModelProperty(value="status状态 1处理中 2充值成功 3充值失败 4超时取消")
+    @ApiModelProperty(value = "status状态 1处理中 2充值成功 3充值失败 4超时取消")
     private Integer status;
-
+    
     /**
      * 渠道
      */
-    @ApiModelProperty(value="channel渠道")
+    @ApiModelProperty(value = "channel渠道")
     private String channel;
-
-    @ApiModelProperty(value="支付通道")
+    
+    @ApiModelProperty(value = "支付通道")
     private String channelName;
-    @ApiModelProperty(value="支付方式")
+    @ApiModelProperty(value = "支付方式")
     private String methodName;
-
+    
     /**
      * 币种
      */
-    @ApiModelProperty(value="currency币种")
+    @ApiModelProperty(value = "currency币种")
     private String currency;
-
+    
     /**
      * 用户名
      */
-    @ApiModelProperty(value="userName用户名")
+    @ApiModelProperty(value = "userName用户名")
     private String userName;
-
+    
     /**
      * 手机号
      */
-    @ApiModelProperty(value="userPhone手机号")
+    @ApiModelProperty(value = "userPhone手机号")
     private String userPhone;
-
-
-
-    @ApiModelProperty(value="银行")
+    
+    
+    @ApiModelProperty(value = "银行")
     private String bank;
-
+    
     /**
      * 用户名
      */
-    @ApiModelProperty(value="银行账号姓名")
+    @ApiModelProperty(value = "银行账号姓名")
     private String bankAccountName;
-
-    @ApiModelProperty(value="银行")
+    
+    @ApiModelProperty(value = "银行")
     private String bankAccount;
-
-
+    
+    
     /**
      * 交易时间
      */
-    @ApiModelProperty(value="transTime交易时间")
+    @ApiModelProperty(value = "transTime交易时间")
     private Date transTime;
-
+    
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+    
     /**
      * 交易成功时间
      */
-    @ApiModelProperty(value="successTime交易成功时间")
+    @ApiModelProperty(value = "successTime交易成功时间")
     private Date successTime;
-
-
-
+    
+    
     /**
      * 版本号
      */
-    @ApiModelProperty(value="version版本号")
+    @ApiModelProperty(value = "version版本号")
     private String version;
-
-    @ApiModelProperty(value="日志")
+    
+    @ApiModelProperty(value = "日志")
     private List<BizLog> bizLogs;
-
+    
 }

+ 210 - 203
cif-service/src/main/java/com/txz/cif/web/mng/RechargeRecordController.java

@@ -1,4 +1,5 @@
 package com.txz.cif.web.mng;
+
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.date.DateUtil;
@@ -33,222 +34,228 @@ import java.util.List;
 import java.util.stream.Collectors;
 
 /**
-* Created by CodeGenerator on 2025/07/15.
-*/
+ * Created by CodeGenerator on 2025/07/15.
+ */
 @Api(tags = "[后台]rechargeRecord管理")
 @RestController
 @RequestMapping("/recharge/record")
 public class RechargeRecordController {
-
-	private static Logger log = LoggerFactory.getLogger(RechargeRecordController.class);
-
+    
+    private static Logger log = LoggerFactory.getLogger(RechargeRecordController.class);
+    
     @Resource
     private RechargeRecordService rechargeRecordService;
-
-	@Resource
-	private BizLogService bizLogService;
-
-	@Resource
-	private AccountService accountService;
-
-	@Resource
-	private PaymentChannelService paymentChannelService;
-	@Resource
-	private PaymentMethodService paymentMethodService;
-
-
-	@GetMapping("/detail")
-	@ApiOperation(value = "rechargeRecord获取详情",httpMethod = "GET")
+    
+    @Resource
+    private BizLogService bizLogService;
+    
+    @Resource
+    private AccountService accountService;
+    
+    @Resource
+    private PaymentChannelService paymentChannelService;
+    @Resource
+    private PaymentMethodService paymentMethodService;
+    
+    @Resource
+    private UserService userService;
+    
+    @GetMapping("/detail")
+    @ApiOperation(value = "rechargeRecord获取详情", httpMethod = "GET")
     public Result<RechargeRecordBO> detail(@RequestParam Long id) {
-    	if(id == null){
-    		return ResultGenerator.genFailResult(ResultCode.ID_IS_NULL);
-    	}
-
-    	try {
-			RechargeRecord rechargeRecord = rechargeRecordService.findById(id);
-			if (rechargeRecord == null){
-				return ResultGenerator.genFailResult(ResultCode.OBJECT_IS_NULL);
-			}
-			RechargeRecordBO bo = BeanUtil.toBean(rechargeRecord,RechargeRecordBO.class);
-			Condition c = new Condition(BizLog.class);
-			c.createCriteria().andEqualTo("bizType",1)
-					.andEqualTo("bizNo",rechargeRecord.getOrderNo());
-			List<BizLog> logs = bizLogService.findByCondition(c);
-			bo.setBizLogs(logs);
-			Account wallet = accountService.getAccount(rechargeRecord.getUserId(), 1);
-			if (wallet != null){
-				bo.setWalletBalance(wallet.getBalance());
-			}
-			Account earnings = accountService.getAccount(rechargeRecord.getUserId(), 2);
-			if (earnings != null){
-				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);
-		} 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 {
+            RechargeRecord rechargeRecord = rechargeRecordService.findById(id);
+            if (rechargeRecord == null) {
+                return ResultGenerator.genFailResult(ResultCode.OBJECT_IS_NULL);
+            }
+            User user = userService.findById(rechargeRecord.getUserId());
+            RechargeRecordBO bo = BeanUtil.toBean(rechargeRecord, RechargeRecordBO.class);
+            bo.setBank(user.getBank());
+            bo.setBankAccount(user.getBankAccount());
+            bo.setBankAccountName(user.getBankAccountName());
+            Condition c = new Condition(BizLog.class);
+            c.createCriteria().andEqualTo("bizType", 1)
+                    .andEqualTo("bizNo", rechargeRecord.getOrderNo());
+            List<BizLog> logs = bizLogService.findByCondition(c);
+            bo.setBizLogs(logs);
+            Account wallet = accountService.getAccount(rechargeRecord.getUserId(), 1);
+            if (wallet != null) {
+                bo.setWalletBalance(wallet.getBalance());
+            }
+            Account earnings = accountService.getAccount(rechargeRecord.getUserId(), 2);
+            if (earnings != null) {
+                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);
+        } catch (Exception e) {
+            log.error("查询对象操作异常e:{}", e);
+            return ResultGenerator.genFailResult(ResultCode.INTERNAL_SERVER_ERROR);
+        }
+        
     }
-
+    
     @PostMapping("/list")
-	@ApiOperation(value = "rechargeRecord获取列表",httpMethod = "POST")
+    @ApiOperation(value = "rechargeRecord获取列表", httpMethod = "POST")
     public Result<List<RechargeRecordBO>> list(@RequestBody RecordParam param) {
-
+        
         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);
-		}
+        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);
     }
-
-	@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<RechargeRecord> list = rechargeRecordService.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 (RechargeRecord temp : list) {
-					List<Object> rowA = CollUtil.newArrayList(
-							temp.getId()+"",
-							temp.getOrderNo(),
-							temp.getAmount() == null? "0":temp.getAmount().toPlainString(),
-							temp.getDiscount() == null? "0":temp.getDiscount().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("导出结束");
-		}
-	}
+    
+    @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<RechargeRecord> list = rechargeRecordService.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 (RechargeRecord temp : list) {
+                    List<Object> rowA = CollUtil.newArrayList(
+                            temp.getId() + "",
+                            temp.getOrderNo(),
+                            temp.getAmount() == null ? "0" : temp.getAmount().toPlainString(),
+                            temp.getDiscount() == null ? "0" : temp.getDiscount().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("导出结束");
+        }
+    }
 }

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

@@ -69,7 +69,7 @@ public class WithdrawRecordController {
             WithdrawRecordBO bo = BeanUtil.toBean(withdrawRecord, WithdrawRecordBO.class);
             Condition c = new Condition(BizLog.class);
             c.createCriteria().andEqualTo("bizType", 2)
-                    .andEqualTo("bizNo", withdrawRecord.getOrderNo());
+                    .andEqualTo("bizNo", withdrawRecord.getThirdOrderNo());
             List<BizLog> logs = bizLogService.findByCondition(c);
             bo.setBizLogs(logs);
             
@@ -91,7 +91,7 @@ public class WithdrawRecordController {
     
     @PostMapping("/review")
     @ApiOperation(value = "审核", httpMethod = "POST")
-    public Result review(@RequestBody ReviewParam param) {
+    public Result review(@RequestBody ReviewParam param, @RequestHeader("userName") String userName) {
         if (param == null) {
             return ResultGenerator.genFailResult(ResultCode.OBJECT_IS_NULL);
         }
@@ -114,7 +114,7 @@ public class WithdrawRecordController {
             return ResultGenerator.genFailResult(ResultCode.STATUS_IS_NULL);
         }
         
-        withdrawRecordService.review(w, param.getType() == 1 ? 2 : 3, param.getReview(), param.getChannelId());
+        withdrawRecordService.review(w, param.getType() == 1 ? 2 : 3, param.getReview(), param.getChannelId(), userName);
         // WithdrawRecord.builder().id(param.getId())
         // .review(param.getReview()).status(param.getType() == 1 ? 2 : 3).build());
         return ResultGenerator.genSuccessResult();