|
@@ -1,6 +1,7 @@
|
|
package com.txz.cif.service.impl;
|
|
package com.txz.cif.service.impl;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
+import com.txz.cif.configurer.LocalUtil;
|
|
import com.txz.cif.constants.MyConstants;
|
|
import com.txz.cif.constants.MyConstants;
|
|
import com.txz.cif.core.ServiceException;
|
|
import com.txz.cif.core.ServiceException;
|
|
import com.txz.cif.dao.FlowMapper;
|
|
import com.txz.cif.dao.FlowMapper;
|
|
@@ -46,10 +47,10 @@ public class FlowServiceImpl extends AbstractService<Flow> implements FlowServic
|
|
try{
|
|
try{
|
|
Account account = accountService.getAccount(param.getUserId(),param.getAccountType());
|
|
Account account = accountService.getAccount(param.getUserId(),param.getAccountType());
|
|
if (account == null){
|
|
if (account == null){
|
|
- return Result.genFailResult("账号未找到");
|
|
|
|
|
|
+ return Result.genFailResult(LocalUtil.get("account.not.found"));
|
|
}
|
|
}
|
|
if (account.getEffectiveBalance().subtract(param.getAmount()).compareTo(BigDecimal.ZERO) < 0){
|
|
if (account.getEffectiveBalance().subtract(param.getAmount()).compareTo(BigDecimal.ZERO) < 0){
|
|
- return Result.genFailResult("冻结金额不足");
|
|
|
|
|
|
+ return Result.genFailResult(LocalUtil.get("insufficient.frozen.amount"));
|
|
}
|
|
}
|
|
Date today = DateUtil.date();
|
|
Date today = DateUtil.date();
|
|
|
|
|
|
@@ -70,7 +71,7 @@ public class FlowServiceImpl extends AbstractService<Flow> implements FlowServic
|
|
return Result.genSuccessResult(freezd.getId());
|
|
return Result.genSuccessResult(freezd.getId());
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
log.error("冻结异常",e);
|
|
log.error("冻结异常",e);
|
|
- return Result.genFailResult("冻结异常",e);
|
|
|
|
|
|
+ return Result.genFailResult(LocalUtil.get("freezing.exception"),e);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -79,19 +80,19 @@ public class FlowServiceImpl extends AbstractService<Flow> implements FlowServic
|
|
public Result unFreeze(Long freezdId) {
|
|
public Result unFreeze(Long freezdId) {
|
|
AccountFreezd freezd = accountFreezdService.findById(freezdId);
|
|
AccountFreezd freezd = accountFreezdService.findById(freezdId);
|
|
if (freezd == null){
|
|
if (freezd == null){
|
|
- return Result.genFailResult("冻结记录未找到");
|
|
|
|
|
|
+ return Result.genFailResult(LocalUtil.get("frozen.record.not.found"));
|
|
}
|
|
}
|
|
if (freezd.getStatus() != 1){
|
|
if (freezd.getStatus() != 1){
|
|
- return Result.genFailResult("冻结状态有异常");
|
|
|
|
|
|
+ return Result.genFailResult(LocalUtil.get("frozen.status.is.abnormal"));
|
|
}
|
|
}
|
|
Flow oldFlow = findById(freezd.getBizId());
|
|
Flow oldFlow = findById(freezd.getBizId());
|
|
if (oldFlow == null){
|
|
if (oldFlow == null){
|
|
- return Result.genFailResult("冻结记录未找到");
|
|
|
|
|
|
+ return Result.genFailResult(LocalUtil.get("frozen.record.not.found"));
|
|
}
|
|
}
|
|
|
|
|
|
Account account = accountService.findById(freezd.getAccountId());
|
|
Account account = accountService.findById(freezd.getAccountId());
|
|
if (account == null){
|
|
if (account == null){
|
|
- return Result.genFailResult("冻结账号未找到");
|
|
|
|
|
|
+ return Result.genFailResult(LocalUtil.get("frozen.account.not.found"));
|
|
}
|
|
}
|
|
Date today = DateUtil.date();
|
|
Date today = DateUtil.date();
|
|
Flow flow = Flow.builder().amount(freezd.getAmount()).bizType(BizTypeEnum.UNFREEZE.getKey())
|
|
Flow flow = Flow.builder().amount(freezd.getAmount()).bizType(BizTypeEnum.UNFREEZE.getKey())
|
|
@@ -146,11 +147,11 @@ public class FlowServiceImpl extends AbstractService<Flow> implements FlowServic
|
|
public Result recharge(RechargeParam param) {
|
|
public Result recharge(RechargeParam param) {
|
|
Account account = accountService.getAccount(param.getUserId(),1);
|
|
Account account = accountService.getAccount(param.getUserId(),1);
|
|
if (account == null){
|
|
if (account == null){
|
|
- return Result.genFailResult("账号未找到");
|
|
|
|
|
|
+ return Result.genFailResult(LocalUtil.get("account.not.found"));
|
|
}
|
|
}
|
|
Account innerCapitalAccount = accountService.findById(MyConstants.INNER_MARKETING);
|
|
Account innerCapitalAccount = accountService.findById(MyConstants.INNER_MARKETING);
|
|
if (innerCapitalAccount == null){
|
|
if (innerCapitalAccount == null){
|
|
- return Result.genFailResult("账号未找到");
|
|
|
|
|
|
+ return Result.genFailResult(LocalUtil.get("account.not.found"));
|
|
}
|
|
}
|
|
Date today = DateUtil.date();
|
|
Date today = DateUtil.date();
|
|
Flow flow = Flow.builder().amount(param.getAmount()).bizType(param.getBizType())
|
|
Flow flow = Flow.builder().amount(param.getAmount()).bizType(param.getBizType())
|
|
@@ -177,7 +178,7 @@ public class FlowServiceImpl extends AbstractService<Flow> implements FlowServic
|
|
//充值返点
|
|
//充值返点
|
|
Account innerRebateAccount = accountService.findById(MyConstants.INNER_REBATE);
|
|
Account innerRebateAccount = accountService.findById(MyConstants.INNER_REBATE);
|
|
if (innerCapitalAccount == null){
|
|
if (innerCapitalAccount == null){
|
|
- return Result.genFailResult("账号未找到");
|
|
|
|
|
|
+ return Result.genFailResult(LocalUtil.get("account.not.found"));
|
|
}
|
|
}
|
|
flow = Flow.builder().amount(param.getDiscount()).bizType(BizTypeEnum.REFUND_RECHARGE.getKey())
|
|
flow = Flow.builder().amount(param.getDiscount()).bizType(BizTypeEnum.REFUND_RECHARGE.getKey())
|
|
.userId(param.getUserId())
|
|
.userId(param.getUserId())
|
|
@@ -209,11 +210,11 @@ public class FlowServiceImpl extends AbstractService<Flow> implements FlowServic
|
|
|
|
|
|
Account account = accountService.getAccount(param.getUserId(),1);
|
|
Account account = accountService.getAccount(param.getUserId(),1);
|
|
if (account == null){
|
|
if (account == null){
|
|
- return Result.genFailResult("账号未找到");
|
|
|
|
|
|
+ return Result.genFailResult(LocalUtil.get("account.not.found"));
|
|
}
|
|
}
|
|
Account innerIncomeAccount = accountService.findById(MyConstants.INNER_INCOME);
|
|
Account innerIncomeAccount = accountService.findById(MyConstants.INNER_INCOME);
|
|
if (innerIncomeAccount == null){
|
|
if (innerIncomeAccount == null){
|
|
- return Result.genFailResult("账号未找到");
|
|
|
|
|
|
+ return Result.genFailResult(LocalUtil.get("account.not.found"));
|
|
}
|
|
}
|
|
|
|
|
|
//借:个人账户钱包(贷) -500元
|
|
//借:个人账户钱包(贷) -500元
|
|
@@ -249,11 +250,11 @@ public class FlowServiceImpl extends AbstractService<Flow> implements FlowServic
|
|
|
|
|
|
Account account = accountService.getAccount(param.getUserId(),1);
|
|
Account account = accountService.getAccount(param.getUserId(),1);
|
|
if (account == null){
|
|
if (account == null){
|
|
- return Result.genFailResult("账号未找到");
|
|
|
|
|
|
+ return Result.genFailResult(LocalUtil.get("account.not.found"));
|
|
}
|
|
}
|
|
Account innerRefundAccount = accountService.findById(MyConstants.INNER_REFUND);
|
|
Account innerRefundAccount = accountService.findById(MyConstants.INNER_REFUND);
|
|
if (innerRefundAccount == null){
|
|
if (innerRefundAccount == null){
|
|
- return Result.genFailResult("账号未找到");
|
|
|
|
|
|
+ return Result.genFailResult(LocalUtil.get("account.not.found"));
|
|
}
|
|
}
|
|
Date today = DateUtil.date();
|
|
Date today = DateUtil.date();
|
|
Flow flow = Flow.builder().amount(param.getAmount()).bizType(param.getBizType())
|
|
Flow flow = Flow.builder().amount(param.getAmount()).bizType(param.getBizType())
|
|
@@ -283,11 +284,11 @@ public class FlowServiceImpl extends AbstractService<Flow> implements FlowServic
|
|
|
|
|
|
Account account = accountService.getAccount(param.getUserId(),param.getAccountType());
|
|
Account account = accountService.getAccount(param.getUserId(),param.getAccountType());
|
|
if (account == null){
|
|
if (account == null){
|
|
- return Result.genFailResult("账号未找到");
|
|
|
|
|
|
+ return Result.genFailResult(LocalUtil.get("account.not.found"));
|
|
}
|
|
}
|
|
Account innerCapitalAccount = accountService.findById(MyConstants.INNER_CAPITAL);
|
|
Account innerCapitalAccount = accountService.findById(MyConstants.INNER_CAPITAL);
|
|
if (innerCapitalAccount == null){
|
|
if (innerCapitalAccount == null){
|
|
- return Result.genFailResult("账号未找到");
|
|
|
|
|
|
+ return Result.genFailResult(LocalUtil.get("account.not.found"));
|
|
}
|
|
}
|
|
|
|
|
|
Date today = DateUtil.date();
|
|
Date today = DateUtil.date();
|
|
@@ -318,11 +319,11 @@ public class FlowServiceImpl extends AbstractService<Flow> implements FlowServic
|
|
public Result settle(RedEnvelope redEnvelope) {
|
|
public Result settle(RedEnvelope redEnvelope) {
|
|
Account account = accountService.getAccount(redEnvelope.getUserId(), 2);
|
|
Account account = accountService.getAccount(redEnvelope.getUserId(), 2);
|
|
if (account == null){
|
|
if (account == null){
|
|
- throw new ServiceException("收益账户未找到");
|
|
|
|
|
|
+ throw new ServiceException(LocalUtil.get("income.account.not.found"));
|
|
}
|
|
}
|
|
Account innerCapitalAccount = accountService.findById(MyConstants.INNER_RED);
|
|
Account innerCapitalAccount = accountService.findById(MyConstants.INNER_RED);
|
|
if (innerCapitalAccount == null){
|
|
if (innerCapitalAccount == null){
|
|
- throw new ServiceException("账户未找到");
|
|
|
|
|
|
+ throw new ServiceException(LocalUtil.get("account.not.found"));
|
|
}
|
|
}
|
|
Date today = DateUtil.date();
|
|
Date today = DateUtil.date();
|
|
Flow flow = Flow.builder().amount(redEnvelope.getAmount()).bizType(redEnvelope.getBizType())
|
|
Flow flow = Flow.builder().amount(redEnvelope.getAmount()).bizType(redEnvelope.getBizType())
|