feat:修改任务

dev
wangxy 8 months ago
parent fc5784e92c
commit 5a2c947b0c

@ -1,200 +1,200 @@
/* */ package com.archive.common.utils
package com.archive.common.utils
;
/* */
/* */ import com.archive.common.utils.StringUtils;
/* */ import java.net.InetAddress;
/* */ import java.net.UnknownHostException;
/* */ import javax.servlet.http.HttpServletRequest;
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class IpUtils
/* */ {
/* */ public static String getIpAddr(HttpServletRequest request) {
/* 16 */ if (request == null)
/* */ {
/* 18 */ return "unknown";
/* */ }
/* 20 */ String ip = request.getHeader("x-forwarded-for");
/* 21 */ if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
/* */ {
/* 23 */ ip = request.getHeader("Proxy-Client-IP");
/* */ }
/* 25 */ if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
/* */ {
/* 27 */ ip = request.getHeader("X-Forwarded-For");
/* */ }
/* 29 */ if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
/* */ {
/* 31 */ ip = request.getHeader("WL-Proxy-Client-IP");
/* */ }
/* 33 */ if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
/* */ {
/* 35 */ ip = request.getHeader("X-Real-IP");
/* */ }
/* */
/* 38 */ if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
/* */ {
/* 40 */ ip = request.getRemoteAddr();
/* */ }
/* */
/* 43 */ return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
/* */ }
/* */
/* */
/* */ public static boolean internalIp(String ip) {
/* 48 */ byte[] addr = textToNumericFormatV4(ip);
/* 49 */ return (internalIp(addr) || "127.0.0.1".equals(ip));
/* */ }
/* */
/* */
/* */ private static boolean internalIp(byte[] addr) {
/* 54 */ if (StringUtils.isNull(addr) || addr.length < 2)
/* */ {
/* 56 */ return true;
/* */ }
/* 58 */ byte b0 = addr[0];
/* 59 */ byte b1 = addr[1];
/* */
/* 61 */ byte SECTION_1 = 10;
/* */
/* 63 */ byte SECTION_2 = -84;
/* 64 */ byte SECTION_3 = 16;
/* 65 */ byte SECTION_4 = 31;
/* */
/* 67 */ byte SECTION_5 = -64;
/* 68 */ byte SECTION_6 = -88;
/* 69 */ switch (b0) {
/* */
/* */ case 10:
/* 72 */ return true;
/* */ case -84:
/* 74 */ if (b1 >= 16 && b1 <= 31)
/* */ {
/* 76 */ return true;
/* */ }
/* */ case -64:
/* 79 */ switch (b1) {
/* */
/* */ case -88:
/* 82 */ return true;
/* */ } break;
/* */ }
/* 85 */ return false;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static byte[] textToNumericFormatV4(String text) {
/* 97 */ if (text.length() == 0)
/* */ {
/* 99 */ return null;
/* */ }
/* */
/* 102 */ byte[] bytes = new byte[4];
/* 103 */ String[] elements = text.split("\\.", -1);
/* */
/* */ try {
/* */ long l;
/* */ int i;
/* 108 */ switch (elements.length) {
/* */
/* */ case 1:
/* 111 */ l = Long.parseLong(elements[0]);
/* 112 */ if (l < 0L || l > 4294967295L) {
/* 113 */ return null;
/* */ }
/* 115 */ bytes[0] = (byte)(int)(l >> 24L & 0xFFL);
/* 116 */ bytes[1] = (byte)(int)((l & 0xFFFFFFL) >> 16L & 0xFFL);
/* 117 */ bytes[2] = (byte)(int)((l & 0xFFFFL) >> 8L & 0xFFL);
/* 118 */ bytes[3] = (byte)(int)(l & 0xFFL);
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* 168 */ return bytes;case 2: l = Integer.parseInt(elements[0]); if (l < 0L || l > 255L) return null; bytes[0] = (byte)(int)(l & 0xFFL); l = Integer.parseInt(elements[1]); if (l < 0L || l > 16777215L) return null; bytes[1] = (byte)(int)(l >> 16L & 0xFFL); bytes[2] = (byte)(int)((l & 0xFFFFL) >> 8L & 0xFFL); bytes[3] = (byte)(int)(l & 0xFFL); return bytes;case 3: for (i = 0; i < 2; i++) { l = Integer.parseInt(elements[i]); if (l < 0L || l > 255L) return null; bytes[i] = (byte)(int)(l & 0xFFL); } l = Integer.parseInt(elements[2]); if (l < 0L || l > 65535L) return null; bytes[2] = (byte)(int)(l >> 8L & 0xFFL); bytes[3] = (byte)(int)(l & 0xFFL); return bytes;case 4: for (i = 0; i < 4; i++) { l = Integer.parseInt(elements[i]); if (l < 0L || l > 255L) return null; bytes[i] = (byte)(int)(l & 0xFFL); } return bytes;
/* */ }
/* */ return null;
/* */ } catch (NumberFormatException e) {
/* */ return null;
/* */ } } public static String getHostIp() {
/* */ try {
/* 175 */ return InetAddress.getLocalHost().getHostAddress();
/* */ }
/* 177 */ catch (UnknownHostException unknownHostException) {
/* */
/* */
/* 180 */ return "127.0.0.1";
/* */ }
/* */ }
/* */
/* */
/* */ public static String getHostName() {
/* */ try {
/* 187 */ return InetAddress.getLocalHost().getHostName();
/* */ }
/* 189 */ catch (UnknownHostException unknownHostException) {
/* */
/* */
/* 192 */ return "未知";
/* */ }
/* */ }
/* */ }
import com.archive.common.utils.StringUtils;
import java.net.InetAddress;
import java.net.UnknownHostException;
import javax.servlet.http.HttpServletRequest;
public class IpUtils
{
public static String getIpAddr(HttpServletRequest request) {
if (request == null)
{
return "unknown";
}
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
{
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
{
ip = request.getHeader("X-Forwarded-For");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
{
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
{
ip = request.getHeader("X-Real-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip))
{
ip = request.getRemoteAddr();
}
return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
}
public static boolean internalIp(String ip) {
byte[] addr = textToNumericFormatV4(ip);
return (internalIp(addr) || "127.0.0.1".equals(ip));
}
private static boolean internalIp(byte[] addr) {
if (StringUtils.isNull(addr) || addr.length < 2)
{
return true;
}
byte b0 = addr[0];
byte b1 = addr[1];
byte SECTION_1 = 10;
byte SECTION_2 = -84;
byte SECTION_3 = 16;
byte SECTION_4 = 31;
byte SECTION_5 = -64;
byte SECTION_6 = -88;
switch (b0) {
case 10:
return true;
case -84:
if (b1 >= 16 && b1 <= 31)
{
return true;
}
case -64:
switch (b1) {
case -88:
return true;
} break;
}
return false;
}
public static byte[] textToNumericFormatV4(String text) {
if (text.length() == 0)
{
return null;
}
byte[] bytes = new byte[4];
String[] elements = text.split("\\.", -1);
try {
long l;
int i;
switch (elements.length) {
case 1:
l = Long.parseLong(elements[0]);
if (l < 0L || l > 4294967295L) {
return null;
}
bytes[0] = (byte)(int)(l >> 24L & 0xFFL);
bytes[1] = (byte)(int)((l & 0xFFFFFFL) >> 16L & 0xFFL);
bytes[2] = (byte)(int)((l & 0xFFFFL) >> 8L & 0xFFL);
bytes[3] = (byte)(int)(l & 0xFFL);
return bytes;case 2: l = Integer.parseInt(elements[0]); if (l < 0L || l > 255L) return null; bytes[0] = (byte)(int)(l & 0xFFL); l = Integer.parseInt(elements[1]); if (l < 0L || l > 16777215L) return null; bytes[1] = (byte)(int)(l >> 16L & 0xFFL); bytes[2] = (byte)(int)((l & 0xFFFFL) >> 8L & 0xFFL); bytes[3] = (byte)(int)(l & 0xFFL); return bytes;case 3: for (i = 0; i < 2; i++) { l = Integer.parseInt(elements[i]); if (l < 0L || l > 255L) return null; bytes[i] = (byte)(int)(l & 0xFFL); } l = Integer.parseInt(elements[2]); if (l < 0L || l > 65535L) return null; bytes[2] = (byte)(int)(l >> 8L & 0xFFL); bytes[3] = (byte)(int)(l & 0xFFL); return bytes;case 4: for (i = 0; i < 4; i++) { l = Integer.parseInt(elements[i]); if (l < 0L || l > 255L) return null; bytes[i] = (byte)(int)(l & 0xFFL); } return bytes;
}
return null;
} catch (NumberFormatException e) {
return null;
} } public static String getHostIp() {
try {
return InetAddress.getLocalHost().getHostAddress();
}
catch (UnknownHostException unknownHostException) {
return "127.0.0.1";
}
}
public static String getHostName() {
try {
return InetAddress.getLocalHost().getHostName();
}
catch (UnknownHostException unknownHostException) {
return "未知";
}
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\IpUtils.class

@ -1,188 +1,188 @@
/* */ package com.archive.framework.aspectj;
/* */
/* */ import com.alibaba.fastjson.JSONObject;
/* */ import com.alibaba.fastjson.serializer.SerializeFilter;
/* */ import com.alibaba.fastjson.support.spring.PropertyPreFilters;
/* */ import com.archive.common.utils.ServletUtils;
/* */ import com.archive.common.utils.StringUtils;
/* */ import com.archive.common.utils.security.ShiroUtils;
/* */ import com.archive.framework.aspectj.lang.annotation.Log;
/* */ import com.archive.framework.aspectj.lang.enums.BusinessStatus;
/* */ import com.archive.framework.manager.AsyncManager;
/* */ import com.archive.framework.manager.factory.AsyncFactory;
/* */ import com.archive.project.monitor.operlog.domain.OperLog;
/* */ import com.archive.project.system.user.domain.User;
/* */ import java.lang.reflect.Method;
/* */ import java.util.Map;
/* */ import org.aspectj.lang.JoinPoint;
/* */ import org.aspectj.lang.Signature;
/* */ import org.aspectj.lang.annotation.AfterReturning;
/* */ import org.aspectj.lang.annotation.AfterThrowing;
/* */ import org.aspectj.lang.annotation.Aspect;
/* */ import org.aspectj.lang.annotation.Pointcut;
/* */ import org.aspectj.lang.reflect.MethodSignature;
/* */ import org.slf4j.Logger;
/* */ import org.slf4j.LoggerFactory;
/* */ import org.springframework.stereotype.Component;
/* */
/* */
/* */
/* */
/* */
/* */ @Aspect
/* */ @Component
/* */ public class LogAspect
/* */ {
/* 36 */ private static final Logger log = LoggerFactory.getLogger(com.archive.framework.aspectj.LogAspect.class);
/* */
/* */
/* 39 */ public static final String[] EXCLUDE_PROPERTIES = new String[] { "password", "oldPassword", "newPassword", "confirmPassword" };
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Pointcut("@annotation(com.archive.framework.aspectj.lang.annotation.Log)")
/* */ public void logPointCut() {}
/* */
/* */
/* */
/* */
/* */
/* */ @AfterReturning(pointcut = "logPointCut()", returning = "jsonResult")
/* */ public void doAfterReturning(JoinPoint joinPoint, Object jsonResult) {
/* 55 */ handleLog(joinPoint, null, jsonResult);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @AfterThrowing(value = "logPointCut()", throwing = "e")
/* */ public void doAfterThrowing(JoinPoint joinPoint, Exception e) {
/* 67 */ handleLog(joinPoint, e, null);
/* */ }
/* */
/* */
/* */
/* */
/* */ protected void handleLog(JoinPoint joinPoint, Exception e, Object jsonResult) {
/* */ try {
/* 75 */ Log controllerLog = getAnnotationLog(joinPoint);
/* 76 */ if (controllerLog == null) {
/* */ return;
/* */ }
/* */
/* */
/* */
/* 82 */ User currentUser = ShiroUtils.getSysUser();
/* */
/* */
/* 85 */ OperLog operLog = new OperLog();
/* 86 */ operLog.setStatus(Integer.valueOf(BusinessStatus.SUCCESS.ordinal()));
/* */
/* 88 */ String ip = ShiroUtils.getIp();
/* 89 */ operLog.setOperIp(ip);
/* */
/* 91 */ operLog.setJsonResult(StringUtils.substring(JSONObject.toJSONString(jsonResult), 0, 2000));
/* */
/* 93 */ operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
/* 94 */ if (currentUser != null) {
/* */
/* 96 */ operLog.setOperName(currentUser.getLoginName());
/* 97 */ if (StringUtils.isNotNull(currentUser.getDept()) &&
/* 98 */ StringUtils.isNotEmpty(currentUser.getDept().getDeptName()))
/* */ {
/* 100 */ operLog.setDeptName(currentUser.getDept().getDeptName());
/* */ }
/* */ }
/* */
/* 104 */ if (e != null) {
/* */
/* 106 */ operLog.setStatus(Integer.valueOf(BusinessStatus.FAIL.ordinal()));
/* 107 */ operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000));
/* */ }
/* */
/* 110 */ String className = joinPoint.getTarget().getClass().getName();
/* 111 */ String methodName = joinPoint.getSignature().getName();
/* 112 */ operLog.setMethod(className + "." + methodName + "()");
/* */
/* 114 */ operLog.setRequestMethod(ServletUtils.getRequest().getMethod());
/* */
/* 116 */ getControllerMethodDescription(controllerLog, operLog);
/* */
/* 118 */ AsyncManager.me().execute(AsyncFactory.recordOper(operLog));
/* */ }
/* 120 */ catch (Exception exp) {
/* */
/* */
/* 123 */ log.error("==前置通知异常==");
/* 124 */ log.error("异常信息:{}", exp.getMessage());
/* 125 */ exp.printStackTrace();
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void getControllerMethodDescription(Log log, OperLog operLog) throws Exception {
/* 139 */ operLog.setBusinessType(Integer.valueOf(log.businessType().ordinal()));
/* */
/* 141 */ operLog.setTitle(log.title());
/* */
/* 143 */ operLog.setOperatorType(Integer.valueOf(log.operatorType().ordinal()));
/* */
/* 145 */ if (log.isSaveRequestData())
/* */ {
/* */
/* 148 */ setRequestValue(operLog);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ private void setRequestValue(OperLog operLog) {
/* 160 */ Map<String, String[]> map = ServletUtils.getRequest().getParameterMap();
/* 161 */ if (StringUtils.isNotEmpty(map)) {
/* */
/* 163 */ PropertyPreFilters.MySimplePropertyPreFilter excludefilter = (new PropertyPreFilters()).addFilter();
/* 164 */ excludefilter.addExcludes(EXCLUDE_PROPERTIES);
/* 165 */ String params = JSONObject.toJSONString(map, (SerializeFilter)excludefilter, new com.alibaba.fastjson.serializer.SerializerFeature[0]);
/* 166 */ operLog.setOperParam(StringUtils.substring(params, 0, 2000));
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ private Log getAnnotationLog(JoinPoint joinPoint) throws Exception {
/* 175 */ Signature signature = joinPoint.getSignature();
/* 176 */ MethodSignature methodSignature = (MethodSignature)signature;
/* 177 */ Method method = methodSignature.getMethod();
/* */
/* 179 */ if (method != null)
/* */ {
/* 181 */ return method.<Log>getAnnotation(Log.class);
/* */ }
/* 183 */ return null;
/* */ }
/* */ }
package com.archive.framework.aspectj;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializeFilter;
import com.alibaba.fastjson.support.spring.PropertyPreFilters;
import com.archive.common.utils.ServletUtils;
import com.archive.common.utils.StringUtils;
import com.archive.common.utils.security.ShiroUtils;
import com.archive.framework.aspectj.lang.annotation.Log;
import com.archive.framework.aspectj.lang.enums.BusinessStatus;
import com.archive.framework.manager.AsyncManager;
import com.archive.framework.manager.factory.AsyncFactory;
import com.archive.project.monitor.operlog.domain.OperLog;
import com.archive.project.system.user.domain.User;
import java.lang.reflect.Method;
import java.util.Map;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@Aspect
@Component
public class LogAspect
{
private static final Logger log = LoggerFactory.getLogger(com.archive.framework.aspectj.LogAspect.class);
public static final String[] EXCLUDE_PROPERTIES = new String[] { "password", "oldPassword", "newPassword", "confirmPassword" };
@Pointcut("@annotation(com.archive.framework.aspectj.lang.annotation.Log)")
public void logPointCut() {}
@AfterReturning(pointcut = "logPointCut()", returning = "jsonResult")
public void doAfterReturning(JoinPoint joinPoint, Object jsonResult) {
handleLog(joinPoint, null, jsonResult);
}
@AfterThrowing(value = "logPointCut()", throwing = "e")
public void doAfterThrowing(JoinPoint joinPoint, Exception e) {
handleLog(joinPoint, e, null);
}
protected void handleLog(JoinPoint joinPoint, Exception e, Object jsonResult) {
try {
Log controllerLog = getAnnotationLog(joinPoint);
if (controllerLog == null) {
return;
}
User currentUser = ShiroUtils.getSysUser();
OperLog operLog = new OperLog();
operLog.setStatus(Integer.valueOf(BusinessStatus.SUCCESS.ordinal()));
String ip = ShiroUtils.getIp();
operLog.setOperIp(ip);
operLog.setJsonResult(StringUtils.substring(JSONObject.toJSONString(jsonResult), 0, 2000));
operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
if (currentUser != null) {
operLog.setOperName(currentUser.getLoginName());
if (StringUtils.isNotNull(currentUser.getDept()) &&
StringUtils.isNotEmpty(currentUser.getDept().getDeptName()))
{
operLog.setDeptName(currentUser.getDept().getDeptName());
}
}
if (e != null) {
operLog.setStatus(Integer.valueOf(BusinessStatus.FAIL.ordinal()));
operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000));
}
String className = joinPoint.getTarget().getClass().getName();
String methodName = joinPoint.getSignature().getName();
operLog.setMethod(className + "." + methodName + "()");
operLog.setRequestMethod(ServletUtils.getRequest().getMethod());
getControllerMethodDescription(controllerLog, operLog);
AsyncManager.me().execute(AsyncFactory.recordOper(operLog));
}
catch (Exception exp) {
log.error("==前置通知异常==");
log.error("异常信息:{}", exp.getMessage());
exp.printStackTrace();
}
}
public void getControllerMethodDescription(Log log, OperLog operLog) throws Exception {
operLog.setBusinessType(Integer.valueOf(log.businessType().ordinal()));
operLog.setTitle(log.title());
operLog.setOperatorType(Integer.valueOf(log.operatorType().ordinal()));
if (log.isSaveRequestData())
{
setRequestValue(operLog);
}
}
private void setRequestValue(OperLog operLog) {
Map<String, String[]> map = ServletUtils.getRequest().getParameterMap();
if (StringUtils.isNotEmpty(map)) {
PropertyPreFilters.MySimplePropertyPreFilter excludefilter = (new PropertyPreFilters()).addFilter();
excludefilter.addExcludes(EXCLUDE_PROPERTIES);
String params = JSONObject.toJSONString(map, (SerializeFilter)excludefilter, new com.alibaba.fastjson.serializer.SerializerFeature[0]);
operLog.setOperParam(StringUtils.substring(params, 0, 2000));
}
}
private Log getAnnotationLog(JoinPoint joinPoint) throws Exception {
Signature signature = joinPoint.getSignature();
MethodSignature methodSignature = (MethodSignature)signature;
Method method = methodSignature.getMethod();
if (method != null)
{
return method.<Log>getAnnotation(Log.class);
}
return null;
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\aspectj\LogAspect.class

@ -1,81 +1,81 @@
/* */ package com.archive.framework.config
package com.archive.framework.config
;
/* */
/* */ import com.google.code.kaptcha.text.impl.DefaultTextCreator;
/* */ import java.security.SecureRandom;
/* */ import java.util.Random;
/* */
/* */
/* */
/* */
/* */
/* */ public class KaptchaTextCreator
/* */ extends DefaultTextCreator
/* */ {
/* 14 */ private static final String[] CNUMBERS = "0,1,2,3,4,5,6,7,8,9,10".split(",");
/* */
/* */
/* */
/* */ public String getText() {
/* 19 */ Integer result = Integer.valueOf(0);
/* 20 */ Random random = new SecureRandom();
/* 21 */ int x = random.nextInt(10);
/* 22 */ int y = random.nextInt(10);
/* 23 */ StringBuilder suChinese = new StringBuilder();
/* 24 */ int randomoperands = (int)Math.round(Math.random() * 2.0D);
/* 25 */ if (randomoperands == 0) {
/* */
/* 27 */ result = Integer.valueOf(x * y);
/* 28 */ suChinese.append(CNUMBERS[x]);
/* 29 */ suChinese.append("*");
/* 30 */ suChinese.append(CNUMBERS[y]);
/* */ }
/* 32 */ else if (randomoperands == 1) {
/* */
/* 34 */ if (x != 0 && y % x == 0)
/* */ {
/* 36 */ result = Integer.valueOf(y / x);
/* 37 */ suChinese.append(CNUMBERS[y]);
/* 38 */ suChinese.append("/");
/* 39 */ suChinese.append(CNUMBERS[x]);
/* */ }
/* */ else
/* */ {
/* 43 */ result = Integer.valueOf(x + y);
/* 44 */ suChinese.append(CNUMBERS[x]);
/* 45 */ suChinese.append("+");
/* 46 */ suChinese.append(CNUMBERS[y]);
/* */ }
/* */
/* 49 */ } else if (randomoperands == 2) {
/* */
/* 51 */ if (x >= y)
/* */ {
/* 53 */ result = Integer.valueOf(x - y);
/* 54 */ suChinese.append(CNUMBERS[x]);
/* 55 */ suChinese.append("-");
/* 56 */ suChinese.append(CNUMBERS[y]);
/* */ }
/* */ else
/* */ {
/* 60 */ result = Integer.valueOf(y - x);
/* 61 */ suChinese.append(CNUMBERS[y]);
/* 62 */ suChinese.append("-");
/* 63 */ suChinese.append(CNUMBERS[x]);
/* */ }
/* */
/* */ } else {
/* */
/* 68 */ result = Integer.valueOf(x + y);
/* 69 */ suChinese.append(CNUMBERS[x]);
/* 70 */ suChinese.append("+");
/* 71 */ suChinese.append(CNUMBERS[y]);
/* */ }
/* 73 */ suChinese.append("=?@" + result);
/* 74 */ return suChinese.toString();
/* */ }
/* */ }
import com.google.code.kaptcha.text.impl.DefaultTextCreator;
import java.security.SecureRandom;
import java.util.Random;
public class KaptchaTextCreator
extends DefaultTextCreator
{
private static final String[] CNUMBERS = "0,1,2,3,4,5,6,7,8,9,10".split(",");
public String getText() {
Integer result = Integer.valueOf(0);
Random random = new SecureRandom();
int x = random.nextInt(10);
int y = random.nextInt(10);
StringBuilder suChinese = new StringBuilder();
int randomoperands = (int)Math.round(Math.random() * 2.0D);
if (randomoperands == 0) {
result = Integer.valueOf(x * y);
suChinese.append(CNUMBERS[x]);
suChinese.append("*");
suChinese.append(CNUMBERS[y]);
}
else if (randomoperands == 1) {
if (x != 0 && y % x == 0)
{
result = Integer.valueOf(y / x);
suChinese.append(CNUMBERS[y]);
suChinese.append("/");
suChinese.append(CNUMBERS[x]);
}
else
{
result = Integer.valueOf(x + y);
suChinese.append(CNUMBERS[x]);
suChinese.append("+");
suChinese.append(CNUMBERS[y]);
}
} else if (randomoperands == 2) {
if (x >= y)
{
result = Integer.valueOf(x - y);
suChinese.append(CNUMBERS[x]);
suChinese.append("-");
suChinese.append(CNUMBERS[y]);
}
else
{
result = Integer.valueOf(y - x);
suChinese.append(CNUMBERS[y]);
suChinese.append("-");
suChinese.append(CNUMBERS[x]);
}
} else {
result = Integer.valueOf(x + y);
suChinese.append(CNUMBERS[x]);
suChinese.append("+");
suChinese.append(CNUMBERS[y]);
}
suChinese.append("=?@" + result);
return suChinese.toString();
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\config\KaptchaTextCreator.class

@ -1,191 +1,191 @@
/* */ package com.archive.framework.shiro.web.filter.kickout
package com.archive.framework.shiro.web.filter.kickout
;
/* */
/* */ import com.archive.common.utils.ServletUtils;
/* */ import com.archive.common.utils.security.ShiroUtils;
/* */ import com.archive.framework.web.domain.AjaxResult;
/* */ import com.archive.project.system.user.domain.User;
/* */ import com.fasterxml.jackson.databind.ObjectMapper;
/* */ import java.io.IOException;
/* */ import java.io.Serializable;
/* */ import java.util.ArrayDeque;
/* */ import java.util.Deque;
/* */ import javax.servlet.ServletRequest;
/* */ import javax.servlet.ServletResponse;
/* */ import javax.servlet.http.HttpServletRequest;
/* */ import javax.servlet.http.HttpServletResponse;
/* */ import org.apache.shiro.cache.Cache;
/* */ import org.apache.shiro.cache.CacheManager;
/* */ import org.apache.shiro.session.Session;
/* */ import org.apache.shiro.session.mgt.DefaultSessionKey;
/* */ import org.apache.shiro.session.mgt.SessionKey;
/* */ import org.apache.shiro.session.mgt.SessionManager;
/* */ import org.apache.shiro.subject.Subject;
/* */ import org.apache.shiro.web.filter.AccessControlFilter;
/* */ import org.apache.shiro.web.util.WebUtils;
/* */
/* */
/* */
/* */
/* */
/* */ public class KickoutSessionFilter
/* */ extends AccessControlFilter
/* */ {
/* 33 */ private static final ObjectMapper objectMapper = new ObjectMapper();
/* */
/* */
/* */
/* */
/* 38 */ private int maxSession = -1;
/* */
/* */
/* */
/* */
/* 43 */ private Boolean kickoutAfter = Boolean.valueOf(false);
/* */
/* */
/* */ private String kickoutUrl;
/* */
/* */
/* */ private SessionManager sessionManager;
/* */
/* */
/* */ private Cache<String, Deque<Serializable>> cache;
/* */
/* */
/* */
/* */ protected boolean isAccessAllowed(ServletRequest servletRequest, ServletResponse servletResponse, Object o) throws Exception {
/* 57 */ return false;
/* */ }
/* */
/* */
/* */
/* */ protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
/* 63 */ Subject subject = getSubject(request, response);
/* 64 */ if ((!subject.isAuthenticated() && !subject.isRemembered()) || this.maxSession == -1)
/* */ {
/* */
/* 67 */ return true;
/* */ }
/* */
/* */ try {
/* 71 */ Session session = subject.getSession();
/* */
/* 73 */ User user = ShiroUtils.getSysUser();
/* 74 */ String loginName = user.getLoginName();
/* 75 */ Serializable sessionId = session.getId();
/* */
/* */
/* 78 */ Deque<Serializable> deque = (Deque<Serializable>)this.cache.get(loginName);
/* 79 */ if (deque == null)
/* */ {
/* */
/* 82 */ deque = new ArrayDeque<>();
/* */ }
/* */
/* */
/* 86 */ if (!deque.contains(sessionId) && session.getAttribute("kickout") == null) {
/* */
/* */
/* 89 */ deque.push(sessionId);
/* */
/* 91 */ this.cache.put(loginName, deque);
/* */ }
/* */
/* */
/* 95 */ while (deque.size() > this.maxSession) {
/* */
/* 97 */ Serializable kickoutSessionId = null;
/* */
/* 99 */ if (this.kickoutAfter.booleanValue()) {
/* */
/* */
/* 102 */ kickoutSessionId = deque.removeFirst();
/* */
/* */ }
/* */ else {
/* */
/* 107 */ kickoutSessionId = deque.removeLast();
/* */ }
/* */
/* 110 */ this.cache.put(loginName, deque);
/* */
/* */
/* */
/* */ try {
/* 115 */ Session kickoutSession = this.sessionManager.getSession((SessionKey)new DefaultSessionKey(kickoutSessionId));
/* 116 */ if (null != kickoutSession)
/* */ {
/* */
/* 119 */ kickoutSession.setAttribute("kickout", Boolean.valueOf(true));
/* */ }
/* */ }
/* 122 */ catch (Exception exception) {}
/* */ }
/* */
/* */
/* */
/* */
/* */
/* 129 */ if ((Boolean)session.getAttribute("kickout") != null && ((Boolean)session.getAttribute("kickout")).booleanValue() == true) {
/* */
/* */
/* 132 */ subject.logout();
/* 133 */ saveRequest(request);
/* 134 */ return isAjaxResponse(request, response);
/* */ }
/* 136 */ return true;
/* */ }
/* 138 */ catch (Exception e) {
/* */
/* 140 */ return isAjaxResponse(request, response);
/* */ }
/* */ }
/* */
/* */
/* */ private boolean isAjaxResponse(ServletRequest request, ServletResponse response) throws IOException {
/* 146 */ HttpServletRequest req = (HttpServletRequest)request;
/* 147 */ HttpServletResponse res = (HttpServletResponse)response;
/* 148 */ if (ServletUtils.isAjaxRequest(req)) {
/* */
/* 150 */ AjaxResult ajaxResult = AjaxResult.error("您已在别处登录,请您修改密码或重新登录");
/* 151 */ ServletUtils.renderString(res, objectMapper.writeValueAsString(ajaxResult));
/* */ }
/* */ else {
/* */
/* 155 */ WebUtils.issueRedirect(request, response, this.kickoutUrl);
/* */ }
/* 157 */ return false;
/* */ }
/* */
/* */
/* */ public void setMaxSession(int maxSession) {
/* 162 */ this.maxSession = maxSession;
/* */ }
/* */
/* */
/* */ public void setKickoutAfter(boolean kickoutAfter) {
/* 167 */ this.kickoutAfter = Boolean.valueOf(kickoutAfter);
/* */ }
/* */
/* */
/* */ public void setKickoutUrl(String kickoutUrl) {
/* 172 */ this.kickoutUrl = kickoutUrl;
/* */ }
/* */
/* */
/* */ public void setSessionManager(SessionManager sessionManager) {
/* 177 */ this.sessionManager = sessionManager;
/* */ }
/* */
/* */
/* */
/* */
/* */ public void setCacheManager(CacheManager cacheManager) {
/* 184 */ this.cache = cacheManager.getCache("sys-userCache");
/* */ }
/* */ }
import com.archive.common.utils.ServletUtils;
import com.archive.common.utils.security.ShiroUtils;
import com.archive.framework.web.domain.AjaxResult;
import com.archive.project.system.user.domain.User;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayDeque;
import java.util.Deque;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheManager;
import org.apache.shiro.session.Session;
import org.apache.shiro.session.mgt.DefaultSessionKey;
import org.apache.shiro.session.mgt.SessionKey;
import org.apache.shiro.session.mgt.SessionManager;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.filter.AccessControlFilter;
import org.apache.shiro.web.util.WebUtils;
public class KickoutSessionFilter
extends AccessControlFilter
{
private static final ObjectMapper objectMapper = new ObjectMapper();
private int maxSession = -1;
private Boolean kickoutAfter = Boolean.valueOf(false);
private String kickoutUrl;
private SessionManager sessionManager;
private Cache<String, Deque<Serializable>> cache;
protected boolean isAccessAllowed(ServletRequest servletRequest, ServletResponse servletResponse, Object o) throws Exception {
return false;
}
protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
Subject subject = getSubject(request, response);
if ((!subject.isAuthenticated() && !subject.isRemembered()) || this.maxSession == -1)
{
return true;
}
try {
Session session = subject.getSession();
User user = ShiroUtils.getSysUser();
String loginName = user.getLoginName();
Serializable sessionId = session.getId();
Deque<Serializable> deque = (Deque<Serializable>)this.cache.get(loginName);
if (deque == null)
{
deque = new ArrayDeque<>();
}
if (!deque.contains(sessionId) && session.getAttribute("kickout") == null) {
deque.push(sessionId);
this.cache.put(loginName, deque);
}
while (deque.size() > this.maxSession) {
Serializable kickoutSessionId = null;
if (this.kickoutAfter.booleanValue()) {
kickoutSessionId = deque.removeFirst();
}
else {
kickoutSessionId = deque.removeLast();
}
this.cache.put(loginName, deque);
try {
Session kickoutSession = this.sessionManager.getSession((SessionKey)new DefaultSessionKey(kickoutSessionId));
if (null != kickoutSession)
{
kickoutSession.setAttribute("kickout", Boolean.valueOf(true));
}
}
catch (Exception exception) {}
}
if ((Boolean)session.getAttribute("kickout") != null && ((Boolean)session.getAttribute("kickout")).booleanValue() == true) {
subject.logout();
saveRequest(request);
return isAjaxResponse(request, response);
}
return true;
}
catch (Exception e) {
return isAjaxResponse(request, response);
}
}
private boolean isAjaxResponse(ServletRequest request, ServletResponse response) throws IOException {
HttpServletRequest req = (HttpServletRequest)request;
HttpServletResponse res = (HttpServletResponse)response;
if (ServletUtils.isAjaxRequest(req)) {
AjaxResult ajaxResult = AjaxResult.error("您已在别处登录,请您修改密码或重新登录");
ServletUtils.renderString(res, objectMapper.writeValueAsString(ajaxResult));
}
else {
WebUtils.issueRedirect(request, response, this.kickoutUrl);
}
return false;
}
public void setMaxSession(int maxSession) {
this.maxSession = maxSession;
}
public void setKickoutAfter(boolean kickoutAfter) {
this.kickoutAfter = Boolean.valueOf(kickoutAfter);
}
public void setKickoutUrl(String kickoutUrl) {
this.kickoutUrl = kickoutUrl;
}
public void setSessionManager(SessionManager sessionManager) {
this.sessionManager = sessionManager;
}
public void setCacheManager(CacheManager cacheManager) {
this.cache = cacheManager.getCache("sys-userCache");
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\shiro\web\filter\kickout\KickoutSessionFilter.class

@ -1,345 +1,345 @@
/* */ package com.archive.project.dajs.jsgl.controller
package com.archive.project.dajs.jsgl.controller
;
/* */
/* */ import com.archive.common.archiveUtil.TableUtil;
/* */ import com.archive.common.utils.StringUtils;
/* */ import com.archive.framework.aspectj.lang.annotation.Log;
/* */ import com.archive.framework.aspectj.lang.enums.BusinessType;
/* */ import com.archive.framework.web.controller.BaseController;
/* */ import com.archive.framework.web.domain.AjaxResult;
/* */ import com.archive.project.dajs.jsgl.service.IJsglService;
/* */ import com.archive.project.dasz.archivetype.domain.ArchiveCollationTree;
/* */ import com.archive.project.dasz.archivetype.service.IArchiveTypeService;
/* */ import com.archive.project.system.config.service.IConfigService;
/* */ import com.archive.project.system.dict.domain.DictData;
/* */ import com.archive.project.system.dict.domain.DictType;
/* */ import com.archive.project.system.dict.service.IDictTypeService;
/* */ import java.io.IOException;
/* */ import java.util.HashMap;
/* */ import java.util.List;
/* */ import java.util.Map;
/* */ import org.apache.shiro.authz.annotation.RequiresPermissions;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Controller;
/* */ import org.springframework.ui.ModelMap;
/* */ import org.springframework.validation.annotation.Validated;
/* */ import org.springframework.web.bind.annotation.GetMapping;
/* */ import org.springframework.web.bind.annotation.PathVariable;
/* */ import org.springframework.web.bind.annotation.PostMapping;
/* */ import org.springframework.web.bind.annotation.RequestMapping;
/* */ import org.springframework.web.bind.annotation.RequestParam;
/* */ import org.springframework.web.bind.annotation.ResponseBody;
/* */ import org.springframework.web.multipart.MultipartFile;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Controller
/* */ @RequestMapping({"/dajs/jsgl"})
/* */ public class JsglController
/* */ extends BaseController
/* */ {
/* */ @Autowired
/* */ private IArchiveTypeService archiveTypeService;
/* */ @Autowired
/* */ private IDictTypeService dictTypeService;
/* */ @Autowired
/* */ private IJsglService jsglService;
/* */ @Autowired
/* */ private IConfigService configService;
/* 56 */ private String prefix = "dajs/jsgl";
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"dajs:jsgl:view"})
/* */ @GetMapping
/* */ public String jsgl(ModelMap mmap) {
/* 65 */ List<ArchiveCollationTree> ztrees = this.archiveTypeService.archiveCollationTreeData();
/* 66 */ if (ztrees != null && ztrees.size() > 2) {
/* 67 */ mmap.put("firstNode", ztrees.get(1));
/* */ } else {
/* 69 */ mmap.put("firstNode", null);
/* */ }
/* */
/* */
/* 73 */ DictType dictType = new DictType(); dictType.setLabel("column_bind");
/* 74 */ List<DictType> dictTypeList = this.dictTypeService.selectDictTypeList(dictType);
/* 75 */ Map<String, List<DictData>> dictDataMap = new HashMap<>();
/* 76 */ for (DictType dictTypeTemp : dictTypeList) {
/* 77 */ List<DictData> dictDatas = this.dictTypeService.selectDictDataByType(dictTypeTemp.getDictType());
/* 78 */ dictDataMap.put(dictTypeTemp.getDictType(), dictDatas);
/* */ }
/* 80 */ mmap.put("dictDataMap", dictDataMap);
/* 81 */ return this.prefix + "/jsgl";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/add/{archiveId}/{type}/{ownerid}"})
/* */ public String add(@PathVariable("archiveId") String archiveId, @PathVariable("type") String type, @PathVariable("ownerid") String ownerid, ModelMap mmap) {
/* 97 */ mmap.put("archiveId", archiveId);
/* 98 */ mmap.put("type", type);
/* 99 */ mmap.put("ownerid", ownerid);
/* 100 */ return this.prefix + "/add";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/detail/{archiveId}/{type}/{id}"})
/* */ public String detail(@PathVariable("archiveId") String archiveId, @PathVariable("type") String type, @PathVariable("id") String id, ModelMap mmap) {
/* 113 */ mmap.put("archiveTypeId", archiveId);
/* 114 */ mmap.put("type", type);
/* 115 */ mmap.put("id", id);
/* 116 */ return this.prefix + "/detail";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/update/{archiveId}/{type}/{id}"})
/* */ public String update(@PathVariable("archiveId") String archiveId, @PathVariable("type") String type, @PathVariable("id") String id, ModelMap mmap) {
/* 128 */ mmap.put("archiveTypeId", archiveId);
/* 129 */ mmap.put("type", type);
/* 130 */ mmap.put("id", id);
/* 131 */ return this.prefix + "/update";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"dajs:jsgl:fileUpload"})
/* */ @GetMapping({"/uploadFile/{archiveId}/{type}/{id}"})
/* */ public String uploadFile(@PathVariable("archiveId") long archiveId, @PathVariable("type") String type, @PathVariable("id") String id, ModelMap mmap) {
/* 146 */ long tableId = TableUtil.getTableIdByArchiveTypeId(archiveId);
/* 147 */ mmap.put("tableId", Long.valueOf(tableId));
/* 148 */ mmap.put("id", id);
/* 149 */ return this.prefix + "/uploadFile";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @PostMapping({"/fileUpload"})
/* */ @ResponseBody
/* */ public Map<String, Object> fileUpload(@RequestParam("file") MultipartFile[] files, long tableId, long id) {
/* 163 */ Map<String, Object> map = new HashMap<>();
/* 164 */ boolean res = false;
/* */ try {
/* 166 */ res = this.jsglService.uploadFile(files, tableId, id);
/* 167 */ } catch (IOException e) {
/* 168 */ e.printStackTrace();
/* */ }
/* */
/* 171 */ map.put("res", Boolean.valueOf(res));
/* 172 */ return map;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/appendAddForm/{archiveId}/{type}"})
/* */ @ResponseBody
/* */ public String appendAddForm(@PathVariable("archiveId") String archiveId, @PathVariable("type") String type) {
/* 189 */ return this.jsglService.appendAddForm(archiveId, type);
/* */ }
/* */
/* */
/* */ @Log(title = "接收管理-档案新增", businessType = BusinessType.INSERT)
/* */ @PostMapping({"/add"})
/* */ @ResponseBody
/* */ public AjaxResult addSave(@Validated String archiveStr, @Validated String archiveId, @Validated String type) {
/* 197 */ if (StringUtils.isEmpty(archiveStr)) {
/* 198 */ return error("提交数据为空,新增失败!");
/* */ }
/* */
/* */ try {
/* 202 */ boolean flag = this.jsglService.addSave(archiveStr, archiveId, type);
/* 203 */ if (flag) {
/* 204 */ return toAjax(true);
/* */ }
/* 206 */ return toAjax(false);
/* */ }
/* 208 */ catch (Exception e) {
/* 209 */ e.printStackTrace();
/* 210 */ return toAjax(false);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */ @Log(title = "接收管理-档案修改", businessType = BusinessType.UPDATE)
/* */ @PostMapping({"/update"})
/* */ @ResponseBody
/* */ public AjaxResult update(@Validated String archiveStr, @Validated String archiveTypeId, @Validated String type, @Validated String id) {
/* 221 */ if (StringUtils.isEmpty(archiveStr)) {
/* 222 */ return error("提交数据为空,新增失败!");
/* */ }
/* */
/* */ try {
/* 226 */ boolean flag = this.jsglService.update(archiveStr, archiveTypeId, type, id);
/* 227 */ if (flag) {
/* 228 */ return toAjax(true);
/* */ }
/* 230 */ return toAjax(false);
/* */ }
/* 232 */ catch (Exception e) {
/* 233 */ e.printStackTrace();
/* 234 */ return toAjax(false);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Log(title = "接收管理-档案删除", businessType = BusinessType.DELETE)
/* */ @PostMapping({"/delete"})
/* */ @ResponseBody
/* */ public AjaxResult delete(@Validated String query, @Validated String archiveTypeId, @Validated String type, @Validated String ids) {
/* 252 */ boolean flag = false;
/* */
/* */ try {
/* 255 */ String deleteType = this.configService.selectConfigByKey("archive.deleteDataType");
/* 256 */ if (deleteType.equals("1")) {
/* */
/* 258 */ flag = this.jsglService.archiveLogicDelete(query, archiveTypeId, type, ids);
/* 259 */ } else if (deleteType.equals("2")) {
/* */
/* 261 */ flag = this.jsglService.archivePhysicalDelete(query, archiveTypeId, type, ids);
/* */ } else {
/* 263 */ return error("请在\"系统参数\"中配置\"档案条目删除方式\"!");
/* */ }
/* */
/* 266 */ } catch (Exception ex) {
/* 267 */ System.out.println("档案删除出现异常:" + ex.getMessage());
/* 268 */ return error("删除失败!");
/* */ }
/* 270 */ if (flag) {
/* 271 */ return success("删除成功!");
/* */ }
/* 273 */ return error("删除失败!");
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Log(title = "接收管理-整理入库", businessType = BusinessType.ZLRK)
/* */ @PostMapping({"/zlrk"})
/* */ @ResponseBody
/* */ public AjaxResult zlrk(@Validated String query, @Validated String archiveTypeId, @Validated String type, @Validated String ids) {
/* 289 */ boolean flag = false;
/* */ try {
/* 291 */ flag = this.jsglService.rzlk(query, archiveTypeId, type, ids);
/* 292 */ } catch (Exception ex) {
/* 293 */ System.out.println("入管理库出现异常:" + ex.getMessage());
/* 294 */ return error("入管理库失败!");
/* */ }
/* 296 */ if (flag) {
/* 297 */ return success("入管理库成功!");
/* */ }
/* 299 */ return error("入管理库失败!");
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/appendAddFormByDataId/{archiveTypeId}/{type}/{id}/{readOnly}"})
/* */ @ResponseBody
/* */ public String appendAddFormByDataId(@PathVariable("archiveTypeId") String archiveTypeId, @PathVariable("type") String type, @PathVariable("id") String id, @PathVariable("readOnly") String readOnly) {
/* 314 */ return this.jsglService.appendAddFormByDataId(archiveTypeId, type, id, readOnly);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/folderFile/{archiveId}/{id}"})
/* */ public String folderFile(@PathVariable("archiveId") String archiveId, @PathVariable("id") String id, ModelMap mmap) {
/* 327 */ mmap.put("archiveId", archiveId);
/* 328 */ mmap.put("folderId", id);
/* */
/* 330 */ DictType dictType = new DictType(); dictType.setLabel("column_bind");
/* 331 */ List<DictType> dictTypeList = this.dictTypeService.selectDictTypeList(dictType);
/* 332 */ Map<String, List<DictData>> dictDataMap = new HashMap<>();
/* 333 */ for (DictType dictTypeTemp : dictTypeList) {
/* 334 */ List<DictData> dictDatas = this.dictTypeService.selectDictDataByType(dictTypeTemp.getDictType());
/* 335 */ dictDataMap.put(dictTypeTemp.getDictType(), dictDatas);
/* */ }
/* 337 */ mmap.put("dictDataMap", dictDataMap);
/* 338 */ return this.prefix + "/jnwj";
/* */ }
/* */ }
import com.archive.common.archiveUtil.TableUtil;
import com.archive.common.utils.StringUtils;
import com.archive.framework.aspectj.lang.annotation.Log;
import com.archive.framework.aspectj.lang.enums.BusinessType;
import com.archive.framework.web.controller.BaseController;
import com.archive.framework.web.domain.AjaxResult;
import com.archive.project.dajs.jsgl.service.IJsglService;
import com.archive.project.dasz.archivetype.domain.ArchiveCollationTree;
import com.archive.project.dasz.archivetype.service.IArchiveTypeService;
import com.archive.project.system.config.service.IConfigService;
import com.archive.project.system.dict.domain.DictData;
import com.archive.project.system.dict.domain.DictType;
import com.archive.project.system.dict.service.IDictTypeService;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
@Controller
@RequestMapping({"/dajs/jsgl"})
public class JsglController
extends BaseController
{
@Autowired
private IArchiveTypeService archiveTypeService;
@Autowired
private IDictTypeService dictTypeService;
@Autowired
private IJsglService jsglService;
@Autowired
private IConfigService configService;
private String prefix = "dajs/jsgl";
@RequiresPermissions({"dajs:jsgl:view"})
@GetMapping
public String jsgl(ModelMap mmap) {
List<ArchiveCollationTree> ztrees = this.archiveTypeService.archiveCollationTreeData();
if (ztrees != null && ztrees.size() > 2) {
mmap.put("firstNode", ztrees.get(1));
} else {
mmap.put("firstNode", null);
}
DictType dictType = new DictType(); dictType.setLabel("column_bind");
List<DictType> dictTypeList = this.dictTypeService.selectDictTypeList(dictType);
Map<String, List<DictData>> dictDataMap = new HashMap<>();
for (DictType dictTypeTemp : dictTypeList) {
List<DictData> dictDatas = this.dictTypeService.selectDictDataByType(dictTypeTemp.getDictType());
dictDataMap.put(dictTypeTemp.getDictType(), dictDatas);
}
mmap.put("dictDataMap", dictDataMap);
return this.prefix + "/jsgl";
}
@GetMapping({"/add/{archiveId}/{type}/{ownerid}"})
public String add(@PathVariable("archiveId") String archiveId, @PathVariable("type") String type, @PathVariable("ownerid") String ownerid, ModelMap mmap) {
mmap.put("archiveId", archiveId);
mmap.put("type", type);
mmap.put("ownerid", ownerid);
return this.prefix + "/add";
}
@GetMapping({"/detail/{archiveId}/{type}/{id}"})
public String detail(@PathVariable("archiveId") String archiveId, @PathVariable("type") String type, @PathVariable("id") String id, ModelMap mmap) {
mmap.put("archiveTypeId", archiveId);
mmap.put("type", type);
mmap.put("id", id);
return this.prefix + "/detail";
}
@GetMapping({"/update/{archiveId}/{type}/{id}"})
public String update(@PathVariable("archiveId") String archiveId, @PathVariable("type") String type, @PathVariable("id") String id, ModelMap mmap) {
mmap.put("archiveTypeId", archiveId);
mmap.put("type", type);
mmap.put("id", id);
return this.prefix + "/update";
}
@RequiresPermissions({"dajs:jsgl:fileUpload"})
@GetMapping({"/uploadFile/{archiveId}/{type}/{id}"})
public String uploadFile(@PathVariable("archiveId") long archiveId, @PathVariable("type") String type, @PathVariable("id") String id, ModelMap mmap) {
long tableId = TableUtil.getTableIdByArchiveTypeId(archiveId);
mmap.put("tableId", Long.valueOf(tableId));
mmap.put("id", id);
return this.prefix + "/uploadFile";
}
@PostMapping({"/fileUpload"})
@ResponseBody
public Map<String, Object> fileUpload(@RequestParam("file") MultipartFile[] files, long tableId, long id) {
Map<String, Object> map = new HashMap<>();
boolean res = false;
try {
res = this.jsglService.uploadFile(files, tableId, id);
} catch (IOException e) {
e.printStackTrace();
}
map.put("res", Boolean.valueOf(res));
return map;
}
@GetMapping({"/appendAddForm/{archiveId}/{type}"})
@ResponseBody
public String appendAddForm(@PathVariable("archiveId") String archiveId, @PathVariable("type") String type) {
return this.jsglService.appendAddForm(archiveId, type);
}
@Log(title = "接收管理-档案新增", businessType = BusinessType.INSERT)
@PostMapping({"/add"})
@ResponseBody
public AjaxResult addSave(@Validated String archiveStr, @Validated String archiveId, @Validated String type) {
if (StringUtils.isEmpty(archiveStr)) {
return error("提交数据为空,新增失败!");
}
try {
boolean flag = this.jsglService.addSave(archiveStr, archiveId, type);
if (flag) {
return toAjax(true);
}
return toAjax(false);
}
catch (Exception e) {
e.printStackTrace();
return toAjax(false);
}
}
@Log(title = "接收管理-档案修改", businessType = BusinessType.UPDATE)
@PostMapping({"/update"})
@ResponseBody
public AjaxResult update(@Validated String archiveStr, @Validated String archiveTypeId, @Validated String type, @Validated String id) {
if (StringUtils.isEmpty(archiveStr)) {
return error("提交数据为空,新增失败!");
}
try {
boolean flag = this.jsglService.update(archiveStr, archiveTypeId, type, id);
if (flag) {
return toAjax(true);
}
return toAjax(false);
}
catch (Exception e) {
e.printStackTrace();
return toAjax(false);
}
}
@Log(title = "接收管理-档案删除", businessType = BusinessType.DELETE)
@PostMapping({"/delete"})
@ResponseBody
public AjaxResult delete(@Validated String query, @Validated String archiveTypeId, @Validated String type, @Validated String ids) {
boolean flag = false;
try {
String deleteType = this.configService.selectConfigByKey("archive.deleteDataType");
if (deleteType.equals("1")) {
flag = this.jsglService.archiveLogicDelete(query, archiveTypeId, type, ids);
} else if (deleteType.equals("2")) {
flag = this.jsglService.archivePhysicalDelete(query, archiveTypeId, type, ids);
} else {
return error("请在\"系统参数\"中配置\"档案条目删除方式\"!");
}
} catch (Exception ex) {
System.out.println("档案删除出现异常:" + ex.getMessage());
return error("删除失败!");
}
if (flag) {
return success("删除成功!");
}
return error("删除失败!");
}
@Log(title = "接收管理-整理入库", businessType = BusinessType.ZLRK)
@PostMapping({"/zlrk"})
@ResponseBody
public AjaxResult zlrk(@Validated String query, @Validated String archiveTypeId, @Validated String type, @Validated String ids) {
boolean flag = false;
try {
flag = this.jsglService.rzlk(query, archiveTypeId, type, ids);
} catch (Exception ex) {
System.out.println("入管理库出现异常:" + ex.getMessage());
return error("入管理库失败!");
}
if (flag) {
return success("入管理库成功!");
}
return error("入管理库失败!");
}
@GetMapping({"/appendAddFormByDataId/{archiveTypeId}/{type}/{id}/{readOnly}"})
@ResponseBody
public String appendAddFormByDataId(@PathVariable("archiveTypeId") String archiveTypeId, @PathVariable("type") String type, @PathVariable("id") String id, @PathVariable("readOnly") String readOnly) {
return this.jsglService.appendAddFormByDataId(archiveTypeId, type, id, readOnly);
}
@GetMapping({"/folderFile/{archiveId}/{id}"})
public String folderFile(@PathVariable("archiveId") String archiveId, @PathVariable("id") String id, ModelMap mmap) {
mmap.put("archiveId", archiveId);
mmap.put("folderId", id);
DictType dictType = new DictType(); dictType.setLabel("column_bind");
List<DictType> dictTypeList = this.dictTypeService.selectDictTypeList(dictType);
Map<String, List<DictData>> dictDataMap = new HashMap<>();
for (DictType dictTypeTemp : dictTypeList) {
List<DictData> dictDatas = this.dictTypeService.selectDictDataByType(dictTypeTemp.getDictType());
dictDataMap.put(dictTypeTemp.getDictType(), dictDatas);
}
mmap.put("dictDataMap", dictDataMap);
return this.prefix + "/jnwj";
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\dajs\jsgl\controller\JsglController.class

@ -1,182 +1,182 @@
/* */ package com.archive.project.monitor.job.controller
package com.archive.project.monitor.job.controller
;
/* */
/* */ import com.archive.common.exception.job.TaskException;
/* */ import com.archive.common.utils.poi.ExcelUtil;
/* */ import com.archive.common.utils.security.ShiroUtils;
/* */ import com.archive.framework.aspectj.lang.annotation.Log;
/* */ import com.archive.framework.aspectj.lang.enums.BusinessType;
/* */ import com.archive.framework.web.controller.BaseController;
/* */ import com.archive.framework.web.domain.AjaxResult;
/* */ import com.archive.framework.web.page.TableDataInfo;
/* */ import com.archive.project.monitor.job.domain.Job;
/* */ import com.archive.project.monitor.job.service.IJobService;
/* */ import com.archive.project.monitor.job.util.CronUtils;
/* */ import java.util.List;
/* */ import org.apache.shiro.authz.annotation.RequiresPermissions;
/* */ import org.quartz.SchedulerException;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Controller;
/* */ import org.springframework.ui.ModelMap;
/* */ import org.springframework.validation.annotation.Validated;
/* */ import org.springframework.web.bind.annotation.GetMapping;
/* */ import org.springframework.web.bind.annotation.PathVariable;
/* */ import org.springframework.web.bind.annotation.PostMapping;
/* */ import org.springframework.web.bind.annotation.RequestMapping;
/* */ import org.springframework.web.bind.annotation.ResponseBody;
/* */
/* */
/* */
/* */
/* */
/* */ @Controller
/* */ @RequestMapping({"/monitor/job"})
/* */ public class JobController
/* */ extends BaseController
/* */ {
/* 36 */ private String prefix = "monitor/job";
/* */
/* */ @Autowired
/* */ private IJobService jobService;
/* */
/* */
/* */ @RequiresPermissions({"monitor:job:view"})
/* */ @GetMapping
/* */ public String job() {
/* 45 */ return this.prefix + "/job";
/* */ }
/* */
/* */
/* */ @RequiresPermissions({"monitor:job:list"})
/* */ @PostMapping({"/list"})
/* */ @ResponseBody
/* */ public TableDataInfo list(Job job) {
/* 53 */ startPage();
/* 54 */ List<Job> list = this.jobService.selectJobList(job);
/* 55 */ return getDataTable(list);
/* */ }
/* */
/* */
/* */ @Log(title = "定时任务", businessType = BusinessType.EXPORT)
/* */ @RequiresPermissions({"monitor:job:export"})
/* */ @PostMapping({"/export"})
/* */ @ResponseBody
/* */ public AjaxResult export(Job job) {
/* 64 */ List<Job> list = this.jobService.selectJobList(job);
/* 65 */ ExcelUtil<Job> util = new ExcelUtil(Job.class);
/* 66 */ return util.exportExcel(list, "定时任务");
/* */ }
/* */
/* */
/* */ @Log(title = "定时任务", businessType = BusinessType.DELETE)
/* */ @RequiresPermissions({"monitor:job:remove"})
/* */ @PostMapping({"/remove"})
/* */ @ResponseBody
/* */ public AjaxResult remove(String ids) throws SchedulerException {
/* 75 */ this.jobService.deleteJobByIds(ids);
/* 76 */ return success();
/* */ }
/* */
/* */
/* */ @RequiresPermissions({"monitor:job:detail"})
/* */ @GetMapping({"/detail/{jobId}"})
/* */ public String detail(@PathVariable("jobId") Long jobId, ModelMap mmap) {
/* 83 */ mmap.put("name", "job");
/* 84 */ mmap.put("job", this.jobService.selectJobById(jobId));
/* 85 */ return this.prefix + "/detail";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @Log(title = "定时任务", businessType = BusinessType.UPDATE)
/* */ @RequiresPermissions({"monitor:job:changeStatus"})
/* */ @PostMapping({"/changeStatus"})
/* */ @ResponseBody
/* */ public AjaxResult changeStatus(Job job) throws SchedulerException {
/* 97 */ Job newJob = this.jobService.selectJobById(job.getJobId());
/* 98 */ newJob.setStatus(job.getStatus());
/* 99 */ return toAjax(this.jobService.changeStatus(newJob));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @Log(title = "定时任务", businessType = BusinessType.UPDATE)
/* */ @RequiresPermissions({"monitor:job:changeStatus"})
/* */ @PostMapping({"/run"})
/* */ @ResponseBody
/* */ public AjaxResult run(Job job) throws SchedulerException {
/* 111 */ this.jobService.run(job);
/* 112 */ return success();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/add"})
/* */ public String add() {
/* 121 */ return this.prefix + "/add";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @Log(title = "定时任务", businessType = BusinessType.INSERT)
/* */ @RequiresPermissions({"monitor:job:add"})
/* */ @PostMapping({"/add"})
/* */ @ResponseBody
/* */ public AjaxResult addSave(@Validated Job job) throws SchedulerException, TaskException {
/* 133 */ if (!CronUtils.isValid(job.getCronExpression()))
/* */ {
/* 135 */ return AjaxResult.error("cron表达式不正确");
/* */ }
/* 137 */ job.setCreateBy(ShiroUtils.getLoginName());
/* 138 */ return toAjax(this.jobService.insertJob(job));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/edit/{jobId}"})
/* */ public String edit(@PathVariable("jobId") Long jobId, ModelMap mmap) {
/* 147 */ mmap.put("job", this.jobService.selectJobById(jobId));
/* 148 */ return this.prefix + "/edit";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @Log(title = "定时任务", businessType = BusinessType.UPDATE)
/* */ @RequiresPermissions({"monitor:job:edit"})
/* */ @PostMapping({"/edit"})
/* */ @ResponseBody
/* */ public AjaxResult editSave(@Validated Job job) throws SchedulerException, TaskException {
/* 160 */ if (!CronUtils.isValid(job.getCronExpression()))
/* */ {
/* 162 */ return AjaxResult.error("cron表达式不正确");
/* */ }
/* 164 */ job.setUpdateBy(ShiroUtils.getLoginName());
/* 165 */ return toAjax(this.jobService.updateJob(job));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @PostMapping({"/checkCronExpressionIsValid"})
/* */ @ResponseBody
/* */ public boolean checkCronExpressionIsValid(Job job) {
/* 175 */ return this.jobService.checkCronExpressionIsValid(job.getCronExpression());
/* */ }
/* */ }
import com.archive.common.exception.job.TaskException;
import com.archive.common.utils.poi.ExcelUtil;
import com.archive.common.utils.security.ShiroUtils;
import com.archive.framework.aspectj.lang.annotation.Log;
import com.archive.framework.aspectj.lang.enums.BusinessType;
import com.archive.framework.web.controller.BaseController;
import com.archive.framework.web.domain.AjaxResult;
import com.archive.framework.web.page.TableDataInfo;
import com.archive.project.monitor.job.domain.Job;
import com.archive.project.monitor.job.service.IJobService;
import com.archive.project.monitor.job.util.CronUtils;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping({"/monitor/job"})
public class JobController
extends BaseController
{
private String prefix = "monitor/job";
@Autowired
private IJobService jobService;
@RequiresPermissions({"monitor:job:view"})
@GetMapping
public String job() {
return this.prefix + "/job";
}
@RequiresPermissions({"monitor:job:list"})
@PostMapping({"/list"})
@ResponseBody
public TableDataInfo list(Job job) {
startPage();
List<Job> list = this.jobService.selectJobList(job);
return getDataTable(list);
}
@Log(title = "定时任务", businessType = BusinessType.EXPORT)
@RequiresPermissions({"monitor:job:export"})
@PostMapping({"/export"})
@ResponseBody
public AjaxResult export(Job job) {
List<Job> list = this.jobService.selectJobList(job);
ExcelUtil<Job> util = new ExcelUtil(Job.class);
return util.exportExcel(list, "定时任务");
}
@Log(title = "定时任务", businessType = BusinessType.DELETE)
@RequiresPermissions({"monitor:job:remove"})
@PostMapping({"/remove"})
@ResponseBody
public AjaxResult remove(String ids) throws SchedulerException {
this.jobService.deleteJobByIds(ids);
return success();
}
@RequiresPermissions({"monitor:job:detail"})
@GetMapping({"/detail/{jobId}"})
public String detail(@PathVariable("jobId") Long jobId, ModelMap mmap) {
mmap.put("name", "job");
mmap.put("job", this.jobService.selectJobById(jobId));
return this.prefix + "/detail";
}
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
@RequiresPermissions({"monitor:job:changeStatus"})
@PostMapping({"/changeStatus"})
@ResponseBody
public AjaxResult changeStatus(Job job) throws SchedulerException {
Job newJob = this.jobService.selectJobById(job.getJobId());
newJob.setStatus(job.getStatus());
return toAjax(this.jobService.changeStatus(newJob));
}
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
@RequiresPermissions({"monitor:job:changeStatus"})
@PostMapping({"/run"})
@ResponseBody
public AjaxResult run(Job job) throws SchedulerException {
this.jobService.run(job);
return success();
}
@GetMapping({"/add"})
public String add() {
return this.prefix + "/add";
}
@Log(title = "定时任务", businessType = BusinessType.INSERT)
@RequiresPermissions({"monitor:job:add"})
@PostMapping({"/add"})
@ResponseBody
public AjaxResult addSave(@Validated Job job) throws SchedulerException, TaskException {
if (!CronUtils.isValid(job.getCronExpression()))
{
return AjaxResult.error("cron表达式不正确");
}
job.setCreateBy(ShiroUtils.getLoginName());
return toAjax(this.jobService.insertJob(job));
}
@GetMapping({"/edit/{jobId}"})
public String edit(@PathVariable("jobId") Long jobId, ModelMap mmap) {
mmap.put("job", this.jobService.selectJobById(jobId));
return this.prefix + "/edit";
}
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
@RequiresPermissions({"monitor:job:edit"})
@PostMapping({"/edit"})
@ResponseBody
public AjaxResult editSave(@Validated Job job) throws SchedulerException, TaskException {
if (!CronUtils.isValid(job.getCronExpression()))
{
return AjaxResult.error("cron表达式不正确");
}
job.setUpdateBy(ShiroUtils.getLoginName());
return toAjax(this.jobService.updateJob(job));
}
@PostMapping({"/checkCronExpressionIsValid"})
@ResponseBody
public boolean checkCronExpressionIsValid(Job job) {
return this.jobService.checkCronExpressionIsValid(job.getCronExpression());
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\job\controller\JobController.class

@ -1,108 +1,108 @@
/* */ package com.archive.project.monitor.job.controller
package com.archive.project.monitor.job.controller
;
/* */
/* */ import com.archive.common.utils.StringUtils;
/* */ import com.archive.common.utils.poi.ExcelUtil;
/* */ import com.archive.framework.aspectj.lang.annotation.Log;
/* */ import com.archive.framework.aspectj.lang.enums.BusinessType;
/* */ import com.archive.framework.web.controller.BaseController;
/* */ import com.archive.framework.web.domain.AjaxResult;
/* */ import com.archive.framework.web.page.TableDataInfo;
/* */ import com.archive.project.monitor.job.domain.Job;
/* */ import com.archive.project.monitor.job.domain.JobLog;
/* */ import com.archive.project.monitor.job.service.IJobLogService;
/* */ import com.archive.project.monitor.job.service.IJobService;
/* */ import java.util.List;
/* */ import org.apache.shiro.authz.annotation.RequiresPermissions;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Controller;
/* */ import org.springframework.ui.ModelMap;
/* */ import org.springframework.web.bind.annotation.GetMapping;
/* */ import org.springframework.web.bind.annotation.PathVariable;
/* */ import org.springframework.web.bind.annotation.PostMapping;
/* */ import org.springframework.web.bind.annotation.RequestMapping;
/* */ import org.springframework.web.bind.annotation.RequestParam;
/* */ import org.springframework.web.bind.annotation.ResponseBody;
/* */
/* */
/* */
/* */
/* */
/* */ @Controller
/* */ @RequestMapping({"/monitor/jobLog"})
/* */ public class JobLogController
/* */ extends BaseController
/* */ {
/* 35 */ private String prefix = "monitor/job";
/* */
/* */ @Autowired
/* */ private IJobService jobService;
/* */
/* */ @Autowired
/* */ private IJobLogService jobLogService;
/* */
/* */
/* */ @RequiresPermissions({"monitor:job:view"})
/* */ @GetMapping
/* */ public String jobLog(@RequestParam(value = "jobId", required = false) Long jobId, ModelMap mmap) {
/* 47 */ if (StringUtils.isNotNull(jobId)) {
/* */
/* 49 */ Job job = this.jobService.selectJobById(jobId);
/* 50 */ mmap.put("job", job);
/* */ }
/* 52 */ return this.prefix + "/jobLog";
/* */ }
/* */
/* */
/* */ @RequiresPermissions({"monitor:job:list"})
/* */ @PostMapping({"/list"})
/* */ @ResponseBody
/* */ public TableDataInfo list(JobLog jobLog) {
/* 60 */ startPage();
/* 61 */ List<JobLog> list = this.jobLogService.selectJobLogList(jobLog);
/* 62 */ return getDataTable(list);
/* */ }
/* */
/* */
/* */ @Log(title = "调度日志", businessType = BusinessType.EXPORT)
/* */ @RequiresPermissions({"monitor:job:export"})
/* */ @PostMapping({"/export"})
/* */ @ResponseBody
/* */ public AjaxResult export(JobLog jobLog) {
/* 71 */ List<JobLog> list = this.jobLogService.selectJobLogList(jobLog);
/* 72 */ ExcelUtil<JobLog> util = new ExcelUtil(JobLog.class);
/* 73 */ return util.exportExcel(list, "调度日志");
/* */ }
/* */
/* */
/* */ @Log(title = "调度日志", businessType = BusinessType.DELETE)
/* */ @RequiresPermissions({"monitor:job:remove"})
/* */ @PostMapping({"/remove"})
/* */ @ResponseBody
/* */ public AjaxResult remove(String ids) {
/* 82 */ return toAjax(this.jobLogService.deleteJobLogByIds(ids));
/* */ }
/* */
/* */
/* */ @RequiresPermissions({"monitor:job:detail"})
/* */ @GetMapping({"/detail/{jobLogId}"})
/* */ public String detail(@PathVariable("jobLogId") Long jobLogId, ModelMap mmap) {
/* 89 */ mmap.put("name", "jobLog");
/* 90 */ mmap.put("jobLog", this.jobLogService.selectJobLogById(jobLogId));
/* 91 */ return this.prefix + "/detail";
/* */ }
/* */
/* */
/* */ @Log(title = "调度日志", businessType = BusinessType.CLEAN)
/* */ @RequiresPermissions({"monitor:job:remove"})
/* */ @PostMapping({"/clean"})
/* */ @ResponseBody
/* */ public AjaxResult clean() {
/* 100 */ this.jobLogService.cleanJobLog();
/* 101 */ return success();
/* */ }
/* */ }
import com.archive.common.utils.StringUtils;
import com.archive.common.utils.poi.ExcelUtil;
import com.archive.framework.aspectj.lang.annotation.Log;
import com.archive.framework.aspectj.lang.enums.BusinessType;
import com.archive.framework.web.controller.BaseController;
import com.archive.framework.web.domain.AjaxResult;
import com.archive.framework.web.page.TableDataInfo;
import com.archive.project.monitor.job.domain.Job;
import com.archive.project.monitor.job.domain.JobLog;
import com.archive.project.monitor.job.service.IJobLogService;
import com.archive.project.monitor.job.service.IJobService;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping({"/monitor/jobLog"})
public class JobLogController
extends BaseController
{
private String prefix = "monitor/job";
@Autowired
private IJobService jobService;
@Autowired
private IJobLogService jobLogService;
@RequiresPermissions({"monitor:job:view"})
@GetMapping
public String jobLog(@RequestParam(value = "jobId", required = false) Long jobId, ModelMap mmap) {
if (StringUtils.isNotNull(jobId)) {
Job job = this.jobService.selectJobById(jobId);
mmap.put("job", job);
}
return this.prefix + "/jobLog";
}
@RequiresPermissions({"monitor:job:list"})
@PostMapping({"/list"})
@ResponseBody
public TableDataInfo list(JobLog jobLog) {
startPage();
List<JobLog> list = this.jobLogService.selectJobLogList(jobLog);
return getDataTable(list);
}
@Log(title = "调度日志", businessType = BusinessType.EXPORT)
@RequiresPermissions({"monitor:job:export"})
@PostMapping({"/export"})
@ResponseBody
public AjaxResult export(JobLog jobLog) {
List<JobLog> list = this.jobLogService.selectJobLogList(jobLog);
ExcelUtil<JobLog> util = new ExcelUtil(JobLog.class);
return util.exportExcel(list, "调度日志");
}
@Log(title = "调度日志", businessType = BusinessType.DELETE)
@RequiresPermissions({"monitor:job:remove"})
@PostMapping({"/remove"})
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(this.jobLogService.deleteJobLogByIds(ids));
}
@RequiresPermissions({"monitor:job:detail"})
@GetMapping({"/detail/{jobLogId}"})
public String detail(@PathVariable("jobLogId") Long jobLogId, ModelMap mmap) {
mmap.put("name", "jobLog");
mmap.put("jobLog", this.jobLogService.selectJobLogById(jobLogId));
return this.prefix + "/detail";
}
@Log(title = "调度日志", businessType = BusinessType.CLEAN)
@RequiresPermissions({"monitor:job:remove"})
@PostMapping({"/clean"})
@ResponseBody
public AjaxResult clean() {
this.jobLogService.cleanJobLog();
return success();
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\job\controller\JobLogController.class

@ -1,174 +1,174 @@
/* */ package com.archive.project.monitor.job.domain
package com.archive.project.monitor.job.domain
;
/* */
/* */ import com.archive.common.utils.StringUtils;
/* */ import com.archive.framework.aspectj.lang.annotation.ColumnType;
import com.archive.common.utils.StringUtils;
import com.archive.framework.aspectj.lang.annotation.ColumnType;
import com.archive.framework.aspectj.lang.annotation.Excel;
/* */ import com.archive.framework.web.domain.BaseEntity;
/* */ import com.archive.project.monitor.job.util.CronUtils;
/* */ import java.io.Serializable;
/* */ import java.util.Date;
/* */ import javax.validation.constraints.NotBlank;
/* */ import javax.validation.constraints.Size;
/* */ import org.apache.commons.lang3.builder.ToStringBuilder;
/* */ import org.apache.commons.lang3.builder.ToStringStyle;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class Job
/* */ extends BaseEntity
/* */ implements Serializable
/* */ {
/* */ private static final long serialVersionUID = 1L;
/* */ @Excel(name = "任务序号", cellType = ColumnType.NUMERIC)
/* */ private Long jobId;
/* */ @Excel(name = "任务名称")
/* */ private String jobName;
/* */ @Excel(name = "任务组名")
/* */ private String jobGroup;
/* */ @Excel(name = "调用目标字符串")
/* */ private String invokeTarget;
/* */ @Excel(name = "执行表达式 ")
/* */ private String cronExpression;
/* */ @Excel(name = "计划策略 ", readConverterExp = "0=默认,1=立即触发执行,2=触发一次执行,3=不触发立即执行")
/* 45 */ private String misfirePolicy = "0";
/* */
/* */
/* */ @Excel(name = "并发执行", readConverterExp = "0=允许,1=禁止")
/* */ private String concurrent;
/* */
/* */
/* */ @Excel(name = "任务状态", readConverterExp = "0=正常,1=暂停")
/* */ private String status;
/* */
/* */
/* */
/* */ public Long getJobId() {
/* 58 */ return this.jobId;
/* */ }
/* */
/* */
/* */ public void setJobId(Long jobId) {
/* 63 */ this.jobId = jobId;
/* */ }
/* */
/* */
/* */ @NotBlank(message = "任务名称不能为空")
/* */ @Size(min = 0, max = 64, message = "任务名称不能超过64个字符")
/* */ public String getJobName() {
/* 70 */ return this.jobName;
/* */ }
/* */
/* */
/* */ public void setJobName(String jobName) {
/* 75 */ this.jobName = jobName;
/* */ }
/* */
/* */
/* */ public String getJobGroup() {
/* 80 */ return this.jobGroup;
/* */ }
/* */
/* */
/* */ public void setJobGroup(String jobGroup) {
/* 85 */ this.jobGroup = jobGroup;
/* */ }
/* */
/* */
/* */ @NotBlank(message = "调用目标字符串不能为空")
/* */ @Size(min = 0, max = 1000, message = "调用目标字符串长度不能超过500个字符")
/* */ public String getInvokeTarget() {
/* 92 */ return this.invokeTarget;
/* */ }
/* */
/* */
/* */ public void setInvokeTarget(String invokeTarget) {
/* 97 */ this.invokeTarget = invokeTarget;
/* */ }
/* */
/* */
/* */ @NotBlank(message = "Cron执行表达式不能为空")
/* */ @Size(min = 0, max = 255, message = "Cron执行表达式不能超过255个字符")
/* */ public String getCronExpression() {
/* 104 */ return this.cronExpression;
/* */ }
/* */
/* */
/* */ public void setCronExpression(String cronExpression) {
/* 109 */ this.cronExpression = cronExpression;
/* */ }
/* */
/* */
/* */ public Date getNextValidTime() {
/* 114 */ if (StringUtils.isNotEmpty(this.cronExpression))
/* */ {
/* 116 */ return CronUtils.getNextExecution(this.cronExpression);
/* */ }
/* 118 */ return null;
/* */ }
/* */
/* */
/* */ public String getMisfirePolicy() {
/* 123 */ return this.misfirePolicy;
/* */ }
/* */
/* */
/* */ public void setMisfirePolicy(String misfirePolicy) {
/* 128 */ this.misfirePolicy = misfirePolicy;
/* */ }
/* */
/* */
/* */ public String getConcurrent() {
/* 133 */ return this.concurrent;
/* */ }
/* */
/* */
/* */ public void setConcurrent(String concurrent) {
/* 138 */ this.concurrent = concurrent;
/* */ }
/* */
/* */
/* */ public String getStatus() {
/* 143 */ return this.status;
/* */ }
/* */
/* */
/* */ public void setStatus(String status) {
/* 148 */ this.status = status;
/* */ }
/* */
/* */ @Override
/* */ public String toString() {
/* 153 */ return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE))
/* 154 */ .append("jobId", getJobId())
/* 155 */ .append("jobName", getJobName())
/* 156 */ .append("jobGroup", getJobGroup())
/* 157 */ .append("cronExpression", getCronExpression())
/* 158 */ .append("nextValidTime", getNextValidTime())
/* 159 */ .append("misfirePolicy", getMisfirePolicy())
/* 160 */ .append("concurrent", getConcurrent())
/* 161 */ .append("status", getStatus())
/* 162 */ .append("createBy", getCreateBy())
/* 163 */ .append("createTime", getCreateTime())
/* 164 */ .append("updateBy", getUpdateBy())
/* 165 */ .append("updateTime", getUpdateTime())
/* 166 */ .append("remark", getRemark())
/* 167 */ .toString();
/* */ }
/* */ }
import com.archive.framework.web.domain.BaseEntity;
import com.archive.project.monitor.job.util.CronUtils;
import java.io.Serializable;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
public class Job
extends BaseEntity
implements Serializable
{
private static final long serialVersionUID = 1L;
@Excel(name = "任务序号", cellType = ColumnType.NUMERIC)
private Long jobId;
@Excel(name = "任务名称")
private String jobName;
@Excel(name = "任务组名")
private String jobGroup;
@Excel(name = "调用目标字符串")
private String invokeTarget;
@Excel(name = "执行表达式 ")
private String cronExpression;
@Excel(name = "计划策略 ", readConverterExp = "0=默认,1=立即触发执行,2=触发一次执行,3=不触发立即执行")
private String misfirePolicy = "0";
@Excel(name = "并发执行", readConverterExp = "0=允许,1=禁止")
private String concurrent;
@Excel(name = "任务状态", readConverterExp = "0=正常,1=暂停")
private String status;
public Long getJobId() {
return this.jobId;
}
public void setJobId(Long jobId) {
this.jobId = jobId;
}
@NotBlank(message = "任务名称不能为空")
@Size(min = 0, max = 64, message = "任务名称不能超过64个字符")
public String getJobName() {
return this.jobName;
}
public void setJobName(String jobName) {
this.jobName = jobName;
}
public String getJobGroup() {
return this.jobGroup;
}
public void setJobGroup(String jobGroup) {
this.jobGroup = jobGroup;
}
@NotBlank(message = "调用目标字符串不能为空")
@Size(min = 0, max = 1000, message = "调用目标字符串长度不能超过500个字符")
public String getInvokeTarget() {
return this.invokeTarget;
}
public void setInvokeTarget(String invokeTarget) {
this.invokeTarget = invokeTarget;
}
@NotBlank(message = "Cron执行表达式不能为空")
@Size(min = 0, max = 255, message = "Cron执行表达式不能超过255个字符")
public String getCronExpression() {
return this.cronExpression;
}
public void setCronExpression(String cronExpression) {
this.cronExpression = cronExpression;
}
public Date getNextValidTime() {
if (StringUtils.isNotEmpty(this.cronExpression))
{
return CronUtils.getNextExecution(this.cronExpression);
}
return null;
}
public String getMisfirePolicy() {
return this.misfirePolicy;
}
public void setMisfirePolicy(String misfirePolicy) {
this.misfirePolicy = misfirePolicy;
}
public String getConcurrent() {
return this.concurrent;
}
public void setConcurrent(String concurrent) {
this.concurrent = concurrent;
}
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
}
@Override
public String toString() {
return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE))
.append("jobId", getJobId())
.append("jobName", getJobName())
.append("jobGroup", getJobGroup())
.append("cronExpression", getCronExpression())
.append("nextValidTime", getNextValidTime())
.append("misfirePolicy", getMisfirePolicy())
.append("concurrent", getConcurrent())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\job\domain\Job.class

@ -1,158 +1,158 @@
/* */ package com.archive.project.monitor.job.domain;
/* */
/* */ import com.archive.framework.aspectj.lang.annotation.Excel;
/* */ import com.archive.framework.web.domain.BaseEntity;
/* */ import java.util.Date;
/* */ import org.apache.commons.lang3.builder.ToStringBuilder;
/* */ import org.apache.commons.lang3.builder.ToStringStyle;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class JobLog
/* */ extends BaseEntity
/* */ {
/* */ private static final long serialVersionUID = 1L;
/* */ @Excel(name = "日志序号")
/* */ private Long jobLogId;
/* */ @Excel(name = "任务名称")
/* */ private String jobName;
/* */ @Excel(name = "任务组名")
/* */ private String jobGroup;
/* */ @Excel(name = "调用目标字符串")
/* */ private String invokeTarget;
/* */ @Excel(name = "日志信息")
/* */ private String jobMessage;
/* */ @Excel(name = "执行状态", readConverterExp = "0=正常,1=失败")
/* */ private String status;
/* */ @Excel(name = "异常信息")
/* */ private String exceptionInfo;
/* */ private Date startTime;
/* */ private Date endTime;
/* */
/* */ public Long getJobLogId() {
/* 54 */ return this.jobLogId;
/* */ }
/* */
/* */
/* */ public void setJobLogId(Long jobLogId) {
/* 59 */ this.jobLogId = jobLogId;
/* */ }
/* */
/* */
/* */ public String getJobName() {
/* 64 */ return this.jobName;
/* */ }
/* */
/* */
/* */ public void setJobName(String jobName) {
/* 69 */ this.jobName = jobName;
/* */ }
/* */
/* */
/* */ public String getJobGroup() {
/* 74 */ return this.jobGroup;
/* */ }
/* */
/* */
/* */ public void setJobGroup(String jobGroup) {
/* 79 */ this.jobGroup = jobGroup;
/* */ }
/* */
/* */
/* */ public String getInvokeTarget() {
/* 84 */ return this.invokeTarget;
/* */ }
/* */
/* */
/* */ public void setInvokeTarget(String invokeTarget) {
/* 89 */ this.invokeTarget = invokeTarget;
/* */ }
/* */
/* */
/* */ public String getJobMessage() {
/* 94 */ return this.jobMessage;
/* */ }
/* */
/* */
/* */ public void setJobMessage(String jobMessage) {
/* 99 */ this.jobMessage = jobMessage;
/* */ }
/* */
/* */
/* */ public String getStatus() {
/* 104 */ return this.status;
/* */ }
/* */
/* */
/* */ public void setStatus(String status) {
/* 109 */ this.status = status;
/* */ }
/* */
/* */
/* */ public String getExceptionInfo() {
/* 114 */ return this.exceptionInfo;
/* */ }
/* */
/* */
/* */ public void setExceptionInfo(String exceptionInfo) {
/* 119 */ this.exceptionInfo = exceptionInfo;
/* */ }
/* */
/* */
/* */ public Date getStartTime() {
/* 124 */ return this.startTime;
/* */ }
/* */
/* */
/* */ public void setStartTime(Date startTime) {
/* 129 */ this.startTime = startTime;
/* */ }
/* */
/* */
/* */ public Date getEndTime() {
/* 134 */ return this.endTime;
/* */ }
/* */
/* */
/* */ public void setEndTime(Date endTime) {
/* 139 */ this.endTime = endTime;
/* */ }
/* */
/* */
/* */ public String toString() {
/* 144 */ return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE))
/* 145 */ .append("jobLogId", getJobLogId())
/* 146 */ .append("jobName", getJobName())
/* 147 */ .append("jobGroup", getJobGroup())
/* 148 */ .append("jobMessage", getJobMessage())
/* 149 */ .append("status", getStatus())
/* 150 */ .append("exceptionInfo", getExceptionInfo())
/* 151 */ .append("startTime", getStartTime())
/* 152 */ .append("endTime", getEndTime())
/* 153 */ .toString();
/* */ }
/* */ }
package com.archive.project.monitor.job.domain;
import com.archive.framework.aspectj.lang.annotation.Excel;
import com.archive.framework.web.domain.BaseEntity;
import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
public class JobLog
extends BaseEntity
{
private static final long serialVersionUID = 1L;
@Excel(name = "日志序号")
private Long jobLogId;
@Excel(name = "任务名称")
private String jobName;
@Excel(name = "任务组名")
private String jobGroup;
@Excel(name = "调用目标字符串")
private String invokeTarget;
@Excel(name = "日志信息")
private String jobMessage;
@Excel(name = "执行状态", readConverterExp = "0=正常,1=失败")
private String status;
@Excel(name = "异常信息")
private String exceptionInfo;
private Date startTime;
private Date endTime;
public Long getJobLogId() {
return this.jobLogId;
}
public void setJobLogId(Long jobLogId) {
this.jobLogId = jobLogId;
}
public String getJobName() {
return this.jobName;
}
public void setJobName(String jobName) {
this.jobName = jobName;
}
public String getJobGroup() {
return this.jobGroup;
}
public void setJobGroup(String jobGroup) {
this.jobGroup = jobGroup;
}
public String getInvokeTarget() {
return this.invokeTarget;
}
public void setInvokeTarget(String invokeTarget) {
this.invokeTarget = invokeTarget;
}
public String getJobMessage() {
return this.jobMessage;
}
public void setJobMessage(String jobMessage) {
this.jobMessage = jobMessage;
}
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
}
public String getExceptionInfo() {
return this.exceptionInfo;
}
public void setExceptionInfo(String exceptionInfo) {
this.exceptionInfo = exceptionInfo;
}
public Date getStartTime() {
return this.startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return this.endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public String toString() {
return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE))
.append("jobLogId", getJobLogId())
.append("jobName", getJobName())
.append("jobGroup", getJobGroup())
.append("jobMessage", getJobMessage())
.append("status", getStatus())
.append("exceptionInfo", getExceptionInfo())
.append("startTime", getStartTime())
.append("endTime", getEndTime())
.toString();
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\job\domain\JobLog.class

@ -1,102 +1,102 @@
/* */ package com.archive.project.monitor.job.service
package com.archive.project.monitor.job.service
;
/* */
/* */ import com.archive.common.utils.text.Convert;
/* */ import com.archive.framework.config.ArchiveConfig;
/* */ import com.archive.project.monitor.job.domain.JobLog;
/* */ import com.archive.project.monitor.job.mapper.JobLogMapper;
/* */ import com.archive.project.monitor.job.service.IJobLogService;
/* */ import java.util.List;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Service;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Service
/* */ public class JobLogServiceImpl
/* */ implements IJobLogService
/* */ {
/* */ @Autowired
/* */ private JobLogMapper jobLogMapper;
/* */ @Autowired
/* */ private ArchiveConfig archiveConfig;
/* */
/* */ public List<JobLog> selectJobLogList(JobLog jobLog) {
/* 36 */ return this.jobLogMapper.selectJobLogList(jobLog);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public JobLog selectJobLogById(Long jobLogId) {
/* 48 */ return this.jobLogMapper.selectJobLogById(jobLogId);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void addJobLog(JobLog jobLog) {
/* 59 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 60 */ this.jobLogMapper.insertJobLog(jobLog);
/* 61 */ } else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 62 */ this.jobLogMapper.insertJobLogSqlite(jobLog);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int deleteJobLogByIds(String ids) {
/* 76 */ return this.jobLogMapper.deleteJobLogByIds(Convert.toStrArray(ids));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int deleteJobLogById(Long jobId) {
/* 87 */ return this.jobLogMapper.deleteJobLogById(jobId);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void cleanJobLog() {
/* 96 */ this.jobLogMapper.cleanJobLog();
/* */ }
/* */ }
import com.archive.common.utils.text.Convert;
import com.archive.framework.config.ArchiveConfig;
import com.archive.project.monitor.job.domain.JobLog;
import com.archive.project.monitor.job.mapper.JobLogMapper;
import com.archive.project.monitor.job.service.IJobLogService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class JobLogServiceImpl
implements IJobLogService
{
@Autowired
private JobLogMapper jobLogMapper;
@Autowired
private ArchiveConfig archiveConfig;
public List<JobLog> selectJobLogList(JobLog jobLog) {
return this.jobLogMapper.selectJobLogList(jobLog);
}
public JobLog selectJobLogById(Long jobLogId) {
return this.jobLogMapper.selectJobLogById(jobLogId);
}
public void addJobLog(JobLog jobLog) {
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
this.jobLogMapper.insertJobLog(jobLog);
} else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
this.jobLogMapper.insertJobLogSqlite(jobLog);
}
}
public int deleteJobLogByIds(String ids) {
return this.jobLogMapper.deleteJobLogByIds(Convert.toStrArray(ids));
}
public int deleteJobLogById(Long jobId) {
return this.jobLogMapper.deleteJobLogById(jobId);
}
public void cleanJobLog() {
this.jobLogMapper.cleanJobLog();
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\job\service\JobLogServiceImpl.class

@ -1,303 +1,303 @@
/* */ package com.archive.project.monitor.job.service
package com.archive.project.monitor.job.service
;
/* */
/* */ import com.archive.common.constant.ScheduleConstants;
/* */ import com.archive.common.constant.Status;
import com.archive.common.constant.ScheduleConstants;
import com.archive.common.constant.Status;
import com.archive.common.exception.job.TaskException;
/* */ import com.archive.common.utils.text.Convert;
/* */ import com.archive.framework.config.ArchiveConfig;
/* */ import com.archive.project.monitor.job.domain.Job;
/* */ import com.archive.project.monitor.job.mapper.JobMapper;
/* */ import com.archive.project.monitor.job.service.IJobService;
/* */ import com.archive.project.monitor.job.util.CronUtils;
/* */ import com.archive.project.monitor.job.util.ScheduleUtils;
/* */ import java.util.List;
/* */ import javax.annotation.PostConstruct;
/* */ import org.quartz.JobDataMap;
/* */ import org.quartz.JobKey;
/* */ import org.quartz.Scheduler;
/* */ import org.quartz.SchedulerException;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Service;
/* */ import org.springframework.transaction.annotation.Transactional;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Service
/* */ public class JobServiceImpl
/* */ implements IJobService
/* */ {
/* */ @Autowired
/* */ private Scheduler scheduler;
/* */ @Autowired
/* */ private JobMapper jobMapper;
/* */ @Autowired
/* */ private ArchiveConfig archiveConfig;
/* */
/* */ @PostConstruct
/* */ public void init() throws SchedulerException, TaskException {
/* 47 */ this.scheduler.clear();
/* 48 */ List<Job> jobList = this.jobMapper.selectJobAll();
/* 49 */ for (Job job : jobList)
/* */ {
/* 51 */ ScheduleUtils.createScheduleJob(this.scheduler, job);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Override
/* */ public List<Job> selectJobList(Job job) {
/* 64 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 65 */ return this.jobMapper.selectJobList(job);
/* */ }
/* 67 */ if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 68 */ return this.jobMapper.selectJobListSqlite(job);
/* */ }
/* 70 */ return this.jobMapper.selectJobList(job);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Override
/* */ public Job selectJobById(Long jobId) {
/* 84 */ return this.jobMapper.selectJobById(jobId);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Override
/* */ @Transactional
/* */ public int pauseJob(Job job) throws SchedulerException {
/* 96 */ Long jobId = job.getJobId();
/* 97 */ String jobGroup = job.getJobGroup();
/* 98 */ job.setStatus(Status.PAUSE.getValue());
/* 99 */ int rows = 0;
/* 100 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 101 */ rows = this.jobMapper.updateJob(job);
/* */ }
/* 103 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 104 */ rows = this.jobMapper.updateJobSqlite(job);
/* */ }
/* 106 */ if (rows > 0)
/* */ {
/* 108 */ this.scheduler.pauseJob(ScheduleUtils.getJobKey(jobId, jobGroup));
/* */ }
/* 110 */ return rows;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Override
/* */ @Transactional
/* */ public int resumeJob(Job job) throws SchedulerException {
/* 122 */ Long jobId = job.getJobId();
/* 123 */ String jobGroup = job.getJobGroup();
/* 124 */ job.setStatus(Status.NORMAL.getValue());
/* 125 */ int rows = 0;
/* 126 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 127 */ rows = this.jobMapper.updateJob(job);
/* */ }
/* 129 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 130 */ rows = this.jobMapper.updateJobSqlite(job);
/* */ }
/* */
/* 133 */ if (rows > 0)
/* */ {
/* 135 */ this.scheduler.resumeJob(ScheduleUtils.getJobKey(jobId, jobGroup));
/* */ }
/* 137 */ return rows;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Override
/* */ @Transactional
/* */ public int deleteJob(Job job) throws SchedulerException {
/* 149 */ Long jobId = job.getJobId();
/* 150 */ String jobGroup = job.getJobGroup();
/* 151 */ int rows = this.jobMapper.deleteJobById(jobId);
/* 152 */ if (rows > 0)
/* */ {
/* 154 */ this.scheduler.deleteJob(ScheduleUtils.getJobKey(jobId, jobGroup));
/* */ }
/* 156 */ return rows;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Override
/* */ @Transactional
/* */ public void deleteJobByIds(String ids) throws SchedulerException {
/* 169 */ Long[] jobIds = Convert.toLongArray(ids);
/* 170 */ for (Long jobId : jobIds) {
/* */
/* 172 */ Job job = this.jobMapper.selectJobById(jobId);
/* 173 */ deleteJob(job);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Override
/* */ @Transactional
/* */ public int changeStatus(Job job) throws SchedulerException {
/* 186 */ int rows = 0;
/* 187 */ String status = job.getStatus();
/* 188 */ if (Status.NORMAL.getValue().equals(status)) {
/* */
/* 190 */ rows = resumeJob(job);
/* */ }
/* 192 */ else if (Status.PAUSE.getValue().equals(status)) {
/* */
/* 194 */ rows = pauseJob(job);
/* */ }
/* 196 */ return rows;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Override
/* */ @Transactional
/* */ public void run(Job job) throws SchedulerException {
/* 208 */ Long jobId = job.getJobId();
/* 209 */ Job tmpObj = selectJobById(job.getJobId());
/* */
/* 211 */ JobDataMap dataMap = new JobDataMap();
/* 212 */ dataMap.put("TASK_PROPERTIES", tmpObj);
/* 213 */ this.scheduler.triggerJob(ScheduleUtils.getJobKey(jobId, tmpObj.getJobGroup()), dataMap);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Override
/* */ @Transactional
/* */ public int insertJob(Job job) throws SchedulerException, TaskException {
/* 225 */ job.setStatus(Status.PAUSE.getValue());
/* 226 */ int rows = 0;
/* 227 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 228 */ rows = this.jobMapper.insertJob(job);
/* */ }
/* 230 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 231 */ rows = this.jobMapper.insertJobSqlite(job);
/* */ }
/* */
/* 234 */ if (rows > 0)
/* */ {
/* 236 */ ScheduleUtils.createScheduleJob(this.scheduler, job);
/* */ }
/* 238 */ return rows;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Override
/* */ @Transactional
/* */ public int updateJob(Job job) throws SchedulerException, TaskException {
/* 250 */ Job properties = selectJobById(job.getJobId());
/* */
/* 252 */ int rows = 0;
/* 253 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 254 */ rows = this.jobMapper.updateJob(job);
/* */ }
/* 256 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 257 */ rows = this.jobMapper.updateJobSqlite(job);
/* */ }
/* */
/* 260 */ if (rows > 0)
/* */ {
/* 262 */ updateSchedulerJob(job, properties.getJobGroup());
/* */ }
/* 264 */ return rows;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void updateSchedulerJob(Job job, String jobGroup) throws SchedulerException, TaskException {
/* 275 */ Long jobId = job.getJobId();
/* */
/* 277 */ JobKey jobKey = ScheduleUtils.getJobKey(jobId, jobGroup);
/* 278 */ if (this.scheduler.checkExists(jobKey))
/* */ {
/* */
/* 281 */ this.scheduler.deleteJob(jobKey);
/* */ }
/* 283 */ ScheduleUtils.createScheduleJob(this.scheduler, job);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Override
/* */ public boolean checkCronExpressionIsValid(String cronExpression) {
/* 295 */ return CronUtils.isValid(cronExpression);
/* */ }
/* */ }
import com.archive.common.utils.text.Convert;
import com.archive.framework.config.ArchiveConfig;
import com.archive.project.monitor.job.domain.Job;
import com.archive.project.monitor.job.mapper.JobMapper;
import com.archive.project.monitor.job.service.IJobService;
import com.archive.project.monitor.job.util.CronUtils;
import com.archive.project.monitor.job.util.ScheduleUtils;
import java.util.List;
import javax.annotation.PostConstruct;
import org.quartz.JobDataMap;
import org.quartz.JobKey;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class JobServiceImpl
implements IJobService
{
@Autowired
private Scheduler scheduler;
@Autowired
private JobMapper jobMapper;
@Autowired
private ArchiveConfig archiveConfig;
@PostConstruct
public void init() throws SchedulerException, TaskException {
this.scheduler.clear();
List<Job> jobList = this.jobMapper.selectJobAll();
for (Job job : jobList)
{
ScheduleUtils.createScheduleJob(this.scheduler, job);
}
}
@Override
public List<Job> selectJobList(Job job) {
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
return this.jobMapper.selectJobList(job);
}
if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
return this.jobMapper.selectJobListSqlite(job);
}
return this.jobMapper.selectJobList(job);
}
@Override
public Job selectJobById(Long jobId) {
return this.jobMapper.selectJobById(jobId);
}
@Override
@Transactional
public int pauseJob(Job job) throws SchedulerException {
Long jobId = job.getJobId();
String jobGroup = job.getJobGroup();
job.setStatus(Status.PAUSE.getValue());
int rows = 0;
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
rows = this.jobMapper.updateJob(job);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
rows = this.jobMapper.updateJobSqlite(job);
}
if (rows > 0)
{
this.scheduler.pauseJob(ScheduleUtils.getJobKey(jobId, jobGroup));
}
return rows;
}
@Override
@Transactional
public int resumeJob(Job job) throws SchedulerException {
Long jobId = job.getJobId();
String jobGroup = job.getJobGroup();
job.setStatus(Status.NORMAL.getValue());
int rows = 0;
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
rows = this.jobMapper.updateJob(job);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
rows = this.jobMapper.updateJobSqlite(job);
}
if (rows > 0)
{
this.scheduler.resumeJob(ScheduleUtils.getJobKey(jobId, jobGroup));
}
return rows;
}
@Override
@Transactional
public int deleteJob(Job job) throws SchedulerException {
Long jobId = job.getJobId();
String jobGroup = job.getJobGroup();
int rows = this.jobMapper.deleteJobById(jobId);
if (rows > 0)
{
this.scheduler.deleteJob(ScheduleUtils.getJobKey(jobId, jobGroup));
}
return rows;
}
@Override
@Transactional
public void deleteJobByIds(String ids) throws SchedulerException {
Long[] jobIds = Convert.toLongArray(ids);
for (Long jobId : jobIds) {
Job job = this.jobMapper.selectJobById(jobId);
deleteJob(job);
}
}
@Override
@Transactional
public int changeStatus(Job job) throws SchedulerException {
int rows = 0;
String status = job.getStatus();
if (Status.NORMAL.getValue().equals(status)) {
rows = resumeJob(job);
}
else if (Status.PAUSE.getValue().equals(status)) {
rows = pauseJob(job);
}
return rows;
}
@Override
@Transactional
public void run(Job job) throws SchedulerException {
Long jobId = job.getJobId();
Job tmpObj = selectJobById(job.getJobId());
JobDataMap dataMap = new JobDataMap();
dataMap.put("TASK_PROPERTIES", tmpObj);
this.scheduler.triggerJob(ScheduleUtils.getJobKey(jobId, tmpObj.getJobGroup()), dataMap);
}
@Override
@Transactional
public int insertJob(Job job) throws SchedulerException, TaskException {
job.setStatus(Status.PAUSE.getValue());
int rows = 0;
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
rows = this.jobMapper.insertJob(job);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
rows = this.jobMapper.insertJobSqlite(job);
}
if (rows > 0)
{
ScheduleUtils.createScheduleJob(this.scheduler, job);
}
return rows;
}
@Override
@Transactional
public int updateJob(Job job) throws SchedulerException, TaskException {
Job properties = selectJobById(job.getJobId());
int rows = 0;
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
rows = this.jobMapper.updateJob(job);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
rows = this.jobMapper.updateJobSqlite(job);
}
if (rows > 0)
{
updateSchedulerJob(job, properties.getJobGroup());
}
return rows;
}
public void updateSchedulerJob(Job job, String jobGroup) throws SchedulerException, TaskException {
Long jobId = job.getJobId();
JobKey jobKey = ScheduleUtils.getJobKey(jobId, jobGroup);
if (this.scheduler.checkExists(jobKey))
{
this.scheduler.deleteJob(jobKey);
}
ScheduleUtils.createScheduleJob(this.scheduler, job);
}
@Override
public boolean checkCronExpressionIsValid(String cronExpression) {
return CronUtils.isValid(cronExpression);
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\job\service\JobServiceImpl.class

@ -1,187 +1,187 @@
/* */ package com.archive.project.monitor.job.util
package com.archive.project.monitor.job.util
;
/* */
/* */ import com.archive.common.utils.StringUtils;
/* */ import com.archive.common.utils.spring.SpringUtils;
/* */ import com.archive.project.monitor.job.domain.Job;
/* */ import java.lang.reflect.InvocationTargetException;
/* */ import java.lang.reflect.Method;
/* */ import java.util.LinkedList;
/* */ import java.util.List;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class JobInvokeUtil
/* */ {
/* */ public static void invokeMethod(Job job) throws Exception {
/* 25 */ String invokeTarget = job.getInvokeTarget();
/* 26 */ String beanName = getBeanName(invokeTarget);
/* 27 */ String methodName = getMethodName(invokeTarget);
/* 28 */ List<Object[]> methodParams = getMethodParams(invokeTarget);
/* */
/* 30 */ if (!isValidClassName(beanName)) {
/* */
/* 32 */ Object bean = SpringUtils.getBean(beanName);
/* 33 */ invokeMethod(bean, methodName, methodParams);
/* */ }
/* */ else {
/* */
/* 37 */ Object bean = Class.forName(beanName).newInstance();
/* 38 */ invokeMethod(bean, methodName, methodParams);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ private static void invokeMethod(Object bean, String methodName, List<Object[]> methodParams) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
/* 53 */ if (StringUtils.isNotNull(methodParams) && methodParams.size() > 0) {
/* */
/* 55 */ Method method = bean.getClass().getDeclaredMethod(methodName, getMethodParamsType(methodParams));
/* 56 */ method.invoke(bean, getMethodParamsValue(methodParams));
/* */ }
/* */ else {
/* */
/* 60 */ Method method = bean.getClass().getDeclaredMethod(methodName, new Class[0]);
/* 61 */ method.invoke(bean, new Object[0]);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean isValidClassName(String invokeTarget) {
/* 73 */ return (StringUtils.countMatches(invokeTarget, ".") > 1);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String getBeanName(String invokeTarget) {
/* 84 */ String beanName = StringUtils.substringBefore(invokeTarget, "(");
/* 85 */ return StringUtils.substringBeforeLast(beanName, ".");
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String getMethodName(String invokeTarget) {
/* 96 */ String methodName = StringUtils.substringBefore(invokeTarget, "(");
/* 97 */ return StringUtils.substringAfterLast(methodName, ".");
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static List<Object[]> getMethodParams(String invokeTarget) {
/* 108 */ String methodStr = StringUtils.substringBetween(invokeTarget, "(", ")");
/* 109 */ if (StringUtils.isEmpty(methodStr))
/* */ {
/* 111 */ return null;
/* */ }
/* 113 */ String[] methodParams = methodStr.split(",");
/* 114 */ List<Object[]> classs = new LinkedList();
/* 115 */ for (int i = 0; i < methodParams.length; i++) {
/* */
/* 117 */ String str = StringUtils.trimToEmpty(methodParams[i]);
/* */
/* 119 */ if (StringUtils.contains(str, "'")) {
/* */
/* 121 */ classs.add(new Object[] { StringUtils.replace(str, "'", ""), String.class });
/* */
/* */ }
/* 124 */ else if (StringUtils.equals(str, "true") || StringUtils.equalsIgnoreCase(str, "false")) {
/* */
/* 126 */ classs.add(new Object[] { Boolean.valueOf(str), Boolean.class });
/* */
/* */ }
/* 129 */ else if (StringUtils.containsIgnoreCase(str, "L")) {
/* */
/* 131 */ classs.add(new Object[] { Long.valueOf(StringUtils.replaceIgnoreCase(str, "L", "")), Long.class });
/* */
/* */ }
/* 134 */ else if (StringUtils.containsIgnoreCase(str, "D")) {
/* */
/* 136 */ classs.add(new Object[] { Double.valueOf(StringUtils.replaceIgnoreCase(str, "D", "")), Double.class });
/* */
/* */ }
/* */ else {
/* */
/* 141 */ classs.add(new Object[] { Integer.valueOf(str), Integer.class });
/* */ }
/* */ }
/* 144 */ return classs;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static Class<?>[] getMethodParamsType(List<Object[]> methodParams) {
/* 155 */ Class<?>[] classs = new Class[methodParams.size()];
/* 156 */ int index = 0;
/* 157 */ for (Object[] os : methodParams) {
/* */
/* 159 */ classs[index] = (Class)os[1];
/* 160 */ index++;
/* */ }
/* 162 */ return classs;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static Object[] getMethodParamsValue(List<Object[]> methodParams) {
/* 173 */ Object[] classs = new Object[methodParams.size()];
/* 174 */ int index = 0;
/* 175 */ for (Object[] os : methodParams) {
/* */
/* 177 */ classs[index] = os[0];
/* 178 */ index++;
/* */ }
/* 180 */ return classs;
/* */ }
/* */ }
import com.archive.common.utils.StringUtils;
import com.archive.common.utils.spring.SpringUtils;
import com.archive.project.monitor.job.domain.Job;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.LinkedList;
import java.util.List;
public class JobInvokeUtil
{
public static void invokeMethod(Job job) throws Exception {
String invokeTarget = job.getInvokeTarget();
String beanName = getBeanName(invokeTarget);
String methodName = getMethodName(invokeTarget);
List<Object[]> methodParams = getMethodParams(invokeTarget);
if (!isValidClassName(beanName)) {
Object bean = SpringUtils.getBean(beanName);
invokeMethod(bean, methodName, methodParams);
}
else {
Object bean = Class.forName(beanName).newInstance();
invokeMethod(bean, methodName, methodParams);
}
}
private static void invokeMethod(Object bean, String methodName, List<Object[]> methodParams) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
if (StringUtils.isNotNull(methodParams) && methodParams.size() > 0) {
Method method = bean.getClass().getDeclaredMethod(methodName, getMethodParamsType(methodParams));
method.invoke(bean, getMethodParamsValue(methodParams));
}
else {
Method method = bean.getClass().getDeclaredMethod(methodName, new Class[0]);
method.invoke(bean, new Object[0]);
}
}
public static boolean isValidClassName(String invokeTarget) {
return (StringUtils.countMatches(invokeTarget, ".") > 1);
}
public static String getBeanName(String invokeTarget) {
String beanName = StringUtils.substringBefore(invokeTarget, "(");
return StringUtils.substringBeforeLast(beanName, ".");
}
public static String getMethodName(String invokeTarget) {
String methodName = StringUtils.substringBefore(invokeTarget, "(");
return StringUtils.substringAfterLast(methodName, ".");
}
public static List<Object[]> getMethodParams(String invokeTarget) {
String methodStr = StringUtils.substringBetween(invokeTarget, "(", ")");
if (StringUtils.isEmpty(methodStr))
{
return null;
}
String[] methodParams = methodStr.split(",");
List<Object[]> classs = new LinkedList();
for (int i = 0; i < methodParams.length; i++) {
String str = StringUtils.trimToEmpty(methodParams[i]);
if (StringUtils.contains(str, "'")) {
classs.add(new Object[] { StringUtils.replace(str, "'", ""), String.class });
}
else if (StringUtils.equals(str, "true") || StringUtils.equalsIgnoreCase(str, "false")) {
classs.add(new Object[] { Boolean.valueOf(str), Boolean.class });
}
else if (StringUtils.containsIgnoreCase(str, "L")) {
classs.add(new Object[] { Long.valueOf(StringUtils.replaceIgnoreCase(str, "L", "")), Long.class });
}
else if (StringUtils.containsIgnoreCase(str, "D")) {
classs.add(new Object[] { Double.valueOf(StringUtils.replaceIgnoreCase(str, "D", "")), Double.class });
}
else {
classs.add(new Object[] { Integer.valueOf(str), Integer.class });
}
}
return classs;
}
public static Class<?>[] getMethodParamsType(List<Object[]> methodParams) {
Class<?>[] classs = new Class[methodParams.size()];
int index = 0;
for (Object[] os : methodParams) {
classs[index] = (Class)os[1];
index++;
}
return classs;
}
public static Object[] getMethodParamsValue(List<Object[]> methodParams) {
Object[] classs = new Object[methodParams.size()];
int index = 0;
for (Object[] os : methodParams) {
classs[index] = os[0];
index++;
}
return classs;
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\jo\\util\JobInvokeUtil.class

@ -1,165 +1,165 @@
/* */ package com.archive.project.monitor.logininfor.domain
package com.archive.project.monitor.logininfor.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.web.domain.BaseEntity;
/* */ import java.util.Date;
/* */ import org.apache.commons.lang3.builder.ToStringBuilder;
/* */ import org.apache.commons.lang3.builder.ToStringStyle;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class Logininfor
/* */ extends BaseEntity
/* */ {
/* */ private static final long serialVersionUID = 1L;
/* */ @Excel(name = "序号", cellType = ColumnType.NUMERIC)
/* */ private Long infoId;
/* */ @Excel(name = "用户账号")
/* */ private String loginName;
/* */ @Excel(name = "登录状态", readConverterExp = "0=成功,1=失败")
/* */ private String status;
/* */ @Excel(name = "登录地址")
/* */ private String ipaddr;
/* */ @Excel(name = "登录地点")
/* */ private String loginLocation;
/* */ @Excel(name = "浏览器")
/* */ private String browser;
/* */ @Excel(name = "操作系统")
/* */ private String os;
/* */ @Excel(name = "提示消息")
/* */ private String msg;
/* */ @Excel(name = "访问时间", width = 30.0D, dateFormat = "yyyy-MM-dd HH:mm:ss")
/* */ private Date loginTime;
/* */
/* */ public Long getInfoId() {
/* 57 */ return this.infoId;
/* */ }
/* */
/* */
/* */ public void setInfoId(Long infoId) {
/* 62 */ this.infoId = infoId;
/* */ }
/* */
/* */
/* */ public String getLoginName() {
/* 67 */ return this.loginName;
/* */ }
/* */
/* */
/* */ public void setLoginName(String loginName) {
/* 72 */ this.loginName = loginName;
/* */ }
/* */
/* */
/* */ public String getStatus() {
/* 77 */ return this.status;
/* */ }
/* */
/* */
/* */ public void setStatus(String status) {
/* 82 */ this.status = status;
/* */ }
/* */
/* */
/* */ public String getIpaddr() {
/* 87 */ return this.ipaddr;
/* */ }
/* */
/* */
/* */ public void setIpaddr(String ipaddr) {
/* 92 */ this.ipaddr = ipaddr;
/* */ }
/* */
/* */
/* */ public String getLoginLocation() {
/* 97 */ return this.loginLocation;
/* */ }
/* */
/* */
/* */ public void setLoginLocation(String loginLocation) {
/* 102 */ this.loginLocation = loginLocation;
/* */ }
/* */
/* */
/* */ public String getBrowser() {
/* 107 */ return this.browser;
/* */ }
/* */
/* */
/* */ public void setBrowser(String browser) {
/* 112 */ this.browser = browser;
/* */ }
/* */
/* */
/* */ public String getOs() {
/* 117 */ return this.os;
/* */ }
/* */
/* */
/* */ public void setOs(String os) {
/* 122 */ this.os = os;
/* */ }
/* */
/* */
/* */ public String getMsg() {
/* 127 */ return this.msg;
/* */ }
/* */
/* */
/* */ public void setMsg(String msg) {
/* 132 */ this.msg = msg;
/* */ }
/* */
/* */
/* */ public Date getLoginTime() {
/* 137 */ return this.loginTime;
/* */ }
/* */
/* */
/* */ public void setLoginTime(Date loginTime) {
/* 142 */ this.loginTime = loginTime;
/* */ }
/* */
/* */ @Override
/* */ public String toString() {
/* 147 */ return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE))
/* 148 */ .append("infoId", getInfoId())
/* 149 */ .append("loginName", getLoginName())
/* 150 */ .append("ipaddr", getIpaddr())
/* 151 */ .append("loginLocation", getLoginLocation())
/* 152 */ .append("browser", getBrowser())
/* 153 */ .append("os", getOs())
/* 154 */ .append("status", getStatus())
/* 155 */ .append("msg", getMsg())
/* 156 */ .append("loginTime", getLoginTime())
/* 157 */ .toString();
/* */ }
/* */ }
import com.archive.framework.web.domain.BaseEntity;
import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
public class Logininfor
extends BaseEntity
{
private static final long serialVersionUID = 1L;
@Excel(name = "序号", cellType = ColumnType.NUMERIC)
private Long infoId;
@Excel(name = "用户账号")
private String loginName;
@Excel(name = "登录状态", readConverterExp = "0=成功,1=失败")
private String status;
@Excel(name = "登录地址")
private String ipaddr;
@Excel(name = "登录地点")
private String loginLocation;
@Excel(name = "浏览器")
private String browser;
@Excel(name = "操作系统")
private String os;
@Excel(name = "提示消息")
private String msg;
@Excel(name = "访问时间", width = 30.0D, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date loginTime;
public Long getInfoId() {
return this.infoId;
}
public void setInfoId(Long infoId) {
this.infoId = infoId;
}
public String getLoginName() {
return this.loginName;
}
public void setLoginName(String loginName) {
this.loginName = loginName;
}
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
}
public String getIpaddr() {
return this.ipaddr;
}
public void setIpaddr(String ipaddr) {
this.ipaddr = ipaddr;
}
public String getLoginLocation() {
return this.loginLocation;
}
public void setLoginLocation(String loginLocation) {
this.loginLocation = loginLocation;
}
public String getBrowser() {
return this.browser;
}
public void setBrowser(String browser) {
this.browser = browser;
}
public String getOs() {
return this.os;
}
public void setOs(String os) {
this.os = os;
}
public String getMsg() {
return this.msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public Date getLoginTime() {
return this.loginTime;
}
public void setLoginTime(Date loginTime) {
this.loginTime = loginTime;
}
@Override
public String toString() {
return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE))
.append("infoId", getInfoId())
.append("loginName", getLoginName())
.append("ipaddr", getIpaddr())
.append("loginLocation", getLoginLocation())
.append("browser", getBrowser())
.append("os", getOs())
.append("status", getStatus())
.append("msg", getMsg())
.append("loginTime", getLoginTime())
.toString();
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\logininfor\domain\Logininfor.class

@ -1,127 +1,127 @@
/* */ 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.DateUtils;
/* */ import java.lang.management.ManagementFactory;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class Jvm
/* */ {
/* */ private double total;
/* */ private double max;
/* */ private double free;
/* */ private String version;
/* */ private String home;
/* */
/* */ public double getTotal() {
/* 41 */ return Arith.div(this.total, 1048576.0D, 2);
/* */ }
/* */
/* */
/* */ public void setTotal(double total) {
/* 46 */ this.total = total;
/* */ }
/* */
/* */
/* */ public double getMax() {
/* 51 */ return Arith.div(this.max, 1048576.0D, 2);
/* */ }
/* */
/* */
/* */ public void setMax(double max) {
/* 56 */ this.max = max;
/* */ }
/* */
/* */
/* */ public double getFree() {
/* 61 */ return Arith.div(this.free, 1048576.0D, 2);
/* */ }
/* */
/* */
/* */ public void setFree(double free) {
/* 66 */ this.free = free;
/* */ }
/* */
/* */
/* */ public double getUsed() {
/* 71 */ return Arith.div(this.total - this.free, 1048576.0D, 2);
/* */ }
/* */
/* */
/* */ public double getUsage() {
/* 76 */ return Arith.mul(Arith.div(this.total - this.free, this.total, 4), 100.0D);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public String getName() {
/* 84 */ return ManagementFactory.getRuntimeMXBean().getVmName();
/* */ }
/* */
/* */
/* */ public String getVersion() {
/* 89 */ return this.version;
/* */ }
/* */
/* */
/* */ public void setVersion(String version) {
/* 94 */ this.version = version;
/* */ }
/* */
/* */
/* */ public String getHome() {
/* 99 */ return this.home;
/* */ }
/* */
/* */
/* */ public void setHome(String home) {
/* 104 */ this.home = home;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public String getStartTime() {
/* 112 */ return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.getServerStartDate());
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public String getRunTime() {
/* 120 */ return DateUtils.getDatePoor(DateUtils.getNowDate(), DateUtils.getServerStartDate());
/* */ }
/* */ }
import com.archive.common.utils.Arith;
import com.archive.common.utils.DateUtils;
import java.lang.management.ManagementFactory;
public class Jvm
{
private double total;
private double max;
private double free;
private String version;
private String home;
public double getTotal() {
return Arith.div(this.total, 1048576.0D, 2);
}
public void setTotal(double total) {
this.total = total;
}
public double getMax() {
return Arith.div(this.max, 1048576.0D, 2);
}
public void setMax(double max) {
this.max = max;
}
public double getFree() {
return Arith.div(this.free, 1048576.0D, 2);
}
public void setFree(double free) {
this.free = free;
}
public double getUsed() {
return Arith.div(this.total - this.free, 1048576.0D, 2);
}
public double getUsage() {
return Arith.mul(Arith.div(this.total - this.free, this.total, 4), 100.0D);
}
public String getName() {
return ManagementFactory.getRuntimeMXBean().getVmName();
}
public String getVersion() {
return this.version;
}
public void setVersion(String version) {
this.version = version;
}
public String getHome() {
return this.home;
}
public void setHome(String home) {
this.home = home;
}
public String getStartTime() {
return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.getServerStartDate());
}
public String getRunTime() {
return DateUtils.getDatePoor(DateUtils.getNowDate(), DateUtils.getServerStartDate());
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\server\domain\Jvm.class

@ -1,80 +1,80 @@
/* */ package com.archive.project.system.user.controller
package com.archive.project.system.user.controller
;
/* */
/* */ import com.archive.common.utils.ServletUtils;
/* */ import com.archive.common.utils.StringUtils;
/* */ import com.archive.framework.web.controller.BaseController;
/* */ import com.archive.framework.web.domain.AjaxResult;
/* */ import com.archive.project.system.config.service.IConfigService;
/* */ import javax.servlet.http.HttpServletRequest;
/* */ import javax.servlet.http.HttpServletResponse;
/* */ import org.apache.shiro.SecurityUtils;
/* */ import org.apache.shiro.authc.AuthenticationException;
/* */ import org.apache.shiro.authc.AuthenticationToken;
/* */ import org.apache.shiro.authc.UsernamePasswordToken;
/* */ import org.apache.shiro.subject.Subject;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Controller;
/* */ import org.springframework.ui.ModelMap;
/* */ import org.springframework.web.bind.annotation.GetMapping;
/* */ import org.springframework.web.bind.annotation.PostMapping;
/* */ import org.springframework.web.bind.annotation.ResponseBody;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Controller
/* */ public class LoginController
/* */ extends BaseController
/* */ {
/* */ @Autowired
/* */ private IConfigService configService;
/* */
/* */ @GetMapping({"/login"})
/* */ public String login(HttpServletRequest request, HttpServletResponse response, ModelMap mmap) {
/* 37 */ String systemName = this.configService.selectConfigByKey("archive.SystemName");
/* 38 */ mmap.put("SystemName", systemName);
/* */
/* 40 */ if (ServletUtils.isAjaxRequest(request))
/* */ {
/* 42 */ return ServletUtils.renderString(response, "{\"code\":\"1\",\"msg\":\"未登录或登录超时。请重新登录\"}");
/* */ }
/* */
/* 45 */ return "login";
/* */ }
/* */
/* */
/* */ @PostMapping({"/login"})
/* */ @ResponseBody
/* */ public AjaxResult ajaxLogin(String username, String password, Boolean rememberMe) {
/* 52 */ UsernamePasswordToken token = new UsernamePasswordToken(username, password, rememberMe.booleanValue());
/* 53 */ Subject subject = SecurityUtils.getSubject();
/* */
/* */ try {
/* 56 */ subject.login((AuthenticationToken)token);
/* 57 */ return success();
/* */ }
/* 59 */ catch (AuthenticationException e) {
/* */
/* 61 */ String msg = "用户或密码错误";
/* 62 */ if (StringUtils.isNotEmpty(e.getMessage()))
/* */ {
/* 64 */ msg = e.getMessage();
/* */ }
/* 66 */ return error(msg);
/* */ }
/* */ }
/* */
/* */
/* */ @GetMapping({"/unauth"})
/* */ public String unauth() {
/* 73 */ return "error/unauth";
/* */ }
/* */ }
import com.archive.common.utils.ServletUtils;
import com.archive.common.utils.StringUtils;
import com.archive.framework.web.controller.BaseController;
import com.archive.framework.web.domain.AjaxResult;
import com.archive.project.system.config.service.IConfigService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class LoginController
extends BaseController
{
@Autowired
private IConfigService configService;
@GetMapping({"/login"})
public String login(HttpServletRequest request, HttpServletResponse response, ModelMap mmap) {
String systemName = this.configService.selectConfigByKey("archive.SystemName");
mmap.put("SystemName", systemName);
if (ServletUtils.isAjaxRequest(request))
{
return ServletUtils.renderString(response, "{\"code\":\"1\",\"msg\":\"未登录或登录超时。请重新登录\"}");
}
return "login";
}
@PostMapping({"/login"})
@ResponseBody
public AjaxResult ajaxLogin(String username, String password, Boolean rememberMe) {
UsernamePasswordToken token = new UsernamePasswordToken(username, password, rememberMe.booleanValue());
Subject subject = SecurityUtils.getSubject();
try {
subject.login((AuthenticationToken)token);
return success();
}
catch (AuthenticationException e) {
String msg = "用户或密码错误";
if (StringUtils.isNotEmpty(e.getMessage()))
{
msg = e.getMessage();
}
return error(msg);
}
}
@GetMapping({"/unauth"})
public String unauth() {
return "error/unauth";
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\syste\\user\controller\LoginController.class

Loading…
Cancel
Save