commit
57ccaf3eb5
|
|
@ -1,6 +1,6 @@
|
|||
@echo off
|
||||
echo.
|
||||
echo [信息] 清理生成路径。
|
||||
echo [信息] 清理工程target生成路径。
|
||||
echo.
|
||||
|
||||
%~d0
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
@echo off
|
||||
echo.
|
||||
echo [信息] 运行Web工程。
|
||||
echo [信息] 使用Jar命令运行Web工程。
|
||||
echo.
|
||||
|
||||
cd %~dp0
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package com.ruoyi.web.controller.common;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
|
@ -17,7 +17,6 @@ import com.ruoyi.common.config.RuoYiConfig;
|
|||
import com.ruoyi.common.config.ServerConfig;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.FileInfo;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
|
|
@ -35,6 +34,8 @@ public class CommonController
|
|||
@Autowired
|
||||
private ServerConfig serverConfig;
|
||||
|
||||
private static final String FILE_DELIMETER = ",";
|
||||
|
||||
/**
|
||||
* 通用下载请求
|
||||
*
|
||||
|
|
@ -103,15 +104,20 @@ public class CommonController
|
|||
{
|
||||
// 上传文件路径
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
List<FileInfo> fileInfos = new LinkedList<FileInfo>();
|
||||
List<String> fileNames = new ArrayList<String>();
|
||||
List<String> urls = new ArrayList<String>();
|
||||
for (MultipartFile file : files)
|
||||
{
|
||||
// 上传并返回新文件名称
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
String url = serverConfig.getUrl() + fileName;
|
||||
fileInfos.add(new FileInfo(fileName, url));
|
||||
fileNames.add(fileName);
|
||||
urls.add(url);
|
||||
}
|
||||
return AjaxResult.success(fileInfos);
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("fileNames", StringUtils.join(fileNames, FILE_DELIMETER));
|
||||
ajax.put("urls", StringUtils.join(urls, FILE_DELIMETER));
|
||||
return ajax;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ 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.ShiroUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.SysConfig;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
|
|
@ -89,7 +88,7 @@ public class SysConfigController extends BaseController
|
|||
{
|
||||
return error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||
}
|
||||
config.setCreateBy(ShiroUtils.getLoginName());
|
||||
config.setCreateBy(getLoginName());
|
||||
return toAjax(configService.insertConfig(config));
|
||||
}
|
||||
|
||||
|
|
@ -116,7 +115,7 @@ public class SysConfigController extends BaseController
|
|||
{
|
||||
return error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在");
|
||||
}
|
||||
config.setUpdateBy(ShiroUtils.getLoginName());
|
||||
config.setUpdateBy(getLoginName());
|
||||
return toAjax(configService.updateConfig(config));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import com.ruoyi.common.core.domain.Ztree;
|
|||
import com.ruoyi.common.core.domain.entity.SysDept;
|
||||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.system.service.ISysDeptService;
|
||||
|
||||
|
|
@ -64,9 +63,9 @@ public class SysDeptController extends BaseController
|
|||
@GetMapping("/add/{parentId}")
|
||||
public String add(@PathVariable("parentId") Long parentId, ModelMap mmap)
|
||||
{
|
||||
if (!ShiroUtils.getSysUser().isAdmin())
|
||||
if (!getSysUser().isAdmin())
|
||||
{
|
||||
parentId = ShiroUtils.getSysUser().getDeptId();
|
||||
parentId = getSysUser().getDeptId();
|
||||
}
|
||||
mmap.put("dept", deptService.selectDeptById(parentId));
|
||||
return prefix + "/add";
|
||||
|
|
@ -85,7 +84,7 @@ public class SysDeptController extends BaseController
|
|||
{
|
||||
return error("新增部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||
}
|
||||
dept.setCreateBy(ShiroUtils.getLoginName());
|
||||
dept.setCreateBy(getLoginName());
|
||||
return toAjax(deptService.insertDept(dept));
|
||||
}
|
||||
|
||||
|
|
@ -126,7 +125,7 @@ public class SysDeptController extends BaseController
|
|||
{
|
||||
return AjaxResult.error("该部门包含未停用的子部门!");
|
||||
}
|
||||
dept.setUpdateBy(ShiroUtils.getLoginName());
|
||||
dept.setUpdateBy(getLoginName());
|
||||
return toAjax(deptService.updateDept(dept));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
|||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.service.ISysDictDataService;
|
||||
|
||||
|
|
@ -82,7 +81,7 @@ public class SysDictDataController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult addSave(@Validated SysDictData dict)
|
||||
{
|
||||
dict.setCreateBy(ShiroUtils.getLoginName());
|
||||
dict.setCreateBy(getLoginName());
|
||||
return toAjax(dictDataService.insertDictData(dict));
|
||||
}
|
||||
|
||||
|
|
@ -105,7 +104,7 @@ public class SysDictDataController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult editSave(@Validated SysDictData dict)
|
||||
{
|
||||
dict.setUpdateBy(ShiroUtils.getLoginName());
|
||||
dict.setUpdateBy(getLoginName());
|
||||
return toAjax(dictDataService.updateDictData(dict));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import com.ruoyi.common.core.domain.Ztree;
|
|||
import com.ruoyi.common.core.domain.entity.SysDictType;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.service.ISysDictTypeService;
|
||||
|
||||
|
|
@ -88,7 +87,7 @@ public class SysDictTypeController extends BaseController
|
|||
{
|
||||
return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||
}
|
||||
dict.setCreateBy(ShiroUtils.getLoginName());
|
||||
dict.setCreateBy(getLoginName());
|
||||
return toAjax(dictTypeService.insertDictType(dict));
|
||||
}
|
||||
|
||||
|
|
@ -115,7 +114,7 @@ public class SysDictTypeController extends BaseController
|
|||
{
|
||||
return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
|
||||
}
|
||||
dict.setUpdateBy(ShiroUtils.getLoginName());
|
||||
dict.setUpdateBy(getLoginName());
|
||||
return toAjax(dictTypeService.updateDictType(dict));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import com.ruoyi.common.core.text.Convert;
|
|||
import com.ruoyi.common.utils.CookieUtils;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
|
|
@ -52,7 +51,7 @@ public class SysIndexController extends BaseController
|
|||
public String index(ModelMap mmap)
|
||||
{
|
||||
// 取身份信息
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
SysUser user = getSysUser();
|
||||
// 根据用户id取出菜单
|
||||
List<SysMenu> menus = menuService.selectMenusByUser(user);
|
||||
mmap.put("menus", menus);
|
||||
|
|
@ -64,6 +63,7 @@ public class SysIndexController extends BaseController
|
|||
mmap.put("demoEnabled", RuoYiConfig.isDemoEnabled());
|
||||
mmap.put("isDefaultModifyPwd", initPasswordIsModify(user.getPwdUpdateDate()));
|
||||
mmap.put("isPasswordExpired", passwordIsExpiration(user.getPwdUpdateDate()));
|
||||
mmap.put("isMobile", ServletUtils.checkAgentIsMobile(ServletUtils.getRequest().getHeader("User-Agent")));
|
||||
|
||||
// 菜单导航显示风格
|
||||
String menuStyle = configService.selectConfigByKey("sys.index.menuStyle");
|
||||
|
|
@ -88,7 +88,7 @@ public class SysIndexController extends BaseController
|
|||
@GetMapping("/lockscreen")
|
||||
public String lockscreen(ModelMap mmap)
|
||||
{
|
||||
mmap.put("user", ShiroUtils.getSysUser());
|
||||
mmap.put("user", getSysUser());
|
||||
ServletUtils.getSession().setAttribute(ShiroConstants.LOCK_SCREEN, true);
|
||||
return "lock";
|
||||
}
|
||||
|
|
@ -98,7 +98,7 @@ public class SysIndexController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult unlockscreen(String password)
|
||||
{
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
SysUser user = getSysUser();
|
||||
if (StringUtils.isNull(user))
|
||||
{
|
||||
return AjaxResult.error("服务器超时,请重新登陆");
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import org.apache.shiro.subject.Subject;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
|
@ -28,6 +29,7 @@ import com.ruoyi.common.core.domain.entity.SysUser;
|
|||
import com.ruoyi.common.enums.UserStatus;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.web.service.ConfigService;
|
||||
import com.ruoyi.framework.jwt.utils.JwtUtils;
|
||||
import com.ruoyi.framework.shiro.service.SysPasswordService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
|
|
@ -43,6 +45,15 @@ import java.util.Map;
|
|||
@Controller
|
||||
public class SysLoginController extends BaseController
|
||||
{
|
||||
/**
|
||||
* 是否开启记住我功能
|
||||
*/
|
||||
@Value("${shiro.rememberMe.enabled: false}")
|
||||
private boolean rememberMe;
|
||||
|
||||
@Autowired
|
||||
private ConfigService configService;
|
||||
|
||||
@Autowired
|
||||
private IJwtTokenService jwtTokenService;
|
||||
|
||||
|
|
@ -50,7 +61,7 @@ public class SysLoginController extends BaseController
|
|||
private IWechatApiService wechatApiService;
|
||||
|
||||
@GetMapping("/login")
|
||||
public String login(HttpServletRequest request, HttpServletResponse response, Map<String,String> map)
|
||||
public String login(HttpServletRequest request, HttpServletResponse response, ModelMap mmap)
|
||||
{
|
||||
String loginType= request.getParameter("loginType");
|
||||
if(StringUtils.isNotEmpty(loginType) && request.getParameter("loginType").equals("wechat")){
|
||||
|
|
@ -63,9 +74,9 @@ public class SysLoginController extends BaseController
|
|||
}
|
||||
|
||||
String password="";
|
||||
map.put("loginType","wechat");
|
||||
map.put("username",username);
|
||||
map.put("password",password);
|
||||
mmap.put("loginType","wechat");
|
||||
mmap.put("username",username);
|
||||
mmap.put("password",password);
|
||||
return "loginwechat";
|
||||
|
||||
|
||||
|
|
@ -76,6 +87,10 @@ public class SysLoginController extends BaseController
|
|||
{
|
||||
return ServletUtils.renderString(response, "{\"code\":\"1\",\"msg\":\"未登录或登录超时。请重新登录\"}");
|
||||
}
|
||||
// 是否开启记住我
|
||||
mmap.put("isRemembered", rememberMe);
|
||||
// 是否开启用户注册
|
||||
mmap.put("isAllowRegister", configService.getKey("sys.account.registerUser"));
|
||||
return "login";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ public class SysMenuController extends BaseController
|
|||
{
|
||||
return error("新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||
}
|
||||
menu.setCreateBy(ShiroUtils.getLoginName());
|
||||
menu.setCreateBy(getLoginName());
|
||||
AuthorizationUtils.clearAllCachedAuthorizationInfo();
|
||||
return toAjax(menuService.insertMenu(menu));
|
||||
}
|
||||
|
|
@ -137,7 +137,7 @@ public class SysMenuController extends BaseController
|
|||
{
|
||||
return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
|
||||
}
|
||||
menu.setUpdateBy(ShiroUtils.getLoginName());
|
||||
menu.setUpdateBy(getLoginName());
|
||||
AuthorizationUtils.clearAllCachedAuthorizationInfo();
|
||||
return toAjax(menuService.updateMenu(menu));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ 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.ShiroUtils;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
import com.ruoyi.system.service.ISysNoticeService;
|
||||
|
||||
|
|
@ -71,7 +70,7 @@ public class SysNoticeController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult addSave(SysNotice notice)
|
||||
{
|
||||
notice.setCreateBy(ShiroUtils.getLoginName());
|
||||
notice.setCreateBy(getLoginName());
|
||||
return toAjax(noticeService.insertNotice(notice));
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +93,7 @@ public class SysNoticeController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult editSave(SysNotice notice)
|
||||
{
|
||||
notice.setUpdateBy(ShiroUtils.getLoginName());
|
||||
notice.setUpdateBy(getLoginName());
|
||||
return toAjax(noticeService.updateNotice(notice));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ 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.ShiroUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
import com.ruoyi.system.service.ISysPostService;
|
||||
|
|
@ -106,7 +105,7 @@ public class SysPostController extends BaseController
|
|||
{
|
||||
return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
||||
}
|
||||
post.setCreateBy(ShiroUtils.getLoginName());
|
||||
post.setCreateBy(getLoginName());
|
||||
return toAjax(postService.insertPost(post));
|
||||
}
|
||||
|
||||
|
|
@ -137,7 +136,7 @@ public class SysPostController extends BaseController
|
|||
{
|
||||
return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
|
||||
}
|
||||
post.setUpdateBy(ShiroUtils.getLoginName());
|
||||
post.setUpdateBy(getLoginName());
|
||||
return toAjax(postService.updatePost(post));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public class SysProfileController extends BaseController
|
|||
@GetMapping()
|
||||
public String profile(ModelMap mmap)
|
||||
{
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
SysUser user = getSysUser();
|
||||
mmap.put("user", user);
|
||||
mmap.put("roleGroup", userService.selectUserRoleGroup(user.getUserId()));
|
||||
mmap.put("postGroup", userService.selectUserPostGroup(user.getUserId()));
|
||||
|
|
@ -61,7 +61,7 @@ public class SysProfileController extends BaseController
|
|||
@ResponseBody
|
||||
public boolean checkPassword(String password)
|
||||
{
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
SysUser user = getSysUser();
|
||||
if (passwordService.matches(user, password))
|
||||
{
|
||||
return true;
|
||||
|
|
@ -72,7 +72,7 @@ public class SysProfileController extends BaseController
|
|||
@GetMapping("/resetPwd")
|
||||
public String resetPwd(ModelMap mmap)
|
||||
{
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
SysUser user = getSysUser();
|
||||
mmap.put("user", userService.selectUserById(user.getUserId()));
|
||||
return prefix + "/resetPwd";
|
||||
}
|
||||
|
|
@ -82,7 +82,7 @@ public class SysProfileController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult resetPwd(String oldPassword, String newPassword)
|
||||
{
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
SysUser user = getSysUser();
|
||||
if (!passwordService.matches(user, oldPassword))
|
||||
{
|
||||
return error("修改密码失败,旧密码错误");
|
||||
|
|
@ -96,7 +96,7 @@ public class SysProfileController extends BaseController
|
|||
user.setPwdUpdateDate(DateUtils.getNowDate());
|
||||
if (userService.resetUserPwd(user) > 0)
|
||||
{
|
||||
ShiroUtils.setSysUser(userService.selectUserById(user.getUserId()));
|
||||
setSysUser(userService.selectUserById(user.getUserId()));
|
||||
return success();
|
||||
}
|
||||
return error("修改密码异常,请联系管理员");
|
||||
|
|
@ -108,7 +108,7 @@ public class SysProfileController extends BaseController
|
|||
@GetMapping("/edit")
|
||||
public String edit(ModelMap mmap)
|
||||
{
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
SysUser user = getSysUser();
|
||||
mmap.put("user", userService.selectUserById(user.getUserId()));
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
|
@ -119,7 +119,7 @@ public class SysProfileController extends BaseController
|
|||
@GetMapping("/avatar")
|
||||
public String avatar(ModelMap mmap)
|
||||
{
|
||||
SysUser user = ShiroUtils.getSysUser();
|
||||
SysUser user = getSysUser();
|
||||
mmap.put("user", userService.selectUserById(user.getUserId()));
|
||||
return prefix + "/avatar";
|
||||
}
|
||||
|
|
@ -132,7 +132,7 @@ public class SysProfileController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult update(SysUser user)
|
||||
{
|
||||
SysUser currentUser = ShiroUtils.getSysUser();
|
||||
SysUser currentUser = getSysUser();
|
||||
currentUser.setUserName(user.getUserName());
|
||||
currentUser.setEmail(user.getEmail());
|
||||
currentUser.setPhonenumber(user.getPhonenumber());
|
||||
|
|
@ -149,7 +149,7 @@ public class SysProfileController extends BaseController
|
|||
}
|
||||
if (userService.updateUserInfo(currentUser) > 0)
|
||||
{
|
||||
ShiroUtils.setSysUser(userService.selectUserById(currentUser.getUserId()));
|
||||
setSysUser(userService.selectUserById(currentUser.getUserId()));
|
||||
return success();
|
||||
}
|
||||
return error();
|
||||
|
|
@ -163,7 +163,7 @@ public class SysProfileController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult updateAvatar(@RequestParam("avatarfile") MultipartFile file)
|
||||
{
|
||||
SysUser currentUser = ShiroUtils.getSysUser();
|
||||
SysUser currentUser = getSysUser();
|
||||
try
|
||||
{
|
||||
if (!file.isEmpty())
|
||||
|
|
@ -172,7 +172,7 @@ public class SysProfileController extends BaseController
|
|||
currentUser.setAvatar(avatar);
|
||||
if (userService.updateUserInfo(currentUser) > 0)
|
||||
{
|
||||
ShiroUtils.setSysUser(userService.selectUserById(currentUser.getUserId()));
|
||||
setSysUser(userService.selectUserById(currentUser.getUserId()));
|
||||
return success();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import com.ruoyi.common.core.domain.entity.SysRole;
|
|||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.framework.shiro.util.AuthorizationUtils;
|
||||
import com.ruoyi.system.domain.SysUserRole;
|
||||
|
|
@ -97,7 +96,7 @@ public class SysRoleController extends BaseController
|
|||
{
|
||||
return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||
}
|
||||
role.setCreateBy(ShiroUtils.getLoginName());
|
||||
role.setCreateBy(getLoginName());
|
||||
AuthorizationUtils.clearAllCachedAuthorizationInfo();
|
||||
return toAjax(roleService.insertRole(role));
|
||||
|
||||
|
|
@ -131,7 +130,7 @@ public class SysRoleController extends BaseController
|
|||
{
|
||||
return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
|
||||
}
|
||||
role.setUpdateBy(ShiroUtils.getLoginName());
|
||||
role.setUpdateBy(getLoginName());
|
||||
AuthorizationUtils.clearAllCachedAuthorizationInfo();
|
||||
return toAjax(roleService.updateRole(role));
|
||||
}
|
||||
|
|
@ -156,10 +155,10 @@ public class SysRoleController extends BaseController
|
|||
public AjaxResult authDataScopeSave(SysRole role)
|
||||
{
|
||||
roleService.checkRoleAllowed(role);
|
||||
role.setUpdateBy(ShiroUtils.getLoginName());
|
||||
role.setUpdateBy(getLoginName());
|
||||
if (roleService.authDataScope(role) > 0)
|
||||
{
|
||||
ShiroUtils.setSysUser(userService.selectUserById(ShiroUtils.getSysUser().getUserId()));
|
||||
setSysUser(userService.selectUserById(getUserId()));
|
||||
return success();
|
||||
}
|
||||
return error();
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ruoyi.web.controller.system;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
|
@ -22,6 +23,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
|||
import com.ruoyi.common.core.domain.entity.SysRole;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
|
@ -93,8 +95,7 @@ public class SysUserController extends BaseController
|
|||
{
|
||||
ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
|
||||
List<SysUser> userList = util.importExcel(file.getInputStream());
|
||||
String operName = ShiroUtils.getSysUser().getLoginName();
|
||||
String message = userService.importUser(userList, updateSupport, operName);
|
||||
String message = userService.importUser(userList, updateSupport, getLoginName());
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
|
||||
|
|
@ -143,7 +144,7 @@ public class SysUserController extends BaseController
|
|||
}
|
||||
user.setSalt(ShiroUtils.randomSalt());
|
||||
user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
|
||||
user.setCreateBy(ShiroUtils.getLoginName());
|
||||
user.setCreateBy(getLoginName());
|
||||
return toAjax(userService.insertUser(user));
|
||||
}
|
||||
|
||||
|
|
@ -180,7 +181,7 @@ public class SysUserController extends BaseController
|
|||
{
|
||||
return error("修改用户'" + user.getLoginName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
user.setUpdateBy(ShiroUtils.getLoginName());
|
||||
user.setUpdateBy(getLoginName());
|
||||
return toAjax(userService.updateUser(user));
|
||||
}
|
||||
|
||||
|
|
@ -205,7 +206,7 @@ public class SysUserController extends BaseController
|
|||
{
|
||||
if (ShiroUtils.getUserId().longValue() == user.getUserId().longValue())
|
||||
{
|
||||
ShiroUtils.setSysUser(userService.selectUserById(user.getUserId()));
|
||||
setSysUser(userService.selectUserById(user.getUserId()));
|
||||
}
|
||||
return success();
|
||||
}
|
||||
|
|
@ -245,6 +246,10 @@ public class SysUserController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
if (ArrayUtils.contains(Convert.toLongArray(ids), getUserId()))
|
||||
{
|
||||
return error("当前用户不能删除");
|
||||
}
|
||||
return toAjax(userService.deleteUserByIds(ids));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -126,6 +126,9 @@ shiro:
|
|||
maxSession: -1
|
||||
# 踢出之前登录的/之后登录的用户,默认踢出之前登录的用户
|
||||
kickoutAfter: false
|
||||
rememberMe:
|
||||
# 是否开启记住我
|
||||
enabled: true
|
||||
|
||||
# 防止XSS攻击
|
||||
xss:
|
||||
|
|
|
|||
|
|
@ -1,16 +1,18 @@
|
|||
/*!
|
||||
* bootstrap-fileinput v5.1.3
|
||||
* bootstrap-fileinput v5.2.3
|
||||
* http://plugins.krajee.com/file-input
|
||||
*
|
||||
* Krajee default styling for bootstrap-fileinput.
|
||||
*
|
||||
* Author: Kartik Visweswaran
|
||||
* Copyright: 2014 - 2020, Kartik Visweswaran, Krajee.com
|
||||
* Copyright: 2014 - 2021, Kartik Visweswaran, Krajee.com
|
||||
*
|
||||
* Licensed under the BSD-3-Clause
|
||||
* https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
|
||||
*/
|
||||
.file-loading input[type=file], input[type=file].file-loading {
|
||||
|
||||
.file-loading input[type=file],
|
||||
input[type=file].file-loading {
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
|
|
@ -29,11 +31,31 @@
|
|||
box-shadow: none;
|
||||
}
|
||||
|
||||
.kv-hidden, .file-caption-icon, .file-zoom-dialog .modal-header:before, .file-zoom-dialog .modal-header:after, .file-input-new .file-preview, .file-input-new .close, .file-input-new .glyphicon-file, .file-input-new .fileinput-remove-button, .file-input-new .fileinput-upload-button, .file-input-new .no-browse .input-group-btn, .file-input-ajax-new .fileinput-remove-button, .file-input-ajax-new .fileinput-upload-button, .file-input-ajax-new .no-browse .input-group-btn, .hide-content .kv-file-content, .is-locked .fileinput-upload-button, .is-locked .fileinput-remove-button {
|
||||
.kv-hidden,
|
||||
.file-caption-icon,
|
||||
.file-zoom-dialog .modal-header:before,
|
||||
.file-zoom-dialog .modal-header:after,
|
||||
.file-input-new .file-preview,
|
||||
.file-input-new .close,
|
||||
.file-input-new .glyphicon-file,
|
||||
.file-input-new .fileinput-remove-button,
|
||||
.file-input-new .fileinput-upload-button,
|
||||
.file-input-new .no-browse .input-group-btn,
|
||||
.file-input-ajax-new .fileinput-remove-button,
|
||||
.file-input-ajax-new .fileinput-upload-button,
|
||||
.file-input-ajax-new .no-browse .input-group-btn,
|
||||
.hide-content .kv-file-content,
|
||||
.is-locked .fileinput-upload-button,
|
||||
.is-locked .fileinput-remove-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.btn-file input[type=file], .file-caption-icon, .file-preview .fileinput-remove, .krajee-default .file-thumb-progress, .file-zoom-dialog .btn-navigate, .file-zoom-dialog .floating-buttons {
|
||||
.btn-file input[type=file],
|
||||
.file-caption-icon,
|
||||
.file-preview .fileinput-remove,
|
||||
.krajee-default .file-thumb-progress,
|
||||
.file-zoom-dialog .btn-navigate,
|
||||
.file-zoom-dialog .floating-buttons {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
|
|
@ -41,35 +63,50 @@
|
|||
line-height: inherit;
|
||||
}
|
||||
|
||||
.file-input, .file-loading:before, .btn-file, .file-caption, .file-preview, .krajee-default.file-preview-frame, .krajee-default .file-thumbnail-footer, .file-zoom-dialog .modal-dialog {
|
||||
.file-input,
|
||||
.file-loading:before,
|
||||
.btn-file,
|
||||
.file-caption,
|
||||
.file-preview,
|
||||
.krajee-default.file-preview-frame,
|
||||
.krajee-default .file-thumbnail-footer,
|
||||
.file-zoom-dialog .modal-dialog {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.file-error-message pre, .file-error-message ul, .krajee-default .file-actions, .krajee-default .file-other-error {
|
||||
.file-error-message pre,
|
||||
.file-error-message ul,
|
||||
.krajee-default .file-actions,
|
||||
.krajee-default .file-other-error {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.file-error-message pre, .file-error-message ul {
|
||||
.file-error-message pre,
|
||||
.file-error-message ul {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.krajee-default .file-drag-handle, .krajee-default .file-upload-indicator {
|
||||
.krajee-default .file-drag-handle,
|
||||
.krajee-default .file-upload-indicator {
|
||||
float: left;
|
||||
margin-top: 10px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.file-thumb-progress .progress, .file-thumb-progress .progress-bar {
|
||||
.file-thumb-progress .progress,
|
||||
.file-thumb-progress .progress-bar {
|
||||
font-family: Verdana, Helvetica, sans-serif;
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
|
||||
.krajee-default .file-thumb-progress .progress, .kv-upload-progress .progress {
|
||||
.krajee-default .file-thumb-progress .progress,
|
||||
.kv-upload-progress .progress {
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
.krajee-default .file-caption-info, .krajee-default .file-size-info {
|
||||
.krajee-default .file-caption-info,
|
||||
.krajee-default .file-size-info {
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
|
|
@ -79,17 +116,23 @@
|
|||
margin: auto;
|
||||
}
|
||||
|
||||
.file-zoom-content > .file-object.type-video, .file-zoom-content > .file-object.type-flash, .file-zoom-content > .file-object.type-image {
|
||||
.file-zoom-content > .file-object.type-video,
|
||||
.file-zoom-content > .file-object.type-flash,
|
||||
.file-zoom-content > .file-object.type-image {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.file-zoom-content > .file-object.type-video, .file-zoom-content > .file-object.type-flash {
|
||||
.file-zoom-content > .file-object.type-video,
|
||||
.file-zoom-content > .file-object.type-flash {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.file-zoom-content > .file-object.type-pdf, .file-zoom-content > .file-object.type-html, .file-zoom-content > .file-object.type-text, .file-zoom-content > .file-object.type-default {
|
||||
.file-zoom-content > .file-object.type-pdf,
|
||||
.file-zoom-content > .file-object.type-html,
|
||||
.file-zoom-content > .file-object.type-text,
|
||||
.file-zoom-content > .file-object.type-default {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
|
@ -131,26 +174,44 @@
|
|||
height: 100%;
|
||||
}
|
||||
|
||||
.file-caption .file-caption-name {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
background: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.file-caption.icon-visible .file-caption-icon {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.file-caption.icon-visible .file-caption-name {
|
||||
padding-left: 15px;
|
||||
padding-left: 1.875rem;
|
||||
}
|
||||
|
||||
.file-caption.icon-visible > .input-group-lg .file-caption-name {
|
||||
padding-left: 2.1rem;
|
||||
}
|
||||
|
||||
.file-caption.icon-visible > .input-group-sm .file-caption-name {
|
||||
padding-left: 1.5rem;
|
||||
}
|
||||
|
||||
.file-caption-name:not(.file-caption-disabled) {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.file-caption-name.file-processing {
|
||||
font-style: italic;
|
||||
border-color: #bbb;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.file-caption-icon {
|
||||
left: 8px;
|
||||
padding: 0.5rem;
|
||||
left: 4px;
|
||||
}
|
||||
|
||||
.input-group-lg .file-caption-icon {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.input-group-sm .file-caption-icon {
|
||||
font-size: 0.875rem;
|
||||
padding: 0.25rem;
|
||||
}
|
||||
|
||||
.file-error-message {
|
||||
|
|
@ -319,7 +380,9 @@
|
|||
font-family: Verdana, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
|
||||
/*noinspection CssOverwrittenProperties*/
|
||||
|
||||
.file-zoom-dialog .file-other-icon {
|
||||
font-size: 22em;
|
||||
font-size: 50vmin;
|
||||
|
|
@ -336,21 +399,18 @@
|
|||
}
|
||||
|
||||
.file-zoom-dialog .btn-navigate {
|
||||
margin: 0 0.1rem;
|
||||
padding: 0;
|
||||
margin: -60px 0 0;
|
||||
font-size: 60px;
|
||||
background: transparent;
|
||||
text-decoration: none;
|
||||
outline: none;
|
||||
opacity: 0.7;
|
||||
font-size: 1.2rem;
|
||||
width: 2.4rem;
|
||||
height: 2.4rem;
|
||||
top: 50%;
|
||||
color: #1c94c4;
|
||||
border-radius: 50%;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .btn-navigate:not([disabled]):hover {
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
opacity: 0.6;
|
||||
.btn-navigate * {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .floating-buttons {
|
||||
|
|
@ -358,27 +418,59 @@
|
|||
right: 10px;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .btn-navigate[disabled] {
|
||||
opacity: 0.3;
|
||||
.file-zoom-dialog .btn-kv-prev {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .btn-prev {
|
||||
left: 1px;
|
||||
.file-zoom-dialog .btn-kv-next {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .btn-next {
|
||||
right: 1px;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-zoom-title {
|
||||
font-weight: 300;
|
||||
color: #999;
|
||||
.file-zoom-dialog .kv-zoom-caption {
|
||||
max-width: 50%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-zoom-header {
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-zoom-body {
|
||||
padding: 0.25rem 0.5rem 0.25rem 0;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-zoom-description {
|
||||
position: absolute;
|
||||
opacity: 0.8;
|
||||
font-size: 0.8rem;
|
||||
background-color: #1a1a1a;
|
||||
padding: 1rem;
|
||||
text-align: center;
|
||||
border-radius: 0.5rem;
|
||||
color: #fff;
|
||||
left: 15%;
|
||||
right: 15%;
|
||||
bottom: 15%;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-desc-hide {
|
||||
float: right;
|
||||
color: #fff;
|
||||
padding: 0 0.1rem;
|
||||
background: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-desc-hide:hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.file-zoom-dialog .kv-desc-hide:focus {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.file-input-new .no-browse .form-control {
|
||||
border-top-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
|
|
@ -389,8 +481,9 @@
|
|||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
.file-caption-main {
|
||||
.file-caption {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.file-thumb-loading {
|
||||
|
|
@ -448,7 +541,7 @@
|
|||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.file-zoom-fullscreen .modal-body {
|
||||
.file-zoom-fullscreen .kv-zoom-body {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
|
|
@ -467,9 +560,23 @@
|
|||
|
||||
.file-zoom-content {
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.file-zoom-content:hover {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.file-zoom-content > * {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.file-zoom-content .kv-spacer {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.file-zoom-content .file-preview-image {
|
||||
max-height: 100%;
|
||||
}
|
||||
|
|
@ -544,7 +651,8 @@
|
|||
opacity: 1;
|
||||
}
|
||||
|
||||
.file-grabbing, .file-grabbing * {
|
||||
.file-grabbing,
|
||||
.file-grabbing * {
|
||||
cursor: not-allowed !important;
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,149 @@
|
|||
@font-face {
|
||||
font-family:ZenIcon;src:url(../fonts/zenicon.woff?v=2.2.0) format('woff')
|
||||
}
|
||||
|
||||
.checkbox-primary,.radio-primary {
|
||||
position: relative;
|
||||
display: block
|
||||
}
|
||||
|
||||
.checkbox-primary>input,.radio-primary>input {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 3;
|
||||
width: 100%;
|
||||
width: 20px;
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
opacity: 0
|
||||
}
|
||||
|
||||
.checkbox-primary>label,.radio-primary>label {
|
||||
padding-left: 25px;
|
||||
font-weight: 400;
|
||||
cursor: pointer
|
||||
}
|
||||
|
||||
.checkbox-primary>label:after,.checkbox-primary>label:before,.radio-primary>label:after,.radio-primary>label:before {
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
right: 0;
|
||||
left: 0;
|
||||
display: block;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
text-align: center;
|
||||
content: ' ';
|
||||
border-radius: 2px
|
||||
}
|
||||
|
||||
.checkbox-primary>label:after,.radio-primary>label:after {
|
||||
z-index: 1;
|
||||
border: 1px solid gray;
|
||||
-webkit-transition: .4s cubic-bezier(.175,.885,.32,1);
|
||||
-o-transition: .4s cubic-bezier(.175,.885,.32,1);
|
||||
transition: .4s cubic-bezier(.175,.885,.32,1);
|
||||
-webkit-transition-property: border,background-color;
|
||||
-o-transition-property: border,background-color;
|
||||
transition-property: border,background-color
|
||||
}
|
||||
|
||||
.checkbox-primary>label:before,.radio-primary>label:before {
|
||||
top: 3px;
|
||||
z-index: 2;
|
||||
font-family: ZenIcon;
|
||||
font-size: 14px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-variant: normal;
|
||||
line-height: 1;
|
||||
text-transform: none;
|
||||
content: '\e60d';
|
||||
opacity: 0;
|
||||
-webkit-transition: .2s cubic-bezier(.175,.885,.32,1);
|
||||
-o-transition: .2s cubic-bezier(.175,.885,.32,1);
|
||||
transition: .2s cubic-bezier(.175,.885,.32,1);
|
||||
-webkit-transition-property: opacity,-webkit-transform;
|
||||
-o-transition-property: opacity,-o-transform;
|
||||
transition-property: opacity,-webkit-transform;
|
||||
transition-property: opacity,transform;
|
||||
transition-property: opacity,transform,-webkit-transform,-o-transform;
|
||||
-webkit-transform: scale(0);
|
||||
-ms-transform: scale(0);
|
||||
-o-transform: scale(0);
|
||||
transform: scale(0);
|
||||
speak: none;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale
|
||||
}
|
||||
|
||||
.checkbox-primary.checked>label:after,.checkbox-primary>input:checked+label:after,.radio-primary.checked>label:after,.radio-primary>input:checked+label:after {
|
||||
background-color: #3280fc;
|
||||
border-color: #3280fc;
|
||||
border-width: 4px
|
||||
}
|
||||
|
||||
.checkbox-primary.checked>label:before,.checkbox-primary>input:checked+label:before,.radio-primary.checked>label:before,.radio-primary>input:checked+label:before {
|
||||
color: #fff;
|
||||
opacity: 1;
|
||||
-webkit-transform: scale(1);
|
||||
-ms-transform: scale(1);
|
||||
-o-transform: scale(1);
|
||||
transform: scale(1)
|
||||
}
|
||||
|
||||
.checkbox-primary.focus>label:after,.checkbox-primary>input:focus+label:after,.radio-primary.focus>label:after,.radio-primary>input:focus+label:after {
|
||||
border-color: #3280fc;
|
||||
-webkit-box-shadow: 0 0 8px #3280fc;
|
||||
box-shadow: 0 0 8px #3280fc
|
||||
}
|
||||
|
||||
.checkbox-primary input:disabled+label:after,.checkbox-primary.disabled>label:after,.radio-primary input:disabled+label:after,.radio-primary.disabled>label:after {
|
||||
background-color: #e5e5e5;
|
||||
border-color: #bbb
|
||||
}
|
||||
|
||||
.checkbox-primary input:disabled:checked+label:after,.checkbox-primary.checked.disabled>label:after,.radio-primary input:disabled:checked+label:after,.radio-primary.checked.disabled>label:after {
|
||||
background-color: #bbb
|
||||
}
|
||||
|
||||
.radio-primary>label:after {
|
||||
border-radius: 50%
|
||||
}
|
||||
|
||||
.radio-primary>label:before {
|
||||
top: 7px;
|
||||
left: 5px;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
content: ' ';
|
||||
border: 0;
|
||||
border-radius: 50%
|
||||
}
|
||||
|
||||
.radio-primary.checked>label:after,.radio-primary>input:checked+label:after {
|
||||
background-color: transparent;
|
||||
border-color: #3280fc;
|
||||
border-width: 2px
|
||||
}
|
||||
|
||||
.radio-primary.checked>label:before,.radio-primary>input:checked+label:before {
|
||||
background-color: #3280fc
|
||||
}
|
||||
|
||||
.radio-primary input:disabled:checked+label:after,.radio-primary.checked.disabled>label:after {
|
||||
background-color: transparent;
|
||||
border-color: #bbb
|
||||
}
|
||||
|
||||
.radio-primary input:disabled:checked+label:before,.radio-primary.checked.disabled>label:before {
|
||||
background-color: #bbb
|
||||
}
|
||||
|
||||
.tab-cron .tab-pane .tabsecondchk .checkbox-primary,.tab-qqskey .tab-pane .tabsecondchk .checkbox-primary {
|
||||
width: 50px;
|
||||
display: inline-block;
|
||||
margin-bottom: 10px
|
||||
}
|
||||
Binary file not shown.
|
|
@ -0,0 +1,926 @@
|
|||
$().ready(function () {
|
||||
$("#unrunBtn").click(function () {
|
||||
var str = $("#cron").val();
|
||||
var str_arr = str.split(" ");
|
||||
try {
|
||||
$("#v_second").val(str_arr[0])
|
||||
$("#v_min").val(str_arr[1])
|
||||
$("#v_hour").val(str_arr[2])
|
||||
$("#v_day").val(str_arr[3])
|
||||
$("#v_month").val(str_arr[4])
|
||||
$("#v_week").val(str_arr[5])
|
||||
$("#v_year").val(str_arr[6])
|
||||
} catch (e) {
|
||||
}
|
||||
});
|
||||
//second
|
||||
$("#sec_all").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
$("#v_second").val("*");
|
||||
gen_cron();
|
||||
}
|
||||
});
|
||||
$("#sec_circle").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
change_sec_circle();
|
||||
}
|
||||
});
|
||||
$("#sec_circle1").change(function () {
|
||||
if ($("#sec_circle").prop('checked')) {
|
||||
change_sec_circle();
|
||||
}
|
||||
});
|
||||
$("#sec_circle2").change(function () {
|
||||
if ($("#sec_circle").prop('checked')) {
|
||||
change_sec_circle();
|
||||
}
|
||||
});
|
||||
$("#sec_per").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
change_sec_per();
|
||||
}
|
||||
});
|
||||
$("#sec_per1").change(function () {
|
||||
if ($("#sec_per").prop('checked')) {
|
||||
change_sec_per();
|
||||
}
|
||||
});
|
||||
$("#sec_per2").change(function () {
|
||||
if ($("#sec_per").prop('checked')) {
|
||||
change_sec_per();
|
||||
}
|
||||
});
|
||||
$("#sec_assign").click(function () {
|
||||
if ($("#sec_assign").prop('checked')) {
|
||||
change_sec_assign();
|
||||
}
|
||||
});
|
||||
$("input[name='zd_second']").click(function () {
|
||||
if ($("#sec_assign").prop('checked')) {
|
||||
change_sec_assign();
|
||||
}
|
||||
});
|
||||
|
||||
//minute
|
||||
$("#min_all").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
$("#v_min").val("*");
|
||||
gen_cron();
|
||||
}
|
||||
});
|
||||
$("#min_circle").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
change_min_circle();
|
||||
}
|
||||
});
|
||||
$("#min_circle1").change(function () {
|
||||
if ($("#min_circle").prop('checked')) {
|
||||
change_min_circle();
|
||||
}
|
||||
});
|
||||
$("#min_circle2").change(function () {
|
||||
if ($("#min_circle").prop('checked')) {
|
||||
change_min_circle();
|
||||
}
|
||||
});
|
||||
$("#min_per").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
change_min_per();
|
||||
}
|
||||
});
|
||||
$("#min_per1").change(function () {
|
||||
if ($("#min_per").prop('checked')) {
|
||||
change_min_per();
|
||||
}
|
||||
});
|
||||
$("#min_per2").change(function () {
|
||||
if ($("#min_per").prop('checked')) {
|
||||
change_min_per();
|
||||
}
|
||||
});
|
||||
$("#min_assign").click(function () {
|
||||
if ($("#min_assign").prop('checked')) {
|
||||
change_min_assign();
|
||||
}
|
||||
});
|
||||
$("input[name='zd_minute']").click(function () {
|
||||
if ($("#min_assign").prop('checked')) {
|
||||
change_min_assign();
|
||||
}
|
||||
});
|
||||
|
||||
//hour
|
||||
$("#hour_all").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
$("#v_hour").val("*");
|
||||
gen_cron();
|
||||
}
|
||||
});
|
||||
$("#hour_circle").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
change_hour_circle();
|
||||
}
|
||||
});
|
||||
$("#hour_circle1").change(function () {
|
||||
if ($("#hour_circle").prop('checked')) {
|
||||
change_hour_circle();
|
||||
}
|
||||
});
|
||||
$("#hour_circle2").change(function () {
|
||||
if ($("#hour_circle").prop('checked')) {
|
||||
change_hour_circle();
|
||||
}
|
||||
});
|
||||
$("#hour_per").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
change_hour_per();
|
||||
}
|
||||
});
|
||||
$("#hour_per1").change(function () {
|
||||
if ($("#hour_per").prop('checked')) {
|
||||
change_hour_per();
|
||||
}
|
||||
});
|
||||
$("#hour_per2").change(function () {
|
||||
if ($("#hour_per").prop('checked')) {
|
||||
change_hour_per();
|
||||
}
|
||||
});
|
||||
$("#hour_assign").click(function () {
|
||||
if ($("#hour_assign").prop('checked')) {
|
||||
change_hour_assign();
|
||||
}
|
||||
});
|
||||
$("input[name='zd_hour']").click(function () {
|
||||
if ($("#hour_assign").prop('checked')) {
|
||||
change_hour_assign();
|
||||
}
|
||||
});
|
||||
|
||||
//day
|
||||
$("#day_all").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
$("#v_day").val("*");
|
||||
gen_cron();
|
||||
}
|
||||
});
|
||||
$("#day_no").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
$("#v_day").val("?");
|
||||
gen_cron();
|
||||
}
|
||||
});
|
||||
$("#day_last").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
$("#v_day").val("L");
|
||||
gen_cron();
|
||||
}
|
||||
});
|
||||
$("#day_circle").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
change_day_circle();
|
||||
}
|
||||
});
|
||||
$("#day_circle1").change(function () {
|
||||
if ($("#day_circle").prop('checked')) {
|
||||
change_day_circle();
|
||||
}
|
||||
});
|
||||
$("#day_circle2").change(function () {
|
||||
if ($("#day_circle").prop('checked')) {
|
||||
change_day_circle();
|
||||
}
|
||||
});
|
||||
$("#day_per").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
change_day_per();
|
||||
}
|
||||
});
|
||||
$("#day_per1").change(function () {
|
||||
if ($("#day_per").prop('checked')) {
|
||||
change_day_per();
|
||||
}
|
||||
});
|
||||
$("#day_per2").change(function () {
|
||||
if ($("#day_per").prop('checked')) {
|
||||
change_day_per();
|
||||
}
|
||||
});
|
||||
$("#day_work").click(function () {
|
||||
if ($("#day_work").prop('checked')) {
|
||||
change_day_work();
|
||||
}
|
||||
});
|
||||
$("#day_work1").change(function () {
|
||||
if ($("#day_work").prop('checked')) {
|
||||
change_day_work();
|
||||
}
|
||||
});
|
||||
$("#day_assign").click(function () {
|
||||
if ($("#day_assign").prop('checked')) {
|
||||
change_day_assign();
|
||||
}
|
||||
});
|
||||
$("input[name='zd_day']").click(function () {
|
||||
if ($("#day_assign").prop('checked')) {
|
||||
change_day_assign();
|
||||
}
|
||||
});
|
||||
|
||||
//month
|
||||
$("#month_all").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
$("#v_month").val("*");
|
||||
gen_cron();
|
||||
}
|
||||
});
|
||||
$("#month_no").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
$("#v_month").val("?");
|
||||
gen_cron();
|
||||
}
|
||||
});
|
||||
$("#month_last").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
$("#v_month").val("L");
|
||||
gen_cron();
|
||||
}
|
||||
});
|
||||
$("#month_circle").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
change_month_circle();
|
||||
}
|
||||
});
|
||||
$("#month_circle1").change(function () {
|
||||
if ($("#month_circle").prop('checked')) {
|
||||
change_month_circle();
|
||||
}
|
||||
});
|
||||
$("#month_circle2").change(function () {
|
||||
if ($("#month_circle").prop('checked')) {
|
||||
change_month_circle();
|
||||
}
|
||||
});
|
||||
$("#month_per").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
change_month_per();
|
||||
}
|
||||
});
|
||||
$("#month_per1").change(function () {
|
||||
if ($("#month_per").prop('checked')) {
|
||||
change_month_per();
|
||||
}
|
||||
});
|
||||
$("#month_per2").change(function () {
|
||||
if ($("#month_per").prop('checked')) {
|
||||
change_month_per();
|
||||
}
|
||||
});
|
||||
$("#month_assign").click(function () {
|
||||
if ($("#month_assign").prop('checked')) {
|
||||
change_month_assign();
|
||||
}
|
||||
});
|
||||
$("input[name='zd_month']").click(function () {
|
||||
if ($("#month_assign").prop('checked')) {
|
||||
change_month_assign();
|
||||
}
|
||||
});
|
||||
|
||||
//week
|
||||
$("#week_all").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
$("#v_week").val("*");
|
||||
gen_cron();
|
||||
}
|
||||
});
|
||||
$("#week_no").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
$("#v_week").val("?");
|
||||
gen_cron();
|
||||
}
|
||||
});
|
||||
$("#week_circle").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
change_week_circle();
|
||||
}
|
||||
});
|
||||
$("#week_circle1").change(function () {
|
||||
if ($("#week_circle").prop('checked')) {
|
||||
change_week_circle();
|
||||
}
|
||||
});
|
||||
$("#week_circle2").change(function () {
|
||||
if ($("#week_circle").prop('checked')) {
|
||||
change_week_circle();
|
||||
}
|
||||
});
|
||||
$("#week_last").click(function () {
|
||||
if ($("#week_last").prop('checked')) {
|
||||
change_week_last();
|
||||
}
|
||||
});
|
||||
$("#week_last1").change(function () {
|
||||
if ($("#week_last").prop('checked')) {
|
||||
change_week_last();
|
||||
}
|
||||
});
|
||||
$("#week_num").click(function () {
|
||||
if ($("#week_num").prop('checked')) {
|
||||
change_week_num();
|
||||
}
|
||||
});
|
||||
$("#week_num1").change(function () {
|
||||
if ($("#week_num").prop('checked')) {
|
||||
change_week_num();
|
||||
}
|
||||
});
|
||||
$("#week_num2").change(function () {
|
||||
if ($("#week_num").prop('checked')) {
|
||||
change_week_num();
|
||||
}
|
||||
});
|
||||
$("#week_assign").click(function () {
|
||||
if ($("#week_assign").prop('checked')) {
|
||||
change_week_assign();
|
||||
}
|
||||
});
|
||||
$("input[name='zd_week']").click(function () {
|
||||
if ($("#week_assign").prop('checked')) {
|
||||
change_week_assign();
|
||||
}
|
||||
});
|
||||
|
||||
//year
|
||||
$("#year_all").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
$("#v_year").val("*");
|
||||
gen_cron();
|
||||
}
|
||||
});
|
||||
$("#year_no").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
$("#v_year").val("");
|
||||
gen_cron();
|
||||
}
|
||||
});
|
||||
$("#year_circle").click(function () {
|
||||
if ($(this).prop('checked')) {
|
||||
change_year_circle();
|
||||
}
|
||||
});
|
||||
$("#year_circle1").change(function () {
|
||||
if ($("#year_circle").prop('checked')) {
|
||||
change_year_circle();
|
||||
}
|
||||
});
|
||||
$("#year_circle2").change(function () {
|
||||
if ($("#year_circle").prop('checked')) {
|
||||
change_year_circle();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function change_sec_assign() {
|
||||
var sec_array = new Array();
|
||||
$("input[name='zd_second']:checked").each(function () {
|
||||
sec_array[sec_array.length] = $(this).val();
|
||||
});
|
||||
sec_array = sec_array.join(",");
|
||||
if (sec_array == null || sec_array == '') {
|
||||
$("#v_second").val("*");
|
||||
} else {
|
||||
$("#v_second").val(sec_array);
|
||||
}
|
||||
gen_cron();
|
||||
}
|
||||
|
||||
function change_sec_circle() {
|
||||
var v1 = $("#sec_circle1").val();
|
||||
var v2 = $("#sec_circle2").val();
|
||||
if (v1 == null || v1 == '' || v2 == null || v2 == '') {
|
||||
return;
|
||||
}
|
||||
if (v1 < 1) {
|
||||
v1 = 1;
|
||||
$("#sec_circle1").val(v1);
|
||||
}
|
||||
if (v2 < 2) {
|
||||
v2 = 2;
|
||||
$("#sec_circle2").val(v2);
|
||||
}
|
||||
if (v2 > 59) {
|
||||
v2 = 59;
|
||||
$("#sec_circle2").val(v2);
|
||||
}
|
||||
if (v1 > 59) {
|
||||
v1 = 59;
|
||||
$("#sec_circle1").val(v1);
|
||||
}
|
||||
if (v1 >= v2) {
|
||||
v1 = v2 - 1;
|
||||
$("#sec_circle1").val(v1);
|
||||
}
|
||||
if (v1 > 60 || v2 > 60) {
|
||||
return;
|
||||
}
|
||||
if (v1 > v2) {
|
||||
return;
|
||||
}
|
||||
$("#v_second").val(v1 + "-" + v2);
|
||||
gen_cron();
|
||||
}
|
||||
|
||||
function change_sec_per() {
|
||||
var v1 = $("#sec_per1").val();
|
||||
var v2 = $("#sec_per2").val();
|
||||
if (v1 == null || v1 == '' || v2 == null || v2 == '') {
|
||||
return;
|
||||
}
|
||||
if (v1 < 0) {
|
||||
v1 = 0;
|
||||
$("#sec_per1").val(v1);
|
||||
}
|
||||
if (v1 > 59) {
|
||||
v1 = 59;
|
||||
$("#sec_per1").val(v1);
|
||||
}
|
||||
if (v2 < 1) {
|
||||
v2 = 1;
|
||||
$("#sec_per2").val(v2);
|
||||
}
|
||||
if (v2 > 59) {
|
||||
v2 = 59;
|
||||
$("#sec_per2").val(v2);
|
||||
}
|
||||
$("#v_second").val(v1 + "/" + v2);
|
||||
gen_cron()
|
||||
}
|
||||
|
||||
function change_min_assign() {
|
||||
var sec_array = new Array();
|
||||
$("input[name='zd_minute']:checked").each(function () {
|
||||
sec_array[sec_array.length] = $(this).val();
|
||||
});
|
||||
sec_array = sec_array.join(",");
|
||||
if (sec_array == null || sec_array == '') {
|
||||
$("#v_min").val("*");
|
||||
} else {
|
||||
$("#v_min").val(sec_array);
|
||||
}
|
||||
gen_cron();
|
||||
}
|
||||
|
||||
function change_min_circle() {
|
||||
var v1 = $("#min_circle1").val();
|
||||
var v2 = $("#min_circle2").val();
|
||||
if (v1 == null || v1 == '' || v2 == null || v2 == '') {
|
||||
return;
|
||||
}
|
||||
if (v1 < 1) {
|
||||
v1 = 1;
|
||||
$("#min_circle1").val(v1);
|
||||
}
|
||||
if (v2 < 2) {
|
||||
v2 = 2;
|
||||
$("#min_circle2").val(v2);
|
||||
}
|
||||
if (v2 > 59) {
|
||||
v2 = 59;
|
||||
$("#min_circle2").val(v2);
|
||||
}
|
||||
if (v1 > 59) {
|
||||
v1 = 59;
|
||||
$("#min_circle1").val(v1);
|
||||
}
|
||||
if (v1 >= v2) {
|
||||
v1 = v2 - 1;
|
||||
$("#min_circle1").val(v1);
|
||||
}
|
||||
if (v1 > 60 || v2 > 60) {
|
||||
return;
|
||||
}
|
||||
if (v1 > v2) {
|
||||
return;
|
||||
}
|
||||
$("#v_min").val(v1 + "-" + v2);
|
||||
gen_cron();
|
||||
}
|
||||
|
||||
function change_min_per() {
|
||||
var v1 = $("#min_per1").val();
|
||||
var v2 = $("#min_per2").val();
|
||||
if (v1 == null || v1 == '' || v2 == null || v2 == '') {
|
||||
return;
|
||||
}
|
||||
if (v1 < 0) {
|
||||
v1 = 0;
|
||||
$("#min_per1").val(v1);
|
||||
}
|
||||
if (v1 > 59) {
|
||||
v1 = 59;
|
||||
$("#min_per1").val(v1);
|
||||
}
|
||||
if (v2 < 1) {
|
||||
v2 = 1;
|
||||
$("#min_per2").val(v2);
|
||||
}
|
||||
if (v2 > 59) {
|
||||
v2 = 59;
|
||||
$("#min_per2").val(v2);
|
||||
}
|
||||
|
||||
$("#v_min").val(v1 + "/" + v2);
|
||||
gen_cron()
|
||||
}
|
||||
|
||||
function change_hour_assign() {
|
||||
var sec_array = new Array();
|
||||
$("input[name='zd_hour']:checked").each(function () {
|
||||
sec_array[sec_array.length] = $(this).val();
|
||||
});
|
||||
sec_array = sec_array.join(",");
|
||||
if (sec_array == null || sec_array == '') {
|
||||
$("#v_hour").val("*");
|
||||
} else {
|
||||
$("#v_hour").val(sec_array);
|
||||
}
|
||||
gen_cron();
|
||||
}
|
||||
|
||||
function change_hour_circle() {
|
||||
var v1 = $("#hour_circle1").val();
|
||||
var v2 = $("#hour_circle2").val();
|
||||
if (v1 == null || v1 == '' || v2 == null || v2 == '') {
|
||||
return;
|
||||
}
|
||||
if (v1 < 1) {
|
||||
v1 = 1;
|
||||
$("#hour_circle1").val(v1);
|
||||
}
|
||||
if (v2 < 2) {
|
||||
v2 = 2;
|
||||
$("#hour_circle2").val(v2);
|
||||
}
|
||||
if (v2 > 23) {
|
||||
v2 = 23;
|
||||
$("#hour_circle2").val(v2);
|
||||
}
|
||||
if (v1 > 23) {
|
||||
v1 = 23;
|
||||
$("#hour_circle1").val(v1);
|
||||
}
|
||||
if (v1 >= v2) {
|
||||
v1 = v2 - 1;
|
||||
$("#hour_circle1").val(v1);
|
||||
}
|
||||
if (v1 > 23 || v2 > 23) {
|
||||
return;
|
||||
}
|
||||
if (v1 > v2) {
|
||||
return;
|
||||
}
|
||||
$("#v_hour").val(v1 + "-" + v2);
|
||||
gen_cron();
|
||||
}
|
||||
|
||||
function change_hour_per() {
|
||||
var v1 = $("#hour_per1").val();
|
||||
var v2 = $("#hour_per2").val();
|
||||
if (v1 == null || v1 == '' || v2 == null || v2 == '') {
|
||||
return;
|
||||
}
|
||||
if (v1 < 0) {
|
||||
v1 = 0;
|
||||
$("#hour_per1").val(v1);
|
||||
}
|
||||
if (v1 > 23) {
|
||||
v1 = 23;
|
||||
$("#hour_per1").val(v1);
|
||||
}
|
||||
if (v2 < 1) {
|
||||
v2 = 1;
|
||||
$("#hour_per2").val(v2);
|
||||
}
|
||||
if (v2 > 23) {
|
||||
v2 = 23;
|
||||
$("#hour_per2").val(v2);
|
||||
}
|
||||
|
||||
$("#v_hour").val(v1 + "/" + v2);
|
||||
gen_cron()
|
||||
}
|
||||
|
||||
function change_day_assign() {
|
||||
var sec_array = new Array();
|
||||
$("input[name='zd_day']:checked").each(function () {
|
||||
sec_array[sec_array.length] = $(this).val();
|
||||
});
|
||||
sec_array = sec_array.join(",");
|
||||
if (sec_array == null || sec_array == '') {
|
||||
$("#v_day").val("*");
|
||||
} else {
|
||||
$("#v_day").val(sec_array);
|
||||
}
|
||||
gen_cron();
|
||||
}
|
||||
|
||||
function change_day_circle() {
|
||||
var v1 = $("#day_circle1").val();
|
||||
var v2 = $("#day_circle2").val();
|
||||
if (v1 == null || v1 == '' || v2 == null || v2 == '') {
|
||||
return;
|
||||
}
|
||||
if (v1 < 1) {
|
||||
v1 = 1;
|
||||
$("#day_circle1").val(v1);
|
||||
}
|
||||
if (v2 < 2) {
|
||||
v2 = 2;
|
||||
$("#day_circle2").val(v2);
|
||||
}
|
||||
if (v2 > 31) {
|
||||
v2 = 31;
|
||||
$("#day_circle2").val(v2);
|
||||
}
|
||||
if (v1 > 31) {
|
||||
v1 = 31;
|
||||
$("#day_circle1").val(v1);
|
||||
}
|
||||
if (v1 >= v2) {
|
||||
v1 = v2 - 1;
|
||||
$("#day_circle1").val(v1);
|
||||
}
|
||||
if (v1 > 31 || v2 > 31) {
|
||||
return;
|
||||
}
|
||||
if (v1 > v2) {
|
||||
return;
|
||||
}
|
||||
$("#v_day").val(v1 + "-" + v2);
|
||||
gen_cron();
|
||||
}
|
||||
|
||||
function change_day_per() {
|
||||
var v1 = $("#day_per1").val();
|
||||
var v2 = $("#day_per2").val();
|
||||
if (v1 == null || v1 == '' || v2 == null || v2 == '') {
|
||||
return;
|
||||
}
|
||||
if (v1 < 1) {
|
||||
v1 = 1;
|
||||
$("#day_per1").val(v1);
|
||||
}
|
||||
if (v1 > 31) {
|
||||
v1 = 31;
|
||||
$("#day_per1").val(v1);
|
||||
}
|
||||
if (v2 < 1) {
|
||||
v2 = 1;
|
||||
$("#day_per2").val(v2);
|
||||
}
|
||||
if (v2 > 31) {
|
||||
v2 = 31;
|
||||
$("#day_per2").val(v2);
|
||||
}
|
||||
|
||||
$("#v_day").val(v1 + "/" + v2);
|
||||
gen_cron()
|
||||
}
|
||||
|
||||
function change_day_work() {
|
||||
var v1 = $("#day_work1").val();
|
||||
|
||||
if (v1 == null || v1 == '') {
|
||||
return;
|
||||
}
|
||||
if (v1 < 1) {
|
||||
v1 = 1;
|
||||
$("#day_work1").val(v1);
|
||||
}
|
||||
if (v1 > 31) {
|
||||
v1 = 31;
|
||||
$("#day_work1").val(v1);
|
||||
}
|
||||
$("#v_day").val(v1 + "W");
|
||||
gen_cron()
|
||||
}
|
||||
|
||||
function change_month_assign() {
|
||||
var sec_array = new Array();
|
||||
$("input[name='zd_month']:checked").each(function () {
|
||||
sec_array[sec_array.length] = $(this).val();
|
||||
});
|
||||
sec_array = sec_array.join(",");
|
||||
if (sec_array == null || sec_array == '') {
|
||||
$("#v_month").val("*");
|
||||
} else {
|
||||
$("#v_month").val(sec_array);
|
||||
}
|
||||
gen_cron();
|
||||
}
|
||||
|
||||
function change_month_circle() {
|
||||
var v1 = $("#month_circle1").val();
|
||||
var v2 = $("#month_circle2").val();
|
||||
if (v1 == null || v1 == '' || v2 == null || v2 == '') {
|
||||
return;
|
||||
}
|
||||
if (v1 < 1) {
|
||||
v1 = 1;
|
||||
$("#month_circle1").val(v1);
|
||||
}
|
||||
if (v2 < 2) {
|
||||
v2 = 2;
|
||||
$("#month_circle2").val(v2);
|
||||
}
|
||||
if (v2 > 12) {
|
||||
v2 = 12;
|
||||
$("#month_circle2").val(v2);
|
||||
}
|
||||
if (v1 > 12) {
|
||||
v1 = 12;
|
||||
$("#month_circle1").val(v1);
|
||||
}
|
||||
if (v1 >= v2) {
|
||||
v1 = v2 - 1;
|
||||
$("#month_circle1").val(v1);
|
||||
}
|
||||
if (v1 > 12 || v2 > 12) {
|
||||
return;
|
||||
}
|
||||
if (v1 > v2) {
|
||||
return;
|
||||
}
|
||||
$("#v_month").val(v1 + "-" + v2);
|
||||
gen_cron();
|
||||
}
|
||||
|
||||
function change_month_per() {
|
||||
var v1 = $("#month_per1").val();
|
||||
var v2 = $("#month_per2").val();
|
||||
if (v1 == null || v1 == '' || v2 == null || v2 == '') {
|
||||
return;
|
||||
}
|
||||
if (v1 < 1) {
|
||||
v1 = 1;
|
||||
$("#month_per1").val(v1);
|
||||
}
|
||||
if (v1 > 12) {
|
||||
v1 = 12;
|
||||
$("#month_per1").val(v1);
|
||||
}
|
||||
if (v2 < 1) {
|
||||
v2 = 1;
|
||||
$("#month_per2").val(v2);
|
||||
}
|
||||
if (v2 > 12) {
|
||||
v2 = 12;
|
||||
$("#month_per2").val(v2);
|
||||
}
|
||||
|
||||
$("#v_month").val(v1 + "/" + v2);
|
||||
gen_cron()
|
||||
}
|
||||
|
||||
function change_week_assign() {
|
||||
var sec_array = new Array();
|
||||
$("input[name='zd_week']:checked").each(function () {
|
||||
sec_array[sec_array.length] = $(this).val();
|
||||
});
|
||||
sec_array = sec_array.join(",");
|
||||
if (sec_array == null || sec_array == '') {
|
||||
$("#v_week").val("*");
|
||||
} else {
|
||||
$("#v_week").val(sec_array);
|
||||
}
|
||||
gen_cron();
|
||||
}
|
||||
|
||||
function change_week_circle() {
|
||||
var v1 = $("#week_circle1").val();
|
||||
var v2 = $("#week_circle2").val();
|
||||
if (v1 == null || v1 == '' || v2 == null || v2 == '') {
|
||||
return;
|
||||
}
|
||||
if (v1 < 1) {
|
||||
v1 = 1;
|
||||
$("#week_circle1").val(v1);
|
||||
}
|
||||
if (v2 < 2) {
|
||||
v2 = 2;
|
||||
$("#week_circle2").val(v2);
|
||||
}
|
||||
if (v2 > 7) {
|
||||
v2 = 7;
|
||||
$("#week_circle2").val(v2);
|
||||
}
|
||||
if (v1 > 7) {
|
||||
v1 = 7;
|
||||
$("#week_circle1").val(v1);
|
||||
}
|
||||
if (v1 >= v2) {
|
||||
v1 = v2 - 1;
|
||||
$("#week_circle1").val(v1);
|
||||
}
|
||||
if (v1 > 7 || v2 > 7) {
|
||||
return;
|
||||
}
|
||||
if (v1 > v2) {
|
||||
return;
|
||||
}
|
||||
$("#v_week").val(v1 + "-" + v2);
|
||||
gen_cron();
|
||||
}
|
||||
|
||||
function change_week_last() {
|
||||
var v1 = $("#week_last1").val();
|
||||
|
||||
if (v1 == null || v1 == '') {
|
||||
return;
|
||||
}
|
||||
if (v1 < 1) {
|
||||
v1 = 1;
|
||||
$("#week_last1").val(v1);
|
||||
}
|
||||
if (v1 > 7) {
|
||||
v1 = 7;
|
||||
$("#week_last1").val(v1);
|
||||
}
|
||||
$("#v_week").val(v1 + "L");
|
||||
gen_cron()
|
||||
}
|
||||
|
||||
function change_week_num() {
|
||||
var v1 = $("#week_num1").val();
|
||||
var v2 = $("#week_num2").val();
|
||||
if (v1 == null || v1 == '' || v2 == null || v2 == '') {
|
||||
return;
|
||||
}
|
||||
if (v1 < 1) {
|
||||
v1 = 1;
|
||||
$("#week_num1").val(v1);
|
||||
}
|
||||
if (v2 < 1) {
|
||||
v2 = 1;
|
||||
$("#week_num2").val(v2);
|
||||
}
|
||||
if (v2 > 7) {
|
||||
v2 = 7;
|
||||
$("#week_num2").val(v2);
|
||||
}
|
||||
if (v1 > 4) {
|
||||
v1 = 4;
|
||||
$("#week_num1").val(v1);
|
||||
}
|
||||
|
||||
$("#v_week").val(v1 + "#" + v2);
|
||||
gen_cron();
|
||||
}
|
||||
|
||||
function change_year_circle() {
|
||||
var v1 = $("#year_circle1").val();
|
||||
var v2 = $("#year_circle2").val();
|
||||
if (v1 == null || v1 == '' || v2 == null || v2 == '') {
|
||||
return;
|
||||
}
|
||||
if (v1 < 2000) {
|
||||
v1 = 2000;
|
||||
$("#year_circle1").val(v1);
|
||||
}
|
||||
if (v2 < 2000) {
|
||||
v2 = 2000;
|
||||
$("#year_circle2").val(v2);
|
||||
}
|
||||
if (v2 > 3000) {
|
||||
v2 = 3000;
|
||||
$("#year_circle2").val(v2);
|
||||
}
|
||||
if (v1 > 3000) {
|
||||
v1 = 3000;
|
||||
$("#year_circle1").val(v1);
|
||||
}
|
||||
if (v1 >= v2) {
|
||||
v1 = v2 - 1;
|
||||
$("#year_circle1").val(v1);
|
||||
}
|
||||
if (v1 > 3000 || v2 > 3000) {
|
||||
return;
|
||||
}
|
||||
if (v1 > v2) {
|
||||
return;
|
||||
}
|
||||
$("#v_year").val(v1 + "-" + v2);
|
||||
gen_cron();
|
||||
}
|
||||
|
||||
function gen_cron() {
|
||||
var str = $("#v_second").val() + " "
|
||||
+ $("#v_min").val() + " "
|
||||
+ $("#v_hour").val() + " "
|
||||
+ $("#v_day").val() + " "
|
||||
+ $("#v_month").val() + " "
|
||||
+ $("#v_week").val() + " "
|
||||
+ $("#v_year").val();
|
||||
$("#cron").val(str);
|
||||
}
|
||||
|
|
@ -52,6 +52,7 @@ $(function() {
|
|||
elem: '#startTime',
|
||||
max: $('#endTime').val(),
|
||||
theme: 'molv',
|
||||
type: $('#startTime').attr("data-type") || 'date',
|
||||
trigger: 'click',
|
||||
done: function(value, date) {
|
||||
// 结束时间大于开始时间
|
||||
|
|
@ -70,6 +71,7 @@ $(function() {
|
|||
elem: '#endTime',
|
||||
min: $('#startTime').val(),
|
||||
theme: 'molv',
|
||||
type: $('#endTime').attr("data-type") || 'date',
|
||||
trigger: 'click',
|
||||
done: function(value, date) {
|
||||
// 开始时间小于结束时间
|
||||
|
|
|
|||
|
|
@ -60,11 +60,8 @@
|
|||
uploadAsync: false
|
||||
}).on('filebatchuploadsuccess', function (event, data, previewId, index) {
|
||||
var rsp = data.response;
|
||||
var fileJson = rsp.data;
|
||||
for (var i in fileJson) {
|
||||
log.info("return data.url:" + fileJson[i].url)
|
||||
log.info("reutrn data.name:" + fileJson[i].name)
|
||||
}
|
||||
log.info("return urls:" + rsp.urls)
|
||||
log.info("reutrn fileNames:" + rsp.fileNames)
|
||||
}).on('fileremoved', function (event, id, index) {
|
||||
$("input[name='" + event.currentTarget.id + "']").val('')
|
||||
})
|
||||
|
|
|
|||
|
|
@ -108,10 +108,10 @@
|
|||
|
||||
<!-- fileinput文件上传插件 -->
|
||||
<div th:fragment="bootstrap-fileinput-css">
|
||||
<link th:href="@{/ajax/libs/bootstrap-fileinput/fileinput.min.css?v=20201202}" rel="stylesheet"/>
|
||||
<link th:href="@{/ajax/libs/bootstrap-fileinput/fileinput.min.css?v=202108081}" rel="stylesheet"/>
|
||||
</div>
|
||||
<div th:fragment="bootstrap-fileinput-js">
|
||||
<script th:src="@{/ajax/libs/bootstrap-fileinput/fileinput.min.js?v=20201202}"></script>
|
||||
<script th:src="@{/ajax/libs/bootstrap-fileinput/fileinput.min.js?v=202108081}"></script>
|
||||
</div>
|
||||
|
||||
<!-- duallistbox双列表框插件 -->
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<link th:href="@{/css/skins.css?v=20200902}" rel="stylesheet"/>
|
||||
<link th:href="@{/ruoyi/css/ry-ui.css?v=4.6.2}" rel="stylesheet"/>
|
||||
</head>
|
||||
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow: hidden">
|
||||
<body class="fixed-sidebar full-height-layout gray-bg" th:classappend="${isMobile} ? 'canvas-menu'" style="overflow: hidden">
|
||||
<div id="wrapper">
|
||||
|
||||
<!--左侧导航开始-->
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<link th:href="@{/css/skins.css}" rel="stylesheet"/>
|
||||
<link th:href="@{/ruoyi/css/ry-ui.css?v=4.6.2}" rel="stylesheet"/>
|
||||
</head>
|
||||
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow: hidden">
|
||||
<body class="fixed-sidebar full-height-layout gray-bg" th:classappend="${isMobile} ? 'canvas-menu'" style="overflow: hidden">
|
||||
<div id="wrapper">
|
||||
|
||||
<!--左侧导航开始-->
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Thymeleaf</li>
|
||||
<li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> Bootstrap</li>
|
||||
</ul>
|
||||
<strong th:if="${@config.getKey('sys.account.registerUser')}">还没有账号? <a th:href="@{/register}">立即注册»</a></strong>
|
||||
<strong th:if="${isAllowRegister}">还没有账号? <a th:href="@{/register}">立即注册»</a></strong>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="checkbox-custom" th:classappend="${captchaEnabled==false} ? 'm-t'">
|
||||
<div class="checkbox-custom" th:if="${isRemembered}" th:classappend="${captchaEnabled==false} ? 'm-t'">
|
||||
<input type="checkbox" id="rememberme" name="rememberme"> <label for="rememberme">记住我</label>
|
||||
</div>
|
||||
<button class="btn btn-success btn-block" id="btnSubmit" data-loading="正在验证登录,请稍后...">登录</button>
|
||||
|
|
|
|||
|
|
@ -90,6 +90,14 @@ public class RuoYiConfig
|
|||
RuoYiConfig.addressEnabled = addressEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取导入上传路径
|
||||
*/
|
||||
public static String getImportPath()
|
||||
{
|
||||
return getProfile() + "/import";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取头像上传路径
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -14,11 +14,13 @@ import com.github.pagehelper.PageHelper;
|
|||
import com.github.pagehelper.PageInfo;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.AjaxResult.Type;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.page.PageDomain;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.page.TableSupport;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ServletUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.sql.SqlUtil;
|
||||
|
||||
|
|
@ -159,6 +161,14 @@ public class BaseController
|
|||
return AjaxResult.success(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功数据
|
||||
*/
|
||||
public static AjaxResult success(Object data)
|
||||
{
|
||||
return AjaxResult.success("操作成功", data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回失败消息
|
||||
*/
|
||||
|
|
@ -182,4 +192,36 @@ public class BaseController
|
|||
{
|
||||
return StringUtils.format("redirect:{}", url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户缓存信息
|
||||
*/
|
||||
public SysUser getSysUser()
|
||||
{
|
||||
return ShiroUtils.getSysUser();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置用户缓存信息
|
||||
*/
|
||||
public void setSysUser(SysUser user)
|
||||
{
|
||||
ShiroUtils.setSysUser(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录用户id
|
||||
*/
|
||||
public Long getUserId()
|
||||
{
|
||||
return getSysUser().getUserId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录用户名
|
||||
*/
|
||||
public String getLoginName()
|
||||
{
|
||||
return getSysUser().getLoginName();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,61 +0,0 @@
|
|||
package com.ruoyi.common.core.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 文件信息
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class FileInfo
|
||||
{
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 文件地址
|
||||
*/
|
||||
private String url;
|
||||
|
||||
public FileInfo()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public FileInfo(String name, String url)
|
||||
{
|
||||
this.name = name;
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUrl()
|
||||
{
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url)
|
||||
{
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("name", getName())
|
||||
.append("url", getUrl())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -418,6 +418,22 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除最后一个字符串
|
||||
*
|
||||
* @param str 输入字符串
|
||||
* @param spit 以什么类型结尾的
|
||||
* @return 截取后的字符串
|
||||
*/
|
||||
public static String lastStringDel(String str, String spit)
|
||||
{
|
||||
if (!StringUtils.isEmpty(str) && str.endsWith(spit))
|
||||
{
|
||||
return str.subSequence(0, str.length() - 1).toString();
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将下划线大写方式命名的字符串转换为驼峰式。如果转换前的下划线大写方式命名的字符串为空,则返回空字符串。 例如:HELLO_WORLD->HelloWorld
|
||||
*
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ public class FileUploadUtils
|
|||
return fileName;
|
||||
}
|
||||
|
||||
private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
|
||||
public static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
|
||||
{
|
||||
File desc = new File(uploadDir + File.separator + fileName);
|
||||
|
||||
|
|
@ -141,7 +141,7 @@ public class FileUploadUtils
|
|||
return desc;
|
||||
}
|
||||
|
||||
private static final String getPathFileName(String uploadDir, String fileName) throws IOException
|
||||
public static final String getPathFileName(String uploadDir, String fileName) throws IOException
|
||||
{
|
||||
int dirLastIndex = RuoYiConfig.getProfile().length() + 1;
|
||||
String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.ruoyi.common.utils.file;
|
|||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
|
@ -10,8 +11,12 @@ import java.net.URLEncoder;
|
|||
import java.nio.charset.StandardCharsets;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.uuid.IdUtils;
|
||||
|
||||
/**
|
||||
* 文件处理工具类
|
||||
|
|
@ -53,29 +58,48 @@ public class FileUtils
|
|||
}
|
||||
finally
|
||||
{
|
||||
if (os != null)
|
||||
IOUtils.close(os);
|
||||
IOUtils.close(fis);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 写数据到文件中
|
||||
*
|
||||
* @param data 数据
|
||||
* @return 目标文件
|
||||
* @throws IOException IO异常
|
||||
*/
|
||||
public static String writeImportBytes(byte[] data) throws IOException
|
||||
{
|
||||
return writeBytes(data, RuoYiConfig.getImportPath());
|
||||
}
|
||||
|
||||
/**
|
||||
* 写数据到文件中
|
||||
*
|
||||
* @param data 数据
|
||||
* @param uploadDir 目标文件
|
||||
* @return 目标文件
|
||||
* @throws IOException IO异常
|
||||
*/
|
||||
public static String writeBytes(byte[] data, String uploadDir) throws IOException
|
||||
{
|
||||
FileOutputStream fos = null;
|
||||
String pathName = "";
|
||||
try
|
||||
{
|
||||
os.close();
|
||||
String extension = getFileExtendName(data);
|
||||
pathName = DateUtils.datePath() + "/" + IdUtils.fastUUID() + "." + extension;
|
||||
File file = FileUploadUtils.getAbsoluteFile(uploadDir, pathName);
|
||||
fos = new FileOutputStream(file);
|
||||
fos.write(data);
|
||||
}
|
||||
catch (IOException e1)
|
||||
finally
|
||||
{
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (fis != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
fis.close();
|
||||
}
|
||||
catch (IOException e1)
|
||||
{
|
||||
e1.printStackTrace();
|
||||
}
|
||||
}
|
||||
IOUtils.close(fos);
|
||||
}
|
||||
return FileUploadUtils.getPathFileName(uploadDir, pathName);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -200,4 +224,33 @@ public class FileUtils
|
|||
String encode = URLEncoder.encode(s, StandardCharsets.UTF_8.toString());
|
||||
return encode.replaceAll("\\+", "%20");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图像后缀
|
||||
*
|
||||
* @param photoByte 图像数据
|
||||
* @return 后缀名
|
||||
*/
|
||||
public static String getFileExtendName(byte[] photoByte)
|
||||
{
|
||||
String strFileExtendName = "jpg";
|
||||
if ((photoByte[0] == 71) && (photoByte[1] == 73) && (photoByte[2] == 70) && (photoByte[3] == 56)
|
||||
&& ((photoByte[4] == 55) || (photoByte[4] == 57)) && (photoByte[5] == 97))
|
||||
{
|
||||
strFileExtendName = "gif";
|
||||
}
|
||||
else if ((photoByte[6] == 74) && (photoByte[7] == 70) && (photoByte[8] == 73) && (photoByte[9] == 70))
|
||||
{
|
||||
strFileExtendName = "jpg";
|
||||
}
|
||||
else if ((photoByte[0] == 66) && (photoByte[1] == 77))
|
||||
{
|
||||
strFileExtendName = "bmp";
|
||||
}
|
||||
else if ((photoByte[1] == 80) && (photoByte[2] == 78) && (photoByte[3] == 71))
|
||||
{
|
||||
strFileExtendName = "png";
|
||||
}
|
||||
return strFileExtendName;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,13 @@ import java.util.Set;
|
|||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.poi.hssf.usermodel.HSSFClientAnchor;
|
||||
import org.apache.poi.hssf.usermodel.HSSFPicture;
|
||||
import org.apache.poi.hssf.usermodel.HSSFPictureData;
|
||||
import org.apache.poi.hssf.usermodel.HSSFShape;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ooxml.POIXMLDocumentPart;
|
||||
import org.apache.poi.ss.usermodel.BorderStyle;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
|
|
@ -33,6 +40,7 @@ import org.apache.poi.ss.usermodel.FillPatternType;
|
|||
import org.apache.poi.ss.usermodel.Font;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.apache.poi.ss.usermodel.IndexedColors;
|
||||
import org.apache.poi.ss.usermodel.PictureData;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||
|
|
@ -43,6 +51,12 @@ import org.apache.poi.util.IOUtils;
|
|||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFClientAnchor;
|
||||
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
|
||||
import org.apache.poi.xssf.usermodel.XSSFDrawing;
|
||||
import org.apache.poi.xssf.usermodel.XSSFPicture;
|
||||
import org.apache.poi.xssf.usermodel.XSSFShape;
|
||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTMarker;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
|
|
@ -57,6 +71,7 @@ import com.ruoyi.common.utils.DateUtils;
|
|||
import com.ruoyi.common.utils.DictUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.file.FileTypeUtils;
|
||||
import com.ruoyi.common.utils.file.FileUtils;
|
||||
import com.ruoyi.common.utils.file.ImageUtils;
|
||||
import com.ruoyi.common.utils.reflect.ReflectUtils;
|
||||
|
||||
|
|
@ -170,23 +185,22 @@ public class ExcelUtil<T>
|
|||
this.type = Type.IMPORT;
|
||||
this.wb = WorkbookFactory.create(is);
|
||||
List<T> list = new ArrayList<T>();
|
||||
Sheet sheet = null;
|
||||
if (StringUtils.isNotEmpty(sheetName))
|
||||
{
|
||||
// 如果指定sheet名,则取指定sheet中的内容.
|
||||
sheet = wb.getSheet(sheetName);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 如果传入的sheet名不存在则默认指向第1个sheet.
|
||||
sheet = wb.getSheetAt(0);
|
||||
}
|
||||
|
||||
// 如果指定sheet名,则取指定sheet中的内容 否则默认指向第1个sheet
|
||||
Sheet sheet = StringUtils.isNotEmpty(sheetName) ? wb.getSheet(sheetName) : wb.getSheetAt(0);
|
||||
if (sheet == null)
|
||||
{
|
||||
throw new IOException("文件sheet不存在");
|
||||
}
|
||||
|
||||
boolean isXSSFWorkbook = !(wb instanceof HSSFWorkbook);
|
||||
Map<String, PictureData> pictures;
|
||||
if (isXSSFWorkbook)
|
||||
{
|
||||
pictures = getSheetPictrues07((XSSFSheet) sheet, (XSSFWorkbook) wb);
|
||||
}
|
||||
else
|
||||
{
|
||||
pictures = getSheetPictrues03((HSSFSheet) sheet, (HSSFWorkbook) wb);
|
||||
}
|
||||
// 获取最后一个非空行的行下标,比如总行数为n,则返回的为n-1
|
||||
int rows = sheet.getLastRowNum();
|
||||
|
||||
|
|
@ -319,6 +333,16 @@ public class ExcelUtil<T>
|
|||
{
|
||||
val = reverseDictByExp(Convert.toStr(val), attr.dictType(), attr.separator());
|
||||
}
|
||||
else if (ColumnType.IMAGE == attr.cellType() && StringUtils.isNotEmpty(pictures))
|
||||
{
|
||||
PictureData image = pictures.get(row.getRowNum() + "_" + entry.getKey());
|
||||
if (image == null)
|
||||
{
|
||||
val = "";
|
||||
}
|
||||
byte[] data = image.getData();
|
||||
val = FileUtils.writeImportBytes(data);
|
||||
}
|
||||
ReflectUtils.invokeSetter(entity, propertyName, val);
|
||||
}
|
||||
}
|
||||
|
|
@ -905,10 +929,9 @@ public class ExcelUtil<T>
|
|||
{
|
||||
if (statistics.size() > 0)
|
||||
{
|
||||
Cell cell = null;
|
||||
Row row = sheet.createRow(sheet.getLastRowNum() + 1);
|
||||
Set<Integer> keys = statistics.keySet();
|
||||
cell = row.createCell(0);
|
||||
Cell cell = row.createCell(0);
|
||||
cell.setCellStyle(styles.get("total"));
|
||||
cell.setCellValue("合计");
|
||||
|
||||
|
|
@ -1166,4 +1189,69 @@ public class ExcelUtil<T>
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Excel2003图片
|
||||
*
|
||||
* @param sheet 当前sheet对象
|
||||
* @param workbook 工作簿对象
|
||||
* @return Map key:图片单元格索引(1_1)String,value:图片流PictureData
|
||||
*/
|
||||
public static Map<String, PictureData> getSheetPictrues03(HSSFSheet sheet, HSSFWorkbook workbook)
|
||||
{
|
||||
Map<String, PictureData> sheetIndexPicMap = new HashMap<String, PictureData>();
|
||||
List<HSSFPictureData> pictures = workbook.getAllPictures();
|
||||
if (!pictures.isEmpty())
|
||||
{
|
||||
for (HSSFShape shape : sheet.getDrawingPatriarch().getChildren())
|
||||
{
|
||||
HSSFClientAnchor anchor = (HSSFClientAnchor) shape.getAnchor();
|
||||
if (shape instanceof HSSFPicture)
|
||||
{
|
||||
HSSFPicture pic = (HSSFPicture) shape;
|
||||
int pictureIndex = pic.getPictureIndex() - 1;
|
||||
HSSFPictureData picData = pictures.get(pictureIndex);
|
||||
String picIndex = String.valueOf(anchor.getRow1()) + "_" + String.valueOf(anchor.getCol1());
|
||||
sheetIndexPicMap.put(picIndex, picData);
|
||||
}
|
||||
}
|
||||
return sheetIndexPicMap;
|
||||
}
|
||||
else
|
||||
{
|
||||
return sheetIndexPicMap;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Excel2007图片
|
||||
*
|
||||
* @param sheet 当前sheet对象
|
||||
* @param workbook 工作簿对象
|
||||
* @return Map key:图片单元格索引(1_1)String,value:图片流PictureData
|
||||
*/
|
||||
public static Map<String, PictureData> getSheetPictrues07(XSSFSheet sheet, XSSFWorkbook workbook)
|
||||
{
|
||||
Map<String, PictureData> sheetIndexPicMap = new HashMap<String, PictureData>();
|
||||
for (POIXMLDocumentPart dr : sheet.getRelations())
|
||||
{
|
||||
if (dr instanceof XSSFDrawing)
|
||||
{
|
||||
XSSFDrawing drawing = (XSSFDrawing) dr;
|
||||
List<XSSFShape> shapes = drawing.getShapes();
|
||||
for (XSSFShape shape : shapes)
|
||||
{
|
||||
if (shape instanceof XSSFPicture)
|
||||
{
|
||||
XSSFPicture pic = (XSSFPicture) shape;
|
||||
XSSFClientAnchor anchor = pic.getPreferredSize();
|
||||
CTMarker ctMarker = anchor.getFrom();
|
||||
String picIndex = ctMarker.getRow() + "_" + ctMarker.getCol();
|
||||
sheetIndexPicMap.put(picIndex, pic.getPictureData());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return sheetIndexPicMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -125,6 +125,12 @@ public class ShiroConfig
|
|||
@Value("${shiro.user.unauthorizedUrl}")
|
||||
private String unauthorizedUrl;
|
||||
|
||||
/**
|
||||
* 是否开启记住我功能
|
||||
*/
|
||||
@Value("${shiro.rememberMe.enabled: false}")
|
||||
private boolean rememberMe;
|
||||
|
||||
/**
|
||||
* 缓存管理器 使用Ehcache实现
|
||||
*/
|
||||
|
|
@ -239,7 +245,7 @@ public class ShiroConfig
|
|||
// 设置realm.
|
||||
securityManager.setRealm(userRealm);
|
||||
// 记住我
|
||||
securityManager.setRememberMeManager(rememberMeManager());
|
||||
securityManager.setRememberMeManager(rememberMe ? rememberMeManager() : null);
|
||||
// 注入缓存管理器;
|
||||
securityManager.setCacheManager(getEhCacheManager());
|
||||
// session管理器
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ 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.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
|
|
@ -189,4 +190,31 @@ public class SysJobController extends BaseController
|
|||
{
|
||||
return jobService.checkCronExpressionIsValid(job.getCronExpression());
|
||||
}
|
||||
|
||||
/**
|
||||
* Cron表达式在线生成
|
||||
*/
|
||||
@GetMapping("/cron")
|
||||
public String cron()
|
||||
{
|
||||
return prefix + "/cron";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询cron表达式近5次的执行时间
|
||||
*/
|
||||
@GetMapping("/queryCronExpression")
|
||||
@ResponseBody
|
||||
public AjaxResult queryCronExpression(@RequestParam(value = "cronExpression", required = false) String cronExpression)
|
||||
{
|
||||
if (jobService.checkCronExpressionIsValid(cronExpression))
|
||||
{
|
||||
List<String> dateList = CronUtils.getRecentTriggerTime(cronExpression);
|
||||
return success(dateList);
|
||||
}
|
||||
else
|
||||
{
|
||||
return error("表达式无效");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,13 @@
|
|||
package com.ruoyi.quartz.util;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.quartz.CronExpression;
|
||||
import org.quartz.TriggerUtils;
|
||||
import org.quartz.impl.triggers.CronTriggerImpl;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
|
||||
/**
|
||||
* cron表达式工具类
|
||||
|
|
@ -60,4 +65,30 @@ public class CronUtils
|
|||
throw new IllegalArgumentException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过表达式获取近10次的执行时间
|
||||
*
|
||||
* @param cron 表达式
|
||||
* @return 时间列表
|
||||
*/
|
||||
public static List<String> getRecentTriggerTime(String cron)
|
||||
{
|
||||
List<String> list = new ArrayList<String>();
|
||||
try
|
||||
{
|
||||
CronTriggerImpl cronTriggerImpl = new CronTriggerImpl();
|
||||
cronTriggerImpl.setCronExpression(cron);
|
||||
List<Date> dates = TriggerUtils.computeFireTimes(cronTriggerImpl, null, 10);
|
||||
for (Date date : dates)
|
||||
{
|
||||
list.add(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, date));
|
||||
}
|
||||
}
|
||||
catch (ParseException e)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -47,6 +47,9 @@
|
|||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="monitor:job:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
<a class="btn btn-primary" onclick="javascript:cron()">
|
||||
<i class="fa fa-code"></i> 生成表达式
|
||||
</a>
|
||||
<a class="btn btn-info" onclick="javascript:jobLog()" shiro:hasPermission="monitor:job:detail">
|
||||
<i class="fa fa-list"></i> 日志
|
||||
</a>
|
||||
|
|
@ -176,6 +179,19 @@
|
|||
}
|
||||
$.modal.openTab("调度日志", url);
|
||||
}
|
||||
|
||||
/* cron表达式生成 */
|
||||
function cron() {
|
||||
var url = prefix + '/cron';
|
||||
var height = $(window).height() - 50;
|
||||
top.layer.open({
|
||||
title: "Cron表达式生成器",
|
||||
type: 2,
|
||||
area: ['800px', height + "px" ], //宽高
|
||||
shadeClose: true,
|
||||
content: url
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -136,6 +136,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
/**
|
||||
* 加载字典缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void loadingDictCache()
|
||||
{
|
||||
List<SysDictType> dictTypeList = dictTypeMapper.selectDictTypeAll();
|
||||
|
|
@ -149,6 +150,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
/**
|
||||
* 清空字典缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void clearDictCache()
|
||||
{
|
||||
DictUtils.clearDictCache();
|
||||
|
|
@ -157,6 +159,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
|||
/**
|
||||
* 重置字典缓存数据
|
||||
*/
|
||||
@Override
|
||||
public void resetDictCache()
|
||||
{
|
||||
clearDictCache();
|
||||
|
|
|
|||
Loading…
Reference in New Issue