diff --git a/bin/clean.bat b/bin/clean.bat deleted file mode 100644 index e1440259b1..0000000000 --- a/bin/clean.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -echo. -echo [信息] 清理生成路径。 -echo. - -%~d0 -cd %~dp0 - -cd .. -call mvn clean - -pause \ No newline at end of file diff --git a/bin/package.bat b/bin/package.bat deleted file mode 100644 index af8af8ecee..0000000000 --- a/bin/package.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -echo. -echo [信息] 打包Web工程,生成war/jar包文件。 -echo. - -%~d0 -cd %~dp0 - -cd .. -call mvn clean package -Dmaven.test.skip=true - -pause \ No newline at end of file diff --git a/bin/run.bat b/bin/run.bat deleted file mode 100644 index e5fb6a6b2b..0000000000 --- a/bin/run.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off -echo. -echo [信息] 运行Web工程。 -echo. - -cd %~dp0 -cd ../ruoyi-admin/target - -set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m - -java -jar %JAVA_OPTS% ruoyi-admin.jar - -cd bin -pause \ No newline at end of file diff --git a/ruoyi-common/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java b/ruoyi-common/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java deleted file mode 100644 index f17c7a5770..0000000000 --- a/ruoyi-common/src/main/java/com/ruoyi/quartz/config/ScheduleConfig.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.ruoyi.quartz.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.quartz.SchedulerFactoryBean; - -import javax.sql.DataSource; -import java.util.Properties; - -/** - * 瀹氭椂浠诲姟閰嶇疆 - * - * @author ruoyi - */ -@Configuration -public class ScheduleConfig { - - @Bean - public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource) { - SchedulerFactoryBean factory = new SchedulerFactoryBean(); - factory.setDataSource(dataSource); - - // quartz鍙傛暟 - Properties prop = new Properties(); - prop.put("org.quartz.scheduler.instanceName", "RuoyiScheduler"); - prop.put("org.quartz.scheduler.instanceId", "AUTO"); - // 闆嗙兢閰嶇疆 - prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000"); - prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1"); - prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true"); - - // sqlserver 鍚敤 - // prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?"); - prop.put("org.quartz.jobStore.misfireThreshold", "12000"); - factory.setQuartzProperties(prop); - - factory.setSchedulerName("RuoyiScheduler"); - // 寤舵椂鍚姩 - factory.setStartupDelay(1); - factory.setApplicationContextSchedulerContextKey("applicationContextKey"); - // 鍙夛紝QuartzScheduler - // 鍚姩鏃舵洿鏂板繁瀛樺湪鐨凧ob锛岃繖鏍峰氨涓嶇敤姣忔淇敼targetObject鍚庡垹闄rtz_job_details琛ㄥ搴旇褰曚簡 - factory.setOverwriteExistingJobs(true); - - - return factory; - } -} diff --git a/ruoyi-common/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java b/ruoyi-common/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java deleted file mode 100644 index 477e35e24f..0000000000 --- a/ruoyi-common/src/main/java/com/ruoyi/quartz/controller/SysJobLogController.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.ruoyi.quartz.controller; - -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.quartz.domain.SysJobLog; -import com.ruoyi.quartz.service.ISysJobLogService; - -/** - * 璋冨害鏃ュ織鎿嶄綔澶勭悊 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/monitor/jobLog") -public class SysJobLogController extends BaseController { - @Autowired - private ISysJobLogService jobLogService; - - /** - * 鏌ヨ瀹氭椂浠诲姟璋冨害鏃ュ織鍒楄〃 - */ - @PreAuthorize("@ss.hasPermi('monitor:job:list')") - @GetMapping("/list") - public TableDataInfo list(SysJobLog sysJobLog) { - startPage(); - List list = jobLogService.selectJobLogList(sysJobLog); - return getDataTable(list); - } - - /** - * 瀵煎嚭瀹氭椂浠诲姟璋冨害鏃ュ織鍒楄〃 - */ - @PreAuthorize("@ss.hasPermi('monitor:job:export')") - @Log(title = "浠诲姟璋冨害鏃ュ織", businessType = BusinessType.EXPORT) - @GetMapping("/export") - public AjaxResult export(SysJobLog sysJobLog) { - List list = jobLogService.selectJobLogList(sysJobLog); - ExcelUtil util = new ExcelUtil(SysJobLog.class); - return util.exportExcel(list, "璋冨害鏃ュ織"); - } - - /** - * 鏍规嵁璋冨害缂栧彿鑾峰彇璇︾粏淇℃伅 - */ - @PreAuthorize("@ss.hasPermi('monitor:job:query')") - @GetMapping(value = "/{configId}") - public AjaxResult getInfo(@PathVariable Long jobLogId) { - return AjaxResult.success(jobLogService.selectJobLogById(jobLogId)); - } - -} diff --git a/ruoyi-ui/src/api/infra/job.js b/ruoyi-ui/src/api/infra/job.js index 48196cf991..7801f0399a 100644 --- a/ruoyi-ui/src/api/infra/job.js +++ b/ruoyi-ui/src/api/infra/job.js @@ -73,3 +73,11 @@ export function runJob(jobId) { method: 'put' }) } + +// 鑾峰緱瀹氭椂浠诲姟鐨勪笅 n 娆℃墽琛屾椂闂 +export function getJobNextTimes(jobId) { + return request({ + url: '/infra/job/get_next_times?id=' + jobId, + method: 'get' + }) +} diff --git a/ruoyi-ui/src/api/infra/jobLog.js b/ruoyi-ui/src/api/infra/jobLog.js new file mode 100644 index 0000000000..348f2ed98f --- /dev/null +++ b/ruoyi-ui/src/api/infra/jobLog.js @@ -0,0 +1,28 @@ +import request from '@/utils/request' + +// 鑾峰緱瀹氭椂浠诲姟 +export function getJobLog(id) { + return request({ + url: '/infra/job-log/get?id=' + id, + method: 'get' + }) +} + +// 鑾峰緱瀹氭椂浠诲姟鍒嗛〉 +export function getJobLogPage(query) { + return request({ + url: '/infra/job-log/page', + method: 'get', + params: query + }) +} + +// 瀵煎嚭瀹氭椂浠诲姟 Excel +export function exportJobLogExcel(query) { + return request({ + url: '/infra/job-log/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/ruoyi-ui/src/api/monitor/jobLog.js b/ruoyi-ui/src/api/monitor/jobLog.js deleted file mode 100644 index be1fffdfae..0000000000 --- a/ruoyi-ui/src/api/monitor/jobLog.js +++ /dev/null @@ -1,35 +0,0 @@ -import request from '@/utils/request' - -// 鏌ヨ璋冨害鏃ュ織鍒楄〃 -export function listJobLog(query) { - return request({ - url: '/monitor/jobLog/list', - method: 'get', - params: query - }) -} - -// 鍒犻櫎璋冨害鏃ュ織 -export function delJobLog(jobLogId) { - return request({ - url: '/monitor/jobLog/' + jobLogId, - method: 'delete' - }) -} - -// 娓呯┖璋冨害鏃ュ織 -export function cleanJobLog() { - return request({ - url: '/monitor/jobLog/clean', - method: 'delete' - }) -} - -// 瀵煎嚭璋冨害鏃ュ織 -export function exportJobLog(query) { - return request({ - url: '/monitor/jobLog/export', - method: 'get', - params: query - }) -} \ No newline at end of file diff --git a/ruoyi-ui/src/utils/dict.js b/ruoyi-ui/src/utils/dict.js index 057494fb4b..30bb2a0996 100644 --- a/ruoyi-ui/src/utils/dict.js +++ b/ruoyi-ui/src/utils/dict.js @@ -18,6 +18,7 @@ export const DICT_TYPE = { INF_REDIS_TIMEOUT_TYPE: 'inf_redis_timeout_type', INF_JOB_STATUS: 'inf_job_status', + INF_JOB_LOG_STATUS: 'inf_job_log_status', TOOL_CODEGEN_TEMPLATE_TYPE: 'tool_codegen_template_type', } diff --git a/ruoyi-ui/src/views/infra/job/index.vue b/ruoyi-ui/src/views/infra/job/index.vue index 8e64be1073..a8ea8812b7 100644 --- a/ruoyi-ui/src/views/infra/job/index.vue +++ b/ruoyi-ui/src/views/infra/job/index.vue @@ -30,7 +30,7 @@ 鏃ュ織 + v-hasPermi="['infra:job:query']">鎵ц鏃ュ織 @@ -50,6 +50,8 @@ \ No newline at end of file + diff --git a/ry.sh b/ry.sh deleted file mode 100644 index 6558b9785a..0000000000 --- a/ry.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash - -AppName=ruoyi-admin.jar - -#JVM鍙傛暟 -JVM_OPTS="-Dname=$AppName -Duser.timezone=Asia/Shanghai -Xms512M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:NewRatio=1 -XX:SurvivorRatio=30 -XX:+UseParallelGC -XX:+UseParallelOldGC" -APP_HOME=`pwd` -LOG_PATH=$APP_HOME/logs/$AppName.log - -if [ "$1" = "" ]; -then - echo -e "\033[0;31m 鏈緭鍏ユ搷浣滃悕 \033[0m \033[0;34m {start|stop|restart|status} \033[0m" - exit 1 -fi - -if [ "$AppName" = "" ]; -then - echo -e "\033[0;31m 鏈緭鍏ュ簲鐢ㄥ悕 \033[0m" - exit 1 -fi - -function start() -{ - PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'` - - if [ x"$PID" != x"" ]; then - echo "$AppName is running..." - else - nohup java -jar $JVM_OPTS target/$AppName > /dev/null 2>&1 & - echo "Start $AppName success..." - fi -} - -function stop() -{ - echo "Stop $AppName" - - PID="" - query(){ - PID=`ps -ef |grep java|grep $AppName|grep -v grep|awk '{print $2}'` - } - - query - if [ x"$PID" != x"" ]; then - kill -TERM $PID - echo "$AppName (pid:$PID) exiting..." - while [ x"$PID" != x"" ] - do - sleep 1 - query - done - echo "$AppName exited." - else - echo "$AppName already stopped." - fi -} - -function restart() -{ - stop - sleep 2 - start -} - -function status() -{ - PID=`ps -ef |grep java|grep $AppName|grep -v grep|wc -l` - if [ $PID != 0 ];then - echo "$AppName is running..." - else - echo "$AppName is not running..." - fi -} - -case $1 in - start) - start;; - stop) - stop;; - restart) - restart;; - status) - status;; - *) - -esac diff --git a/src/main/java/cn/iocoder/dashboard/framework/quartz/core/util/CronUtils.java b/src/main/java/cn/iocoder/dashboard/framework/quartz/core/util/CronUtils.java index 0863f5b4ec..62ba408fab 100644 --- a/src/main/java/cn/iocoder/dashboard/framework/quartz/core/util/CronUtils.java +++ b/src/main/java/cn/iocoder/dashboard/framework/quartz/core/util/CronUtils.java @@ -2,6 +2,11 @@ package cn.iocoder.dashboard.framework.quartz.core.util; import org.quartz.CronExpression; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + /** * Quartz Cron 琛ㄨ揪寮忕殑宸ュ叿绫 * @@ -19,4 +24,31 @@ public class CronUtils { return CronExpression.isValidExpression(cronExpression); } + /** + * 鍩轰簬 CRON 琛ㄨ揪寮忥紝鑾峰緱涓 n 涓弧瓒虫墽琛岀殑鏃堕棿 + * + * @param cronExpression CRON 琛ㄨ揪寮 + * @param n 鏁伴噺 + * @return 婊¤冻鏉′欢鐨勬墽琛屾椂闂 + */ + public static List getNextTimes(String cronExpression, int n) { + // 鑾峰緱 CronExpression 瀵硅薄 + CronExpression cron; + try { + cron = new CronExpression(cronExpression); + } catch (ParseException e) { + throw new IllegalArgumentException(e.getMessage()); + } + // 浠庡綋鍓嶅紑濮嬭绠楋紝n 涓弧瓒虫潯浠剁殑 + Date now = new Date(); + List nextTimes = new ArrayList<>(n); + for (int i = 0; i < n; i++) { + Date nextTime = cron.getNextValidTimeAfter(now); + nextTimes.add(nextTime); + // 鍒囨崲鐜板湪锛屼负涓嬩竴涓Е鍙戞椂闂达紱 + now = nextTime; + } + return nextTimes; + } + } diff --git a/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/InfJobController.java b/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/InfJobController.java index 9d253481b9..90894c6d40 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/InfJobController.java +++ b/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/InfJobController.java @@ -4,6 +4,7 @@ import cn.iocoder.dashboard.common.pojo.CommonResult; import cn.iocoder.dashboard.common.pojo.PageResult; import cn.iocoder.dashboard.framework.excel.core.util.ExcelUtils; import cn.iocoder.dashboard.framework.logger.operatelog.core.annotations.OperateLog; +import cn.iocoder.dashboard.framework.quartz.core.util.CronUtils; import cn.iocoder.dashboard.modules.infra.controller.job.vo.job.*; import cn.iocoder.dashboard.modules.infra.convert.job.InfJobConvert; import cn.iocoder.dashboard.modules.infra.dal.dataobject.job.InfJobDO; @@ -22,6 +23,8 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.IOException; import java.util.Collection; +import java.util.Collections; +import java.util.Date; import java.util.List; import static cn.iocoder.dashboard.common.pojo.CommonResult.success; @@ -123,4 +126,20 @@ public class InfJobController { ExcelUtils.write(response, "瀹氭椂浠诲姟.xls", "鏁版嵁", InfJobExcelVO.class, datas); } + @GetMapping("/get_next_times") + @ApiOperation("鑾峰緱瀹氭椂浠诲姟鐨勪笅 n 娆℃墽琛屾椂闂") + @ApiImplicitParams({ + @ApiImplicitParam(name = "id", value = "缂栧彿", required = true, example = "1024", dataTypeClass = Long.class), + @ApiImplicitParam(name = "count", value = "鏁伴噺", example = "5", dataTypeClass = Long.class) + }) + @PreAuthorize("@ss.hasPermission('infra:job:query')") + public CommonResult> getJobNextTimes(@RequestParam("id") Long id, + @RequestParam(value = "count", required = false, defaultValue = "5") Integer count) { + InfJobDO job = jobService.getJob(id); + if (job == null) { + return success(Collections.emptyList()); + } + return success(CronUtils.getNextTimes(job.getCronExpression(), count)); + } + } diff --git a/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/InfJobLogController.java b/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/InfJobLogController.java new file mode 100644 index 0000000000..c7fee7a69f --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/InfJobLogController.java @@ -0,0 +1,81 @@ +package cn.iocoder.dashboard.modules.infra.controller.job; + +import cn.iocoder.dashboard.common.pojo.CommonResult; +import cn.iocoder.dashboard.common.pojo.PageResult; +import cn.iocoder.dashboard.framework.excel.core.util.ExcelUtils; +import cn.iocoder.dashboard.framework.logger.operatelog.core.annotations.OperateLog; +import cn.iocoder.dashboard.modules.infra.controller.job.vo.log.InfJobLogExcelVO; +import cn.iocoder.dashboard.modules.infra.controller.job.vo.log.InfJobLogExportReqVO; +import cn.iocoder.dashboard.modules.infra.controller.job.vo.log.InfJobLogPageReqVO; +import cn.iocoder.dashboard.modules.infra.controller.job.vo.log.InfJobLogRespVO; +import cn.iocoder.dashboard.modules.infra.convert.job.InfJobLogConvert; +import cn.iocoder.dashboard.modules.infra.dal.dataobject.job.InfJobLogDO; +import cn.iocoder.dashboard.modules.infra.service.job.InfJobLogService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.util.Collection; +import java.util.List; + +import static cn.iocoder.dashboard.common.pojo.CommonResult.success; +import static cn.iocoder.dashboard.framework.logger.operatelog.core.enums.OperateTypeEnum.EXPORT; + +@Api(tags = "瀹氭椂浠诲姟鏃ュ織") +@RestController +@RequestMapping("/infra/job-log") +@Validated +public class InfJobLogController { + + @Resource + private InfJobLogService jobLogService; + + @GetMapping("/get") + @ApiOperation("鑾峰緱瀹氭椂浠诲姟鏃ュ織") + @ApiImplicitParam(name = "id", value = "缂栧彿", required = true, example = "1024", dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('infra:job:query')") + public CommonResult getJobLog(@RequestParam("id") Long id) { + InfJobLogDO jobLog = jobLogService.getJobLog(id); + return success(InfJobLogConvert.INSTANCE.convert(jobLog)); + } + + @GetMapping("/list") + @ApiOperation("鑾峰緱瀹氭椂浠诲姟鏃ュ織鍒楄〃") + @ApiImplicitParam(name = "ids", value = "缂栧彿鍒楄〃", required = true, example = "1024,2048", dataTypeClass = List.class) + @PreAuthorize("@ss.hasPermission('infra:job:query')") + public CommonResult> getJobLogList(@RequestParam("ids") Collection ids) { + List list = jobLogService.getJobLogList(ids); + return success(InfJobLogConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @ApiOperation("鑾峰緱瀹氭椂浠诲姟鏃ュ織鍒嗛〉") + @PreAuthorize("@ss.hasPermission('infra:job:query')") + public CommonResult> getJobLogPage(@Valid InfJobLogPageReqVO pageVO) { + PageResult pageResult = jobLogService.getJobLogPage(pageVO); + return success(InfJobLogConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @ApiOperation("瀵煎嚭瀹氭椂浠诲姟鏃ュ織 Excel") + @PreAuthorize("@ss.hasPermission('infra:job:export')") + @OperateLog(type = EXPORT) + public void exportJobLogExcel(@Valid InfJobLogExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = jobLogService.getJobLogList(exportReqVO); + // 瀵煎嚭 Excel + List datas = InfJobLogConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "瀹氭椂浠诲姟.xls", "鏁版嵁", InfJobLogExcelVO.class, datas); + } + +} diff --git a/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/job/InfJobBaseVO.java b/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/job/InfJobBaseVO.java index bbbdf4f400..2df3ad823d 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/job/InfJobBaseVO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/job/InfJobBaseVO.java @@ -23,14 +23,14 @@ public class InfJobBaseVO { @NotNull(message = "CRON 琛ㄨ揪寮忎笉鑳戒负绌") private String cronExpression; - @ApiModelProperty(value = "閲嶈瘯娆℃暟", required = true) + @ApiModelProperty(value = "閲嶈瘯娆℃暟", required = true, example = "3") @NotNull(message = "閲嶈瘯娆℃暟涓嶈兘涓虹┖") private Integer retryCount; - @ApiModelProperty(value = "閲嶈瘯闂撮殧", required = true) + @ApiModelProperty(value = "閲嶈瘯闂撮殧", required = true, example = "1000") @NotNull(message = "閲嶈瘯闂撮殧涓嶈兘涓虹┖") private Integer retryInterval; - + @ApiModelProperty(value = "鐩戞帶瓒呮椂鏃堕棿", example = "1000") private Integer monitorTimeout; diff --git a/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/job/InfJobRespVO.java b/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/job/InfJobRespVO.java index 95d52b1ebe..c23eb8b5ca 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/job/InfJobRespVO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/job/InfJobRespVO.java @@ -25,18 +25,6 @@ public class InfJobRespVO extends InfJobBaseVO { @NotNull(message = "澶勭悊鍣ㄧ殑鍚嶅瓧涓嶈兘涓虹┖") private String handlerName; - @ApiModelProperty(value = "鏈鍚庝竴娆℃墽琛岀殑寮濮嬫椂闂") - private Date executeBeginTime; - - @ApiModelProperty(value = "鏈鍚庝竴娆℃墽琛岀殑缁撴潫鏃堕棿") - private Date executeEndTime; - - @ApiModelProperty(value = "涓婁竴娆¤Е鍙戞椂闂") - private Date firePrevTime; - - @ApiModelProperty(value = "涓嬩竴娆¤Е鍙戞椂闂") - private Date fireNextTime; - @ApiModelProperty(value = "鍒涘缓鏃堕棿", required = true) private Date createTime; diff --git a/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogBaseVO.java b/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogBaseVO.java index ea58f41127..81c1d58995 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogBaseVO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogBaseVO.java @@ -16,18 +16,18 @@ import static cn.iocoder.dashboard.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOU @Data public class InfJobLogBaseVO { - @ApiModelProperty(value = "浠诲姟缂栧彿", required = true) + @ApiModelProperty(value = "浠诲姟缂栧彿", required = true, example = "1024") @NotNull(message = "浠诲姟缂栧彿涓嶈兘涓虹┖") private Long jobId; - @ApiModelProperty(value = "澶勭悊鍣ㄧ殑鍚嶅瓧", required = true) + @ApiModelProperty(value = "澶勭悊鍣ㄧ殑鍚嶅瓧", required = true, example = "sysUserSessionTimeoutJob") @NotNull(message = "澶勭悊鍣ㄧ殑鍚嶅瓧涓嶈兘涓虹┖") private String handlerName; - @ApiModelProperty(value = "澶勭悊鍣ㄧ殑鍙傛暟") + @ApiModelProperty(value = "澶勭悊鍣ㄧ殑鍙傛暟", example = "yudao") private String handlerParam; - @ApiModelProperty(value = "绗嚑娆℃墽琛", required = true) + @ApiModelProperty(value = "绗嚑娆℃墽琛", required = true, example = "1") @NotNull(message = "绗嚑娆℃墽琛屼笉鑳戒负绌") private Integer executeIndex; @@ -40,14 +40,14 @@ public class InfJobLogBaseVO { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private Date endTime; - @ApiModelProperty(value = "鎵ц鏃堕暱") + @ApiModelProperty(value = "鎵ц鏃堕暱", example = "123") private Integer duration; - @ApiModelProperty(value = "浠诲姟鐘舵", required = true) + @ApiModelProperty(value = "浠诲姟鐘舵", required = true, example = "1", notes = "鍙傝 InfJobLogStatusEnum 鏋氫妇") @NotNull(message = "浠诲姟鐘舵佷笉鑳戒负绌") private Integer status; - @ApiModelProperty(value = "缁撴灉鏁版嵁") + @ApiModelProperty(value = "缁撴灉鏁版嵁", example = "鎵ц鎴愬姛") private String result; } diff --git a/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogExcelVO.java b/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogExcelVO.java index 92775e8b6a..6f6d829f9f 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogExcelVO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogExcelVO.java @@ -1,5 +1,8 @@ package cn.iocoder.dashboard.modules.infra.controller.job.vo.log; +import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; +import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; +import cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum; import com.alibaba.excel.annotation.ExcelProperty; import lombok.Data; @@ -37,7 +40,8 @@ public class InfJobLogExcelVO { @ExcelProperty("鎵ц鏃堕暱") private Integer duration; - @ExcelProperty("浠诲姟鐘舵") + @ExcelProperty(value = "浠诲姟鐘舵", converter = DictConvert.class) + @DictFormat(SysDictTypeEnum.INF_JOB_STATUS) private Integer status; @ExcelProperty("缁撴灉鏁版嵁") diff --git a/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogExportReqVO.java b/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogExportReqVO.java index 80cdbfb584..e5fd05a77c 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogExportReqVO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogExportReqVO.java @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; +import javax.validation.constraints.NotNull; import java.util.Date; import static cn.iocoder.dashboard.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -13,7 +14,10 @@ import static cn.iocoder.dashboard.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOU @Data public class InfJobLogExportReqVO { - @ApiModelProperty(value = "澶勭悊鍣ㄧ殑鍚嶅瓧") + @ApiModelProperty(value = "浠诲姟缂栧彿", example = "10") + private Long jobId; + + @ApiModelProperty(value = "澶勭悊鍣ㄧ殑鍚嶅瓧", notes = "妯$硦鍖归厤") private String handlerName; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @@ -24,7 +28,7 @@ public class InfJobLogExportReqVO { @ApiModelProperty(value = "缁撴潫鎵ц鏃堕棿") private Date endTime; - @ApiModelProperty(value = "浠诲姟鐘舵") + @ApiModelProperty(value = "浠诲姟鐘舵", notes = "鍙傝 InfJobLogStatusEnum 鏋氫妇") private Integer status; } diff --git a/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogPageReqVO.java b/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogPageReqVO.java index 6e007f9a26..5a679ab697 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogPageReqVO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogPageReqVO.java @@ -18,7 +18,10 @@ import static cn.iocoder.dashboard.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOU @ToString(callSuper = true) public class InfJobLogPageReqVO extends PageParam { - @ApiModelProperty(value = "澶勭悊鍣ㄧ殑鍚嶅瓧") + @ApiModelProperty(value = "浠诲姟缂栧彿", example = "10") + private Long jobId; + + @ApiModelProperty(value = "澶勭悊鍣ㄧ殑鍚嶅瓧", notes = "妯$硦鍖归厤") private String handlerName; @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @@ -29,7 +32,7 @@ public class InfJobLogPageReqVO extends PageParam { @ApiModelProperty(value = "缁撴潫鎵ц鏃堕棿") private Date endTime; - @ApiModelProperty(value = "浠诲姟鐘舵") + @ApiModelProperty(value = "浠诲姟鐘舵", notes = "鍙傝 InfJobLogStatusEnum 鏋氫妇") private Integer status; } diff --git a/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogRespVO.java b/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogRespVO.java index c50b867105..72587f5df2 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogRespVO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/infra/controller/job/vo/log/InfJobLogRespVO.java @@ -14,7 +14,7 @@ import java.util.Date; @ToString(callSuper = true) public class InfJobLogRespVO extends InfJobLogBaseVO { - @ApiModelProperty(value = "鏃ュ織缂栧彿", required = true) + @ApiModelProperty(value = "鏃ュ織缂栧彿", required = true, example = "1024") private Long id; @ApiModelProperty(value = "鍒涘缓鏃堕棿", required = true) diff --git a/src/main/java/cn/iocoder/dashboard/modules/infra/convert/job/InfJobLogConvert.java b/src/main/java/cn/iocoder/dashboard/modules/infra/convert/job/InfJobLogConvert.java new file mode 100644 index 0000000000..b08e03028d --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/infra/convert/job/InfJobLogConvert.java @@ -0,0 +1,30 @@ +package cn.iocoder.dashboard.modules.infra.convert.job; + +import cn.iocoder.dashboard.common.pojo.PageResult; +import cn.iocoder.dashboard.modules.infra.controller.job.vo.log.InfJobLogExcelVO; +import cn.iocoder.dashboard.modules.infra.controller.job.vo.log.InfJobLogRespVO; +import cn.iocoder.dashboard.modules.infra.dal.dataobject.job.InfJobLogDO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +/** + * 瀹氭椂浠诲姟鏃ュ織 Convert + * + * @author 鑺嬭壙 + */ +@Mapper +public interface InfJobLogConvert { + + InfJobLogConvert INSTANCE = Mappers.getMapper(InfJobLogConvert.class); + + InfJobLogRespVO convert(InfJobLogDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/src/main/java/cn/iocoder/dashboard/modules/infra/dal/dataobject/job/InfJobDO.java b/src/main/java/cn/iocoder/dashboard/modules/infra/dal/dataobject/job/InfJobDO.java index 430c97f5eb..44caaad692 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/infra/dal/dataobject/job/InfJobDO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/infra/dal/dataobject/job/InfJobDO.java @@ -6,8 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.*; -import java.util.Date; - /** * 瀹氭椂浠诲姟 DO * @@ -45,35 +43,10 @@ public class InfJobDO extends BaseDO { * 澶勭悊鍣ㄧ殑鍙傛暟 */ private String handlerParam; - - // ========== 鏃堕棿鐩稿叧瀛楁 ========== - /** * CRON 琛ㄨ揪寮 */ private String cronExpression; - /** - * 鏈鍚庝竴娆℃墽琛岀殑寮濮嬫椂闂 - * - * 璇ュ瓧娈靛湪浠诲姟鎵ц缁撴潫鍚庯紝杩涜璁板綍 - */ - private Date executeBeginTime; - /** - * 鏈鍚庝竴娆℃墽琛岀殑缁撴潫鏃堕棿 - * - * 璇ュ瓧娈靛湪浠诲姟鎵ц缁撴潫鍚庯紝杩涜璁板綍 - */ - private Date executeEndTime; - /** - * 涓婁竴娆¤Е鍙戞椂闂达紝鏉ヨ嚜 Quartz SCHE_TRIGGERS 琛 - */ - private Date firePrevTime; - /** - * 涓嬩竴娆¤Е鍙戞椂闂达紝鏉ヨ嚜 Quartz SCHE_TRIGGERS 琛 - * - * 鍦ㄨЕ鍙戝櫒鐘舵佷粠 `ACQUIRED` 鍙樻垚 `BLOCKED` 鏃讹紝灏变細鏇存柊 PREV_FIRE_TIME銆丯EXT_FIRE_TIME锛岀劧鍚庡畾鏃朵换鍔℃墠姝e紡寮濮嬫墽琛 - */ - private Date fireNextTime; // ========== 閲嶈瘯鐩稿叧瀛楁 ========== /** @@ -96,8 +69,4 @@ public class InfJobDO extends BaseDO { */ private Integer monitorTimeout; - // TODO misfirePolicy - // TODO concurrent - // TODO 澶辫触閲嶈瘯 - } diff --git a/src/main/java/cn/iocoder/dashboard/modules/infra/dal/mysql/job/InfJobLogMapper.java b/src/main/java/cn/iocoder/dashboard/modules/infra/dal/mysql/job/InfJobLogMapper.java index 70061236b2..956f073abe 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/infra/dal/mysql/job/InfJobLogMapper.java +++ b/src/main/java/cn/iocoder/dashboard/modules/infra/dal/mysql/job/InfJobLogMapper.java @@ -1,9 +1,15 @@ package cn.iocoder.dashboard.modules.infra.dal.mysql.job; +import cn.iocoder.dashboard.common.pojo.PageResult; import cn.iocoder.dashboard.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.dashboard.framework.mybatis.core.query.QueryWrapperX; +import cn.iocoder.dashboard.modules.infra.controller.job.vo.log.InfJobLogExportReqVO; +import cn.iocoder.dashboard.modules.infra.controller.job.vo.log.InfJobLogPageReqVO; import cn.iocoder.dashboard.modules.infra.dal.dataobject.job.InfJobLogDO; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 浠诲姟鏃ュ織 Mapper * @@ -11,4 +17,27 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface InfJobLogMapper extends BaseMapperX { + + default PageResult selectPage(InfJobLogPageReqVO reqVO) { + return selectPage(reqVO, new QueryWrapperX() + .eqIfPresent("job_id", reqVO.getJobId()) + .likeIfPresent("handler_name", reqVO.getHandlerName()) + .geIfPresent("begin_time", reqVO.getBeginTime()) + .leIfPresent("end_time", reqVO.getEndTime()) + .eqIfPresent("status", reqVO.getStatus()) + .orderByDesc("id") // ID 鍊掑簭 + ); + } + + default List selectList(InfJobLogExportReqVO reqVO) { + return selectList(new QueryWrapperX() + .eqIfPresent("job_id", reqVO.getJobId()) + .likeIfPresent("handler_name", reqVO.getHandlerName()) + .geIfPresent("begin_time", reqVO.getBeginTime()) + .leIfPresent("end_time", reqVO.getEndTime()) + .eqIfPresent("status", reqVO.getStatus()) + .orderByDesc("id") // ID 鍊掑簭 + ); + } + } diff --git a/src/main/java/cn/iocoder/dashboard/modules/infra/service/job/InfJobLogService.java b/src/main/java/cn/iocoder/dashboard/modules/infra/service/job/InfJobLogService.java index b72eabe238..dd9edeb9a4 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/infra/service/job/InfJobLogService.java +++ b/src/main/java/cn/iocoder/dashboard/modules/infra/service/job/InfJobLogService.java @@ -1,6 +1,13 @@ package cn.iocoder.dashboard.modules.infra.service.job; +import cn.iocoder.dashboard.common.pojo.PageResult; import cn.iocoder.dashboard.framework.quartz.core.service.JobLogFrameworkService; +import cn.iocoder.dashboard.modules.infra.controller.job.vo.log.InfJobLogExportReqVO; +import cn.iocoder.dashboard.modules.infra.controller.job.vo.log.InfJobLogPageReqVO; +import cn.iocoder.dashboard.modules.infra.dal.dataobject.job.InfJobLogDO; + +import java.util.Collection; +import java.util.List; /** * Job 鏃ュ織 Service 鎺ュ彛 @@ -8,4 +15,37 @@ import cn.iocoder.dashboard.framework.quartz.core.service.JobLogFrameworkService * @author 鑺嬮亾婧愮爜 */ public interface InfJobLogService extends JobLogFrameworkService { + + /** + * 鑾峰緱瀹氭椂浠诲姟 + * + * @param id 缂栧彿 + * @return 瀹氭椂浠诲姟 + */ + InfJobLogDO getJobLog(Long id); + + /** + * 鑾峰緱瀹氭椂浠诲姟鍒楄〃 + * + * @param ids 缂栧彿 + * @return 瀹氭椂浠诲姟鍒楄〃 + */ + List getJobLogList(Collection ids); + + /** + * 鑾峰緱瀹氭椂浠诲姟鍒嗛〉 + * + * @param pageReqVO 鍒嗛〉鏌ヨ + * @return 瀹氭椂浠诲姟鍒嗛〉 + */ + PageResult getJobLogPage(InfJobLogPageReqVO pageReqVO); + + /** + * 鑾峰緱瀹氭椂浠诲姟鍒楄〃, 鐢ㄤ簬 Excel 瀵煎嚭 + * + * @param exportReqVO 鏌ヨ鏉′欢 + * @return 瀹氭椂浠诲姟鍒嗛〉 + */ + List getJobLogList(InfJobLogExportReqVO exportReqVO); + } diff --git a/src/main/java/cn/iocoder/dashboard/modules/infra/service/job/impl/InfJobLogServiceImpl.java b/src/main/java/cn/iocoder/dashboard/modules/infra/service/job/impl/InfJobLogServiceImpl.java index a473170b07..99c0286511 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/infra/service/job/impl/InfJobLogServiceImpl.java +++ b/src/main/java/cn/iocoder/dashboard/modules/infra/service/job/impl/InfJobLogServiceImpl.java @@ -1,5 +1,8 @@ package cn.iocoder.dashboard.modules.infra.service.job.impl; +import cn.iocoder.dashboard.common.pojo.PageResult; +import cn.iocoder.dashboard.modules.infra.controller.job.vo.log.InfJobLogExportReqVO; +import cn.iocoder.dashboard.modules.infra.controller.job.vo.log.InfJobLogPageReqVO; import cn.iocoder.dashboard.modules.infra.dal.dataobject.job.InfJobLogDO; import cn.iocoder.dashboard.modules.infra.dal.mysql.job.InfJobLogMapper; import cn.iocoder.dashboard.modules.infra.enums.job.InfJobLogStatusEnum; @@ -10,7 +13,9 @@ import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; +import java.util.Collection; import java.util.Date; +import java.util.List; /** * Job 鏃ュ織 Service 瀹炵幇绫 @@ -46,4 +51,24 @@ public class InfJobLogServiceImpl implements InfJobLogService { } } + @Override + public InfJobLogDO getJobLog(Long id) { + return jobLogMapper.selectById(id); + } + + @Override + public List getJobLogList(Collection ids) { + return jobLogMapper.selectBatchIds(ids); + } + + @Override + public PageResult getJobLogPage(InfJobLogPageReqVO pageReqVO) { + return jobLogMapper.selectPage(pageReqVO); + } + + @Override + public List getJobLogList(InfJobLogExportReqVO exportReqVO) { + return jobLogMapper.selectList(exportReqVO); + } + } diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/dal/mysql/dict/SysDictDataMapper.java b/src/main/java/cn/iocoder/dashboard/modules/system/dal/mysql/dict/SysDictDataMapper.java index 8939d5743d..a9a4a1d55a 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/dal/mysql/dict/SysDictDataMapper.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/dal/mysql/dict/SysDictDataMapper.java @@ -15,8 +15,9 @@ import java.util.List; @Mapper public interface SysDictDataMapper extends BaseMapperX { - default SysDictDataDO selectByLabel(String label) { - return selectOne(new QueryWrapper().eq("label", label)); + default SysDictDataDO selectByDictTypeAndLabel(String dictType, String label) { + return selectOne(new QueryWrapper().eq("dict_type", dictType) + .eq("label", label)); } default int selectCountByDictType(String dictType) { diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/enums/dict/SysDictTypeEnum.java b/src/main/java/cn/iocoder/dashboard/modules/system/enums/dict/SysDictTypeEnum.java index e1e59f7899..c87992de33 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/enums/dict/SysDictTypeEnum.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/enums/dict/SysDictTypeEnum.java @@ -18,8 +18,9 @@ public enum SysDictTypeEnum { SYS_BOOLEAN_STRING("sys_boolean_string"), // Boolean 鏄惁绫诲瀷 INF_REDIS_TIMEOUT_TYPE("inf_redis_timeout_type"), // Redis 瓒呮椂绫诲瀷 - INF_JOB_STATUS("inf_job_status") // 浠诲姟鐘舵佺殑鏋氫妇 - ; + INF_JOB_STATUS("inf_job_status"), // 瀹氭椂浠诲姟鐘舵佺殑鏋氫妇 + INF_JOB_LOG_STATUS("inf_job_log_status") // 瀹氭椂浠诲姟鏃ュ織鐘舵佺殑鏋氫妇 + ,; /** diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/job/auth/SysUserSessionTimeoutJob.java b/src/main/java/cn/iocoder/dashboard/modules/system/job/auth/SysUserSessionTimeoutJob.java index a3e132765c..ceb697afac 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/job/auth/SysUserSessionTimeoutJob.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/job/auth/SysUserSessionTimeoutJob.java @@ -15,9 +15,6 @@ public class SysUserSessionTimeoutJob implements JobHandler { @Override public String execute(String param) throws Exception { - if (true) { - throw new RuntimeException("娴嬭瘯寮傚父"); - } // System.out.println("鎵ц浜嗕竴娆′换鍔"); log.info("[execute][鎵ц浠诲姟锛歿}]", param); return null; diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/service/dict/impl/SysDictDataServiceImpl.java b/src/main/java/cn/iocoder/dashboard/modules/system/service/dict/impl/SysDictDataServiceImpl.java index 3404b24909..1ec82d6c4c 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/service/dict/impl/SysDictDataServiceImpl.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/service/dict/impl/SysDictDataServiceImpl.java @@ -195,13 +195,13 @@ public class SysDictDataServiceImpl implements SysDictDataService { // 鏍¢獙鑷繁瀛樺湪 checkDictDataExists(id); // 鏍¢獙瀛楀吀鏁版嵁鐨勫肩殑鍞竴鎬 - checkDictDataValueUnique(id, label); + checkDictDataValueUnique(id, dictType, label); // 鏍¢獙瀛楀吀绫诲瀷鏈夋晥 checkDictTypeValid(dictType); } - private void checkDictDataValueUnique(Long id, String label) { - SysDictDataDO dictData = dictDataMapper.selectByLabel(label); + private void checkDictDataValueUnique(Long id, String dictType, String label) { + SysDictDataDO dictData = dictDataMapper.selectByDictTypeAndLabel(dictType, label); if (dictData == null) { return; } diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/ToolTestDemoController.java b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/ToolTestDemoController.java index f08648b0b7..ba42b4c583 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/ToolTestDemoController.java +++ b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/ToolTestDemoController.java @@ -51,7 +51,7 @@ public class ToolTestDemoController { @DeleteMapping("/delete") @ApiOperation("鍒犻櫎娴嬭瘯绀轰緥") - @ApiImplicitParam(name = "id", value = "缂栧彿", required = true) + @ApiImplicitParam(name = "id", value = "缂栧彿", required = true, dataTypeClass = Long.class) @PreAuthorize("@ss.hasPermission('tool:test-demo:delete')") public CommonResult deleteTestDemo(@RequestParam("id") Long id) { testDemoService.deleteTestDemo(id); diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 8cd8fd5d10..c424b2a8ca 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -50,11 +50,16 @@ spring: properties: # 娣诲姞 Quartz Scheduler 闄勫姞灞炴э紝鏇村鍙互鐪 http://www.quartz-scheduler.org/documentation/2.4.0-SNAPSHOT/configuration.html 鏂囨。 org: quartz: + # Scheduler 鐩稿叧閰嶇疆 + scheduler: + instanceName: schedulerName + instanceId: AUTO # 鑷姩鐢熸垚 instance ID # JobStore 鐩稿叧閰嶇疆 jobStore: class: org.quartz.impl.jdbcjobstore.JobStoreTX # JobStore 瀹炵幇绫 isClustered: true # 鏄泦缇ゆā寮 - clusterCheckinInterval: 1000 + clusterCheckinInterval: 15000 # 闆嗙兢妫鏌ラ鐜囷紝鍗曚綅锛氭绉掋傞粯璁や负 15000锛屽嵆 15 绉 + misfireThreshold: 60000 # misfire 闃鍊硷紝鍗曚綅锛氭绉掋 # 绾跨▼姹犵浉鍏抽厤缃 threadPool: threadCount: 25 # 绾跨▼姹犲ぇ灏忋傞粯璁や负 10 銆