Commit a292fa28 authored by shiyu's avatar shiyu

发布的商品不符合规定就取消签到记录2

parent 2bcdd4c4
...@@ -226,7 +226,11 @@ public class UserSigninServiceImpl implements UserSigninService { ...@@ -226,7 +226,11 @@ public class UserSigninServiceImpl implements UserSigninService {
} }
//连续签到天数 //连续签到天数
UserSignIn lastedRecord = userSignInDao.findLastedRecord(userId); UserSignIn lastedRecord = userSignInDao.findLastedRecord(userId);
resultMap.put("totalConsecutiveDays", lastedRecord.getTotalConsecutiveDays() == null ? 0 : lastedRecord.getTotalConsecutiveDays()); if (lastedRecord == null) {
resultMap.put("totalConsecutiveDays", 0);
} else {
resultMap.put("totalConsecutiveDays", lastedRecord.getTotalConsecutiveDays() == null ? 0 : lastedRecord.getTotalConsecutiveDays());
}
//当前是几号 //当前是几号
LocalDate today = LocalDate.now(); LocalDate today = LocalDate.now();
...@@ -395,7 +399,7 @@ public class UserSigninServiceImpl implements UserSigninService { ...@@ -395,7 +399,7 @@ public class UserSigninServiceImpl implements UserSigninService {
//日历数据 //日历数据
resultMap.put("calendar", calendar); resultMap.put("calendar", calendar);
//签到进度 //签到进度
resultMap.put("rate", (int)Math.ceil((Double.valueOf(resultMap.get("consecutiveDays").toString()) / 21) * 100)); resultMap.put("rate", (int)Math.ceil((Double.valueOf(resultMap.get("consecutiveDays").toString()) / 365) * 100));
//查询用户当天有没有发布过商品 //查询用户当天有没有发布过商品
SupplierItemRequestDto supplierItemRequestDto = new SupplierItemRequestDto(); SupplierItemRequestDto supplierItemRequestDto = new SupplierItemRequestDto();
LocalDateTime startOfDay = today.atTime(LocalTime.MIN); LocalDateTime startOfDay = today.atTime(LocalTime.MIN);
......
...@@ -77,12 +77,12 @@ public class SignInNoticeJob { ...@@ -77,12 +77,12 @@ public class SignInNoticeJob {
/** /**
* 每天下午两点执行一次 * 每天下午两点执行一次
*/ */
@Scheduled(cron = "0 20 11 * * ?") @Scheduled(cron = "0 0 14 * * ?")
public void execute() { public void execute() {
/* if ("dev".equals(env)) { if ("dev".equals(env)) {
logger.info(">>>>>>>>>>>>>>>>>>>>>>> dev环境, 不执行发送签到提醒通知定时作业<<<<<<<<<<<<<<<<<<<<<"); logger.info(">>>>>>>>>>>>>>>>>>>>>>> dev环境, 不执行发送签到提醒通知定时作业<<<<<<<<<<<<<<<<<<<<<");
return; return;
}*/ }
RLock lock = redissonClient.getLock(SIGN_IN_NOTICE_KEY); RLock lock = redissonClient.getLock(SIGN_IN_NOTICE_KEY);
if (!lock.tryLock()) { if (!lock.tryLock()) {
logger.warn("发送签到提醒通知,当前服务实例获取锁成功: {} 获取锁失败,锁被占用不执行", Thread.currentThread().getId()); logger.warn("发送签到提醒通知,当前服务实例获取锁成功: {} 获取锁失败,锁被占用不执行", Thread.currentThread().getId());
......
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