Forráskód Böngészése

定时任务迁移

dsx 1 éve
szülő
commit
7eb3cc7aa2

+ 58 - 58
src/main/java/com/fdkankan/job/job/CleanDownloadPanoramaHandler.java

@@ -1,58 +1,58 @@
-package com.fdkankan.job.job;
-
-import cn.hutool.core.img.ImgUtil;
-import com.fdkankan.job.service.ISceneAsynOperLogService;
-import com.fdkankan.job.service.ISceneCleanOrigService;
-import com.fdkankan.job.service.IScenePlusService;
-import com.fdkankan.job.service.ISceneProService;
-import com.fdkankan.redis.constant.RedisLockKey;
-import com.fdkankan.redis.util.RedisLockUtil;
-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.cloud.context.config.annotation.RefreshScope;
-import org.springframework.stereotype.Component;
-
-import java.io.File;
-import java.sql.SQLException;
-
-/**
- * <p>
- * 场景冻结定时任务
- * </p>
- *
- * @author dengsixing
- * @since 2022/12/16
- **/
-@RefreshScope
-@Component
-@Slf4j
-public class CleanDownloadPanoramaHandler {
-
-    @Value("${env}")
-    private String env;
-
-    @Autowired
-    private IScenePlusService scenePlusService;
-    @Autowired
-    private ISceneProService sceneProService;
-    @Autowired
-    private RedisLockUtil redisLockUtil;
-    @Autowired
-    private ISceneCleanOrigService sceneCleanOrigService;
-    @Autowired
-    private ISceneAsynOperLogService sceneAsynOperLogService;
-
-    @XxlJob("cleanDownloadPanorama")
-    public void coldStorageHomeV3() throws Exception {
-        XxlJobHelper.log("cleanDownloadPanorama start.....");
-
-        log.info("定时清除全景图压缩包开始");
-        sceneAsynOperLogService.cleanDownloadPanorama();
-        log.info("定时清除全景图压缩包完毕");
-
-        XxlJobHelper.log("cleanDownloadPanorama end.....");
-    }
-}
+//package com.fdkankan.job.job;
+//
+//import cn.hutool.core.img.ImgUtil;
+//import com.fdkankan.job.service.ISceneAsynOperLogService;
+//import com.fdkankan.job.service.ISceneCleanOrigService;
+//import com.fdkankan.job.service.IScenePlusService;
+//import com.fdkankan.job.service.ISceneProService;
+//import com.fdkankan.redis.constant.RedisLockKey;
+//import com.fdkankan.redis.util.RedisLockUtil;
+//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.cloud.context.config.annotation.RefreshScope;
+//import org.springframework.stereotype.Component;
+//
+//import java.io.File;
+//import java.sql.SQLException;
+//
+///**
+// * <p>
+// * 场景冻结定时任务
+// * </p>
+// *
+// * @author dengsixing
+// * @since 2022/12/16
+// **/
+//@RefreshScope
+//@Component
+//@Slf4j
+//public class CleanDownloadPanoramaHandler {
+//
+//    @Value("${env}")
+//    private String env;
+//
+//    @Autowired
+//    private IScenePlusService scenePlusService;
+//    @Autowired
+//    private ISceneProService sceneProService;
+//    @Autowired
+//    private RedisLockUtil redisLockUtil;
+//    @Autowired
+//    private ISceneCleanOrigService sceneCleanOrigService;
+//    @Autowired
+//    private ISceneAsynOperLogService sceneAsynOperLogService;
+//
+//    @XxlJob("cleanDownloadPanorama")
+//    public void coldStorageHomeV3() throws Exception {
+//        XxlJobHelper.log("cleanDownloadPanorama start.....");
+//
+//        log.info("定时清除全景图压缩包开始");
+//        sceneAsynOperLogService.cleanDownloadPanorama();
+//        log.info("定时清除全景图压缩包完毕");
+//
+//        XxlJobHelper.log("cleanDownloadPanorama end.....");
+//    }
+//}

+ 71 - 71
src/main/java/com/fdkankan/job/job/CleanOss4DeleteSceneHandler.java

