| | |
| | | package com.nq.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.nq.dao.SiteAdminMapper; |
| | | import com.github.pagehelper.PageHelper; |
| | |
| | | |
| | | import com.nq.pojo.UserRecharge; |
| | | |
| | | import com.nq.pojo.UserWithdraw; |
| | | import com.nq.service.IAgentUserService; |
| | | |
| | | import com.nq.service.ISiteAdminService; |
| | |
| | | |
| | | import java.util.Date; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | |
| | | @Autowired |
| | | UserWithdrawMapper userWithdrawMapper; |
| | | |
| | | |
| | | public ServerResponse login(String adminPhone, String adminPwd, String verifyCode, HttpServletRequest request) { |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public ServerResponse moneyCount(String startTime, String entTime) { |
| | | BigDecimal rechargeTotalAmount = BigDecimal.ZERO; |
| | | BigDecimal withdrawalTotalAmount = BigDecimal.ZERO; |
| | | |
| | | List<UserRecharge> userRecharges = userRechargeMapper.selectList(new LambdaQueryWrapper<UserRecharge>().eq(UserRecharge::getOrderStatus, 1) |
| | | .ge(StringUtils.isNotBlank(startTime), UserRecharge::getPayTime, startTime) |
| | | .le(StringUtils.isNotBlank(entTime), UserRecharge::getPayTime, entTime)); |
| | | List<UserWithdraw> userWithdraws = userWithdrawMapper.selectList(new LambdaQueryWrapper<UserWithdraw>().eq(UserWithdraw::getWithStatus, 1) |
| | | .ge(StringUtils.isNotBlank(startTime), UserWithdraw::getTransTime, startTime) |
| | | .le(StringUtils.isNotBlank(entTime), UserWithdraw::getTransTime, entTime)); |
| | | |
| | | for (UserRecharge userRecharge : userRecharges) { |
| | | rechargeTotalAmount = rechargeTotalAmount.add(userRecharge.getPayAmt()); |
| | | } |
| | | |
| | | for (UserWithdraw userWithdraw : userWithdraws) { |
| | | withdrawalTotalAmount = withdrawalTotalAmount.add(userWithdraw.getWithAmt()); |
| | | } |
| | | |
| | | Map<String, BigDecimal> map = new HashMap<>(); |
| | | map.put("rechargeTotalAmount", rechargeTotalAmount); |
| | | map.put("withdrawalTotalAmount", withdrawalTotalAmount); |
| | | return ServerResponse.createBySuccess(map); |
| | | } |
| | | |
| | | |
| | | |
| | | public SiteAdmin findAdminByName(String name) { |
| | | return this.siteAdminMapper.findAdminByName(name); |