|
@@ -29,7 +29,9 @@ import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.time.LocalDate;
|
|
|
+import java.time.YearMonth;
|
|
|
import java.time.ZoneId;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
@@ -87,18 +89,24 @@ public class MemberSignInRecordServiceImpl implements MemberSignInRecordService
|
|
|
return summary;
|
|
|
}
|
|
|
// 4.2 连续签到天数
|
|
|
- summary.setContinuousDay(lastRecord.getDay());
|
|
|
+ summary.setContinuousDay(lastRecord.getContinueDay());
|
|
|
return summary;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public AppMemberSignInConfigMoonRespVO getOwnSignInMoon(Long loginUserId) {
|
|
|
+ public AppMemberSignInConfigMoonRespVO getOwnSignInMoon(Long loginUserId, String month) {
|
|
|
|
|
|
// 获取当前月份, 天数 , 星期数
|
|
|
List<Days> days = generateDaysForCurrentMonth();
|
|
|
LocalDate today = LocalDate.now();
|
|
|
LocalDate firstDayOfMonth = today.withDayOfMonth(1);
|
|
|
LocalDate lastDayOfMonth = today.withDayOfMonth(today.lengthOfMonth());
|
|
|
+ if (StringUtils.isNotBlank(month)){
|
|
|
+ // 解析字符串为YearMonth对象
|
|
|
+ YearMonth yearMonth = YearMonth.parse(month, DateTimeFormatter.ofPattern("yyyy-MM"));
|
|
|
+ firstDayOfMonth = yearMonth.atDay(1);
|
|
|
+ lastDayOfMonth = yearMonth.atEndOfMonth();
|
|
|
+ }
|
|
|
|
|
|
// 获取签到的天数
|
|
|
// 查询用户当月的签到情况
|