master
冯凯 2023-11-05 10:00:28 +08:00
parent 6a59b13e3c
commit 90d5b49b1f
1 changed files with 5 additions and 0 deletions

View File

@ -41,13 +41,17 @@ public class SysSignServiceImpl implements SysSignService {
int recentDay = sign.getSignTime().getDay();
//判断是否已经断签了
if (today-recentDay>1){
System.out.println("断签了!!!!");
sign.setSignAmount(0);
//其次将签到次数signAmount改为0
sysSignMapper.updateSingAmountByUserId(sign);
redisService.deleteObject("sign:"+userId);
redisService.setCacheObject("sign:"+userId,sign);
System.out.println(sign);
return sign;
}
System.out.println("没有断签!!!");
System.out.println(sign);
//没有断签 直接返回当前查询出来的签到记录
return sign;
}
@ -57,5 +61,6 @@ public class SysSignServiceImpl implements SysSignService {
Sign sign = this.searchSignByUserId(userId);
sign.setSignAmount(sign.getSignAmount()+1);
sysSignMapper.signByUserId(sign);
redisService.setCacheObject("sing:"+userId,sign);
}
}