|
@@ -2,6 +2,8 @@ package com.yonge.cooleshow.biz.dal.service.impl;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.time.LocalDate;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.ZoneId;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Comparator;
|
|
|
import java.util.Date;
|
|
@@ -12,6 +14,8 @@ import java.util.Objects;
|
|
|
import java.util.Set;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import com.yonge.cooleshow.biz.dal.service.SysConfigService;
|
|
|
+import com.yonge.cooleshow.common.constant.SysConfigConstant;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -58,6 +62,9 @@ public class SysMusicCompareRecordServiceImpl extends BaseServiceImpl<Long, SysM
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private SysConfigService sysConfigService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private MusicSheetDao musicSheetDao;
|
|
|
|
|
|
@Override
|
|
@@ -102,6 +109,19 @@ public class SysMusicCompareRecordServiceImpl extends BaseServiceImpl<Long, SysM
|
|
|
jsonObject.put("heardLevel", userLastEvaluationData.getHeardLevel());
|
|
|
jsonObject.put("videoFilePath", userLastEvaluationData.getVideoFilePath());
|
|
|
jsonObject.put("partIndex", userLastEvaluationData.getPartIndex());
|
|
|
+ if(userLastEvaluationData.getCreateTime() == null) {
|
|
|
+ jsonObject.put("expire", 1);
|
|
|
+ } else {
|
|
|
+ LocalDateTime localDateTime = userLastEvaluationData.getCreateTime()
|
|
|
+ .toInstant()
|
|
|
+ .atZone(ZoneId.systemDefault())
|
|
|
+ .toLocalDateTime();
|
|
|
+ if (localDateTime.plusDays(Long.parseLong(getExpireTime())).compareTo(LocalDateTime.now()) <0) {
|
|
|
+ jsonObject.put("expire", 1);
|
|
|
+ } else {
|
|
|
+ jsonObject.put("expire", 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
MusicSheet sysMusicScore = musicSheetDao.selectById(userLastEvaluationData.getMusicSheetId());
|
|
|
if(Objects.nonNull(sysMusicScore)){
|
|
@@ -136,6 +156,7 @@ public class SysMusicCompareRecordServiceImpl extends BaseServiceImpl<Long, SysM
|
|
|
queryInfo.setFeatureType(FeatureType.CLOUD_STUDY_EVALUATION);
|
|
|
MapUtil.populateMap(params, queryInfo);
|
|
|
|
|
|
+ params.put("expireTime",getExpireTime());
|
|
|
List<SysMusicCompareRecord> dataList = null;
|
|
|
int count = this.findCount(params);
|
|
|
if (count > 0) {
|
|
@@ -192,4 +213,13 @@ public class SysMusicCompareRecordServiceImpl extends BaseServiceImpl<Long, SysM
|
|
|
return pageInfo;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private String getExpireTime() {
|
|
|
+
|
|
|
+ String homeworkExpireTime = sysConfigService.findConfigValue(SysConfigConstant.HOMEWORK_EXPIRE_TIME);
|
|
|
+ if (org.springframework.util.StringUtils.isEmpty(homeworkExpireTime)) {
|
|
|
+ return "9999";
|
|
|
+ }
|
|
|
+ return homeworkExpireTime;
|
|
|
+ }
|
|
|
}
|