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

Commit e85d3763 authored by 胡佳晨's avatar 胡佳晨

脚本修改,增加历史积分不拦截每月上限

parent 85d65c0a
......@@ -81,11 +81,12 @@ public class DataImpl {
}
//获取演出每日任务积分
Integer performancePrice = orderTicketsMapper.getOrderScore(uid);
score += performancePrice.intValue() * 5;
score += (performancePrice.intValue() / 100);
//获取商品每日任务积分
String resultData = HttpUtil.get("http://devmall.zhengzai.tv/admin/sumUserCost?user_id=" + 1, null);
int goodsPrice = (int) JSONObject.parseObject(resultData).get("cost");
score += goodsPrice * 5;
score += (goodsPrice / 100);
//获取 关注摩登天空服务号
if (getUnionIdByPhone(mobile) != null) {
MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString();
......@@ -108,13 +109,13 @@ public class DataImpl {
params.add("taskId", 6 + "");
HttpUtil.post(stoneUrl + "/user/inner/doTask", params);
}
if (userInfoVo.getIsComplete() == 11) {
//获取 首次体验在场
MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString();
params.add("uid", uid);
params.add("taskId", 8 + "");
HttpUtil.post(stoneUrl + "/user/inner/doTask", params);
}
// if (userInfoVo.getIsComplete() == 11) {
// //获取 首次体验在场
// MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString();
// params.add("uid", uid);
// params.add("taskId", 8 + "");
// HttpUtil.post(stoneUrl + "/user/inner/doTask", params);
// }
//生成用户积分日志
int isLog = stoneScoreLogsMapper.selectCount(Wrappers.lambdaQuery(StoneScoreLogs.class).eq(StoneScoreLogs::getUid, uid).eq(StoneScoreLogs::getContent, "历史积分"));
if (isLog <= 0) {
......@@ -156,11 +157,11 @@ public class DataImpl {
}
//获取演出每日任务积分
Integer performancePrice = orderTicketsMapper.getOrderScore(uid);
score += performancePrice.intValue() * 5;
score += performancePrice.intValue() / 100;
//获取商品每日任务积分
String resultData = HttpUtil.get("http://devmall.zhengzai.tv/admin/sumUserCost?user_id=" + 1, null);
int goodsPrice = (int) JSONObject.parseObject(resultData).get("cost");
score += goodsPrice * 5;
score += goodsPrice / 100;
//获取 关注摩登天空服务号
if (getUnionIdByPhone(mobile) != null) {
......@@ -184,13 +185,13 @@ public class DataImpl {
params.add("taskId", 6 + "");
HttpUtil.post(stoneUrl + "/user/inner/doTask", params);
}
if (userInfoVo.getIsComplete() == 11) {
//获取 首次体验在场
MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString();
params.add("uid", uid);
params.add("taskId", 8 + "");
HttpUtil.post(stoneUrl + "/user/inner/doTask", params);
}
// if (userInfoVo.getIsComplete() == 11) {
// //获取 首次体验在场
// MultiValueMap<String, String> params = CollectionUtil.linkedMultiValueMapStringString();
// params.add("uid", uid);
// params.add("taskId", 8 + "");
// HttpUtil.post(stoneUrl + "/user/inner/doTask", params);
// }
//生成用户积分日志
int isLog = stoneScoreLogsMapper.selectCount(Wrappers.lambdaQuery(StoneScoreLogs.class).eq(StoneScoreLogs::getUid, uid).eq(StoneScoreLogs::getContent, "历史积分"));
if (isLog <= 0) {
......
......@@ -70,7 +70,7 @@ public class StoneScoreLogsServiceImpl implements IStoneScoreLogsService {
return "积分不能小于0";
}
if (TaskId == 2111) {
if (TaskId == 2111 && !reason.equals("历史积分")) {
StoneUserVo vo = stoneRedisUtils.getUserData(uid);
if (vo == null) {
vo = StoneUserVo.getNew();
......@@ -86,10 +86,8 @@ public class StoneScoreLogsServiceImpl implements IStoneScoreLogsService {
SqlMapping.get("stone_score_user.insert", IDGenerator.nextTimeId2(), vo.getUid(), vo.getStatus(), LocalDateTime.now())
);
}
// Date userDay = DateUtil.parse(vo.getCurrentDay()==null ? DateUtil.getNowTime() : vo.getCurrentDay(), "yyyy-MM-dd");
Date userMonth = DateUtil.parse(vo.getCurrentMonth()==null ? DateUtil.getNowTime() : vo.getCurrentMonth(), "yyyy-MM");
Date userMonth = DateUtil.parse(vo.getCurrentMonth() == null ? DateUtil.getNowTime() : vo.getCurrentMonth(), "yyyy-MM");
int monthScore = vo.getMonthScore() == null ? 0 : vo.getMonthScore();
// int dayScore = vo.getDayScore() == null ? 0 : vo.getDayScore();
if (DateUtil.compareMonth(userMonth, DateUtil.parse(DateUtil.getNowTime(), "yyyy-MM")) == 0) {//当月
if ((monthScore + score) >= monthMax) {
score = monthMax - monthScore;
......@@ -99,17 +97,19 @@ public class StoneScoreLogsServiceImpl implements IStoneScoreLogsService {
score = monthMax;
}
}
// if (DateUtil.compareDay(userDay, DateUtil.parse(DateUtil.getNowTime(), "yyyy-MM-dd")) == 0) {//当日
// if ((dayScore + score) >= dayMax) {
// score = dayMax - dayScore;
// }
// } else {
// if (score >= dayMax) {
// score = dayMax;
// Date userDay = DateUtil.parse(vo.getCurrentDay() == null ? DateUtil.getNowTime() : vo.getCurrentDay(), "yyyy-MM-dd");
// int dayScore = vo.getDayScore() == null ? 0 : vo.getDayScore();
// if (DateUtil.compareDay(userDay, DateUtil.parse(DateUtil.getNowTime(), "yyyy-MM-dd")) == 0) {//当日
// if ((dayScore + score) >= dayMax) {
// score = dayMax - dayScore;
// }
// } else {
// if (score >= dayMax) {
// score = dayMax;
// }
// }
// }
vo.setCurrentMonth(DateUtil.format(userMonth,DateUtil.Formatter.yyyyMMddHHmmss));
vo.setMonthScore(monthScore+score);
vo.setCurrentMonth(DateUtil.format(userMonth, DateUtil.Formatter.yyyyMMddHHmmss));
vo.setMonthScore(monthScore + score);
stoneRedisUtils.setUserData(uid, vo);
if (score == 0) {
return "成功";
......
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