定时器修改

pull/2/head
ZhiShuo_Lou 2023-10-28 19:58:03 +08:00
parent 3436cedce9
commit ede9a8e9c7
2 changed files with 6 additions and 1 deletions

View File

@ -120,10 +120,12 @@ public class InvitationServiceImpl implements InvitationService {
//支出操作
purse.setBalanceFee(purseResponse.getBalanceFee() - amountIncome);
purse.setWalletOutcome(purseResponse.getWalletOutcome() + amountIncome);
purse.setWalletIncome(purseResponse.getWalletIncome());
}else{
//收入操作
purse.setBalanceFee(purseResponse.getBalanceFee() + amountIncome);
purse.setWalletIncome(purseResponse.getWalletIncome() + amountIncome);
purse.setWalletOutcome(purseResponse.getWalletOutcome());
}
//修改钱包余额
i = invitationMapper.updateUserMoney(purse);

View File

@ -27,13 +27,16 @@ public class SysUserPurse {
/**
*
*/
@Scheduled(cron = "0 0/5 * * * ?")
@Scheduled(cron = "0/5 * * * * ?")
public void userPurse(){
System.out.println("~~~~~~定时器开始扫描钱包余额~~~~~~");
//获取用户的编号
Long userId = SecurityUtils.getUserId();
//根据用户编号查询用户钱包
PurseResponse purseResponse = purseServiceTwo.purseObject(userId);
if (null == purseResponse){
throw new RuntimeException("查无此用户!");
}
//钱包余额
Integer balanceFee = purseResponse.getBalanceFee();
//将余额存入redis