Browse Source

场景计算统计定时任务

dsx 2 years ago
parent
commit
65385d2e2d

+ 6 - 0
pom.xml

@@ -58,6 +58,12 @@
 
         <dependency>
             <groupId>com.fdkankan</groupId>
+            <artifactId>4dkankan-utils-dingtalk</artifactId>
+            <version>3.0.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.fdkankan</groupId>
             <artifactId>4dkankan-utils-redis</artifactId>
             <version>3.0.0-SNAPSHOT</version>
         </dependency>

+ 0 - 1
src/main/java/com/fdkankan/job/JobApplication.java

@@ -19,7 +19,6 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
 @EnableScheduling
 @ComponentScan(basePackages = {"com.fdkankan.*"})
 @MapperScan("com.fdkankan.**.mapper")
-@ForestScan(basePackages = "com.fdkankan.scene.httpclient")
 public class JobApplication {
 
     @Resource

+ 10 - 2
src/main/java/com/fdkankan/job/job/SceneCallCountHandler.java

@@ -10,6 +10,7 @@ import com.alibaba.druid.pool.DruidDataSource;
 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;
@@ -18,6 +19,7 @@ import com.fdkankan.job.service.ISceneBuildProcessLogService;
 import com.fdkankan.job.service.IScenePlusService;
 import com.fdkankan.job.service.ISceneProService;
 import com.fdkankan.model.constants.SceneBuildProcessType;
+import com.taobao.api.ApiException;
 import com.xxl.job.core.context.XxlJobHelper;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -26,6 +28,9 @@ import org.springframework.stereotype.Component;
 
 import javax.sql.DataSource;
 import java.io.File;
+import java.io.UnsupportedEncodingException;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
 import java.sql.SQLException;
 import java.util.Calendar;
 import java.util.Date;
@@ -51,6 +56,8 @@ public class SceneCallCountHandler {
     private ISceneProService sceneProService;
     @Autowired
     private ISceneBuildProcessLogService sceneBuildProcessLogService;
+    @Autowired
+    private DingTalkSendUtils dingTalkSendUtils;
 
     public static final String DINGTALK_MSG_PATTERN =
             "**日期**: %s\n\n" +
@@ -60,7 +67,7 @@ public class SceneCallCountHandler {
             "**错误日志**: %s";
 
     @XxlJob("sceneCallCountHandler")
-    private void repairSceneUpXmlUrlOfVideos() throws SQLException {
+    private void repairSceneUpXmlUrlOfVideos() throws SQLException, NoSuchAlgorithmException, ApiException, InvalidKeyException, UnsupportedEncodingException {
         XxlJobHelper.log("sceneCallCountHandler start.....");
 
         Date time = Calendar.getInstance().getTime();
@@ -113,7 +120,8 @@ public class SceneCallCountHandler {
                 v3Msg,
                 errorMsg);
 
-        XxlJobHelper.log(ddMsg);
+//        XxlJobHelper.log(ddMsg);
+        dingTalkSendUtils.sendActioncardMsgToDingRobot(ddMsg, "场景计算统计");
         XxlJobHelper.log("sceneCallCountHandler end.....");
     }