From 78262545593c52fa75aa1072b864121cb918897c Mon Sep 17 00:00:00 2001
From: zj <1772600164@qq.com>
Date: Wed, 13 Aug 2025 01:28:44 +0800
Subject: [PATCH] 1

---
 trading-order-service/src/main/java/com/yami/trading/service/system/impl/TipServiceImpl.java               |    6 ---
 trading-order-service/src/main/java/com/yami/trading/service/impl/WithdrawServiceImpl.java                 |   40 +++++++++----------
 trading-order-security-common/src/main/java/com/yami/trading/security/common/enums/CryptoCurrencyEnum.java |    5 +-
 trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiWithdrawController.java               |   28 +++++++-------
 trading-order-admin/src/main/java/com/yami/trading/api/service/impl/UserCacheServiceImpl.java              |    2 
 trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiC2cOrderController.java               |    2 
 trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiContractApplyOrderController.java     |    4 +-
 trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiBankCardController.java               |    4 +-
 trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiFuturesOrderController.java           |    2 
 trading-order-service/src/main/java/com/yami/trading/service/contract/ContractApplyOrderService.java       |    2 
 trading-order-service/src/main/resources/mapper/UserMapper.xml                                             |    9 ++--
 trading-order-common/src/main/java/com/yami/trading/common/constants/TipConstants.java                     |    2 
 12 files changed, 49 insertions(+), 57 deletions(-)

diff --git a/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiBankCardController.java b/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiBankCardController.java
index 80de65c..e5bf2e2 100644
--- a/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiBankCardController.java
+++ b/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiBankCardController.java
@@ -243,7 +243,7 @@
             throw new YamiShopBindException("无权限");
         }
         if (!party.isEnabled()) {
-            throw new YamiShopBindException("用户已锁定");
+            throw new YamiShopBindException("User is locked");
         }
         // 手续费
         double fee = 0;