@@ -1,71 +1,71 @@
-package com.fdkankan.job.job;
-
-import com.fdkankan.job.service.ISceneCleanOrigService;
-import com.fdkankan.redis.constant.RedisLockKey;
-import com.fdkankan.redis.util.RedisLockUtil;
-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.cloud.context.config.annotation.RefreshScope;
-import org.springframework.stereotype.Component;
-
-/**
- * <p>
- * 已删除场景 清除oss文件
- * </p>
- *
- * @author dengsixing
- * @since 2022/12/16
- **/
-@RefreshScope
-@Component
-@Slf4j
-public class CleanOss4DeleteSceneHandler {
-
-    @Autowired
-    private RedisLockUtil redisLockUtil;
-    @Autowired
-    private ISceneCleanOrigService sceneCleanOrigService;
-
-    @XxlJob("cleanOss4DeletedSceneV3")
-    public void cleanOss4DeletedSceneV3(){
-        XxlJobHelper.log("cleanOss4DeletedSceneV3 start.....");
-
-        log.info("删除已删除V3场景原始资源开始");
-        String lockKey = RedisLockKey.LOCK_CLEAN_SCENE_DELETED_ORIG_V3;
-        try {
-            boolean lock = redisLockUtil.lock(lockKey, 24*60*60);
-            if(!lock){
-                return;
-            }
-            sceneCleanOrigService.cleanOss4DeletedSceneV3();
-        }finally {
-            redisLockUtil.unlockLua(lockKey);
-        }
-        log.info("删除已删除V3场景原始资源结束");
-
-        XxlJobHelper.log("cleanOss4DeletedSceneV3 end.....");
-    }
-
-    @XxlJob("cleanOss4DeletedSceneV4")
-    public void cleanOss4DeletedSceneV4() throws Exception {
-        XxlJobHelper.log("cleanOss4DeletedSceneV4 start.....");
-
-        log.info("删除已删除V4场景原始资源开始");
-        String lockKey = RedisLockKey.LOCK_CLEAN_SCENE_DELETED_ORIG_V4;
-        try {
-            boolean lock = redisLockUtil.lock(lockKey, 24*60*60);
-            if(!lock){
-                return;
-            }
-            sceneCleanOrigService.cleanOss4DeletedSceneV4();
-        }finally {
-            redisLockUtil.unlockLua(lockKey);
-        }
-        log.info("删除已删除V4场景原始资源结束");
-
-        XxlJobHelper.log("cleanOss4DeletedSceneV4 end.....");
-    }
-
-}
+//package com.fdkankan.job.job;
+//
+//import com.fdkankan.job.service.ISceneCleanOrigService;
+//import com.fdkankan.redis.constant.RedisLockKey;
+//import com.fdkankan.redis.util.RedisLockUtil;
+//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.cloud.context.config.annotation.RefreshScope;
+//import org.springframework.stereotype.Component;
+//
+///**
+// * <p>
+// * 已删除场景 清除oss文件
+// * </p>
+// *
+// * @author dengsixing
+// * @since 2022/12/16
+// **/
+//@RefreshScope
+//@Component
+//@Slf4j
+//public class CleanOss4DeleteSceneHandler {
+//
+//    @Autowired
+//    private RedisLockUtil redisLockUtil;
+//    @Autowired
+//    private ISceneCleanOrigService sceneCleanOrigService;
+//
+//    @XxlJob("cleanOss4DeletedSceneV3")
+//    public void cleanOss4DeletedSceneV3(){
+//        XxlJobHelper.log("cleanOss4DeletedSceneV3 start.....");
+//
+//        log.info("删除已删除V3场景原始资源开始");
+//        String lockKey = RedisLockKey.LOCK_CLEAN_SCENE_DELETED_ORIG_V3;
+//        try {
+//            boolean lock = redisLockUtil.lock(lockKey, 24*60*60);
+//            if(!lock){
+//                return;
+//            }
+//            sceneCleanOrigService.cleanOss4DeletedSceneV3();
+//        }finally {
+//            redisLockUtil.unlockLua(lockKey);
+//        }
+//        log.info("删除已删除V3场景原始资源结束");
+//
+//        XxlJobHelper.log("cleanOss4DeletedSceneV3 end.....");
+//    }
+//
+//    @XxlJob("cleanOss4DeletedSceneV4")
+//    public void cleanOss4DeletedSceneV4() throws Exception {
+//        XxlJobHelper.log("cleanOss4DeletedSceneV4 start.....");
+//
+//        log.info("删除已删除V4场景原始资源开始");
+//        String lockKey = RedisLockKey.LOCK_CLEAN_SCENE_DELETED_ORIG_V4;
+//        try {
+//            boolean lock = redisLockUtil.lock(lockKey, 24*60*60);
+//            if(!lock){
+//                return;
+//            }
+//            sceneCleanOrigService.cleanOss4DeletedSceneV4();
+//        }finally {
+//            redisLockUtil.unlockLua(lockKey);
+//        }
+//        log.info("删除已删除V4场景原始资源结束");
+//
+//        XxlJobHelper.log("cleanOss4DeletedSceneV4 end.....");
+//    }
+//
+//}

