Commit 2bcdd4c4 authored by shiyu's avatar shiyu

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

parent d4718040
......@@ -616,14 +616,17 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
//发送短息通知用户商品违规被下架,跳转到个人藏馆
String url = wxAppletApi.getUrlLink("/pages/saleSelf/index","userId=" + oldItem.getCreatorId() + "&shareRecordId=");
String msg = "您发布的" + oldItem.getName() + ",内容涉嫌违反平台规定,已被平台下架,请前往"+ url + "查看";
aliSmsSender.sendSms(oldItem.getCreatorId(), msg);
//如果用户今天签到了,则取消签到记录
UserSignIn todaySignIn = userSignInDao.findTodayRecord(oldItem.getCreatorId());
if (todaySignIn != null) {
UserSignIn updateDto = new UserSignIn();
updateDto.setId(todaySignIn.getId());
// updateDto.set
updateDto.setIsValid(false);
userSignInDao.updateByPrimaryKey(updateDto);
msg = "您发布的" + oldItem.getName() + ",内容涉嫌违反平台规定,已被平台下架,并取消了今天的签到记录,请前往"+ url + "查看";
}
aliSmsSender.sendSms(oldItem.getCreatorId(), msg);
return Result.success();
} catch (Exception e) {
logger.error("违规下架失败 error : {}", e);
......
......@@ -86,6 +86,7 @@ public class UserSigninServiceImpl implements UserSigninService {
userSignin.setCreateTime(new Date());
userSignin.setUpdateTime(new Date());
userSignin.setConsecutiveDays(1);
userSignin.setTotalConsecutiveDays(1);
userSignin.setIsGet(false);
userSignin.setIsReward(false);
userSignin.setRewardLevel(SigninEnum.LevelEnum.ZERO.getCode());
......@@ -102,6 +103,8 @@ public class UserSigninServiceImpl implements UserSigninService {
consecutiveDays = yesterdaySignin.getConsecutiveDays() + 1;
}
userSignin.setConsecutiveDays(consecutiveDays);
userSignin.setTotalConsecutiveDays(yesterdaySignin.getTotalConsecutiveDays() + 1);
switch (consecutiveDays) {
case 7:
userSignin.setIsReward(true);
......@@ -221,6 +224,10 @@ public class UserSigninServiceImpl implements UserSigninService {
resultMap.put("needConsecutiveDays", 7);
}
}
//连续签到天数
UserSignIn lastedRecord = userSignInDao.findLastedRecord(userId);
resultMap.put("totalConsecutiveDays", lastedRecord.getTotalConsecutiveDays() == null ? 0 : lastedRecord.getTotalConsecutiveDays());
//当前是几号
LocalDate today = LocalDate.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
......
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