Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

Mr.qian 2 viikkoa sitten
vanhempi
sitoutus
455cc04a5f

+ 5 - 0
cif-service/src/main/java/com/txz/cif/web/bo/RechargeRecordBO.java

@@ -59,6 +59,11 @@ public class RechargeRecordBO {
     @ApiModelProperty(value="channel渠道")
     private String channel;
 
+    @ApiModelProperty(value="支付通道")
+    private String channelName;
+    @ApiModelProperty(value="支付方式")
+    private String methodName;
+
     /**
      * 币种
      */

+ 40 - 8
cif-service/src/main/java/com/txz/cif/web/mng/RechargeRecordController.java

@@ -7,12 +7,8 @@ import cn.hutool.poi.excel.ExcelUtil;
 import cn.hutool.poi.excel.ExcelWriter;
 import com.txz.cif.core.Result;
 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;
 
@@ -34,6 +30,7 @@ import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletResponse;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
 * Created by CodeGenerator on 2025/07/15.
@@ -53,7 +50,14 @@ public class RechargeRecordController {
 
 	@Resource
 	private AccountService accountService;
-    @GetMapping("/detail")
+
+	@Resource
+	private PaymentChannelService paymentChannelService;
+	@Resource
+	private PaymentMethodService paymentMethodService;
+
+
+	@GetMapping("/detail")
 	@ApiOperation(value = "rechargeRecord获取详情",httpMethod = "GET")
     public Result<RechargeRecordBO> detail(@RequestParam Long id) {
     	if(id == null){
@@ -79,6 +83,18 @@ public class RechargeRecordController {
 			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);
@@ -89,7 +105,7 @@ public class RechargeRecordController {
 
     @PostMapping("/list")
 	@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());
 
@@ -126,6 +142,22 @@ public class RechargeRecordController {
 			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);