@@ -461,7 +461,7 @@
             throw new YamiShopBindException("无权限");
         }
         if (!party.isEnabled()) {
-            throw new YamiShopBindException("用户已锁定");
+            throw new YamiShopBindException("User is locked");
         }
         C2cOrder order = this.c2cOrderService.get(order_no);
         if (null == order || !order.getPartyId().equals(SecurityUtils.getUser().getUserId())) {
diff --git a/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiC2cOrderController.java b/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiC2cOrderController.java
index 8af5151..98a3680 100644
--- a/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiC2cOrderController.java
+++ b/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiC2cOrderController.java
@@ -125,7 +125,7 @@
 
             if (!party.isEnabled()) {
 
-                return Result.succeed("用户已锁定");
+                return Result.succeed("User is locked");
             }
 
             // C2C用户未结束订单最大数量
diff --git a/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiContractApplyOrderController.java b/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiContractApplyOrderController.java
index 11f9369..bb144e5 100644
--- a/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiContractApplyOrderController.java
+++ b/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiContractApplyOrderController.java
@@ -264,7 +264,7 @@
     private void checkUserStatus(String partyId) {
         User user = userService.getById(partyId);
         if (!user.isEnabled()) {
-            throw new YamiShopBindException("用户已锁定");
+            throw new YamiShopBindException("User is locked");
         }
     }
 
@@ -319,7 +319,7 @@
         try {
             User user = userService.getById(partyId);
             if (!user.isEnabled()) {
-                throw new YamiShopBindException("用户已锁定");
+                throw new YamiShopBindException("User is locked");
             }
 
             Syspara syspara = sysparaService.find("stop_user_internet");
diff --git a/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiFuturesOrderController.java b/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiFuturesOrderController.java
index 7457f87..43f0d54 100644
--- a/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiFuturesOrderController.java
+++ b/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiFuturesOrderController.java
@@ -154,7 +154,7 @@
             this.sessionTokenService.del(session_token);
             User party = this.partyService.findUserByUserCode(partyId);
             if (!party.isEnabled()) {
-                throw new YamiShopBindException("用户已锁定");
+                throw new YamiShopBindException("User is locked");
             }
             if (null == object || !party.getUserId().equals((String) object)) {
                 throw new BusinessException("请稍后再试");
diff --git a/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiWithdrawController.java b/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiWithdrawController.java
index 384d8ca..6ec4118 100644
--- a/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiWithdrawController.java
+++ b/trading-order-admin/src/main/java/com/yami/trading/api/controller/ApiWithdrawController.java
@@ -90,25 +90,25 @@
             throw new YamiShopBindException("系统参数错误");
         }
 
-        if ("true".equals(exchange_withdraw_need_safeword)) {
-
-            if (StringUtils.isEmptyString(safeword)) {
-                throw new YamiShopBindException("资金密码不能为空");
-            }
-
-            if (safeword.length() < 6 || safeword.length() > 12) {
-                throw new YamiShopBindException("资金密码必须6-12位");
-            }
-            if (!userService.checkLoginSafeword(SecurityUtils.getUser().getUserId(),safeword)){
-                throw new YamiShopBindException("资金密码错误");
-            }
-        }
+//        if ("true".equals(exchange_withdraw_need_safeword)) {
+//
+//            if (StringUtils.isEmptyString(safeword)) {
+//                throw new YamiShopBindException("资金密码不能为空");
+//            }
+//
+//            if (safeword.length() < 6 || safeword.length() > 12) {
+//                throw new YamiShopBindException("资金密码必须6-12位");
+//            }
+//            if (!userService.checkLoginSafeword(SecurityUtils.getUser().getUserId(),safeword)){
+//                throw new YamiShopBindException("资金密码错误");
+//            }
+//        }
 
         // 获取资金账户(capital)
         CapitaltWallet capitaltWallet = capitaltWalletService.getOne(new LambdaQueryWrapper<>(CapitaltWallet.class)
                 .eq(CapitaltWallet::getUserId, partyId).last(" limit 1 "));
         if(capitaltWallet.getMoney().compareTo(new BigDecimal(amount)) < 0){
-            throw new YamiShopBindException("可提现余额不足!");
+            throw new YamiShopBindException("Insufficient available balance for withdrawal!");
         }
 
         this.sessionTokenService.del(session_token);
diff --git a/trading-order-admin/src/main/java/com/yami/trading/api/service/impl/UserCacheServiceImpl.java b/trading-order-admin/src/main/java/com/yami/trading/api/service/impl/UserCacheServiceImpl.java
index f98889a..bb0e5cc 100644
--- a/trading-order-admin/src/main/java/com/yami/trading/api/service/impl/UserCacheServiceImpl.java
+++ b/trading-order-admin/src/main/java/com/yami/trading/api/service/impl/UserCacheServiceImpl.java
@@ -38,7 +38,7 @@
         String userId = SecurityUtils.getUser().getUserId();
         User user = userService.getById(userId);
         if (!user.isEnabled()) {
-            throw new YamiShopBindException("用户已锁定");
+            throw new YamiShopBindException("User is locked");
         }
         return user;
     }
diff --git a/trading-order-common/src/main/java/com/yami/trading/common/constants/TipConstants.java b/trading-order-common/src/main/java/com/yami/trading/common/constants/TipConstants.java
index cb74aea..0ca1775 100644
--- a/trading-order-common/src/main/java/com/yami/trading/common/constants/TipConstants.java
+++ b/trading-order-common/src/main/java/com/yami/trading/common/constants/TipConstants.java
@@ -76,7 +76,6 @@
      * 用户客服模块
      */
     public static final String ONLINECHAT = "OP_ADMIN_ONLINECHAT";
-
     /**
      * 活动申请模块
      */
@@ -113,6 +112,7 @@
 
     static {
         MESSAGE_MAP.put(RECHARGE_BLOCKCHAIN, "您有{0}条新的区块链充值订单");
+        MESSAGE_MAP.put(CONTRACT_ORDER, "您有{0}条新的永续合约订单");
         MESSAGE_MAP.put(RECHARGE, "您有{0}条新的三方充值订单");
         MESSAGE_MAP.put(WITHDRAW, "您有{0}条新的提现订单");
         MESSAGE_MAP.put(KYC, "您有{0}条新的基础认证");
diff --git a/trading-order-security-common/src/main/java/com/yami/trading/security/common/enums/CryptoCurrencyEnum.java b/trading-order-security-common/src/main/java/com/yami/trading/security/common/enums/CryptoCurrencyEnum.java
index 6f0b057..b1ba821 100644
--- a/trading-order-security-common/src/main/java/com/yami/trading/security/common/enums/CryptoCurrencyEnum.java
+++ b/trading-order-security-common/src/main/java/com/yami/trading/security/common/enums/CryptoCurrencyEnum.java
@@ -15,9 +15,10 @@
     USDT_ERC20("usdt", "ERC20","usdt_erc20"),
     ETH("eth", "ETH","eth"),
     BTC("btc", "BTC","btc"),
-    USDC_TRC20("usdc", "TRC20","usdc_trc20"),
     USDC_ERC20("usdc", "ERC20(1)","usdc_erc20(1)"),
-    USDC_ERC202("usdc", "ERC20(2)","usdc_erc20(2)");
+    USDC_ERC202("usdc", "ERC20(2)","usdc_erc20(2)"),
+    USDC_TRC20("usdc", "TRC20","usdc_trc20");
+
 
     private final String coin;
     private final String chain;
diff --git a/trading-order-service/src/main/java/com/yami/trading/service/contract/ContractApplyOrderService.java b/trading-order-service/src/main/java/com/yami/trading/service/contract/ContractApplyOrderService.java
index 7edae99..3ec63b0 100644
--- a/trading-order-service/src/main/java/com/yami/trading/service/contract/ContractApplyOrderService.java
+++ b/trading-order-service/src/main/java/com/yami/trading/service/contract/ContractApplyOrderService.java
@@ -233,7 +233,7 @@
         BigDecimal totalAmountCost = order.getDeposit().add(order.getFee());
 
         if (amountBefore.compareTo(totalAmountCost) < 0) {
-            throw new YamiShopBindException("余额不足");
+            throw new YamiShopBindException("not sufficient funds");
         }
 
         //如果是限价单先扣钱
diff --git a/trading-order-service/src/main/java/com/yami/trading/service/impl/WithdrawServiceImpl.java b/trading-order-service/src/main/java/com/yami/trading/service/impl/WithdrawServiceImpl.java
index b659dc8..c31b132 100644
--- a/trading-order-service/src/main/java/com/yami/trading/service/impl/WithdrawServiceImpl.java
+++ b/trading-order-service/src/main/java/com/yami/trading/service/impl/WithdrawServiceImpl.java
@@ -219,7 +219,7 @@
     public void saveApplyOtherChannel(Withdraw withdraw, String symbol) {
         User party = userService.getById(withdraw.getUserId());
         if (Constants.SECURITY_ROLE_TEST.equals(party.getRoleName())) {
-            throw new YamiShopBindException("无权限");
+            throw new YamiShopBindException("no access");
         }
         RealNameAuthRecord party_kyc = realNameAuthRecordService.getByUserId(withdraw.getUserId());
         HighLevelAuthRecord party_kycHighLevel = highLevelAuthRecordService.findByUserId(withdraw.getUserId());
@@ -230,12 +230,12 @@
             party_kyc=new  RealNameAuthRecord();
         }
         if (!(party_kyc.getStatus() == 2) && "true".equals(sysparaService.find("withdraw_by_kyc").getSvalue())) {
-            throw new YamiShopBindException("未基础认证");
+            throw new YamiShopBindException("Not yet certified at the basic level");
         }
         double withdraw_by_high_kyc = Double.valueOf(sysparaService.find("withdraw_by_high_kyc").getSvalue());
         if (withdraw_by_high_kyc > 0 && withdraw.getVolume().doubleValue() > withdraw_by_high_kyc
                 && !(party_kycHighLevel.getStatus() == 2)) {
-            throw new YamiShopBindException("请先通过高级认证");
+            throw new YamiShopBindException("Please go through the advanced certification process first.");
         }
 //        if (!party.isWithdrawAuthority()) {
 //            throw new YamiShopBindException("无权限");
@@ -245,15 +245,15 @@
         }
         WalletExtend walletExtend = walletService.saveExtendByPara(party.getUserId(), symbol);
         if (walletExtend.getAmount() < withdraw.getVolume().doubleValue()) {
-            throw new YamiShopBindException("余额不足");
+            throw new YamiShopBindException("not sufficient funds");
         }
         String withdraw_limit = sysparaService.find("withdraw_limit_" + symbol).getSvalue();
         if (withdraw.getVolume().doubleValue() < Double.valueOf(withdraw_limit)) {
-            throw new YamiShopBindException("提现不得小于限额");
+            throw new YamiShopBindException("Withdrawal amount must not be less than the limit.");
         }
         String withdraw_limit_max = sysparaService.find("withdraw_limit_max").getSvalue();
         if (withdraw.getVolume().doubleValue() > Double.valueOf(withdraw_limit_max)) {
-            throw new YamiShopBindException("提现不得大于限额");
+            throw new YamiShopBindException("Withdrawal amount cannot exceed the limit.");
         }
         /**
          * 当日提现次数是否超过
@@ -262,7 +262,7 @@
         List<Withdraw> withdraw_days = findAllByDate(withdraw.getUserId().toString());
         if (withdraw_limit_num > 0 && withdraw_days != null) {
             if (withdraw_days.size() >= withdraw_limit_num) {
-                throw new YamiShopBindException("当日可提现次数不足");
+                throw new YamiShopBindException("The number of times funds can be withdrawn on the same day is insufficient.");
             }
         }
         /**
@@ -277,7 +277,7 @@
             //
             String dateString = sdf.format(date);
             if (dateString.compareTo(withdraw_time[0]) < 0 || dateString.compareTo(withdraw_time[1]) > 0) {
-                throw new YamiShopBindException("不在可提现时间内");
+                throw new YamiShopBindException("Not within the available withdrawal period");
             }
         }
         /**
@@ -431,10 +431,10 @@
     public void saveApply(Withdraw withdraw, String channel, String method_id) {
         withdraw.setMethod(channel);
         if (channel.indexOf("BTC") != -1) {
-            saveApplyOtherChannel(withdraw, "btc");
+            saveApplyOtherChannel(withdraw, "btcusdt");
             return;
         } else if (channel.indexOf("ETH") != -1) {
-            saveApplyOtherChannel(withdraw, "eth");
+            saveApplyOtherChannel(withdraw, "ethusdt");
             return;
         }
         User party = userService.getById(withdraw.getUserId());
@@ -483,7 +483,7 @@
         CapitaltWallet capitaltWallet = capitaltWalletService.getOne(new LambdaQueryWrapper<>(CapitaltWallet.class)
                 .eq(CapitaltWallet::getUserId, withdraw.getUserId()).last(" limit 1 "));
         if (capitaltWallet.getMoney().doubleValue() < withdraw.getVolume().doubleValue()) {
-            throw new YamiShopBindException("余额不足");
+            throw new YamiShopBindException("not sufficient funds");
         }
         // 手续费(USDT)
         /**
@@ -520,11 +520,11 @@
         }
         String withdraw_limit = sysparaService.find("withdraw_limit").getSvalue();
         if (withdraw.getVolume().doubleValue() < Double.valueOf(withdraw_limit)) {
-            throw new YamiShopBindException("提现不得小于限额");
+            throw new YamiShopBindException("Withdrawal amount must not be less than the limit.");
         }
         String withdraw_limit_max = sysparaService.find("withdraw_limit_max").getSvalue();
         if (withdraw.getVolume().doubleValue() > Double.valueOf(withdraw_limit_max)) {
-            throw new YamiShopBindException("提现不得大于限额");
+            throw new YamiShopBindException("Withdrawal amount must not be less than the withdrawal limit and must not exceed the withdrawal limit.");
         }
         /**
          * 当日提现次数是否超过
@@ -533,7 +533,7 @@
         List<Withdraw> withdraw_days = findAllByDate(withdraw.getUserId().toString());
         if (withdraw_limit_num > 0 && withdraw_days != null) {
             if (withdraw_days.size() >= withdraw_limit_num) {
-                throw new YamiShopBindException("当日可提现次数不足");
+                throw new YamiShopBindException("The number of times funds can be withdrawn on the same day is insufficient.");
             }
         }
         /**
@@ -548,7 +548,7 @@
             //
             String dateString = sdf.format(date);
             if (dateString.compareTo(withdraw_time[0]) < 0 || dateString.compareTo(withdraw_time[1]) > 0) {
-                throw new YamiShopBindException("不在可提现时间内");
+                throw new YamiShopBindException("Not within the available withdrawal period");
             }
         }
         /**
@@ -651,9 +651,9 @@
             withdraw.setMethod(channel);
         }
         else if ("OTC".equals(channel)) {
-            throw new YamiShopBindException("渠道未开通");
+            throw new YamiShopBindException("Channel not activated");
         } else {
-            throw new YamiShopBindException("渠道未开通");
+            throw new YamiShopBindException("Channel not activated");
         }
         log.info("========================getOrderNo=======11111111=============================================");
 
@@ -675,11 +675,9 @@
 
 
         if(ObjectUtil.isEmpty(capitaltWallet)){
-            throw new YamiShopBindException("用户资金账户不存在!");
+            throw new YamiShopBindException("The user's funds account does not exist!");
         }
-        capitaltWalletService.update(new LambdaUpdateWrapper<CapitaltWallet>()
-                .set(CapitaltWallet::getMoney,new BigDecimal(Arith.sub(capitaltWallet.getMoney().doubleValue(), amount_before)))
-                .eq(CapitaltWallet::getUserId,capitaltWallet.getUserId()));
+        capitaltWalletService.update(capitaltWallet,-withdraw.getAmount().doubleValue());
 
         save(withdraw);
 
diff --git a/trading-order-service/src/main/java/com/yami/trading/service/system/impl/TipServiceImpl.java b/trading-order-service/src/main/java/com/yami/trading/service/system/impl/TipServiceImpl.java
index 7c242bb..8f86c76 100644
--- a/trading-order-service/src/main/java/com/yami/trading/service/system/impl/TipServiceImpl.java
+++ b/trading-order-service/src/main/java/com/yami/trading/service/system/impl/TipServiceImpl.java
@@ -328,11 +328,6 @@
         // 根据权限列表,判定是否有模块的通知权限
         List<String> resourceIds = this.userAuth(username);
         List<Tip> filterNewTips = filterTips(username, lastTimeStamp);
-
-//        System.out.println("username = " + username);
-//        System.out.println("resourceIds = " + resourceIds);
-//        System.out.println("filterNewTips = " + filterNewTips);
-
         if (CollectionUtils.isEmpty(filterNewTips)) {
             return result;
         }
@@ -357,7 +352,6 @@
         CollectionUtils.filter(tipList, new Predicate() {// 过滤查找新生成的通知数据
             @Override
             public boolean evaluate(Object paramObject) {
-                // TODO Auto-generated method stub
                 Tip tip = (Tip) paramObject;
                 if (TipConstants.MUST_USERNAME_MODEL.containsKey(tip.getModel())) {
                     if (StringUtils.isNotEmpty(tip.getTargetUsername()) && username.equals(tip.getTargetUsername())) {
diff --git a/trading-order-service/src/main/resources/mapper/UserMapper.xml b/trading-order-service/src/main/resources/mapper/UserMapper.xml
index 6a97229..4871ca0 100644
--- a/trading-order-service/src/main/resources/mapper/UserMapper.xml
+++ b/trading-order-service/src/main/resources/mapper/UserMapper.xml
@@ -45,12 +45,11 @@
             #{r}
         </foreach>
 
-        <if test="userCode!=null and userCode!=''">
-            and u.user_code=#{userCode}
-        </if>
-
+<!--        <if test="userCode!=null and userCode!=''">-->
+<!--            and u.user_code=#{userCode}-->
+<!--        </if>-->
         <if test="userName!=null and userName!=''">
-            and u.user_name=#{userName}
+            and u.user_name=#{userName} or  u.user_code=#{userName}
         </if>
 
         <if test="checkedList!=null">

--
Gitblit v1.9.3