Loading escheduler-api/src/main/java/cn/escheduler/api/quartz/QuartzExecutors.java +2 −0 Original line number Diff line number Diff line Loading @@ -230,6 +230,8 @@ public class QuartzExecutors { if(scheduler.checkExists(jobKey)){ logger.info("try to delete job, job name: {}, job group name: {},", jobName, jobGroupName); return scheduler.deleteJob(jobKey); }else { return true; } } catch (SchedulerException e) { Loading escheduler-api/src/main/java/cn/escheduler/api/service/ResourcesService.java +6 −0 Original line number Diff line number Diff line Loading @@ -569,6 +569,7 @@ public class ResourcesService extends BaseService { * @param resourceId * @return */ @Transactional(value = "TransactionManager",rollbackFor = Exception.class) public Result updateResourceContent(int resourceId, String content) { Result result = new Result(); Loading Loading @@ -597,6 +598,10 @@ public class ResourcesService extends BaseService { } } resource.setSize(content.getBytes().length); resource.setUpdateTime(new Date()); resourcesMapper.update(resource); User user = userMapper.queryDetailsById(resource.getUserId()); String tenantCode = tenantMapper.queryById(user.getTenantId()).getTenantCode(); Loading Loading @@ -643,6 +648,7 @@ public class ResourcesService extends BaseService { logger.error("{} is not exist", resourcePath); result.setCode(Status.HDFS_OPERATION_ERROR.getCode()); result.setMsg(String.format("%s is not exist", resourcePath)); return result; } } catch (Exception e) { logger.error(e.getMessage(), e); Loading escheduler-common/src/main/java/cn/escheduler/common/utils/DependentUtils.java +6 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,9 @@ public class DependentUtils { case "last7Days": result = DependentDateUtils.getLastDayInterval(businessDate, 7); break; case "thisWeek": result = DependentDateUtils.getThisWeekInterval(businessDate); break; case "lastWeek": result = DependentDateUtils.getLastWeekInterval(businessDate); break; Loading @@ -119,6 +122,9 @@ public class DependentUtils { case "lastSunday": result = DependentDateUtils.getLastWeekOneDayInterval(businessDate, 7); break; case "thisMonth": result = DependentDateUtils.getThisMonthInterval(businessDate); break; case "lastMonth": result = DependentDateUtils.getLastMonthInterval(businessDate); break; Loading escheduler-common/src/main/java/cn/escheduler/common/utils/OSUtils.java +1 −1 Original line number Diff line number Diff line Loading @@ -220,7 +220,7 @@ public class OSUtils { * @throws IOException */ public static String exeShell(String command) throws IOException { return ShellExecutor.execCommand("groups"); return ShellExecutor.execCommand(command); } /** Loading escheduler-common/src/main/java/cn/escheduler/common/utils/dependent/DependentDateUtils.java +20 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,16 @@ public class DependentDateUtils { return dateIntervals; } /** * get interval between this month first day and businessDate * @param businessDate * @return */ public static List<DateInterval> getThisMonthInterval(Date businessDate) { Date firstDay = DateUtils.getFirstDayOfMonth(businessDate); return getDateIntervalListBetweenTwoDates(firstDay, businessDate); } /** * get interval between last month first day and last day * @param businessDate Loading Loading @@ -108,6 +118,16 @@ public class DependentDateUtils { } } /** * get interval between monday to businessDate of this week * @param businessDate * @return */ public static List<DateInterval> getThisWeekInterval(Date businessDate) { Date mondayThisWeek = DateUtils.getMonday(businessDate); return getDateIntervalListBetweenTwoDates(mondayThisWeek, businessDate); } /** * get interval between monday to sunday of last week * default set monday the first day of week Loading Loading
escheduler-api/src/main/java/cn/escheduler/api/quartz/QuartzExecutors.java +2 −0 Original line number Diff line number Diff line Loading @@ -230,6 +230,8 @@ public class QuartzExecutors { if(scheduler.checkExists(jobKey)){ logger.info("try to delete job, job name: {}, job group name: {},", jobName, jobGroupName); return scheduler.deleteJob(jobKey); }else { return true; } } catch (SchedulerException e) { Loading
escheduler-api/src/main/java/cn/escheduler/api/service/ResourcesService.java +6 −0 Original line number Diff line number Diff line Loading @@ -569,6 +569,7 @@ public class ResourcesService extends BaseService { * @param resourceId * @return */ @Transactional(value = "TransactionManager",rollbackFor = Exception.class) public Result updateResourceContent(int resourceId, String content) { Result result = new Result(); Loading Loading @@ -597,6 +598,10 @@ public class ResourcesService extends BaseService { } } resource.setSize(content.getBytes().length); resource.setUpdateTime(new Date()); resourcesMapper.update(resource); User user = userMapper.queryDetailsById(resource.getUserId()); String tenantCode = tenantMapper.queryById(user.getTenantId()).getTenantCode(); Loading Loading @@ -643,6 +648,7 @@ public class ResourcesService extends BaseService { logger.error("{} is not exist", resourcePath); result.setCode(Status.HDFS_OPERATION_ERROR.getCode()); result.setMsg(String.format("%s is not exist", resourcePath)); return result; } } catch (Exception e) { logger.error(e.getMessage(), e); Loading
escheduler-common/src/main/java/cn/escheduler/common/utils/DependentUtils.java +6 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,9 @@ public class DependentUtils { case "last7Days": result = DependentDateUtils.getLastDayInterval(businessDate, 7); break; case "thisWeek": result = DependentDateUtils.getThisWeekInterval(businessDate); break; case "lastWeek": result = DependentDateUtils.getLastWeekInterval(businessDate); break; Loading @@ -119,6 +122,9 @@ public class DependentUtils { case "lastSunday": result = DependentDateUtils.getLastWeekOneDayInterval(businessDate, 7); break; case "thisMonth": result = DependentDateUtils.getThisMonthInterval(businessDate); break; case "lastMonth": result = DependentDateUtils.getLastMonthInterval(businessDate); break; Loading
escheduler-common/src/main/java/cn/escheduler/common/utils/OSUtils.java +1 −1 Original line number Diff line number Diff line Loading @@ -220,7 +220,7 @@ public class OSUtils { * @throws IOException */ public static String exeShell(String command) throws IOException { return ShellExecutor.execCommand("groups"); return ShellExecutor.execCommand(command); } /** Loading
escheduler-common/src/main/java/cn/escheduler/common/utils/dependent/DependentDateUtils.java +20 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,16 @@ public class DependentDateUtils { return dateIntervals; } /** * get interval between this month first day and businessDate * @param businessDate * @return */ public static List<DateInterval> getThisMonthInterval(Date businessDate) { Date firstDay = DateUtils.getFirstDayOfMonth(businessDate); return getDateIntervalListBetweenTwoDates(firstDay, businessDate); } /** * get interval between last month first day and last day * @param businessDate Loading Loading @@ -108,6 +118,16 @@ public class DependentDateUtils { } } /** * get interval between monday to businessDate of this week * @param businessDate * @return */ public static List<DateInterval> getThisWeekInterval(Date businessDate) { Date mondayThisWeek = DateUtils.getMonday(businessDate); return getDateIntervalListBetweenTwoDates(mondayThisWeek, businessDate); } /** * get interval between monday to sunday of last week * default set monday the first day of week Loading