|
@@ -6,6 +6,7 @@ import cn.hutool.core.lang.generator.SnowflakeGenerator;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import com.txz.cif.constants.MyConstants;
|
|
import com.txz.cif.constants.MyConstants;
|
|
import com.txz.cif.dao.AccountMapper;
|
|
import com.txz.cif.dao.AccountMapper;
|
|
|
|
+import com.txz.cif.enums.BizTypeEnum;
|
|
import com.txz.cif.model.Account;
|
|
import com.txz.cif.model.Account;
|
|
import com.txz.cif.model.AccountFlow;
|
|
import com.txz.cif.model.AccountFlow;
|
|
import com.txz.cif.model.Flow;
|
|
import com.txz.cif.model.Flow;
|
|
@@ -54,15 +55,32 @@ public class AccountServiceImpl extends AbstractService<Account> implements Acco
|
|
//解冻
|
|
//解冻
|
|
cAccountMapper.dealFreeze(accountFlow.getAccountId(),accountFlow.getAmount().negate());
|
|
cAccountMapper.dealFreeze(accountFlow.getAccountId(),accountFlow.getAmount().negate());
|
|
} else {
|
|
} else {
|
|
|
|
+
|
|
if (accountFlow.getType() == 1){
|
|
if (accountFlow.getType() == 1){
|
|
- int i = cAccountMapper.dealWithDayCut(accountFlow.getAccountId(),accountFlow.getAmount().negate());
|
|
|
|
- if (i == 0){
|
|
|
|
- cAccountMapper.deal(accountFlow.getAccountId(),accountFlow.getAmount().negate());
|
|
|
|
|
|
+ if (BizTypeEnum.getByKey(accountFlow.getBizType()) == BizTypeEnum.WITHDRAW
|
|
|
|
+ || BizTypeEnum.getByKey(accountFlow.getBizType()) == BizTypeEnum.RECHARGE){
|
|
|
|
+ int i = cAccountMapper.dealWithDayCutHasTotal(accountFlow.getAccountId(),accountFlow.getAmount().negate());
|
|
|
|
+ if (i == 0){
|
|
|
|
+ cAccountMapper.dealHasTotal(accountFlow.getAccountId(),accountFlow.getAmount().negate());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ int i = cAccountMapper.dealWithDayCut(accountFlow.getAccountId(),accountFlow.getAmount().negate());
|
|
|
|
+ if (i == 0){
|
|
|
|
+ cAccountMapper.deal(accountFlow.getAccountId(),accountFlow.getAmount().negate());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- int i = cAccountMapper.dealWithDayCut(accountFlow.getAccountId(),accountFlow.getAmount());
|
|
|
|
- if (i == 0){
|
|
|
|
- cAccountMapper.deal(accountFlow.getAccountId(),accountFlow.getAmount());
|
|
|
|
|
|
+ if (BizTypeEnum.getByKey(accountFlow.getBizType()) == BizTypeEnum.WITHDRAW
|
|
|
|
+ || BizTypeEnum.getByKey(accountFlow.getBizType()) == BizTypeEnum.RECHARGE){
|
|
|
|
+ int i = cAccountMapper.dealWithDayCutHasTotal(accountFlow.getAccountId(),accountFlow.getAmount());
|
|
|
|
+ if (i == 0){
|
|
|
|
+ cAccountMapper.dealHasTotal(accountFlow.getAccountId(),accountFlow.getAmount());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ int i = cAccountMapper.dealWithDayCut(accountFlow.getAccountId(),accountFlow.getAmount());
|
|
|
|
+ if (i == 0){
|
|
|
|
+ cAccountMapper.deal(accountFlow.getAccountId(),accountFlow.getAmount());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|