调整部分包路径
This commit is contained in:
@ -12,12 +12,12 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.config.Global;
|
||||
import com.ruoyi.common.config.ServerConfig;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.framework.config.ServerConfig;
|
||||
|
||||
/**
|
||||
* 通用请求处理
|
||||
|
@ -4,7 +4,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
|
||||
/**
|
||||
* druid 监控
|
||||
|
@ -5,7 +5,7 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.framework.web.domain.Server;
|
||||
|
||||
/**
|
||||
|
@ -1,171 +0,0 @@
|
||||
package com.ruoyi.web.controller.monitor;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.quartz.domain.SysJob;
|
||||
import com.ruoyi.quartz.service.ISysJobService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
||||
/**
|
||||
* 调度任务信息操作处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/monitor/job")
|
||||
public class SysJobController extends BaseController
|
||||
{
|
||||
private String prefix = "monitor/job";
|
||||
|
||||
@Autowired
|
||||
private ISysJobService jobService;
|
||||
|
||||
@RequiresPermissions("monitor:job:view")
|
||||
@GetMapping()
|
||||
public String job()
|
||||
{
|
||||
return prefix + "/job";
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:job:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(SysJob job)
|
||||
{
|
||||
startPage();
|
||||
List<SysJob> list = jobService.selectJobList(job);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "定时任务", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("monitor:job:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(SysJob job)
|
||||
{
|
||||
List<SysJob> list = jobService.selectJobList(job);
|
||||
ExcelUtil<SysJob> util = new ExcelUtil<SysJob>(SysJob.class);
|
||||
return util.exportExcel(list, "定时任务");
|
||||
}
|
||||
|
||||
@Log(title = "定时任务", businessType = BusinessType.DELETE)
|
||||
@RequiresPermissions("monitor:job:remove")
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
try
|
||||
{
|
||||
jobService.deleteJobByIds(ids);
|
||||
return success();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
return error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:job:detail")
|
||||
@GetMapping("/detail/{jobId}")
|
||||
public String detail(@PathVariable("jobId") Long jobId, ModelMap mmap)
|
||||
{
|
||||
mmap.put("name", "job");
|
||||
mmap.put("job", jobService.selectJobById(jobId));
|
||||
return prefix + "/detail";
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务调度状态修改
|
||||
*/
|
||||
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
|
||||
@RequiresPermissions("monitor:job:changeStatus")
|
||||
@PostMapping("/changeStatus")
|
||||
@ResponseBody
|
||||
public AjaxResult changeStatus(SysJob job)
|
||||
{
|
||||
job.setUpdateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(jobService.changeStatus(job));
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务调度立即执行一次
|
||||
*/
|
||||
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
|
||||
@RequiresPermissions("monitor:job:changeStatus")
|
||||
@PostMapping("/run")
|
||||
@ResponseBody
|
||||
public AjaxResult run(SysJob job)
|
||||
{
|
||||
return toAjax(jobService.run(job));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增调度
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存调度
|
||||
*/
|
||||
@Log(title = "定时任务", businessType = BusinessType.INSERT)
|
||||
@RequiresPermissions("monitor:job:add")
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(SysJob job)
|
||||
{
|
||||
job.setCreateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(jobService.insertJobCron(job));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改调度
|
||||
*/
|
||||
@GetMapping("/edit/{jobId}")
|
||||
public String edit(@PathVariable("jobId") Long jobId, ModelMap mmap)
|
||||
{
|
||||
mmap.put("job", jobService.selectJobById(jobId));
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存调度
|
||||
*/
|
||||
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
|
||||
@RequiresPermissions("monitor:job:edit")
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(SysJob job)
|
||||
{
|
||||
job.setUpdateBy(ShiroUtils.getLoginName());
|
||||
return toAjax(jobService.updateJobCron(job));
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验cron表达式是否有效
|
||||
*/
|
||||
@PostMapping("/checkCronExpressionIsValid")
|
||||
@ResponseBody
|
||||
public boolean checkCronExpressionIsValid(SysJob job)
|
||||
{
|
||||
return jobService.checkCronExpressionIsValid(job.getCronExpression());
|
||||
}
|
||||
}
|
@ -1,91 +0,0 @@
|
||||
package com.ruoyi.web.controller.monitor;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
import com.ruoyi.quartz.domain.SysJobLog;
|
||||
import com.ruoyi.quartz.service.ISysJobLogService;
|
||||
|
||||
/**
|
||||
* 调度日志操作处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/monitor/jobLog")
|
||||
public class SysJobLogController extends BaseController
|
||||
{
|
||||
private String prefix = "monitor/job";
|
||||
|
||||
@Autowired
|
||||
private ISysJobLogService jobLogService;
|
||||
|
||||
@RequiresPermissions("monitor:job:view")
|
||||
@GetMapping()
|
||||
public String jobLog()
|
||||
{
|
||||
return prefix + "/jobLog";
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:job:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(SysJobLog jobLog)
|
||||
{
|
||||
startPage();
|
||||
List<SysJobLog> list = jobLogService.selectJobLogList(jobLog);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@Log(title = "调度日志", businessType = BusinessType.EXPORT)
|
||||
@RequiresPermissions("monitor:job:export")
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(SysJobLog jobLog)
|
||||
{
|
||||
List<SysJobLog> list = jobLogService.selectJobLogList(jobLog);
|
||||
ExcelUtil<SysJobLog> util = new ExcelUtil<SysJobLog>(SysJobLog.class);
|
||||
return util.exportExcel(list, "调度日志");
|
||||
}
|
||||
|
||||
@Log(title = "调度日志", businessType = BusinessType.DELETE)
|
||||
@RequiresPermissions("monitor:job:remove")
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(jobLogService.deleteJobLogByIds(ids));
|
||||
}
|
||||
|
||||
@RequiresPermissions("monitor:job:detail")
|
||||
@GetMapping("/detail/{jobLogId}")
|
||||
public String detail(@PathVariable("jobLogId") Long jobLogId, ModelMap mmap)
|
||||
{
|
||||
mmap.put("name", "jobLog");
|
||||
mmap.put("jobLog", jobLogService.selectJobLogById(jobLogId));
|
||||
return prefix + "/detail";
|
||||
}
|
||||
|
||||
@Log(title = "调度日志", businessType = BusinessType.CLEAN)
|
||||
@RequiresPermissions("monitor:job:remove")
|
||||
@PostMapping("/clean")
|
||||
@ResponseBody
|
||||
public AjaxResult clean()
|
||||
{
|
||||
jobLogService.cleanJobLog();
|
||||
return success();
|
||||
}
|
||||
}
|
@ -9,13 +9,13 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.SysLogininfor;
|
||||
import com.ruoyi.system.service.ISysLogininforService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
||||
/**
|
||||
* 系统访问记录
|
||||
|
@ -11,13 +11,13 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.SysOperLog;
|
||||
import com.ruoyi.system.service.ISysOperLogService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
||||
/**
|
||||
* 操作日志记录
|
||||
|
@ -10,7 +10,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.enums.OnlineStatus;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
@ -19,7 +20,6 @@ import com.ruoyi.framework.shiro.session.OnlineSessionDAO;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.system.domain.SysUserOnline;
|
||||
import com.ruoyi.system.service.ISysUserOnlineService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
||||
/**
|
||||
* 在线用户监控
|
||||
|
@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.google.code.kaptcha.Constants;
|
||||
import com.google.code.kaptcha.Producer;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
|
||||
/**
|
||||
* 图片验证码(支持算术形式)
|
||||
|
@ -11,14 +11,14 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.system.domain.SysConfig;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
||||
/**
|
||||
* 参数配置 信息操作处理
|
||||
|
@ -11,12 +11,12 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.base.Ztree;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.Ztree;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
import com.ruoyi.system.domain.SysDept;
|
||||
import com.ruoyi.system.domain.SysRole;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
|
@ -11,14 +11,14 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.system.domain.SysDictData;
|
||||
import com.ruoyi.system.service.ISysDictDataService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
||||
/**
|
||||
* 数据字典信息
|
||||
|
@ -11,14 +11,14 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.system.domain.SysDictType;
|
||||
import com.ruoyi.system.service.ISysDictTypeService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
||||
/**
|
||||
* 数据字典信息
|
||||
|
@ -6,10 +6,11 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import com.ruoyi.common.config.Global;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.system.domain.SysMenu;
|
||||
import com.ruoyi.system.domain.SysUser;
|
||||
import com.ruoyi.system.service.ISysMenuService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
||||
/**
|
||||
* 首页 业务处理
|
||||
@ -27,7 +28,7 @@ public class SysIndexController extends BaseController
|
||||
public String index(ModelMap mmap)
|
||||
{
|
||||
// 取身份信息
|
||||
SysUser user = getSysUser();
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
// 根据用户id取出菜单
|
||||
List<SysMenu> menus = menuService.selectMenusByUser(user);
|
||||
mmap.put("menus", menus);
|
||||
|
@ -10,10 +10,10 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
||||
/**
|
||||
* 登录验证
|
||||
|
@ -11,11 +11,11 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.base.Ztree;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.Ztree;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
import com.ruoyi.system.domain.SysMenu;
|
||||
import com.ruoyi.system.domain.SysRole;
|
||||
import com.ruoyi.system.service.ISysMenuService;
|
||||
|
@ -11,13 +11,13 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
import com.ruoyi.system.service.ISysNoticeService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
||||
/**
|
||||
* 公告 信息操作处理
|
||||
|
@ -11,14 +11,14 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
import com.ruoyi.system.service.ISysPostService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
||||
/**
|
||||
* 岗位信息操作处理
|
||||
|
@ -12,8 +12,9 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.config.Global;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
@ -22,7 +23,6 @@ import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.system.domain.SysUser;
|
||||
import com.ruoyi.system.service.ISysDictDataService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
||||
/**
|
||||
* 个人信息 业务处理
|
||||
@ -52,7 +52,7 @@ public class SysProfileController extends BaseController
|
||||
@GetMapping()
|
||||
public String profile(ModelMap mmap)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
user.setSex(dictDataService.selectDictLabel("sys_user_sex", user.getSex()));
|
||||
mmap.put("user", user);
|
||||
mmap.put("roleGroup", userService.selectUserRoleGroup(user.getUserId()));
|
||||
@ -64,7 +64,7 @@ public class SysProfileController extends BaseController
|
||||
@ResponseBody
|
||||
public boolean checkPassword(String password)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
if (passwordService.matches(user, password))
|
||||
{
|
||||
return true;
|
||||
@ -75,7 +75,7 @@ public class SysProfileController extends BaseController
|
||||
@GetMapping("/resetPwd")
|
||||
public String resetPwd(ModelMap mmap)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
mmap.put("user", userService.selectUserById(user.getUserId()));
|
||||
return prefix + "/resetPwd";
|
||||
}
|
||||
@ -85,14 +85,14 @@ public class SysProfileController extends BaseController
|
||||
@ResponseBody
|
||||
public AjaxResult resetPwd(String oldPassword, String newPassword)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
if (StringUtils.isNotEmpty(newPassword) && passwordService.matches(user, oldPassword))
|
||||
{
|
||||
user.setSalt(ShiroUtils.randomSalt());
|
||||
user.setPassword(passwordService.encryptPassword(user.getLoginName(), newPassword, user.getSalt()));
|
||||
if (userService.resetUserPwd(user) > 0)
|
||||
{
|
||||
setSysUser(userService.selectUserById(user.getUserId()));
|
||||
ShiroUtils.setSysUser(userService.selectUserById(user.getUserId()));
|
||||
return success();
|
||||
}
|
||||
return error();
|
||||
@ -109,7 +109,7 @@ public class SysProfileController extends BaseController
|
||||
@GetMapping("/edit")
|
||||
public String edit(ModelMap mmap)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
mmap.put("user", userService.selectUserById(user.getUserId()));
|
||||
return prefix + "/edit";
|
||||
}
|
||||
@ -120,7 +120,7 @@ public class SysProfileController extends BaseController
|
||||
@GetMapping("/avatar")
|
||||
public String avatar(ModelMap mmap)
|
||||
{
|
||||
SysUser user = getSysUser();
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
mmap.put("user", userService.selectUserById(user.getUserId()));
|
||||
return prefix + "/avatar";
|
||||
}
|
||||
@ -133,14 +133,14 @@ public class SysProfileController extends BaseController
|
||||
@ResponseBody
|
||||
public AjaxResult update(SysUser user)
|
||||
{
|
||||
SysUser currentUser = getSysUser();
|
||||
SysUser currentUser = ShiroUtils.getSysUser();
|
||||
currentUser.setUserName(user.getUserName());
|
||||
currentUser.setEmail(user.getEmail());
|
||||
currentUser.setPhonenumber(user.getPhonenumber());
|
||||
currentUser.setSex(user.getSex());
|
||||
if (userService.updateUserInfo(currentUser) > 0)
|
||||
{
|
||||
setSysUser(userService.selectUserById(currentUser.getUserId()));
|
||||
ShiroUtils.setSysUser(userService.selectUserById(currentUser.getUserId()));
|
||||
return success();
|
||||
}
|
||||
return error();
|
||||
@ -154,7 +154,7 @@ public class SysProfileController extends BaseController
|
||||
@ResponseBody
|
||||
public AjaxResult updateAvatar(@RequestParam("avatarfile") MultipartFile file)
|
||||
{
|
||||
SysUser currentUser = getSysUser();
|
||||
SysUser currentUser = ShiroUtils.getSysUser();
|
||||
try
|
||||
{
|
||||
if (!file.isEmpty())
|
||||
@ -163,7 +163,7 @@ public class SysProfileController extends BaseController
|
||||
currentUser.setAvatar(avatar);
|
||||
if (userService.updateUserInfo(currentUser) > 0)
|
||||
{
|
||||
setSysUser(userService.selectUserById(currentUser.getUserId()));
|
||||
ShiroUtils.setSysUser(userService.selectUserById(currentUser.getUserId()));
|
||||
return success();
|
||||
}
|
||||
}
|
||||
|
@ -12,14 +12,14 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.system.domain.SysRole;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
||||
/**
|
||||
* 角色信息
|
||||
|
@ -13,14 +13,14 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||
import com.ruoyi.framework.util.ShiroUtils;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
import com.ruoyi.system.domain.SysUser;
|
||||
import com.ruoyi.system.service.ISysPostService;
|
||||
import com.ruoyi.system.service.ISysRoleService;
|
||||
@ -85,7 +85,7 @@ public class SysUserController extends BaseController
|
||||
{
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
List<SysUser> userList = util.importExcel(file.getInputStream());
|
||||
String operName = getSysUser().getLoginName();
|
||||
String operName = ShiroUtils.getSysUser().getLoginName();
|
||||
String message = userService.importUser(userList, updateSupport, operName);
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
|
||||
/**
|
||||
* build 表单构建
|
||||
|
@ -1,89 +0,0 @@
|
||||
package com.ruoyi.web.controller.tool;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.page.TableDataInfo;
|
||||
import com.ruoyi.common.support.Convert;
|
||||
import com.ruoyi.generator.domain.TableInfo;
|
||||
import com.ruoyi.generator.service.IGenService;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
||||
/**
|
||||
* 代码生成 操作处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/tool/gen")
|
||||
public class GenController extends BaseController
|
||||
{
|
||||
private String prefix = "tool/gen";
|
||||
|
||||
@Autowired
|
||||
private IGenService genService;
|
||||
|
||||
@RequiresPermissions("tool:gen:view")
|
||||
@GetMapping()
|
||||
public String gen()
|
||||
{
|
||||
return prefix + "/gen";
|
||||
}
|
||||
|
||||
@RequiresPermissions("tool:gen:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(TableInfo tableInfo)
|
||||
{
|
||||
startPage();
|
||||
List<TableInfo> list = genService.selectTableList(tableInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成代码
|
||||
*/
|
||||
@RequiresPermissions("tool:gen:code")
|
||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||
@GetMapping("/genCode/{tableName}")
|
||||
public void genCode(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException
|
||||
{
|
||||
byte[] data = genService.generatorCode(tableName);
|
||||
response.reset();
|
||||
response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\"");
|
||||
response.addHeader("Content-Length", "" + data.length);
|
||||
response.setContentType("application/octet-stream; charset=UTF-8");
|
||||
|
||||
IOUtils.write(data, response.getOutputStream());
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量生成代码
|
||||
*/
|
||||
@RequiresPermissions("tool:gen:code")
|
||||
@Log(title = "代码生成", businessType = BusinessType.GENCODE)
|
||||
@GetMapping("/batchGenCode")
|
||||
@ResponseBody
|
||||
public void batchGenCode(HttpServletResponse response, String tables) throws IOException
|
||||
{
|
||||
String[] tableNames = Convert.toStrArray(tables);
|
||||
byte[] data = genService.generatorCode(tableNames);
|
||||
response.reset();
|
||||
response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\"");
|
||||
response.addHeader("Content-Length", "" + data.length);
|
||||
response.setContentType("application/octet-stream; charset=UTF-8");
|
||||
|
||||
IOUtils.write(data, response.getOutputStream());
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
|
||||
/**
|
||||
* swagger 接口
|
||||
|
@ -2,17 +2,14 @@ package com.ruoyi.web.controller.tool;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.ruoyi.common.base.AjaxResult;
|
||||
import com.ruoyi.framework.web.base.BaseController;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -6,7 +6,7 @@ ruoyi:
|
||||
version: 3.2.0
|
||||
# 版权年份
|
||||
copyrightYear: 2019
|
||||
# 文件上传路径
|
||||
# 文件上传
|
||||
profile: D:/profile/
|
||||
# 获取ip地址开关
|
||||
addressEnabled: true
|
||||
@ -121,14 +121,3 @@ xss:
|
||||
excludes: /system/notice/*
|
||||
# 匹配链接
|
||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||
|
||||
# 代码生成
|
||||
gen:
|
||||
# 作者
|
||||
author: ruoyi
|
||||
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
|
||||
packageName: com.ruoyi.system
|
||||
# 自动去除表前缀,默认是true
|
||||
autoRemovePre: true
|
||||
# 表前缀(类名不会包含表前缀)
|
||||
tablePrefix: sys_
|
@ -1,100 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-job-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">任务名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="jobName" id="jobName" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">任务组名:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="jobGroup" id="jobGroup" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">方法名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="methodName" id="methodName" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">方法参数:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="methodParams" id="methodParams">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">cron表达式:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="cronExpression" id="cronExpression" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">执行策略:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="radio-box"> <input type="radio" name="misfirePolicy" value="1" th:checked="true"/> 立即执行 </label>
|
||||
<label class="radio-box"> <input type="radio" name="misfirePolicy" value="2" /> 执行一次 </label>
|
||||
<label class="radio-box"> <input type="radio" name="misfirePolicy" value="3" /> 放弃执行 </label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box" th:each="dict : ${@dict.getType('sys_job_status')}">
|
||||
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
|
||||
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea id="remark" name="remark" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "monitor/job";
|
||||
|
||||
$("#form-job-add").validate({
|
||||
rules:{
|
||||
cronExpression:{
|
||||
remote: {
|
||||
url: prefix + "/checkCronExpressionIsValid",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
"cronExpression": function() {
|
||||
return $.common.trim($("#cronExpression").val());
|
||||
}
|
||||
},
|
||||
dataFilter: function(data, type) {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
"cronExpression": {
|
||||
remote: "表达式不正确"
|
||||
}
|
||||
},
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-job-add').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,94 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
|
||||
xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
|
||||
<form class="form-horizontal m-t" id="jobLogForm" th:if="${name == 'jobLog'}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">日志序号:</label>
|
||||
<div class="form-control-static" th:text="${jobLog.jobLogId}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">任务名称:</label>
|
||||
<div class="form-control-static" th:text="${jobLog.jobName}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">任务组名:</label>
|
||||
<div class="form-control-static" th:text="${jobLog.jobGroup}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">任务方法:</label>
|
||||
<div class="form-control-static" th:text="${jobLog.methodName} + '(' + ${#strings.defaultString(jobLog.methodParams,'')} + ')'">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">日志信息:</label>
|
||||
<div class="form-control-static" th:text="${jobLog.jobMessage}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">执行状态:</label>
|
||||
<div class="form-control-static" th:class="${jobLog.status == '0' ? 'label label-primary' : 'label label-danger'}" th:text="${jobLog.status == '0' ? '正常' : '失败'}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" th:style="'display:' + ${jobLog.status == '0' ? 'none' : 'block'}">
|
||||
<label class="col-sm-3 control-label">异常信息:</label>
|
||||
<div class="form-control-static" th:text="${jobLog.exceptionInfo}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form class="form-horizontal m-t" id="jobForm" th:if="${name == 'job'}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">任务序号:</label>
|
||||
<div class="form-control-static" th:text="${job.jobId}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">任务名称:</label>
|
||||
<div class="form-control-static" th:text="${job.jobName}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">任务组名:</label>
|
||||
<div class="form-control-static" th:text="${job.jobGroup}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">任务方法:</label>
|
||||
<div class="form-control-static" th:text="${job.methodName} + '(' + ${#strings.defaultString(job.methodParams,'')} + ')'">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">执行表达式:</label>
|
||||
<div class="form-control-static" th:text="${job.cronExpression}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">下次执行时间:</label>
|
||||
<div class="form-control-static" th:text="${#dates.format(job.nextValidTime, 'yyyy-MM-dd HH:mm:ss')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">执行策略:</label>
|
||||
<div class="form-control-static" th:if="${job.misfirePolicy == '0'}">默认策略</div>
|
||||
<div class="form-control-static" th:if="${job.misfirePolicy == '1'}">立即执行</div>
|
||||
<div class="form-control-static" th:if="${job.misfirePolicy == '2'}">执行一次</div>
|
||||
<div class="form-control-static" th:if="${job.misfirePolicy == '3'}">放弃执行</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">执行状态:</label>
|
||||
<div class="form-control-static" th:class="${job.status == '0' ? 'label label-primary' : 'label label-danger'}" th:text="${job.status == '0' ? '正常' : '暂停'}">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,111 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-job-edit" th:object="${job}">
|
||||
<input id="jobId" name="jobId" type="hidden" th:field="*{jobId}"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">任务名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="jobName" id="jobName" th:field="*{jobName}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">任务组名:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="jobGroup" id="jobGroup" th:field="*{jobGroup}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">方法名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="methodName" id="methodName" th:field="*{methodName}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">方法参数:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="methodParams" id="methodParams" th:field="*{methodParams}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label ">cron表达式:</label>
|
||||
<div class="col-sm-8">
|
||||
<input class="form-control" type="text" name="cronExpression" id="cronExpression" th:field="*{cronExpression}" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">执行策略:</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="radio-box"> <input type="radio" th:field="*{misfirePolicy}" name="misfirePolicy" value="1" /> 立即执行 </label>
|
||||
<label class="radio-box"> <input type="radio" th:field="*{misfirePolicy}" name="misfirePolicy" value="2" /> 执行一次 </label>
|
||||
<label class="radio-box"> <input type="radio" th:field="*{misfirePolicy}" name="misfirePolicy" value="3" /> 放弃执行 </label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box" th:each="dict : ${@dict.getType('sys_job_status')}">
|
||||
<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
|
||||
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea id="remark" name="remark" class="form-control">[[*{remark}]]</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "monitor/job";
|
||||
|
||||
$("#form-job-edit").validate({
|
||||
rules:{
|
||||
jobName:{
|
||||
required:true,
|
||||
},
|
||||
jobGroup:{
|
||||
required:true,
|
||||
},
|
||||
methodName:{
|
||||
required:true,
|
||||
},
|
||||
cronExpression:{
|
||||
required:true,
|
||||
remote: {
|
||||
url: prefix + "/checkCronExpressionIsValid",
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
"cronExpression": function() {
|
||||
return $.common.trim($("#cronExpression").val());
|
||||
}
|
||||
},
|
||||
dataFilter: function(data, type) {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
"cronExpression": {
|
||||
remote: "表达式不正确"
|
||||
}
|
||||
},
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-job-edit').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,171 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
|
||||
xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="gray-bg">
|
||||
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="job-form">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
任务名称:<input type="text" name="jobName"/>
|
||||
</li>
|
||||
<li>
|
||||
方法名称:<input type="text" name="methodName"/>
|
||||
</li>
|
||||
<li>
|
||||
任务状态:<select name="status" th:with="type=${@dict.getType('sys_job_status')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="monitor:job:add">
|
||||
<i class="fa fa-plus"></i> 新增
|
||||
</a>
|
||||
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="system:job:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="monitor:job:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="monitor:job:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
<a class="btn btn-info" onclick="javascript:jobLog()" shiro:hasPermission="monitor:job:list">
|
||||
<i class="fa fa-list"></i> 日志
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table" data-mobile-responsive="true"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include :: footer"></div>
|
||||
<script th:inline="javascript">
|
||||
var detailFlag = [[${@permission.hasPermi('monitor:job:detail')}]];
|
||||
var editFlag = [[${@permission.hasPermi('monitor:job:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('monitor:job:remove')}]];
|
||||
var statusFlag = [[${@permission.hasPermi('monitor:job:changeStatus')}]];
|
||||
var datas = [[${@dict.getType('sys_job_status')}]];
|
||||
var prefix = ctx + "monitor/job";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
detailUrl: prefix + "/detail/{id}",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
sortName: "createTime",
|
||||
sortOrder: "desc",
|
||||
modalName: "任务",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'jobId',
|
||||
title: '任务编号'
|
||||
},
|
||||
{
|
||||
field: 'jobName',
|
||||
title: '任务名称',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'jobGroup',
|
||||
title: '任务组名',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'methodName',
|
||||
title: '方法名称'
|
||||
},
|
||||
{
|
||||
field: 'methodParams',
|
||||
title: '方法参数'
|
||||
},
|
||||
{
|
||||
field: 'cronExpression',
|
||||
title: '执行表达式'
|
||||
},
|
||||
{
|
||||
visible: statusFlag == 'hidden' ? false : true,
|
||||
title: '任务状态',
|
||||
align: 'center',
|
||||
formatter: function (value, row, index) {
|
||||
return statusTools(row);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-primary btn-xs ' + statusFlag + '" href="#" onclick="run(\'' + row.jobId + '\')"><i class="fa fa-play-circle-o"></i> 执行</a> ');
|
||||
actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="#" onclick="$.operate.detail(\'' + row.jobId + '\')"><i class="fa fa-search"></i>详细</a> ');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
/* 调度任务状态显示 */
|
||||
function statusTools(row) {
|
||||
if (row.status == 1) {
|
||||
return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="start(\'' + row.jobId + '\')"></i> ';
|
||||
} else {
|
||||
return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="stop(\'' + row.jobId + '\')"></i> ';
|
||||
}
|
||||
}
|
||||
|
||||
/* 立即执行一次 */
|
||||
function run(jobId) {
|
||||
$.modal.confirm("确认要立即执行任务吗?", function() {
|
||||
$.operate.post(prefix + "/run", { "jobId": jobId});
|
||||
})
|
||||
}
|
||||
|
||||
/* 调度任务-停用 */
|
||||
function stop(jobId) {
|
||||
$.modal.confirm("确认要停用任务吗?", function() {
|
||||
$.operate.post(prefix + "/changeStatus", { "jobId": jobId, "status": 1 });
|
||||
})
|
||||
}
|
||||
|
||||
/* 调度任务-启用 */
|
||||
function start(jobId) {
|
||||
$.modal.confirm("确认要启用任务吗?", function() {
|
||||
$.operate.post(prefix + "/changeStatus", { "jobId": jobId, "status": 0 });
|
||||
})
|
||||
}
|
||||
|
||||
/* 调度日志查询 */
|
||||
function jobLog(id) {
|
||||
var url = ctx + 'monitor/jobLog';
|
||||
createMenuItem(url, "调度日志");
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,130 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
|
||||
xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="gray-bg">
|
||||
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="jobLog-form">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>任务名称:</label><input type="text" name="jobName"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>方法名称:</label><input type="text" name="methodName"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>执行状态:</label><select name="status" th:with="type=${@dict.getType('sys_common_status')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li class="select-time">
|
||||
<label>执行时间: </label>
|
||||
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
|
||||
<span>-</span>
|
||||
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="monitor:job:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-danger" onclick="$.operate.clean()" shiro:hasPermission="monitor:job:remove">
|
||||
<i class="fa fa-trash"></i> 清空
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="monitor:job:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table" data-mobile-responsive="true"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include :: footer"></div>
|
||||
<script th:inline="javascript">
|
||||
var detailFlag = [[${@permission.hasPermi('monitor:job:detail')}]];
|
||||
var datas = [[${@dict.getType('sys_common_status')}]];
|
||||
var prefix = ctx + "monitor/jobLog";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
cleanUrl: prefix + "/clean",
|
||||
detailUrl: prefix + "/detail/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
sortName: "createTime",
|
||||
sortOrder: "desc",
|
||||
modalName: "调度日志",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'jobLogId',
|
||||
title: '日志编号'
|
||||
},
|
||||
{
|
||||
field: 'jobName',
|
||||
title: '任务名称',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'jobGroup',
|
||||
title: '任务组名',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'methodName',
|
||||
title: '方法名称'
|
||||
},
|
||||
{
|
||||
field: 'methodParams',
|
||||
title: '方法参数'
|
||||
},
|
||||
{
|
||||
field: 'jobMessage',
|
||||
title: '日志信息'
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(datas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="#" onclick="$.operate.detail(\'' + row.jobLogId + '\')"><i class="fa fa-search"></i>详细</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,123 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="gray-bg">
|
||||
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="gen-form">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
表名称:<input type="text" name="tableName"/>
|
||||
</li>
|
||||
<li>
|
||||
表描述:<input type="text" name="tableComment"/>
|
||||
</li>
|
||||
<li class="select-time">
|
||||
<label>表时间: </label>
|
||||
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
|
||||
<span>-</span>
|
||||
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="javascript:batchGenCode()" shiro:hasPermission="tool:gen:code">
|
||||
<i class="fa fa-download"></i> 批量生成
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table" data-mobile-responsive="true"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include :: footer"></div>
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "tool/gen";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
sortName: "createTime",
|
||||
sortOrder: "desc",
|
||||
showExport: true,
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
title: "序号",
|
||||
formatter: function (value, row, index) {
|
||||
return $.table.serialNumber(index);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'tableName',
|
||||
title: '表名称',
|
||||
width: '20%',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'tableComment',
|
||||
title: '表描述',
|
||||
width: '20%',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间',
|
||||
width: '20%',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
title: '更新时间',
|
||||
width: '20%',
|
||||
sortable: true
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '20%',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var msg = '<a class="btn btn-primary btn-xs" href="#" onclick="genCode(\'' + row.tableName + '\')"><i class="fa fa-bug"></i>生成代码</a> ';
|
||||
return msg;
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
// 生成代码
|
||||
function genCode(tableName) {
|
||||
$.modal.confirm("确定要生成" + tableName + "表代码吗?", function() {
|
||||
location.href = prefix + "/genCode/" + tableName;
|
||||
layer.msg('执行成功,正在生成代码请稍后…', { icon: 1 });
|
||||
})
|
||||
}
|
||||
|
||||
//批量生成代码
|
||||
function batchGenCode() {
|
||||
var rows = $.table.selectColumns("tableName");
|
||||
if (rows.length == 0) {
|
||||
$.modal.alertWarning("请选择要生成的数据");
|
||||
return;
|
||||
}
|
||||
$.modal.confirm("确认要生成选中的" + rows.length + "条数据吗?", function() {
|
||||
location.href = prefix + "/batchGenCode?tables=" + rows;
|
||||
layer.msg('执行成功,正在生成代码请稍后…', { icon: 1 });
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user