|
@@ -99,7 +99,7 @@ public class UserWithdrawServiceImpl implements IUserWithdrawService {
|
|
|
}
|
|
|
List<UserPosition> userPositions = this.iUserPositionService.findPositionByUserIdAndSellIdIsNull(user.getId());
|
|
|
if (userPositions.size() > 0) {
|
|
|
- return ServerResponse.createByErrorMsg("有持仓单不能出金");
|
|
|
+ return ServerResponse.createByErrorMsg("有持仓单不能出币");
|
|
|
}
|
|
|
if (StringUtils.isBlank(user.getRealName()) || StringUtils.isBlank(user.getIdCard())) {
|
|
|
return ServerResponse.createByErrorMsg("未实名认证");
|
|
@@ -109,16 +109,16 @@ public class UserWithdrawServiceImpl implements IUserWithdrawService {
|
|
|
return ServerResponse.createByErrorMsg("未添加银行卡");
|
|
|
}
|
|
|
if (user.getAccountType().intValue() == 1) {
|
|
|
- return ServerResponse.createByErrorMsg("模拟用户不能出金");
|
|
|
+ return ServerResponse.createByErrorMsg("模拟用户不能出币");
|
|
|
}
|
|
|
SiteSetting siteSetting = this.iSiteSettingService.getSiteSetting();
|
|
|
if ((new BigDecimal(amt)).compareTo(new BigDecimal(siteSetting.getWithMinAmt().intValue())) == -1) {
|
|
|
- return ServerResponse.createByErrorMsg("出金金额不得低于" + siteSetting.getWithMinAmt() + "元");
|
|
|
+ return ServerResponse.createByErrorMsg("出币金额不得低于" + siteSetting.getWithMinAmt() + "元");
|
|
|
}
|
|
|
int with_time_begin = siteSetting.getWithTimeBegin().intValue();
|
|
|
int with_time_end = siteSetting.getWithTimeEnd().intValue();
|
|
|
if (!WithDrawUtils.checkIsWithTime(with_time_begin, with_time_end)) {
|
|
|
- return ServerResponse.createByErrorMsg("出金失败,出金时间在" + with_time_begin + "点 - " + with_time_end + "点 之间");
|
|
|
+ return ServerResponse.createByErrorMsg("出币失败,出币时间在" + with_time_begin + "点 - " + with_time_end + "点 之间");
|
|
|
}
|
|
|
BigDecimal index_user_amt = user.getUserIndexAmt();
|
|
|
if (index_user_amt.compareTo(new BigDecimal("0")) == -1) {
|
|
@@ -131,22 +131,22 @@ public class UserWithdrawServiceImpl implements IUserWithdrawService {
|
|
|
BigDecimal enable_amt = user.getEnableAmt();
|
|
|
int compareAmt = enable_amt.compareTo(new BigDecimal(amt));
|
|
|
if (compareAmt == -1) {
|
|
|
- return ServerResponse.createByErrorMsg("提现失败,用户可用资金不足");
|
|
|
+ return ServerResponse.createByErrorMsg("提币失败,用户可用资金不足");
|
|
|
}
|
|
|
BigDecimal user_all_amt = user.getUserAmt();
|
|
|
BigDecimal reckon_all_amt = user_all_amt.subtract(new BigDecimal(amt));
|
|
|
BigDecimal reckon_enable_amt = enable_amt.subtract(new BigDecimal(amt));
|
|
|
user.setUserAmt(reckon_all_amt);
|
|
|
user.setEnableAmt(reckon_enable_amt);
|
|
|
- log.info("用户提现{},金额 = {},总资金 = {},可用资金 = {}", new Object[]{user.getId(), amt, user_all_amt, enable_amt});
|
|
|
- log.info("提现后,总金额={},可用资金={}", reckon_all_amt, reckon_enable_amt);
|
|
|
+ log.info("用户提币{},金额 = {},总资金 = {},可用资金 = {}", new Object[]{user.getId(), amt, user_all_amt, enable_amt});
|
|
|
+ log.info("提币后,总金额={},可用资金={}", reckon_all_amt, reckon_enable_amt);
|
|
|
|
|
|
int updateUserCount = this.userMapper.updateByPrimaryKeySelective(user);
|
|
|
if (updateUserCount > 0) {
|
|
|
log.info("修改用户资金成功");
|
|
|
} else {
|
|
|
log.error("修改用户资金失败");
|
|
|
- throw new Exception("用户提现,修改用户资金失败");
|
|
|
+ throw new Exception("用户提币,修改用户资金失败");
|
|
|
}
|
|
|
|
|
|
BigDecimal rmb = new BigDecimal(BigInteger.ZERO);
|
|
@@ -186,13 +186,13 @@ public class UserWithdrawServiceImpl implements IUserWithdrawService {
|
|
|
|
|
|
int insertCount = this.userWithdrawMapper.insert(userWithdraw);
|
|
|
if (insertCount > 0) {
|
|
|
- messageService.sendTopicMessage(String.format("%s提现了%s", user.getRealName(), amt));
|
|
|
- return ServerResponse.createBySuccessMsg("提现成功");
|
|
|
+ messageService.sendTopicMessage(String.format("%s提币了%s", user.getRealName(), amt));
|
|
|
+ return ServerResponse.createBySuccessMsg("提币成功");
|
|
|
}
|
|
|
- log.error("保存提现记录失败");
|
|
|
- throw new Exception("用户提现,保存提现记录失败");
|
|
|
+ log.error("保存提币记录失败");
|
|
|
+ throw new Exception("用户提币,保存提币记录失败");
|
|
|
} else {
|
|
|
- return ServerResponse.createByErrorMsg("提现密码不正确!!");
|
|
|
+ return ServerResponse.createByErrorMsg("提币密码不正确!!");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -218,10 +218,10 @@ public class UserWithdrawServiceImpl implements IUserWithdrawService {
|
|
|
return ServerResponse.createByErrorMsg("当前订单不能取消");
|
|
|
}
|
|
|
userWithdraw.setWithStatus(Integer.valueOf(3));
|
|
|
- userWithdraw.setWithMsg("用户取消出金");
|
|
|
+ userWithdraw.setWithMsg("用户取消出币");
|
|
|
int updateCount = this.userWithdrawMapper.updateByPrimaryKeySelective(userWithdraw);
|
|
|
if (updateCount > 0) {
|
|
|
- log.info("修改用户提现订单 {} 状态成功", withId);
|
|
|
+ log.info("修改用户提币订单 {} 状态成功", withId);
|
|
|
User user = this.userMapper.selectByPrimaryKey(userWithdraw.getUserId());
|
|
|
user.setUserAmt(user.getUserAmt().add(userWithdraw.getWithAmt()));
|
|
|
user.setEnableAmt(user.getEnableAmt().add(userWithdraw.getWithAmt()));
|
|
@@ -232,7 +232,7 @@ public class UserWithdrawServiceImpl implements IUserWithdrawService {
|
|
|
}
|
|
|
return ServerResponse.createByErrorMsg("取消失败");
|
|
|
}
|
|
|
- log.info("修改用户提现订单 {} 状态失败", withId);
|
|
|
+ log.info("修改用户提币订单 {} 状态失败", withId);
|
|
|
return ServerResponse.createByErrorMsg("取消失败");
|
|
|
}
|
|
|
|
|
@@ -302,10 +302,10 @@ public class UserWithdrawServiceImpl implements IUserWithdrawService {
|
|
|
public ServerResponse updateState(Integer withId, Integer state, String authMsg) throws Exception {
|
|
|
UserWithdraw userWithdraw = this.userWithdrawMapper.selectByPrimaryKey(withId);
|
|
|
if (userWithdraw == null) {
|
|
|
- return ServerResponse.createByErrorMsg("提现订单不存在");
|
|
|
+ return ServerResponse.createByErrorMsg("提币订单不存在");
|
|
|
}
|
|
|
if (userWithdraw.getWithStatus().intValue() != 0) {
|
|
|
- return ServerResponse.createByErrorMsg("提现订单已处理,不要重复操作");
|
|
|
+ return ServerResponse.createByErrorMsg("提币订单已处理,不要重复操作");
|
|
|
}
|
|
|
if (state.intValue() == 2 && StringUtils.isBlank(authMsg)) {
|
|
|
return ServerResponse.createByErrorMsg("失败信息必填");
|
|
@@ -316,14 +316,14 @@ public class UserWithdrawServiceImpl implements IUserWithdrawService {
|
|
|
return ServerResponse.createByErrorMsg("用户不存在");
|
|
|
}
|
|
|
BigDecimal user_amt = user.getUserAmt().add(userWithdraw.getWithAmt());
|
|
|
- log.info("管理员确认提现订单失败,返还用户 {} 总资金,原金额 = {} , 返还后 = {}", new Object[]{user.getId(), user.getUserAmt(), user_amt});
|
|
|
+ log.info("管理员确认提币订单失败,返还用户 {} 总资金,原金额 = {} , 返还后 = {}", new Object[]{user.getId(), user.getUserAmt(), user_amt});
|
|
|
user.setUserAmt(user_amt);
|
|
|
BigDecimal user_enable_amt = user.getEnableAmt().add(userWithdraw.getWithAmt());
|
|
|
- log.info("管理员确认提现订单失败,返还用户 {} 可用资金,原金额 = {} , 返还后 = {}", new Object[]{user.getId(), user.getEnableAmt(), user_enable_amt});
|
|
|
+ log.info("管理员确认提币订单失败,返还用户 {} 可用资金,原金额 = {} , 返还后 = {}", new Object[]{user.getId(), user.getEnableAmt(), user_enable_amt});
|
|
|
user.setEnableAmt(user_enable_amt);
|
|
|
int updateCount = this.userMapper.updateByPrimaryKeySelective(user);
|
|
|
if (updateCount > 0) {
|
|
|
- log.info("提现失败,返还用户资金成功!");
|
|
|
+ log.info("提币失败,返还用户资金成功!");
|
|
|
} else {
|
|
|
log.error("返还用户资金出错,抛出异常");
|
|
|
throw new Exception("修改用户资金出错,抛出异常");
|