| | |
| | | // 用户承兑商 |
| | | party = userService.findUserByUserCode(c2c_user_party_code); |
| | | if (null == party) { |
| | | throw new YamiShopBindException("用户承兑商:用户UID不存在"); |
| | | throw new YamiShopBindException("User merchant: user UID does not exist"); |
| | | } |
| | | } else if ("1".equals(c2c_user_type)) { |
| | | /// 后台承兑商 |
| | | party = userService.register(username_front, password_front, usercode_front,Integer.valueOf(type_front),false); |
| | | if (null == party) { |
| | | throw new YamiShopBindException("后台承兑商:注册失败"); |
| | | throw new YamiShopBindException("Backend merchant: registration failed"); |
| | | } |
| | | this.saveLog(party, SecurityUtils.getSysUser().getUsername(), "管理员操作:后台承兑商用户注册,ip[" + IPHelper.getIpAddr() + "]", Constants.LOG_CATEGORY_SECURITY); |
| | | } else { |
| | | throw new YamiShopBindException("承兑商类型不正确"); |
| | | throw new YamiShopBindException("Invalid merchant type"); |
| | | } |
| | | party.setC2cUserType(Integer.valueOf(c2c_user_type).intValue()); |
| | | userService.updateById(party); |
| | |
| | | String id =model.getId(); |
| | | C2cUser c2cUser = c2cUserService.getById(id); |
| | | if (null == c2cUser) { |
| | | throw new YamiShopBindException("承兑商不存在"); |
| | | throw new YamiShopBindException("Merchant does not exist"); |
| | | } |
| | | C2cUserParamBaseSet paramBaseSet = c2cUserParamBaseSetService.getByPartyId(c2cUser.getC2cUserPartyId()); |
| | | if (null == paramBaseSet) { |
| | | throw new YamiShopBindException("承兑商参数基础设置不存在"); |
| | | throw new YamiShopBindException("Merchant base settings do not exist"); |
| | | } |
| | | User party = userService.getById(c2cUser.getC2cUserPartyId()); |
| | | if (null == party) { |
| | | throw new YamiShopBindException("承兑商的用户信息不存在"); |
| | | throw new YamiShopBindException("Merchant user info does not exist"); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", id); |
| | |
| | | sysUserService.checkSafeWord(login_safeword); |
| | | C2cUser c2cUser = c2cUserService.getById(id); |
| | | if (null == c2cUser) { |
| | | throw new YamiShopBindException("承兑商不存在"); |
| | | throw new YamiShopBindException("Merchant does not exist"); |
| | | } |
| | | C2cUserParamBaseSet paramBaseSet = this.c2cUserParamBaseSetService.getByPartyId(c2cUser.getC2cUserPartyId()); |
| | | if (null == paramBaseSet) { |
| | | throw new YamiShopBindException("承兑商参数基础设置不存在"); |
| | | throw new YamiShopBindException("Merchant base settings do not exist"); |
| | | } |
| | | User party = userService.getById(c2cUser.getC2cUserPartyId()); |
| | | if (null == party) { |
| | | throw new YamiShopBindException("承兑商的用户信息不存在"); |
| | | throw new YamiShopBindException("Merchant user info does not exist"); |
| | | } |
| | | String log = MessageFormat.format("ip:" + IPHelper.getIpAddr() |
| | | + ",管理员修改承兑商信息,id:{0},原承兑商类型:{1},原承兑商CODE:{2},原承兑商PARTY_ID:{3},原承兑商昵称:{4},原承兑商头像:{5},原剩余保证金:{6},原保证金:{7}," |
| | |
| | | String money_change = model.getMoney_change(); |
| | | String safe_password = model.getSafe_password(); |
| | | if (StringUtils.isEmptyString(recharge_withdraw)) { |
| | | throw new YamiShopBindException("修改方式不正确"); |
| | | throw new YamiShopBindException("Invalid modification method"); |
| | | } |
| | | if (StringUtils.isEmptyString(money_change) || !StringUtils.isDouble(money_change) || Double.valueOf(money_change).doubleValue() <= 0) { |
| | | throw new YamiShopBindException("修改额度未填或格式不正确"); |
| | | throw new YamiShopBindException("Modification amount is empty or invalid"); |
| | | } |
| | | DecimalFormat df = new DecimalFormat("#.########"); |
| | | double money_change_double = Double.valueOf(money_change).doubleValue(); |
| | | C2cUser c2cUser = c2cUserService.getById(id); |
| | | if (null == c2cUser) { |
| | | throw new YamiShopBindException("承兑商不存在"); |
| | | throw new YamiShopBindException("Merchant does not exist"); |
| | | } |
| | | String userNameLogin = SecurityUtils.getSysUser().getUsername(); |
| | | sysUserService.checkSafeWord(safe_password); |
| | |
| | | newDepositOpen = Double.valueOf(df.format(Arith.add(money_change_double, c2cUser.getDepositOpen()))).doubleValue(); |
| | | newDeposit = Double.valueOf(df.format(Arith.add(money_change_double, c2cUser.getDeposit()))).doubleValue(); |
| | | if (newDepositOpen <= 0 || newDeposit <= 0) { |
| | | throw new YamiShopBindException("提现额度不能超过总保证金和剩余保证金"); |
| | | throw new YamiShopBindException("Withdrawal limit cannot exceed total and remaining margin"); |
| | | } |
| | | } else { |
| | | throw new YamiShopBindException("修改方式不正确"); |
| | | throw new YamiShopBindException("Invalid modification method"); |
| | | } |
| | | c2cUser.setDepositOpen(newDepositOpen); |
| | | c2cUser.setDeposit(newDeposit); |
| | |
| | | String c2c_user_id = model.getC2c_user_id(); |
| | | List<Map<String, Object>> ret = new ArrayList<Map<String, Object>>(); |
| | | if (StringUtils.isEmptyString(manager_id)) { |
| | | throw new YamiShopBindException("C2C管理员PARTY_ID为空"); |
| | | throw new YamiShopBindException("C2C admin PARTY_ID is empty"); |
| | | } |
| | | if (StringUtils.isEmptyString(c2c_user_id)) { |
| | | throw new YamiShopBindException("承兑商ID为空"); |
| | | throw new YamiShopBindException("Merchant ID is empty"); |
| | | } |
| | | List<Map<String, Object>> result = c2cUserService.getC2cManagerC2cUser(manager_id); |
| | | if (null == result) { |