fixed 视频有效性判断

master
zhangjinli 2 years ago
parent a229e75d73
commit e20db155b8

@ -85,7 +85,7 @@ public class CommonWordsController {
private String title;
}
@Operation(summary = "更新标签名称")
@Operation(summary = "更新名称")
@PostMapping("/upd")
@AdminTokenValid
@AdminCheckAuthorityAnnotation(jurisdictionId = "131")

@ -59,7 +59,7 @@ public class StatisticsController {
@Data
static class SSParam {
@Schema(title = "时间条件", description = "1今日;2本周;3本月;4全年")
private Integer dateCondition;
private int dateCondition;
@Schema(title = "开始时间(yyyy-MM-dd HH:mm:ss)", description = "如果传入dateCondition以月份区间为条件")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime beginTime;
@ -72,14 +72,15 @@ public class StatisticsController {
@PostMapping("/data2")
@AdminTokenValid
public Result data2(@Validated @RequestBody SSParam param) {
Integer condition = param.getDateCondition();
System.out.println(condition);
QueryWrapper<Video> qw = new QueryWrapper<>();
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd");
DateTimeFormatter df2 = DateTimeFormatter.ofPattern("yyyy-MM");
LocalDate now = LocalDateTime.now().toLocalDate();
LocalDate before =now.with(TemporalAdjusters.firstDayOfMonth());
if (null != param.getDateCondition()) {
switch (param.getDateCondition()) {
if (null != condition) {
switch (condition) {
case 1:
before = now;
break;
@ -99,7 +100,7 @@ public class StatisticsController {
now = param.getEndTime() != null ? param.getEndTime().toLocalDate() : now;
}
ArrayList<JSONObject> res = new ArrayList<>();
if(param.getDateCondition() == 4){
if(condition == 4){
qw.between("date_format(creatAt, '%Y-%m')", before.format(df2), now.plusMonths(1).format(df2));
List<JSONObject> videoDataBydDay =adminMapper.statistics3(qw);
if (videoDataBydDay == null || videoDataBydDay.size() == 0) {

@ -133,9 +133,13 @@ public class VideoUController {
}
// 不支持重复提交
QueryWrapper<Video> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("userId", useId).eq("taskId", taskId).eq("type",video.getType()).ne("status", 3);
queryWrapper.eq("userId", useId).eq("taskId", taskId).eq("type", param.getType()).ne("status",3);
if (videoService.getMap(queryWrapper) != null) {
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "该视频已被使用");
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "已提交过该平台视频");
}
Map<String, Object> urlRepeat = videoService.getMap(new QueryWrapper<Video>().eq("url", video.getUrl()).ne("status",3));
if(null !=urlRepeat){
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "视频链接已被提交过");
}
videoService.save(video);
return Result.success("添加完成!");

Loading…
Cancel
Save