From 8e4ab7792008f3ade896fe6d568d5cdbd63f747e Mon Sep 17 00:00:00 2001 From: ldj_willow Date: Tue, 11 Oct 2022 11:13:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...箔LMS系统接口.postman_collection.json | 154 ++++++++++++++++++ .../org/nl/modules/quartz/task/TestTask.java | 4 +- .../nl/modules/quartz/utils/ExecutionJob.java | 22 +-- .../src/main/resources/logback-spring.xml | 6 + 4 files changed, 163 insertions(+), 23 deletions(-) create mode 100644 doc/兰州铜箔LMS系统接口.postman_collection.json diff --git a/doc/兰州铜箔LMS系统接口.postman_collection.json b/doc/兰州铜箔LMS系统接口.postman_collection.json new file mode 100644 index 000000000..e38700bc8 --- /dev/null +++ b/doc/兰州铜箔LMS系统接口.postman_collection.json @@ -0,0 +1,154 @@ +{ + "info": { + "_postman_id": "3fab44b6-d4fb-4afd-81ad-31f1ec49c8c4", + "name": "兰州铜箔LMS系统接口", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "手持请求LMS", + "description": "", + "item": [ + { + "name": "登录", + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "http://localhost:8010/api/param/getStageCodeByCode", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8010", + "path": [ + "api", + "param", + "getStageCodeByCode" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "LMS请求MES", + "description": "", + "item": [ + { + "name": "http://localhost:8010/api/param/getStageCodeByCode", + "request": { + "method": "GET", + "header": [], + "body": {}, + "url": { + "raw": "http://localhost:8010/api/param/getStageCodeByCode", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8010", + "path": [ + "api", + "param", + "getStageCodeByCode" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "MES请求LMS", + "description": "", + "item": [], + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiI2ZjI2OGMxZjAyOTE0MTNiOWU3YThmMTM2ZTc2MWJkYSIsImF1dGgiOiJhZG1pbiIsInN1YiI6ImFkbWluIn0.lKxY3Wc_efzmBXXAS_dDC_Sfh32kZInxYmaxBzg83e5gviSJPPKolNt4IlCCaGM8HOc_yKByiIu8YFlgQif01Q", + "type": "string" + } + ] + } + }, + { + "name": "LMS请求CRM", + "description": "", + "item": [] + }, + { + "name": "CRM请求MES", + "description": "", + "item": [] + }, + { + "name": "ACS请求LMS", + "description": "", + "item": [], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "2f9e1cf4-d33b-4c2c-85fb-546f276da5b7", + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "id": "d7ddf3ac-5ecf-4a01-ae1c-c491bd7b645b", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "LMS请求ACS", + "description": "", + "item": [], + "event": [ + { + "listen": "prerequest", + "script": { + "id": "2f9e1cf4-d33b-4c2c-85fb-546f276da5b7", + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "id": "d7ddf3ac-5ecf-4a01-ae1c-c491bd7b645b", + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] + }, + { + "name": "SAP请求LMS", + "description": "", + "item": [] + }, + { + "name": "LMS请求SAP", + "description": "", + "item": [] + } + ] +} \ No newline at end of file diff --git a/nladmin-system/src/main/java/org/nl/modules/quartz/task/TestTask.java b/nladmin-system/src/main/java/org/nl/modules/quartz/task/TestTask.java index 6a0b518c9..2d99ded81 100644 --- a/nladmin-system/src/main/java/org/nl/modules/quartz/task/TestTask.java +++ b/nladmin-system/src/main/java/org/nl/modules/quartz/task/TestTask.java @@ -16,7 +16,6 @@ package org.nl.modules.quartz.task; import lombok.extern.slf4j.Slf4j; -import org.nl.modules.wql.core.bean.WQLObject; import org.springframework.stereotype.Component; /** @@ -29,7 +28,6 @@ import org.springframework.stereotype.Component; public class TestTask { public void run(){ - log.info("run 执行成功"); } @@ -38,7 +36,7 @@ public class TestTask { } public void run2(){ - WQLObject.getWQLObject("sys_param"); +// int i= 1/0; log.info("run2 执行成功"); } } diff --git a/nladmin-system/src/main/java/org/nl/modules/quartz/utils/ExecutionJob.java b/nladmin-system/src/main/java/org/nl/modules/quartz/utils/ExecutionJob.java index 0ea11bfea..d735ced2a 100644 --- a/nladmin-system/src/main/java/org/nl/modules/quartz/utils/ExecutionJob.java +++ b/nladmin-system/src/main/java/org/nl/modules/quartz/utils/ExecutionJob.java @@ -105,29 +105,11 @@ public class ExecutionJob extends QuartzJobBean { //更新状态 quartzJobService.updateIsPause(quartzJob); } -// if (quartzJob.getEmail() != null) { -// EmailService emailService = SpringContextHolder.getBean(EmailService.class); -// // 邮箱报警 -// EmailVo emailVo = taskAlarm(quartzJob, ThrowableUtil.getStackTrace(e)); -// emailService.send(emailVo, emailService.find()); -// } - } finally { + //异常时候打印日志 log.info(logDto.toString()); + } finally { quartzLogRepository.save(logDto); } } -// private EmailVo taskAlarm(QuartzJob quartzJob, String msg) { -// EmailVo emailVo = new EmailVo(); -// emailVo.setSubject("定时任务【" + quartzJob.getJobName() + "】执行失败,请尽快处理!"); -// Map data = new HashMap<>(16); -// data.put("task", quartzJob); -// data.put("msg", msg); -// TemplateEngine engine = TemplateUtil.createEngine(new TemplateConfig("template", TemplateConfig.ResourceMode.CLASSPATH)); -// Template template = engine.getTemplate("email/taskAlarm.ftl"); -// emailVo.setContent(template.render(data)); -// List emails = Arrays.asList(quartzJob.getEmail().split("[,,]")); -// emailVo.setTos(emails); -// return emailVo; -// } } diff --git a/nladmin-system/src/main/resources/logback-spring.xml b/nladmin-system/src/main/resources/logback-spring.xml index 84ff0e00e..b1d27a20e 100644 --- a/nladmin-system/src/main/resources/logback-spring.xml +++ b/nladmin-system/src/main/resources/logback-spring.xml @@ -85,6 +85,9 @@ https://juejin.cn/post/6844903775631572999 + + + @@ -106,6 +109,9 @@ https://juejin.cn/post/6844903775631572999 + + +