From 5a2c947b0ca88db13e42d8ccfd997d801dda44bf Mon Sep 17 00:00:00 2001 From: wangxy <1481820854@qq.com> Date: Wed, 21 May 2025 08:55:42 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/archive/common/utils/IpUtils.java | 390 +-- .../archive/framework/aspectj/LogAspect.java | 370 +-- .../framework/config/KaptchaTextCreator.java | 152 +- .../filter/kickout/KickoutSessionFilter.java | 372 +-- .../dajs/jsgl/controller/JsglController.java | 680 ++-- .../jsgl/service/impl/JsglServiceImpl.java | 2832 ++++++++--------- .../monitor/job/controller/JobController.java | 354 +-- .../job/controller/JobLogController.java | 206 +- .../project/monitor/job/domain/Job.java | 338 +- .../project/monitor/job/domain/JobLog.java | 310 +- .../job/service/JobLogServiceImpl.java | 196 +- .../monitor/job/service/JobServiceImpl.java | 594 ++-- .../monitor/job/util/JobInvokeUtil.java | 364 +-- .../monitor/logininfor/domain/Logininfor.java | 318 +- .../project/monitor/server/domain/Jvm.java | 244 +- .../user/controller/LoginController.java | 150 +- 16 files changed, 3935 insertions(+), 3935 deletions(-) diff --git a/src/main/java/com/archive/common/utils/IpUtils.java b/src/main/java/com/archive/common/utils/IpUtils.java index 17c175b..78c9da3 100644 --- a/src/main/java/com/archive/common/utils/IpUtils.java +++ b/src/main/java/com/archive/common/utils/IpUtils.java @@ -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 diff --git a/src/main/java/com/archive/framework/aspectj/LogAspect.java b/src/main/java/com/archive/framework/aspectj/LogAspect.java index 8e4dda7..4e30f84 100644 --- a/src/main/java/com/archive/framework/aspectj/LogAspect.java +++ b/src/main/java/com/archive/framework/aspectj/LogAspect.java @@ -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 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.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 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.getAnnotation(Log.class); + } + return null; + } + } /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\aspectj\LogAspect.class diff --git a/src/main/java/com/archive/framework/config/KaptchaTextCreator.java b/src/main/java/com/archive/framework/config/KaptchaTextCreator.java index d783faa..9b40315 100644 --- a/src/main/java/com/archive/framework/config/KaptchaTextCreator.java +++ b/src/main/java/com/archive/framework/config/KaptchaTextCreator.java @@ -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 diff --git a/src/main/java/com/archive/framework/shiro/web/filter/kickout/KickoutSessionFilter.java b/src/main/java/com/archive/framework/shiro/web/filter/kickout/KickoutSessionFilter.java index c21c505..5d26746 100644 --- a/src/main/java/com/archive/framework/shiro/web/filter/kickout/KickoutSessionFilter.java +++ b/src/main/java/com/archive/framework/shiro/web/filter/kickout/KickoutSessionFilter.java @@ -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> 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 deque = (Deque)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> 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 deque = (Deque)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 diff --git a/src/main/java/com/archive/project/dajs/jsgl/controller/JsglController.java b/src/main/java/com/archive/project/dajs/jsgl/controller/JsglController.java index 85ad57f..a5526d3 100644 --- a/src/main/java/com/archive/project/dajs/jsgl/controller/JsglController.java +++ b/src/main/java/com/archive/project/dajs/jsgl/controller/JsglController.java @@ -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 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 dictTypeList = this.dictTypeService.selectDictTypeList(dictType); -/* 75 */ Map> dictDataMap = new HashMap<>(); -/* 76 */ for (DictType dictTypeTemp : dictTypeList) { -/* 77 */ List 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 fileUpload(@RequestParam("file") MultipartFile[] files, long tableId, long id) { -/* 163 */ Map 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 dictTypeList = this.dictTypeService.selectDictTypeList(dictType); -/* 332 */ Map> dictDataMap = new HashMap<>(); -/* 333 */ for (DictType dictTypeTemp : dictTypeList) { -/* 334 */ List 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 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 dictTypeList = this.dictTypeService.selectDictTypeList(dictType); + Map> dictDataMap = new HashMap<>(); + for (DictType dictTypeTemp : dictTypeList) { + List 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 fileUpload(@RequestParam("file") MultipartFile[] files, long tableId, long id) { + Map 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 dictTypeList = this.dictTypeService.selectDictTypeList(dictType); + Map> dictDataMap = new HashMap<>(); + for (DictType dictTypeTemp : dictTypeList) { + List 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 diff --git a/src/main/java/com/archive/project/dajs/jsgl/service/impl/JsglServiceImpl.java b/src/main/java/com/archive/project/dajs/jsgl/service/impl/JsglServiceImpl.java index 4dee507..4979f21 100644 --- a/src/main/java/com/archive/project/dajs/jsgl/service/impl/JsglServiceImpl.java +++ b/src/main/java/com/archive/project/dajs/jsgl/service/impl/JsglServiceImpl.java @@ -1,1421 +1,1421 @@ -/* */ package com.archive.project.dajs.jsgl.service.impl + package com.archive.project.dajs.jsgl.service.impl ; -/* */ -/* */ import com.alibaba.fastjson.JSON; -/* */ import com.archive.common.archiveUtil.FileUtils; -/* */ import com.archive.common.archiveUtil.TableUtil; -/* */ import com.archive.common.utils.DateUtils; -/* */ import com.archive.common.utils.StringUtils; -/* */ import com.archive.common.utils.security.ShiroUtils; -/* */ import com.archive.framework.config.ArchiveConfig; -/* */ import com.archive.project.common.service.IExecuteSqlService; -/* */ import com.archive.project.dajs.archiveimportbatch.service.IArchiveImportBatchService; -/* */ import com.archive.project.dajs.jsgl.service.IJsglService; -/* */ import com.archive.project.dasz.archivetype.domain.ArchiveType; -/* */ import com.archive.project.dasz.archivetype.service.IArchiveTypeService; -/* */ import com.archive.project.dasz.ccgl.service.ICcglService; -/* */ import com.archive.project.dasz.physicaltable.domain.PhysicalTable; -/* */ import com.archive.project.dasz.physicaltable.service.IPhysicalTableService; -/* */ import com.archive.project.dasz.physicaltablecolumn.domain.PhysicalTableColumn; -/* */ import com.archive.project.dasz.physicaltablecolumn.mapper.PhysicalTableColumnMapper; -/* */ import com.archive.project.system.dict.domain.DictData; -/* */ import com.archive.project.system.dict.service.IDictTypeService; -/* */ import com.archive.project.system.user.domain.User; -/* */ import java.io.File; -/* */ import java.io.IOException; -/* */ import java.util.ArrayList; -/* */ import java.util.HashMap; -/* */ import java.util.LinkedHashMap; -/* */ import java.util.List; -/* */ import java.util.Map; -/* */ import java.util.Set; -/* */ import org.springframework.beans.factory.annotation.Autowired; -/* */ import org.springframework.stereotype.Service; -/* */ import org.springframework.transaction.annotation.Transactional; -/* */ import org.springframework.web.multipart.MultipartFile; -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @Service -/* */ public class JsglServiceImpl -/* */ implements IJsglService -/* */ { -/* */ @Autowired -/* */ private IPhysicalTableService physicalTableService; -/* */ @Autowired -/* */ private PhysicalTableColumnMapper physicalTableColumnMapper; -/* */ @Autowired -/* */ private IArchiveTypeService iArchiveTypeService; -/* */ @Autowired -/* */ private IExecuteSqlService executeSqlService; -/* */ @Autowired -/* */ private IDictTypeService dictTypeService; -/* */ @Autowired -/* */ private IArchiveImportBatchService archiveImportBatchService; -/* */ @Autowired -/* */ private ICcglService ccglService; -/* */ @Autowired -/* */ private ArchiveConfig archiveConfig; -/* */ -/* */ public String appendAddForm(String archiveId, String type) { -/* 74 */ StringBuilder html = new StringBuilder(); -/* 75 */ PhysicalTable physicalTable = new PhysicalTable(); -/* 76 */ physicalTable.setArchivetypeid(archiveId); -/* 77 */ physicalTable.setTableCode(type); -/* 78 */ List physicalTableList = this.physicalTableService.selectPhysicalTableList(physicalTable); -/* 79 */ if (physicalTableList != null && physicalTableList.size() > 0) { -/* 80 */ Long tableId = ((PhysicalTable)physicalTableList.get(0)).getId(); -/* 81 */ PhysicalTableColumn physicalTableColumn = new PhysicalTableColumn(); -/* 82 */ physicalTableColumn.setTableId(tableId); -/* 83 */ physicalTableColumn.setJmx(Long.valueOf(1L)); -/* 84 */ List tableColumnsList = new ArrayList<>(); -/* 85 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) { -/* 86 */ tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn); -/* */ } -/* 88 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { -/* 89 */ tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn); -/* */ } -/* */ -/* */ -/* 93 */ tableColumnsList = this.physicalTableService.selectTableFormColumns(tableId, tableColumnsList); -/* */ -/* 95 */ for (int i = 1; i <= tableColumnsList.size(); i++) { -/* */ -/* 97 */ if (i % 2 != 0) { -/* 98 */ html.append("
"); -/* */ } -/* */ -/* 101 */ PhysicalTableColumn tableColumn = tableColumnsList.get(i - 1); -/* 102 */ String showType = tableColumn.getShowType(); -/* 103 */ Long isBsx = tableColumn.getBsx(); -/* 104 */ String columnName = tableColumn.getColumnName(); -/* 105 */ String columnCode = tableColumn.getColumnCode(); -/* 106 */ String columnCodetype = tableColumn.getColumnCodetype(); -/* 107 */ String columnType = tableColumn.getColumnType(); -/* */ -/* 109 */ if ("textBox".equals(showType)) { -/* 110 */ if (isBsx.longValue() == 1L) { -/* 111 */ if ("C".equals(columnType)) { -/* 112 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* 121 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 133 */ else if ("C".equals(columnType)) { -/* 134 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* */ -/* 144 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 156 */ else if ("dateBox".equals(showType)) { -/* 157 */ if (isBsx.longValue() == 1L) { -/* 158 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* */ -/* */ -/* 170 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 185 */ else if ("dateTimeBox".equals(showType)) { -/* 186 */ if (isBsx.longValue() == 1L) { -/* 187 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* */ -/* */ -/* 199 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 214 */ else if ("comboBox".equals(showType)) { -/* 215 */ List dictDatas = this.dictTypeService.selectDictDataByType(columnCodetype); -/* 216 */ if (isBsx.longValue() == 1L) { -/* 217 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\t\t\t\t"); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* 232 */ for (DictData dictData : dictDatas) { -/* 233 */ html.append("\r\n"); -/* */ } -/* */ -/* 236 */ html.append("\t\t\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 243 */ else if ("multipleComboBox".equals(showType)) { -/* 244 */ List dictDatas = this.dictTypeService.selectDictDataByType(columnCodetype); -/* 245 */ if (isBsx.longValue() == 1L) { -/* 246 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t"); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* 259 */ for (DictData dictData : dictDatas) { -/* 260 */ html.append("\r\n"); -/* */ } -/* */ -/* 263 */ html.append("\t\t\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 270 */ else if ("textArea".equals(showType)) { -/* 271 */ if (isBsx.longValue() == 1L) { -/* 272 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* 281 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 294 */ else if (isBsx.longValue() == 1L) { -/* 295 */ if ("C".equals(columnType)) { -/* 296 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* */ -/* 306 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 316 */ else if ("C".equals(columnType)) { -/* 317 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* */ -/* 327 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* 339 */ if (i % 2 == 0 || i == tableColumnsList.size()) { -/* 340 */ html.append("
"); -/* */ } -/* */ } -/* */ } -/* 344 */ return html.toString(); -/* */ } -/* */ -/* */ -/* */ @Transactional -/* */ public String appendAddFormByDataId(String archiveTypeId, String type, String id, String readOnly) { -/* 350 */ StringBuilder html = new StringBuilder(); -/* 351 */ PhysicalTable physicalTable = new PhysicalTable(); -/* 352 */ physicalTable.setArchivetypeid(archiveTypeId); -/* 353 */ physicalTable.setTableCode(type); -/* 354 */ List physicalTableList = this.physicalTableService.selectPhysicalTableList(physicalTable); -/* 355 */ if (physicalTableList != null && physicalTableList.size() > 0) { -/* 356 */ Long tableId = ((PhysicalTable)physicalTableList.get(0)).getId(); -/* 357 */ PhysicalTableColumn physicalTableColumn = new PhysicalTableColumn(); -/* 358 */ physicalTableColumn.setTableId(tableId); -/* 359 */ physicalTableColumn.setJmx(Long.valueOf(1L)); -/* 360 */ List tableColumnsList = new ArrayList<>(); -/* 361 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) { -/* 362 */ tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn); -/* */ } -/* 364 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { -/* 365 */ tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn); -/* */ } -/* */ -/* */ -/* 369 */ tableColumnsList = this.physicalTableService.selectTableFormColumns(tableId, tableColumnsList); -/* */ -/* 371 */ for (int i = 1; i <= tableColumnsList.size(); i++) { -/* */ -/* 373 */ if (i % 2 != 0) { -/* 374 */ html.append("
"); -/* */ } -/* */ -/* 377 */ PhysicalTableColumn tableColumn = tableColumnsList.get(i - 1); -/* 378 */ String showType = tableColumn.getShowType(); -/* 379 */ Long isBsx = tableColumn.getBsx(); -/* 380 */ String columnName = tableColumn.getColumnName(); -/* 381 */ String columnCode = tableColumn.getColumnCode(); -/* 382 */ String columnCodetype = tableColumn.getColumnCodetype(); -/* 383 */ String columnType = tableColumn.getColumnType(); -/* */ -/* */ -/* */ -/* 387 */ String Sql = ""; -/* 388 */ if (type.toLowerCase().equals("folder")) { -/* 389 */ Sql = "select " + columnCode + " from " + ((PhysicalTable)physicalTableList.get(0)).getTablename() + " where id=" + id; -/* 390 */ } else if (type.toLowerCase().equals("file")) { -/* 391 */ Sql = "select " + columnCode + " from " + ((PhysicalTable)physicalTableList.get(0)).getTablename() + " where id=" + id; -/* 392 */ } else if (type.toLowerCase().equals("document") || type.toLowerCase().equals("info")) { -/* 393 */ Sql = "select " + columnCode + " from " + ((PhysicalTable)physicalTableList.get(0)).getTablename() + " where ownerid=" + id; -/* */ } -/* 395 */ LinkedHashMap datalist = this.executeSqlService.getOne(Sql); -/* 396 */ String value = ""; -/* 397 */ if (datalist != null && datalist.size() > 0) { -/* 398 */ value = (datalist.get(columnCode) == null) ? "" : datalist.get(columnCode).toString(); -/* */ } -/* */ -/* 401 */ if ("textBox".equals(showType)) { -/* 402 */ if (isBsx.longValue() == 1L) { -/* 403 */ if ("C".equals(columnType)) { -/* 404 */ if (readOnly.equals("true")) { -/* 405 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* 414 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 425 */ else if (readOnly.equals("true")) { -/* 426 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* 435 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 448 */ else if ("C".equals(columnType)) { -/* 449 */ if (readOnly.equals("true")) { -/* 450 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* 459 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 471 */ else if (readOnly.equals("true")) { -/* 472 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* 481 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 495 */ else if ("dateBox".equals(showType)) { -/* 496 */ if (isBsx.longValue() == 1L) { -/* 497 */ if (readOnly.equals("true")) { -/* 498 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* */ -/* */ -/* 510 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 524 */ else if (readOnly.equals("true")) { -/* 525 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* */ -/* */ -/* 537 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 554 */ else if ("dateTimeBox".equals(showType)) { -/* 555 */ if (isBsx.longValue() == 1L) { -/* 556 */ if (readOnly.equals("true")) { -/* 557 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* */ -/* */ -/* 569 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 583 */ else if (readOnly.equals("true")) { -/* 584 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* */ -/* */ -/* 596 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 613 */ else if ("comboBox".equals(showType)) { -/* 614 */ List dictDatas = this.dictTypeService.selectDictDataByType(columnCodetype); -/* 615 */ if (isBsx.longValue() == 1L) { -/* 616 */ if (readOnly.equals("true")) { -/* 617 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\t\t\t\t"); -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ } -/* 633 */ else if (readOnly.equals("true")) { -/* 634 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\t\t\t\t"); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* 651 */ for (DictData dictData : dictDatas) { -/* 652 */ if (value.equals(dictData.getDictValue())) { -/* 653 */ html.append("\r\n"); continue; -/* */ } -/* 655 */ html.append("\r\n"); -/* */ } -/* */ -/* */ -/* 659 */ html.append("\t\t\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 666 */ else if ("multipleComboBox".equals(showType)) { -/* 667 */ List dictDatas = this.dictTypeService.selectDictDataByType(columnCodetype); -/* 668 */ if (isBsx.longValue() == 1L) { -/* 669 */ if (readOnly.equals("true")) { -/* 670 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t"); -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ } -/* 684 */ else if (readOnly.equals("true")) { -/* 685 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t"); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* 700 */ for (DictData dictData : dictDatas) { -/* 701 */ if (value.contains(dictData.getDictValue())) { -/* 702 */ html.append("\r\n"); continue; -/* */ } -/* 704 */ html.append("\r\n"); -/* */ } -/* */ -/* */ -/* */ -/* 709 */ html.append("\t\t\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 716 */ else if ("textArea".equals(showType)) { -/* 717 */ if (isBsx.longValue() == 1L) { -/* 718 */ if (readOnly.equals("true")) { -/* 719 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* 728 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 739 */ else if (readOnly.equals("true")) { -/* 740 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* 749 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 764 */ else if (isBsx.longValue() == 1L) { -/* 765 */ if ("C".equals(columnType)) { -/* 766 */ if (readOnly.equals("true")) { -/* 767 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* 776 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 787 */ else if (readOnly.equals("true")) { -/* 788 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* 797 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 809 */ else if ("C".equals(columnType)) { -/* 810 */ if (readOnly.equals("true")) { -/* 811 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* 820 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ } -/* 832 */ else if (readOnly.equals("true")) { -/* 833 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ -/* */ -/* */ -/* */ } -/* */ else { -/* */ -/* */ -/* */ -/* 842 */ html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* 856 */ if (i % 2 == 0 || i == tableColumnsList.size()) { -/* 857 */ html.append("
"); -/* */ } -/* */ } -/* */ } -/* 861 */ return html.toString(); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @Transactional -/* */ public boolean addSave(String archiveStr, String archiveId, String type) throws Exception { -/* 871 */ HashMap archiveMap = (HashMap)JSON.parseObject(archiveStr, HashMap.class); -/* 872 */ PhysicalTable physicalTable = new PhysicalTable(); -/* 873 */ physicalTable.setTableCode(type); -/* 874 */ physicalTable.setArchivetypeid(archiveId); -/* 875 */ List tablesList = this.physicalTableService.selectPhysicalTableList(physicalTable); -/* 876 */ if (tablesList != null && tablesList.size() > 0) { -/* 877 */ String tableName = ((PhysicalTable)tablesList.get(0)).getTablename(); -/* 878 */ Long tableId = ((PhysicalTable)tablesList.get(0)).getId(); -/* 879 */ PhysicalTableColumn physicalTableColumn = new PhysicalTableColumn(); -/* 880 */ physicalTableColumn.setTableId(tableId); -/* */ -/* 882 */ String fields = ",is_delete"; -/* 883 */ String values = ",0"; -/* 884 */ Set keySet = archiveMap.keySet(); -/* 885 */ for (String key : keySet) { -/* 886 */ fields = fields + "," + key; -/* */ -/* 888 */ String value = archiveMap.get(key); -/* */ -/* 890 */ if (StringUtils.isEmpty(value)) { -/* 891 */ values = values + ",''"; -/* */ -/* */ continue; -/* */ } -/* 895 */ physicalTableColumn.setColumnCode(key); -/* 896 */ List tableColumnsList = new ArrayList<>(); -/* 897 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) { -/* 898 */ tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn); -/* */ } -/* 900 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { -/* 901 */ tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn); -/* */ } -/* 903 */ if (tableColumnsList.size() > 0 && tableColumnsList.get(0) != null) { -/* 904 */ String columnType = ((PhysicalTableColumn)tableColumnsList.get(0)).getColumnType(); -/* 905 */ if (columnType.equals("N")) { -/* 906 */ values = values + "," + (String)archiveMap.get(key); -/* */ continue; -/* */ } -/* 909 */ values = values + ",'" + (String)archiveMap.get(key) + "'"; -/* */ continue; -/* */ } -/* 912 */ values = values + ",'" + (String)archiveMap.get(key) + "'"; -/* */ } -/* */ -/* */ -/* */ -/* 917 */ fields = fields.substring(1); -/* 918 */ values = values.substring(1); -/* 919 */ String sql = "INSERT INTO " + tableName + " ( " + fields + ",status ) VALUES ( " + values + ",'60' ) "; -/* 920 */ return this.executeSqlService.insert(sql); -/* */ } -/* 922 */ return false; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public boolean update(String archiveStr, String archiveTypeId, String type, String id) throws Exception { -/* 938 */ HashMap archiveMap = (HashMap)JSON.parseObject(archiveStr, HashMap.class); -/* 939 */ PhysicalTable physicalTable = new PhysicalTable(); -/* 940 */ physicalTable.setTableCode(type); -/* 941 */ physicalTable.setArchivetypeid(archiveTypeId); -/* 942 */ List tablesList = this.physicalTableService.selectPhysicalTableList(physicalTable); -/* 943 */ if (tablesList != null && tablesList.size() > 0) { -/* 944 */ String tableName = ((PhysicalTable)tablesList.get(0)).getTablename(); -/* 945 */ Long tableId = ((PhysicalTable)tablesList.get(0)).getId(); -/* 946 */ PhysicalTableColumn physicalTableColumn = new PhysicalTableColumn(); -/* 947 */ physicalTableColumn.setTableId(tableId); -/* */ -/* 949 */ String fields = ""; -/* 950 */ Set keySet = archiveMap.keySet(); -/* 951 */ for (String key : keySet) { -/* */ -/* 953 */ String value = archiveMap.get(key); -/* */ -/* */ -/* */ -/* */ -/* */ -/* 959 */ physicalTableColumn.setColumnCode(key); -/* 960 */ List tableColumnsList = new ArrayList<>(); -/* 961 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) { -/* 962 */ tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn); -/* */ } -/* 964 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { -/* 965 */ tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn); -/* */ } -/* 967 */ if (tableColumnsList.size() > 0 && tableColumnsList.get(0) != null) { -/* 968 */ String columnType = ((PhysicalTableColumn)tableColumnsList.get(0)).getColumnType(); -/* 969 */ if (columnType.equals("C")) { -/* 970 */ if (StringUtils.isEmpty(value)) { -/* 971 */ value = "0"; -/* */ } else { -/* 973 */ value = archiveMap.get(key); -/* */ } -/* */ -/* */ } else { -/* */ -/* 978 */ value = "'" + (String)archiveMap.get(key) + "'"; -/* */ } -/* */ } else { -/* 981 */ value = "'" + (String)archiveMap.get(key) + "'"; -/* */ } -/* */ -/* 984 */ fields = fields + "," + key + "=" + value; -/* */ } -/* 986 */ fields = fields.substring(1); -/* 987 */ String sql = "update " + tableName + " set " + fields + " where id=" + id; -/* 988 */ return this.executeSqlService.update(sql); -/* */ } -/* 990 */ return false; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public Map getTableIdByArchiveTypeId(String archiveTypeId, String type) { -/* 1002 */ Map map = new HashMap<>(); -/* 1003 */ PhysicalTable physicalTable = new PhysicalTable(); -/* 1004 */ physicalTable.setTableCode(type); -/* 1005 */ physicalTable.setArchivetypeid(archiveTypeId); -/* 1006 */ List tablesList = this.physicalTableService.selectPhysicalTableList(physicalTable); -/* 1007 */ if (tablesList != null && tablesList.size() > 0) { -/* 1008 */ String tableName = ((PhysicalTable)tablesList.get(0)).getTablename(); -/* 1009 */ Long tableId = ((PhysicalTable)tablesList.get(0)).getId(); -/* 1010 */ map.put("tableId", tableId); -/* 1011 */ map.put("tableName", tableName); -/* */ } -/* 1013 */ return map; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public boolean uploadFile(MultipartFile[] files, long tableId, long id) throws IOException { -/* 1025 */ boolean res = false; -/* 1026 */ if (files != null) { -/* 1027 */ for (int i = 0; i < files.length; i++) { -/* 1028 */ String fileName = files[i].getOriginalFilename(); -/* */ -/* 1030 */ String xdlj = this.ccglService.getCreateDocumentPathByFile(id, tableId); -/* 1031 */ String filepath = ArchiveConfig.getInstance().getUploadPath() + File.separator + "DocumentFile" + File.separator + xdlj; -/* 1032 */ File localFile = new File(filepath); -/* 1033 */ if (!localFile.exists()) { -/* 1034 */ localFile.mkdirs(); -/* */ } -/* 1036 */ String path = localFile.getPath() + File.separator + fileName; -/* 1037 */ File server_file = new File(path); -/* 1038 */ if (server_file.exists()) { -/* 1039 */ server_file.setWritable(true); -/* 1040 */ server_file.delete(); -/* */ } -/* 1042 */ files[i].transferTo(server_file); -/* 1043 */ String newfileName = server_file.getName().substring(0, server_file.getName().lastIndexOf(".")); -/* 1044 */ String hz = server_file.getName().substring(server_file.getName().lastIndexOf(".") + 1, server_file.getName().length()); -/* 1045 */ String fileSize = FileUtils.changeValueType(Long.valueOf(server_file.length())); -/* */ -/* 1047 */ String tableName = TableUtil.getTableName(Long.valueOf(tableId)); -/* 1048 */ String docuumentTableName = tableName.toLowerCase().replace("_folder", "_document"); -/* 1049 */ docuumentTableName = docuumentTableName.toLowerCase().replace("_file", "_document"); -/* 1050 */ String docTableId = TableUtil.getTableId(docuumentTableName); -/* 1051 */ long newId = this.archiveImportBatchService.getTableNewId(Long.parseLong(docTableId)); -/* 1052 */ long archiveTypeId = TableUtil.getArchiveTypeIdByTableId(tableId); -/* 1053 */ User user = ShiroUtils.getSysUser(); -/* 1054 */ String loginName = user.getLoginName(); -/* */ -/* */ -/* 1057 */ String inserSql = "insert into " + docuumentTableName + "(id,ownerid,filename,filesize,filepath,filehz,tableId,create_user,create_time,batcharchivetypeid) values(" + newId + "," + id + ",'" + newfileName + "','" + fileSize + "','" + server_file.getPath().replaceAll("\\\\", "\\\\\\\\") + "','" + hz + "','" + tableId + "','" + loginName + "','" + DateUtils.getTime() + "'," + archiveTypeId + ")"; -/* 1058 */ res = this.executeSqlService.insert(inserSql); -/* */ -/* 1060 */ String updateSql = "update " + tableName + " set dqzws=dqzws+1 where id=" + id; -/* 1061 */ this.executeSqlService.update(updateSql); -/* 1062 */ System.out.println("文件" + path + "上传成功"); -/* */ } -/* */ } -/* 1065 */ return res; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @Transactional -/* */ public boolean archivePhysicalDelete(String query, String archiveTypeId, String type, String ids) { -/* 1084 */ boolean res = false; -/* 1085 */ ArchiveType archiveType = this.iArchiveTypeService.selectArchiveTypeById(Long.valueOf(Long.parseLong(archiveTypeId))); -/* 1086 */ String archiveCode = archiveType.getArhciveCode(); -/* */ -/* 1088 */ if (StringUtils.isNotEmpty(ids)) { -/* 1089 */ if (type.toLowerCase().equals("folder")) { -/* */ -/* */ -/* 1092 */ String documentPathSql = "select filewaterpath,filepath from t_ar_" + archiveCode + "_document where ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (" + ids + "))"; -/* 1093 */ getDocumentSqlDeleteFile(documentPathSql); -/* 1094 */ String documentSql = "delete from t_ar_" + archiveCode + "_document where ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (" + ids + "))"; -/* 1095 */ String filesql = "delete from t_ar_" + archiveCode + "_file where ownerid in (" + ids + ")"; -/* 1096 */ String folderSql = "delete from t_ar_" + archiveCode + "_folder where id in (" + ids + ")"; -/* 1097 */ this.executeSqlService.delete(documentSql); -/* 1098 */ this.executeSqlService.delete(filesql); -/* 1099 */ this.executeSqlService.delete(folderSql); -/* 1100 */ } else if (type.toLowerCase().equals("file")) { -/* */ -/* */ -/* 1103 */ String documentPathSql = "select filewaterpath,filepath from t_ar_" + archiveCode + "_document where ownerid in (" + ids + ")"; -/* 1104 */ getDocumentSqlDeleteFile(documentPathSql); -/* 1105 */ String documentSql = "delete from t_ar_" + archiveCode + "_document where ownerid in (" + ids + ")"; -/* 1106 */ String filesql = "delete from t_ar_" + archiveCode + "_file where id in (" + ids + ")"; -/* 1107 */ this.executeSqlService.delete(documentSql); -/* 1108 */ this.executeSqlService.delete(filesql); -/* */ } -/* 1110 */ res = true; -/* */ } -/* */ else { -/* */ -/* 1114 */ String condition = appendQueryCondition(query, archiveTypeId, type); -/* 1115 */ if (type.toLowerCase().equals("folder")) { -/* */ -/* 1117 */ String documentPathSql = "select filewaterpath,filepath from t_ar_" + archiveCode + "_document where ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (select id from t_ar_" + archiveCode + "_folder where " + condition + "))"; -/* 1118 */ getDocumentSqlDeleteFile(documentPathSql); -/* 1119 */ String documentSql = "delete from t_ar_" + archiveCode + "_document where ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (select id from t_ar_" + archiveCode + "_folder where " + condition + "))"; -/* 1120 */ String filesql = "delete from t_ar_" + archiveCode + "_file where ownerid in (select id from t_ar_" + archiveCode + "_folder where " + condition + ")"; -/* 1121 */ String folderSql = "delete from t_ar_" + archiveCode + "_folder where " + condition; -/* 1122 */ this.executeSqlService.delete(documentSql); -/* 1123 */ this.executeSqlService.delete(filesql); -/* 1124 */ this.executeSqlService.delete(folderSql); -/* */ } else { -/* */ -/* 1127 */ String documentPathSql = "select filewaterpath,filepath from t_ar_" + archiveCode + "_document where ownerid in (select id from t_ar_" + archiveCode + "_file where " + condition + ")"; -/* 1128 */ getDocumentSqlDeleteFile(documentPathSql); -/* 1129 */ String documentSql = "delete from t_ar_" + archiveCode + "_document where ownerid in (select id from t_ar_" + archiveCode + "_file where " + condition + ")"; -/* 1130 */ String filesql = "delete from t_ar_" + archiveCode + "_file where " + condition; -/* 1131 */ this.executeSqlService.delete(documentSql); -/* 1132 */ this.executeSqlService.delete(filesql); -/* */ } -/* 1134 */ res = true; -/* */ } -/* 1136 */ return res; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @Transactional -/* */ public boolean archivePhysicalHf(String query, String archiveTypeId, String type, String ids) { -/* 1154 */ boolean res = false; -/* 1155 */ ArchiveType archiveType = this.iArchiveTypeService.selectArchiveTypeById(Long.valueOf(Long.parseLong(archiveTypeId))); -/* 1156 */ String archiveCode = archiveType.getArhciveCode(); -/* */ -/* 1158 */ if (StringUtils.isNotEmpty(ids)) { -/* 1159 */ if (type.toLowerCase().equals("folder")) { -/* */ -/* 1161 */ String documentSql = "update t_ar_" + archiveCode + "_document set is_delete='0' where is_delete='1' and ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (" + ids + "))"; -/* 1162 */ String filesql = "update t_ar_" + archiveCode + "_file set is_delete='0' where is_delete='1' and ownerid in (" + ids + ")"; -/* 1163 */ String folderSql = "update t_ar_" + archiveCode + "_folder set is_delete='0' where is_delete='1' and id in (" + ids + ")"; -/* 1164 */ this.executeSqlService.update(documentSql); -/* 1165 */ this.executeSqlService.update(filesql); -/* 1166 */ this.executeSqlService.update(folderSql); -/* 1167 */ } else if (type.toLowerCase().equals("file")) { -/* */ -/* 1169 */ String documentSql = "update t_ar_" + archiveCode + "_document set is_delete='0' where is_delete='1' and ownerid in (" + ids + ")"; -/* 1170 */ String filesql = "update t_ar_" + archiveCode + "_file set is_delete='0' where is_delete='1' and id in (" + ids + ")"; -/* 1171 */ this.executeSqlService.update(documentSql); -/* 1172 */ this.executeSqlService.update(filesql); -/* */ } -/* 1174 */ res = true; -/* */ } -/* */ else { -/* */ -/* 1178 */ String condition = appendQueryCondition(query, archiveTypeId, type); -/* 1179 */ if (type.toLowerCase().equals("folder")) { -/* */ -/* 1181 */ String documentSql = "update t_ar_" + archiveCode + "_document set is_delete='0' where is_delete='1' and ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (select id from t_ar_" + archiveCode + "_folder where " + condition + "))"; -/* 1182 */ String filesql = "update t_ar_" + archiveCode + "_file set is_delete='0' where is_delete='1' and ownerid in (select id from t_ar_" + archiveCode + "_folder where " + condition + ")"; -/* 1183 */ String folderSql = "update t_ar_" + archiveCode + "_folder set is_delete='0' where is_delete='1' and " + condition + ""; -/* 1184 */ this.executeSqlService.update(documentSql); -/* 1185 */ this.executeSqlService.update(filesql); -/* 1186 */ this.executeSqlService.update(folderSql); -/* 1187 */ } else if (type.toLowerCase().equals("file")) { -/* */ -/* 1189 */ String documentSql = "update t_ar_" + archiveCode + "_document set is_delete='0' where is_delete='1' and ownerid in (select id from t_ar_" + archiveCode + "_file where " + condition + ")"; -/* 1190 */ String filesql = "update t_ar_" + archiveCode + "_file set is_delete='0' where is_delete='1' and " + condition; -/* 1191 */ this.executeSqlService.update(documentSql); -/* 1192 */ this.executeSqlService.update(filesql); -/* */ } -/* 1194 */ res = true; -/* */ } -/* 1196 */ return res; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @Transactional -/* */ public boolean archiveLogicDelete(String query, String archiveTypeId, String type, String ids) { -/* 1211 */ boolean res = false; -/* 1212 */ ArchiveType archiveType = this.iArchiveTypeService.selectArchiveTypeById(Long.valueOf(Long.parseLong(archiveTypeId))); -/* 1213 */ String archiveCode = archiveType.getArhciveCode(); -/* */ -/* 1215 */ if (StringUtils.isNotEmpty(ids)) { -/* 1216 */ if (type.toLowerCase().equals("folder")) { -/* */ -/* 1218 */ String documentSql = "update t_ar_" + archiveCode + "_document set is_delete='1' where is_delete='0' and ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (" + ids + "))"; -/* 1219 */ String filesql = "update t_ar_" + archiveCode + "_file set is_delete='1' where is_delete='0' and ownerid in (" + ids + ")"; -/* 1220 */ String folderSql = "update t_ar_" + archiveCode + "_folder set is_delete='1' where is_delete='0' and id in (" + ids + ")"; -/* 1221 */ this.executeSqlService.update(documentSql); -/* 1222 */ this.executeSqlService.update(filesql); -/* 1223 */ this.executeSqlService.update(folderSql); -/* 1224 */ } else if (type.toLowerCase().equals("file")) { -/* */ -/* 1226 */ String documentSql = "update t_ar_" + archiveCode + "_document set is_delete='1' where is_delete='0' and ownerid in (" + ids + ")"; -/* 1227 */ String filesql = "update t_ar_" + archiveCode + "_file set is_delete='1' where is_delete='0' and id in (" + ids + ")"; -/* 1228 */ this.executeSqlService.update(documentSql); -/* 1229 */ this.executeSqlService.update(filesql); -/* */ } -/* 1231 */ res = true; -/* */ } -/* */ else { -/* */ -/* 1235 */ String condition = appendQueryCondition(query, archiveTypeId, type); -/* 1236 */ if (type.toLowerCase().equals("folder")) { -/* */ -/* 1238 */ String documentSql = "update t_ar_" + archiveCode + "_document set is_delete='1' where is_delete='0' and ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (select id from t_ar_" + archiveCode + "_folder where " + condition + "))"; -/* 1239 */ String filesql = "update t_ar_" + archiveCode + "_file set is_delete='1' where is_delete='0' and ownerid in (select id from t_ar_" + archiveCode + "_folder where " + condition + ")"; -/* 1240 */ String folderSql = "update t_ar_" + archiveCode + "_folder set is_delete='1' where is_delete='0' and " + condition + ""; -/* 1241 */ this.executeSqlService.update(documentSql); -/* 1242 */ this.executeSqlService.update(filesql); -/* 1243 */ this.executeSqlService.update(folderSql); -/* 1244 */ } else if (type.toLowerCase().equals("file")) { -/* */ -/* 1246 */ String documentSql = "update t_ar_" + archiveCode + "_document set is_delete='1' where is_delete='0' and ownerid in (select id from t_ar_" + archiveCode + "_file where " + condition + ")"; -/* 1247 */ String filesql = "update t_ar_" + archiveCode + "_file set is_delete='1' where is_delete='0' and " + condition; -/* 1248 */ this.executeSqlService.update(documentSql); -/* 1249 */ this.executeSqlService.update(filesql); -/* */ } -/* 1251 */ res = true; -/* */ } -/* 1253 */ return res; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public String appendQueryCondition(String query, String archiveTypeId, String type) { -/* 1266 */ String condition = " 1=1 "; -/* 1267 */ if (StringUtils.isNotEmpty(query)) { -/* 1268 */ HashMap archiveMap = (HashMap)JSON.parseObject(query, HashMap.class); -/* */ -/* 1270 */ PhysicalTable physicalTable = new PhysicalTable(); -/* 1271 */ physicalTable.setArchivetypeid(archiveTypeId); -/* 1272 */ physicalTable.setTableCode(type); -/* 1273 */ List tablesList = this.physicalTableService.selectPhysicalTableList(physicalTable); -/* */ -/* 1275 */ if (tablesList != null && tablesList.size() > 0) { -/* 1276 */ physicalTable = tablesList.get(0); -/* */ -/* 1278 */ PhysicalTableColumn physicalTableColumn1 = new PhysicalTableColumn(); -/* 1279 */ physicalTableColumn1.setTableId(physicalTable.getId()); -/* 1280 */ List columnsList1 = new ArrayList<>(); -/* 1281 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) { -/* 1282 */ columnsList1 = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn1); -/* */ } -/* 1284 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { -/* 1285 */ columnsList1 = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn1); -/* */ } -/* */ -/* 1288 */ if (columnsList1 != null && columnsList1.size() > 0) { -/* 1289 */ Set keySet = archiveMap.keySet(); -/* 1290 */ for (String key : keySet) { -/* 1291 */ for (PhysicalTableColumn tableColumn : columnsList1) { -/* 1292 */ String field = tableColumn.getColumnCode(); -/* 1293 */ if (key.equals(field) || key.replaceAll("_Qazwsx13579!", "").equals(field) || key -/* 1294 */ .replaceAll("_Qazwsx24680!", "").equals(field)) { -/* 1295 */ String value = String.valueOf(archiveMap.get(key)); -/* 1296 */ if (StringUtils.isNotEmpty(value)) { -/* 1297 */ Long jsfs = tableColumn.getJsfs(); -/* */ -/* 1299 */ if (jsfs.longValue() == 0L) { -/* 1300 */ condition = condition + "and " + field + " like '%" + value + "%' "; -/* */ continue; -/* */ } -/* 1303 */ if (jsfs.longValue() == 1L) { -/* 1304 */ condition = condition + "and " + field + " = '" + value + "' "; -/* */ continue; -/* */ } -/* 1307 */ if (jsfs.longValue() == 2L) { -/* 1308 */ condition = condition + "and " + field + " > '" + value + "' "; -/* */ continue; -/* */ } -/* 1311 */ if (jsfs.longValue() == 3L) { -/* 1312 */ condition = condition + "and " + field + " < '" + value + "' "; -/* */ continue; -/* */ } -/* 1315 */ if (jsfs.longValue() == 4L) { -/* 1316 */ condition = condition + "and " + field + " >= '" + value + "' "; -/* */ continue; -/* */ } -/* 1319 */ if (jsfs.longValue() == 5L) { -/* 1320 */ condition = condition + "and " + field + " <= '" + value + "' "; -/* */ continue; -/* */ } -/* 1323 */ if (jsfs.longValue() == 6L) { -/* 1324 */ if (key.replaceAll("_Qazwsx13579!", "").equals(field)) { -/* 1325 */ condition = condition + "and " + field + " >= '" + value + "' "; -/* */ } -/* 1327 */ if (key.replaceAll("_Qazwsx24680!", "").equals(field)) -/* 1328 */ condition = condition + "and " + field + " <= '" + value + "' "; -/* */ continue; -/* */ } -/* 1331 */ condition = condition + "and " + field + " like '%" + value + "%' "; -/* */ } -/* */ } -/* */ } -/* */ } -/* */ } -/* */ } -/* */ } -/* */ -/* 1340 */ return condition; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public void getDocumentSqlDeleteFile(String sql) { -/* 1348 */ List> list = this.executeSqlService.queryList(sql); -/* 1349 */ for (int i = 0; i < list.size(); i++) { -/* 1350 */ String waterPath = (((LinkedHashMap)list.get(i)).get("filewaterpath") == null) ? "" : ((LinkedHashMap)list.get(i)).get("filewaterpath").toString(); -/* 1351 */ String filePath = (((LinkedHashMap)list.get(i)).get("filepath") == null) ? "" : ((LinkedHashMap)list.get(i)).get("filepath").toString(); -/* 1352 */ File waterFile = new File(waterPath); -/* 1353 */ if (waterFile.exists()) { -/* 1354 */ waterFile.delete(); -/* */ } -/* 1356 */ File file = new File(filePath); -/* 1357 */ if (file.exists()) { -/* 1358 */ file.delete(); -/* */ } -/* */ } -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @Transactional -/* */ public boolean rzlk(String query, String archiveTypeId, String type, String ids) { -/* 1375 */ boolean res = false; -/* 1376 */ ArchiveType archiveType = this.iArchiveTypeService.selectArchiveTypeById(Long.valueOf(Long.parseLong(archiveTypeId))); -/* 1377 */ String archiveCode = archiveType.getArhciveCode(); -/* 1378 */ if (StringUtils.isNotEmpty(ids)) { -/* 1379 */ if (type.toLowerCase().equals("folder")) { -/* */ -/* 1381 */ String documentSql = "update t_ar_" + archiveCode + "_document set status='80' where is_delete='0' and ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (" + ids + "))"; -/* 1382 */ String filesql = "update t_ar_" + archiveCode + "_file set status='80' where is_delete='0' and ownerid in (" + ids + ")"; -/* 1383 */ String folderSql = "update t_ar_" + archiveCode + "_folder set status='80' where is_delete='0' and id in (" + ids + ")"; -/* 1384 */ this.executeSqlService.update(documentSql); -/* 1385 */ this.executeSqlService.update(filesql); -/* 1386 */ this.executeSqlService.update(folderSql); -/* 1387 */ } else if (type.toLowerCase().equals("file")) { -/* */ -/* 1389 */ String documentSql = "update t_ar_" + archiveCode + "_document set status='80' where is_delete='0' and ownerid in (" + ids + ")"; -/* 1390 */ String filesql = "update t_ar_" + archiveCode + "_file set status='80' where is_delete='0' and id in (" + ids + ")"; -/* 1391 */ this.executeSqlService.update(documentSql); -/* 1392 */ this.executeSqlService.update(filesql); -/* */ } -/* 1394 */ res = true; -/* */ } else { -/* 1396 */ String condition = appendQueryCondition(query, archiveTypeId, type); -/* 1397 */ if (type.toLowerCase().equals("folder")) { -/* */ -/* 1399 */ String documentSql = "update t_ar_" + archiveCode + "_document set status='80' where is_delete='0' and ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (select id from t_ar_" + archiveCode + "_folder where " + condition + "))"; -/* 1400 */ String filesql = "update t_ar_" + archiveCode + "_file set status='80' where is_delete='0' and ownerid in (select id from t_ar_" + archiveCode + "_folder where " + condition + ")"; -/* 1401 */ String folderSql = "update t_ar_" + archiveCode + "_folder set status='80' where is_delete='0' and " + condition + ""; -/* 1402 */ this.executeSqlService.update(documentSql); -/* 1403 */ this.executeSqlService.update(filesql); -/* 1404 */ this.executeSqlService.update(folderSql); -/* 1405 */ } else if (type.toLowerCase().equals("file")) { -/* */ -/* 1407 */ String documentSql = "update t_ar_" + archiveCode + "_document set status='80' where is_delete='0' and ownerid in (select id from t_ar_" + archiveCode + "_file where " + condition + ")"; -/* 1408 */ String filesql = "update t_ar_" + archiveCode + "_file set status='80' where is_delete='0' and " + condition; -/* 1409 */ this.executeSqlService.update(documentSql); -/* 1410 */ this.executeSqlService.update(filesql); -/* */ } -/* 1412 */ res = true; -/* */ } -/* 1414 */ return res; -/* */ } -/* */ } + + import com.alibaba.fastjson.JSON; + import com.archive.common.archiveUtil.FileUtils; + import com.archive.common.archiveUtil.TableUtil; + import com.archive.common.utils.DateUtils; + import com.archive.common.utils.StringUtils; + import com.archive.common.utils.security.ShiroUtils; + import com.archive.framework.config.ArchiveConfig; + import com.archive.project.common.service.IExecuteSqlService; + import com.archive.project.dajs.archiveimportbatch.service.IArchiveImportBatchService; + import com.archive.project.dajs.jsgl.service.IJsglService; + import com.archive.project.dasz.archivetype.domain.ArchiveType; + import com.archive.project.dasz.archivetype.service.IArchiveTypeService; + import com.archive.project.dasz.ccgl.service.ICcglService; + import com.archive.project.dasz.physicaltable.domain.PhysicalTable; + import com.archive.project.dasz.physicaltable.service.IPhysicalTableService; + import com.archive.project.dasz.physicaltablecolumn.domain.PhysicalTableColumn; + import com.archive.project.dasz.physicaltablecolumn.mapper.PhysicalTableColumnMapper; + import com.archive.project.system.dict.domain.DictData; + import com.archive.project.system.dict.service.IDictTypeService; + import com.archive.project.system.user.domain.User; + import java.io.File; + import java.io.IOException; + import java.util.ArrayList; + import java.util.HashMap; + import java.util.LinkedHashMap; + import java.util.List; + import java.util.Map; + import java.util.Set; + import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.stereotype.Service; + import org.springframework.transaction.annotation.Transactional; + import org.springframework.web.multipart.MultipartFile; + + + + + + + + + + + + + + + + + + @Service + public class JsglServiceImpl + implements IJsglService + { + @Autowired + private IPhysicalTableService physicalTableService; + @Autowired + private PhysicalTableColumnMapper physicalTableColumnMapper; + @Autowired + private IArchiveTypeService iArchiveTypeService; + @Autowired + private IExecuteSqlService executeSqlService; + @Autowired + private IDictTypeService dictTypeService; + @Autowired + private IArchiveImportBatchService archiveImportBatchService; + @Autowired + private ICcglService ccglService; + @Autowired + private ArchiveConfig archiveConfig; + + public String appendAddForm(String archiveId, String type) { + StringBuilder html = new StringBuilder(); + PhysicalTable physicalTable = new PhysicalTable(); + physicalTable.setArchivetypeid(archiveId); + physicalTable.setTableCode(type); + List physicalTableList = this.physicalTableService.selectPhysicalTableList(physicalTable); + if (physicalTableList != null && physicalTableList.size() > 0) { + Long tableId = ((PhysicalTable)physicalTableList.get(0)).getId(); + PhysicalTableColumn physicalTableColumn = new PhysicalTableColumn(); + physicalTableColumn.setTableId(tableId); + physicalTableColumn.setJmx(Long.valueOf(1L)); + List tableColumnsList = new ArrayList<>(); + if ("mysql".equals(this.archiveConfig.getDatabaseType())) { + tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn); + } + else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { + tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn); + } + + + tableColumnsList = this.physicalTableService.selectTableFormColumns(tableId, tableColumnsList); + + for (int i = 1; i <= tableColumnsList.size(); i++) { + + if (i % 2 != 0) { + html.append("
"); + } + + PhysicalTableColumn tableColumn = tableColumnsList.get(i - 1); + String showType = tableColumn.getShowType(); + Long isBsx = tableColumn.getBsx(); + String columnName = tableColumn.getColumnName(); + String columnCode = tableColumn.getColumnCode(); + String columnCodetype = tableColumn.getColumnCodetype(); + String columnType = tableColumn.getColumnType(); + + if ("textBox".equals(showType)) { + if (isBsx.longValue() == 1L) { + if ("C".equals(columnType)) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + } + else { + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + + } + + + + + + } + else if ("C".equals(columnType)) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + } + else { + + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + + } + + + + + + } + else if ("dateBox".equals(showType)) { + if (isBsx.longValue() == 1L) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); + + + + + } + else { + + + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); + + + + + + + } + + + + + + + } + else if ("dateTimeBox".equals(showType)) { + if (isBsx.longValue() == 1L) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); + + + + + } + else { + + + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); + + + + + + + } + + + + + + + } + else if ("comboBox".equals(showType)) { + List dictDatas = this.dictTypeService.selectDictDataByType(columnCodetype); + if (isBsx.longValue() == 1L) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\t\t\t\t"); + } + + + + + + + for (DictData dictData : dictDatas) { + html.append("\r\n"); + } + + html.append("\t\t\t\t
\r\n\t
\r\n
"); + + + + + + } + else if ("multipleComboBox".equals(showType)) { + List dictDatas = this.dictTypeService.selectDictDataByType(columnCodetype); + if (isBsx.longValue() == 1L) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t"); + } + + + + + + for (DictData dictData : dictDatas) { + html.append("\r\n"); + } + + html.append("\t\t\t\t
\r\n\t
\r\n
"); + + + + + + } + else if ("textArea".equals(showType)) { + if (isBsx.longValue() == 1L) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + } + else { + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + + + } + + + + + + } + else if (isBsx.longValue() == 1L) { + if ("C".equals(columnType)) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + } + else { + + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + } + + + + + } + else if ("C".equals(columnType)) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + } + else { + + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + } + + + + + + + + + + + if (i % 2 == 0 || i == tableColumnsList.size()) { + html.append("
"); + } + } + } + return html.toString(); + } + + + @Transactional + public String appendAddFormByDataId(String archiveTypeId, String type, String id, String readOnly) { + StringBuilder html = new StringBuilder(); + PhysicalTable physicalTable = new PhysicalTable(); + physicalTable.setArchivetypeid(archiveTypeId); + physicalTable.setTableCode(type); + List physicalTableList = this.physicalTableService.selectPhysicalTableList(physicalTable); + if (physicalTableList != null && physicalTableList.size() > 0) { + Long tableId = ((PhysicalTable)physicalTableList.get(0)).getId(); + PhysicalTableColumn physicalTableColumn = new PhysicalTableColumn(); + physicalTableColumn.setTableId(tableId); + physicalTableColumn.setJmx(Long.valueOf(1L)); + List tableColumnsList = new ArrayList<>(); + if ("mysql".equals(this.archiveConfig.getDatabaseType())) { + tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn); + } + else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { + tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn); + } + + + tableColumnsList = this.physicalTableService.selectTableFormColumns(tableId, tableColumnsList); + + for (int i = 1; i <= tableColumnsList.size(); i++) { + + if (i % 2 != 0) { + html.append("
"); + } + + PhysicalTableColumn tableColumn = tableColumnsList.get(i - 1); + String showType = tableColumn.getShowType(); + Long isBsx = tableColumn.getBsx(); + String columnName = tableColumn.getColumnName(); + String columnCode = tableColumn.getColumnCode(); + String columnCodetype = tableColumn.getColumnCodetype(); + String columnType = tableColumn.getColumnType(); + + + + String Sql = ""; + if (type.toLowerCase().equals("folder")) { + Sql = "select " + columnCode + " from " + ((PhysicalTable)physicalTableList.get(0)).getTablename() + " where id=" + id; + } else if (type.toLowerCase().equals("file")) { + Sql = "select " + columnCode + " from " + ((PhysicalTable)physicalTableList.get(0)).getTablename() + " where id=" + id; + } else if (type.toLowerCase().equals("document") || type.toLowerCase().equals("info")) { + Sql = "select " + columnCode + " from " + ((PhysicalTable)physicalTableList.get(0)).getTablename() + " where ownerid=" + id; + } + LinkedHashMap datalist = this.executeSqlService.getOne(Sql); + String value = ""; + if (datalist != null && datalist.size() > 0) { + value = (datalist.get(columnCode) == null) ? "" : datalist.get(columnCode).toString(); + } + + if ("textBox".equals(showType)) { + if (isBsx.longValue() == 1L) { + if ("C".equals(columnType)) { + if (readOnly.equals("true")) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + } + else { + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + + } + + + + + } + else if (readOnly.equals("true")) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + } + else { + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + + + } + + + + + + } + else if ("C".equals(columnType)) { + if (readOnly.equals("true")) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + } + else { + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + + } + + + + + + } + else if (readOnly.equals("true")) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + } + else { + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + + + } + + + + + + + } + else if ("dateBox".equals(showType)) { + if (isBsx.longValue() == 1L) { + if (readOnly.equals("true")) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); + + + + + } + else { + + + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); + + + + + + } + + + + + + + } + else if (readOnly.equals("true")) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); + + + + + } + else { + + + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); + + + + + + + + } + + + + + + + + } + else if ("dateTimeBox".equals(showType)) { + if (isBsx.longValue() == 1L) { + if (readOnly.equals("true")) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); + + + + + } + else { + + + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); + + + + + + } + + + + + + + } + else if (readOnly.equals("true")) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); + + + + + } + else { + + + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n \t\t
\t\t\t\t\t\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n
"); + + + + + + + + } + + + + + + + + } + else if ("comboBox".equals(showType)) { + List dictDatas = this.dictTypeService.selectDictDataByType(columnCodetype); + if (isBsx.longValue() == 1L) { + if (readOnly.equals("true")) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\t\t\t\t"); + + + + } + + + + } + else if (readOnly.equals("true")) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\t\t\t\t"); + } + + + + + + + + + for (DictData dictData : dictDatas) { + if (value.equals(dictData.getDictValue())) { + html.append("\r\n"); continue; + } + html.append("\r\n"); + } + + + html.append("\t\t\t\t
\r\n\t
\r\n
"); + + + + + + } + else if ("multipleComboBox".equals(showType)) { + List dictDatas = this.dictTypeService.selectDictDataByType(columnCodetype); + if (isBsx.longValue() == 1L) { + if (readOnly.equals("true")) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t"); + + + } + + + + } + else if (readOnly.equals("true")) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t"); + } + + + + + + + + for (DictData dictData : dictDatas) { + if (value.contains(dictData.getDictValue())) { + html.append("\r\n"); continue; + } + html.append("\r\n"); + } + + + + html.append("\t\t\t\t
\r\n\t
\r\n
"); + + + + + + } + else if ("textArea".equals(showType)) { + if (isBsx.longValue() == 1L) { + if (readOnly.equals("true")) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + } + else { + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + + } + + + + + } + else if (readOnly.equals("true")) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + } + else { + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + + + + } + + + + + + + } + else if (isBsx.longValue() == 1L) { + if ("C".equals(columnType)) { + if (readOnly.equals("true")) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + } + else { + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + + } + + + + + } + else if (readOnly.equals("true")) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + } + else { + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + + } + + + + + + } + else if ("C".equals(columnType)) { + if (readOnly.equals("true")) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + } + else { + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + + } + + + + + + } + else if (readOnly.equals("true")) { + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + + + + } + else { + + + + html.append("
\r\n\t
\r\n\t\t\r\n\t\t
\r\n\t\t\t\r\n\t\t
\r\n\t
\r\n
"); + } + + + + + + + + + + + + + if (i % 2 == 0 || i == tableColumnsList.size()) { + html.append("
"); + } + } + } + return html.toString(); + } + + + + + + + @Transactional + public boolean addSave(String archiveStr, String archiveId, String type) throws Exception { + HashMap archiveMap = (HashMap)JSON.parseObject(archiveStr, HashMap.class); + PhysicalTable physicalTable = new PhysicalTable(); + physicalTable.setTableCode(type); + physicalTable.setArchivetypeid(archiveId); + List tablesList = this.physicalTableService.selectPhysicalTableList(physicalTable); + if (tablesList != null && tablesList.size() > 0) { + String tableName = ((PhysicalTable)tablesList.get(0)).getTablename(); + Long tableId = ((PhysicalTable)tablesList.get(0)).getId(); + PhysicalTableColumn physicalTableColumn = new PhysicalTableColumn(); + physicalTableColumn.setTableId(tableId); + + String fields = ",is_delete"; + String values = ",0"; + Set keySet = archiveMap.keySet(); + for (String key : keySet) { + fields = fields + "," + key; + + String value = archiveMap.get(key); + + if (StringUtils.isEmpty(value)) { + values = values + ",''"; + + continue; + } + physicalTableColumn.setColumnCode(key); + List tableColumnsList = new ArrayList<>(); + if ("mysql".equals(this.archiveConfig.getDatabaseType())) { + tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn); + } + else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { + tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn); + } + if (tableColumnsList.size() > 0 && tableColumnsList.get(0) != null) { + String columnType = ((PhysicalTableColumn)tableColumnsList.get(0)).getColumnType(); + if (columnType.equals("N")) { + values = values + "," + (String)archiveMap.get(key); + continue; + } + values = values + ",'" + (String)archiveMap.get(key) + "'"; + continue; + } + values = values + ",'" + (String)archiveMap.get(key) + "'"; + } + + + + fields = fields.substring(1); + values = values.substring(1); + String sql = "INSERT INTO " + tableName + " ( " + fields + ",status ) VALUES ( " + values + ",'60' ) "; + return this.executeSqlService.insert(sql); + } + return false; + } + + + + + + + + + + + + + + public boolean update(String archiveStr, String archiveTypeId, String type, String id) throws Exception { + HashMap archiveMap = (HashMap)JSON.parseObject(archiveStr, HashMap.class); + PhysicalTable physicalTable = new PhysicalTable(); + physicalTable.setTableCode(type); + physicalTable.setArchivetypeid(archiveTypeId); + List tablesList = this.physicalTableService.selectPhysicalTableList(physicalTable); + if (tablesList != null && tablesList.size() > 0) { + String tableName = ((PhysicalTable)tablesList.get(0)).getTablename(); + Long tableId = ((PhysicalTable)tablesList.get(0)).getId(); + PhysicalTableColumn physicalTableColumn = new PhysicalTableColumn(); + physicalTableColumn.setTableId(tableId); + + String fields = ""; + Set keySet = archiveMap.keySet(); + for (String key : keySet) { + + String value = archiveMap.get(key); + + + + + + physicalTableColumn.setColumnCode(key); + List tableColumnsList = new ArrayList<>(); + if ("mysql".equals(this.archiveConfig.getDatabaseType())) { + tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn); + } + else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { + tableColumnsList = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn); + } + if (tableColumnsList.size() > 0 && tableColumnsList.get(0) != null) { + String columnType = ((PhysicalTableColumn)tableColumnsList.get(0)).getColumnType(); + if (columnType.equals("C")) { + if (StringUtils.isEmpty(value)) { + value = "0"; + } else { + value = archiveMap.get(key); + } + + } else { + + value = "'" + (String)archiveMap.get(key) + "'"; + } + } else { + value = "'" + (String)archiveMap.get(key) + "'"; + } + + fields = fields + "," + key + "=" + value; + } + fields = fields.substring(1); + String sql = "update " + tableName + " set " + fields + " where id=" + id; + return this.executeSqlService.update(sql); + } + return false; + } + + + + + + + + + + public Map getTableIdByArchiveTypeId(String archiveTypeId, String type) { + Map map = new HashMap<>(); + PhysicalTable physicalTable = new PhysicalTable(); + physicalTable.setTableCode(type); + physicalTable.setArchivetypeid(archiveTypeId); + List tablesList = this.physicalTableService.selectPhysicalTableList(physicalTable); + if (tablesList != null && tablesList.size() > 0) { + String tableName = ((PhysicalTable)tablesList.get(0)).getTablename(); + Long tableId = ((PhysicalTable)tablesList.get(0)).getId(); + map.put("tableId", tableId); + map.put("tableName", tableName); + } + return map; + } + + + + + + + + + + public boolean uploadFile(MultipartFile[] files, long tableId, long id) throws IOException { + boolean res = false; + if (files != null) { + for (int i = 0; i < files.length; i++) { + String fileName = files[i].getOriginalFilename(); + + String xdlj = this.ccglService.getCreateDocumentPathByFile(id, tableId); + String filepath = ArchiveConfig.getInstance().getUploadPath() + File.separator + "DocumentFile" + File.separator + xdlj; + File localFile = new File(filepath); + if (!localFile.exists()) { + localFile.mkdirs(); + } + String path = localFile.getPath() + File.separator + fileName; + File server_file = new File(path); + if (server_file.exists()) { + server_file.setWritable(true); + server_file.delete(); + } + files[i].transferTo(server_file); + String newfileName = server_file.getName().substring(0, server_file.getName().lastIndexOf(".")); + String hz = server_file.getName().substring(server_file.getName().lastIndexOf(".") + 1, server_file.getName().length()); + String fileSize = FileUtils.changeValueType(Long.valueOf(server_file.length())); + + String tableName = TableUtil.getTableName(Long.valueOf(tableId)); + String docuumentTableName = tableName.toLowerCase().replace("_folder", "_document"); + docuumentTableName = docuumentTableName.toLowerCase().replace("_file", "_document"); + String docTableId = TableUtil.getTableId(docuumentTableName); + long newId = this.archiveImportBatchService.getTableNewId(Long.parseLong(docTableId)); + long archiveTypeId = TableUtil.getArchiveTypeIdByTableId(tableId); + User user = ShiroUtils.getSysUser(); + String loginName = user.getLoginName(); + + + String inserSql = "insert into " + docuumentTableName + "(id,ownerid,filename,filesize,filepath,filehz,tableId,create_user,create_time,batcharchivetypeid) values(" + newId + "," + id + ",'" + newfileName + "','" + fileSize + "','" + server_file.getPath().replaceAll("\\\\", "\\\\\\\\") + "','" + hz + "','" + tableId + "','" + loginName + "','" + DateUtils.getTime() + "'," + archiveTypeId + ")"; + res = this.executeSqlService.insert(inserSql); + + String updateSql = "update " + tableName + " set dqzws=dqzws+1 where id=" + id; + this.executeSqlService.update(updateSql); + System.out.println("文件" + path + "上传成功"); + } + } + return res; + } + + + + + + + + + + + + + + + + @Transactional + public boolean archivePhysicalDelete(String query, String archiveTypeId, String type, String ids) { + boolean res = false; + ArchiveType archiveType = this.iArchiveTypeService.selectArchiveTypeById(Long.valueOf(Long.parseLong(archiveTypeId))); + String archiveCode = archiveType.getArhciveCode(); + + if (StringUtils.isNotEmpty(ids)) { + if (type.toLowerCase().equals("folder")) { + + + String documentPathSql = "select filewaterpath,filepath from t_ar_" + archiveCode + "_document where ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (" + ids + "))"; + getDocumentSqlDeleteFile(documentPathSql); + String documentSql = "delete from t_ar_" + archiveCode + "_document where ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (" + ids + "))"; + String filesql = "delete from t_ar_" + archiveCode + "_file where ownerid in (" + ids + ")"; + String folderSql = "delete from t_ar_" + archiveCode + "_folder where id in (" + ids + ")"; + this.executeSqlService.delete(documentSql); + this.executeSqlService.delete(filesql); + this.executeSqlService.delete(folderSql); + } else if (type.toLowerCase().equals("file")) { + + + String documentPathSql = "select filewaterpath,filepath from t_ar_" + archiveCode + "_document where ownerid in (" + ids + ")"; + getDocumentSqlDeleteFile(documentPathSql); + String documentSql = "delete from t_ar_" + archiveCode + "_document where ownerid in (" + ids + ")"; + String filesql = "delete from t_ar_" + archiveCode + "_file where id in (" + ids + ")"; + this.executeSqlService.delete(documentSql); + this.executeSqlService.delete(filesql); + } + res = true; + } + else { + + String condition = appendQueryCondition(query, archiveTypeId, type); + if (type.toLowerCase().equals("folder")) { + + String documentPathSql = "select filewaterpath,filepath from t_ar_" + archiveCode + "_document where ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (select id from t_ar_" + archiveCode + "_folder where " + condition + "))"; + getDocumentSqlDeleteFile(documentPathSql); + String documentSql = "delete from t_ar_" + archiveCode + "_document where ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (select id from t_ar_" + archiveCode + "_folder where " + condition + "))"; + String filesql = "delete from t_ar_" + archiveCode + "_file where ownerid in (select id from t_ar_" + archiveCode + "_folder where " + condition + ")"; + String folderSql = "delete from t_ar_" + archiveCode + "_folder where " + condition; + this.executeSqlService.delete(documentSql); + this.executeSqlService.delete(filesql); + this.executeSqlService.delete(folderSql); + } else { + + String documentPathSql = "select filewaterpath,filepath from t_ar_" + archiveCode + "_document where ownerid in (select id from t_ar_" + archiveCode + "_file where " + condition + ")"; + getDocumentSqlDeleteFile(documentPathSql); + String documentSql = "delete from t_ar_" + archiveCode + "_document where ownerid in (select id from t_ar_" + archiveCode + "_file where " + condition + ")"; + String filesql = "delete from t_ar_" + archiveCode + "_file where " + condition; + this.executeSqlService.delete(documentSql); + this.executeSqlService.delete(filesql); + } + res = true; + } + return res; + } + + + + + + + + + + + + + + + @Transactional + public boolean archivePhysicalHf(String query, String archiveTypeId, String type, String ids) { + boolean res = false; + ArchiveType archiveType = this.iArchiveTypeService.selectArchiveTypeById(Long.valueOf(Long.parseLong(archiveTypeId))); + String archiveCode = archiveType.getArhciveCode(); + + if (StringUtils.isNotEmpty(ids)) { + if (type.toLowerCase().equals("folder")) { + + String documentSql = "update t_ar_" + archiveCode + "_document set is_delete='0' where is_delete='1' and ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (" + ids + "))"; + String filesql = "update t_ar_" + archiveCode + "_file set is_delete='0' where is_delete='1' and ownerid in (" + ids + ")"; + String folderSql = "update t_ar_" + archiveCode + "_folder set is_delete='0' where is_delete='1' and id in (" + ids + ")"; + this.executeSqlService.update(documentSql); + this.executeSqlService.update(filesql); + this.executeSqlService.update(folderSql); + } else if (type.toLowerCase().equals("file")) { + + String documentSql = "update t_ar_" + archiveCode + "_document set is_delete='0' where is_delete='1' and ownerid in (" + ids + ")"; + String filesql = "update t_ar_" + archiveCode + "_file set is_delete='0' where is_delete='1' and id in (" + ids + ")"; + this.executeSqlService.update(documentSql); + this.executeSqlService.update(filesql); + } + res = true; + } + else { + + String condition = appendQueryCondition(query, archiveTypeId, type); + if (type.toLowerCase().equals("folder")) { + + String documentSql = "update t_ar_" + archiveCode + "_document set is_delete='0' where is_delete='1' and ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (select id from t_ar_" + archiveCode + "_folder where " + condition + "))"; + String filesql = "update t_ar_" + archiveCode + "_file set is_delete='0' where is_delete='1' and ownerid in (select id from t_ar_" + archiveCode + "_folder where " + condition + ")"; + String folderSql = "update t_ar_" + archiveCode + "_folder set is_delete='0' where is_delete='1' and " + condition + ""; + this.executeSqlService.update(documentSql); + this.executeSqlService.update(filesql); + this.executeSqlService.update(folderSql); + } else if (type.toLowerCase().equals("file")) { + + String documentSql = "update t_ar_" + archiveCode + "_document set is_delete='0' where is_delete='1' and ownerid in (select id from t_ar_" + archiveCode + "_file where " + condition + ")"; + String filesql = "update t_ar_" + archiveCode + "_file set is_delete='0' where is_delete='1' and " + condition; + this.executeSqlService.update(documentSql); + this.executeSqlService.update(filesql); + } + res = true; + } + return res; + } + + + + + + + + + + + + @Transactional + public boolean archiveLogicDelete(String query, String archiveTypeId, String type, String ids) { + boolean res = false; + ArchiveType archiveType = this.iArchiveTypeService.selectArchiveTypeById(Long.valueOf(Long.parseLong(archiveTypeId))); + String archiveCode = archiveType.getArhciveCode(); + + if (StringUtils.isNotEmpty(ids)) { + if (type.toLowerCase().equals("folder")) { + + String documentSql = "update t_ar_" + archiveCode + "_document set is_delete='1' where is_delete='0' and ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (" + ids + "))"; + String filesql = "update t_ar_" + archiveCode + "_file set is_delete='1' where is_delete='0' and ownerid in (" + ids + ")"; + String folderSql = "update t_ar_" + archiveCode + "_folder set is_delete='1' where is_delete='0' and id in (" + ids + ")"; + this.executeSqlService.update(documentSql); + this.executeSqlService.update(filesql); + this.executeSqlService.update(folderSql); + } else if (type.toLowerCase().equals("file")) { + + String documentSql = "update t_ar_" + archiveCode + "_document set is_delete='1' where is_delete='0' and ownerid in (" + ids + ")"; + String filesql = "update t_ar_" + archiveCode + "_file set is_delete='1' where is_delete='0' and id in (" + ids + ")"; + this.executeSqlService.update(documentSql); + this.executeSqlService.update(filesql); + } + res = true; + } + else { + + String condition = appendQueryCondition(query, archiveTypeId, type); + if (type.toLowerCase().equals("folder")) { + + String documentSql = "update t_ar_" + archiveCode + "_document set is_delete='1' where is_delete='0' and ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (select id from t_ar_" + archiveCode + "_folder where " + condition + "))"; + String filesql = "update t_ar_" + archiveCode + "_file set is_delete='1' where is_delete='0' and ownerid in (select id from t_ar_" + archiveCode + "_folder where " + condition + ")"; + String folderSql = "update t_ar_" + archiveCode + "_folder set is_delete='1' where is_delete='0' and " + condition + ""; + this.executeSqlService.update(documentSql); + this.executeSqlService.update(filesql); + this.executeSqlService.update(folderSql); + } else if (type.toLowerCase().equals("file")) { + + String documentSql = "update t_ar_" + archiveCode + "_document set is_delete='1' where is_delete='0' and ownerid in (select id from t_ar_" + archiveCode + "_file where " + condition + ")"; + String filesql = "update t_ar_" + archiveCode + "_file set is_delete='1' where is_delete='0' and " + condition; + this.executeSqlService.update(documentSql); + this.executeSqlService.update(filesql); + } + res = true; + } + return res; + } + + + + + + + + + + + public String appendQueryCondition(String query, String archiveTypeId, String type) { + String condition = " 1=1 "; + if (StringUtils.isNotEmpty(query)) { + HashMap archiveMap = (HashMap)JSON.parseObject(query, HashMap.class); + + PhysicalTable physicalTable = new PhysicalTable(); + physicalTable.setArchivetypeid(archiveTypeId); + physicalTable.setTableCode(type); + List tablesList = this.physicalTableService.selectPhysicalTableList(physicalTable); + + if (tablesList != null && tablesList.size() > 0) { + physicalTable = tablesList.get(0); + + PhysicalTableColumn physicalTableColumn1 = new PhysicalTableColumn(); + physicalTableColumn1.setTableId(physicalTable.getId()); + List columnsList1 = new ArrayList<>(); + if ("mysql".equals(this.archiveConfig.getDatabaseType())) { + columnsList1 = this.physicalTableColumnMapper.selectPhysicalTableColumnListMysql(physicalTableColumn1); + } + else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) { + columnsList1 = this.physicalTableColumnMapper.selectPhysicalTableColumnListSqlLite(physicalTableColumn1); + } + + if (columnsList1 != null && columnsList1.size() > 0) { + Set keySet = archiveMap.keySet(); + for (String key : keySet) { + for (PhysicalTableColumn tableColumn : columnsList1) { + String field = tableColumn.getColumnCode(); + if (key.equals(field) || key.replaceAll("_Qazwsx13579!", "").equals(field) || key + .replaceAll("_Qazwsx24680!", "").equals(field)) { + String value = String.valueOf(archiveMap.get(key)); + if (StringUtils.isNotEmpty(value)) { + Long jsfs = tableColumn.getJsfs(); + + if (jsfs.longValue() == 0L) { + condition = condition + "and " + field + " like '%" + value + "%' "; + continue; + } + if (jsfs.longValue() == 1L) { + condition = condition + "and " + field + " = '" + value + "' "; + continue; + } + if (jsfs.longValue() == 2L) { + condition = condition + "and " + field + " > '" + value + "' "; + continue; + } + if (jsfs.longValue() == 3L) { + condition = condition + "and " + field + " < '" + value + "' "; + continue; + } + if (jsfs.longValue() == 4L) { + condition = condition + "and " + field + " >= '" + value + "' "; + continue; + } + if (jsfs.longValue() == 5L) { + condition = condition + "and " + field + " <= '" + value + "' "; + continue; + } + if (jsfs.longValue() == 6L) { + if (key.replaceAll("_Qazwsx13579!", "").equals(field)) { + condition = condition + "and " + field + " >= '" + value + "' "; + } + if (key.replaceAll("_Qazwsx24680!", "").equals(field)) + condition = condition + "and " + field + " <= '" + value + "' "; + continue; + } + condition = condition + "and " + field + " like '%" + value + "%' "; + } + } + } + } + } + } + } + + return condition; + } + + + + + + public void getDocumentSqlDeleteFile(String sql) { + List> list = this.executeSqlService.queryList(sql); + for (int i = 0; i < list.size(); i++) { + String waterPath = (((LinkedHashMap)list.get(i)).get("filewaterpath") == null) ? "" : ((LinkedHashMap)list.get(i)).get("filewaterpath").toString(); + String filePath = (((LinkedHashMap)list.get(i)).get("filepath") == null) ? "" : ((LinkedHashMap)list.get(i)).get("filepath").toString(); + File waterFile = new File(waterPath); + if (waterFile.exists()) { + waterFile.delete(); + } + File file = new File(filePath); + if (file.exists()) { + file.delete(); + } + } + } + + + + + + + + + + + + @Transactional + public boolean rzlk(String query, String archiveTypeId, String type, String ids) { + boolean res = false; + ArchiveType archiveType = this.iArchiveTypeService.selectArchiveTypeById(Long.valueOf(Long.parseLong(archiveTypeId))); + String archiveCode = archiveType.getArhciveCode(); + if (StringUtils.isNotEmpty(ids)) { + if (type.toLowerCase().equals("folder")) { + + String documentSql = "update t_ar_" + archiveCode + "_document set status='80' where is_delete='0' and ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (" + ids + "))"; + String filesql = "update t_ar_" + archiveCode + "_file set status='80' where is_delete='0' and ownerid in (" + ids + ")"; + String folderSql = "update t_ar_" + archiveCode + "_folder set status='80' where is_delete='0' and id in (" + ids + ")"; + this.executeSqlService.update(documentSql); + this.executeSqlService.update(filesql); + this.executeSqlService.update(folderSql); + } else if (type.toLowerCase().equals("file")) { + + String documentSql = "update t_ar_" + archiveCode + "_document set status='80' where is_delete='0' and ownerid in (" + ids + ")"; + String filesql = "update t_ar_" + archiveCode + "_file set status='80' where is_delete='0' and id in (" + ids + ")"; + this.executeSqlService.update(documentSql); + this.executeSqlService.update(filesql); + } + res = true; + } else { + String condition = appendQueryCondition(query, archiveTypeId, type); + if (type.toLowerCase().equals("folder")) { + + String documentSql = "update t_ar_" + archiveCode + "_document set status='80' where is_delete='0' and ownerid in (select id from t_ar_" + archiveCode + "_file where ownerid in (select id from t_ar_" + archiveCode + "_folder where " + condition + "))"; + String filesql = "update t_ar_" + archiveCode + "_file set status='80' where is_delete='0' and ownerid in (select id from t_ar_" + archiveCode + "_folder where " + condition + ")"; + String folderSql = "update t_ar_" + archiveCode + "_folder set status='80' where is_delete='0' and " + condition + ""; + this.executeSqlService.update(documentSql); + this.executeSqlService.update(filesql); + this.executeSqlService.update(folderSql); + } else if (type.toLowerCase().equals("file")) { + + String documentSql = "update t_ar_" + archiveCode + "_document set status='80' where is_delete='0' and ownerid in (select id from t_ar_" + archiveCode + "_file where " + condition + ")"; + String filesql = "update t_ar_" + archiveCode + "_file set status='80' where is_delete='0' and " + condition; + this.executeSqlService.update(documentSql); + this.executeSqlService.update(filesql); + } + res = true; + } + return res; + } + } /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\dajs\jsgl\service\impl\JsglServiceImpl.class diff --git a/src/main/java/com/archive/project/monitor/job/controller/JobController.java b/src/main/java/com/archive/project/monitor/job/controller/JobController.java index 1d354aa..aa6e881 100644 --- a/src/main/java/com/archive/project/monitor/job/controller/JobController.java +++ b/src/main/java/com/archive/project/monitor/job/controller/JobController.java @@ -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 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 list = this.jobService.selectJobList(job); -/* 65 */ ExcelUtil 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 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 list = this.jobService.selectJobList(job); + ExcelUtil 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 diff --git a/src/main/java/com/archive/project/monitor/job/controller/JobLogController.java b/src/main/java/com/archive/project/monitor/job/controller/JobLogController.java index 9a55627..2a06873 100644 --- a/src/main/java/com/archive/project/monitor/job/controller/JobLogController.java +++ b/src/main/java/com/archive/project/monitor/job/controller/JobLogController.java @@ -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 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 list = this.jobLogService.selectJobLogList(jobLog); -/* 72 */ ExcelUtil 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 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 list = this.jobLogService.selectJobLogList(jobLog); + ExcelUtil 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 diff --git a/src/main/java/com/archive/project/monitor/job/domain/Job.java b/src/main/java/com/archive/project/monitor/job/domain/Job.java index 2ebb77c..64383a7 100644 --- a/src/main/java/com/archive/project/monitor/job/domain/Job.java +++ b/src/main/java/com/archive/project/monitor/job/domain/Job.java @@ -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 diff --git a/src/main/java/com/archive/project/monitor/job/domain/JobLog.java b/src/main/java/com/archive/project/monitor/job/domain/JobLog.java index fac8d8c..380c199 100644 --- a/src/main/java/com/archive/project/monitor/job/domain/JobLog.java +++ b/src/main/java/com/archive/project/monitor/job/domain/JobLog.java @@ -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 diff --git a/src/main/java/com/archive/project/monitor/job/service/JobLogServiceImpl.java b/src/main/java/com/archive/project/monitor/job/service/JobLogServiceImpl.java index d9b40af..5f3201c 100644 --- a/src/main/java/com/archive/project/monitor/job/service/JobLogServiceImpl.java +++ b/src/main/java/com/archive/project/monitor/job/service/JobLogServiceImpl.java @@ -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 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 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 diff --git a/src/main/java/com/archive/project/monitor/job/service/JobServiceImpl.java b/src/main/java/com/archive/project/monitor/job/service/JobServiceImpl.java index aad2f9f..b11ff53 100644 --- a/src/main/java/com/archive/project/monitor/job/service/JobServiceImpl.java +++ b/src/main/java/com/archive/project/monitor/job/service/JobServiceImpl.java @@ -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 jobList = this.jobMapper.selectJobAll(); -/* 49 */ for (Job job : jobList) -/* */ { -/* 51 */ ScheduleUtils.createScheduleJob(this.scheduler, job); -/* */ } -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @Override -/* */ public List 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 jobList = this.jobMapper.selectJobAll(); + for (Job job : jobList) + { + ScheduleUtils.createScheduleJob(this.scheduler, job); + } + } + + + + + + + + + @Override + public List 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 diff --git a/src/main/java/com/archive/project/monitor/job/util/JobInvokeUtil.java b/src/main/java/com/archive/project/monitor/job/util/JobInvokeUtil.java index f7a7e22..e3f334c 100644 --- a/src/main/java/com/archive/project/monitor/job/util/JobInvokeUtil.java +++ b/src/main/java/com/archive/project/monitor/job/util/JobInvokeUtil.java @@ -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 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 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 getMethodParams(String invokeTarget) { -/* 108 */ String methodStr = StringUtils.substringBetween(invokeTarget, "(", ")"); -/* 109 */ if (StringUtils.isEmpty(methodStr)) -/* */ { -/* 111 */ return null; -/* */ } -/* 113 */ String[] methodParams = methodStr.split(","); -/* 114 */ List 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 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 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 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 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 getMethodParams(String invokeTarget) { + String methodStr = StringUtils.substringBetween(invokeTarget, "(", ")"); + if (StringUtils.isEmpty(methodStr)) + { + return null; + } + String[] methodParams = methodStr.split(","); + List 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 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 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 diff --git a/src/main/java/com/archive/project/monitor/logininfor/domain/Logininfor.java b/src/main/java/com/archive/project/monitor/logininfor/domain/Logininfor.java index 2d33df1..5c497e2 100644 --- a/src/main/java/com/archive/project/monitor/logininfor/domain/Logininfor.java +++ b/src/main/java/com/archive/project/monitor/logininfor/domain/Logininfor.java @@ -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 diff --git a/src/main/java/com/archive/project/monitor/server/domain/Jvm.java b/src/main/java/com/archive/project/monitor/server/domain/Jvm.java index c3d5f0b..a7b70de 100644 --- a/src/main/java/com/archive/project/monitor/server/domain/Jvm.java +++ b/src/main/java/com/archive/project/monitor/server/domain/Jvm.java @@ -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 diff --git a/src/main/java/com/archive/project/system/user/controller/LoginController.java b/src/main/java/com/archive/project/system/user/controller/LoginController.java index 9813dbb..ef1c6ba 100644 --- a/src/main/java/com/archive/project/system/user/controller/LoginController.java +++ b/src/main/java/com/archive/project/system/user/controller/LoginController.java @@ -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