定时器修改
parent
3436cedce9
commit
ede9a8e9c7
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue