feat:修改任务

dev
wangxy 8 months ago
parent 9f0222e0a8
commit 07fa856090

@ -1,19 +1,19 @@
/* */ package com.archive.common.exception.user; package com.archive.common.exception.user;
/* */
/* */ import com.archive.common.exception.user.UserException; import com.archive.common.exception.user.UserException;
/* */
/* */
/* */
/* */
/* */ public class RoleBlockedException public class RoleBlockedException
/* */ extends UserException extends UserException
/* */ { {
/* */ private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/* */
/* */ public RoleBlockedException() { public RoleBlockedException() {
/* 14 */ super("role.blocked", null); super("role.blocked", null);
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\exceptio\\user\RoleBlockedException.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\exceptio\\user\RoleBlockedException.class

@ -1,169 +1,169 @@
/* */ package com.archive.common.utils package com.archive.common.utils
; ;
/* */
/* */ import com.archive.common.utils.StringUtils; import com.archive.common.utils.StringUtils;
/* */ import com.archive.common.utils.text.Convert; import com.archive.common.utils.text.Convert;
/* */ import java.io.IOException; import java.io.IOException;
/* */ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
/* */ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
/* */ import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
/* */ import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestAttributes;
/* */ import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
/* */ import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class ServletUtils public class ServletUtils
/* */ { {
/* 22 */ private static final String[] agent = new String[] { "Android", "iPhone", "iPod", "iPad", "Windows Phone", "MQQBrowser" }; private static final String[] agent = new String[] { "Android", "iPhone", "iPod", "iPad", "Windows Phone", "MQQBrowser" };
/* */
/* */
/* */
/* */
/* */
/* */ public static String getParameter(String name) { public static String getParameter(String name) {
/* 29 */ return getRequest().getParameter(name); return getRequest().getParameter(name);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public static String getParameter(String name, String defaultValue) { public static String getParameter(String name, String defaultValue) {
/* 37 */ return Convert.toStr(getRequest().getParameter(name), defaultValue); return Convert.toStr(getRequest().getParameter(name), defaultValue);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public static Integer getParameterToInt(String name) { public static Integer getParameterToInt(String name) {
/* 45 */ return Convert.toInt(getRequest().getParameter(name)); return Convert.toInt(getRequest().getParameter(name));
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public static Integer getParameterToInt(String name, Integer defaultValue) { public static Integer getParameterToInt(String name, Integer defaultValue) {
/* 53 */ return Convert.toInt(getRequest().getParameter(name), defaultValue); return Convert.toInt(getRequest().getParameter(name), defaultValue);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public static HttpServletRequest getRequest() { public static HttpServletRequest getRequest() {
/* 61 */ return getRequestAttributes().getRequest(); return getRequestAttributes().getRequest();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public static HttpServletResponse getResponse() { public static HttpServletResponse getResponse() {
/* 69 */ return getRequestAttributes().getResponse(); return getRequestAttributes().getResponse();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public static HttpSession getSession() { public static HttpSession getSession() {
/* 77 */ return getRequest().getSession(); return getRequest().getSession();
/* */ } }
/* */
/* */
/* */ public static ServletRequestAttributes getRequestAttributes() { public static ServletRequestAttributes getRequestAttributes() {
/* 82 */ RequestAttributes attributes = RequestContextHolder.getRequestAttributes(); RequestAttributes attributes = RequestContextHolder.getRequestAttributes();
/* 83 */ return (ServletRequestAttributes)attributes; return (ServletRequestAttributes)attributes;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String renderString(HttpServletResponse response, String string) { public static String renderString(HttpServletResponse response, String string) {
/* */ try { try {
/* 97 */ response.setContentType("application/json"); response.setContentType("application/json");
/* 98 */ response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
/* 99 */ response.getWriter().print(string); response.getWriter().print(string);
/* */ } }
/* 101 */ catch (IOException e) { catch (IOException e) {
/* */
/* 103 */ e.printStackTrace(); e.printStackTrace();
/* */ } }
/* 105 */ return null; return null;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean isAjaxRequest(HttpServletRequest request) { public static boolean isAjaxRequest(HttpServletRequest request) {
/* 115 */ String accept = request.getHeader("accept"); String accept = request.getHeader("accept");
/* 116 */ if (accept != null && accept.indexOf("application/json") != -1) if (accept != null && accept.indexOf("application/json") != -1)
/* */ { {
/* 118 */ return true; return true;
/* */ } }
/* */
/* 121 */ String xRequestedWith = request.getHeader("X-Requested-With"); String xRequestedWith = request.getHeader("X-Requested-With");
/* 122 */ if (xRequestedWith != null && xRequestedWith.indexOf("XMLHttpRequest") != -1) if (xRequestedWith != null && xRequestedWith.indexOf("XMLHttpRequest") != -1)
/* */ { {
/* 124 */ return true; return true;
/* */ } }
/* */
/* 127 */ String uri = request.getRequestURI(); String uri = request.getRequestURI();
/* 128 */ if (StringUtils.inStringIgnoreCase(uri, new String[] { ".json", ".xml" })) if (StringUtils.inStringIgnoreCase(uri, new String[] { ".json", ".xml" }))
/* */ { {
/* 130 */ return true; return true;
/* */ } }
/* */
/* 133 */ String ajax = request.getParameter("__ajax"); String ajax = request.getParameter("__ajax");
/* 134 */ if (StringUtils.inStringIgnoreCase(ajax, new String[] { "json", "xml" })) if (StringUtils.inStringIgnoreCase(ajax, new String[] { "json", "xml" }))
/* */ { {
/* 136 */ return true; return true;
/* */ } }
/* 138 */ return false; return false;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean checkAgentIsMobile(String ua) { public static boolean checkAgentIsMobile(String ua) {
/* 146 */ boolean flag = false; boolean flag = false;
/* 147 */ if (!ua.contains("Windows NT") || (ua.contains("Windows NT") && ua.contains("compatible; MSIE 9.0;"))) if (!ua.contains("Windows NT") || (ua.contains("Windows NT") && ua.contains("compatible; MSIE 9.0;")))
/* */ { {
/* */
/* 150 */ if (!ua.contains("Windows NT") && !ua.contains("Macintosh")) if (!ua.contains("Windows NT") && !ua.contains("Macintosh"))
/* */ { {
/* 152 */ for (String item : agent) { for (String item : agent) {
/* */
/* 154 */ if (ua.contains(item)) { if (ua.contains(item)) {
/* */
/* 156 */ flag = true; flag = true;
/* */ break; break;
/* */ } }
/* */ } }
/* */ } }
/* */ } }
/* 162 */ return flag; return flag;
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\ServletUtils.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\ServletUtils.class

@ -1,413 +1,413 @@
/* */ package com.archive.common.utils.reflect; package com.archive.common.utils.reflect;
/* */
/* */ import com.archive.common.utils.DateUtils; import com.archive.common.utils.DateUtils;
/* */ import com.archive.common.utils.text.Convert; import com.archive.common.utils.text.Convert;
/* */ import java.lang.reflect.Field; import java.lang.reflect.Field;
/* */ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
/* */ import java.lang.reflect.Method; import java.lang.reflect.Method;
/* */ import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
/* */ import java.lang.reflect.ParameterizedType; import java.lang.reflect.ParameterizedType;
/* */ import java.lang.reflect.Type; import java.lang.reflect.Type;
/* */ import java.util.Date; import java.util.Date;
/* */ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
/* */ import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
/* */ import org.apache.poi.ss.usermodel.DateUtil; import org.apache.poi.ss.usermodel.DateUtil;
/* */ import org.slf4j.Logger; import org.slf4j.Logger;
/* */ import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class ReflectUtils public class ReflectUtils
/* */ { {
/* */ private static final String SETTER_PREFIX = "set"; private static final String SETTER_PREFIX = "set";
/* */ private static final String GETTER_PREFIX = "get"; private static final String GETTER_PREFIX = "get";
/* */ private static final String CGLIB_CLASS_SEPARATOR = "$$"; private static final String CGLIB_CLASS_SEPARATOR = "$$";
/* 32 */ private static Logger logger = LoggerFactory.getLogger(com.archive.common.utils.reflect.ReflectUtils.class); private static Logger logger = LoggerFactory.getLogger(com.archive.common.utils.reflect.ReflectUtils.class);
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static <E> E invokeGetter(Object obj, String propertyName) { public static <E> E invokeGetter(Object obj, String propertyName) {
/* 41 */ Object object = obj; Object object = obj;
/* 42 */ for (String name : StringUtils.split(propertyName, ".")) { for (String name : StringUtils.split(propertyName, ".")) {
/* */
/* 44 */ String getterMethodName = "get" + StringUtils.capitalize(name); String getterMethodName = "get" + StringUtils.capitalize(name);
/* 45 */ object = invokeMethod(object, getterMethodName, new Class[0], new Object[0]); object = invokeMethod(object, getterMethodName, new Class[0], new Object[0]);
/* */ } }
/* 47 */ return (E)object; return (E)object;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static <E> void invokeSetter(Object obj, String propertyName, E value) { public static <E> void invokeSetter(Object obj, String propertyName, E value) {
/* 56 */ Object object = obj; Object object = obj;
/* 57 */ String[] names = StringUtils.split(propertyName, "."); String[] names = StringUtils.split(propertyName, ".");
/* 58 */ for (int i = 0; i < names.length; i++) { for (int i = 0; i < names.length; i++) {
/* */
/* 60 */ if (i < names.length - 1) { if (i < names.length - 1) {
/* */
/* 62 */ String getterMethodName = "get" + StringUtils.capitalize(names[i]); String getterMethodName = "get" + StringUtils.capitalize(names[i]);
/* 63 */ object = invokeMethod(object, getterMethodName, new Class[0], new Object[0]); object = invokeMethod(object, getterMethodName, new Class[0], new Object[0]);
/* */ } }
/* */ else { else {
/* */
/* 67 */ String setterMethodName = "set" + StringUtils.capitalize(names[i]); String setterMethodName = "set" + StringUtils.capitalize(names[i]);
/* 68 */ invokeMethodByName(object, setterMethodName, new Object[] { value }); invokeMethodByName(object, setterMethodName, new Object[] { value });
/* */ } }
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static <E> E getFieldValue(Object obj, String fieldName) { public static <E> E getFieldValue(Object obj, String fieldName) {
/* 79 */ Field field = getAccessibleField(obj, fieldName); Field field = getAccessibleField(obj, fieldName);
/* 80 */ if (field == null) { if (field == null) {
/* */
/* 82 */ logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 "); logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
/* 83 */ return null; return null;
/* */ } }
/* 85 */ E result = null; E result = null;
/* */
/* */ try { try {
/* 88 */ result = (E)field.get(obj); result = (E)field.get(obj);
/* */ } }
/* 90 */ catch (IllegalAccessException e) { catch (IllegalAccessException e) {
/* */
/* 92 */ logger.error("不可能抛出的异常{}", e.getMessage()); logger.error("不可能抛出的异常{}", e.getMessage());
/* */ } }
/* 94 */ return result; return result;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public static <E> void setFieldValue(Object obj, String fieldName, E value) { public static <E> void setFieldValue(Object obj, String fieldName, E value) {
/* 102 */ Field field = getAccessibleField(obj, fieldName); Field field = getAccessibleField(obj, fieldName);
/* 103 */ if (field == null) { if (field == null) {
/* */
/* */
/* 106 */ logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 "); logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + fieldName + "] 字段 ");
/* */
/* */ return; return;
/* */ } }
/* */ try { try {
/* 111 */ field.set(obj, value); field.set(obj, value);
/* */ } }
/* 113 */ catch (IllegalAccessException e) { catch (IllegalAccessException e) {
/* */
/* 115 */ logger.error("不可能抛出的异常: {}", e.getMessage()); logger.error("不可能抛出的异常: {}", e.getMessage());
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static <E> E invokeMethod(Object obj, String methodName, Class<?>[] parameterTypes, Object[] args) { public static <E> E invokeMethod(Object obj, String methodName, Class<?>[] parameterTypes, Object[] args) {
/* 128 */ if (obj == null || methodName == null) if (obj == null || methodName == null)
/* */ { {
/* 130 */ return null; return null;
/* */ } }
/* 132 */ Method method = getAccessibleMethod(obj, methodName, parameterTypes); Method method = getAccessibleMethod(obj, methodName, parameterTypes);
/* 133 */ if (method == null) { if (method == null) {
/* */
/* 135 */ logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 "); logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
/* 136 */ return null; return null;
/* */ } }
/* */
/* */ try { try {
/* 140 */ return (E)method.invoke(obj, args); return (E)method.invoke(obj, args);
/* */ } }
/* 142 */ catch (Exception e) { catch (Exception e) {
/* */
/* 144 */ String msg = "method: " + method + ", obj: " + obj + ", args: " + args + ""; String msg = "method: " + method + ", obj: " + obj + ", args: " + args + "";
/* 145 */ throw convertReflectionExceptionToUnchecked(msg, e); throw convertReflectionExceptionToUnchecked(msg, e);
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static <E> E invokeMethodByName(Object obj, String methodName, Object[] args) { public static <E> E invokeMethodByName(Object obj, String methodName, Object[] args) {
/* 157 */ Method method = getAccessibleMethodByName(obj, methodName, args.length); Method method = getAccessibleMethodByName(obj, methodName, args.length);
/* 158 */ if (method == null) { if (method == null) {
/* */
/* */
/* 161 */ logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 "); logger.debug("在 [" + obj.getClass() + "] 中,没有找到 [" + methodName + "] 方法 ");
/* 162 */ return null; return null;
/* */ } }
/* */
/* */
/* */ try { try {
/* 167 */ Class<?>[] cs = method.getParameterTypes(); Class<?>[] cs = method.getParameterTypes();
/* 168 */ for (int i = 0; i < cs.length; i++) { for (int i = 0; i < cs.length; i++) {
/* */
/* 170 */ if (args[i] != null && !args[i].getClass().equals(cs[i])) if (args[i] != null && !args[i].getClass().equals(cs[i]))
/* */ { {
/* 172 */ if (cs[i] == String.class) { if (cs[i] == String.class) {
/* */
/* 174 */ args[i] = Convert.toStr(args[i]); args[i] = Convert.toStr(args[i]);
/* 175 */ if (StringUtils.endsWith((String)args[i], ".0")) if (StringUtils.endsWith((String)args[i], ".0"))
/* */ { {
/* 177 */ args[i] = StringUtils.substringBefore((String)args[i], ".0"); args[i] = StringUtils.substringBefore((String)args[i], ".0");
/* */ } }
/* */ } }
/* 180 */ else if (cs[i] == Integer.class) { else if (cs[i] == Integer.class) {
/* */
/* 182 */ args[i] = Convert.toInt(args[i]); args[i] = Convert.toInt(args[i]);
/* */ } }
/* 184 */ else if (cs[i] == Long.class) { else if (cs[i] == Long.class) {
/* */
/* 186 */ args[i] = Convert.toLong(args[i]); args[i] = Convert.toLong(args[i]);
/* */ } }
/* 188 */ else if (cs[i] == Double.class) { else if (cs[i] == Double.class) {
/* */
/* 190 */ args[i] = Convert.toDouble(args[i]); args[i] = Convert.toDouble(args[i]);
/* */ } }
/* 192 */ else if (cs[i] == Float.class) { else if (cs[i] == Float.class) {
/* */
/* 194 */ args[i] = Convert.toFloat(args[i]); args[i] = Convert.toFloat(args[i]);
/* */ } }
/* 196 */ else if (cs[i] == Date.class) { else if (cs[i] == Date.class) {
/* */
/* 198 */ if (args[i] instanceof String) if (args[i] instanceof String)
/* */ { {
/* 200 */ args[i] = DateUtils.parseDate(args[i]); args[i] = DateUtils.parseDate(args[i]);
/* */ } }
/* */ else else
/* */ { {
/* 204 */ args[i] = DateUtil.getJavaDate(((Double)args[i]).doubleValue()); args[i] = DateUtil.getJavaDate(((Double)args[i]).doubleValue());
/* */ } }
/* */
/* 207 */ } else if (cs[i] == boolean.class || cs[i] == Boolean.class) { } else if (cs[i] == boolean.class || cs[i] == Boolean.class) {
/* */
/* 209 */ args[i] = Convert.toBool(args[i]); args[i] = Convert.toBool(args[i]);
/* */ } }
/* */ } }
/* */ } }
/* 213 */ return (E)method.invoke(obj, args); return (E)method.invoke(obj, args);
/* */ } }
/* 215 */ catch (Exception e) { catch (Exception e) {
/* */
/* 217 */ String msg = "method: " + method + ", obj: " + obj + ", args: " + args + ""; String msg = "method: " + method + ", obj: " + obj + ", args: " + args + "";
/* 218 */ throw convertReflectionExceptionToUnchecked(msg, e); throw convertReflectionExceptionToUnchecked(msg, e);
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static Field getAccessibleField(Object obj, String fieldName) { public static Field getAccessibleField(Object obj, String fieldName) {
/* 229 */ if (obj == null) if (obj == null)
/* */ { {
/* 231 */ return null; return null;
/* */ } }
/* 233 */ Validate.notBlank(fieldName, "fieldName can't be blank", new Object[0]); Validate.notBlank(fieldName, "fieldName can't be blank", new Object[0]);
/* 234 */ for (Class<?> superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) { for (Class<?> superClass = obj.getClass(); superClass != Object.class; superClass = superClass.getSuperclass()) {
/* */
/* */
/* */ try { try {
/* 238 */ Field field = superClass.getDeclaredField(fieldName); Field field = superClass.getDeclaredField(fieldName);
/* 239 */ makeAccessible(field); makeAccessible(field);
/* 240 */ return field; return field;
/* */ } }
/* 242 */ catch (NoSuchFieldException e) {} catch (NoSuchFieldException e) {}
/* */ } }
/* */
/* */
/* */
/* 247 */ return null; return null;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static Method getAccessibleMethod(Object obj, String methodName, Class<?>... parameterTypes) { public static Method getAccessibleMethod(Object obj, String methodName, Class<?>... parameterTypes) {
/* 260 */ if (obj == null) if (obj == null)
/* */ { {
/* 262 */ return null; return null;
/* */ } }
/* 264 */ Validate.notBlank(methodName, "methodName can't be blank", new Object[0]); Validate.notBlank(methodName, "methodName can't be blank", new Object[0]);
/* 265 */ for (Class<?> searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) { for (Class<?> searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) {
/* */
/* */
/* */ try { try {
/* 269 */ Method method = searchType.getDeclaredMethod(methodName, parameterTypes); Method method = searchType.getDeclaredMethod(methodName, parameterTypes);
/* 270 */ makeAccessible(method); makeAccessible(method);
/* 271 */ return method; return method;
/* */ } }
/* 273 */ catch (NoSuchMethodException e) {} catch (NoSuchMethodException e) {}
/* */ } }
/* */
/* */
/* */
/* 278 */ return null; return null;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static Method getAccessibleMethodByName(Object obj, String methodName, int argsNum) { public static Method getAccessibleMethodByName(Object obj, String methodName, int argsNum) {
/* 290 */ if (obj == null) if (obj == null)
/* */ { {
/* 292 */ return null; return null;
/* */ } }
/* 294 */ Validate.notBlank(methodName, "methodName can't be blank", new Object[0]); Validate.notBlank(methodName, "methodName can't be blank", new Object[0]);
/* 295 */ for (Class<?> searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) { for (Class<?> searchType = obj.getClass(); searchType != Object.class; searchType = searchType.getSuperclass()) {
/* */
/* 297 */ Method[] methods = searchType.getDeclaredMethods(); Method[] methods = searchType.getDeclaredMethods();
/* 298 */ for (Method method : methods) { for (Method method : methods) {
/* */
/* 300 */ if (method.getName().equals(methodName) && (method.getParameterTypes()).length == argsNum) { if (method.getName().equals(methodName) && (method.getParameterTypes()).length == argsNum) {
/* */
/* 302 */ makeAccessible(method); makeAccessible(method);
/* 303 */ return method; return method;
/* */ } }
/* */ } }
/* */ } }
/* 307 */ return null; return null;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public static void makeAccessible(Method method) { public static void makeAccessible(Method method) {
/* 315 */ if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers())) && if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers())) &&
/* 316 */ !method.isAccessible()) !method.isAccessible())
/* */ { {
/* 318 */ method.setAccessible(true); method.setAccessible(true);
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public static void makeAccessible(Field field) { public static void makeAccessible(Field field) {
/* 327 */ if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers()) || if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers()) ||
/* 328 */ Modifier.isFinal(field.getModifiers())) && !field.isAccessible()) Modifier.isFinal(field.getModifiers())) && !field.isAccessible())
/* */ { {
/* 330 */ field.setAccessible(true); field.setAccessible(true);
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static <T> Class<T> getClassGenricType(Class clazz) { public static <T> Class<T> getClassGenricType(Class clazz) {
/* 341 */ return getClassGenricType(clazz, 0); return getClassGenricType(clazz, 0);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static Class getClassGenricType(Class clazz, int index) { public static Class getClassGenricType(Class clazz, int index) {
/* 350 */ Type genType = clazz.getGenericSuperclass(); Type genType = clazz.getGenericSuperclass();
/* */
/* 352 */ if (!(genType instanceof ParameterizedType)) { if (!(genType instanceof ParameterizedType)) {
/* */
/* 354 */ logger.debug(clazz.getSimpleName() + "'s superclass not ParameterizedType"); logger.debug(clazz.getSimpleName() + "'s superclass not ParameterizedType");
/* 355 */ return Object.class; return Object.class;
/* */ } }
/* */
/* 358 */ Type[] params = ((ParameterizedType)genType).getActualTypeArguments(); Type[] params = ((ParameterizedType)genType).getActualTypeArguments();
/* */
/* 360 */ if (index >= params.length || index < 0) { if (index >= params.length || index < 0) {
/* */
/* 362 */ logger.debug("Index: " + index + ", Size of " + clazz.getSimpleName() + "'s Parameterized Type: " + params.length); logger.debug("Index: " + index + ", Size of " + clazz.getSimpleName() + "'s Parameterized Type: " + params.length);
/* */
/* 364 */ return Object.class; return Object.class;
/* */ } }
/* 366 */ if (!(params[index] instanceof Class)) { if (!(params[index] instanceof Class)) {
/* */
/* 368 */ logger.debug(clazz.getSimpleName() + " not set the actual class on superclass generic parameter"); logger.debug(clazz.getSimpleName() + " not set the actual class on superclass generic parameter");
/* 369 */ return Object.class; return Object.class;
/* */ } }
/* */
/* 372 */ return (Class)params[index]; return (Class)params[index];
/* */ } }
/* */
/* */
/* */ public static Class<?> getUserClass(Object instance) { public static Class<?> getUserClass(Object instance) {
/* 377 */ if (instance == null) if (instance == null)
/* */ { {
/* 379 */ throw new RuntimeException("Instance must not be null"); throw new RuntimeException("Instance must not be null");
/* */ } }
/* 381 */ Class<?> clazz = instance.getClass(); Class<?> clazz = instance.getClass();
/* 382 */ if (clazz != null && clazz.getName().contains("$$")) { if (clazz != null && clazz.getName().contains("$$")) {
/* */
/* 384 */ Class<?> superClass = clazz.getSuperclass(); Class<?> superClass = clazz.getSuperclass();
/* 385 */ if (superClass != null && !Object.class.equals(superClass)) if (superClass != null && !Object.class.equals(superClass))
/* */ { {
/* 387 */ return superClass; return superClass;
/* */ } }
/* */ } }
/* 390 */ return clazz; return clazz;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static RuntimeException convertReflectionExceptionToUnchecked(String msg, Exception e) { public static RuntimeException convertReflectionExceptionToUnchecked(String msg, Exception e) {
/* 399 */ if (e instanceof IllegalAccessException || e instanceof IllegalArgumentException || e instanceof NoSuchMethodException) if (e instanceof IllegalAccessException || e instanceof IllegalArgumentException || e instanceof NoSuchMethodException)
/* */ { {
/* */
/* 402 */ return new IllegalArgumentException(msg, e); return new IllegalArgumentException(msg, e);
/* */ } }
/* 404 */ if (e instanceof InvocationTargetException) if (e instanceof InvocationTargetException)
/* */ { {
/* 406 */ return new RuntimeException(msg, ((InvocationTargetException)e).getTargetException()); return new RuntimeException(msg, ((InvocationTargetException)e).getTargetException());
/* */ } }
/* 408 */ return new RuntimeException(msg, e); return new RuntimeException(msg, e);
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\reflect\ReflectUtils.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\reflect\ReflectUtils.class

@ -1,78 +1,78 @@
/* */ package com.archive.common.utils.security; package com.archive.common.utils.security;
/* */
/* */ import com.archive.common.utils.StringUtils; import com.archive.common.utils.StringUtils;
/* */ import com.archive.common.utils.bean.BeanUtils; import com.archive.common.utils.bean.BeanUtils;
/* */ import com.archive.project.system.user.domain.User; import com.archive.project.system.user.domain.User;
/* */ import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
/* */ import org.apache.shiro.session.Session; import org.apache.shiro.session.Session;
/* */ import org.apache.shiro.subject.PrincipalCollection; import org.apache.shiro.subject.PrincipalCollection;
/* */ import org.apache.shiro.subject.SimplePrincipalCollection; import org.apache.shiro.subject.SimplePrincipalCollection;
/* */ import org.apache.shiro.subject.Subject; import org.apache.shiro.subject.Subject;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class ShiroUtils public class ShiroUtils
/* */ { {
/* */ public static Subject getSubject() { public static Subject getSubject() {
/* 21 */ return SecurityUtils.getSubject(); return SecurityUtils.getSubject();
/* */ } }
/* */
/* */
/* */ public static Session getSession() { public static Session getSession() {
/* 26 */ return SecurityUtils.getSubject().getSession(); return SecurityUtils.getSubject().getSession();
/* */ } }
/* */
/* */
/* */ public static void logout() { public static void logout() {
/* 31 */ getSubject().logout(); getSubject().logout();
/* */ } }
/* */
/* */
/* */ public static User getSysUser() { public static User getSysUser() {
/* 36 */ User user = null; User user = null;
/* 37 */ Object obj = getSubject().getPrincipal(); Object obj = getSubject().getPrincipal();
/* 38 */ if (StringUtils.isNotNull(obj)) { if (StringUtils.isNotNull(obj)) {
/* */
/* 40 */ user = new User(); user = new User();
/* 41 */ BeanUtils.copyBeanProp(user, obj); BeanUtils.copyBeanProp(user, obj);
/* */ } }
/* 43 */ return user; return user;
/* */ } }
/* */
/* */
/* */ public static void setSysUser(User user) { public static void setSysUser(User user) {
/* 48 */ Subject subject = getSubject(); Subject subject = getSubject();
/* 49 */ PrincipalCollection principalCollection = subject.getPrincipals(); PrincipalCollection principalCollection = subject.getPrincipals();
/* 50 */ String realmName = principalCollection.getRealmNames().iterator().next(); String realmName = principalCollection.getRealmNames().iterator().next();
/* 51 */ SimplePrincipalCollection simplePrincipalCollection = new SimplePrincipalCollection(user, realmName); SimplePrincipalCollection simplePrincipalCollection = new SimplePrincipalCollection(user, realmName);
/* */
/* 53 */ subject.runAs((PrincipalCollection)simplePrincipalCollection); subject.runAs((PrincipalCollection)simplePrincipalCollection);
/* */ } }
/* */
/* */
/* */ public static Long getUserId() { public static Long getUserId() {
/* 58 */ return Long.valueOf(getSysUser().getUserId().longValue()); return Long.valueOf(getSysUser().getUserId().longValue());
/* */ } }
/* */
/* */
/* */ public static String getLoginName() { public static String getLoginName() {
/* 63 */ return getSysUser().getLoginName(); return getSysUser().getLoginName();
/* */ } }
/* */
/* */
/* */ public static String getIp() { public static String getIp() {
/* 68 */ return getSubject().getSession().getHost(); return getSubject().getSession().getHost();
/* */ } }
/* */
/* */
/* */ public static String getSessionId() { public static String getSessionId() {
/* 73 */ return String.valueOf(getSubject().getSession().getId()); return String.valueOf(getSubject().getSession().getId());
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\security\ShiroUtils.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\security\ShiroUtils.class

@ -1,149 +1,149 @@
/* */ package com.archive.common.utils.spring; package com.archive.common.utils.spring;
/* */
/* */ import com.archive.common.utils.StringUtils; import com.archive.common.utils.StringUtils;
/* */ import org.springframework.aop.framework.AopContext; import org.springframework.aop.framework.AopContext;
/* */ import org.springframework.beans.BeansException; import org.springframework.beans.BeansException;
/* */ import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.NoSuchBeanDefinitionException;
/* */ import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
/* */ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
/* */ import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
/* */ import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationContextAware;
/* */ import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Component @Component
/* */ public final class SpringUtils public final class SpringUtils
/* */ implements BeanFactoryPostProcessor, ApplicationContextAware implements BeanFactoryPostProcessor, ApplicationContextAware
/* */ { {
/* */ private static ConfigurableListableBeanFactory beanFactory; private static ConfigurableListableBeanFactory beanFactory;
/* */ private static ApplicationContext applicationContext; private static ApplicationContext applicationContext;
/* */
/* */ public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
/* 29 */ com.archive.common.utils.spring.SpringUtils.beanFactory = beanFactory; com.archive.common.utils.spring.SpringUtils.beanFactory = beanFactory;
/* */ } }
/* */
/* */
/* */
/* */ public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
/* 35 */ com.archive.common.utils.spring.SpringUtils.applicationContext = applicationContext; com.archive.common.utils.spring.SpringUtils.applicationContext = applicationContext;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static <T> T getBean(String name) throws BeansException { public static <T> T getBean(String name) throws BeansException {
/* 49 */ return (T)beanFactory.getBean(name); return (T)beanFactory.getBean(name);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static <T> T getBean(Class<T> clz) throws BeansException { public static <T> T getBean(Class<T> clz) throws BeansException {
/* 62 */ T result = (T)beanFactory.getBean(clz); T result = (T)beanFactory.getBean(clz);
/* 63 */ return result; return result;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean containsBean(String name) { public static boolean containsBean(String name) {
/* 74 */ return beanFactory.containsBean(name); return beanFactory.containsBean(name);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException { public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
/* 87 */ return beanFactory.isSingleton(name); return beanFactory.isSingleton(name);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static Class<?> getType(String name) throws NoSuchBeanDefinitionException { public static Class<?> getType(String name) throws NoSuchBeanDefinitionException {
/* 98 */ return beanFactory.getType(name); return beanFactory.getType(name);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String[] getAliases(String name) throws NoSuchBeanDefinitionException { public static String[] getAliases(String name) throws NoSuchBeanDefinitionException {
/* 111 */ return beanFactory.getAliases(name); return beanFactory.getAliases(name);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static <T> T getAopProxy(T invoker) { public static <T> T getAopProxy(T invoker) {
/* 123 */ return (T)AopContext.currentProxy(); return (T)AopContext.currentProxy();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String[] getActiveProfiles() { public static String[] getActiveProfiles() {
/* 133 */ return applicationContext.getEnvironment().getActiveProfiles(); return applicationContext.getEnvironment().getActiveProfiles();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String getActiveProfile() { public static String getActiveProfile() {
/* 143 */ String[] activeProfiles = getActiveProfiles(); String[] activeProfiles = getActiveProfiles();
/* 144 */ return StringUtils.isNotEmpty((Object[])activeProfiles) ? activeProfiles[0] : null; return StringUtils.isNotEmpty((Object[])activeProfiles) ? activeProfiles[0] : null;
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\spring\SpringUtils.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\spring\SpringUtils.class

@ -1,40 +1,40 @@
/* */ package com.archive.common.utils.sql; package com.archive.common.utils.sql;
/* */
/* */ import com.archive.common.exception.base.BaseException; import com.archive.common.exception.base.BaseException;
/* */ import com.archive.common.utils.StringUtils; import com.archive.common.utils.StringUtils;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class SqlUtil public class SqlUtil
/* */ { {
/* 16 */ public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,\\.]+"; public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,\\.]+";
/* */
/* */
/* */
/* */
/* */
/* */ public static String escapeOrderBySql(String value) { public static String escapeOrderBySql(String value) {
/* 23 */ if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value)) if (StringUtils.isNotEmpty(value) && !isValidOrderBySql(value))
/* */ { {
/* 25 */ throw new BaseException("参数不符合规范,不能进行查询"); throw new BaseException("参数不符合规范,不能进行查询");
/* */ } }
/* 27 */ return value; return value;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean isValidOrderBySql(String value) { public static boolean isValidOrderBySql(String value) {
/* 35 */ return value.matches(SQL_PATTERN); return value.matches(SQL_PATTERN);
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\sql\SqlUtil.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\sql\SqlUtil.class

@ -1,63 +1,63 @@
/* */ package com.archive.framework.config package com.archive.framework.config
; ;
/* */
/* */ import com.archive.framework.config.ArchiveConfig; import com.archive.framework.config.ArchiveConfig;
/* */ import com.archive.framework.interceptor.RepeatSubmitInterceptor; import com.archive.framework.interceptor.RepeatSubmitInterceptor;
/* */ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
/* */ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
/* */ import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerInterceptor;
/* */ import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
/* */ import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
/* */ import org.springframework.web.servlet.config.annotation.ViewControllerRegistry; import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
/* */ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Configuration @Configuration
/* */ public class ResourcesConfig public class ResourcesConfig
/* */ implements WebMvcConfigurer implements WebMvcConfigurer
/* */ { {
/* */ @Value("${shiro.user.indexUrl}") @Value("${shiro.user.indexUrl}")
/* */ private String indexUrl; private String indexUrl;
/* */ @Autowired @Autowired
/* */ private RepeatSubmitInterceptor repeatSubmitInterceptor; private RepeatSubmitInterceptor repeatSubmitInterceptor;
/* */
/* */ public void addViewControllers(ViewControllerRegistry registry) { public void addViewControllers(ViewControllerRegistry registry) {
/* 36 */ registry.addViewController("/").setViewName("forward:" + this.indexUrl); registry.addViewController("/").setViewName("forward:" + this.indexUrl);
/* */ } }
/* */
/* */
/* */
/* */
/* */ public void addResourceHandlers(ResourceHandlerRegistry registry) { public void addResourceHandlers(ResourceHandlerRegistry registry) {
/* 43 */ registry.addResourceHandler(new String[] { "/profile/**" }).addResourceLocations(new String[] { "file:" + ArchiveConfig.getInstance().getProfile() + "/" }); registry.addResourceHandler(new String[] { "/profile/**" }).addResourceLocations(new String[] { "file:" + ArchiveConfig.getInstance().getProfile() + "/" });
/* */
/* */
/* 46 */ registry.addResourceHandler(new String[] { "swagger-ui.html" }).addResourceLocations(new String[] { "classpath:/META-INF/resources/" }); registry.addResourceHandler(new String[] { "swagger-ui.html" }).addResourceLocations(new String[] { "classpath:/META-INF/resources/" });
/* 47 */ registry.addResourceHandler(new String[] { "/webjars/**" }).addResourceLocations(new String[] { "classpath:/META-INF/resources/webjars/" }); registry.addResourceHandler(new String[] { "/webjars/**" }).addResourceLocations(new String[] { "classpath:/META-INF/resources/webjars/" });
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void addInterceptors(InterceptorRegistry registry) { public void addInterceptors(InterceptorRegistry registry) {
/* 56 */ registry.addInterceptor((HandlerInterceptor)this.repeatSubmitInterceptor).addPathPatterns(new String[] { "/**" }); registry.addInterceptor((HandlerInterceptor)this.repeatSubmitInterceptor).addPathPatterns(new String[] { "/**" });
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\config\ResourcesConfig.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\config\ResourcesConfig.class

@ -1,38 +1,38 @@
/* */ package com.archive.framework.config package com.archive.framework.config
; ;
/* */
/* */ import com.archive.common.utils.ServletUtils; import com.archive.common.utils.ServletUtils;
/* */ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
/* */ import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Component @Component
/* */ public class ServerConfig public class ServerConfig
/* */ { {
/* */ public String getUrl() { public String getUrl() {
/* 23 */ HttpServletRequest request = ServletUtils.getRequest(); HttpServletRequest request = ServletUtils.getRequest();
/* 24 */ return getDomain(request); return getDomain(request);
/* */ } }
/* */
/* */
/* */ public static String getDomain(HttpServletRequest request) { public static String getDomain(HttpServletRequest request) {
/* 29 */ StringBuffer url = request.getRequestURL(); StringBuffer url = request.getRequestURL();
/* 30 */ String contextPath = request.getServletContext().getContextPath(); String contextPath = request.getServletContext().getContextPath();
/* 31 */ return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString(); return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString();
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\config\ServerConfig.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\config\ServerConfig.class

@ -1,381 +1,381 @@
/* */ package com.archive.framework.config package com.archive.framework.config
; ;
/* */
/* */ import at.pollux.thymeleaf.shiro.dialect.ShiroDialect; import at.pollux.thymeleaf.shiro.dialect.ShiroDialect;
/* */ import com.archive.common.utils.StringUtils; import com.archive.common.utils.StringUtils;
/* */ import com.archive.common.utils.spring.SpringUtils; import com.archive.common.utils.spring.SpringUtils;
/* */ import com.archive.framework.shiro.realm.UserRealm; import com.archive.framework.shiro.realm.UserRealm;
/* */ import com.archive.framework.shiro.session.OnlineSessionDAO; import com.archive.framework.shiro.session.OnlineSessionDAO;
/* */ import com.archive.framework.shiro.session.OnlineSessionFactory; import com.archive.framework.shiro.session.OnlineSessionFactory;
/* */ import com.archive.framework.shiro.web.filter.LogoutFilter; import com.archive.framework.shiro.web.filter.LogoutFilter;
/* */ import com.archive.framework.shiro.web.filter.captcha.CaptchaValidateFilter; import com.archive.framework.shiro.web.filter.captcha.CaptchaValidateFilter;
/* */ import com.archive.framework.shiro.web.filter.kickout.KickoutSessionFilter; import com.archive.framework.shiro.web.filter.kickout.KickoutSessionFilter;
/* */ import com.archive.framework.shiro.web.filter.online.OnlineSessionFilter; import com.archive.framework.shiro.web.filter.online.OnlineSessionFilter;
/* */ import com.archive.framework.shiro.web.filter.sync.SyncOnlineSessionFilter; import com.archive.framework.shiro.web.filter.sync.SyncOnlineSessionFilter;
/* */ import com.archive.framework.shiro.web.session.OnlineWebSessionManager; import com.archive.framework.shiro.web.session.OnlineWebSessionManager;
/* */ import com.archive.framework.shiro.web.session.SpringSessionValidationScheduler; import com.archive.framework.shiro.web.session.SpringSessionValidationScheduler;
/* */ import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
/* */ import java.io.IOException; import java.io.IOException;
/* */ import java.io.InputStream; import java.io.InputStream;
/* */ import java.util.LinkedHashMap; import java.util.LinkedHashMap;
/* */ import java.util.Map; import java.util.Map;
/* */ import javax.servlet.Filter; import javax.servlet.Filter;
/* */ import net.sf.ehcache.CacheManager; import net.sf.ehcache.CacheManager;
/* */ import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
/* */
/* */ import org.apache.shiro.cache.ehcache.EhCacheManager; import org.apache.shiro.cache.ehcache.EhCacheManager;
/* */ import org.apache.shiro.codec.Base64; import org.apache.shiro.codec.Base64;
/* */ import org.apache.shiro.config.ConfigurationException; import org.apache.shiro.config.ConfigurationException;
/* */ import org.apache.shiro.io.ResourceUtils; import org.apache.shiro.io.ResourceUtils;
/* */ import org.apache.shiro.mgt.RememberMeManager; import org.apache.shiro.mgt.RememberMeManager;
/* */ import org.apache.shiro.mgt.SecurityManager; import org.apache.shiro.mgt.SecurityManager;
/* */ import org.apache.shiro.realm.Realm; import org.apache.shiro.realm.Realm;
/* */ import org.apache.shiro.session.mgt.SessionFactory; import org.apache.shiro.session.mgt.SessionFactory;
/* */ import org.apache.shiro.session.mgt.SessionManager; import org.apache.shiro.session.mgt.SessionManager;
/* */ import org.apache.shiro.session.mgt.SessionValidationScheduler; import org.apache.shiro.session.mgt.SessionValidationScheduler;
/* */ import org.apache.shiro.session.mgt.eis.SessionDAO; import org.apache.shiro.session.mgt.eis.SessionDAO;
/* */ import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor; import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor;
/* */ import org.apache.shiro.spring.web.ShiroFilterFactoryBean; import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
/* */ import org.apache.shiro.web.mgt.CookieRememberMeManager; import org.apache.shiro.web.mgt.CookieRememberMeManager;
/* */ import org.apache.shiro.web.mgt.DefaultWebSecurityManager; import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
/* */ import org.apache.shiro.web.servlet.Cookie; import org.apache.shiro.web.servlet.Cookie;
/* */ import org.apache.shiro.web.servlet.SimpleCookie; import org.apache.shiro.web.servlet.SimpleCookie;
/* */ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
/* */ import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
/* */ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
/* */ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Configuration @Configuration
/* */ public class ShiroConfig public class ShiroConfig
/* */ { {
/* */ @Value("${shiro.session.expireTime}") @Value("${shiro.session.expireTime}")
/* */ private int expireTime; private int expireTime;
/* */ @Value("${shiro.session.validationInterval}") @Value("${shiro.session.validationInterval}")
/* */ private int validationInterval; private int validationInterval;
/* */ @Value("${shiro.session.maxSession}") @Value("${shiro.session.maxSession}")
/* */ private int maxSession; private int maxSession;
/* */ @Value("${shiro.session.kickoutAfter}") @Value("${shiro.session.kickoutAfter}")
/* */ private boolean kickoutAfter; private boolean kickoutAfter;
/* */ @Value("${shiro.user.captchaEnabled}") @Value("${shiro.user.captchaEnabled}")
/* */ private boolean captchaEnabled; private boolean captchaEnabled;
/* */ @Value("${shiro.user.captchaType}") @Value("${shiro.user.captchaType}")
/* */ private String captchaType; private String captchaType;
/* */ @Value("${shiro.cookie.domain}") @Value("${shiro.cookie.domain}")
/* */ private String domain; private String domain;
/* */ @Value("${shiro.cookie.path}") @Value("${shiro.cookie.path}")
/* */ private String path; private String path;
/* */ @Value("${shiro.cookie.httpOnly}") @Value("${shiro.cookie.httpOnly}")
/* */ private boolean httpOnly; private boolean httpOnly;
/* */ @Value("${shiro.cookie.maxAge}") @Value("${shiro.cookie.maxAge}")
/* */ private int maxAge; private int maxAge;
/* */ @Value("${shiro.cookie.cipherKey}") @Value("${shiro.cookie.cipherKey}")
/* */ private String cipherKey; private String cipherKey;
/* */ @Value("${shiro.user.loginUrl}") @Value("${shiro.user.loginUrl}")
/* */ private String loginUrl; private String loginUrl;
/* */ @Value("${shiro.user.unauthorizedUrl}") @Value("${shiro.user.unauthorizedUrl}")
/* */ private String unauthorizedUrl; private String unauthorizedUrl;
/* */
/* */ @Bean @Bean
/* */ public EhCacheManager getEhCacheManager() { public EhCacheManager getEhCacheManager() {
/* 105 */ CacheManager cacheManager = CacheManager.getCacheManager("archive"); CacheManager cacheManager = CacheManager.getCacheManager("archive");
/* 106 */ EhCacheManager em = new EhCacheManager(); EhCacheManager em = new EhCacheManager();
/* 107 */ if (StringUtils.isNull(cacheManager)) { if (StringUtils.isNull(cacheManager)) {
/* */
/* 109 */ em.setCacheManager(new CacheManager(getCacheManagerConfigFileInputStream())); em.setCacheManager(new CacheManager(getCacheManagerConfigFileInputStream()));
/* 110 */ return em; return em;
/* */ } }
/* */
/* */
/* 114 */ em.setCacheManager(cacheManager); em.setCacheManager(cacheManager);
/* 115 */ return em; return em;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ protected InputStream getCacheManagerConfigFileInputStream() { protected InputStream getCacheManagerConfigFileInputStream() {
/* 124 */ String configFile = "classpath:ehcache/ehcache-shiro.xml"; String configFile = "classpath:ehcache/ehcache-shiro.xml";
/* 125 */ InputStream inputStream = null; InputStream inputStream = null;
/* */
/* */ try { try {
/* 128 */ inputStream = ResourceUtils.getInputStreamForPath(configFile); inputStream = ResourceUtils.getInputStreamForPath(configFile);
/* 129 */ byte[] b = IOUtils.toByteArray(inputStream); byte[] b = IOUtils.toByteArray(inputStream);
/* 130 */ InputStream in = new ByteArrayInputStream(b); InputStream in = new ByteArrayInputStream(b);
/* 131 */ return in; return in;
/* */ } }
/* 133 */ catch (IOException e) { catch (IOException e) {
/* */
/* 135 */ throw new ConfigurationException("Unable to obtain input stream for cacheManagerConfigFile [" + configFile + "]", e); throw new ConfigurationException("Unable to obtain input stream for cacheManagerConfigFile [" + configFile + "]", e);
/* */
/* */ } }
/* */ finally { finally {
/* */
/* 140 */ IOUtils.closeQuietly(inputStream); IOUtils.closeQuietly(inputStream);
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @Bean @Bean
/* */ public UserRealm userRealm(EhCacheManager cacheManager) { public UserRealm userRealm(EhCacheManager cacheManager) {
/* 150 */ UserRealm userRealm = new UserRealm(); UserRealm userRealm = new UserRealm();
/* 151 */ userRealm.setAuthorizationCacheName("sys-authCache"); userRealm.setAuthorizationCacheName("sys-authCache");
/* 152 */ userRealm.setCacheManager(cacheManager); userRealm.setCacheManager(cacheManager);
/* 153 */ return userRealm; return userRealm;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @Bean @Bean
/* */ public OnlineSessionDAO sessionDAO() { public OnlineSessionDAO sessionDAO() {
/* 162 */ OnlineSessionDAO sessionDAO = new OnlineSessionDAO(); OnlineSessionDAO sessionDAO = new OnlineSessionDAO();
/* 163 */ return sessionDAO; return sessionDAO;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @Bean @Bean
/* */ public OnlineSessionFactory sessionFactory() { public OnlineSessionFactory sessionFactory() {
/* 172 */ OnlineSessionFactory sessionFactory = new OnlineSessionFactory(); OnlineSessionFactory sessionFactory = new OnlineSessionFactory();
/* 173 */ return sessionFactory; return sessionFactory;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @Bean @Bean
/* */ public OnlineWebSessionManager sessionManager() { public OnlineWebSessionManager sessionManager() {
/* 182 */ OnlineWebSessionManager manager = new OnlineWebSessionManager(); OnlineWebSessionManager manager = new OnlineWebSessionManager();
/* */
/* 184 */ manager.setCacheManager(getEhCacheManager()); manager.setCacheManager(getEhCacheManager());
/* */
/* 186 */ manager.setDeleteInvalidSessions(true); manager.setDeleteInvalidSessions(true);
/* */
/* 188 */ manager.setGlobalSessionTimeout((this.expireTime * 60 * 1000)); manager.setGlobalSessionTimeout((this.expireTime * 60 * 1000));
/* */
/* 190 */ manager.setSessionIdUrlRewritingEnabled(false); manager.setSessionIdUrlRewritingEnabled(false);
/* */
/* 192 */ manager.setSessionValidationScheduler((SessionValidationScheduler)SpringUtils.getBean(SpringSessionValidationScheduler.class)); manager.setSessionValidationScheduler((SessionValidationScheduler)SpringUtils.getBean(SpringSessionValidationScheduler.class));
/* */
/* 194 */ manager.setSessionValidationSchedulerEnabled(true); manager.setSessionValidationSchedulerEnabled(true);
/* */
/* 196 */ manager.setSessionDAO((SessionDAO)sessionDAO()); manager.setSessionDAO((SessionDAO)sessionDAO());
/* */
/* 198 */ manager.setSessionFactory((SessionFactory)sessionFactory()); manager.setSessionFactory((SessionFactory)sessionFactory());
/* 199 */ return manager; return manager;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @Bean @Bean
/* */ public SecurityManager securityManager(UserRealm userRealm) { public SecurityManager securityManager(UserRealm userRealm) {
/* 208 */ DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(); DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
/* */
/* 210 */ securityManager.setRealm((Realm)userRealm); securityManager.setRealm((Realm)userRealm);
/* */
/* 212 */ securityManager.setRememberMeManager((RememberMeManager)rememberMeManager()); securityManager.setRememberMeManager((RememberMeManager)rememberMeManager());
/* */
/* 214 */ securityManager.setCacheManager(getEhCacheManager()); securityManager.setCacheManager(getEhCacheManager());
/* */
/* 216 */ securityManager.setSessionManager((SessionManager)sessionManager()); securityManager.setSessionManager((SessionManager)sessionManager());
/* 217 */ return (SecurityManager)securityManager; return (SecurityManager)securityManager;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public LogoutFilter logoutFilter() { public LogoutFilter logoutFilter() {
/* 225 */ LogoutFilter logoutFilter = new LogoutFilter(); LogoutFilter logoutFilter = new LogoutFilter();
/* 226 */ logoutFilter.setLoginUrl(this.loginUrl); logoutFilter.setLoginUrl(this.loginUrl);
/* 227 */ return logoutFilter; return logoutFilter;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @Bean @Bean
/* */ public ShiroFilterFactoryBean shiroFilterFactoryBean(SecurityManager securityManager) { public ShiroFilterFactoryBean shiroFilterFactoryBean(SecurityManager securityManager) {
/* 236 */ ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean(); ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
/* */
/* 238 */ shiroFilterFactoryBean.setSecurityManager(securityManager); shiroFilterFactoryBean.setSecurityManager(securityManager);
/* */
/* 240 */ shiroFilterFactoryBean.setLoginUrl(this.loginUrl); shiroFilterFactoryBean.setLoginUrl(this.loginUrl);
/* */
/* 242 */ shiroFilterFactoryBean.setUnauthorizedUrl(this.unauthorizedUrl); shiroFilterFactoryBean.setUnauthorizedUrl(this.unauthorizedUrl);
/* */
/* 244 */ LinkedHashMap<String, String> filterChainDefinitionMap = new LinkedHashMap<>(); LinkedHashMap<String, String> filterChainDefinitionMap = new LinkedHashMap<>();
/* */
/* 246 */ filterChainDefinitionMap.put("/favicon.ico**", "anon"); filterChainDefinitionMap.put("/favicon.ico**", "anon");
/* 247 */ filterChainDefinitionMap.put("/archive.png**", "anon"); filterChainDefinitionMap.put("/archive.png**", "anon");
/* 248 */ filterChainDefinitionMap.put("/css/**", "anon"); filterChainDefinitionMap.put("/css/**", "anon");
/* 249 */ filterChainDefinitionMap.put("/docs/**", "anon"); filterChainDefinitionMap.put("/docs/**", "anon");
/* 250 */ filterChainDefinitionMap.put("/fonts/**", "anon"); filterChainDefinitionMap.put("/fonts/**", "anon");
/* 251 */ filterChainDefinitionMap.put("/img/**", "anon"); filterChainDefinitionMap.put("/img/**", "anon");
/* 252 */ filterChainDefinitionMap.put("/ajax/**", "anon"); filterChainDefinitionMap.put("/ajax/**", "anon");
/* 253 */ filterChainDefinitionMap.put("/plugins/**", "anon"); filterChainDefinitionMap.put("/plugins/**", "anon");
/* 254 */ filterChainDefinitionMap.put("/js/**", "anon"); filterChainDefinitionMap.put("/js/**", "anon");
/* 255 */ filterChainDefinitionMap.put("/archive/**", "anon"); filterChainDefinitionMap.put("/archive/**", "anon");
/* 256 */ filterChainDefinitionMap.put("/captcha/captchaImage**", "anon"); filterChainDefinitionMap.put("/captcha/captchaImage**", "anon");
/* */
/* 258 */ filterChainDefinitionMap.put("/logout", "logout"); filterChainDefinitionMap.put("/logout", "logout");
/* */
/* 260 */ filterChainDefinitionMap.put("/login", "anon,captchaValidate"); filterChainDefinitionMap.put("/login", "anon,captchaValidate");
/* 261 */ filterChainDefinitionMap.put("/browse/browseDocument", "anon,captchaValidate"); filterChainDefinitionMap.put("/browse/browseDocument", "anon,captchaValidate");
/* */
/* 263 */ filterChainDefinitionMap.put("/register", "anon,captchaValidate"); filterChainDefinitionMap.put("/register", "anon,captchaValidate");
/* */
/* */
/* */
/* 267 */ Map<String, Filter> filters = new LinkedHashMap<>(); Map<String, Filter> filters = new LinkedHashMap<>();
/* 268 */ filters.put("onlineSession", onlineSessionFilter()); filters.put("onlineSession", onlineSessionFilter());
/* 269 */ filters.put("syncOnlineSession", syncOnlineSessionFilter()); filters.put("syncOnlineSession", syncOnlineSessionFilter());
/* 270 */ filters.put("captchaValidate", captchaValidateFilter()); filters.put("captchaValidate", captchaValidateFilter());
/* 271 */ filters.put("kickout", kickoutSessionFilter()); filters.put("kickout", kickoutSessionFilter());
/* */
/* 273 */ filters.put("logout", logoutFilter()); filters.put("logout", logoutFilter());
/* 274 */ shiroFilterFactoryBean.setFilters(filters); shiroFilterFactoryBean.setFilters(filters);
/* */
/* */
/* 277 */ filterChainDefinitionMap.put("/**", "user,kickout,onlineSession,syncOnlineSession"); filterChainDefinitionMap.put("/**", "user,kickout,onlineSession,syncOnlineSession");
/* 278 */ shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap); shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap);
/* */
/* 280 */ return shiroFilterFactoryBean; return shiroFilterFactoryBean;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public OnlineSessionFilter onlineSessionFilter() { public OnlineSessionFilter onlineSessionFilter() {
/* 288 */ OnlineSessionFilter onlineSessionFilter = new OnlineSessionFilter(); OnlineSessionFilter onlineSessionFilter = new OnlineSessionFilter();
/* 289 */ onlineSessionFilter.setLoginUrl(this.loginUrl); onlineSessionFilter.setLoginUrl(this.loginUrl);
/* 290 */ onlineSessionFilter.setOnlineSessionDAO(sessionDAO()); onlineSessionFilter.setOnlineSessionDAO(sessionDAO());
/* 291 */ return onlineSessionFilter; return onlineSessionFilter;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public SyncOnlineSessionFilter syncOnlineSessionFilter() { public SyncOnlineSessionFilter syncOnlineSessionFilter() {
/* 299 */ SyncOnlineSessionFilter syncOnlineSessionFilter = new SyncOnlineSessionFilter(); SyncOnlineSessionFilter syncOnlineSessionFilter = new SyncOnlineSessionFilter();
/* 300 */ syncOnlineSessionFilter.setOnlineSessionDAO(sessionDAO()); syncOnlineSessionFilter.setOnlineSessionDAO(sessionDAO());
/* 301 */ return syncOnlineSessionFilter; return syncOnlineSessionFilter;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public CaptchaValidateFilter captchaValidateFilter() { public CaptchaValidateFilter captchaValidateFilter() {
/* 309 */ CaptchaValidateFilter captchaValidateFilter = new CaptchaValidateFilter(); CaptchaValidateFilter captchaValidateFilter = new CaptchaValidateFilter();
/* 310 */ captchaValidateFilter.setCaptchaEnabled(this.captchaEnabled); captchaValidateFilter.setCaptchaEnabled(this.captchaEnabled);
/* 311 */ captchaValidateFilter.setCaptchaType(this.captchaType); captchaValidateFilter.setCaptchaType(this.captchaType);
/* 312 */ return captchaValidateFilter; return captchaValidateFilter;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public SimpleCookie rememberMeCookie() { public SimpleCookie rememberMeCookie() {
/* 320 */ SimpleCookie cookie = new SimpleCookie("rememberMe"); SimpleCookie cookie = new SimpleCookie("rememberMe");
/* 321 */ cookie.setDomain(this.domain); cookie.setDomain(this.domain);
/* 322 */ cookie.setPath(this.path); cookie.setPath(this.path);
/* 323 */ cookie.setHttpOnly(this.httpOnly); cookie.setHttpOnly(this.httpOnly);
/* 324 */ cookie.setMaxAge(this.maxAge * 24 * 60 * 60); cookie.setMaxAge(this.maxAge * 24 * 60 * 60);
/* 325 */ return cookie; return cookie;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public CookieRememberMeManager rememberMeManager() { public CookieRememberMeManager rememberMeManager() {
/* 333 */ CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager();
/* 334 */ cookieRememberMeManager.setCookie((Cookie)rememberMeCookie()); cookieRememberMeManager.setCookie((Cookie)rememberMeCookie());
/* 335 */ cookieRememberMeManager.setCipherKey(Base64.decode(this.cipherKey)); cookieRememberMeManager.setCipherKey(Base64.decode(this.cipherKey));
/* 336 */ return cookieRememberMeManager; return cookieRememberMeManager;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public KickoutSessionFilter kickoutSessionFilter() { public KickoutSessionFilter kickoutSessionFilter() {
/* 344 */ KickoutSessionFilter kickoutSessionFilter = new KickoutSessionFilter(); KickoutSessionFilter kickoutSessionFilter = new KickoutSessionFilter();
/* 345 */ kickoutSessionFilter.setCacheManager(getEhCacheManager()); kickoutSessionFilter.setCacheManager(getEhCacheManager());
/* 346 */ kickoutSessionFilter.setSessionManager((SessionManager)sessionManager()); kickoutSessionFilter.setSessionManager((SessionManager)sessionManager());
/* */
/* 348 */ kickoutSessionFilter.setMaxSession(this.maxSession); kickoutSessionFilter.setMaxSession(this.maxSession);
/* */
/* 350 */ kickoutSessionFilter.setKickoutAfter(this.kickoutAfter); kickoutSessionFilter.setKickoutAfter(this.kickoutAfter);
/* */
/* 352 */ kickoutSessionFilter.setKickoutUrl("/login?kickout=1"); kickoutSessionFilter.setKickoutUrl("/login?kickout=1");
/* 353 */ return kickoutSessionFilter; return kickoutSessionFilter;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @Bean @Bean
/* */ public ShiroDialect shiroDialect() { public ShiroDialect shiroDialect() {
/* 362 */ return new ShiroDialect(); return new ShiroDialect();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Bean @Bean
/* */ public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(@Qualifier("securityManager") SecurityManager securityManager) { public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(@Qualifier("securityManager") SecurityManager securityManager) {
/* 372 */ AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor = new AuthorizationAttributeSourceAdvisor(); AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor = new AuthorizationAttributeSourceAdvisor();
/* 373 */ authorizationAttributeSourceAdvisor.setSecurityManager(securityManager); authorizationAttributeSourceAdvisor.setSecurityManager(securityManager);
/* 374 */ return authorizationAttributeSourceAdvisor; return authorizationAttributeSourceAdvisor;
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\config\ShiroConfig.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\config\ShiroConfig.class

@ -1,52 +1,52 @@
/* */ package com.archive.framework.interceptor package com.archive.framework.interceptor
; ;
/* */
/* */ import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
/* */ import com.archive.common.utils.ServletUtils; import com.archive.common.utils.ServletUtils;
/* */ import com.archive.framework.interceptor.annotation.RepeatSubmit; import com.archive.framework.interceptor.annotation.RepeatSubmit;
/* */ import com.archive.framework.web.domain.AjaxResult; import com.archive.framework.web.domain.AjaxResult;
/* */ import java.lang.reflect.Method; import java.lang.reflect.Method;
/* */ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
/* */ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
/* */ import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/* */ import org.springframework.web.method.HandlerMethod; import org.springframework.web.method.HandlerMethod;
/* */ import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Component @Component
/* */ public abstract class RepeatSubmitInterceptor public abstract class RepeatSubmitInterceptor
/* */ extends HandlerInterceptorAdapter extends HandlerInterceptorAdapter
/* */ { {
/* */ public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
/* 25 */ if (handler instanceof HandlerMethod) { if (handler instanceof HandlerMethod) {
/* */
/* 27 */ HandlerMethod handlerMethod = (HandlerMethod)handler; HandlerMethod handlerMethod = (HandlerMethod)handler;
/* 28 */ Method method = handlerMethod.getMethod(); Method method = handlerMethod.getMethod();
/* 29 */ RepeatSubmit annotation = method.<RepeatSubmit>getAnnotation(RepeatSubmit.class); RepeatSubmit annotation = method.<RepeatSubmit>getAnnotation(RepeatSubmit.class);
/* 30 */ if (annotation != null) if (annotation != null)
/* */ { {
/* 32 */ if (isRepeatSubmit(request)) { if (isRepeatSubmit(request)) {
/* */
/* 34 */ AjaxResult ajaxResult = AjaxResult.error("不允许重复提交,请稍后再试"); AjaxResult ajaxResult = AjaxResult.error("不允许重复提交,请稍后再试");
/* 35 */ ServletUtils.renderString(response, JSONObject.toJSONString(ajaxResult)); ServletUtils.renderString(response, JSONObject.toJSONString(ajaxResult));
/* 36 */ return false; return false;
/* */ } }
/* */ } }
/* 39 */ return true; return true;
/* */ } }
/* */
/* */
/* 43 */ return super.preHandle(request, response, handler); return super.preHandle(request, response, handler);
/* */ } }
/* */
/* */ public abstract boolean isRepeatSubmit(HttpServletRequest paramHttpServletRequest); public abstract boolean isRepeatSubmit(HttpServletRequest paramHttpServletRequest);
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\interceptor\RepeatSubmitInterceptor.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\interceptor\RepeatSubmitInterceptor.class

@ -1,99 +1,99 @@
/* */ package com.archive.framework.interceptor.impl package com.archive.framework.interceptor.impl
; ;
/* */
/* */ import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
/* */ import com.archive.framework.interceptor.RepeatSubmitInterceptor; import com.archive.framework.interceptor.RepeatSubmitInterceptor;
/* */ import java.util.HashMap; import java.util.HashMap;
/* */ import java.util.Map; import java.util.Map;
/* */ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
/* */ import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
/* */ import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Component @Component
/* */ public class SameUrlDataInterceptor public class SameUrlDataInterceptor
/* */ extends RepeatSubmitInterceptor extends RepeatSubmitInterceptor
/* */ { {
/* 20 */ public final String REPEAT_PARAMS = "repeatParams"; public final String REPEAT_PARAMS = "repeatParams";
/* */
/* 22 */ public final String REPEAT_TIME = "repeatTime"; public final String REPEAT_TIME = "repeatTime";
/* */
/* 24 */ public final String SESSION_REPEAT_KEY = "repeatData"; public final String SESSION_REPEAT_KEY = "repeatData";
/* */
/* */
/* */
/* */
/* */
/* */
/* 31 */ private int intervalTime = 10; private int intervalTime = 10;
/* */
/* */
/* */ public void setIntervalTime(int intervalTime) { public void setIntervalTime(int intervalTime) {
/* 35 */ this.intervalTime = intervalTime; this.intervalTime = intervalTime;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public boolean isRepeatSubmit(HttpServletRequest request) { public boolean isRepeatSubmit(HttpServletRequest request) {
/* 43 */ String nowParams = JSONObject.toJSONString(request.getParameterMap()); String nowParams = JSONObject.toJSONString(request.getParameterMap());
/* 44 */ Map<String, Object> nowDataMap = new HashMap<>(); Map<String, Object> nowDataMap = new HashMap<>();
/* 45 */ nowDataMap.put("repeatParams", nowParams); nowDataMap.put("repeatParams", nowParams);
/* 46 */ nowDataMap.put("repeatTime", Long.valueOf(System.currentTimeMillis())); nowDataMap.put("repeatTime", Long.valueOf(System.currentTimeMillis()));
/* */
/* */
/* 49 */ String url = request.getRequestURI(); String url = request.getRequestURI();
/* */
/* 51 */ HttpSession session = request.getSession(); HttpSession session = request.getSession();
/* 52 */ Object sessionObj = session.getAttribute("repeatData"); Object sessionObj = session.getAttribute("repeatData");
/* 53 */ if (sessionObj != null) { if (sessionObj != null) {
/* */
/* 55 */ Map<String, Object> map = (Map<String, Object>)sessionObj; Map<String, Object> map = (Map<String, Object>)sessionObj;
/* 56 */ if (map.containsKey(url)) { if (map.containsKey(url)) {
/* */
/* 58 */ Map<String, Object> preDataMap = (Map<String, Object>)map.get(url); Map<String, Object> preDataMap = (Map<String, Object>)map.get(url);
/* 59 */ if (compareParams(nowDataMap, preDataMap) && compareTime(nowDataMap, preDataMap)) if (compareParams(nowDataMap, preDataMap) && compareTime(nowDataMap, preDataMap))
/* */ { {
/* 61 */ return true; return true;
/* */ } }
/* */ } }
/* */ } }
/* 65 */ Map<String, Object> sessionMap = new HashMap<>(); Map<String, Object> sessionMap = new HashMap<>();
/* 66 */ sessionMap.put(url, nowDataMap); sessionMap.put(url, nowDataMap);
/* 67 */ session.setAttribute("repeatData", sessionMap); session.setAttribute("repeatData", sessionMap);
/* 68 */ return false; return false;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ private boolean compareParams(Map<String, Object> nowMap, Map<String, Object> preMap) { private boolean compareParams(Map<String, Object> nowMap, Map<String, Object> preMap) {
/* 76 */ String nowParams = (String)nowMap.get("repeatParams"); String nowParams = (String)nowMap.get("repeatParams");
/* 77 */ String preParams = (String)preMap.get("repeatParams"); String preParams = (String)preMap.get("repeatParams");
/* 78 */ return nowParams.equals(preParams); return nowParams.equals(preParams);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ private boolean compareTime(Map<String, Object> nowMap, Map<String, Object> preMap) { private boolean compareTime(Map<String, Object> nowMap, Map<String, Object> preMap) {
/* 86 */ long time1 = ((Long)nowMap.get("repeatTime")).longValue(); long time1 = ((Long)nowMap.get("repeatTime")).longValue();
/* 87 */ long time2 = ((Long)preMap.get("repeatTime")).longValue(); long time2 = ((Long)preMap.get("repeatTime")).longValue();
/* 88 */ if (time1 - time2 < (this.intervalTime * 1000)) if (time1 - time2 < (this.intervalTime * 1000))
/* */ { {
/* 90 */ return true; return true;
/* */ } }
/* 92 */ return false; return false;
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\interceptor\impl\SameUrlDataInterceptor.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\interceptor\impl\SameUrlDataInterceptor.class

@ -1,90 +1,90 @@
/* */ package com.archive.framework.manager; package com.archive.framework.manager;
/* */
/* */ import com.archive.framework.manager.AsyncManager; import com.archive.framework.manager.AsyncManager;
/* */ import com.archive.framework.shiro.web.session.SpringSessionValidationScheduler; import com.archive.framework.shiro.web.session.SpringSessionValidationScheduler;
/* */ import javax.annotation.PreDestroy; import javax.annotation.PreDestroy;
/* */ import net.sf.ehcache.CacheManager; import net.sf.ehcache.CacheManager;
/* */ import org.apache.shiro.cache.ehcache.EhCacheManager; import org.apache.shiro.cache.ehcache.EhCacheManager;
/* */ import org.slf4j.Logger; import org.slf4j.Logger;
/* */ import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
/* */ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/* */
/* */
/* */
/* */
/* */
/* */ @Component @Component
/* */ public class ShutdownManager public class ShutdownManager
/* */ { {
/* 20 */ private static final Logger logger = LoggerFactory.getLogger("sys-user"); private static final Logger logger = LoggerFactory.getLogger("sys-user");
/* */
/* */ @Autowired(required = false) @Autowired(required = false)
/* */ private SpringSessionValidationScheduler springSessionValidationScheduler; private SpringSessionValidationScheduler springSessionValidationScheduler;
/* */
/* */ @Autowired(required = false) @Autowired(required = false)
/* */ private EhCacheManager ehCacheManager; private EhCacheManager ehCacheManager;
/* */
/* */
/* */ @PreDestroy @PreDestroy
/* */ public void destroy() { public void destroy() {
/* 31 */ shutdownSpringSessionValidationScheduler(); shutdownSpringSessionValidationScheduler();
/* 32 */ shutdownAsyncManager(); shutdownAsyncManager();
/* 33 */ shutdownEhCacheManager(); shutdownEhCacheManager();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ private void shutdownSpringSessionValidationScheduler() { private void shutdownSpringSessionValidationScheduler() {
/* 41 */ if (this.springSessionValidationScheduler != null && this.springSessionValidationScheduler.isEnabled()) { if (this.springSessionValidationScheduler != null && this.springSessionValidationScheduler.isEnabled()) {
/* */
/* */ try { try {
/* */
/* 45 */ logger.info("====关闭会话验证任务===="); logger.info("====关闭会话验证任务====");
/* 46 */ this.springSessionValidationScheduler.disableSessionValidation(); this.springSessionValidationScheduler.disableSessionValidation();
/* */ } }
/* 48 */ catch (Exception e) { catch (Exception e) {
/* */
/* 50 */ logger.error(e.getMessage(), e); logger.error(e.getMessage(), e);
/* */ } }
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ private void shutdownAsyncManager() { private void shutdownAsyncManager() {
/* */ try { try {
/* 62 */ logger.info("====关闭后台任务任务线程池===="); logger.info("====关闭后台任务任务线程池====");
/* 63 */ AsyncManager.me().shutdown(); AsyncManager.me().shutdown();
/* */ } }
/* 65 */ catch (Exception e) { catch (Exception e) {
/* */
/* 67 */ logger.error(e.getMessage(), e); logger.error(e.getMessage(), e);
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */ private void shutdownEhCacheManager() { private void shutdownEhCacheManager() {
/* */ try { try {
/* 75 */ logger.info("====关闭缓存===="); logger.info("====关闭缓存====");
/* 76 */ if (this.ehCacheManager != null) if (this.ehCacheManager != null)
/* */ { {
/* 78 */ CacheManager cacheManager = this.ehCacheManager.getCacheManager(); CacheManager cacheManager = this.ehCacheManager.getCacheManager();
/* 79 */ cacheManager.shutdown(); cacheManager.shutdown();
/* */ } }
/* */
/* 82 */ } catch (Exception e) { } catch (Exception e) {
/* */
/* 84 */ logger.error(e.getMessage(), e); logger.error(e.getMessage(), e);
/* */ } }
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\manager\ShutdownManager.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\manager\ShutdownManager.class

@ -1,82 +1,82 @@
/* */ package com.archive.framework.shiro.service package com.archive.framework.shiro.service
; ;
/* */
/* */ import com.archive.common.utils.DateUtils; import com.archive.common.utils.DateUtils;
/* */ import com.archive.common.utils.MessageUtils; import com.archive.common.utils.MessageUtils;
/* */ import com.archive.common.utils.ServletUtils; import com.archive.common.utils.ServletUtils;
/* */ import com.archive.framework.manager.AsyncManager; import com.archive.framework.manager.AsyncManager;
/* */ import com.archive.framework.manager.factory.AsyncFactory; import com.archive.framework.manager.factory.AsyncFactory;
/* */ import com.archive.project.system.user.domain.User; import com.archive.project.system.user.domain.User;
/* */ import com.archive.project.system.user.service.IUserService; import com.archive.project.system.user.service.IUserService;
/* */ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/* */ import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Component @Component
/* */ public class RegisterService public class RegisterService
/* */ { {
/* */ @Autowired @Autowired
/* */ private IUserService userService; private IUserService userService;
/* */
/* */ public String register(User user) { public String register(User user) {
/* 33 */ String msg = "", loginName = user.getLoginName(), password = user.getPassword(); String msg = "", loginName = user.getLoginName(), password = user.getPassword();
/* */
/* 35 */ if (!StringUtils.isEmpty(ServletUtils.getRequest().getAttribute("captcha"))) { if (!StringUtils.isEmpty(ServletUtils.getRequest().getAttribute("captcha"))) {
/* */
/* 37 */ msg = "验证码错误"; msg = "验证码错误";
/* */ } }
/* 39 */ else if (StringUtils.isEmpty(loginName)) { else if (StringUtils.isEmpty(loginName)) {
/* */
/* 41 */ msg = "用户名不能为空"; msg = "用户名不能为空";
/* */ } }
/* 43 */ else if (StringUtils.isEmpty(password)) { else if (StringUtils.isEmpty(password)) {
/* */
/* 45 */ msg = "用户密码不能为空"; msg = "用户密码不能为空";
/* */ } }
/* 47 */ else if (password.length() < 5 || password else if (password.length() < 5 || password
/* 48 */ .length() > 20) { .length() > 20) {
/* */
/* 50 */ msg = "密码长度必须在5到20个字符之间"; msg = "密码长度必须在5到20个字符之间";
/* */ } }
/* 52 */ else if (loginName.length() < 2 || loginName else if (loginName.length() < 2 || loginName
/* 53 */ .length() > 20) { .length() > 20) {
/* */
/* 55 */ msg = "账户长度必须在2到20个字符之间"; msg = "账户长度必须在2到20个字符之间";
/* */ } }
/* 57 */ else if ("1".equals(this.userService.checkLoginNameUnique(loginName))) { else if ("1".equals(this.userService.checkLoginNameUnique(loginName))) {
/* */
/* 59 */ msg = "保存用户'" + loginName + "'失败,注册账号已存在"; msg = "保存用户'" + loginName + "'失败,注册账号已存在";
/* */ } }
/* */ else { else {
/* */
/* 63 */ user.setPwdUpdateDate(DateUtils.getNowDate()); user.setPwdUpdateDate(DateUtils.getNowDate());
/* 64 */ user.setUserName(loginName); user.setUserName(loginName);
/* 65 */ boolean regFlag = this.userService.registerUser(user); boolean regFlag = this.userService.registerUser(user);
/* 66 */ if (!regFlag) { if (!regFlag) {
/* */
/* 68 */ msg = "注册失败,请联系系统管理人员"; msg = "注册失败,请联系系统管理人员";
/* */ } }
/* */ else { else {
/* */
/* 72 */ AsyncManager.me().execute(AsyncFactory.recordLogininfor(loginName, "Register", MessageUtils.message("user.register.success", new Object[0]), new Object[0])); AsyncManager.me().execute(AsyncFactory.recordLogininfor(loginName, "Register", MessageUtils.message("user.register.success", new Object[0]), new Object[0]));
/* */ } }
/* */ } }
/* 75 */ return msg; return msg;
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\shiro\service\RegisterService.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\shiro\service\RegisterService.class

@ -1,94 +1,94 @@
/* */ package com.archive.framework.shiro.web.session package com.archive.framework.shiro.web.session
; ;
/* */
/* */ import com.archive.common.utils.Threads; import com.archive.common.utils.Threads;
/* */ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledExecutorService;
/* */ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
/* */ import org.apache.shiro.session.mgt.SessionValidationScheduler; import org.apache.shiro.session.mgt.SessionValidationScheduler;
/* */ import org.apache.shiro.session.mgt.ValidatingSessionManager; import org.apache.shiro.session.mgt.ValidatingSessionManager;
/* */ import org.slf4j.Logger; import org.slf4j.Logger;
/* */ import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
/* */ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
/* */ import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
/* */ import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
/* */ import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Component @Component
/* */ public class SpringSessionValidationScheduler public class SpringSessionValidationScheduler
/* */ implements SessionValidationScheduler implements SessionValidationScheduler
/* */ { {
/* 25 */ private static final Logger log = LoggerFactory.getLogger(com.archive.framework.shiro.web.session.SpringSessionValidationScheduler.class); private static final Logger log = LoggerFactory.getLogger(com.archive.framework.shiro.web.session.SpringSessionValidationScheduler.class);
/* */
/* */
/* */
/* */ public static final long DEFAULT_SESSION_VALIDATION_INTERVAL = 3600000L; public static final long DEFAULT_SESSION_VALIDATION_INTERVAL = 3600000L;
/* */
/* */
/* */
/* */ @Autowired @Autowired
/* */ @Qualifier("scheduledExecutorService") @Qualifier("scheduledExecutorService")
/* */ private ScheduledExecutorService executorService; private ScheduledExecutorService executorService;
/* */
/* */
/* */ private volatile boolean enabled = false; private volatile boolean enabled = false;
/* */
/* */
/* */ @Autowired @Autowired
/* */ @Qualifier("sessionManager") @Qualifier("sessionManager")
/* */ @Lazy @Lazy
/* */ private ValidatingSessionManager sessionManager; private ValidatingSessionManager sessionManager;
/* */
/* */
/* */ @Value("${shiro.session.validationInterval}") @Value("${shiro.session.validationInterval}")
/* */ private long sessionValidationInterval; private long sessionValidationInterval;
/* */
/* */
/* */ @Override @Override
/* */ public boolean isEnabled() { public boolean isEnabled() {
/* 53 */ return this.enabled; return this.enabled;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void setSessionValidationInterval(long sessionValidationInterval) { public void setSessionValidationInterval(long sessionValidationInterval) {
/* 68 */ this.sessionValidationInterval = sessionValidationInterval; this.sessionValidationInterval = sessionValidationInterval;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Override @Override
/* */ public void enableSessionValidation() { public void enableSessionValidation() {
/* 78 */ this.enabled = true; this.enabled = true;
/* */
/* 80 */ if (log.isDebugEnabled()) if (log.isDebugEnabled())
/* */ { {
/* 82 */ log.debug("Scheduling session validation job using Spring Scheduler with session validation interval of [" + this.sessionValidationInterval + "]ms..."); log.debug("Scheduling session validation job using Spring Scheduler with session validation interval of [" + this.sessionValidationInterval + "]ms...");
/* */ } }
/* */
/* */
/* */
/* */ try { try {
/* */
/* */
executorService.scheduleAtFixedRate(new Runnable() { executorService.scheduleAtFixedRate(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -97,47 +97,47 @@
} }
} }
}, 1000, sessionValidationInterval * 60 * 1000, TimeUnit.MILLISECONDS); }, 1000, sessionValidationInterval * 60 * 1000, TimeUnit.MILLISECONDS);
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* 100 */ this.enabled = true; this.enabled = true;
/* */
/* 102 */ if (log.isDebugEnabled()) if (log.isDebugEnabled())
/* */ { {
/* 104 */ log.debug("Session validation job successfully scheduled with Spring Scheduler."); log.debug("Session validation job successfully scheduled with Spring Scheduler.");
/* */
/* */ } }
/* */ } }
/* 108 */ catch (Exception e) { catch (Exception e) {
/* */
/* 110 */ if (log.isErrorEnabled()) if (log.isErrorEnabled())
/* */ { {
/* 112 */ log.error("Error starting the Spring Scheduler session validation job. Session validation may not occur.", e); log.error("Error starting the Spring Scheduler session validation job. Session validation may not occur.", e);
/* */ } }
/* */ } }
/* */ } }
/* */
/* */
/* */ @Override @Override
/* */ public void disableSessionValidation() { public void disableSessionValidation() {
/* 120 */ if (log.isDebugEnabled()) if (log.isDebugEnabled())
/* */ { {
/* 122 */ log.debug("Stopping Spring Scheduler session validation job..."); log.debug("Stopping Spring Scheduler session validation job...");
/* */ } }
/* */
/* 125 */ if (this.enabled) if (this.enabled)
/* */ { {
/* 127 */ Threads.shutdownAndAwaitTermination(this.executorService); Threads.shutdownAndAwaitTermination(this.executorService);
/* */ } }
/* 129 */ this.enabled = false; this.enabled = false;
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\shiro\web\session\SpringSessionValidationScheduler.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\shiro\web\session\SpringSessionValidationScheduler.class

@ -1,110 +1,110 @@
/* */ package com.archive.project.dajs.recycle.service.impl package com.archive.project.dajs.recycle.service.impl
; ;
/* */
/* */ import com.archive.project.common.service.IExecuteSqlService; import com.archive.project.common.service.IExecuteSqlService;
/* */ import com.archive.project.dajs.recycle.service.IRecycleService; import com.archive.project.dajs.recycle.service.IRecycleService;
/* */ import com.archive.project.dasz.archivetype.domain.ArchiveType; import com.archive.project.dasz.archivetype.domain.ArchiveType;
/* */ import com.archive.project.dasz.archivetype.mapper.ArchiveTypeMapper; import com.archive.project.dasz.archivetype.mapper.ArchiveTypeMapper;
/* */ import com.archive.project.dasz.archivetype.service.IArchiveTypeService; import com.archive.project.dasz.archivetype.service.IArchiveTypeService;
/* */ import com.archive.project.dasz.physicaltable.mapper.PhysicalTableMapper; import com.archive.project.dasz.physicaltable.mapper.PhysicalTableMapper;
/* */ import com.archive.project.dasz.physicaltablecolumn.mapper.PhysicalTableColumnMapper; import com.archive.project.dasz.physicaltablecolumn.mapper.PhysicalTableColumnMapper;
/* */ import java.io.File; import java.io.File;
/* */ import java.util.LinkedHashMap; import java.util.LinkedHashMap;
/* */ import java.util.List; import java.util.List;
/* */ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/* */ import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Service @Service
/* */ public class RecycleServiceImpl public class RecycleServiceImpl
/* */ implements IRecycleService implements IRecycleService
/* */ { {
/* */ @Autowired @Autowired
/* */ private ArchiveTypeMapper archiveTypeMapper; private ArchiveTypeMapper archiveTypeMapper;
/* */ @Autowired @Autowired
/* */ private PhysicalTableMapper physicalTableMapper; private PhysicalTableMapper physicalTableMapper;
/* */ @Autowired @Autowired
/* */ private IExecuteSqlService executeSqlService; private IExecuteSqlService executeSqlService;
/* */ @Autowired @Autowired
/* */ private PhysicalTableColumnMapper physicalTableColumnMapper; private PhysicalTableColumnMapper physicalTableColumnMapper;
/* */ @Autowired @Autowired
/* */ private IArchiveTypeService iArchiveTypeService; private IArchiveTypeService iArchiveTypeService;
/* */
/* */ @Transactional @Transactional
/* */ public boolean archivePhysicalDelete(String archiveTypeId, String type) { public boolean archivePhysicalDelete(String archiveTypeId, String type) {
/* 58 */ boolean res = false; boolean res = false;
/* 59 */ ArchiveType archiveType = this.iArchiveTypeService.selectArchiveTypeById(Long.valueOf(Long.parseLong(archiveTypeId))); ArchiveType archiveType = this.iArchiveTypeService.selectArchiveTypeById(Long.valueOf(Long.parseLong(archiveTypeId)));
/* 60 */ String archiveCode = archiveType.getArhciveCode(); String archiveCode = archiveType.getArhciveCode();
/* 61 */ if (type.toLowerCase().equals("folder")) { if (type.toLowerCase().equals("folder")) {
/* */
/* */
/* 64 */ String documentPathSql = "select filewaterpath,filepath from t_ar_" + archiveCode + "_document where is_delete='1'"; String documentPathSql = "select filewaterpath,filepath from t_ar_" + archiveCode + "_document where is_delete='1'";
/* 65 */ getDocumentSqlDeleteFile(documentPathSql); getDocumentSqlDeleteFile(documentPathSql);
/* 66 */ String documentSql = "delete from t_ar_" + archiveCode + "_document where is_delete='1'"; String documentSql = "delete from t_ar_" + archiveCode + "_document where is_delete='1'";
/* 67 */ String filesql = "delete from t_ar_" + archiveCode + "_file where is_delete='1'"; String filesql = "delete from t_ar_" + archiveCode + "_file where is_delete='1'";
/* 68 */ String folderSql = "delete from t_ar_" + archiveCode + "_folder where is_delete='1'"; String folderSql = "delete from t_ar_" + archiveCode + "_folder where is_delete='1'";
/* 69 */ this.executeSqlService.delete(documentSql); this.executeSqlService.delete(documentSql);
/* 70 */ this.executeSqlService.delete(filesql); this.executeSqlService.delete(filesql);
/* 71 */ this.executeSqlService.delete(folderSql); this.executeSqlService.delete(folderSql);
/* 72 */ } else if (type.toLowerCase().equals("file")) { } else if (type.toLowerCase().equals("file")) {
/* */
/* */
/* 75 */ String documentPathSql = "select filewaterpath,filepath from t_ar_" + archiveCode + "_document where is_delete='1'"; String documentPathSql = "select filewaterpath,filepath from t_ar_" + archiveCode + "_document where is_delete='1'";
/* 76 */ getDocumentSqlDeleteFile(documentPathSql); getDocumentSqlDeleteFile(documentPathSql);
/* 77 */ String documentSql = "delete from t_ar_" + archiveCode + "_document where is_delete='1'"; String documentSql = "delete from t_ar_" + archiveCode + "_document where is_delete='1'";
/* 78 */ String filesql = "delete from t_ar_" + archiveCode + "_file where is_delete='1'"; String filesql = "delete from t_ar_" + archiveCode + "_file where is_delete='1'";
/* 79 */ this.executeSqlService.delete(documentSql); this.executeSqlService.delete(documentSql);
/* 80 */ this.executeSqlService.delete(filesql); this.executeSqlService.delete(filesql);
/* */ } }
/* 82 */ res = true; res = true;
/* 83 */ return res; return res;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void getDocumentSqlDeleteFile(String sql) { public void getDocumentSqlDeleteFile(String sql) {
/* 92 */ List<LinkedHashMap<String, Object>> list = this.executeSqlService.queryList(sql); List<LinkedHashMap<String, Object>> list = this.executeSqlService.queryList(sql);
/* 93 */ for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
/* 94 */ String waterPath = (((LinkedHashMap)list.get(i)).get("filewaterpath") == null) ? "" : ((LinkedHashMap)list.get(i)).get("filewaterpath").toString(); String waterPath = (((LinkedHashMap)list.get(i)).get("filewaterpath") == null) ? "" : ((LinkedHashMap)list.get(i)).get("filewaterpath").toString();
/* 95 */ String filePath = (((LinkedHashMap)list.get(i)).get("filepath") == null) ? "" : ((LinkedHashMap)list.get(i)).get("filepath").toString(); String filePath = (((LinkedHashMap)list.get(i)).get("filepath") == null) ? "" : ((LinkedHashMap)list.get(i)).get("filepath").toString();
/* 96 */ File waterFile = new File(waterPath); File waterFile = new File(waterPath);
/* 97 */ if (waterFile.exists()) { if (waterFile.exists()) {
/* 98 */ waterFile.delete(); waterFile.delete();
/* */ } }
/* 100 */ File file = new File(filePath); File file = new File(filePath);
/* 101 */ if (file.exists()) if (file.exists())
/* 102 */ file.delete(); file.delete();
/* */ } }
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\dajs\recycle\service\impl\RecycleServiceImpl.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\dajs\recycle\service\impl\RecycleServiceImpl.class

@ -1,33 +1,33 @@
/* */ package com.archive.project.monitor.job.task package com.archive.project.monitor.job.task
; ;
/* */
/* */ import com.archive.common.utils.StringUtils; import com.archive.common.utils.StringUtils;
/* */ import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Component("ryTask") @Component("ryTask")
/* */ public class RyTask public class RyTask
/* */ { {
/* */ public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) { public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
/* 16 */ System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", new Object[] { s, b, l, d, i })); System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", new Object[] { s, b, l, d, i }));
/* */ } }
/* */
/* */
/* */ public void ryParams(String params) { public void ryParams(String params) {
/* 21 */ System.out.println("执行有参方法:" + params); System.out.println("执行有参方法:" + params);
/* */ } }
/* */
/* */
/* */ public void ryNoParams() { public void ryNoParams() {
/* 26 */ System.out.println("执行无参方法"); System.out.println("执行无参方法");
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\job\task\RyTask.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\job\task\RyTask.class

@ -1,47 +1,47 @@
/* */ package com.archive.project.monitor.job.task; package com.archive.project.monitor.job.task;
/* */
/* */ import com.archive.common.utils.DateUtils; import com.archive.common.utils.DateUtils;
/* */
/* */ import com.archive.project.dasz.ccgl.service.ICcglService; import com.archive.project.dasz.ccgl.service.ICcglService;
/* */ import com.archive.project.system.config.service.IConfigService; import com.archive.project.system.config.service.IConfigService;
/* */ import java.io.File; import java.io.File;
/* */ import java.io.IOException; import java.io.IOException;
/* */ import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Component("sqliteBackTask") @Component("sqliteBackTask")
/* */ public class SqliteBackTask public class SqliteBackTask
/* */ { {
/* */ @Autowired @Autowired
/* */ private IConfigService configService; private IConfigService configService;
/* */ @Autowired @Autowired
/* */ private ICcglService ccglService; private ICcglService ccglService;
/* */
/* */ public void Back() { public void Back() {
/* 28 */ String path = this.configService.selectConfigByKey("archive.SqliteAddress"); String path = this.configService.selectConfigByKey("archive.SqliteAddress");
/* 29 */ if ((new File(path)).exists()) { if ((new File(path)).exists()) {
/* */
/* 31 */ String time = DateUtils.dateTimeNow(); String time = DateUtils.dateTimeNow();
/* 32 */ String backPath = this.ccglService.getPathByLjbs("archive.SqliteBackPath"); String backPath = this.ccglService.getPathByLjbs("archive.SqliteBackPath");
/* */ try { try {
/* 34 */ FileUtils.copyFile(new File(path), new File(backPath + File.separator + "archive_sqlite" + time + ".db")); FileUtils.copyFile(new File(path), new File(backPath + File.separator + "archive_sqlite" + time + ".db"));
/* 35 */ } catch (IOException e) { } catch (IOException e) {
/* 36 */ e.printStackTrace(); e.printStackTrace();
/* */ } }
/* 38 */ System.out.println("数据库备份完毕:" + backPath + File.separator + "archive_sqlite" + time + ".db"); System.out.println("数据库备份完毕:" + backPath + File.separator + "archive_sqlite" + time + ".db");
/* */ } else { } else {
/* 40 */ System.out.println("数据库文件不存在,请检查参数管理中-Sqlite数据存放位置-的参数值是否正确"); System.out.println("数据库文件不存在,请检查参数管理中-Sqlite数据存放位置-的参数值是否正确");
/* */ } }
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\job\task\SqliteBackTask.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\job\task\SqliteBackTask.class

@ -1,117 +1,117 @@
/* */ package com.archive.project.monitor.job.util package com.archive.project.monitor.job.util
; ;
/* */
/* */ import com.archive.common.constant.ScheduleConstants; import com.archive.common.constant.ScheduleConstants;
/* */ import com.archive.common.constant.Status; import com.archive.common.constant.Status;
import com.archive.common.exception.job.Code; import com.archive.common.exception.job.Code;
import com.archive.common.exception.job.TaskException; import com.archive.common.exception.job.TaskException;
/* */ import com.archive.project.monitor.job.domain.Job; import com.archive.project.monitor.job.domain.Job;
/* */ import com.archive.project.monitor.job.util.QuartzDisallowConcurrentExecution; import com.archive.project.monitor.job.util.QuartzDisallowConcurrentExecution;
/* */ import com.archive.project.monitor.job.util.QuartzJobExecution; import com.archive.project.monitor.job.util.QuartzJobExecution;
/* */ import org.quartz.CronScheduleBuilder; import org.quartz.CronScheduleBuilder;
/* */ import org.quartz.CronTrigger; import org.quartz.CronTrigger;
/* */
/* */ import org.quartz.JobBuilder; import org.quartz.JobBuilder;
/* */ import org.quartz.JobDetail; import org.quartz.JobDetail;
/* */ import org.quartz.JobKey; import org.quartz.JobKey;
/* */ import org.quartz.ScheduleBuilder; import org.quartz.ScheduleBuilder;
/* */ import org.quartz.Scheduler; import org.quartz.Scheduler;
/* */ import org.quartz.SchedulerException; import org.quartz.SchedulerException;
/* */ import org.quartz.Trigger; import org.quartz.Trigger;
/* */ import org.quartz.TriggerBuilder; import org.quartz.TriggerBuilder;
/* */ import org.quartz.TriggerKey; import org.quartz.TriggerKey;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class ScheduleUtils public class ScheduleUtils
/* */ { {
/* */ private static Class<? extends org.quartz.Job> getQuartzJobClass(Job job) { private static Class<? extends org.quartz.Job> getQuartzJobClass(Job job) {
/* 33 */ boolean isConcurrent = "0".equals(job.getConcurrent()); boolean isConcurrent = "0".equals(job.getConcurrent());
/* 34 */ return isConcurrent ? (Class)QuartzJobExecution.class : (Class)QuartzDisallowConcurrentExecution.class; return isConcurrent ? (Class)QuartzJobExecution.class : (Class)QuartzDisallowConcurrentExecution.class;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public static TriggerKey getTriggerKey(Long jobId, String jobGroup) { public static TriggerKey getTriggerKey(Long jobId, String jobGroup) {
/* 42 */ return TriggerKey.triggerKey("TASK_CLASS_NAME" + jobId, jobGroup); return TriggerKey.triggerKey("TASK_CLASS_NAME" + jobId, jobGroup);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public static JobKey getJobKey(Long jobId, String jobGroup) { public static JobKey getJobKey(Long jobId, String jobGroup) {
/* 50 */ return JobKey.jobKey("TASK_CLASS_NAME" + jobId, jobGroup); return JobKey.jobKey("TASK_CLASS_NAME" + jobId, jobGroup);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public static void createScheduleJob(Scheduler scheduler, Job job) throws SchedulerException, TaskException { public static void createScheduleJob(Scheduler scheduler, Job job) throws SchedulerException, TaskException {
/* 58 */ Class<? extends org.quartz.Job> jobClass = getQuartzJobClass(job); Class<? extends org.quartz.Job> jobClass = getQuartzJobClass(job);
/* */
/* 60 */ Long jobId = job.getJobId(); Long jobId = job.getJobId();
/* 61 */ String jobGroup = job.getJobGroup(); String jobGroup = job.getJobGroup();
/* 62 */ JobDetail jobDetail = JobBuilder.newJob(jobClass).withIdentity(getJobKey(jobId, jobGroup)).build(); JobDetail jobDetail = JobBuilder.newJob(jobClass).withIdentity(getJobKey(jobId, jobGroup)).build();
/* */
/* */
/* 65 */ CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(job.getCronExpression()); CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule(job.getCronExpression());
/* 66 */ cronScheduleBuilder = handleCronScheduleMisfirePolicy(job, cronScheduleBuilder); cronScheduleBuilder = handleCronScheduleMisfirePolicy(job, cronScheduleBuilder);
/* */
/* */
/* */
/* 70 */ CronTrigger trigger = (CronTrigger)TriggerBuilder.newTrigger().withIdentity(getTriggerKey(jobId, jobGroup)).withSchedule((ScheduleBuilder)cronScheduleBuilder).build(); CronTrigger trigger = (CronTrigger)TriggerBuilder.newTrigger().withIdentity(getTriggerKey(jobId, jobGroup)).withSchedule((ScheduleBuilder)cronScheduleBuilder).build();
/* */
/* */
/* 73 */ jobDetail.getJobDataMap().put("TASK_PROPERTIES", job); jobDetail.getJobDataMap().put("TASK_PROPERTIES", job);
/* */
/* */
/* 76 */ if (scheduler.checkExists(getJobKey(jobId, jobGroup))) if (scheduler.checkExists(getJobKey(jobId, jobGroup)))
/* */ { {
/* */
/* 79 */ scheduler.deleteJob(getJobKey(jobId, jobGroup)); scheduler.deleteJob(getJobKey(jobId, jobGroup));
/* */ } }
/* */
/* 82 */ scheduler.scheduleJob(jobDetail, (Trigger)trigger); scheduler.scheduleJob(jobDetail, (Trigger)trigger);
/* */
/* */
/* 85 */ if (job.getStatus().equals(Status.PAUSE.getValue())) if (job.getStatus().equals(Status.PAUSE.getValue()))
/* */ { {
/* 87 */ scheduler.pauseJob(getJobKey(jobId, jobGroup)); scheduler.pauseJob(getJobKey(jobId, jobGroup));
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static CronScheduleBuilder handleCronScheduleMisfirePolicy(Job job, CronScheduleBuilder cb) throws TaskException { public static CronScheduleBuilder handleCronScheduleMisfirePolicy(Job job, CronScheduleBuilder cb) throws TaskException {
/* 97 */ switch (job.getMisfirePolicy()) { switch (job.getMisfirePolicy()) {
/* */
/* */ case "0": case "0":
/* 100 */ return cb; return cb;
/* */ case "1": case "1":
/* 102 */ return cb.withMisfireHandlingInstructionIgnoreMisfires(); return cb.withMisfireHandlingInstructionIgnoreMisfires();
/* */ case "2": case "2":
/* 104 */ return cb.withMisfireHandlingInstructionFireAndProceed(); return cb.withMisfireHandlingInstructionFireAndProceed();
/* */ case "3": case "3":
/* 106 */ return cb.withMisfireHandlingInstructionDoNothing(); return cb.withMisfireHandlingInstructionDoNothing();
/* */ } }
/* 108 */ throw new TaskException("The task misfire policy '" + job.getMisfirePolicy() + "' cannot be used in cron schedule tasks", Code.CONFIG_ERROR); throw new TaskException("The task misfire policy '" + job.getMisfirePolicy() + "' cannot be used in cron schedule tasks", Code.CONFIG_ERROR);
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\jo\\util\ScheduleUtils.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\jo\\util\ScheduleUtils.class

@ -1,36 +1,36 @@
/* */ package com.archive.project.monitor.server.controller package com.archive.project.monitor.server.controller
; ;
/* */
/* */ import com.archive.framework.web.controller.BaseController; import com.archive.framework.web.controller.BaseController;
/* */ import com.archive.project.monitor.server.domain.Server; import com.archive.project.monitor.server.domain.Server;
/* */ import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
/* */ import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
/* */ import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
/* */ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
/* */ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
/* */
/* */
/* */
/* */
/* */
/* */ @Controller @Controller
/* */ @RequestMapping({"/monitor/server"}) @RequestMapping({"/monitor/server"})
/* */ public class ServerController public class ServerController
/* */ extends BaseController extends BaseController
/* */ { {
/* 20 */ private String prefix = "monitor/server"; private String prefix = "monitor/server";
/* */
/* */
/* */ @RequiresPermissions({"monitor:server:view"}) @RequiresPermissions({"monitor:server:view"})
/* */ @GetMapping @GetMapping
/* */ public String server(ModelMap mmap) throws Exception { public String server(ModelMap mmap) throws Exception {
/* 26 */ Server server = new Server(); Server server = new Server();
/* 27 */ server.copyTo(); server.copyTo();
/* 28 */ mmap.put("server", server); mmap.put("server", server);
/* 29 */ return this.prefix + "/server"; return this.prefix + "/server";
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\server\controller\ServerController.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\server\controller\ServerController.class

@ -1,239 +1,239 @@
/* */ package com.archive.project.monitor.server.domain package com.archive.project.monitor.server.domain
; ;
/* */
/* */ import com.archive.common.utils.Arith; import com.archive.common.utils.Arith;
/* */ import com.archive.common.utils.IpUtils; import com.archive.common.utils.IpUtils;
/* */ import com.archive.project.monitor.server.domain.Cpu; import com.archive.project.monitor.server.domain.Cpu;
/* */ import com.archive.project.monitor.server.domain.Jvm; import com.archive.project.monitor.server.domain.Jvm;
/* */ import com.archive.project.monitor.server.domain.Mem; import com.archive.project.monitor.server.domain.Mem;
/* */ import com.archive.project.monitor.server.domain.Sys; import com.archive.project.monitor.server.domain.Sys;
/* */ import com.archive.project.monitor.server.domain.SysFile; import com.archive.project.monitor.server.domain.SysFile;
/* */ import java.net.UnknownHostException; import java.net.UnknownHostException;
/* */ import java.util.LinkedList; import java.util.LinkedList;
/* */ import java.util.List; import java.util.List;
/* */ import java.util.Properties; import java.util.Properties;
/* */ import oshi.SystemInfo; import oshi.SystemInfo;
/* */ import oshi.hardware.CentralProcessor; import oshi.hardware.CentralProcessor;
/* */ import oshi.hardware.GlobalMemory; import oshi.hardware.GlobalMemory;
/* */ import oshi.hardware.HardwareAbstractionLayer; import oshi.hardware.HardwareAbstractionLayer;
/* */ import oshi.software.os.FileSystem; import oshi.software.os.FileSystem;
/* */ import oshi.software.os.OSFileStore; import oshi.software.os.OSFileStore;
/* */ import oshi.software.os.OperatingSystem; import oshi.software.os.OperatingSystem;
/* */ import oshi.util.Util; import oshi.util.Util;
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class Server public class Server
/* */ { {
/* */ private static final int OSHI_WAIT_SECOND = 1000; private static final int OSHI_WAIT_SECOND = 1000;
/* 31 */ private Cpu cpu = new Cpu(); private Cpu cpu = new Cpu();
/* */
/* */
/* */
/* */
/* 36 */ private Mem mem = new Mem(); private Mem mem = new Mem();
/* */
/* */
/* */
/* */
/* 41 */ private Jvm jvm = new Jvm(); private Jvm jvm = new Jvm();
/* */
/* */
/* */
/* */
/* 46 */ private Sys sys = new Sys(); private Sys sys = new Sys();
/* */
/* */
/* */
/* */
/* 51 */ private List<SysFile> sysFiles = new LinkedList<>(); private List<SysFile> sysFiles = new LinkedList<>();
/* */
/* */
/* */ public Cpu getCpu() { public Cpu getCpu() {
/* 55 */ return this.cpu; return this.cpu;
/* */ } }
/* */
/* */
/* */ public void setCpu(Cpu cpu) { public void setCpu(Cpu cpu) {
/* 60 */ this.cpu = cpu; this.cpu = cpu;
/* */ } }
/* */
/* */
/* */ public Mem getMem() { public Mem getMem() {
/* 65 */ return this.mem; return this.mem;
/* */ } }
/* */
/* */
/* */ public void setMem(Mem mem) { public void setMem(Mem mem) {
/* 70 */ this.mem = mem; this.mem = mem;
/* */ } }
/* */
/* */
/* */ public Jvm getJvm() { public Jvm getJvm() {
/* 75 */ return this.jvm; return this.jvm;
/* */ } }
/* */
/* */
/* */ public void setJvm(Jvm jvm) { public void setJvm(Jvm jvm) {
/* 80 */ this.jvm = jvm; this.jvm = jvm;
/* */ } }
/* */
/* */
/* */ public Sys getSys() { public Sys getSys() {
/* 85 */ return this.sys; return this.sys;
/* */ } }
/* */
/* */
/* */ public void setSys(Sys sys) { public void setSys(Sys sys) {
/* 90 */ this.sys = sys; this.sys = sys;
/* */ } }
/* */
/* */
/* */ public List<SysFile> getSysFiles() { public List<SysFile> getSysFiles() {
/* 95 */ return this.sysFiles; return this.sysFiles;
/* */ } }
/* */
/* */
/* */ public void setSysFiles(List<SysFile> sysFiles) { public void setSysFiles(List<SysFile> sysFiles) {
/* 100 */ this.sysFiles = sysFiles; this.sysFiles = sysFiles;
/* */ } }
/* */
/* */
/* */ public void copyTo() throws Exception { public void copyTo() throws Exception {
/* 105 */ SystemInfo si = new SystemInfo(); SystemInfo si = new SystemInfo();
/* 106 */ HardwareAbstractionLayer hal = si.getHardware(); HardwareAbstractionLayer hal = si.getHardware();
/* */
/* 108 */ setCpuInfo(hal.getProcessor()); setCpuInfo(hal.getProcessor());
/* */
/* 110 */ setMemInfo(hal.getMemory()); setMemInfo(hal.getMemory());
/* */
/* 112 */ setSysInfo(); setSysInfo();
/* */
/* 114 */ setJvmInfo(); setJvmInfo();
/* */
/* 116 */ setSysFiles(si.getOperatingSystem()); setSysFiles(si.getOperatingSystem());
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ private void setCpuInfo(CentralProcessor processor) { private void setCpuInfo(CentralProcessor processor) {
/* 125 */ long[] prevTicks = processor.getSystemCpuLoadTicks(); long[] prevTicks = processor.getSystemCpuLoadTicks();
/* 126 */ Util.sleep(1000L); Util.sleep(1000L);
/* 127 */ long[] ticks = processor.getSystemCpuLoadTicks(); long[] ticks = processor.getSystemCpuLoadTicks();
/* 128 */ long nice = ticks[CentralProcessor.TickType.NICE.getIndex()] - prevTicks[CentralProcessor.TickType.NICE.getIndex()]; long nice = ticks[CentralProcessor.TickType.NICE.getIndex()] - prevTicks[CentralProcessor.TickType.NICE.getIndex()];
/* 129 */ long irq = ticks[CentralProcessor.TickType.IRQ.getIndex()] - prevTicks[CentralProcessor.TickType.IRQ.getIndex()]; long irq = ticks[CentralProcessor.TickType.IRQ.getIndex()] - prevTicks[CentralProcessor.TickType.IRQ.getIndex()];
/* 130 */ long softirq = ticks[CentralProcessor.TickType.SOFTIRQ.getIndex()] - prevTicks[CentralProcessor.TickType.SOFTIRQ.getIndex()]; long softirq = ticks[CentralProcessor.TickType.SOFTIRQ.getIndex()] - prevTicks[CentralProcessor.TickType.SOFTIRQ.getIndex()];
/* 131 */ long steal = ticks[CentralProcessor.TickType.STEAL.getIndex()] - prevTicks[CentralProcessor.TickType.STEAL.getIndex()]; long steal = ticks[CentralProcessor.TickType.STEAL.getIndex()] - prevTicks[CentralProcessor.TickType.STEAL.getIndex()];
/* 132 */ long cSys = ticks[CentralProcessor.TickType.SYSTEM.getIndex()] - prevTicks[CentralProcessor.TickType.SYSTEM.getIndex()]; long cSys = ticks[CentralProcessor.TickType.SYSTEM.getIndex()] - prevTicks[CentralProcessor.TickType.SYSTEM.getIndex()];
/* 133 */ long user = ticks[CentralProcessor.TickType.USER.getIndex()] - prevTicks[CentralProcessor.TickType.USER.getIndex()]; long user = ticks[CentralProcessor.TickType.USER.getIndex()] - prevTicks[CentralProcessor.TickType.USER.getIndex()];
/* 134 */ long iowait = ticks[CentralProcessor.TickType.IOWAIT.getIndex()] - prevTicks[CentralProcessor.TickType.IOWAIT.getIndex()]; long iowait = ticks[CentralProcessor.TickType.IOWAIT.getIndex()] - prevTicks[CentralProcessor.TickType.IOWAIT.getIndex()];
/* 135 */ long idle = ticks[CentralProcessor.TickType.IDLE.getIndex()] - prevTicks[CentralProcessor.TickType.IDLE.getIndex()]; long idle = ticks[CentralProcessor.TickType.IDLE.getIndex()] - prevTicks[CentralProcessor.TickType.IDLE.getIndex()];
/* 136 */ long totalCpu = user + nice + cSys + idle + iowait + irq + softirq + steal; long totalCpu = user + nice + cSys + idle + iowait + irq + softirq + steal;
/* 137 */ this.cpu.setCpuNum(processor.getLogicalProcessorCount()); this.cpu.setCpuNum(processor.getLogicalProcessorCount());
/* 138 */ this.cpu.setTotal(totalCpu); this.cpu.setTotal(totalCpu);
/* 139 */ this.cpu.setSys(cSys); this.cpu.setSys(cSys);
/* 140 */ this.cpu.setUsed(user); this.cpu.setUsed(user);
/* 141 */ this.cpu.setWait(iowait); this.cpu.setWait(iowait);
/* 142 */ this.cpu.setFree(idle); this.cpu.setFree(idle);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ private void setMemInfo(GlobalMemory memory) { private void setMemInfo(GlobalMemory memory) {
/* 150 */ this.mem.setTotal(memory.getTotal()); this.mem.setTotal(memory.getTotal());
/* 151 */ this.mem.setUsed(memory.getTotal() - memory.getAvailable()); this.mem.setUsed(memory.getTotal() - memory.getAvailable());
/* 152 */ this.mem.setFree(memory.getAvailable()); this.mem.setFree(memory.getAvailable());
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ private void setSysInfo() { private void setSysInfo() {
/* 160 */ Properties props = System.getProperties(); Properties props = System.getProperties();
/* 161 */ this.sys.setComputerName(IpUtils.getHostName()); this.sys.setComputerName(IpUtils.getHostName());
/* 162 */ this.sys.setComputerIp(IpUtils.getHostIp()); this.sys.setComputerIp(IpUtils.getHostIp());
/* 163 */ this.sys.setOsName(props.getProperty("os.name")); this.sys.setOsName(props.getProperty("os.name"));
/* 164 */ this.sys.setOsArch(props.getProperty("os.arch")); this.sys.setOsArch(props.getProperty("os.arch"));
/* 165 */ this.sys.setUserDir(props.getProperty("user.dir")); this.sys.setUserDir(props.getProperty("user.dir"));
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ private void setJvmInfo() throws UnknownHostException { private void setJvmInfo() throws UnknownHostException {
/* 173 */ Properties props = System.getProperties(); Properties props = System.getProperties();
/* 174 */ this.jvm.setTotal(Runtime.getRuntime().totalMemory()); this.jvm.setTotal(Runtime.getRuntime().totalMemory());
/* 175 */ this.jvm.setMax(Runtime.getRuntime().maxMemory()); this.jvm.setMax(Runtime.getRuntime().maxMemory());
/* 176 */ this.jvm.setFree(Runtime.getRuntime().freeMemory()); this.jvm.setFree(Runtime.getRuntime().freeMemory());
/* 177 */ this.jvm.setVersion(props.getProperty("java.version")); this.jvm.setVersion(props.getProperty("java.version"));
/* 178 */ this.jvm.setHome(props.getProperty("java.home")); this.jvm.setHome(props.getProperty("java.home"));
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ private void setSysFiles(OperatingSystem os) { private void setSysFiles(OperatingSystem os) {
/* 186 */ FileSystem fileSystem = os.getFileSystem(); FileSystem fileSystem = os.getFileSystem();
/* 187 */ List<OSFileStore> fsArray = fileSystem.getFileStores(); List<OSFileStore> fsArray = fileSystem.getFileStores();
/* 188 */ for (OSFileStore fs : fsArray) { for (OSFileStore fs : fsArray) {
/* */
/* 190 */ long free = fs.getUsableSpace(); long free = fs.getUsableSpace();
/* 191 */ long total = fs.getTotalSpace(); long total = fs.getTotalSpace();
/* 192 */ long used = total - free; long used = total - free;
/* 193 */ SysFile sysFile = new SysFile(); SysFile sysFile = new SysFile();
/* 194 */ sysFile.setDirName(fs.getMount()); sysFile.setDirName(fs.getMount());
/* 195 */ sysFile.setSysTypeName(fs.getType()); sysFile.setSysTypeName(fs.getType());
/* 196 */ sysFile.setTypeName(fs.getName()); sysFile.setTypeName(fs.getName());
/* 197 */ sysFile.setTotal(convertFileSize(total)); sysFile.setTotal(convertFileSize(total));
/* 198 */ sysFile.setFree(convertFileSize(free)); sysFile.setFree(convertFileSize(free));
/* 199 */ sysFile.setUsed(convertFileSize(used)); sysFile.setUsed(convertFileSize(used));
/* 200 */ sysFile.setUsage(Arith.mul(Arith.div(used, total, 4), 100.0D)); sysFile.setUsage(Arith.mul(Arith.div(used, total, 4), 100.0D));
/* 201 */ this.sysFiles.add(sysFile); this.sysFiles.add(sysFile);
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public String convertFileSize(long size) { public String convertFileSize(long size) {
/* 213 */ long kb = 1024L; long kb = 1024L;
/* 214 */ long mb = kb * 1024L; long mb = kb * 1024L;
/* 215 */ long gb = mb * 1024L; long gb = mb * 1024L;
/* 216 */ if (size >= gb) if (size >= gb)
/* */ { {
/* 218 */ return String.format("%.1f GB", new Object[] { Float.valueOf((float)size / (float)gb) }); return String.format("%.1f GB", new Object[] { Float.valueOf((float)size / (float)gb) });
/* */ } }
/* 220 */ if (size >= mb) { if (size >= mb) {
/* */
/* 222 */ float f = (float)size / (float)mb; float f = (float)size / (float)mb;
/* 223 */ return String.format((f > 100.0F) ? "%.0f MB" : "%.1f MB", new Object[] { Float.valueOf(f) }); return String.format((f > 100.0F) ? "%.0f MB" : "%.1f MB", new Object[] { Float.valueOf(f) });
/* */ } }
/* 225 */ if (size >= kb) { if (size >= kb) {
/* */
/* 227 */ float f = (float)size / (float)kb; float f = (float)size / (float)kb;
/* 228 */ return String.format((f > 100.0F) ? "%.0f KB" : "%.1f KB", new Object[] { Float.valueOf(f) }); return String.format((f > 100.0F) ? "%.0f KB" : "%.1f KB", new Object[] { Float.valueOf(f) });
/* */ } }
/* */
/* */
/* 232 */ return String.format("%d B", new Object[] { Long.valueOf(size) }); return String.format("%d B", new Object[] { Long.valueOf(size) });
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\server\domain\Server.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\server\domain\Server.class

@ -1,299 +1,299 @@
/* */ package com.archive.project.system.role.controller package com.archive.project.system.role.controller
; ;
/* */
/* */ import com.archive.common.utils.poi.ExcelUtil; import com.archive.common.utils.poi.ExcelUtil;
/* */ import com.archive.common.utils.security.AuthorizationUtils; import com.archive.common.utils.security.AuthorizationUtils;
/* */ import com.archive.framework.aspectj.lang.annotation.Log; import com.archive.framework.aspectj.lang.annotation.Log;
/* */ import com.archive.framework.aspectj.lang.enums.BusinessType; import com.archive.framework.aspectj.lang.enums.BusinessType;
/* */ import com.archive.framework.web.controller.BaseController; import com.archive.framework.web.controller.BaseController;
/* */ import com.archive.framework.web.domain.AjaxResult; import com.archive.framework.web.domain.AjaxResult;
/* */ import com.archive.framework.web.page.TableDataInfo; import com.archive.framework.web.page.TableDataInfo;
/* */ import com.archive.project.system.role.domain.Role; import com.archive.project.system.role.domain.Role;
/* */ import com.archive.project.system.role.service.IRoleService; import com.archive.project.system.role.service.IRoleService;
/* */ import com.archive.project.system.user.domain.User; import com.archive.project.system.user.domain.User;
/* */ import com.archive.project.system.user.domain.UserRole; import com.archive.project.system.user.domain.UserRole;
/* */ import com.archive.project.system.user.service.IUserService; import com.archive.project.system.user.service.IUserService;
/* */ import java.util.List; import java.util.List;
/* */ import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
/* */ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
/* */ import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
/* */ import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
/* */ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
/* */ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
/* */ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
/* */ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
/* */ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Controller @Controller
/* */ @RequestMapping({"/system/role"}) @RequestMapping({"/system/role"})
/* */ public class RoleController public class RoleController
/* */ extends BaseController extends BaseController
/* */ { {
/* 37 */ private String prefix = "system/role"; private String prefix = "system/role";
/* */
/* */ @Autowired @Autowired
/* */ private IRoleService roleService; private IRoleService roleService;
/* */
/* */ @Autowired @Autowired
/* */ private IUserService userService; private IUserService userService;
/* */
/* */
/* */ @RequiresPermissions({"system:role:view"}) @RequiresPermissions({"system:role:view"})
/* */ @GetMapping @GetMapping
/* */ public String role() { public String role() {
/* 49 */ return this.prefix + "/role"; return this.prefix + "/role";
/* */ } }
/* */
/* */
/* */ @RequiresPermissions({"system:role:list"}) @RequiresPermissions({"system:role:list"})
/* */ @PostMapping({"/list"}) @PostMapping({"/list"})
/* */ @ResponseBody @ResponseBody
/* */ public TableDataInfo list(Role role) { public TableDataInfo list(Role role) {
/* 57 */ startPage(); startPage();
/* 58 */ List<Role> list = this.roleService.selectRoleList(role); List<Role> list = this.roleService.selectRoleList(role);
/* 59 */ return getDataTable(list); return getDataTable(list);
/* */ } }
/* */
/* */
/* */ @Log(title = "角色管理", businessType = BusinessType.EXPORT) @Log(title = "角色管理", businessType = BusinessType.EXPORT)
/* */ @RequiresPermissions({"system:role:export"}) @RequiresPermissions({"system:role:export"})
/* */ @PostMapping({"/export"}) @PostMapping({"/export"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult export(Role role) { public AjaxResult export(Role role) {
/* 68 */ List<Role> list = this.roleService.selectRoleList(role); List<Role> list = this.roleService.selectRoleList(role);
/* 69 */ ExcelUtil<Role> util = new ExcelUtil(Role.class); ExcelUtil<Role> util = new ExcelUtil(Role.class);
/* 70 */ return util.exportExcel(list, "角色数据"); return util.exportExcel(list, "角色数据");
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/add"}) @GetMapping({"/add"})
/* */ public String add() { public String add() {
/* 79 */ return this.prefix + "/add"; return this.prefix + "/add";
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"system:role:add"}) @RequiresPermissions({"system:role:add"})
/* */ @Log(title = "角色管理", businessType = BusinessType.INSERT) @Log(title = "角色管理", businessType = BusinessType.INSERT)
/* */ @PostMapping({"/add"}) @PostMapping({"/add"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult addSave(@Validated Role role) { public AjaxResult addSave(@Validated Role role) {
/* 91 */ if ("1".equals(this.roleService.checkRoleNameUnique(role))) if ("1".equals(this.roleService.checkRoleNameUnique(role)))
/* */ { {
/* 93 */ return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在"); return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
/* */ } }
/* 95 */ if ("1".equals(this.roleService.checkRoleKeyUnique(role))) if ("1".equals(this.roleService.checkRoleKeyUnique(role)))
/* */ { {
/* 97 */ return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在"); return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
/* */ } }
/* 99 */ AuthorizationUtils.clearAllCachedAuthorizationInfo(); AuthorizationUtils.clearAllCachedAuthorizationInfo();
/* 100 */ return toAjax(this.roleService.insertRole(role)); return toAjax(this.roleService.insertRole(role));
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/edit/{roleId}"}) @GetMapping({"/edit/{roleId}"})
/* */ public String edit(@PathVariable("roleId") Long roleId, ModelMap mmap) { public String edit(@PathVariable("roleId") Long roleId, ModelMap mmap) {
/* 110 */ mmap.put("role", this.roleService.selectRoleById(roleId)); mmap.put("role", this.roleService.selectRoleById(roleId));
/* 111 */ return this.prefix + "/edit"; return this.prefix + "/edit";
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"system:role:edit"}) @RequiresPermissions({"system:role:edit"})
/* */ @Log(title = "角色管理", businessType = BusinessType.UPDATE) @Log(title = "角色管理", businessType = BusinessType.UPDATE)
/* */ @PostMapping({"/edit"}) @PostMapping({"/edit"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult editSave(@Validated Role role) { public AjaxResult editSave(@Validated Role role) {
/* 123 */ this.roleService.checkRoleAllowed(role); this.roleService.checkRoleAllowed(role);
/* 124 */ if ("1".equals(this.roleService.checkRoleNameUnique(role))) if ("1".equals(this.roleService.checkRoleNameUnique(role)))
/* */ { {
/* 126 */ return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在"); return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
/* */ } }
/* 128 */ if ("1".equals(this.roleService.checkRoleKeyUnique(role))) if ("1".equals(this.roleService.checkRoleKeyUnique(role)))
/* */ { {
/* 130 */ return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在"); return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
/* */ } }
/* 132 */ AuthorizationUtils.clearAllCachedAuthorizationInfo(); AuthorizationUtils.clearAllCachedAuthorizationInfo();
/* 133 */ return toAjax(this.roleService.updateRole(role)); return toAjax(this.roleService.updateRole(role));
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/authDataScope/{roleId}"}) @GetMapping({"/authDataScope/{roleId}"})
/* */ public String authDataScope(@PathVariable("roleId") Long roleId, ModelMap mmap) { public String authDataScope(@PathVariable("roleId") Long roleId, ModelMap mmap) {
/* 142 */ mmap.put("role", this.roleService.selectRoleById(roleId)); mmap.put("role", this.roleService.selectRoleById(roleId));
/* 143 */ return this.prefix + "/dataScope"; return this.prefix + "/dataScope";
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"system:role:edit"}) @RequiresPermissions({"system:role:edit"})
/* */ @Log(title = "角色管理", businessType = BusinessType.UPDATE) @Log(title = "角色管理", businessType = BusinessType.UPDATE)
/* */ @PostMapping({"/authDataScope"}) @PostMapping({"/authDataScope"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult authDataScopeSave(Role role) { public AjaxResult authDataScopeSave(Role role) {
/* 155 */ this.roleService.checkRoleAllowed(role); this.roleService.checkRoleAllowed(role);
/* 156 */ if (this.roleService.authDataScope(role) > 0) { if (this.roleService.authDataScope(role) > 0) {
/* */
/* 158 */ setSysUser(this.userService.selectUserById(getSysUser().getUserId())); setSysUser(this.userService.selectUserById(getSysUser().getUserId()));
/* 159 */ return success(); return success();
/* */ } }
/* 161 */ return error(); return error();
/* */ } }
/* */
/* */
/* */ @RequiresPermissions({"system:role:remove"}) @RequiresPermissions({"system:role:remove"})
/* */ @Log(title = "角色管理", businessType = BusinessType.DELETE) @Log(title = "角色管理", businessType = BusinessType.DELETE)
/* */ @PostMapping({"/remove"}) @PostMapping({"/remove"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult remove(String ids) { public AjaxResult remove(String ids) {
/* 170 */ return toAjax(this.roleService.deleteRoleByIds(ids)); return toAjax(this.roleService.deleteRoleByIds(ids));
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @PostMapping({"/checkRoleNameUnique"}) @PostMapping({"/checkRoleNameUnique"})
/* */ @ResponseBody @ResponseBody
/* */ public String checkRoleNameUnique(Role role) { public String checkRoleNameUnique(Role role) {
/* 180 */ return this.roleService.checkRoleNameUnique(role); return this.roleService.checkRoleNameUnique(role);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @PostMapping({"/checkRoleKeyUnique"}) @PostMapping({"/checkRoleKeyUnique"})
/* */ @ResponseBody @ResponseBody
/* */ public String checkRoleKeyUnique(Role role) { public String checkRoleKeyUnique(Role role) {
/* 190 */ return this.roleService.checkRoleKeyUnique(role); return this.roleService.checkRoleKeyUnique(role);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/selectMenuTree"}) @GetMapping({"/selectMenuTree"})
/* */ public String selectMenuTree() { public String selectMenuTree() {
/* 199 */ return this.prefix + "/tree"; return this.prefix + "/tree";
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @Log(title = "角色管理", businessType = BusinessType.UPDATE) @Log(title = "角色管理", businessType = BusinessType.UPDATE)
/* */ @RequiresPermissions({"system:role:edit"}) @RequiresPermissions({"system:role:edit"})
/* */ @PostMapping({"/changeStatus"}) @PostMapping({"/changeStatus"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult changeStatus(Role role) { public AjaxResult changeStatus(Role role) {
/* 211 */ this.roleService.checkRoleAllowed(role); this.roleService.checkRoleAllowed(role);
/* 212 */ return toAjax(this.roleService.changeStatus(role)); return toAjax(this.roleService.changeStatus(role));
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"system:role:edit"}) @RequiresPermissions({"system:role:edit"})
/* */ @GetMapping({"/authUser/{roleId}"}) @GetMapping({"/authUser/{roleId}"})
/* */ public String authUser(@PathVariable("roleId") Long roleId, ModelMap mmap) { public String authUser(@PathVariable("roleId") Long roleId, ModelMap mmap) {
/* 222 */ mmap.put("role", this.roleService.selectRoleById(roleId)); mmap.put("role", this.roleService.selectRoleById(roleId));
/* 223 */ return this.prefix + "/authUser"; return this.prefix + "/authUser";
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"system:role:list"}) @RequiresPermissions({"system:role:list"})
/* */ @PostMapping({"/authUser/allocatedList"}) @PostMapping({"/authUser/allocatedList"})
/* */ @ResponseBody @ResponseBody
/* */ public TableDataInfo allocatedList(User user) { public TableDataInfo allocatedList(User user) {
/* 234 */ startPage(); startPage();
/* 235 */ List<User> list = this.userService.selectAllocatedList(user); List<User> list = this.userService.selectAllocatedList(user);
/* 236 */ return getDataTable(list); return getDataTable(list);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @Log(title = "角色管理", businessType = BusinessType.GRANT) @Log(title = "角色管理", businessType = BusinessType.GRANT)
/* */ @PostMapping({"/authUser/cancel"}) @PostMapping({"/authUser/cancel"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult cancelAuthUser(UserRole userRole) { public AjaxResult cancelAuthUser(UserRole userRole) {
/* 247 */ return toAjax(this.roleService.deleteAuthUser(userRole)); return toAjax(this.roleService.deleteAuthUser(userRole));
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @Log(title = "角色管理", businessType = BusinessType.GRANT) @Log(title = "角色管理", businessType = BusinessType.GRANT)
/* */ @PostMapping({"/authUser/cancelAll"}) @PostMapping({"/authUser/cancelAll"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult cancelAuthUserAll(Long roleId, String userIds) { public AjaxResult cancelAuthUserAll(Long roleId, String userIds) {
/* 258 */ return toAjax(this.roleService.deleteAuthUsers(roleId, userIds)); return toAjax(this.roleService.deleteAuthUsers(roleId, userIds));
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/authUser/selectUser/{roleId}"}) @GetMapping({"/authUser/selectUser/{roleId}"})
/* */ public String selectUser(@PathVariable("roleId") Long roleId, ModelMap mmap) { public String selectUser(@PathVariable("roleId") Long roleId, ModelMap mmap) {
/* 267 */ mmap.put("role", this.roleService.selectRoleById(roleId)); mmap.put("role", this.roleService.selectRoleById(roleId));
/* 268 */ return this.prefix + "/selectUser"; return this.prefix + "/selectUser";
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"system:role:list"}) @RequiresPermissions({"system:role:list"})
/* */ @PostMapping({"/authUser/unallocatedList"}) @PostMapping({"/authUser/unallocatedList"})
/* */ @ResponseBody @ResponseBody
/* */ public TableDataInfo unallocatedList(User user) { public TableDataInfo unallocatedList(User user) {
/* 279 */ startPage(); startPage();
/* 280 */ List<User> list = this.userService.selectUnallocatedList(user); List<User> list = this.userService.selectUnallocatedList(user);
/* 281 */ return getDataTable(list); return getDataTable(list);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ @Log(title = "角色管理", businessType = BusinessType.GRANT) @Log(title = "角色管理", businessType = BusinessType.GRANT)
/* */ @PostMapping({"/authUser/selectAll"}) @PostMapping({"/authUser/selectAll"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult selectAuthUserAll(Long roleId, String userIds) { public AjaxResult selectAuthUserAll(Long roleId, String userIds) {
/* 292 */ return toAjax(this.roleService.insertAuthUsers(roleId, userIds)); return toAjax(this.roleService.insertAuthUsers(roleId, userIds));
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\system\role\controller\RoleController.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\system\role\controller\RoleController.class

@ -1,203 +1,203 @@
/* */ package com.archive.project.system.role.domain package com.archive.project.system.role.domain
; ;
/* */
/* */ import com.archive.framework.aspectj.lang.annotation.ColumnType; import com.archive.framework.aspectj.lang.annotation.ColumnType;
import com.archive.framework.aspectj.lang.annotation.Excel; import com.archive.framework.aspectj.lang.annotation.Excel;
/* */ import com.archive.framework.web.domain.BaseEntity; import com.archive.framework.web.domain.BaseEntity;
/* */ import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
/* */ import javax.validation.constraints.Size; import javax.validation.constraints.Size;
/* */ import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
/* */ import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class Role public class Role
/* */ extends BaseEntity extends BaseEntity
/* */ { {
/* */ private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/* */ @Excel(name = "角色序号", cellType = ColumnType.NUMERIC) @Excel(name = "角色序号", cellType = ColumnType.NUMERIC)
/* */ private Long roleId; private Long roleId;
/* */ @Excel(name = "角色名称") @Excel(name = "角色名称")
/* */ private String roleName; private String roleName;
/* */ @Excel(name = "角色权限") @Excel(name = "角色权限")
/* */ private String roleKey; private String roleKey;
/* */ @Excel(name = "角色排序") @Excel(name = "角色排序")
/* */ private String roleSort; private String roleSort;
/* */ @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限") @Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限")
/* */ private String dataScope; private String dataScope;
/* */ @Excel(name = "角色状态", readConverterExp = "0=正常,1=停用") @Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
/* */ private String status; private String status;
/* */ private String delFlag; private String delFlag;
/* */ private boolean flag = false; private boolean flag = false;
/* */ private Long[] menuIds; private Long[] menuIds;
/* */ private Long[] deptIds; private Long[] deptIds;
/* */
/* */ public Role() {} public Role() {}
/* */
/* */ public Role(Long roleId) { public Role(Long roleId) {
/* 62 */ this.roleId = roleId; this.roleId = roleId;
/* */ } }
/* */
/* */
/* */ public Long getRoleId() { public Long getRoleId() {
/* 67 */ return this.roleId; return this.roleId;
/* */ } }
/* */
/* */
/* */ public void setRoleId(Long roleId) { public void setRoleId(Long roleId) {
/* 72 */ this.roleId = roleId; this.roleId = roleId;
/* */ } }
/* */
/* */
/* */ public boolean isAdmin() { public boolean isAdmin() {
/* 77 */ return isAdmin(this.roleId); return isAdmin(this.roleId);
/* */ } }
/* */
/* */
/* */ public static boolean isAdmin(Long roleId) { public static boolean isAdmin(Long roleId) {
/* 82 */ return (roleId != null && 1L == roleId.longValue()); return (roleId != null && 1L == roleId.longValue());
/* */ } }
/* */
/* */
/* */ public String getDataScope() { public String getDataScope() {
/* 87 */ return this.dataScope; return this.dataScope;
/* */ } }
/* */
/* */
/* */ public void setDataScope(String dataScope) { public void setDataScope(String dataScope) {
/* 92 */ this.dataScope = dataScope; this.dataScope = dataScope;
/* */ } }
/* */
/* */
/* */ @NotBlank(message = "角色名称不能为空") @NotBlank(message = "角色名称不能为空")
/* */ @Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符") @Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符")
/* */ public String getRoleName() { public String getRoleName() {
/* 99 */ return this.roleName; return this.roleName;
/* */ } }
/* */
/* */
/* */ public void setRoleName(String roleName) { public void setRoleName(String roleName) {
/* 104 */ this.roleName = roleName; this.roleName = roleName;
/* */ } }
/* */
/* */
/* */ @NotBlank(message = "权限字符不能为空") @NotBlank(message = "权限字符不能为空")
/* */ @Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符") @Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符")
/* */ public String getRoleKey() { public String getRoleKey() {
/* 111 */ return this.roleKey; return this.roleKey;
/* */ } }
/* */
/* */
/* */ public void setRoleKey(String roleKey) { public void setRoleKey(String roleKey) {
/* 116 */ this.roleKey = roleKey; this.roleKey = roleKey;
/* */ } }
/* */
/* */
/* */ @NotBlank(message = "显示顺序不能为空") @NotBlank(message = "显示顺序不能为空")
/* */ public String getRoleSort() { public String getRoleSort() {
/* 122 */ return this.roleSort; return this.roleSort;
/* */ } }
/* */
/* */
/* */ public void setRoleSort(String roleSort) { public void setRoleSort(String roleSort) {
/* 127 */ this.roleSort = roleSort; this.roleSort = roleSort;
/* */ } }
/* */
/* */
/* */ public String getStatus() { public String getStatus() {
/* 132 */ return this.status; return this.status;
/* */ } }
/* */
/* */
/* */ public String getDelFlag() { public String getDelFlag() {
/* 137 */ return this.delFlag; return this.delFlag;
/* */ } }
/* */
/* */
/* */ public void setDelFlag(String delFlag) { public void setDelFlag(String delFlag) {
/* 142 */ this.delFlag = delFlag; this.delFlag = delFlag;
/* */ } }
/* */
/* */
/* */ public void setStatus(String status) { public void setStatus(String status) {
/* 147 */ this.status = status; this.status = status;
/* */ } }
/* */
/* */
/* */ public boolean isFlag() { public boolean isFlag() {
/* 152 */ return this.flag; return this.flag;
/* */ } }
/* */
/* */
/* */ public void setFlag(boolean flag) { public void setFlag(boolean flag) {
/* 157 */ this.flag = flag; this.flag = flag;
/* */ } }
/* */
/* */
/* */ public Long[] getMenuIds() { public Long[] getMenuIds() {
/* 162 */ return this.menuIds; return this.menuIds;
/* */ } }
/* */
/* */
/* */ public void setMenuIds(Long[] menuIds) { public void setMenuIds(Long[] menuIds) {
/* 167 */ this.menuIds = menuIds; this.menuIds = menuIds;
/* */ } }
/* */
/* */
/* */ public Long[] getDeptIds() { public Long[] getDeptIds() {
/* 172 */ return this.deptIds; return this.deptIds;
/* */ } }
/* */
/* */
/* */ public void setDeptIds(Long[] deptIds) { public void setDeptIds(Long[] deptIds) {
/* 177 */ this.deptIds = deptIds; this.deptIds = deptIds;
/* */ } }
/* */
/* */
/* */ public String toString() { public String toString() {
/* 182 */ return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)) return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE))
/* 183 */ .append("roleId", getRoleId()) .append("roleId", getRoleId())
/* 184 */ .append("roleName", getRoleName()) .append("roleName", getRoleName())
/* 185 */ .append("roleKey", getRoleKey()) .append("roleKey", getRoleKey())
/* 186 */ .append("roleSort", getRoleSort()) .append("roleSort", getRoleSort())
/* 187 */ .append("dataScope", getDataScope()) .append("dataScope", getDataScope())
/* 188 */ .append("status", getStatus()) .append("status", getStatus())
/* 189 */ .append("delFlag", getDelFlag()) .append("delFlag", getDelFlag())
/* 190 */ .append("createBy", getCreateBy()) .append("createBy", getCreateBy())
/* 191 */ .append("createTime", getCreateTime()) .append("createTime", getCreateTime())
/* 192 */ .append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
/* 193 */ .append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
/* 194 */ .append("remark", getRemark()) .append("remark", getRemark())
/* 195 */ .toString(); .toString();
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\system\role\domain\Role.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\system\role\domain\Role.class

@ -1,51 +1,51 @@
/* */ package com.archive.project.system.role.domain package com.archive.project.system.role.domain
; ;
/* */
/* */ import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
/* */ import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class RoleDept public class RoleDept
/* */ { {
/* */ private Long roleId; private Long roleId;
/* */ private Long deptId; private Long deptId;
/* */
/* */ public Long getRoleId() { public Long getRoleId() {
/* 21 */ return this.roleId; return this.roleId;
/* */ } }
/* */
/* */
/* */ public void setRoleId(Long roleId) { public void setRoleId(Long roleId) {
/* 26 */ this.roleId = roleId; this.roleId = roleId;
/* */ } }
/* */
/* */
/* */ public Long getDeptId() { public Long getDeptId() {
/* 31 */ return this.deptId; return this.deptId;
/* */ } }
/* */
/* */
/* */ public void setDeptId(Long deptId) { public void setDeptId(Long deptId) {
/* 36 */ this.deptId = deptId; this.deptId = deptId;
/* */ } }
/* */
/* */
/* */ public String toString() { public String toString() {
/* 41 */ return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)) return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE))
/* 42 */ .append("roleId", getRoleId()) .append("roleId", getRoleId())
/* 43 */ .append("deptId", getDeptId()) .append("deptId", getDeptId())
/* 44 */ .toString(); .toString();
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\system\role\domain\RoleDept.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\system\role\domain\RoleDept.class

@ -1,51 +1,51 @@
/* */ package com.archive.project.system.role.domain package com.archive.project.system.role.domain
; ;
/* */
/* */ import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
/* */ import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class RoleMenu public class RoleMenu
/* */ { {
/* */ private Long roleId; private Long roleId;
/* */ private Long menuId; private Long menuId;
/* */
/* */ public Long getRoleId() { public Long getRoleId() {
/* 21 */ return this.roleId; return this.roleId;
/* */ } }
/* */
/* */
/* */ public void setRoleId(Long roleId) { public void setRoleId(Long roleId) {
/* 26 */ this.roleId = roleId; this.roleId = roleId;
/* */ } }
/* */
/* */
/* */ public Long getMenuId() { public Long getMenuId() {
/* 31 */ return this.menuId; return this.menuId;
/* */ } }
/* */
/* */
/* */ public void setMenuId(Long menuId) { public void setMenuId(Long menuId) {
/* 36 */ this.menuId = menuId; this.menuId = menuId;
/* */ } }
/* */
/* */
/* */ public String toString() { public String toString() {
/* 41 */ return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)) return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE))
/* 42 */ .append("roleId", getRoleId()) .append("roleId", getRoleId())
/* 43 */ .append("menuId", getMenuId()) .append("menuId", getMenuId())
/* 44 */ .toString(); .toString();
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\system\role\domain\RoleMenu.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\system\role\domain\RoleMenu.class

@ -1,436 +1,436 @@
/* */ package com.archive.project.system.role.service package com.archive.project.system.role.service
; ;
/* */
/* */ import com.archive.common.exception.BusinessException; import com.archive.common.exception.BusinessException;
/* */ import com.archive.common.utils.StringUtils; import com.archive.common.utils.StringUtils;
/* */ import com.archive.common.utils.security.ShiroUtils; import com.archive.common.utils.security.ShiroUtils;
/* */ import com.archive.common.utils.spring.SpringUtils; import com.archive.common.utils.spring.SpringUtils;
/* */ import com.archive.common.utils.text.Convert; import com.archive.common.utils.text.Convert;
/* */ import com.archive.framework.aspectj.lang.annotation.DataScope; import com.archive.framework.aspectj.lang.annotation.DataScope;
/* */ import com.archive.framework.config.ArchiveConfig; import com.archive.framework.config.ArchiveConfig;
/* */ import com.archive.project.system.role.domain.Role; import com.archive.project.system.role.domain.Role;
/* */ import com.archive.project.system.role.domain.RoleDept; import com.archive.project.system.role.domain.RoleDept;
/* */ import com.archive.project.system.role.domain.RoleMenu; import com.archive.project.system.role.domain.RoleMenu;
/* */ import com.archive.project.system.role.mapper.RoleDeptMapper; import com.archive.project.system.role.mapper.RoleDeptMapper;
/* */ import com.archive.project.system.role.mapper.RoleMapper; import com.archive.project.system.role.mapper.RoleMapper;
/* */ import com.archive.project.system.role.mapper.RoleMenuMapper; import com.archive.project.system.role.mapper.RoleMenuMapper;
/* */ import com.archive.project.system.role.service.IRoleService; import com.archive.project.system.role.service.IRoleService;
/* */ import com.archive.project.system.user.domain.UserRole; import com.archive.project.system.user.domain.UserRole;
/* */ import com.archive.project.system.user.mapper.UserRoleMapper; import com.archive.project.system.user.mapper.UserRoleMapper;
/* */ import java.util.ArrayList; import java.util.ArrayList;
/* */ import java.util.Arrays; import java.util.Arrays;
/* */ import java.util.HashSet; import java.util.HashSet;
/* */ import java.util.List; import java.util.List;
/* */ import java.util.Set; import java.util.Set;
/* */ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/* */ import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Service @Service
/* */ public class RoleServiceImpl public class RoleServiceImpl
/* */ implements IRoleService implements IRoleService
/* */ { {
/* */ @Autowired @Autowired
/* */ private RoleMapper roleMapper; private RoleMapper roleMapper;
/* */ @Autowired @Autowired
/* */ private RoleMenuMapper roleMenuMapper; private RoleMenuMapper roleMenuMapper;
/* */ @Autowired @Autowired
/* */ private UserRoleMapper userRoleMapper; private UserRoleMapper userRoleMapper;
/* */ @Autowired @Autowired
/* */ private RoleDeptMapper roleDeptMapper; private RoleDeptMapper roleDeptMapper;
/* */ @Autowired @Autowired
/* */ private ArchiveConfig archiveConfig; private ArchiveConfig archiveConfig;
/* */
/* */ @DataScope(deptAlias = "d") @DataScope(deptAlias = "d")
/* */ public List<Role> selectRoleList(Role role) { public List<Role> selectRoleList(Role role) {
/* 63 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) { if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 64 */ return this.roleMapper.selectRoleList(role); return this.roleMapper.selectRoleList(role);
/* */ } }
/* 66 */ if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 67 */ return this.roleMapper.selectRoleListSqlite(role); return this.roleMapper.selectRoleListSqlite(role);
/* */ } }
/* 69 */ return this.roleMapper.selectRoleList(role); return this.roleMapper.selectRoleList(role);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public Set<String> selectRoleKeys(Long userId) { public Set<String> selectRoleKeys(Long userId) {
/* 86 */ List<Role> perms = this.roleMapper.selectRolesByUserId(userId); List<Role> perms = this.roleMapper.selectRolesByUserId(userId);
/* 87 */ Set<String> permsSet = new HashSet<>(); Set<String> permsSet = new HashSet<>();
/* 88 */ for (Role perm : perms) { for (Role perm : perms) {
/* */
/* 90 */ if (StringUtils.isNotNull(perm)) if (StringUtils.isNotNull(perm))
/* */ { {
/* 92 */ permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(","))); permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(",")));
/* */ } }
/* */ } }
/* 95 */ return permsSet; return permsSet;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public List<Role> selectRolesByUserId(Long userId) { public List<Role> selectRolesByUserId(Long userId) {
/* 107 */ List<Role> userRoles = this.roleMapper.selectRolesByUserId(userId); List<Role> userRoles = this.roleMapper.selectRolesByUserId(userId);
/* 108 */ List<Role> roles = selectRoleAll(); List<Role> roles = selectRoleAll();
/* 109 */ for (Role role : roles) { for (Role role : roles) {
/* */
/* 111 */ for (Role userRole : userRoles) { for (Role userRole : userRoles) {
/* */
/* 113 */ if (role.getRoleId().longValue() == userRole.getRoleId().longValue()) if (role.getRoleId().longValue() == userRole.getRoleId().longValue())
/* */ { {
/* 115 */ role.setFlag(true); role.setFlag(true);
/* */ } }
/* */ } }
/* */ } }
/* */
/* 120 */ return roles; return roles;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public List<Role> selectRoleAll() { public List<Role> selectRoleAll() {
/* 131 */ return ((com.archive.project.system.role.service.RoleServiceImpl)SpringUtils.getAopProxy(this)).selectRoleList(new Role()); return ((com.archive.project.system.role.service.RoleServiceImpl)SpringUtils.getAopProxy(this)).selectRoleList(new Role());
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public Role selectRoleById(Long roleId) { public Role selectRoleById(Long roleId) {
/* 143 */ return this.roleMapper.selectRoleById(roleId); return this.roleMapper.selectRoleById(roleId);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Transactional @Transactional
/* */ public boolean deleteRoleById(Long roleId) { public boolean deleteRoleById(Long roleId) {
/* 157 */ this.roleMenuMapper.deleteRoleMenuByRoleId(roleId); this.roleMenuMapper.deleteRoleMenuByRoleId(roleId);
/* */
/* 159 */ this.roleDeptMapper.deleteRoleDeptByRoleId(roleId); this.roleDeptMapper.deleteRoleDeptByRoleId(roleId);
/* 160 */ return (this.roleMapper.deleteRoleById(roleId) > 0); return (this.roleMapper.deleteRoleById(roleId) > 0);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Transactional @Transactional
/* */ public int deleteRoleByIds(String ids) { public int deleteRoleByIds(String ids) {
/* 173 */ Long[] roleIds = Convert.toLongArray(ids); Long[] roleIds = Convert.toLongArray(ids);
/* 174 */ for (Long roleId : roleIds) { for (Long roleId : roleIds) {
/* */
/* 176 */ checkRoleAllowed(new Role(roleId)); checkRoleAllowed(new Role(roleId));
/* 177 */ Role role = selectRoleById(roleId); Role role = selectRoleById(roleId);
/* 178 */ if (countUserRoleByRoleId(roleId) > 0) if (countUserRoleByRoleId(roleId) > 0)
/* */ { {
/* 180 */ throw new BusinessException(String.format("%1$s已分配,不能删除", new Object[] { role.getRoleName() })); throw new BusinessException(String.format("%1$s已分配,不能删除", new Object[] { role.getRoleName() }));
/* */ } }
/* */ } }
/* */
/* 184 */ this.roleMenuMapper.deleteRoleMenu(roleIds); this.roleMenuMapper.deleteRoleMenu(roleIds);
/* */
/* 186 */ this.roleDeptMapper.deleteRoleDept(roleIds); this.roleDeptMapper.deleteRoleDept(roleIds);
/* 187 */ return this.roleMapper.deleteRoleByIds(roleIds); return this.roleMapper.deleteRoleByIds(roleIds);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Transactional @Transactional
/* */ public int insertRole(Role role) { public int insertRole(Role role) {
/* 200 */ role.setCreateBy(ShiroUtils.getLoginName()); role.setCreateBy(ShiroUtils.getLoginName());
/* */
/* 202 */ this.roleMapper.insertRole(role); this.roleMapper.insertRole(role);
/* 203 */ return insertRoleMenu(role); return insertRoleMenu(role);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Transactional @Transactional
/* */ public int updateRole(Role role) { public int updateRole(Role role) {
/* 216 */ role.setUpdateBy(ShiroUtils.getLoginName()); role.setUpdateBy(ShiroUtils.getLoginName());
/* */
/* 218 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) { if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 219 */ this.roleMapper.updateRole(role); this.roleMapper.updateRole(role);
/* */ } }
/* 221 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 222 */ this.roleMapper.updateRoleSqlite(role); this.roleMapper.updateRoleSqlite(role);
/* */ } }
/* */
/* */
/* 226 */ this.roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId()); this.roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId());
/* 227 */ return insertRoleMenu(role); return insertRoleMenu(role);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Transactional @Transactional
/* */ public int authDataScope(Role role) { public int authDataScope(Role role) {
/* 240 */ role.setUpdateBy(ShiroUtils.getLoginName()); role.setUpdateBy(ShiroUtils.getLoginName());
/* */
/* 242 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) { if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 243 */ this.roleMapper.updateRole(role); this.roleMapper.updateRole(role);
/* */ } }
/* 245 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 246 */ this.roleMapper.updateRoleSqlite(role); this.roleMapper.updateRoleSqlite(role);
/* */ } }
/* */
/* 249 */ this.roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId()); this.roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId());
/* */
/* 251 */ return insertRoleDept(role); return insertRoleDept(role);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int insertRoleMenu(Role role) { public int insertRoleMenu(Role role) {
/* 261 */ int rows = 1; int rows = 1;
/* */
/* 263 */ List<RoleMenu> list = new ArrayList<>(); List<RoleMenu> list = new ArrayList<>();
/* 264 */ for (Long menuId : role.getMenuIds()) { for (Long menuId : role.getMenuIds()) {
/* */
/* 266 */ RoleMenu rm = new RoleMenu(); RoleMenu rm = new RoleMenu();
/* 267 */ rm.setRoleId(role.getRoleId()); rm.setRoleId(role.getRoleId());
/* 268 */ rm.setMenuId(menuId); rm.setMenuId(menuId);
/* 269 */ list.add(rm); list.add(rm);
/* */ } }
/* 271 */ if (list.size() > 0) if (list.size() > 0)
/* */ { {
/* 273 */ rows = this.roleMenuMapper.batchRoleMenu(list); rows = this.roleMenuMapper.batchRoleMenu(list);
/* */ } }
/* 275 */ return rows; return rows;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int insertRoleDept(Role role) { public int insertRoleDept(Role role) {
/* 285 */ int rows = 1; int rows = 1;
/* */
/* 287 */ List<RoleDept> list = new ArrayList<>(); List<RoleDept> list = new ArrayList<>();
/* 288 */ for (Long deptId : role.getDeptIds()) { for (Long deptId : role.getDeptIds()) {
/* */
/* 290 */ RoleDept rd = new RoleDept(); RoleDept rd = new RoleDept();
/* 291 */ rd.setRoleId(role.getRoleId()); rd.setRoleId(role.getRoleId());
/* 292 */ rd.setDeptId(deptId); rd.setDeptId(deptId);
/* 293 */ list.add(rd); list.add(rd);
/* */ } }
/* 295 */ if (list.size() > 0) if (list.size() > 0)
/* */ { {
/* 297 */ rows = this.roleDeptMapper.batchRoleDept(list); rows = this.roleDeptMapper.batchRoleDept(list);
/* */ } }
/* 299 */ return rows; return rows;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public String checkRoleNameUnique(Role role) { public String checkRoleNameUnique(Role role) {
/* 311 */ Long roleId = Long.valueOf(StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId().longValue()); Long roleId = Long.valueOf(StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId().longValue());
/* 312 */ Role info = this.roleMapper.checkRoleNameUnique(role.getRoleName()); Role info = this.roleMapper.checkRoleNameUnique(role.getRoleName());
/* 313 */ if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
/* */ { {
/* 315 */ return "1"; return "1";
/* */ } }
/* 317 */ return "0"; return "0";
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public String checkRoleKeyUnique(Role role) { public String checkRoleKeyUnique(Role role) {
/* 329 */ Long roleId = Long.valueOf(StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId().longValue()); Long roleId = Long.valueOf(StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId().longValue());
/* 330 */ Role info = this.roleMapper.checkRoleKeyUnique(role.getRoleKey()); Role info = this.roleMapper.checkRoleKeyUnique(role.getRoleKey());
/* 331 */ if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue())
/* */ { {
/* 333 */ return "1"; return "1";
/* */ } }
/* 335 */ return "0"; return "0";
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void checkRoleAllowed(Role role) { public void checkRoleAllowed(Role role) {
/* 346 */ if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin()) if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin())
/* */ { {
/* 348 */ throw new BusinessException("不允许操作超级管理员角色"); throw new BusinessException("不允许操作超级管理员角色");
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int countUserRoleByRoleId(Long roleId) { public int countUserRoleByRoleId(Long roleId) {
/* 361 */ return this.userRoleMapper.countUserRoleByRoleId(roleId); return this.userRoleMapper.countUserRoleByRoleId(roleId);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int changeStatus(Role role) { public int changeStatus(Role role) {
/* 373 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) { if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 374 */ return this.roleMapper.updateRole(role); return this.roleMapper.updateRole(role);
/* */ } }
/* 376 */ if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 377 */ return this.roleMapper.updateRoleSqlite(role); return this.roleMapper.updateRoleSqlite(role);
/* */ } }
/* 379 */ return this.roleMapper.updateRole(role); return this.roleMapper.updateRole(role);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int deleteAuthUser(UserRole userRole) { public int deleteAuthUser(UserRole userRole) {
/* 393 */ return this.userRoleMapper.deleteUserRoleInfo(userRole); return this.userRoleMapper.deleteUserRoleInfo(userRole);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int deleteAuthUsers(Long roleId, String userIds) { public int deleteAuthUsers(Long roleId, String userIds) {
/* 406 */ return this.userRoleMapper.deleteUserRoleInfos(roleId, Convert.toLongArray(userIds)); return this.userRoleMapper.deleteUserRoleInfos(roleId, Convert.toLongArray(userIds));
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int insertAuthUsers(Long roleId, String userIds) { public int insertAuthUsers(Long roleId, String userIds) {
/* 419 */ Long[] users = Convert.toLongArray(userIds); Long[] users = Convert.toLongArray(userIds);
/* */
/* 421 */ List<UserRole> list = new ArrayList<>(); List<UserRole> list = new ArrayList<>();
/* 422 */ for (Long userId : users) { for (Long userId : users) {
/* */
/* 424 */ UserRole ur = new UserRole(); UserRole ur = new UserRole();
/* 425 */ ur.setUserId(userId); ur.setUserId(userId);
/* 426 */ ur.setRoleId(roleId); ur.setRoleId(roleId);
/* 427 */ list.add(ur); list.add(ur);
/* */ } }
/* 429 */ return this.userRoleMapper.batchUserRole(list); return this.userRoleMapper.batchUserRole(list);
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\system\role\service\RoleServiceImpl.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\system\role\service\RoleServiceImpl.class

@ -1,51 +1,51 @@
/* */ package com.archive.project.system.user.controller package com.archive.project.system.user.controller
; ;
/* */
/* */ import com.archive.framework.shiro.service.RegisterService; import com.archive.framework.shiro.service.RegisterService;
/* */ import com.archive.framework.web.controller.BaseController; import com.archive.framework.web.controller.BaseController;
/* */ import com.archive.framework.web.domain.AjaxResult; import com.archive.framework.web.domain.AjaxResult;
/* */ import com.archive.project.system.config.service.IConfigService; import com.archive.project.system.config.service.IConfigService;
/* */ import com.archive.project.system.user.domain.User; import com.archive.project.system.user.domain.User;
/* */ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
/* */ import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
/* */ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
/* */ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
/* */ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Controller @Controller
/* */ public class RegisterController public class RegisterController
/* */ extends BaseController extends BaseController
/* */ { {
/* */ @Autowired @Autowired
/* */ private RegisterService registerService; private RegisterService registerService;
/* */ @Autowired @Autowired
/* */ private IConfigService configService; private IConfigService configService;
/* */
/* */ @GetMapping({"/register"}) @GetMapping({"/register"})
/* */ public String register() { public String register() {
/* 32 */ return "register"; return "register";
/* */ } }
/* */
/* */
/* */ @PostMapping({"/register"}) @PostMapping({"/register"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult ajaxRegister(User user) { public AjaxResult ajaxRegister(User user) {
/* 39 */ if (!"true".equals(this.configService.selectConfigByKey("sys.account.registerUser"))) if (!"true".equals(this.configService.selectConfigByKey("sys.account.registerUser")))
/* */ { {
/* 41 */ return error("当前系统没有开启注册功能!"); return error("当前系统没有开启注册功能!");
/* */ } }
/* 43 */ String msg = this.registerService.register(user); String msg = this.registerService.register(user);
/* 44 */ return StringUtils.isEmpty(msg) ? success() : error(msg); return StringUtils.isEmpty(msg) ? success() : error(msg);
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\syste\\user\controller\RegisterController.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\syste\\user\controller\RegisterController.class

Loading…
Cancel
Save