Browse Source

提现导出修改

liweifan 3 years ago
parent
commit
f8cc1d28d5

+ 7 - 8
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/controller/UserWithdrawalController.java

@@ -6,9 +6,6 @@ import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
 import com.yonge.cooleshow.auth.api.entity.SysUser;
 import com.yonge.cooleshow.biz.dal.dto.excel.UserWithdrawalExport;
 import com.yonge.cooleshow.biz.dal.dto.req.AuthOperaReq;
-import com.yonge.cooleshow.biz.dal.support.DistributedLock;
-import com.yonge.cooleshow.common.enums.CacheNameEnum;
-import com.yonge.toolset.base.exception.BizException;
 import com.yonge.toolset.mybatis.support.PageUtil;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
@@ -16,7 +13,6 @@ import com.yonge.toolset.base.page.PageInfo;
 import com.yonge.toolset.utils.easyexcel.*;
 import io.swagger.annotations.*;
 import org.apache.commons.beanutils.BeanUtils;
-import org.redisson.api.RedissonClient;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -25,12 +21,10 @@ import org.springframework.web.bind.annotation.*;
 import com.yonge.cooleshow.biz.dal.vo.UserWithdrawalVo;
 import com.yonge.cooleshow.biz.dal.dto.search.TeacherWithdrawalSearch;
 import com.yonge.cooleshow.biz.dal.service.UserWithdrawalService;
-import springfox.documentation.annotations.ApiIgnore;
 
 import javax.validation.Valid;
 import java.lang.reflect.InvocationTargetException;
 import java.util.*;
-import java.util.concurrent.TimeUnit;
 
 @RestController
 @RequestMapping("/userWithdrawal")
@@ -40,8 +34,7 @@ public class UserWithdrawalController extends BaseController {
     private SysUserFeignService sysUserFeignService;
     @Autowired
     private UserWithdrawalService userWithdrawalService;
-    @Autowired
-    private RedissonClient redissonClient;
+
     /**
      * 查询单条
      */
@@ -87,6 +80,12 @@ public class UserWithdrawalController extends BaseController {
                 "列表数据");
     }
 
+    @GetMapping("/totalAmount")
+    @ApiOperation(value = "统计金额")
+    @PreAuthorize("@pcs.hasPermissions('userWithdrawal/totalAmount')")
+    public HttpResponseResult<UserWithdrawalVo> totalAmount() {
+        return succeed(userWithdrawalService.totalAmount());
+    }
 
     @PostMapping("/doAuth")
     @ApiOperation(value = "审核", notes = "传入authOperaReq")

+ 5 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/UserWithdrawalDao.java

@@ -49,5 +49,9 @@ public interface UserWithdrawalDao extends BaseMapper<UserWithdrawal> {
      */
     Integer getNowDayWithdrawalCount(@Param("userId") Long userId);
 
-
+    /**
+     * 统计金额
+     * @return
+     */
+    UserWithdrawalVo totalAmount();
 }

+ 6 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/UserWithdrawalService.java

@@ -99,6 +99,12 @@ public interface UserWithdrawalService extends IService<UserWithdrawal> {
      */
     HttpResponseResult<Boolean> transferAccount(AuthOperaReq authOperaReq, SysUser user);
 
+    /**
+     * 统计金额
+     * @return
+     */
+    UserWithdrawalVo totalAmount();
+
 
     /***
      * 导入

+ 5 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/UserWithdrawalServiceImpl.java

@@ -310,6 +310,11 @@ public class UserWithdrawalServiceImpl extends ServiceImpl<UserWithdrawalDao, Us
         }
     }
 
+    @Override
+    public UserWithdrawalVo totalAmount() {
+        return baseMapper.totalAmount();
+    }
+
 
     @Override
     @Transactional(rollbackFor = Exception.class)

+ 5 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/UserWithdrawalMapper.xml

@@ -143,4 +143,9 @@
           and auth_status_ in ('DOING','PASS') and trade_status_ != 'failed'
         and to_days(create_time_) = to_days(now())
     </select>
+
+    <select id="totalAmount" resultType="com.yonge.cooleshow.biz.dal.vo.UserWithdrawalVo">
+        select sum(actual_amount_) as actual_amount_ from user_withdrawal
+        where auth_status_ = 'DOING'
+    </select>
 </mapper>