记得上下班打卡 | git大法好,push需谨慎

Commit 4cf84c4d authored by 胡佳晨's avatar 胡佳晨

临时积分规则

parent 63ad4bac
......@@ -87,6 +87,8 @@ public class StoneScoreLogsServiceImpl implements IStoneScoreLogsService {
} else if (item.getTaskType().equals(2) && item.getTaskCount() >= 1) {
return ResponseDto.failure("该任务已完成");
} else {
//增加积分
int score = 0;
//记录完成任务
if (taskId == 0) { //每日签到
if (DateUtil.intervalDays(DateUtil.parse(item.getTaskTime(), "yyyy-MM-dd"),
......@@ -94,14 +96,18 @@ public class StoneScoreLogsServiceImpl implements IStoneScoreLogsService {
) == 1L) {//连续签到
if (item.getTaskCount() >= 7) {
item.setTaskCount(1);
score = item.getTaskCount();
} else {
item.setTaskCount(item.getTaskCount() + 1);
score = item.getTaskCount();
}
} else {//非连续签到
item.setTaskCount(1);
score = item.getTaskCount();
}
} else {//其他
item.setTaskCount(1);
score = 10;
}
item.setTaskTime(DateUtil.getNowTime(DateUtil.DATE_SMALL_STR));
taskList.set(i, item);
......@@ -111,7 +117,7 @@ public class StoneScoreLogsServiceImpl implements IStoneScoreLogsService {
//redis
stoneRedisUtils.setUserData(uid,vo);
//添加积分
inScore(uid, taskId+1, taskId, item.getTaskName());
inScore(uid, score, taskId, item.getTaskName());
isIn = true;
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment