|
|
@ -365,47 +365,13 @@ public class CreatorProfitServiceImpl implements CreatorProfitService { |
|
|
return creatorProfitMapper.queryFrontEndAmtDetails(id); |
|
|
return creatorProfitMapper.queryFrontEndAmtDetails(id); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public boolean checkCreatorCanUpload(Long creatorId) { |
|
|
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
|
String date = df.format(new Date()); |
|
|
|
|
|
String redisKey = RedisKeyConstant.CREATOR_DOWNLOAD_KEY + date; |
|
|
|
|
|
if (redisService.hasHashKey(redisKey, creatorId.toString())) { |
|
|
|
|
|
//存在键,判断次数,次数达标则不可下载
|
|
|
|
|
|
Integer downloadNum = redisService.getCacheMapValue(redisKey, creatorId.toString()); |
|
|
|
|
|
if (downloadNum >= 40) { |
|
|
|
|
|
return true; |
|
|
|
|
|
} else { |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
}else{ |
|
|
|
|
|
//不存在键则可上传
|
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void batchDeleteCreatorDownloadNum() { |
|
|
|
|
|
log.info("==============批量删除昨日艺术家上传次数开始!==============="); |
|
|
|
|
|
long startTime = System.currentTimeMillis(); |
|
|
|
|
|
//获取昨日日期
|
|
|
|
|
|
Date yesterday = new Date(startTime - 1000 * 60 * 60 * 24); |
|
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
|
|
String date = simpleDateFormat.format(yesterday); |
|
|
|
|
|
String redisKey = RedisKeyConstant.CREATOR_DOWNLOAD_KEY + date; |
|
|
|
|
|
if(redisService.hasKey(redisKey)){ |
|
|
|
|
|
redisService.deleteObject(redisKey); |
|
|
|
|
|
} |
|
|
|
|
|
log.info("==============批量删除昨日艺术家上传次数完成,耗时【{}】毫秒!===============", System.currentTimeMillis() - startTime); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public boolean checkCreatorCanUpload(Long creatorId) { |
|
|
public boolean checkCreatorCanUpload(Long creatorId) { |
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); |
|
|
String date = df.format(new Date()); |
|
|
String date = df.format(new Date()); |
|
|
String redisKey = RedisKeyConstant.CREATOR_UPLOAD_KEY + date; |
|
|
String redisKey = RedisKeyConstant.CREATOR_UPLOAD_KEY + date; |
|
|
if (redisService.hasHashKey(redisKey, creatorId.toString())) { |
|
|
if (redisService.hasHashKey(redisKey, creatorId.toString())) { |
|
|
//存在键,判断次数,次数达标则不可上传
|
|
|
//存在键,判断次数,次数达标则不可下载
|
|
|
Integer downloadNum = redisService.getCacheMapValue(redisKey, creatorId.toString()); |
|
|
Integer downloadNum = redisService.getCacheMapValue(redisKey, creatorId.toString()); |
|
|
if (downloadNum >= 40) { |
|
|
if (downloadNum >= 40) { |
|
|
return true; |
|
|
return true; |
|
|
|