diff --git a/physical-base-core/pom.xml b/physical-base-core/pom.xml index 8d36a7a..54a9565 100644 --- a/physical-base-core/pom.xml +++ b/physical-base-core/pom.xml @@ -182,10 +182,10 @@ - - org.springframework.boot - spring-boot-starter-quartz - + + + + diff --git a/physical-base-core/src/test/java/org/jeecg/test/sqlinjection/TestInjectWithSqlParser.java b/physical-base-core/src/test/java/org/jeecg/test/sqlinjection/TestInjectWithSqlParser.java deleted file mode 100644 index d0bc00d..0000000 --- a/physical-base-core/src/test/java/org/jeecg/test/sqlinjection/TestInjectWithSqlParser.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.jeecg.test.sqlinjection; - -import lombok.extern.slf4j.Slf4j; -import net.sf.jsqlparser.JSQLParserException; -import org.jeecg.common.util.SqlInjectionUtil; -import org.junit.Test; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - - -/** - * SQL注入攻击检查测试 - * - * @author: liusq - * @date: 2023年09月08日 - */ -@Slf4j -public class TestInjectWithSqlParser { - /** - * 注入测试 - * - * @param sql - * @return - */ - private boolean isExistSqlInject(String sql) { - try { - SqlInjectionUtil.specialFilterContentForOnlineReport(sql); - return false; - } catch (Exception e) { - log.info("==================================================="); - return true; - } - } - - - @Test - public void test() throws JSQLParserException { - //不存在sql注入 - assertFalse(isExistSqlInject("select * from fm_time where dept_id=:sqlparamsmap.id and time=:sqlparamsmap.time")); - assertFalse(isExistSqlInject("select * from test")); - assertFalse(isExistSqlInject("select load_file(\"C:\\\\benben.txt\")")); - assertFalse(isExistSqlInject("WITH SUB1 AS (SELECT user FROM t1) SELECT * FROM T2 WHERE id > 123 ")); - - //存在sql注入 - assertTrue(isExistSqlInject("or 1= 1 --")); - assertTrue(isExistSqlInject("select * from test where sleep(%23)")); - assertTrue(isExistSqlInject("select * from test where id=1 and multipoint((select * from(select * from(select user())a)b));")); - assertTrue(isExistSqlInject("select * from users;show databases;")); - assertTrue(isExistSqlInject("select * from dc_device where id=1 and length((select group_concat(table_name) from information_schema.tables where table_schema=database()))>13")); - assertTrue(isExistSqlInject("update user set name = '123'")); - assertTrue(isExistSqlInject("SELECT * FROM users WHERE username = 'admin' AND password = '123456' OR 1=1;--")); - assertTrue(isExistSqlInject("select * from users where id=1 and (select count(*) from information_schema.tables where table_schema='数据库名')>4 %23")); - assertTrue(isExistSqlInject("select * from dc_device where sleep(5) %23")); - assertTrue(isExistSqlInject("select * from dc_device where id in (select id from other)")); - assertTrue(isExistSqlInject("select * from dc_device where id in (select id from other)")); - assertTrue(isExistSqlInject("select * from dc_device where 2=2.0 or 2 != 4")); - assertTrue(isExistSqlInject("select * from dc_device where 1!=2.0")); - assertTrue(isExistSqlInject("select * from dc_device where id=floor(2.0)")); - assertTrue(isExistSqlInject("select * from dc_device where not true")); - assertTrue(isExistSqlInject("select * from dc_device where 1 or id > 0")); - assertTrue(isExistSqlInject("select * from dc_device where 'tom' or id > 0")); - assertTrue(isExistSqlInject("select * from dc_device where '-2.3' ")); - assertTrue(isExistSqlInject("select * from dc_device where 2 ")); - assertTrue(isExistSqlInject("select * from dc_device where (3+2) ")); - assertTrue(isExistSqlInject("select * from dc_device where -1 IS TRUE")); - assertTrue(isExistSqlInject("select * from dc_device where 'hello' is null ")); - assertTrue(isExistSqlInject("select * from dc_device where '2022-10-31' and id > 0")); - assertTrue(isExistSqlInject("select * from dc_device where id > 0 or 1!=2.0 ")); - assertTrue(isExistSqlInject("select * from dc_device where id > 0 or 1 in (1,3,4) ")); - assertTrue(isExistSqlInject("select * from dc_device UNION select name from other")); - assertTrue(isExistSqlInject("(SELECT 6240 FROM (SELECT(SLEEP(5))and 1=2)vidl)")); - } - -} - diff --git a/physical-base-core/src/test/java/org/jeecg/test/sqlinjection/TestSqlInjectForDict.java b/physical-base-core/src/test/java/org/jeecg/test/sqlinjection/TestSqlInjectForDict.java deleted file mode 100644 index 8454442..0000000 --- a/physical-base-core/src/test/java/org/jeecg/test/sqlinjection/TestSqlInjectForDict.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.jeecg.test.sqlinjection; - -import lombok.extern.slf4j.Slf4j; -import net.sf.jsqlparser.JSQLParserException; -import org.jeecg.common.util.SqlInjectionUtil; -import org.junit.Test; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - - -/** - * SQL注入攻击检查测试 - * - * @author: liusq - * @date: 2023年09月08日 - */ -@Slf4j -public class TestSqlInjectForDict { - /** - * 注入测试 - * - * @param sql - * @return - */ - private boolean isExistSqlInject(String sql) { - try { - SqlInjectionUtil.specialFilterContentForDictSql(sql); - return false; - } catch (Exception e) { - log.info("==================================================="); - return true; - } - } - - - @Test - public void test() throws JSQLParserException { - //不存在sql注入 - assertFalse(isExistSqlInject("sys_user,realname,id")); - assertFalse(isExistSqlInject("oa_officialdoc_organcode,organ_name,id")); - assertFalse(isExistSqlInject("onl_cgform_head where table_type!=3 and copy_type=0,table_txt,table_name")); - assertFalse(isExistSqlInject("onl_cgform_head where copy_type = 0,table_txt,table_name")); - - //存在sql注入 - assertTrue(isExistSqlInject("or 1= 1 --")); - assertTrue(isExistSqlInject("select * from test where sleep(%23)")); - } - -} - diff --git a/physical-base-core/src/test/java/org/jeecg/test/sqlinjection/TestSqlInjectForOnlineReport.java b/physical-base-core/src/test/java/org/jeecg/test/sqlinjection/TestSqlInjectForOnlineReport.java deleted file mode 100644 index 697d35b..0000000 --- a/physical-base-core/src/test/java/org/jeecg/test/sqlinjection/TestSqlInjectForOnlineReport.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.jeecg.test.sqlinjection; - -import lombok.extern.slf4j.Slf4j; -import net.sf.jsqlparser.JSQLParserException; -import org.jeecg.common.util.SqlInjectionUtil; -import org.junit.Test; - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - - -/** - * SQL注入攻击检查测试 - * - * @author: liusq - * @date: 2023年09月08日 - */ -@Slf4j -public class TestSqlInjectForOnlineReport { - /** - * 注入测试 - * - * @param sql - * @return - */ - private boolean isExistSqlInject(String sql) { - try { - SqlInjectionUtil.specialFilterContentForOnlineReport(sql); - return false; - } catch (Exception e) { - log.info("==================================================="); - return true; - } - } - - - @Test - public void test() throws JSQLParserException { - //不存在sql注入 - assertFalse(isExistSqlInject("select * from fm_time where dept_id=:sqlparamsmap.id and time=:sqlparamsmap.time")); - assertFalse(isExistSqlInject("select * from test")); - assertFalse(isExistSqlInject("select load_file(\"C:\\\\benben.txt\")")); - assertFalse(isExistSqlInject("select * from dc_device where id in (select id from other)")); - assertFalse(isExistSqlInject("select * from dc_device UNION select name from other")); - - //存在sql注入 - assertTrue(isExistSqlInject("(SELECT 6240 FROM (SELECT(SLEEP(5))and 1=2)vidl)")); - assertTrue(isExistSqlInject("or 1= 1 --")); - assertTrue(isExistSqlInject("select * from test where sleep(%23)")); - assertTrue(isExistSqlInject("select * from test where SLEEP(3)")); - assertTrue(isExistSqlInject("select * from test where id=1 and multipoint((select * from(select * from(select user())a)b));")); - assertTrue(isExistSqlInject("select * from users;show databases;")); - assertTrue(isExistSqlInject("select * from dc_device where id=1 and length((select group_concat(table_name) from information_schema.tables where table_schema=database()))>13")); - assertTrue(isExistSqlInject("update user set name = '123'")); - assertTrue(isExistSqlInject("SELECT * FROM users WHERE username = 'admin' AND password = '123456' OR 1=1;--")); - assertTrue(isExistSqlInject("select * from users where id=1 and (select count(*) from information_schema.tables where table_schema='数据库名')>4 %23")); - assertTrue(isExistSqlInject("select * from dc_device where sleep(5) %23")); - } - -} - diff --git a/physical-base-core/src/test/java/org/jeecg/test/sqlinjection/TestSqlInjection.java b/physical-base-core/src/test/java/org/jeecg/test/sqlinjection/TestSqlInjection.java deleted file mode 100644 index 4b167f1..0000000 --- a/physical-base-core/src/test/java/org/jeecg/test/sqlinjection/TestSqlInjection.java +++ /dev/null @@ -1,103 +0,0 @@ -package org.jeecg.test.sqlinjection; - -import com.baomidou.mybatisplus.core.toolkit.sql.SqlInjectionUtils; -import org.jeecg.common.util.SqlInjectionUtil; -import org.junit.Test; - -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Pattern; - -/** - * @Description: SQL注入测试类 - * @author: scott - * @date: 2023年08月14日 9:55 - */ -public class TestSqlInjection { - - - /** - * 表名带别名,同时有html编码字符 - */ - @Test - public void testSpecialSQL() { - String tableName = "sys_user t"; - //解决使用参数tableName=sys_user t&复测,漏洞仍然存在 - if (tableName.contains(" ")) { - tableName = tableName.substring(0, tableName.indexOf(" ")); - } - //【issues/4393】 sys_user , (sys_user), sys_user%20, %60sys_user%60 - String reg = "\\s+|\\(|\\)|`"; - tableName = tableName.replaceAll(reg, ""); - System.out.println(tableName); - } - - - /** - * 测试sql是否含sql注入风险 - *

- * mybatis plus的方法 - */ - @Test - public void sqlInjectionCheck() { - String sql = "select * from sys_user"; - System.out.println(SqlInjectionUtils.check(sql)); - } - - - /** - * 测试sql是否有SLEEP风险 - *

- * mybatisPlus的方法 - */ - @Test - public void sqlSleepCheck() { - SqlInjectionUtil.checkSqlAnnotation("(SELECT 6240 FROM (SELECT(SLEEP(5))and 1=2)vidl)"); - } - - /** - * 测试sql是否含sql注入风险 - *

- * 自定义方法 - */ - @Test - public void sqlInjectionCheck2() { - String sql = "select * from sys_user"; - SqlInjectionUtil.specialFilterContentForOnlineReport(sql); - } - - /** - * 字段定义只能是是字母 数字 下划线的组合(不允许有空格、转义字符串等) - *

- * 判断字段名是否符合规范 - */ - @Test - public void testFieldSpecification() { - List list = new ArrayList(); - list.add("Hello World!"); - list.add("Hello%20World!"); - list.add("HelloWorld!"); - list.add("Hello World"); - list.add("age"); - list.add("user_name"); - list.add("user_name%20"); - list.add("user_name%20 "); - - for (String input : list) { - boolean containsSpecialChars = isValidString(input); - System.out.println("input:" + input + " ,包含空格和特殊字符: " + containsSpecialChars); - } - } - - /** - * 字段定义只能是是字母 数字 下划线的组合(不允许有空格、转义字符串等) - * - * @param input - * @return - */ - private static boolean isValidString(String input) { - Pattern pattern = Pattern.compile("^[a-zA-Z0-9_]+$"); - return pattern.matcher(input).matches(); - } - -} diff --git a/physical-base-core/src/test/java/org/jeecg/test/sqlparse/JSqlParserUtilsTest.java b/physical-base-core/src/test/java/org/jeecg/test/sqlparse/JSqlParserUtilsTest.java deleted file mode 100644 index 33d8d6d..0000000 --- a/physical-base-core/src/test/java/org/jeecg/test/sqlparse/JSqlParserUtilsTest.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.jeecg.test.sqlparse; - -import net.sf.jsqlparser.JSQLParserException; -import org.jeecg.common.util.oConvertUtils; -import org.jeecg.common.util.sqlparse.JSqlParserUtils; -import org.jeecg.common.util.sqlparse.vo.SelectSqlInfo; -import org.junit.Test; - -import java.util.Map; - -/** - * 针对 JSqlParserUtils 的单元测试 - */ -public class JSqlParserUtilsTest { - - private static final String[] sqlList = new String[]{ - "select * from sys_user", - "select u.* from sys_user u", - "select u.*, c.name from sys_user u, demo c", - "select u.age, c.name from sys_user u, demo c", - "select sex, age, c.name from sys_user, demo c", - // 别名测试 - "select username as realname from sys_user", - "select username as realname, u.realname as aaa, u.id bbb from sys_user u", - // 不存在真实地查询字段 - "select count(1) from sys_user", - // 函数式字段 - "select max(sex), id from sys_user", - // 复杂嵌套函数式字段 - "select CONCAT(CONCAT(' _ ', sex), ' - ' , birthday) as info, id from sys_user", - // 更复杂的嵌套函数式字段 - "select CONCAT(CONCAT(101,'_',NULL, DATE(create_time),'_',sex),' - ',birthday) as info, id from sys_user", - // 子查询SQL - "select u.name1 as name2 from (select username as name1 from sys_user) u", - // 多层嵌套子查询SQL - "select u2.name2 as name3 from (select u1.name1 as name2 from (select username as name1 from sys_user) u1) u2", - // 字段子查询SQL - "select id, (select username as name1 from sys_user u2 where u1.id = u2.id) as name2 from sys_user u1", - // 带条件的SQL(不解析where条件里的字段,但不影响解析查询字段) - "select username as name1 from sys_user where realname LIKE '%张%'", - // 多重复杂关联表查询解析,包含的表为:sys_user, sys_depart, sys_dict_item, demo - "" + - "SELECT " + - " u.*, d.age, sd.item_text AS sex, (SELECT count(sd.id) FROM sys_depart sd) AS count " + - "FROM " + - " (SELECT sd.username AS foo, sd.realname FROM sys_user sd) u, " + - " demo d " + - "LEFT JOIN sys_dict_item AS sd ON d.sex = sd.item_value " + - "WHERE sd.dict_id = '3d9a351be3436fbefb1307d4cfb49bf2'", - }; - - @Test - public void testParseSelectSql() { - System.out.println("-----------------------------------------"); - for (String sql : sqlList) { - System.out.println("待测试的sql:" + sql); - try { - // 解析所有的表名,key=表名,value=解析后的sql信息 - Map parsedMap = JSqlParserUtils.parseAllSelectTable(sql); - assert parsedMap != null; - for (Map.Entry entry : parsedMap.entrySet()) { - System.out.println("表名:" + entry.getKey()); - this.printSqlInfo(entry.getValue(), 1); - } - } catch (JSQLParserException e) { - System.out.println("SQL解析出现异常:" + e.getMessage()); - } - System.out.println("-----------------------------------------"); - } - } - - private void printSqlInfo(SelectSqlInfo sqlInfo, int level) { - String beforeStr = this.getBeforeStr(level); - if (sqlInfo.getFromTableName() == null) { - // 子查询 - System.out.println(beforeStr + "子查询:" + sqlInfo.getFromSubSelect().getParsedSql()); - this.printSqlInfo(sqlInfo.getFromSubSelect(), level + 1); - } else { - // 非子查询 - System.out.println(beforeStr + "查询的表名:" + sqlInfo.getFromTableName()); - } - if (oConvertUtils.isNotEmpty(sqlInfo.getFromTableAliasName())) { - System.out.println(beforeStr + "查询的表别名:" + sqlInfo.getFromTableAliasName()); - } - if (sqlInfo.isSelectAll()) { - System.out.println(beforeStr + "查询的字段:*"); - } else { - System.out.println(beforeStr + "查询的字段:" + sqlInfo.getSelectFields()); - System.out.println(beforeStr + "真实的字段:" + sqlInfo.getRealSelectFields()); - if (sqlInfo.getFromTableName() == null) { - System.out.println(beforeStr + "所有的字段(包括子查询):" + sqlInfo.getAllRealSelectFields()); - } - } - } - - // 打印前缀,根据层级来打印 - private String getBeforeStr(int level) { - if (level == 0) { - return ""; - } - StringBuilder beforeStr = new StringBuilder(); - for (int i = 0; i < level; i++) { - beforeStr.append(" "); - } - beforeStr.append("- "); - return beforeStr.toString(); - } - -} diff --git a/physical-base-core/src/test/java/org/jeecg/test/sqlparse/TestIpUtil.java b/physical-base-core/src/test/java/org/jeecg/test/sqlparse/TestIpUtil.java deleted file mode 100644 index d7d8ba9..0000000 --- a/physical-base-core/src/test/java/org/jeecg/test/sqlparse/TestIpUtil.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.jeecg.test.sqlparse; - -import org.jeecg.common.util.IpUtils; -import org.jeecg.common.util.oConvertUtils; -import org.junit.Test; - -import java.util.HashMap; -import java.util.Map; - -/** - * @author: scott - * @date: 2024年04月29日 16:48 - */ -public class TestIpUtil { - public static void main(String[] args) { - Map map = new HashMap<>(); - map.put("key1", new String[]{"value1", "value2", "value3"}); - map.put("key4", null); - map.put("key2", new String[]{"value4", "value5"}); - map.put("key3", new String[]{"value6"}); - System.out.println(oConvertUtils.mapToString(map)); - } - - @Test - public void test() { - String ip = "2408:8207:1851:10e0:50bd:1a50:60c8:b030, 115.231.101.180"; - String[] ipAddresses = ip.split(","); - for (String ipAddress : ipAddresses) { - System.out.println(ipAddress); - ipAddress = ipAddress.trim(); - if (IpUtils.isValidIpAddress(ipAddress)) { - System.out.println("ipAddress= " + ipAddress); - } - } - } -} diff --git a/physical-launcher/src/main/resources/application-dev.yml b/physical-launcher/src/main/resources/application-dev.yml index f36cf8f..a446563 100644 --- a/physical-launcher/src/main/resources/application-dev.yml +++ b/physical-launcher/src/main/resources/application-dev.yml @@ -64,33 +64,33 @@ spring: enable: true required: true ## quartz定时任务,采用数据库方式 - quartz: - job-store-type: jdbc - initialize-schema: embedded - #定时任务启动开关,true-开 false-关 - auto-startup: true - #延迟1秒启动定时任务 - startup-delay: 1s - #启动时更新己存在的Job - overwrite-existing-jobs: true - properties: - org: - quartz: - scheduler: - instanceName: MyScheduler - instanceId: AUTO - jobStore: - class: org.springframework.scheduling.quartz.LocalDataSourceJobStore - driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate - tablePrefix: QRTZ_ - isClustered: true - misfireThreshold: 12000 - clusterCheckinInterval: 15000 - threadPool: - class: org.quartz.simpl.SimpleThreadPool - threadCount: 10 - threadPriority: 5 - threadsInheritContextClassLoaderOfInitializingThread: true +# quartz: +# job-store-type: jdbc +# initialize-schema: embedded +# #定时任务启动开关,true-开 false-关 +# auto-startup: true +# #延迟1秒启动定时任务 +# startup-delay: 1s +# #启动时更新己存在的Job +# overwrite-existing-jobs: true +# properties: +# org: +# quartz: +# scheduler: +# instanceName: MyScheduler +# instanceId: AUTO +# jobStore: +# class: org.springframework.scheduling.quartz.LocalDataSourceJobStore +# driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate +# tablePrefix: QRTZ_ +# isClustered: true +# misfireThreshold: 12000 +# clusterCheckinInterval: 15000 +# threadPool: +# class: org.quartz.simpl.SimpleThreadPool +# threadCount: 10 +# threadPriority: 5 +# threadsInheritContextClassLoaderOfInitializingThread: true #json 时间戳统一转换 jackson: date-format: yyyy-MM-dd HH:mm:ss @@ -166,8 +166,8 @@ spring: slow-sql-millis: 5000 datasource: master: -# url: jdbc:mysql://127.0.0.1:3306/physical-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai - url: jdbc:mysql://192.168.50.100:23306/physical-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai + url: jdbc:mysql://127.0.0.1:3306/physical-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai +# url: jdbc:mysql://192.168.50.100:23306/physical-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai username: root password: 123456 driver-class-name: com.mysql.cj.jdbc.Driver diff --git a/physical-launcher/src/main/resources/application-prod.yml b/physical-launcher/src/main/resources/application-prod.yml index c76c779..a31d8a1 100644 --- a/physical-launcher/src/main/resources/application-prod.yml +++ b/physical-launcher/src/main/resources/application-prod.yml @@ -64,33 +64,33 @@ spring: enable: true required: true ## quartz定时任务,采用数据库方式 - quartz: - job-store-type: jdbc - initialize-schema: embedded - #定时任务开关,true-开 false-关 - auto-startup: false - #延迟1秒启动定时任务 - startup-delay: 1s - #启动时更新己存在的Job - overwrite-existing-jobs: true - properties: - org: - quartz: - scheduler: - instanceName: MyScheduler - instanceId: AUTO - jobStore: - class: org.springframework.scheduling.quartz.LocalDataSourceJobStore - driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate - tablePrefix: QRTZ_ - isClustered: true - misfireThreshold: 12000 - clusterCheckinInterval: 15000 - threadPool: - class: org.quartz.simpl.SimpleThreadPool - threadCount: 10 - threadPriority: 5 - threadsInheritContextClassLoaderOfInitializingThread: true +# quartz: +# job-store-type: jdbc +# initialize-schema: embedded +# #定时任务开关,true-开 false-关 +# auto-startup: false +# #延迟1秒启动定时任务 +# startup-delay: 1s +# #启动时更新己存在的Job +# overwrite-existing-jobs: true +# properties: +# org: +# quartz: +# scheduler: +# instanceName: MyScheduler +# instanceId: AUTO +# jobStore: +# class: org.springframework.scheduling.quartz.LocalDataSourceJobStore +# driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate +# tablePrefix: QRTZ_ +# isClustered: true +# misfireThreshold: 12000 +# clusterCheckinInterval: 15000 +# threadPool: +# class: org.quartz.simpl.SimpleThreadPool +# threadCount: 10 +# threadPriority: 5 +# threadsInheritContextClassLoaderOfInitializingThread: true #json 时间戳统一转换 jackson: date-format: yyyy-MM-dd HH:mm:ss diff --git a/physical-launcher/src/main/resources/application-test.yml b/physical-launcher/src/main/resources/application-test.yml index 6436097..5596684 100644 --- a/physical-launcher/src/main/resources/application-test.yml +++ b/physical-launcher/src/main/resources/application-test.yml @@ -64,33 +64,33 @@ spring: enable: true required: true ## quartz定时任务,采用数据库方式 - quartz: - job-store-type: jdbc - initialize-schema: embedded - #定时任务开关,true-开 false-关 - auto-startup: true - #延迟1秒启动定时任务 - startup-delay: 1s - #启动时更新己存在的Job - overwrite-existing-jobs: true - properties: - org: - quartz: - scheduler: - instanceName: MyScheduler - instanceId: AUTO - jobStore: - class: org.springframework.scheduling.quartz.LocalDataSourceJobStore - driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate - tablePrefix: QRTZ_ - isClustered: true - misfireThreshold: 12000 - clusterCheckinInterval: 15000 - threadPool: - class: org.quartz.simpl.SimpleThreadPool - threadCount: 10 - threadPriority: 5 - threadsInheritContextClassLoaderOfInitializingThread: true +# quartz: +# job-store-type: jdbc +# initialize-schema: embedded +# #定时任务开关,true-开 false-关 +# auto-startup: true +# #延迟1秒启动定时任务 +# startup-delay: 1s +# #启动时更新己存在的Job +# overwrite-existing-jobs: true +# properties: +# org: +# quartz: +# scheduler: +# instanceName: MyScheduler +# instanceId: AUTO +# jobStore: +# class: org.springframework.scheduling.quartz.LocalDataSourceJobStore +# driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate +# tablePrefix: QRTZ_ +# isClustered: true +# misfireThreshold: 12000 +# clusterCheckinInterval: 15000 +# threadPool: +# class: org.quartz.simpl.SimpleThreadPool +# threadCount: 10 +# threadPriority: 5 +# threadsInheritContextClassLoaderOfInitializingThread: true #json 时间戳统一转换 jackson: date-format: yyyy-MM-dd HH:mm:ss diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/uniapp/ExperimentReviewForm.vue b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/uniapp/ExperimentReviewForm.vue deleted file mode 100644 index e1b1a92..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/uniapp/ExperimentReviewForm.vue +++ /dev/null @@ -1,101 +0,0 @@ - - - diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/uniapp/ExperimentReviewList.vue b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/uniapp/ExperimentReviewList.vue deleted file mode 100644 index 09a2791..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/uniapp/ExperimentReviewList.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - - diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/uniapp/MigrationDataRecordForm.vue b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/uniapp/MigrationDataRecordForm.vue deleted file mode 100644 index 738ea2b..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/uniapp/MigrationDataRecordForm.vue +++ /dev/null @@ -1,119 +0,0 @@ - - - diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/uniapp/MigrationDataRecordList.vue b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/uniapp/MigrationDataRecordList.vue deleted file mode 100644 index e20280e..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/uniapp/MigrationDataRecordList.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - - diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/uniapp/NasaDataRecordForm.vue b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/uniapp/NasaDataRecordForm.vue deleted file mode 100644 index 8d91609..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/uniapp/NasaDataRecordForm.vue +++ /dev/null @@ -1,143 +0,0 @@ - - - diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/uniapp/NasaDataRecordList.vue b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/uniapp/NasaDataRecordList.vue deleted file mode 100644 index 50b848f..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/uniapp/NasaDataRecordList.vue +++ /dev/null @@ -1,44 +0,0 @@ - - - - diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/ExperimentReview.api.ts b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/ExperimentReview.api.ts deleted file mode 100644 index 3d7e823..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/ExperimentReview.api.ts +++ /dev/null @@ -1,64 +0,0 @@ -import {defHttp} from '/@/utils/http/axios'; -import { useMessage } from "/@/hooks/web/useMessage"; - -const { createConfirm } = useMessage(); - -enum Api { - list = '/database/experimentReview/list', - save='/database/experimentReview/add', - edit='/database/experimentReview/edit', - deleteOne = '/database/experimentReview/delete', - deleteBatch = '/database/experimentReview/deleteBatch', - importExcel = '/database/experimentReview/importExcel', - exportXls = '/database/experimentReview/exportXls', -} -/** - * 导出api - * @param params - */ -export const getExportUrl = Api.exportXls; -/** - * 导入api - */ -export const getImportUrl = Api.importExcel; -/** - * 列表接口 - * @param params - */ -export const list = (params) => - defHttp.get({url: Api.list, params}); - -/** - * 删除单个 - */ -export const deleteOne = (params,handleSuccess) => { - return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { - handleSuccess(); - }); -} -/** - * 批量删除 - * @param params - */ -export const batchDelete = (params, handleSuccess) => { - createConfirm({ - iconType: 'warning', - title: '确认删除', - content: '是否删除选中数据', - okText: '确认', - cancelText: '取消', - onOk: () => { - return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { - handleSuccess(); - }); - } - }); -} -/** - * 保存或者更新 - * @param params - */ -export const saveOrUpdate = (params, isUpdate) => { - let url = isUpdate ? Api.edit : Api.save; - return defHttp.post({url: url, params}); -} diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/ExperimentReview.data.ts b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/ExperimentReview.data.ts deleted file mode 100644 index 1805569..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/ExperimentReview.data.ts +++ /dev/null @@ -1,78 +0,0 @@ -import {BasicColumn} from '/@/components/Table'; -import {FormSchema} from '/@/components/Table'; -import { rules} from '/@/utils/helper/validator'; -import { render } from '/@/utils/common/renderUtils'; -import { getWeekMonthQuarterYear } from '/@/utils'; -//列表数据 -export const columns: BasicColumn[] = [ - { - title: '实验ID', - align:"center", - dataIndex: 'experimentalId' - }, - { - title: '评审流程', - align:"center", - dataIndex: 'reviewProcess' - }, - { - title: '评审详情(json大字段)', - align:"center", - dataIndex: 'reviewDetail' - }, - { - title: '评审结果', - align:"center", - dataIndex: 'reviewResult' - }, -]; -//查询数据 -export const searchFormSchema: FormSchema[] = [ -]; -//表单数据 -export const formSchema: FormSchema[] = [ - { - label: '实验ID', - field: 'experimentalId', - component: 'Input', - }, - { - label: '评审流程', - field: 'reviewProcess', - component: 'Input', - }, - { - label: '评审详情(json大字段)', - field: 'reviewDetail', - component: 'Input', - }, - { - label: '评审结果', - field: 'reviewResult', - component: 'Input', - }, - // TODO 主键隐藏字段,目前写死为ID - { - label: '', - field: 'id', - component: 'Input', - show: false - }, -]; - -// 高级查询数据 -export const superQuerySchema = { - experimentalId: {title: '实验ID',order: 0,view: 'text', type: 'string',}, - reviewProcess: {title: '评审流程',order: 1,view: 'text', type: 'string',}, - reviewDetail: {title: '评审详情(json大字段)',order: 2,view: 'text', type: 'string',}, - reviewResult: {title: '评审结果',order: 3,view: 'text', type: 'string',}, -}; - -/** -* 流程表单调用这个方法获取formSchema -* @param param -*/ -export function getBpmFormSchema(_formData): FormSchema[]{ - // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema - return formSchema; -} \ No newline at end of file diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/ExperimentReviewList.vue b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/ExperimentReviewList.vue deleted file mode 100644 index 445677f..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/ExperimentReviewList.vue +++ /dev/null @@ -1,188 +0,0 @@ - - - - - \ No newline at end of file diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/MigrationDataRecord.api.ts b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/MigrationDataRecord.api.ts deleted file mode 100644 index 020320f..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/MigrationDataRecord.api.ts +++ /dev/null @@ -1,64 +0,0 @@ -import {defHttp} from '/@/utils/http/axios'; -import { useMessage } from "/@/hooks/web/useMessage"; - -const { createConfirm } = useMessage(); - -enum Api { - list = '/database/migrationDataRecord/list', - save='/database/migrationDataRecord/add', - edit='/database/migrationDataRecord/edit', - deleteOne = '/database/migrationDataRecord/delete', - deleteBatch = '/database/migrationDataRecord/deleteBatch', - importExcel = '/database/migrationDataRecord/importExcel', - exportXls = '/database/migrationDataRecord/exportXls', -} -/** - * 导出api - * @param params - */ -export const getExportUrl = Api.exportXls; -/** - * 导入api - */ -export const getImportUrl = Api.importExcel; -/** - * 列表接口 - * @param params - */ -export const list = (params) => - defHttp.get({url: Api.list, params}); - -/** - * 删除单个 - */ -export const deleteOne = (params,handleSuccess) => { - return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { - handleSuccess(); - }); -} -/** - * 批量删除 - * @param params - */ -export const batchDelete = (params, handleSuccess) => { - createConfirm({ - iconType: 'warning', - title: '确认删除', - content: '是否删除选中数据', - okText: '确认', - cancelText: '取消', - onOk: () => { - return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { - handleSuccess(); - }); - } - }); -} -/** - * 保存或者更新 - * @param params - */ -export const saveOrUpdate = (params, isUpdate) => { - let url = isUpdate ? Api.edit : Api.save; - return defHttp.post({url: url, params}); -} diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/MigrationDataRecord.data.ts b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/MigrationDataRecord.data.ts deleted file mode 100644 index 6d804f8..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/MigrationDataRecord.data.ts +++ /dev/null @@ -1,111 +0,0 @@ -import {BasicColumn} from '/@/components/Table'; -import {FormSchema} from '/@/components/Table'; -import { rules} from '/@/utils/helper/validator'; -import { render } from '/@/utils/common/renderUtils'; -import { getWeekMonthQuarterYear } from '/@/utils'; -//列表数据 -export const columns: BasicColumn[] = [ - { - title: '试验类型', - align:"center", - dataIndex: 'type' - }, - { - title: '试验名称', - align:"center", - dataIndex: 'name' - }, - { - title: '委托方', - align:"center", - dataIndex: 'client' - }, - { - title: '生产厂家', - align:"center", - dataIndex: 'manufacturer' - }, - { - title: '试验时间', - align:"center", - dataIndex: 'experimentDate' - }, - { - title: '试验人员', - align:"center", - dataIndex: 'experimentUser' - }, - { - title: '实验详情(大字段)', - align:"center", - dataIndex: 'experimentDetail' - }, -]; -//查询数据 -export const searchFormSchema: FormSchema[] = [ -]; -//表单数据 -export const formSchema: FormSchema[] = [ - { - label: '试验类型', - field: 'type', - component: 'Input', - }, - { - label: '试验名称', - field: 'name', - component: 'Input', - }, - { - label: '委托方', - field: 'client', - component: 'Input', - }, - { - label: '生产厂家', - field: 'manufacturer', - component: 'Input', - }, - { - label: '试验时间', - field: 'experimentDate', - component: 'Input', - }, - { - label: '试验人员', - field: 'experimentUser', - component: 'Input', - }, - { - label: '实验详情(大字段)', - field: 'experimentDetail', - component: 'Input', - }, - // TODO 主键隐藏字段,目前写死为ID - { - label: '', - field: 'id', - component: 'Input', - show: false - }, -]; - -// 高级查询数据 -export const superQuerySchema = { - type: {title: '试验类型',order: 0,view: 'text', type: 'string',}, - name: {title: '试验名称',order: 1,view: 'text', type: 'string',}, - client: {title: '委托方',order: 2,view: 'text', type: 'string',}, - manufacturer: {title: '生产厂家',order: 3,view: 'text', type: 'string',}, - experimentDate: {title: '试验时间',order: 4,view: 'text', type: 'string',}, - experimentUser: {title: '试验人员',order: 5,view: 'text', type: 'string',}, - experimentDetail: {title: '实验详情(大字段)',order: 6,view: 'text', type: 'string',}, -}; - -/** -* 流程表单调用这个方法获取formSchema -* @param param -*/ -export function getBpmFormSchema(_formData): FormSchema[]{ - // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema - return formSchema; -} \ No newline at end of file diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/MigrationDataRecordList.vue b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/MigrationDataRecordList.vue deleted file mode 100644 index 49b0e15..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/MigrationDataRecordList.vue +++ /dev/null @@ -1,188 +0,0 @@ - - - - - \ No newline at end of file diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/NasaDataRecord.api.ts b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/NasaDataRecord.api.ts deleted file mode 100644 index 8d34d24..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/NasaDataRecord.api.ts +++ /dev/null @@ -1,64 +0,0 @@ -import {defHttp} from '/@/utils/http/axios'; -import { useMessage } from "/@/hooks/web/useMessage"; - -const { createConfirm } = useMessage(); - -enum Api { - list = '/database/nasaDataRecord/list', - save='/database/nasaDataRecord/add', - edit='/database/nasaDataRecord/edit', - deleteOne = '/database/nasaDataRecord/delete', - deleteBatch = '/database/nasaDataRecord/deleteBatch', - importExcel = '/database/nasaDataRecord/importExcel', - exportXls = '/database/nasaDataRecord/exportXls', -} -/** - * 导出api - * @param params - */ -export const getExportUrl = Api.exportXls; -/** - * 导入api - */ -export const getImportUrl = Api.importExcel; -/** - * 列表接口 - * @param params - */ -export const list = (params) => - defHttp.get({url: Api.list, params}); - -/** - * 删除单个 - */ -export const deleteOne = (params,handleSuccess) => { - return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { - handleSuccess(); - }); -} -/** - * 批量删除 - * @param params - */ -export const batchDelete = (params, handleSuccess) => { - createConfirm({ - iconType: 'warning', - title: '确认删除', - content: '是否删除选中数据', - okText: '确认', - cancelText: '取消', - onOk: () => { - return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { - handleSuccess(); - }); - } - }); -} -/** - * 保存或者更新 - * @param params - */ -export const saveOrUpdate = (params, isUpdate) => { - let url = isUpdate ? Api.edit : Api.save; - return defHttp.post({url: url, params}); -} diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/NasaDataRecord.data.ts b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/NasaDataRecord.data.ts deleted file mode 100644 index e326bb3..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/NasaDataRecord.data.ts +++ /dev/null @@ -1,155 +0,0 @@ -import {BasicColumn} from '/@/components/Table'; -import {FormSchema} from '/@/components/Table'; -import { rules} from '/@/utils/helper/validator'; -import { render } from '/@/utils/common/renderUtils'; -import { getWeekMonthQuarterYear } from '/@/utils'; -//列表数据 -export const columns: BasicColumn[] = [ - { - title: '器件类型', - align:"center", - dataIndex: 'deviceType' - }, - { - title: '器件名称', - align:"center", - dataIndex: 'deviceName' - }, - { - title: '器件型号', - align:"center", - dataIndex: 'deviceMode' - }, - { - title: '器件功能', - align:"center", - dataIndex: 'deviceFunction' - }, - { - title: '器件批次', - align:"center", - dataIndex: 'deviceBatch' - }, - { - title: '生产厂家', - align:"center", - dataIndex: 'manufacturer' - }, - { - title: '试验时间', - align:"center", - dataIndex: 'experimentDate' - }, - { - title: '数据来源', - align:"center", - dataIndex: 'dataSource' - }, - { - title: '试验人员', - align:"center", - dataIndex: 'experimentUser' - }, - { - title: '条目数统计', - align:"center", - dataIndex: 'totalCount' - }, - { - title: '附件IDs', - align:"center", - dataIndex: 'fileList' - }, -]; -//查询数据 -export const searchFormSchema: FormSchema[] = [ -]; -//表单数据 -export const formSchema: FormSchema[] = [ - { - label: '器件类型', - field: 'deviceType', - component: 'Input', - }, - { - label: '器件名称', - field: 'deviceName', - component: 'Input', - }, - { - label: '器件型号', - field: 'deviceMode', - component: 'Input', - }, - { - label: '器件功能', - field: 'deviceFunction', - component: 'Input', - }, - { - label: '器件批次', - field: 'deviceBatch', - component: 'Input', - }, - { - label: '生产厂家', - field: 'manufacturer', - component: 'Input', - }, - { - label: '试验时间', - field: 'experimentDate', - component: 'Input', - }, - { - label: '数据来源', - field: 'dataSource', - component: 'Input', - }, - { - label: '试验人员', - field: 'experimentUser', - component: 'Input', - }, - { - label: '条目数统计', - field: 'totalCount', - component: 'Input', - }, - { - label: '附件IDs', - field: 'fileList', - component: 'Input', - }, - // TODO 主键隐藏字段,目前写死为ID - { - label: '', - field: 'id', - component: 'Input', - show: false - }, -]; - -// 高级查询数据 -export const superQuerySchema = { - deviceType: {title: '器件类型',order: 0,view: 'text', type: 'string',}, - deviceName: {title: '器件名称',order: 1,view: 'text', type: 'string',}, - deviceMode: {title: '器件型号',order: 2,view: 'text', type: 'string',}, - deviceFunction: {title: '器件功能',order: 3,view: 'text', type: 'string',}, - deviceBatch: {title: '器件批次',order: 4,view: 'text', type: 'string',}, - manufacturer: {title: '生产厂家',order: 5,view: 'text', type: 'string',}, - experimentDate: {title: '试验时间',order: 6,view: 'text', type: 'string',}, - dataSource: {title: '数据来源',order: 7,view: 'text', type: 'string',}, - experimentUser: {title: '试验人员',order: 8,view: 'text', type: 'string',}, - totalCount: {title: '条目数统计',order: 9,view: 'text', type: 'string',}, - fileList: {title: '附件IDs',order: 10,view: 'text', type: 'string',}, -}; - -/** -* 流程表单调用这个方法获取formSchema -* @param param -*/ -export function getBpmFormSchema(_formData): FormSchema[]{ - // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema - return formSchema; -} \ No newline at end of file diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/NasaDataRecordList.vue b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/NasaDataRecordList.vue deleted file mode 100644 index b8f22d3..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/NasaDataRecordList.vue +++ /dev/null @@ -1,188 +0,0 @@ - - - - - \ No newline at end of file diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/V20241104_1__menu_insert_MigrationDataRecord.sql b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/V20241104_1__menu_insert_MigrationDataRecord.sql deleted file mode 100644 index b2422c6..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/V20241104_1__menu_insert_MigrationDataRecord.sql +++ /dev/null @@ -1,26 +0,0 @@ --- 注意:该页面对应的前台目录为views/database文件夹下 --- 如果你想更改到其他目录,请修改sql中component字段对应的值 - - -INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) -VALUES ('2024110401285550100', NULL, '迁移数据管理', '/database/migrationDataRecordList', 'database/MigrationDataRecordList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2024-11-04 13:28:10', NULL, NULL, 0); - --- 权限控制sql --- 新增 -INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('2024110401285550101', '2024110401285550100', '添加迁移数据管理', NULL, NULL, 0, NULL, NULL, 2, 'database:migration_data_record:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-04 13:28:10', NULL, NULL, 0, 0, '1', 0); --- 编辑 -INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('2024110401285550102', '2024110401285550100', '编辑迁移数据管理', NULL, NULL, 0, NULL, NULL, 2, 'database:migration_data_record:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-04 13:28:10', NULL, NULL, 0, 0, '1', 0); --- 删除 -INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('2024110401285550103', '2024110401285550100', '删除迁移数据管理', NULL, NULL, 0, NULL, NULL, 2, 'database:migration_data_record:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-04 13:28:10', NULL, NULL, 0, 0, '1', 0); --- 批量删除 -INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('2024110401285550104', '2024110401285550100', '批量删除迁移数据管理', NULL, NULL, 0, NULL, NULL, 2, 'database:migration_data_record:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-04 13:28:10', NULL, NULL, 0, 0, '1', 0); --- 导出excel -INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('2024110401285550105', '2024110401285550100', '导出excel_迁移数据管理', NULL, NULL, 0, NULL, NULL, 2, 'database:migration_data_record:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-04 13:28:10', NULL, NULL, 0, 0, '1', 0); --- 导入excel -INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('2024110401285550106', '2024110401285550100', '导入excel_迁移数据管理', NULL, NULL, 0, NULL, NULL, 2, 'database:migration_data_record:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-04 13:28:10', NULL, NULL, 0, 0, '1', 0); \ No newline at end of file diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/V20241104_1__menu_insert_NasaDataRecord.sql b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/V20241104_1__menu_insert_NasaDataRecord.sql deleted file mode 100644 index 159fe10..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/V20241104_1__menu_insert_NasaDataRecord.sql +++ /dev/null @@ -1,26 +0,0 @@ --- 注意:该页面对应的前台目录为views/database文件夹下 --- 如果你想更改到其他目录,请修改sql中component字段对应的值 - - -INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) -VALUES ('2024110401279790110', NULL, 'NASA数据管理', '/database/nasaDataRecordList', 'database/NasaDataRecordList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2024-11-04 13:27:11', NULL, NULL, 0); - --- 权限控制sql --- 新增 -INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('2024110401279800111', '2024110401279790110', '添加NASA数据管理', NULL, NULL, 0, NULL, NULL, 2, 'database:nasa_data_record:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-04 13:27:11', NULL, NULL, 0, 0, '1', 0); --- 编辑 -INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('2024110401279800112', '2024110401279790110', '编辑NASA数据管理', NULL, NULL, 0, NULL, NULL, 2, 'database:nasa_data_record:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-04 13:27:11', NULL, NULL, 0, 0, '1', 0); --- 删除 -INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('2024110401279800113', '2024110401279790110', '删除NASA数据管理', NULL, NULL, 0, NULL, NULL, 2, 'database:nasa_data_record:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-04 13:27:11', NULL, NULL, 0, 0, '1', 0); --- 批量删除 -INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('2024110401279800114', '2024110401279790110', '批量删除NASA数据管理', NULL, NULL, 0, NULL, NULL, 2, 'database:nasa_data_record:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-04 13:27:11', NULL, NULL, 0, 0, '1', 0); --- 导出excel -INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('2024110401279800115', '2024110401279790110', '导出excel_NASA数据管理', NULL, NULL, 0, NULL, NULL, 2, 'database:nasa_data_record:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-04 13:27:11', NULL, NULL, 0, 0, '1', 0); --- 导入excel -INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('2024110401279800116', '2024110401279790110', '导入excel_NASA数据管理', NULL, NULL, 0, NULL, NULL, 2, 'database:nasa_data_record:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-04 13:27:11', NULL, NULL, 0, 0, '1', 0); \ No newline at end of file diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/V20241105_1__menu_insert_ExperimentReview.sql b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/V20241105_1__menu_insert_ExperimentReview.sql deleted file mode 100644 index ed391d5..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/V20241105_1__menu_insert_ExperimentReview.sql +++ /dev/null @@ -1,26 +0,0 @@ --- 注意:该页面对应的前台目录为views/database文件夹下 --- 如果你想更改到其他目录,请修改sql中component字段对应的值 - - -INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) -VALUES ('2024110502579840310', NULL, '试验评定', '/database/experimentReviewList', 'database/ExperimentReviewList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2024-11-05 02:57:31', NULL, NULL, 0); - --- 权限控制sql --- 新增 -INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('2024110502579850311', '2024110502579840310', '添加试验评定', NULL, NULL, 0, NULL, NULL, 2, 'database:experiment_review:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-05 02:57:31', NULL, NULL, 0, 0, '1', 0); --- 编辑 -INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('2024110502579850312', '2024110502579840310', '编辑试验评定', NULL, NULL, 0, NULL, NULL, 2, 'database:experiment_review:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-05 02:57:31', NULL, NULL, 0, 0, '1', 0); --- 删除 -INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('2024110502579850313', '2024110502579840310', '删除试验评定', NULL, NULL, 0, NULL, NULL, 2, 'database:experiment_review:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-05 02:57:31', NULL, NULL, 0, 0, '1', 0); --- 批量删除 -INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('2024110502579850314', '2024110502579840310', '批量删除试验评定', NULL, NULL, 0, NULL, NULL, 2, 'database:experiment_review:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-05 02:57:31', NULL, NULL, 0, 0, '1', 0); --- 导出excel -INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('2024110502579850315', '2024110502579840310', '导出excel_试验评定', NULL, NULL, 0, NULL, NULL, 2, 'database:experiment_review:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-05 02:57:31', NULL, NULL, 0, 0, '1', 0); --- 导入excel -INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) -VALUES ('2024110502579850316', '2024110502579840310', '导入excel_试验评定', NULL, NULL, 0, NULL, NULL, 2, 'database:experiment_review:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-11-05 02:57:31', NULL, NULL, 0, 0, '1', 0); \ No newline at end of file diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/components/ExperimentReviewForm.vue b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/components/ExperimentReviewForm.vue deleted file mode 100644 index d147df4..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/components/ExperimentReviewForm.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - \ No newline at end of file diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/components/ExperimentReviewModal.vue b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/components/ExperimentReviewModal.vue deleted file mode 100644 index 8165d09..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/components/ExperimentReviewModal.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - - \ No newline at end of file diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/components/MigrationDataRecordForm.vue b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/components/MigrationDataRecordForm.vue deleted file mode 100644 index da09129..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/components/MigrationDataRecordForm.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - \ No newline at end of file diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/components/MigrationDataRecordModal.vue b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/components/MigrationDataRecordModal.vue deleted file mode 100644 index caa0a1d..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/components/MigrationDataRecordModal.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - - \ No newline at end of file diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/components/NasaDataRecordForm.vue b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/components/NasaDataRecordForm.vue deleted file mode 100644 index 3ed6600..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/components/NasaDataRecordForm.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - \ No newline at end of file diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/components/NasaDataRecordModal.vue b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/components/NasaDataRecordModal.vue deleted file mode 100644 index dfaecaf..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/database/vue3/components/NasaDataRecordModal.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - - \ No newline at end of file diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/message/job/SendMsgJob.java b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/message/job/SendMsgJob.java index a6684f9..21f890a 100644 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/message/job/SendMsgJob.java +++ b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/message/job/SendMsgJob.java @@ -1,71 +1,71 @@ -package org.jeecg.modules.message.job; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import lombok.extern.slf4j.Slf4j; -import org.jeecg.common.api.dto.message.MessageDTO; -import org.jeecg.common.system.api.ISysBaseAPI; -import org.jeecg.common.util.DateUtils; -import org.jeecg.modules.message.entity.SysMessage; -import org.jeecg.modules.message.handle.enums.SendMsgStatusEnum; -import org.jeecg.modules.message.service.ISysMessageService; -import org.quartz.Job; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.List; - -/** - * 发送消息任务 - * - * @author: jeecg-boot - */ - -@Slf4j -public class SendMsgJob implements Job { - - @Autowired - private ISysMessageService sysMessageService; - - @Autowired - private ISysBaseAPI sysBaseAPI; - - @Override - public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { - - log.info(String.format(" Jeecg-Boot 发送消息任务 SendMsgJob ! 时间:" + DateUtils.getTimestamp())); - - // 1.读取消息中心数据,只查询未发送的和发送失败不超过次数的 - QueryWrapper queryWrapper = new QueryWrapper(); - queryWrapper.eq("es_send_status", SendMsgStatusEnum.WAIT.getCode()) - .or(i -> i.eq("es_send_status", SendMsgStatusEnum.FAIL.getCode()).lt("es_send_num", 6)); - List sysMessages = sysMessageService.list(queryWrapper); - System.out.println(sysMessages); - // 2.根据不同的类型走不通的发送实现类 - for (SysMessage sysMessage : sysMessages) { - //update-begin-author:taoyan date:2022-7-8 for: 模板消息发送测试调用方法修改 - Integer sendNum = sysMessage.getEsSendNum(); - try { - MessageDTO md = new MessageDTO(); - md.setTitle(sysMessage.getEsTitle()); - md.setContent(sysMessage.getEsContent()); - md.setToUser(sysMessage.getEsReceiver()); - md.setType(sysMessage.getEsType()); - md.setToAll(false); - sysBaseAPI.sendTemplateMessage(md); - //发送消息成功 - sysMessage.setEsSendStatus(SendMsgStatusEnum.SUCCESS.getCode()); - //update-end-author:taoyan date:2022-7-8 for: 模板消息发送测试调用方法修改 - } catch (Exception e) { - e.printStackTrace(); - // 发送消息出现异常 - sysMessage.setEsSendStatus(SendMsgStatusEnum.FAIL.getCode()); - } - sysMessage.setEsSendNum(++sendNum); - // 发送结果回写到数据库 - sysMessageService.updateById(sysMessage); - } - - } - -} +//package org.jeecg.modules.message.job; +// +//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +//import lombok.extern.slf4j.Slf4j; +//import org.jeecg.common.api.dto.message.MessageDTO; +//import org.jeecg.common.system.api.ISysBaseAPI; +//import org.jeecg.common.util.DateUtils; +//import org.jeecg.modules.message.entity.SysMessage; +//import org.jeecg.modules.message.handle.enums.SendMsgStatusEnum; +//import org.jeecg.modules.message.service.ISysMessageService; +//import org.quartz.Job; +//import org.quartz.JobExecutionContext; +//import org.quartz.JobExecutionException; +//import org.springframework.beans.factory.annotation.Autowired; +// +//import java.util.List; +// +///** +// * 发送消息任务 +// * +// * @author: jeecg-boot +// */ +// +//@Slf4j +//public class SendMsgJob implements Job { +// +// @Autowired +// private ISysMessageService sysMessageService; +// +// @Autowired +// private ISysBaseAPI sysBaseAPI; +// +// @Override +// public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { +// +// log.info(String.format(" Jeecg-Boot 发送消息任务 SendMsgJob ! 时间:" + DateUtils.getTimestamp())); +// +// // 1.读取消息中心数据,只查询未发送的和发送失败不超过次数的 +// QueryWrapper queryWrapper = new QueryWrapper(); +// queryWrapper.eq("es_send_status", SendMsgStatusEnum.WAIT.getCode()) +// .or(i -> i.eq("es_send_status", SendMsgStatusEnum.FAIL.getCode()).lt("es_send_num", 6)); +// List sysMessages = sysMessageService.list(queryWrapper); +// System.out.println(sysMessages); +// // 2.根据不同的类型走不通的发送实现类 +// for (SysMessage sysMessage : sysMessages) { +// //update-begin-author:taoyan date:2022-7-8 for: 模板消息发送测试调用方法修改 +// Integer sendNum = sysMessage.getEsSendNum(); +// try { +// MessageDTO md = new MessageDTO(); +// md.setTitle(sysMessage.getEsTitle()); +// md.setContent(sysMessage.getEsContent()); +// md.setToUser(sysMessage.getEsReceiver()); +// md.setType(sysMessage.getEsType()); +// md.setToAll(false); +// sysBaseAPI.sendTemplateMessage(md); +// //发送消息成功 +// sysMessage.setEsSendStatus(SendMsgStatusEnum.SUCCESS.getCode()); +// //update-end-author:taoyan date:2022-7-8 for: 模板消息发送测试调用方法修改 +// } catch (Exception e) { +// e.printStackTrace(); +// // 发送消息出现异常 +// sysMessage.setEsSendStatus(SendMsgStatusEnum.FAIL.getCode()); +// } +// sysMessage.setEsSendNum(++sendNum); +// // 发送结果回写到数据库 +// sysMessageService.updateById(sysMessage); +// } +// +// } +// +//} diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/controller/QuartzJobController.java b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/controller/QuartzJobController.java deleted file mode 100644 index 6d2854c..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/controller/QuartzJobController.java +++ /dev/null @@ -1,292 +0,0 @@ -package org.jeecg.modules.quartz.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import lombok.extern.slf4j.Slf4j; -import org.apache.shiro.SecurityUtils; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.constant.CommonConstant; -import org.jeecg.common.constant.SymbolConstant; -import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.common.system.vo.LoginUser; -import org.jeecg.common.util.ImportExcelUtil; -import org.jeecg.modules.quartz.entity.QuartzJob; -import org.jeecg.modules.quartz.service.IQuartzJobService; -import org.jeecgframework.poi.excel.ExcelImportUtil; -import org.jeecgframework.poi.excel.def.NormalExcelConstants; -import org.jeecgframework.poi.excel.entity.ExportParams; -import org.jeecgframework.poi.excel.entity.ImportParams; -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; -import org.quartz.Scheduler; -import org.quartz.SchedulerException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; - -/** - * @Description: 定时任务在线管理 - * @Author: jeecg-boot - * @Date: 2019-01-02 - * @Version:V1.0 - */ -@RestController -@RequestMapping("/sys/quartzJob") -@Slf4j -@Tag(name = "定时任务接口") -public class QuartzJobController { - @Autowired - private IQuartzJobService quartzJobService; - @Autowired - private Scheduler scheduler; - - /** - * 分页列表查询 - * - * @param quartzJob - * @param pageNo - * @param pageSize - * @param req - * @return - */ - @RequestMapping(value = "/list", method = RequestMethod.GET) - public Result queryPageList(QuartzJob quartzJob, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(quartzJob, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = quartzJobService.page(page, queryWrapper); - return Result.ok(pageList); - - } - - /** - * 添加定时任务 - * - * @param quartzJob - * @return - */ - //@RequiresRoles("admin") - @RequiresPermissions("system:quartzJob:add") - @RequestMapping(value = "/add", method = RequestMethod.POST) - public Result add(@RequestBody QuartzJob quartzJob) { - quartzJobService.saveAndScheduleJob(quartzJob); - return Result.ok("创建定时任务成功"); - } - - /** - * 更新定时任务 - * - * @param quartzJob - * @return - */ - //@RequiresRoles("admin") - @RequiresPermissions("system:quartzJob:edit") - @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) - public Result eidt(@RequestBody QuartzJob quartzJob) { - try { - quartzJobService.editAndScheduleJob(quartzJob); - } catch (SchedulerException e) { - log.error(e.getMessage(), e); - return Result.error("更新定时任务失败!"); - } - return Result.ok("更新定时任务成功!"); - } - - /** - * 通过id删除 - * - * @param id - * @return - */ - //@RequiresRoles("admin") - @RequiresPermissions("system:quartzJob:delete") - @RequestMapping(value = "/delete", method = RequestMethod.DELETE) - public Result delete(@RequestParam(name = "id", required = true) String id) { - QuartzJob quartzJob = quartzJobService.getById(id); - if (quartzJob == null) { - return Result.error("未找到对应实体"); - } - quartzJobService.deleteAndStopJob(quartzJob); - return Result.ok("删除成功!"); - - } - - /** - * 批量删除 - * - * @param ids - * @return - */ - //@RequiresRoles("admin") - @RequiresPermissions("system:quartzJob:deleteBatch") - @RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE) - public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { - if (ids == null || "".equals(ids.trim())) { - return Result.error("参数不识别!"); - } - for (String id : Arrays.asList(ids.split(SymbolConstant.COMMA))) { - QuartzJob job = quartzJobService.getById(id); - quartzJobService.deleteAndStopJob(job); - } - return Result.ok("删除定时任务成功!"); - } - - /** - * 暂停定时任务 - * - * @param id - * @return - */ - //@RequiresRoles("admin") - @RequiresPermissions("system:quartzJob:pause") - @GetMapping(value = "/pause") - @Operation(summary = "停止定时任务") - public Result pauseJob(@RequestParam(name = "id") String id) { - QuartzJob job = quartzJobService.getById(id); - if (job == null) { - return Result.error("定时任务不存在!"); - } - quartzJobService.pause(job); - return Result.ok("停止定时任务成功"); - } - - /** - * 启动定时任务 - * - * @param id - * @return - */ - //@RequiresRoles("admin") - @RequiresPermissions("system:quartzJob:resume") - @GetMapping(value = "/resume") - @Operation(summary = "启动定时任务") - public Result resumeJob(@RequestParam(name = "id") String id) { - QuartzJob job = quartzJobService.getById(id); - if (job == null) { - return Result.error("定时任务不存在!"); - } - quartzJobService.resumeJob(job); - //scheduler.resumeJob(JobKey.jobKey(job.getJobClassName().trim())); - return Result.ok("启动定时任务成功"); - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - @RequestMapping(value = "/queryById", method = RequestMethod.GET) - public Result queryById(@RequestParam(name = "id", required = true) String id) { - QuartzJob quartzJob = quartzJobService.getById(id); - return Result.ok(quartzJob); - } - - /** - * 导出excel - * - * @param request - * @param quartzJob - */ - @RequestMapping(value = "/exportXls") - public ModelAndView exportXls(HttpServletRequest request, QuartzJob quartzJob) { - // Step.1 组装查询条件 - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(quartzJob, request.getParameterMap()); - // Step.2 AutoPoi 导出Excel - ModelAndView mv = new ModelAndView(new JeecgEntityExcelView()); - List pageList = quartzJobService.list(queryWrapper); - // 导出文件名称 - mv.addObject(NormalExcelConstants.FILE_NAME, "定时任务列表"); - mv.addObject(NormalExcelConstants.CLASS, QuartzJob.class); - //获取当前登录用户 - //update-begin---author:wangshuai ---date:20211227 for:[JTC-116]导出人写死了------------ - LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); - mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("定时任务列表数据", "导出人:" + user.getRealname(), "导出信息")); - //update-end---author:wangshuai ---date:20211227 for:[JTC-116]导出人写死了------------ - mv.addObject(NormalExcelConstants.DATA_LIST, pageList); - return mv; - } - - /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result importExcel(HttpServletRequest request, HttpServletResponse response) throws IOException { - MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; - Map fileMap = multipartRequest.getFileMap(); - // 错误信息 - List errorMessage = new ArrayList<>(); - int successLines = 0, errorLines = 0; - for (Map.Entry entity : fileMap.entrySet()) { - // 获取上传文件对象 - MultipartFile file = entity.getValue(); - ImportParams params = new ImportParams(); - params.setTitleRows(2); - params.setHeadRows(1); - params.setNeedSave(true); - try { - List listQuartzJobs = ExcelImportUtil.importExcel(file.getInputStream(), QuartzJob.class, params); - //add-begin-author:taoyan date:20210909 for:导入定时任务,并不会被启动和调度,需要手动点击启动,才会加入调度任务中 #2986 - for (QuartzJob job : listQuartzJobs) { - job.setStatus(CommonConstant.STATUS_DISABLE); - } - List list = ImportExcelUtil.importDateSave(listQuartzJobs, IQuartzJobService.class, errorMessage, CommonConstant.SQL_INDEX_UNIQ_JOB_CLASS_NAME); - //add-end-author:taoyan date:20210909 for:导入定时任务,并不会被启动和调度,需要手动点击启动,才会加入调度任务中 #2986 - errorLines += list.size(); - successLines += (listQuartzJobs.size() - errorLines); - } catch (Exception e) { - log.error(e.getMessage(), e); - return Result.error("文件导入失败!"); - } finally { - try { - file.getInputStream().close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - return ImportExcelUtil.imporReturnRes(errorLines, successLines, errorMessage); - } - - /** - * 立即执行 - * - * @param id - * @return - */ - //@RequiresRoles("admin") - @RequiresPermissions("system:quartzJob:execute") - @GetMapping("/execute") - public Result execute(@RequestParam(name = "id", required = true) String id) { - QuartzJob quartzJob = quartzJobService.getById(id); - if (quartzJob == null) { - return Result.error("未找到对应实体"); - } - try { - quartzJobService.execute(quartzJob); - } catch (Exception e) { - //e.printStackTrace(); - log.info("定时任务 立即执行失败>>" + e.getMessage()); - return Result.error("执行失败!"); - } - return Result.ok("执行成功!"); - } - -} diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/entity/QuartzJob.java b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/entity/QuartzJob.java deleted file mode 100644 index de53065..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/entity/QuartzJob.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.jeecg.modules.quartz.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.Data; -import org.jeecg.common.aspect.annotation.Dict; -import org.jeecgframework.poi.excel.annotation.Excel; -import org.springframework.format.annotation.DateTimeFormat; - -import java.io.Serializable; - -/** - * @Description: 定时任务在线管理 - * @Author: jeecg-boot - * @Date: 2019-01-02 - * @Version: V1.0 - */ -@Data -@TableName("sys_quartz_job") -public class QuartzJob implements Serializable { - private static final long serialVersionUID = 1L; - - /** - * id - */ - @TableId(type = IdType.ASSIGN_ID) - private java.lang.String id; - /** - * 创建人 - */ - private java.lang.String createBy; - /** - * 创建时间 - */ - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private java.util.Date createTime; - /** - * 删除状态 - */ - private java.lang.Integer delFlag; - /** - * 修改人 - */ - private java.lang.String updateBy; - /** - * 修改时间 - */ - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private java.util.Date updateTime; - /** - * 任务类名 - */ - @Excel(name = "任务类名", width = 40) - private java.lang.String jobClassName; - /** - * cron表达式 - */ - @Excel(name = "cron表达式", width = 30) - private java.lang.String cronExpression; - /** - * 参数 - */ - @Excel(name = "参数", width = 15) - private java.lang.String parameter; - /** - * 描述 - */ - @Excel(name = "描述", width = 40) - private java.lang.String description; - /** - * 状态 0正常 -1停止 - */ - @Excel(name = "状态", width = 15, dicCode = "quartz_status") - @Dict(dicCode = "quartz_status") - private java.lang.Integer status; - -} diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/job/AsyncJob.java b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/job/AsyncJob.java deleted file mode 100644 index 78b1843..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/job/AsyncJob.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.jeecg.modules.quartz.job; - -import lombok.extern.slf4j.Slf4j; -import org.jeecg.common.util.DateUtils; -import org.quartz.*; - -/** - * @Description: 同步定时任务测试 - *

- * 此处的同步是指 当定时任务的执行时间大于任务的时间间隔时 - * 会等待第一个任务执行完成才会走第二个任务 - * @author: taoyan - * @date: 2020年06月19日 - */ -@PersistJobDataAfterExecution -@DisallowConcurrentExecution -@Slf4j -public class AsyncJob implements Job { - - @Override - public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { - log.info(" --- 同步任务调度开始 --- "); - try { - //此处模拟任务执行时间 5秒 任务表达式配置为每秒执行一次:0/1 * * * * ? * - Thread.sleep(5000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - //测试发现 每5秒执行一次 - log.info(" --- 执行完毕,时间:" + DateUtils.now() + "---"); - } - -} diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/job/SampleJob.java b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/job/SampleJob.java deleted file mode 100644 index 81cc167..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/job/SampleJob.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.jeecg.modules.quartz.job; - -import lombok.extern.slf4j.Slf4j; -import org.jeecg.common.util.DateUtils; -import org.quartz.Job; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; - -/** - * 示例不带参定时任务 - * - * @Author Scott - */ -@Slf4j -public class SampleJob implements Job { - - @Override - public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { - log.info(" Job Execution key:" + jobExecutionContext.getJobDetail().getKey()); - log.info(String.format(" Jeecg-Boot 普通定时任务 SampleJob ! 时间:" + DateUtils.getTimestamp())); - } -} diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/job/SampleParamJob.java b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/job/SampleParamJob.java deleted file mode 100644 index 3cc1f30..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/job/SampleParamJob.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.jeecg.modules.quartz.job; - -import lombok.extern.slf4j.Slf4j; -import org.jeecg.common.util.DateUtils; -import org.quartz.Job; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; - -/** - * 示例带参定时任务 - * - * @Author Scott - */ -@Slf4j -public class SampleParamJob implements Job { - - /** - * 若参数变量名修改 QuartzJobController中也需对应修改 - */ - private String parameter; - - public void setParameter(String parameter) { - this.parameter = parameter; - } - - @Override - public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { - log.info(" Job Execution key:" + jobExecutionContext.getJobDetail().getKey()); - log.info(String.format("welcome %s! Jeecg-Boot 带参数定时任务 SampleParamJob ! 时间:" + DateUtils.now(), this.parameter)); - } -} diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/mapper/QuartzJobMapper.java b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/mapper/QuartzJobMapper.java deleted file mode 100644 index 8c08eec..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/mapper/QuartzJobMapper.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.jeecg.modules.quartz.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import org.jeecg.modules.quartz.entity.QuartzJob; - -import java.util.List; - -/** - * @Description: 定时任务在线管理 - * @Author: jeecg-boot - * @Date: 2019-01-02 - * @Version: V1.0 - */ -public interface QuartzJobMapper extends BaseMapper { - - /** - * 根据jobClassName查询 - * - * @param jobClassName 任务类名 - * @return - */ - public List findByJobClassName(@Param("jobClassName") String jobClassName); - -} diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/mapper/xml/QuartzJobMapper.xml b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/mapper/xml/QuartzJobMapper.xml deleted file mode 100644 index 2f6f0a0..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/mapper/xml/QuartzJobMapper.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/service/IQuartzJobService.java b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/service/IQuartzJobService.java deleted file mode 100644 index 70230f9..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/service/IQuartzJobService.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.jeecg.modules.quartz.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import org.jeecg.modules.quartz.entity.QuartzJob; -import org.quartz.SchedulerException; - -import java.util.List; - -/** - * @Description: 定时任务在线管理 - * @Author: jeecg-boot - * @Date: 2019-04-28 - * @Version: V1.1 - */ -public interface IQuartzJobService extends IService { - - /** - * 通过类名寻找定时任务 - * - * @param jobClassName 类名 - * @return List - */ - List findByJobClassName(String jobClassName); - - /** - * 保存定时任务 - * - * @param quartzJob - * @return boolean - */ - boolean saveAndScheduleJob(QuartzJob quartzJob); - - /** - * 编辑定时任务 - * - * @param quartzJob - * @return boolean - * @throws SchedulerException - */ - boolean editAndScheduleJob(QuartzJob quartzJob) throws SchedulerException; - - /** - * 删除定时任务 - * - * @param quartzJob - * @return boolean - */ - boolean deleteAndStopJob(QuartzJob quartzJob); - - /** - * 恢复定时任务 - * - * @param quartzJob - * @return - */ - boolean resumeJob(QuartzJob quartzJob); - - /** - * 执行定时任务 - * - * @param quartzJob - * @throws Exception - */ - void execute(QuartzJob quartzJob) throws Exception; - - /** - * 暂停任务 - * - * @param quartzJob - * @throws SchedulerException - */ - void pause(QuartzJob quartzJob); -} diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/service/impl/QuartzJobServiceImpl.java b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/service/impl/QuartzJobServiceImpl.java deleted file mode 100644 index b601e6e..0000000 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/quartz/service/impl/QuartzJobServiceImpl.java +++ /dev/null @@ -1,184 +0,0 @@ -package org.jeecg.modules.quartz.service.impl; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import lombok.extern.slf4j.Slf4j; -import org.jeecg.common.constant.CommonConstant; -import org.jeecg.common.exception.JeecgBootException; -import org.jeecg.common.util.DateUtils; -import org.jeecg.modules.quartz.entity.QuartzJob; -import org.jeecg.modules.quartz.mapper.QuartzJobMapper; -import org.jeecg.modules.quartz.service.IQuartzJobService; -import org.quartz.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.Date; -import java.util.List; - -/** - * @Description: 定时任务在线管理 - * @Author: jeecg-boot - * @Date: 2019-04-28 - * @Version: V1.1 - */ -@Slf4j -@Service -public class QuartzJobServiceImpl extends ServiceImpl implements IQuartzJobService { - @Autowired - private QuartzJobMapper quartzJobMapper; - @Autowired - private Scheduler scheduler; - - /** - * 立即执行的任务分组 - */ - private static final String JOB_TEST_GROUP = "test_group"; - - @Override - public List findByJobClassName(String jobClassName) { - return quartzJobMapper.findByJobClassName(jobClassName); - } - - /** - * 保存&启动定时任务 - */ - @Override - @Transactional(rollbackFor = JeecgBootException.class) - public boolean saveAndScheduleJob(QuartzJob quartzJob) { - // DB设置修改 - quartzJob.setDelFlag(CommonConstant.DEL_FLAG_0); - boolean success = this.save(quartzJob); - if (success) { - if (CommonConstant.STATUS_NORMAL.equals(quartzJob.getStatus())) { - // 定时器添加 - this.schedulerAdd(quartzJob.getId(), quartzJob.getJobClassName().trim(), quartzJob.getCronExpression().trim(), quartzJob.getParameter()); - } - } - return success; - } - - /** - * 恢复定时任务 - */ - @Override - @Transactional(rollbackFor = JeecgBootException.class) - public boolean resumeJob(QuartzJob quartzJob) { - schedulerDelete(quartzJob.getId()); - schedulerAdd(quartzJob.getId(), quartzJob.getJobClassName().trim(), quartzJob.getCronExpression().trim(), quartzJob.getParameter()); - quartzJob.setStatus(CommonConstant.STATUS_NORMAL); - return this.updateById(quartzJob); - } - - /** - * 编辑&启停定时任务 - * - * @throws SchedulerException - */ - @Override - @Transactional(rollbackFor = JeecgBootException.class) - public boolean editAndScheduleJob(QuartzJob quartzJob) throws SchedulerException { - if (CommonConstant.STATUS_NORMAL.equals(quartzJob.getStatus())) { - schedulerDelete(quartzJob.getId()); - schedulerAdd(quartzJob.getId(), quartzJob.getJobClassName().trim(), quartzJob.getCronExpression().trim(), quartzJob.getParameter()); - } else { - scheduler.pauseJob(JobKey.jobKey(quartzJob.getId())); - } - return this.updateById(quartzJob); - } - - /** - * 删除&停止删除定时任务 - */ - @Override - @Transactional(rollbackFor = JeecgBootException.class) - public boolean deleteAndStopJob(QuartzJob job) { - schedulerDelete(job.getId()); - boolean ok = this.removeById(job.getId()); - return ok; - } - - @Override - public void execute(QuartzJob quartzJob) throws Exception { - String jobName = quartzJob.getJobClassName().trim(); - Date startDate = new Date(); - String ymd = DateUtils.date2Str(startDate, DateUtils.yyyymmddhhmmss.get()); - String identity = jobName + ymd; - //3秒后执行 只执行一次 - // update-begin--author:sunjianlei ---- date:20210511--- for:定时任务立即执行,延迟3秒改成0.1秒------- - startDate.setTime(startDate.getTime() + 100L); - // update-end--author:sunjianlei ---- date:20210511--- for:定时任务立即执行,延迟3秒改成0.1秒------- - // 定义一个Trigger - SimpleTrigger trigger = (SimpleTrigger) TriggerBuilder.newTrigger() - .withIdentity(identity, JOB_TEST_GROUP) - .startAt(startDate) - .build(); - // 构建job信息 - JobDetail jobDetail = JobBuilder.newJob(getClass(jobName).getClass()).withIdentity(identity).usingJobData("parameter", quartzJob.getParameter()).build(); - // 将trigger和 jobDetail 加入这个调度 - scheduler.scheduleJob(jobDetail, trigger); - // 启动scheduler - scheduler.start(); - } - - @Override - @Transactional(rollbackFor = JeecgBootException.class) - public void pause(QuartzJob quartzJob) { - schedulerDelete(quartzJob.getId()); - quartzJob.setStatus(CommonConstant.STATUS_DISABLE); - this.updateById(quartzJob); - } - - /** - * 添加定时任务 - * - * @param jobClassName - * @param cronExpression - * @param parameter - */ - private void schedulerAdd(String id, String jobClassName, String cronExpression, String parameter) { - try { - // 启动调度器 - scheduler.start(); - - // 构建job信息 - JobDetail jobDetail = JobBuilder.newJob(getClass(jobClassName).getClass()).withIdentity(id).usingJobData("parameter", parameter).build(); - - // 表达式调度构建器(即任务执行的时间) - CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(cronExpression); - - // 按新的cronExpression表达式构建一个新的trigger - CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(id).withSchedule(scheduleBuilder).build(); - - scheduler.scheduleJob(jobDetail, trigger); - } catch (SchedulerException e) { - throw new JeecgBootException("创建定时任务失败", e); - } catch (RuntimeException e) { - throw new JeecgBootException(e.getMessage(), e); - } catch (Exception e) { - throw new JeecgBootException("后台找不到该类名:" + jobClassName, e); - } - } - - /** - * 删除定时任务 - * - * @param id - */ - private void schedulerDelete(String id) { - try { - scheduler.pauseTrigger(TriggerKey.triggerKey(id)); - scheduler.unscheduleJob(TriggerKey.triggerKey(id)); - scheduler.deleteJob(JobKey.jobKey(id)); - } catch (Exception e) { - log.error(e.getMessage(), e); - throw new JeecgBootException("删除定时任务失败"); - } - } - - private static Job getClass(String classname) throws Exception { - Class class1 = Class.forName(classname); - return (Job) class1.newInstance(); - } - -} diff --git a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/system/controller/LoginController.java b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/system/controller/LoginController.java index 3843582..33ad0d4 100644 --- a/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/system/controller/LoginController.java +++ b/physical-module-system/physical-system-biz/src/main/java/org/jeecg/modules/system/controller/LoginController.java @@ -46,6 +46,7 @@ import java.util.*; @Tag(name = "用户登录") @Slf4j public class LoginController { + private final String BASE_CHECK_CODES = "qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890"; @Autowired private ISysUserService sysUserService; @Autowired @@ -65,8 +66,6 @@ public class LoginController { @Autowired private JeecgBaseConfig jeecgBaseConfig; - private final String BASE_CHECK_CODES = "qwertyuiplkjhgfdsazxcvbnmQWERTYUPLKJHGFDSAZXCVBNM1234567890"; - @Operation(summary = "登录接口") @RequestMapping(value = "/login", method = RequestMethod.POST) public Result login(@RequestBody SysLoginModel sysLoginModel, HttpServletRequest request) { @@ -74,7 +73,8 @@ public class LoginController { String username = sysLoginModel.getUsername(); String password = sysLoginModel.getPassword(); if (isLoginFailOvertimes(username)) { - return result.error500("该用户登录失败次数过多,请于10分钟后再次登录!"); + long expire = redisUtil.getExpire(CommonConstant.LOGIN_FAIL + username); + return result.error500("该用户登录失败次数过多,请于" + (expire / 60) + 1 + "分钟后再次登录!"); } // step.1 验证码check