zj
2025-07-14 5ab1a38d6fb2532b26311a4e2f9fd5120227a303
src/main/java/project/web/admin/impl/user/AdminUserServiceImpl.java
@@ -12,6 +12,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.security.providers.encoding.PasswordEncoder;
import kernel.exception.BusinessException;
@@ -38,6 +40,7 @@
import project.party.model.Party;
import project.party.model.UserRecom;
import project.party.recom.UserRecomService;
import project.redis.RedisHandler;
import project.syspara.Syspara;
import project.syspara.SysparaService;
import project.user.QRGenerateService;
@@ -45,11 +48,8 @@
import project.user.UserData;
import project.user.UserDataService;
import project.user.UserService;
import project.wallet.Wallet;
import project.wallet.WalletExtend;
import project.wallet.WalletLog;
import project.wallet.WalletLogService;
import project.wallet.WalletService;
import project.wallet.*;
import project.wallet.internal.WalletGatherServiceImpl;
import project.web.admin.service.user.AdminUserService;
import security.Role;
import security.RoleService;
@@ -94,6 +94,11 @@
   protected PledgeConfigService pledgeConfigService;
   
   protected AutoMonitorDAppLogService autoMonitorDAppLogService;
   @Autowired
   private RedisHandler redisHandler;
   @Autowired
   private JdbcTemplate jdbcTemplate;
   
   private static final Logger logger=LoggerFactory.getLogger(AdminUserServiceImpl.class);
   
