This commit is contained in:
韩鹏辉
2023-08-24 16:15:13 +08:00
parent 0c42abc879
commit 28c0f8c6ef

View File

@@ -441,16 +441,28 @@ public class Userservice {
return true;
}).collect(Collectors.toList());
if(promotion.getTypeCode().equals("MG")){
cash.setStatus(1);
aliPayService.alipayTransfer(cash.getVirrealcashamt().toString(),cash.getAccountno(),cash.getAccountname(),"",cash.getCashnumber());
modFunds(cash.getUserid(),cash.getCashamt());
}
cash.setCashstatus(JSONUtil.toJsonStr(cashStatusList));
break;
case "2":
cashStatusList.stream().filter(it->{
if(it.getUserId().toString().equals(userId))
it.setStatus("2");
if(it.getUserType().equals("MG")){
//释放资金
TbPlussUserAccount userAccount= tbPlussUserAccountMapper.selectByPrimaryKey(cash.getUserid());
if(ObjectUtil.isEmpty(userAccount)|| N.gt(cash.getCashamt(),userAccount.getFreezeBalance())){
try {
throw new Exception("冻结资金不足");
} catch (Exception e) {
throw new RuntimeException(e);
}
}
userAccount.setFreezeBalance(userAccount.getFreezeBalance().subtract(cash.getCashamt()));
@@ -466,20 +478,6 @@ public class Userservice {
flow.setBalance(userAccount.getBalance());
flow.setCreateTime(new Date());
tbPlussUserAccountFlowMapper.insert(flow);
break;
case "2":
cashStatusList.stream().filter(it->{
if(it.getUserId().toString().equals(userId))
it.setStatus("2");
if(it.getUserType().equals("MG")){
//支付宝打款
try {
aliPayService.alipayTransfer(cash.getVirrealcashamt().toString(),cash.getAccountno(),cash.getAccountname(),"",cash.getCashnumber());
modFunds(cash.getUserid(),cash.getCashamt());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
return true;
}).collect(Collectors.toList());