ソースを参照

fix on 2020.8.19

jiequan.bi 4 年 前
コミット
93afc84414

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/mapper/xml/MaterialTopMapper.xml

@@ -3,6 +3,7 @@
 <mapper namespace="org.jeecg.modules.ctop.mapper.MaterialTopMapper">
     <select id="selectMapsPage" resultType="org.jeecg.modules.ctop.vo.MaterialTopVO">
         SELECT
+            code,
             url,
             cover_url,
             name,

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/vo/MaterialTopVO.java

@@ -6,6 +6,7 @@ import java.math.BigDecimal;
 
 @Data
 public class MaterialTopVO {
+    private String code;
     private String url;
     private String coverUrl;
     private String name ;

+ 6 - 6
module-check/src/main/java/cn/com/ctop/check/component/execute/GroovyScriptExecutor.java

@@ -53,7 +53,7 @@ public class GroovyScriptExecutor {
         if(script.getIsDelete()||!script.getExeState()){
             return Result.error(String.format("groovy script is invalid. api_name=%s", script.getApiName()));
         }else {
-            return executescriptScript(script);
+            return executeScript(script);
         }
     }
 
@@ -62,11 +62,11 @@ public class GroovyScriptExecutor {
         if (script == null) {
             return Result.error(String.format("groovy script not found. api_name=%s", apiName));
         }else {
-            return executescriptScript(script);
+            return executeScript(script);
         }
     }
 
-    private Result<Object> executescriptScript(CtopCheckTaskList taskList){
+    private Result<Object> executeScript(CtopCheckTaskList taskList){
         ClearCache();
         GroovyCodeSource groovyCodeSource = getGroovyCodeSource(taskList);
         Result<Object> response = null;
@@ -81,9 +81,9 @@ public class GroovyScriptExecutor {
                 scriptInstance.setCtopCheckTaskList(taskList);
                 response = scriptInstance.exec();
             } else {
-                scriptProcessLogExecutor.insertLogExecute(taskList,0L,0L,false,false);
-                log.error("script script should extends Abstractscript.");
-                response=Result.error("script script should extends Abstractscript.");
+                scriptProcessLogExecutor.insertLogExecute(taskList,start,0L,false,false);
+                log.error("script script should extends AbstractScript.");
+                response=Result.error("script script should extends AbstractScript.");
             }
             long end=System.currentTimeMillis();
             scriptProcessLogExecutor.insertLogExecute(taskList,start,end);

+ 16 - 0
module-check/src/main/java/cn/com/ctop/notice/handler/SendWeChatHandle.java

@@ -6,6 +6,9 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Arrays;
+import java.util.List;
+
 @Slf4j
 @Service
 public class SendWeChatHandle {
@@ -25,4 +28,17 @@ public class SendWeChatHandle {
         }
         return result;
     }
+
+    public void SendWeChatByMails(String mails,String message){
+        List<String> mail= Arrays.asList(mails.split(","));
+        mail.forEach(m->{
+            String weChatId=mailLogMapper.getWeChatByMail(m);
+            if(weChatId.isEmpty()){
+                log.error(String.format("mail's WeChat not found. mail =%s", m));
+                //TODO 通知管理员添加邮箱
+            }else{
+                CorpWexinUtils.sendMessageByWeChatId(weChatId,message);
+            }
+        });
+    }
 }

+ 1 - 1
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/CheckDataStateJob.java

@@ -28,7 +28,7 @@ public class CheckDataStateJob {
     public ReturnT<String> execute(String param) throws Exception {
         //查询需要检查的任务列表
         List<CtopCheckTaskList> ctopCheckTaskList= checkTaskListService.queryExecuteList(jobName);
-        if(!ctopCheckTaskList.isEmpty()){
+        if(ctopCheckTaskList!=null){
             ctopCheckTaskList.forEach(it-> groovyScriptExecutor.execute(it));
         }
         return ReturnT.SUCCESS;

+ 1 - 1
module-job-bytedance/src/main/java/cn/com/ctop/job/bytedance/handler/CheckExecuteStateJob.java

@@ -28,7 +28,7 @@ public class CheckExecuteStateJob {
     public ReturnT<String> execute(String param) throws Exception {
         //查询需要检查的任务列表
         List<CtopCheckTaskList> ctopCheckTaskList= checkTaskListService.queryExecuteList(jobName);
-        if(!ctopCheckTaskList.isEmpty()){
+        if(ctopCheckTaskList!=null){
             ctopCheckTaskList.forEach(it-> groovyScriptExecutor.execute(it));
         }
         return ReturnT.SUCCESS;