|
@@ -0,0 +1,68 @@
|
|
|
+package com.fdkankan.job.job;
|
|
|
+
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
+import com.fdkankan.job.entity.ScenePro;
|
|
|
+import com.fdkankan.job.service.*;
|
|
|
+import com.fdkankan.redis.util.RedisUtil;
|
|
|
+import com.xxl.job.core.context.XxlJobHelper;
|
|
|
+import com.xxl.job.core.handler.annotation.XxlJob;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * v4场景回退v3
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author dengsixing
|
|
|
+ * @since 2022/12/16
|
|
|
+ **/
|
|
|
+@Slf4j
|
|
|
+@Component
|
|
|
+public class RepairVideosHandler {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISceneProService sceneProService;
|
|
|
+ @Autowired
|
|
|
+ ISceneEditInfoService sceneEditInfoService;
|
|
|
+
|
|
|
+
|
|
|
+ @XxlJob("repairVideosHandler")
|
|
|
+ public void V4toV3Handler(){
|
|
|
+ XxlJobHelper.log("repairVideosHandler start.....");
|
|
|
+
|
|
|
+ List<String> faildNumList = new ArrayList<>();
|
|
|
+
|
|
|
+ List<String> numList = null;
|
|
|
+ String nums = XxlJobHelper.getJobParam();
|
|
|
+ if(StrUtil.isNotEmpty(nums)){
|
|
|
+ numList = Arrays.asList(nums.split(","));
|
|
|
+ }
|
|
|
+
|
|
|
+ LambdaQueryWrapper<ScenePro> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper.like(ScenePro::getVideos, "/home/");
|
|
|
+ if(CollUtil.isNotEmpty(numList)){
|
|
|
+ queryWrapper.in(ScenePro::getNum, numList);
|
|
|
+ }
|
|
|
+ List<ScenePro> list = sceneProService.list(queryWrapper);
|
|
|
+
|
|
|
+ XxlJobHelper.log("待修复场景数:{}", list.size());
|
|
|
+
|
|
|
+ XxlJobHelper.log("repairVideosHandler end.....");
|
|
|
+ XxlJobHelper.log("失败场景码:" + JSON.toJSONString(faildNumList));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|