|
|
|
@ -1,28 +1,32 @@ |
|
|
|
package com.example.demo.serviceImpl.cash; |
|
|
|
|
|
|
|
import com.example.demo.Util.JWTUtil; |
|
|
|
import com.example.demo.config.RabbitMQConfig; |
|
|
|
import com.example.demo.domain.entity.CashRecord; |
|
|
|
import com.example.demo.domain.entity.GOrder; |
|
|
|
import com.example.demo.domain.entity.RechargeActivity; |
|
|
|
import com.example.demo.domain.entity.User; |
|
|
|
import com.example.demo.domain.entity.*; |
|
|
|
import com.example.demo.domain.vo.cash.CashCollection; |
|
|
|
import com.example.demo.domain.vo.cash.CashCollectionMessage; |
|
|
|
import com.example.demo.domain.vo.coin.GoldUser; |
|
|
|
import com.example.demo.domain.vo.coin.Result; |
|
|
|
import com.example.demo.mapper.cash.CashCollectionMapper; |
|
|
|
import com.example.demo.mapper.coin.MarketMapper; |
|
|
|
import com.example.demo.mapper.coin.UserMapper; |
|
|
|
import com.example.demo.service.cash.CashCollectionService; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import jakarta.servlet.http.HttpServletRequest; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
import org.springframework.web.context.request.RequestContextHolder; |
|
|
|
import org.springframework.web.context.request.ServletRequestAttributes; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.ZoneOffset; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.UUID; |
|
|
|
|
|
|
|
@ -41,6 +45,8 @@ public class CashCollectionServiceImpl implements CashCollectionService { |
|
|
|
@Autowired |
|
|
|
private CashCollectionMapper cashCollectionMapper; |
|
|
|
@Autowired |
|
|
|
private UserMapper userMapper; |
|
|
|
@Autowired |
|
|
|
private MarketMapper marketMapper; |
|
|
|
@Autowired |
|
|
|
private RabbitTemplate rabbitTemplate; |
|
|
|
@ -308,15 +314,34 @@ public class CashCollectionServiceImpl implements CashCollectionService { |
|
|
|
} |
|
|
|
|
|
|
|
//根据精网号查询姓名和地区 |
|
|
|
@Override |
|
|
|
public User getNameAndMarket(Integer jwcode) { |
|
|
|
@Override |
|
|
|
public User getNameAndMarket(Integer jwcode) { |
|
|
|
try { |
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); |
|
|
|
String token = request.getHeader("token"); |
|
|
|
Admin admin = (Admin) JWTUtil.getUserDetailsList(String.valueOf(token), Admin.class); |
|
|
|
if (admin != null) { |
|
|
|
List<String> list = Arrays.asList(admin.getMarkets().split(",")); |
|
|
|
List<String> markets = marketMapper.getMarketIds(list); |
|
|
|
if (markets.contains("9") || markets.contains("9999")) { |
|
|
|
markets = null; |
|
|
|
} |
|
|
|
GoldUser gUser = userMapper.selectUserCard(jwcode.toString(), markets); |
|
|
|
if (gUser != null) { |
|
|
|
User user = new User(); |
|
|
|
user.setMarket(cashCollectionMapper.getMarketByJwcode(jwcode)); |
|
|
|
user.setName(cashCollectionMapper.getNameByJwcode(jwcode)); |
|
|
|
user.setMarketName(cashCollectionMapper.getMarketNameByJwcode(jwcode)); |
|
|
|
|
|
|
|
return user; |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
|
|
|
|
// 如果没有返回有效用户信息,则抛出异常 |
|
|
|
throw new RuntimeException("无法获取用户信息"); |
|
|
|
} |
|
|
|
|
|
|
|
//获取收款活动列表 |
|
|
|
@Override |
|
|
|
|