|
@@ -108,14 +108,14 @@ public class AppletServiceImpl implements IAppletService {
|
|
|
RedisUtils.setCacheObject(key, value);
|
|
|
//如果是延迟放学,给后台首页记录延迟放学
|
|
|
//key = TODAY_YAN_CHI:学校id:日期 value = 数量
|
|
|
- String num = RedisUtils.getCacheObject(TODAY_YAN_CHI + formalTeacherClass.getSchoolId() + ":" + DateUtils.getDate());
|
|
|
- if (StringUtils.isBlank(num)) {
|
|
|
+ Object num = RedisUtils.getCacheObject(TODAY_YAN_CHI + formalTeacherClass.getSchoolId() + ":" + DateUtils.getDate());
|
|
|
+ if (ObjectUtils.isEmpty(num)) {
|
|
|
//如果是空,则说明今天还没有延迟放学,则插入
|
|
|
RedisUtils.setCacheObject(TODAY_YAN_CHI + formalTeacherClass.getSchoolId() + ":" + DateUtils.getDate(), 1);
|
|
|
RedisUtils.expire(TODAY_YAN_CHI + formalTeacherClass.getSchoolId() + ":" + DateUtils.getDate(), 86400 - (System.currentTimeMillis() / 1000 + 8 * 3600) % 86400);
|
|
|
} else {
|
|
|
//不为空则+1
|
|
|
- RedisUtils.setCacheObject(TODAY_YAN_CHI + formalTeacherClass.getSchoolId() + ":" + DateUtils.getDate(), Integer.parseInt(num) + 1);
|
|
|
+ RedisUtils.setCacheObject(TODAY_YAN_CHI + formalTeacherClass.getSchoolId() + ":" + DateUtils.getDate(), (int) num + 1);
|
|
|
RedisUtils.expire(TODAY_YAN_CHI + formalTeacherClass.getSchoolId() + ":" + DateUtils.getDate(), 86400 - (System.currentTimeMillis() / 1000 + 8 * 3600) % 86400);
|
|
|
}
|
|
|
|