From b967bac24b2fd662ac3b8826700fb76c26690aec Mon Sep 17 00:00:00 2001
From: zyy3 <zyy3@zy.com>
Date: Tue, 02 Dec 2025 00:27:56 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 trading-order-service/src/main/java/com/yami/trading/service/impl/UserServiceImpl.java |   37 ++++++++++++++++++++++++++-----------
 1 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/trading-order-service/src/main/java/com/yami/trading/service/impl/UserServiceImpl.java b/trading-order-service/src/main/java/com/yami/trading/service/impl/UserServiceImpl.java
index 381dc73..95cb1f0 100644
--- a/trading-order-service/src/main/java/com/yami/trading/service/impl/UserServiceImpl.java
+++ b/trading-order-service/src/main/java/com/yami/trading/service/impl/UserServiceImpl.java
@@ -9,6 +9,7 @@
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.yami.trading.bean.constans.UserConstants;
 import com.yami.trading.bean.model.*;
+import com.yami.trading.bean.rate.domain.ExchangeRate;
 import com.yami.trading.bean.syspara.domain.Syspara;
 import com.yami.trading.bean.syspara.dto.SysparasDto;
 import com.yami.trading.bean.user.dto.AgentUserDto;
@@ -25,6 +26,7 @@
 import com.yami.trading.service.OnlineUserService;
 import com.yami.trading.service.WalletService;
 import com.yami.trading.service.data.DataService;
+import com.yami.trading.service.rate.ExchangeRateService;
 import com.yami.trading.service.syspara.SysparaService;
 import com.yami.trading.service.system.LogService;
 import com.yami.trading.service.user.*;
@@ -70,6 +72,9 @@
     @Autowired
     WalletLogService walletLogService;
 
+    @Autowired
+    ExchangeRateService exchangeRateService;
+
     /**
      * UserCode生成并发锁
      */
@@ -96,9 +101,9 @@
 
     @Override
     public Page<UserDto> listUser(Page page, List<String> roleNames, String userCode, String userName,
-        String userMail, String userMobile, List<String> checkedList) {
+        String userMail, String userMobile, List<String> checkedList, String recomUserName) {
 
-        Page<UserDto> userDtoPage = baseMapper.listUser(page, roleNames, userCode, userName, userMail, userMobile, checkedList);
+        Page<UserDto> userDtoPage = baseMapper.listUser(page, roleNames, userCode, userName, userMail, userMobile, checkedList, recomUserName);
 
         // 提现限制流水开启后,提现判断用的用户当前流水是使用UserData表的当日流水1还是使用Party表里的用户当前流水2
         String withdraw_limit_open_use_type = this.sysparaService.find("withdraw_limit_open_use_type").getSvalue();
@@ -145,9 +150,9 @@
     }
 
     @Override
-    public Page<UserDataDto> listUserAndRecom(Page page, List<String> roleNames, String userCode, String userName, String lastIp, List<String> checkedList, String userMail, String userMobile) {
+    public Page<UserDataDto> listUserAndRecom(Page page, List<String> roleNames, String userCode, String userName, String lastIp, List<String> checkedList, String userMail, String userMobile, String recomUserName) {
         return baseMapper.listUserAndRecom(page, roleNames, userCode,
-                userName, lastIp, checkedList, userMail, userMobile);
+                userName, lastIp, checkedList, userMail, userMobile, recomUserName);
     }
 
     @Override
@@ -182,12 +187,22 @@
     @Override
     public void saveResetCreateOrder(String partyId, double money_revise, String safeword, String operator_name, String reset_type, String ip, String coin_type) {
 
-        if (money_revise == 0 || coin_type == "") {
+        if (money_revise == 0 || coin_type.equalsIgnoreCase("")) {
             return;
         }
 
-        if ("usdt".equals(coin_type)) {
+        if ("usdt".equalsIgnoreCase(coin_type) || "eur".equalsIgnoreCase(coin_type) || "gbp".equalsIgnoreCase(coin_type)) {
             // 交易所修改usdt
+            //到账金额
+            double toAmt = money_revise;
+            if (!coin_type.equalsIgnoreCase("usdt")) {
+                ExchangeRate exchangeRate = exchangeRateService.findBy(ExchangeRate.IN, coin_type.toUpperCase());
+                if (exchangeRate == null) {
+                    throw new YamiShopBindException("汇率未设置!");
+                }
+                BigDecimal amt = BigDecimal.valueOf(money_revise).divide(exchangeRate.getRata(), 8, RoundingMode.HALF_UP);
+                money_revise = amt.doubleValue();
+            }
 
             User party = getById(partyId);
 //			if (party!=null&&!Constants.SECURITY_ROLE_GUEST.equals(party.getRolename())) {
@@ -214,10 +229,10 @@
             MoneyLog moneyLog = new MoneyLog();
             moneyLog.setCategory(Constants.MONEYLOG_CATEGORY_COIN);
             moneyLog.setAmountBefore(new BigDecimal(amount_before));
-            moneyLog.setAmount(new BigDecimal(money_revise));
-            moneyLog.setAmountAfter(new BigDecimal(Arith.add(wallet.getMoney().doubleValue(), money_revise)));
+            moneyLog.setAmount(new BigDecimal(toAmt));
+            moneyLog.setAmountAfter(BigDecimal.valueOf(Arith.add(amount_before, money_revise)));
             moneyLog.setUserId(partyId);
-            moneyLog.setWalletType(Constants.WALLET);
+            moneyLog.setWalletType(coin_type.toUpperCase());
             moneyLog.setContent_type(Constants.MONEYLOG_CONTENT_RECHARGE);
             moneyLog.setContentType(Constants.MONEYLOG_CONTENT_RECHARGE);
             moneyLog.setCreateTime(new Date());
@@ -1251,7 +1266,7 @@
         if (!user.isGoogleAuthBind()) {
             throw new YamiShopBindException("用户谷歌验证码未绑定!");
         }
-        GoogleAuthenticator ga = new GoogleAuthenticator();
+        /*GoogleAuthenticator ga = new GoogleAuthenticator();
         ga.setWindowSize(5);
         long t = System.currentTimeMillis();
         boolean flag = ga.check_code(user.getGoogleAuthSecret(), Long.valueOf(googleAuthCode), t);
@@ -1260,7 +1275,7 @@
         }
         if (!passwordEncoder.matches(loginSafeword, user.getSafePassword())) {
             throw new YamiShopBindException("登录人资金密码错误");
-        }
+        }*/
         user.setGoogleAuthBind(false);
         user.setGoogleAuthSecret("");
         updateById(user);

--
Gitblit v1.9.3