From 3cd5a88ce846894d82f83daf967b424d0bf841db Mon Sep 17 00:00:00 2001
From: zyy <zyy@email.com>
Date: Mon, 20 Oct 2025 16:05:50 +0800
Subject: [PATCH] C2C

---
 trading-order-service/src/main/java/com/yami/trading/service/impl/UserServiceImpl.java |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 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 0bf03e1..ea4d3b6 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
@@ -694,6 +694,10 @@
             if (StringUtils.isEmptyString(username) || username.length() > 20) {
                 throw new YamiShopBindException("请输入正确的手机号码");
             }
+            User partyPhone = findPartyByVerifiedPhone(username);
+            if (null != partyPhone) {
+                throw new YamiShopBindException("电话号码已绑定其他用户");
+            }
             this.savePhone(username, party.getUserId().toString());
         } else {
             // 邮箱注册
@@ -715,6 +719,7 @@
             userRecom.setUserId(party_reco.getUserId());
             userRecom.setRecomUserId(party.getUserId());
             this.userRecomService.save(userRecom);
+            party = getById(party.getUserId());
             party.setUserRecom(party_reco.getUserId());
             updateById(party);
         }
@@ -823,14 +828,20 @@
         user.setUserCode(getAgentUserCode());
         user.setRemarks(remarks);
         user.setRoleName(roleName);
-        user.setLoginPassword(password);
+        user.setLoginPassword(passwordEncoder.encode(password));
         user.setSafePassword(passwordEncoder.encode(safePassword));
         user.setStatus(loginAuthority ? 1 : 0);
         user.setUserLevel(userLevel);
+        user.setCreditScore(80);
         save(user);
         Wallet wallet = new Wallet();
         wallet.setUserId(user.getUserId());
         walletService.save(wallet);
+
+        CapitaltWallet capitaltWallet = new CapitaltWallet();
+        capitaltWallet.setUserId(user.getUserId());
+        capitaltWalletMapper.insert(capitaltWallet);
+
         //推荐人
         if (StrUtil.isNotBlank(userCode)) {
 //            if ("true".equals(this.sysparaService.find("register_need_usercode").getSvalue())) {

--
Gitblit v1.9.3