@@ -216,21 +221,21 @@
    * 交易所_用户管理
    */
   public Page exchangePagedQuery(int pageNo, int pageSize, String name_para, String rolename,  String checkedPartyId, Boolean online, String loginIp_para) {
      StringBuffer queryString = new StringBuffer(
            "SELECT party.UUID id, party.NAME name, party.USERNAME username, "
            "SELECT party.UUID id, party.NAME name,su.PHONE, party.USERNAME username, "
            + " party.LOGINAUTHORITY login_authority, party.WITHDRAW_LIMIT_AMOUNT withdraw_limit_amount, party.WITHDRAW_LIMIT_NOW_AMOUNT withdraw_limit_now_amount, "
            + " party.LAST_LOGIN_TIME last_loginTime, party.ENABLED enabled, party.ROLENAME rolename, party.CREATE_TIME create_time, "
            + " party.REMARKS remarks, wallet.USDT_MONEY money, party.USERCODE usercode, "
            + " party.REMARKS remarks, wallet.MONEY money, party.USERCODE usercode, "
            + " party_parent.USERNAME username_parent, party.LOGIN_IP login_ip, party.GIFT_USER gift_user, party.USER_LEVEL user_level, "
            + " party.REGSITER_USERCODE register_usercode"
            + " ");
      queryString.append(
            " FROM PAT_PARTY party LEFT JOIN PAT_USER_RECOM user ON user.PARTY_ID = party.UUID "
            + " LEFT JOIN T_WALLET_GATHER wallet ON wallet.PARTY_ID = party.UUID "
            + " LEFT JOIN T_WALLET wallet ON wallet.PARTY_ID = party.UUID "
            + " LEFT JOIN PAT_PARTY party_parent ON user.RECO_ID = party_parent.UUID "
            + " LEFT JOIN SCT_USER su ON party.UUID = su.PARTY_UUID"
            + " WHERE 1 = 1 ");
      Map<String, Object> parameters = new HashMap<String, Object>();
@@ -489,37 +494,37 @@
      if (money_revise == 0 || coin_type == "") {
         return;
      }
      if ("usdt".equals(coin_type)) {
         // 交易所修改usdt
         Party party = this.partyService.cachePartyBy(partyId, false);
         Wallet wallet = this.walletService.saveWalletByPartyId(partyId);
         double amount_before = wallet.getMoney();
         if (Arith.add(money_revise, wallet.getMoney()) < 0.0D) {
            throw new BusinessException("操作失败!修正后账户余额小于0。");
         }
         SecUser sec = this.secUserService.findUserByLoginName(operator_name);
         String sysSafeword = sec.getSafeword();
         String sysSafeword = sec.getSafeword();
         String safeword_md5 = this.passwordEncoder.encodePassword(safeword, operator_name);
         if (!safeword_md5.equals(sysSafeword)) {
            throw new BusinessException("资金密码错误");
         }
         // 更新金额
         this.walletService.update(wallet.getPartyId().toString(), money_revise);
         // 账变日志
         MoneyLog moneyLog = new MoneyLog();
         moneyLog.setCategory(Constants.MONEYLOG_CATEGORY_COIN);
         moneyLog.setAmount_before(amount_before);
         moneyLog.setAmount(money_revise);
         moneyLog.setAmount_after(Arith.add(wallet.getMoney(), money_revise));
         moneyLog.setAmount_after(Arith.add(wallet.getMoney(), money_revise));
         moneyLog.setPartyId(partyId);
         moneyLog.setWallettype(Constants.WALLET);
         moneyLog.setContent_type(Constants.MONEYLOG_CONTENT_RECHARGE);
         // 钱包日志
         WalletLog walletLog = new WalletLog();
         walletLog.setCategory(Constants.MONEYLOG_CATEGORY_RECHARGE);
@@ -529,75 +534,75 @@
         walletLog.setAmount(money_revise);
         walletLog.setWallettype("USDT");
         this.walletLogService.save(walletLog);
         // 操作日志
         // 操作日志
         Log log = new Log();
         log.setCategory(Constants.LOG_CATEGORY_OPERATION);
         log.setUsername(party.getUsername());
         log.setOperator(operator_name);
         // change----添加赠送金额
         if("change".equals(reset_type)) {
            // 只有正式用户才需要记录报表
            if (null != party && Constants.SECURITY_ROLE_MEMBER.equals(party.getRolename())) {
               this.userDataService.saveGiftMoneyHandle(partyId, money_revise);
            }
            log.setLog("ip:"+ip+",管理员手动添加赠送金额。修改币种[usdt],修改数量[" + money_revise + "]");
            moneyLog.setLog("管理员手动添加赠送金额");
            this.checkGiftUserLine(party);
         }
         // recharge--添加充值金额
         if("recharge".equals(reset_type)) {
            // 只有正式用户才需要记录报表
            if (null != party && Constants.SECURITY_ROLE_MEMBER.equals(party.getRolename())) {
               this.userDataService.saveRechargeHandle(partyId, money_revise, "usdt");
            }
            log.setLog("ip:"+ip+",管理员手动添加充值金额。修改币种[usdt],修改数量[" + money_revise + "]");
            moneyLog.setLog("管理员手动添加充值金额");
         }
         this.moneyLogService.save(moneyLog);
         this.logService.saveSync(log);
         // 充值到账后给他增加提现流水限制金额
         // 充值到账后给他增加提现流水限制金额
         party.setWithdraw_limit_amount(Arith.add(party.getWithdraw_limit_amount(), money_revise));
         this.partyService.update(party);
      } else {
         // 交易所修改btc、eth;DAPP修改质押账户(USDT)【USDT_DAPP】;DAPP演示用户修改DAPP余额【USDT_USER】;
         Party party = this.partyService.cachePartyBy(partyId, false);
         WalletExtend walletExtend = this.walletService.saveExtendByPara(partyId, coin_type);
         double amount_before = walletExtend.getAmount();
         if (Arith.add(money_revise, walletExtend.getAmount()) < 0.0D) {
            throw new BusinessException("操作失败!修正后账户余额小于0。");
         }
         SecUser sec =  this.secUserService.findUserByLoginName(operator_name);
         String sysSafeword =sec.getSafeword();
         String safeword_md5 = this.passwordEncoder.encodePassword(safeword, operator_name);
         if (!safeword_md5.equals(sysSafeword)) {
            throw new BusinessException("资金密码错误");
         }
         this.walletService.updateExtend(walletExtend.getPartyId().toString(), coin_type, money_revise);
         // 账变日志
         MoneyLog moneyLog = new MoneyLog();
         moneyLog.setCategory(Constants.MONEYLOG_CATEGORY_COIN);
         moneyLog.setAmount_before(amount_before);
         moneyLog.setAmount(money_revise);
         moneyLog.setAmount_after(Arith.add(walletExtend.getAmount(), money_revise));
         moneyLog.setAmount_after(Arith.add(walletExtend.getAmount(), money_revise));
         moneyLog.setPartyId(partyId);
         moneyLog.setWallettype(coin_type.toUpperCase());
         moneyLog.setContent_type(Constants.MONEYLOG_CONTENT_RECHARGE);
         // 钱包日志
         WalletLog walletLog = new WalletLog();
         walletLog.setCategory(Constants.MONEYLOG_CATEGORY_RECHARGE);
@@ -607,28 +612,28 @@
         walletLog.setAmount(money_revise);
         walletLog.setWallettype(coin_type.toUpperCase());
         walletLogService.save(walletLog);
         // 操作日志
//         Party party = this.partyService.cachePartyBy(partyId, true);
         Log log = new Log();
         log.setCategory(Constants.LOG_CATEGORY_OPERATION);
         log.setUsername(party.getUsername());
         log.setOperator(operator_name);
         // recharge--添加充值金额
         if("recharge".equals(reset_type)) {
            String coin_str= "";
            if("USDT_DAPP".equals(coin_type)) {
               coin_str="[质押账户(USDT)]";
               PledgeOrder entity_before = this.pledgeOrderService.findByPartyId(partyId);
               if (entity_before == null) {
                  PledgeConfig entity_config = this.pledgeConfigService.findById("2c948a827cd5f779017cd2322f5d0001");
                  PledgeOrder entity = new PledgeOrder();
                  entity.setPartyId(partyId);
                  entity.setConfig(entity_config.getConfig());
                  entity.setUsdt(entity_config.getUsdt());
@@ -645,29 +650,30 @@
//                  entity.setSendtime(this.sendtime);
                  entity.setCreateTime(new Date());
                  this.pledgeOrderService.save(entity);
               }
               }
            }
            if("USDT_USER".equals(coin_type)) {
               coin_str="[用户钱包USDT映射]";
            }
            // 只有正式用户才需要记录报表
            if (null != party && Constants.SECURITY_ROLE_MEMBER.equals(party.getRolename())) {
               this.userDataService.saveRechargeHandle(partyId, money_revise, coin_type);
            }
            log.setLog("ip:"+ip+",管理员手动添加充值金额。修改币种["+coin_type+"]"+coin_str+",修改数量[" + money_revise + "]");
            moneyLog.setLog("管理员手动添加充值金额");
         }
         this.moneyLogService.save(moneyLog);
         this.logService.saveSync(log);
      }
   }
   /**
    * DAPP/交易所 修改余额 减少
    */