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