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

View File

@@ -441,31 +441,13 @@ public class Userservice {
return true; return true;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
if(promotion.getTypeCode().equals("MG")){ if(promotion.getTypeCode().equals("MG")){
cash.setStatus(1); cash.setStatus(1);
aliPayService.alipayTransfer(cash.getVirrealcashamt().toString(),cash.getAccountno(),cash.getAccountname(),"",cash.getCashnumber());
modFunds(cash.getUserid(),cash.getCashamt());
} }
cash.setCashstatus(JSONUtil.toJsonStr(cashStatusList)); cash.setCashstatus(JSONUtil.toJsonStr(cashStatusList));
//释放资金
TbPlussUserAccount userAccount= tbPlussUserAccountMapper.selectByPrimaryKey(cash.getUserid());
if(ObjectUtil.isEmpty(userAccount)|| N.gt(cash.getCashamt(),userAccount.getFreezeBalance())){
throw new Exception("冻结资金不足");
}
userAccount.setFreezeBalance(userAccount.getFreezeBalance().subtract(cash.getCashamt()));
userAccount.setUpdateTime(new Date());
tbPlussUserAccountMapper.updateByPrimaryKey(userAccount);
TbPlussUserAccountFlow flow=new TbPlussUserAccountFlow();
flow.setUserId(cash.getUserid());
flow.setBizCode("105");
flow.setBizName("提现拒绝解冻");
flow.setAmount(cash.getCashamt());
flow.setBalance(userAccount.getBalance());
flow.setCreateTime(new Date());
tbPlussUserAccountFlowMapper.insert(flow);
break; break;
case "2": case "2":
@@ -473,13 +455,29 @@ public class Userservice {
if(it.getUserId().toString().equals(userId)) if(it.getUserId().toString().equals(userId))
it.setStatus("2"); it.setStatus("2");
if(it.getUserType().equals("MG")){ if(it.getUserType().equals("MG")){
//支付宝打款 //释放资金
try { TbPlussUserAccount userAccount= tbPlussUserAccountMapper.selectByPrimaryKey(cash.getUserid());
aliPayService.alipayTransfer(cash.getVirrealcashamt().toString(),cash.getAccountno(),cash.getAccountname(),"",cash.getCashnumber()); if(ObjectUtil.isEmpty(userAccount)|| N.gt(cash.getCashamt(),userAccount.getFreezeBalance())){
modFunds(cash.getUserid(),cash.getCashamt()); try {
} catch (Exception e) { throw new Exception("冻结资金不足");
throw new RuntimeException(e); } catch (Exception e) {
throw new RuntimeException(e);
}
} }
userAccount.setFreezeBalance(userAccount.getFreezeBalance().subtract(cash.getCashamt()));
userAccount.setUpdateTime(new Date());
tbPlussUserAccountMapper.updateByPrimaryKey(userAccount);
TbPlussUserAccountFlow flow=new TbPlussUserAccountFlow();
flow.setUserId(cash.getUserid());
flow.setBizCode("105");
flow.setBizName("提现拒绝解冻");
flow.setAmount(cash.getCashamt());
flow.setBalance(userAccount.getBalance());
flow.setCreateTime(new Date());
tbPlussUserAccountFlowMapper.insert(flow);
} }
return true; return true;
}).collect(Collectors.toList()); }).collect(Collectors.toList());