+ 113 - 113
src/main/java/com/fdkankan/job/job/SceneColdStorageHandler.java

@@ -1,113 +1,113 @@
-package com.fdkankan.job.job;
-
-import cn.hutool.core.collection.CollUtil;
-import cn.hutool.core.img.ImgUtil;
-import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.fdkankan.common.constant.CommonOperStatus;
-import com.fdkankan.common.util.DateExtUtil;
-import com.fdkankan.dingtalk.DingTalkSendUtils;
-import com.fdkankan.job.entity.SceneBuildProcessLog;
-import com.fdkankan.job.entity.ScenePlus;
-import com.fdkankan.job.entity.ScenePro;
-import com.fdkankan.job.service.ISceneBuildProcessLogService;
-import com.fdkankan.job.service.ISceneCleanOrigService;
-import com.fdkankan.job.service.IScenePlusService;
-import com.fdkankan.job.service.ISceneProService;
-import com.fdkankan.model.constants.SceneBuildProcessType;
-import com.fdkankan.redis.constant.RedisLockKey;
-import com.fdkankan.redis.util.RedisLockUtil;
-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.cloud.context.config.annotation.RefreshScope;
-import org.springframework.stereotype.Component;
-
-import java.io.File;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.stream.Collectors;
-
-/**
- * <p>
- * 场景冻结定时任务
- * </p>
- *
- * @author dengsixing
- * @since 2022/12/16
- **/
-@RefreshScope
-@Component
-@Slf4j
-public class SceneColdStorageHandler {
-
-    @Value("${env}")
-    private String env;
-
-    @Autowired
-    private IScenePlusService scenePlusService;
-    @Autowired
-    private ISceneProService sceneProService;
-    @Autowired
-    private RedisLockUtil redisLockUtil;
-    @Autowired
-    private ISceneCleanOrigService sceneCleanOrigService;
-
-    @XxlJob("coldStorageHomeV3")
-    public void coldStorageHomeV3() throws Exception {
-        XxlJobHelper.log("coldStorageHomeV3 start.....");
-
-        log.info("冻结v3场景原始资源开始");
-        String lockKey = RedisLockKey.LOCK_CLEAN_SCENE_ORIG_V3;
-        try {
-            boolean lock = redisLockUtil.lock(lockKey, 24*60*60);
-            if(!lock){
-                return;
-            }
-            sceneCleanOrigService.coldStorageHomeV3();
-        }finally {
-            redisLockUtil.unlockLua(lockKey);
-        }
-        log.info("冻结v3场景原始资源结束");
-
-
-
-        XxlJobHelper.log("coldStorageHomeV3 end.....");
-    }
-
-    @XxlJob("coldStorageHomeV4")
-    public void coldStorageHomeV4() throws Exception {
-        XxlJobHelper.log("coldStorageHomeV4 start.....");
-
-        log.info("冻结v4场景原始资源开始");
-        String lockKey = RedisLockKey.LOCK_CLEAN_SCENE_ORIG_V4;
-        try {
-            boolean lock = redisLockUtil.lock(lockKey, 24*60*60);
-            if(!lock){
-                return;
-            }
-            sceneCleanOrigService.coldStorageHomeV4();
-        }finally {
-            redisLockUtil.unlockLua(lockKey);
-        }
-        log.info("冻结v4场景原始资源结束");
-
-
-
-        XxlJobHelper.log("coldStorageHomeV4 end.....");
-    }
-
-    public static void main(String[] args) throws SQLException {
-
-        ImgUtil.scale(new File("C:\\Users\\dsx\\Desktop\\test\\20230116173304.jpg"), new File("C:\\Users\\dsx\\Desktop\\test\\3.jpg"), (float) 0.3);
-
-    }
-
-
-}
+//package com.fdkankan.job.job;
+//
+//import cn.hutool.core.collection.CollUtil;
+//import cn.hutool.core.img.ImgUtil;
+//import cn.hutool.core.util.StrUtil;
+//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+//import com.fdkankan.common.constant.CommonOperStatus;
+//import com.fdkankan.common.util.DateExtUtil;
+//import com.fdkankan.dingtalk.DingTalkSendUtils;
+//import com.fdkankan.job.entity.SceneBuildProcessLog;
+//import com.fdkankan.job.entity.ScenePlus;
+//import com.fdkankan.job.entity.ScenePro;
+//import com.fdkankan.job.service.ISceneBuildProcessLogService;
+//import com.fdkankan.job.service.ISceneCleanOrigService;
+//import com.fdkankan.job.service.IScenePlusService;
+//import com.fdkankan.job.service.ISceneProService;
+//import com.fdkankan.model.constants.SceneBuildProcessType;
+//import com.fdkankan.redis.constant.RedisLockKey;
+//import com.fdkankan.redis.util.RedisLockUtil;
+//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.cloud.context.config.annotation.RefreshScope;
+//import org.springframework.stereotype.Component;
+//
+//import java.io.File;
+//import java.sql.SQLException;
+//import java.util.ArrayList;
+//import java.util.Calendar;
+//import java.util.Date;
+//import java.util.List;
+//import java.util.concurrent.atomic.AtomicInteger;
+//import java.util.stream.Collectors;
+//
+///**
+// * <p>
+// * 场景冻结定时任务
+// * </p>
+// *
+// * @author dengsixing
+// * @since 2022/12/16
+// **/
+//@RefreshScope
+//@Component
+//@Slf4j
+//public class SceneColdStorageHandler {
+//
+//    @Value("${env}")
+//    private String env;
+//
+//    @Autowired
+//    private IScenePlusService scenePlusService;
+//    @Autowired
+//    private ISceneProService sceneProService;
+//    @Autowired
+//    private RedisLockUtil redisLockUtil;
+//    @Autowired
+//    private ISceneCleanOrigService sceneCleanOrigService;
+//
+//    @XxlJob("coldStorageHomeV3")
+//    public void coldStorageHomeV3() throws Exception {
+//        XxlJobHelper.log("coldStorageHomeV3 start.....");
+//
+//        log.info("冻结v3场景原始资源开始");
+//        String lockKey = RedisLockKey.LOCK_CLEAN_SCENE_ORIG_V3;
+//        try {
+//            boolean lock = redisLockUtil.lock(lockKey, 24*60*60);
+//            if(!lock){
+//                return;
+//            }
+//            sceneCleanOrigService.coldStorageHomeV3();
+//        }finally {
+//            redisLockUtil.unlockLua(lockKey);
+//        }
+//        log.info("冻结v3场景原始资源结束");
+//
+//
+//
+//        XxlJobHelper.log("coldStorageHomeV3 end.....");
+//    }
+//
+//    @XxlJob("coldStorageHomeV4")
+//    public void coldStorageHomeV4() throws Exception {
+//        XxlJobHelper.log("coldStorageHomeV4 start.....");
+//
+//        log.info("冻结v4场景原始资源开始");
+//        String lockKey = RedisLockKey.LOCK_CLEAN_SCENE_ORIG_V4;
+//        try {
+//            boolean lock = redisLockUtil.lock(lockKey, 24*60*60);
+//            if(!lock){
+//                return;
+//            }
+//            sceneCleanOrigService.coldStorageHomeV4();
+//        }finally {
+//            redisLockUtil.unlockLua(lockKey);
+//        }
+//        log.info("冻结v4场景原始资源结束");
+//
+//
+//
+//        XxlJobHelper.log("coldStorageHomeV4 end.....");
+//    }
+//
+//    public static void main(String[] args) throws SQLException {
+//
+//        ImgUtil.scale(new File("C:\\Users\\dsx\\Desktop\\test\\20230116173304.jpg"), new File("C:\\Users\\dsx\\Desktop\\test\\3.jpg"), (float) 0.3);
+//
+//    }
+//
+//
+//}

+ 0 - 12
src/main/resources/mapper/job/ScenePlusMapper.xml

@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.fdkankan.job.mapper.IScenePlusMapper">
-
-    <select id="selectColdStorageScene" resultType="com.fdkankan.job.dto.SceneBean">
-    </select>
-
-    <select id="selectCleanOrigSceneDeleted" resultType="com.fdkankan.scene.bean.SceneBean">
-    </select>
-
-
-</mapper>

+ 0 - 11
src/main/resources/mapper/job/SceneProMapper.xml

@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.fdkankan.job.mapper.ISceneProMapper">
-
-    <select id="selectColdStorageScene" resultType="com.fdkankan.job.dto.SceneBean">
-    </select>
-
-    <select id="listCleanOss4DeletedScene" resultType="com.fdkankan.job.dto.SceneBean">
-    </select>
-
-</mapper>