From f95325fd2635a9af08c0acac70e70379978d128a Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期一, 10 七月 2023 19:10:33 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java |  131 +++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 125 insertions(+), 6 deletions(-)

diff --git a/cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java b/cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java
index c08ab90..73175a8 100644
--- a/cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java
+++ b/cloud-server-account/src/main/java/com/dsh/account/controller/UseBenefitsController.java
@@ -3,20 +3,24 @@
 
 import com.dsh.account.entity.TAppUser;
 import com.dsh.account.feignclient.other.SysLogClient;
-import com.dsh.account.model.vo.userBenefitDetail.AppUserDetailsVo;
-import com.dsh.account.model.vo.userBenefitDetail.BillingDetailsVo;
-import com.dsh.account.model.vo.userBenefitDetail.IndexOfUserBenefirVo;
+import com.dsh.account.model.vo.userBenefitDetail.*;
+import com.dsh.account.service.RechargeRecordsService;
 import com.dsh.account.service.TAppUserService;
+import com.dsh.account.service.UserIntegralChangesService;
 import com.dsh.account.util.ResultUtil;
 import com.dsh.account.util.TokenUtil;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 import java.text.SimpleDateFormat;
+import java.util.List;
 
 /**
  * 使用福利 控制器
@@ -35,6 +39,12 @@
 
     @Resource
     private SysLogClient slClient;
+
+    @Autowired
+    private RechargeRecordsService rechargeRService;
+
+    @Autowired
+    private UserIntegralChangesService uicService;
 
     private final SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd");
 
@@ -145,7 +155,7 @@
     @ApiImplicitParams({
             @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
             @ApiImplicitParam(value = "年月", name = "yearMonth", required = true, dataType = "string"),
-            @ApiImplicitParam(value = "记录id", name = "recordId", required = true, dataType = "int"),
+            @ApiImplicitParam(value = "记录(1充值 2扣除)", name = "recordId", required = true, dataType = "int"),
     })
     public ResultUtil<BillingDetailsVo> getUserBillingDetails(String yearMonth,Integer recordId){
         try {
@@ -153,7 +163,116 @@
             if(null == appUserId){
                 return ResultUtil.tokenErr();
             }
-            return ResultUtil.success(tauService.queryUserBillingDetails(yearMonth,recordId));
+            return ResultUtil.success(tauService.queryUserBillingDetails(yearMonth,recordId,appUserId));
+        }catch (Exception e){
+            return ResultUtil.runErr();
+        }
+    }
+
+
+    @ResponseBody
+    @PostMapping("/api/useBenefit/voucherDetail")
+    @ApiOperation(value = "充值明细", tags = {"APP-使用福利"})
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
+            @ApiImplicitParam(value = "年月", name = "yearMonth", required = true, dataType = "string"),
+            @ApiImplicitParam(value = "记录(1充值 2扣除)", name = "recordId", required = true, dataType = "int"),
+    })
+    public ResultUtil<RechargeDetailsVo> wpGoldRechargeRecord(String yearMonth, Integer recordId){
+        try {
+            Integer appUserId = tokenUtil.getUserIdFormRedis();
+            if(null == appUserId){
+                return ResultUtil.tokenErr();
+            }
+            return ResultUtil.success(rechargeRService.getAppUserRechargeRecord(yearMonth,recordId,appUserId));
+        }catch (Exception e){
+            return ResultUtil.runErr();
+        }
+    }
+
+
+    @ResponseBody
+    @PostMapping("/api/useBenefit/voucherCenter")
+    @ApiOperation(value = "充值中心", tags = {"APP-使用福利"})
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
+    })
+    public ResultUtil<List<RechargeCentVo>> rechargeCenterConfig(){
+        try {
+            Integer appUserId = tokenUtil.getUserIdFormRedis();
+            if(null == appUserId){
+                return ResultUtil.tokenErr();
+            }
+            return ResultUtil.success(tauService.getSysRechargeConfig(appUserId));
+        }catch (Exception e){
+            return ResultUtil.runErr();
+        }
+    }
+
+    /**
+     * 充值中心-支付
+     */
+    @ResponseBody
+    @PostMapping("/api/useBenefit/payment")
+    @ApiOperation(value = "充值中心-支付", tags = {"APP-使用福利"})
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
+    })
+    public ResultUtil rechargeCenPayment(RechargePayRequest request){
+        try {
+            Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
+            if(null == userIdFormRedis){
+                return ResultUtil.tokenErr();
+            }
+            return rechargeRService.rechargeCenPayment(userIdFormRedis,request);
+        }catch (Exception e){
+            return ResultUtil.runErr();
+        }
+
+    }
+
+
+    /**
+     * 积分商城
+     */
+    @ResponseBody
+    @PostMapping("/api/useBenefit/integralMallList")
+    @ApiOperation(value = "积分商城", tags = {"APP-使用福利"})
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
+    })
+    public ResultUtil<PointMallDetailsResponse> pointsMallList(MallRequest request){
+        try {
+            Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
+            if(null == userIdFormRedis){
+                return ResultUtil.tokenErr();
+            }
+            // TODO: 2023/7/10 积分商品列表查询
+            return ResultUtil.success();
+        }catch (Exception e){
+            return ResultUtil.runErr();
+        }
+    }
+
+
+    /**
+     * 积分明细
+     */
+    @ResponseBody
+    @PostMapping("/api/useBenefit/integralDetails")
+    @ApiOperation(value = "积分明细", tags = {"APP-使用福利"})
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."),
+            @ApiImplicitParam(value = "年月", name = "yearMonth", required = true, dataType = "string"),
+            @ApiImplicitParam(value = "记录(1充值 2扣除)", name = "recordId", required = true, dataType = "int"),
+    })
+    public ResultUtil<IntegralDetailsResponse> pointDetails(String yearMonth, Integer recordId){
+        try {
+            Integer userIdFormRedis = tokenUtil.getUserIdFormRedis();
+            if(null == userIdFormRedis){
+                return ResultUtil.tokenErr();
+            }
+            return ResultUtil.success(uicService.queryUserPointsDetails(yearMonth,recordId,userIdFormRedis));
         }catch (Exception e){
             return ResultUtil.runErr();
         }

--
Gitblit v1.7.1