From a54694671ab93778cc3de8bf85c8793272ae4d54 Mon Sep 17 00:00:00 2001 From: wangxy <1481820854@qq.com> Date: Wed, 21 May 2025 08:51:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=8F=91=E9=80=81=E4=BC=A0=E8=BE=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/exception/base/BaseException.java | 206 +++--- .../java/com/archive/common/utils/Arith.java | 228 +++--- .../archive/common/utils/bean/BeanUtils.java | 220 +++--- .../utils/security/AuthorizationUtils.java | 60 +- .../framework/manager/AsyncManager.java | 114 +-- .../manager/factory/AsyncFactory.java | 198 +++--- .../framework/web/domain/BaseEntity.java | 228 +++--- .../browse/controller/BrowseController.java | 666 +++++++++--------- .../service/impl/BrowseServiceImpl.java | 458 ++++++------ .../project/tool/build/BuildController.java | 52 +- 10 files changed, 1215 insertions(+), 1215 deletions(-) diff --git a/src/main/java/com/archive/common/exception/base/BaseException.java b/src/main/java/com/archive/common/exception/base/BaseException.java index 2b41d38..80301fb 100644 --- a/src/main/java/com/archive/common/exception/base/BaseException.java +++ b/src/main/java/com/archive/common/exception/base/BaseException.java @@ -1,106 +1,106 @@ -/* */ package com.archive.common.exception.base; -/* */ -/* */ import com.archive.common.utils.MessageUtils; -/* */ import org.springframework.util.StringUtils; -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public class BaseException -/* */ extends RuntimeException -/* */ { -/* */ private static final long serialVersionUID = 1L; -/* */ private String module; -/* */ private String code; -/* */ private Object[] args; -/* */ private String defaultMessage; -/* */ -/* */ public BaseException(String module, String code, Object[] args, String defaultMessage) { -/* 37 */ this.module = module; -/* 38 */ this.code = code; -/* 39 */ this.args = args; -/* 40 */ this.defaultMessage = defaultMessage; -/* */ } -/* */ -/* */ -/* */ public BaseException(String module, String code, Object[] args) { -/* 45 */ this(module, code, args, null); -/* */ } -/* */ -/* */ -/* */ public BaseException(String module, String defaultMessage) { -/* 50 */ this(module, null, null, defaultMessage); -/* */ } -/* */ -/* */ -/* */ public BaseException(String code, Object[] args) { -/* 55 */ this(null, code, args, null); -/* */ } -/* */ -/* */ -/* */ public BaseException(String defaultMessage) { -/* 60 */ this(null, null, null, defaultMessage); -/* */ } -/* */ -/* */ -/* */ -/* */ public String getMessage() { -/* 66 */ String message = null; -/* 67 */ if (!StringUtils.isEmpty(this.code)) -/* */ { -/* 69 */ message = MessageUtils.message(this.code, this.args); -/* */ } -/* 71 */ if (message == null) -/* */ { -/* 73 */ message = this.defaultMessage; -/* */ } -/* 75 */ return message; -/* */ } -/* */ -/* */ -/* */ public String getModule() { -/* 80 */ return this.module; -/* */ } -/* */ -/* */ -/* */ public String getCode() { -/* 85 */ return this.code; -/* */ } -/* */ -/* */ -/* */ public Object[] getArgs() { -/* 90 */ return this.args; -/* */ } -/* */ -/* */ -/* */ public String getDefaultMessage() { -/* 95 */ return this.defaultMessage; -/* */ } -/* */ -/* */ -/* */ -/* */ public String toString() { -/* 101 */ return getClass() + "{module='" + this.module + '\'' + ", message='" + getMessage() + '\'' + '}'; -/* */ } -/* */ } + package com.archive.common.exception.base; + + import com.archive.common.utils.MessageUtils; + import org.springframework.util.StringUtils; + + + + + + + + + + + + + + + + + + + + + + + public class BaseException + extends RuntimeException + { + private static final long serialVersionUID = 1L; + private String module; + private String code; + private Object[] args; + private String defaultMessage; + + public BaseException(String module, String code, Object[] args, String defaultMessage) { + this.module = module; + this.code = code; + this.args = args; + this.defaultMessage = defaultMessage; + } + + + public BaseException(String module, String code, Object[] args) { + this(module, code, args, null); + } + + + public BaseException(String module, String defaultMessage) { + this(module, null, null, defaultMessage); + } + + + public BaseException(String code, Object[] args) { + this(null, code, args, null); + } + + + public BaseException(String defaultMessage) { + this(null, null, null, defaultMessage); + } + + + + public String getMessage() { + String message = null; + if (!StringUtils.isEmpty(this.code)) + { + message = MessageUtils.message(this.code, this.args); + } + if (message == null) + { + message = this.defaultMessage; + } + return message; + } + + + public String getModule() { + return this.module; + } + + + public String getCode() { + return this.code; + } + + + public Object[] getArgs() { + return this.args; + } + + + public String getDefaultMessage() { + return this.defaultMessage; + } + + + + public String toString() { + return getClass() + "{module='" + this.module + '\'' + ", message='" + getMessage() + '\'' + '}'; + } + } /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\exception\base\BaseException.class diff --git a/src/main/java/com/archive/common/utils/Arith.java b/src/main/java/com/archive/common/utils/Arith.java index 72e97b7..d488363 100644 --- a/src/main/java/com/archive/common/utils/Arith.java +++ b/src/main/java/com/archive/common/utils/Arith.java @@ -1,119 +1,119 @@ -/* */ package com.archive.common.utils + package com.archive.common.utils ; -/* */ -/* */ import java.math.BigDecimal; -/* */ import java.math.RoundingMode; -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public class Arith -/* */ { -/* */ private static final int DEF_DIV_SCALE = 10; -/* */ -/* */ public static double add(double v1, double v2) { -/* 30 */ BigDecimal b1 = new BigDecimal(Double.toString(v1)); -/* 31 */ BigDecimal b2 = new BigDecimal(Double.toString(v2)); -/* 32 */ return b1.add(b2).doubleValue(); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public static double sub(double v1, double v2) { -/* 43 */ BigDecimal b1 = new BigDecimal(Double.toString(v1)); -/* 44 */ BigDecimal b2 = new BigDecimal(Double.toString(v2)); -/* 45 */ return b1.subtract(b2).doubleValue(); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public static double mul(double v1, double v2) { -/* 56 */ BigDecimal b1 = new BigDecimal(Double.toString(v1)); -/* 57 */ BigDecimal b2 = new BigDecimal(Double.toString(v2)); -/* 58 */ return b1.multiply(b2).doubleValue(); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public static double div(double v1, double v2) { -/* 70 */ return div(v1, v2, 10); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public static double div(double v1, double v2, int scale) { -/* 83 */ if (scale < 0) -/* */ { -/* 85 */ throw new IllegalArgumentException("The scale must be a positive integer or zero"); -/* */ } -/* */ -/* 88 */ BigDecimal b1 = new BigDecimal(Double.toString(v1)); -/* 89 */ BigDecimal b2 = new BigDecimal(Double.toString(v2)); -/* 90 */ if (b1.compareTo(BigDecimal.ZERO) == 0) -/* */ { -/* 92 */ return BigDecimal.ZERO.doubleValue(); -/* */ } -/* 94 */ return b1.divide(b2, scale, RoundingMode.HALF_UP).doubleValue(); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public static double round(double v, int scale) { -/* 105 */ if (scale < 0) -/* */ { -/* 107 */ throw new IllegalArgumentException("The scale must be a positive integer or zero"); -/* */ } -/* */ -/* 110 */ BigDecimal b = new BigDecimal(Double.toString(v)); -/* 111 */ BigDecimal one = new BigDecimal("1"); -/* 112 */ return b.divide(one, scale, RoundingMode.HALF_UP).doubleValue(); -/* */ } -/* */ } + + import java.math.BigDecimal; + import java.math.RoundingMode; + + + + + + + + + + + + + + + + + + + + + public class Arith + { + private static final int DEF_DIV_SCALE = 10; + + public static double add(double v1, double v2) { + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + return b1.add(b2).doubleValue(); + } + + + + + + + + + public static double sub(double v1, double v2) { + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + return b1.subtract(b2).doubleValue(); + } + + + + + + + + + public static double mul(double v1, double v2) { + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + return b1.multiply(b2).doubleValue(); + } + + + + + + + + + + public static double div(double v1, double v2) { + return div(v1, v2, 10); + } + + + + + + + + + + + public static double div(double v1, double v2, int scale) { + if (scale < 0) + { + throw new IllegalArgumentException("The scale must be a positive integer or zero"); + } + + BigDecimal b1 = new BigDecimal(Double.toString(v1)); + BigDecimal b2 = new BigDecimal(Double.toString(v2)); + if (b1.compareTo(BigDecimal.ZERO) == 0) + { + return BigDecimal.ZERO.doubleValue(); + } + return b1.divide(b2, scale, RoundingMode.HALF_UP).doubleValue(); + } + + + + + + + + + public static double round(double v, int scale) { + if (scale < 0) + { + throw new IllegalArgumentException("The scale must be a positive integer or zero"); + } + + BigDecimal b = new BigDecimal(Double.toString(v)); + BigDecimal one = new BigDecimal("1"); + return b.divide(one, scale, RoundingMode.HALF_UP).doubleValue(); + } + } /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\Arith.class diff --git a/src/main/java/com/archive/common/utils/bean/BeanUtils.java b/src/main/java/com/archive/common/utils/bean/BeanUtils.java index d8727a2..9d7ff4a 100644 --- a/src/main/java/com/archive/common/utils/bean/BeanUtils.java +++ b/src/main/java/com/archive/common/utils/bean/BeanUtils.java @@ -1,113 +1,113 @@ -/* */ package com.archive.common.utils.bean; -/* */ -/* */ import java.lang.reflect.Method; -/* */ import java.util.ArrayList; -/* */ import java.util.List; -/* */ import java.util.regex.Matcher; -/* */ import java.util.regex.Pattern; -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public class BeanUtils -/* */ extends org.springframework.beans.BeanUtils -/* */ { -/* */ private static final int BEAN_METHOD_PROP_INDEX = 3; -/* 20 */ private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)"); -/* */ -/* */ -/* 23 */ private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public static void copyBeanProp(Object dest, Object src) { -/* */ try { -/* 35 */ copyProperties(src, dest); -/* */ } -/* 37 */ catch (Exception e) { -/* */ -/* 39 */ e.printStackTrace(); -/* */ } -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public static List getSetterMethods(Object obj) { -/* 52 */ List setterMethods = new ArrayList<>(); -/* */ -/* */ -/* 55 */ Method[] methods = obj.getClass().getMethods(); -/* */ -/* */ -/* */ -/* 59 */ for (Method method : methods) { -/* */ -/* 61 */ Matcher m = SET_PATTERN.matcher(method.getName()); -/* 62 */ if (m.matches() && (method.getParameterTypes()).length == 1) -/* */ { -/* 64 */ setterMethods.add(method); -/* */ } -/* */ } -/* */ -/* 68 */ return setterMethods; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public static List getGetterMethods(Object obj) { -/* 81 */ List getterMethods = new ArrayList<>(); -/* */ -/* 83 */ Method[] methods = obj.getClass().getMethods(); -/* */ -/* 85 */ for (Method method : methods) { -/* */ -/* 87 */ Matcher m = GET_PATTERN.matcher(method.getName()); -/* 88 */ if (m.matches() && (method.getParameterTypes()).length == 0) -/* */ { -/* 90 */ getterMethods.add(method); -/* */ } -/* */ } -/* */ -/* 94 */ return getterMethods; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public static boolean isMethodPropEquals(String m1, String m2) { -/* 108 */ return m1.substring(3).equals(m2.substring(3)); -/* */ } -/* */ } + package com.archive.common.utils.bean; + + import java.lang.reflect.Method; + import java.util.ArrayList; + import java.util.List; + import java.util.regex.Matcher; + import java.util.regex.Pattern; + + + + + + + + + public class BeanUtils + extends org.springframework.beans.BeanUtils + { + private static final int BEAN_METHOD_PROP_INDEX = 3; + private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)"); + + + private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)"); + + + + + + + + + + public static void copyBeanProp(Object dest, Object src) { + try { + copyProperties(src, dest); + } + catch (Exception e) { + + e.printStackTrace(); + } + } + + + + + + + + + + public static List getSetterMethods(Object obj) { + List setterMethods = new ArrayList<>(); + + + Method[] methods = obj.getClass().getMethods(); + + + + for (Method method : methods) { + + Matcher m = SET_PATTERN.matcher(method.getName()); + if (m.matches() && (method.getParameterTypes()).length == 1) + { + setterMethods.add(method); + } + } + + return setterMethods; + } + + + + + + + + + + + public static List getGetterMethods(Object obj) { + List getterMethods = new ArrayList<>(); + + Method[] methods = obj.getClass().getMethods(); + + for (Method method : methods) { + + Matcher m = GET_PATTERN.matcher(method.getName()); + if (m.matches() && (method.getParameterTypes()).length == 0) + { + getterMethods.add(method); + } + } + + return getterMethods; + } + + + + + + + + + + + + public static boolean isMethodPropEquals(String m1, String m2) { + return m1.substring(3).equals(m2.substring(3)); + } + } /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\bean\BeanUtils.class diff --git a/src/main/java/com/archive/common/utils/security/AuthorizationUtils.java b/src/main/java/com/archive/common/utils/security/AuthorizationUtils.java index c2850d1..b56b7b0 100644 --- a/src/main/java/com/archive/common/utils/security/AuthorizationUtils.java +++ b/src/main/java/com/archive/common/utils/security/AuthorizationUtils.java @@ -1,33 +1,33 @@ -/* */ package com.archive.common.utils.security; -/* */ -/* */ import com.archive.framework.shiro.realm.UserRealm; -/* */ import org.apache.shiro.SecurityUtils; -/* */ import org.apache.shiro.mgt.RealmSecurityManager; -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public class AuthorizationUtils -/* */ { -/* */ public static void clearAllCachedAuthorizationInfo() { -/* 19 */ getUserRealm().clearAllCachedAuthorizationInfo(); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public static UserRealm getUserRealm() { -/* 27 */ RealmSecurityManager rsm = (RealmSecurityManager)SecurityUtils.getSecurityManager(); -/* 28 */ return (UserRealm) rsm.getRealms().iterator().next(); -/* */ } -/* */ } + package com.archive.common.utils.security; + + import com.archive.framework.shiro.realm.UserRealm; + import org.apache.shiro.SecurityUtils; + import org.apache.shiro.mgt.RealmSecurityManager; + + + + + + + + + + + public class AuthorizationUtils + { + public static void clearAllCachedAuthorizationInfo() { + getUserRealm().clearAllCachedAuthorizationInfo(); + } + + + + + + public static UserRealm getUserRealm() { + RealmSecurityManager rsm = (RealmSecurityManager)SecurityUtils.getSecurityManager(); + return (UserRealm) rsm.getRealms().iterator().next(); + } + } /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\security\AuthorizationUtils.class diff --git a/src/main/java/com/archive/framework/manager/AsyncManager.java b/src/main/java/com/archive/framework/manager/AsyncManager.java index 3c8a20f..04c628b 100644 --- a/src/main/java/com/archive/framework/manager/AsyncManager.java +++ b/src/main/java/com/archive/framework/manager/AsyncManager.java @@ -1,61 +1,61 @@ -/* */ package com.archive.framework.manager + package com.archive.framework.manager ; -/* */ -/* */ import com.archive.common.utils.Threads; -/* */ import com.archive.common.utils.spring.SpringUtils; -/* */ import java.util.TimerTask; -/* */ import java.util.concurrent.ScheduledExecutorService; -/* */ import java.util.concurrent.TimeUnit; -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public class AsyncManager -/* */ { -/* 19 */ private final int OPERATE_DELAY_TIME = 10; -/* */ -/* */ -/* */ -/* */ -/* 24 */ private ScheduledExecutorService executor = (ScheduledExecutorService)SpringUtils.getBean("scheduledExecutorService"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* 33 */ private static com.archive.framework.manager.AsyncManager me = new com.archive.framework.manager.AsyncManager(); -/* */ -/* */ -/* */ public static com.archive.framework.manager.AsyncManager me() { -/* 37 */ return me; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public void execute(TimerTask task) { -/* 47 */ this.executor.schedule(task, 10L, TimeUnit.MILLISECONDS); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public void shutdown() { -/* 55 */ Threads.shutdownAndAwaitTermination(this.executor); -/* */ } -/* */ } + + import com.archive.common.utils.Threads; + import com.archive.common.utils.spring.SpringUtils; + import java.util.TimerTask; + import java.util.concurrent.ScheduledExecutorService; + import java.util.concurrent.TimeUnit; + + + + + + + + + + public class AsyncManager + { + private final int OPERATE_DELAY_TIME = 10; + + + + + private ScheduledExecutorService executor = (ScheduledExecutorService)SpringUtils.getBean("scheduledExecutorService"); + + + + + + + + + private static com.archive.framework.manager.AsyncManager me = new com.archive.framework.manager.AsyncManager(); + + + public static com.archive.framework.manager.AsyncManager me() { + return me; + } + + + + + + + + public void execute(TimerTask task) { + this.executor.schedule(task, 10L, TimeUnit.MILLISECONDS); + } + + + + + + public void shutdown() { + Threads.shutdownAndAwaitTermination(this.executor); + } + } /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\manager\AsyncManager.class diff --git a/src/main/java/com/archive/framework/manager/factory/AsyncFactory.java b/src/main/java/com/archive/framework/manager/factory/AsyncFactory.java index 0b1d0e3..9e55ca1 100644 --- a/src/main/java/com/archive/framework/manager/factory/AsyncFactory.java +++ b/src/main/java/com/archive/framework/manager/factory/AsyncFactory.java @@ -1,104 +1,104 @@ -/* */ package com.archive.framework.manager.factory + package com.archive.framework.manager.factory ; -/* */ -/* */ import com.archive.common.utils.ServletUtils; -/* */ import com.archive.common.utils.security.ShiroUtils; -/* */ import com.archive.project.monitor.online.domain.OnlineSession; -/* */ import com.archive.project.monitor.operlog.domain.OperLog; -/* */ import eu.bitwalker.useragentutils.UserAgent; -/* */ import java.util.TimerTask; -/* */ import org.slf4j.Logger; -/* */ import org.slf4j.LoggerFactory; -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public class AsyncFactory -/* */ { -/* 30 */ private static final Logger sys_user_logger = LoggerFactory.getLogger("sys-user"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public static TimerTask syncSessionToDb(OnlineSession session) { -/* 40 */ return null; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public static TimerTask recordOper(OperLog operLog) { -/* 72 */ return null; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public static TimerTask recordLogininfor(String username, String status, String message, Object... args) { -/* 95 */ UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent")); -/* 96 */ String ip = ShiroUtils.getIp(); -/* 97 */ return null; -/* */ } -/* */ } + + import com.archive.common.utils.ServletUtils; + import com.archive.common.utils.security.ShiroUtils; + import com.archive.project.monitor.online.domain.OnlineSession; + import com.archive.project.monitor.operlog.domain.OperLog; + import eu.bitwalker.useragentutils.UserAgent; + import java.util.TimerTask; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; + + + + + + + + + + + + + + + + + + public class AsyncFactory + { + private static final Logger sys_user_logger = LoggerFactory.getLogger("sys-user"); + + + + + + + + + public static TimerTask syncSessionToDb(OnlineSession session) { + return null; + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + public static TimerTask recordOper(OperLog operLog) { + return null; + } + + + + + + + + + + + + + + + + + + + + + public static TimerTask recordLogininfor(String username, String status, String message, Object... args) { + UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent")); + String ip = ShiroUtils.getIp(); + return null; + } + } /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\manager\factory\AsyncFactory.class diff --git a/src/main/java/com/archive/framework/web/domain/BaseEntity.java b/src/main/java/com/archive/framework/web/domain/BaseEntity.java index 7b6de3c..d8de7b9 100644 --- a/src/main/java/com/archive/framework/web/domain/BaseEntity.java +++ b/src/main/java/com/archive/framework/web/domain/BaseEntity.java @@ -1,119 +1,119 @@ -/* */ package com.archive.framework.web.domain + package com.archive.framework.web.domain ; -/* */ -/* */ import com.fasterxml.jackson.annotation.JsonFormat; -/* */ import com.google.common.collect.Maps; -/* */ import java.io.Serializable; -/* */ import java.util.Date; -/* */ import java.util.Map; -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public class BaseEntity -/* */ implements Serializable -/* */ { -/* */ private static final long serialVersionUID = 1L; -/* */ private String searchValue; -/* */ private String createBy; -/* */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") -/* */ private Date createTime; -/* */ private String updateBy; -/* */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") -/* */ private Date updateTime; -/* */ private String remark; -/* */ private Map params; -/* */ -/* */ public String getSearchValue() { -/* 43 */ return this.searchValue; -/* */ } -/* */ -/* */ -/* */ public void setSearchValue(String searchValue) { -/* 48 */ this.searchValue = searchValue; -/* */ } -/* */ -/* */ -/* */ public String getCreateBy() { -/* 53 */ return this.createBy; -/* */ } -/* */ -/* */ -/* */ public void setCreateBy(String createBy) { -/* 58 */ this.createBy = createBy; -/* */ } -/* */ -/* */ -/* */ public Date getCreateTime() { -/* 63 */ return this.createTime; -/* */ } -/* */ -/* */ -/* */ public void setCreateTime(Date createTime) { -/* 68 */ this.createTime = createTime; -/* */ } -/* */ -/* */ -/* */ public String getUpdateBy() { -/* 73 */ return this.updateBy; -/* */ } -/* */ -/* */ -/* */ public void setUpdateBy(String updateBy) { -/* 78 */ this.updateBy = updateBy; -/* */ } -/* */ -/* */ -/* */ public Date getUpdateTime() { -/* 83 */ return this.updateTime; -/* */ } -/* */ -/* */ -/* */ public void setUpdateTime(Date updateTime) { -/* 88 */ this.updateTime = updateTime; -/* */ } -/* */ -/* */ -/* */ public String getRemark() { -/* 93 */ return this.remark; -/* */ } -/* */ -/* */ -/* */ public void setRemark(String remark) { -/* 98 */ this.remark = remark; -/* */ } -/* */ -/* */ -/* */ public Map getParams() { -/* 103 */ if (this.params == null) -/* */ { -/* 105 */ this.params = Maps.newHashMap(); -/* */ } -/* 107 */ return this.params; -/* */ } -/* */ -/* */ -/* */ public void setParams(Map params) { -/* 112 */ this.params = params; -/* */ } -/* */ } + + import com.fasterxml.jackson.annotation.JsonFormat; + import com.google.common.collect.Maps; + import java.io.Serializable; + import java.util.Date; + import java.util.Map; + + + + + + + + + + + + + + + + + + + + + public class BaseEntity + implements Serializable + { + private static final long serialVersionUID = 1L; + private String searchValue; + private String createBy; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + private String updateBy; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date updateTime; + private String remark; + private Map params; + + public String getSearchValue() { + return this.searchValue; + } + + + public void setSearchValue(String searchValue) { + this.searchValue = searchValue; + } + + + public String getCreateBy() { + return this.createBy; + } + + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + + public Date getCreateTime() { + return this.createTime; + } + + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + + public String getUpdateBy() { + return this.updateBy; + } + + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + + public Date getUpdateTime() { + return this.updateTime; + } + + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + + public String getRemark() { + return this.remark; + } + + + public void setRemark(String remark) { + this.remark = remark; + } + + + public Map getParams() { + if (this.params == null) + { + this.params = Maps.newHashMap(); + } + return this.params; + } + + + public void setParams(Map params) { + this.params = params; + } + } /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\web\domain\BaseEntity.class diff --git a/src/main/java/com/archive/project/browse/controller/BrowseController.java b/src/main/java/com/archive/project/browse/controller/BrowseController.java index 1b7648b..8a1ce05 100644 --- a/src/main/java/com/archive/project/browse/controller/BrowseController.java +++ b/src/main/java/com/archive/project/browse/controller/BrowseController.java @@ -1,343 +1,343 @@ -/* */ package com.archive.project.browse.controller + package com.archive.project.browse.controller ; -/* */ import com.archive.common.archiveUtil.MetadataUtil; -/* */ import com.archive.common.archiveUtil.TableUtil; -/* */ import com.archive.common.ocr.ImageOcr; -/* */ import com.archive.common.ocr.PdfOcr; -/* */ import com.archive.common.utils.StringUtils; -/* */ import com.archive.common.utils.http.HttpUtils; + import com.archive.common.archiveUtil.MetadataUtil; + import com.archive.common.archiveUtil.TableUtil; + import com.archive.common.ocr.ImageOcr; + import com.archive.common.ocr.PdfOcr; + import com.archive.common.utils.StringUtils; + import com.archive.common.utils.http.HttpUtils; import com.archive.framework.config.ArchiveConfig; -/* */ import com.archive.framework.web.controller.BaseController; -/* */ import com.archive.framework.web.domain.AjaxResult; -/* */ import com.archive.project.browse.service.IBrowseService; -/* */ import com.archive.project.dajs.jsgl.service.IJsglService; -/* */ import com.archive.project.dasz.ccgl.service.ICcglService; -/* */ import com.archive.project.system.config.service.IConfigService; -/* */ import java.io.File; -/* */ import java.io.FileInputStream; -/* */ import java.io.IOException; -/* */ import java.util.ArrayList; -/* */ import java.util.HashMap; -/* */ import java.util.List; -/* */ import java.util.Map; -/* */ import javax.servlet.ServletOutputStream; -/* */ import javax.servlet.http.HttpServletRequest; -/* */ import javax.servlet.http.HttpServletResponse; -/* */ 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.RequestMapping; -/* */ import org.springframework.web.bind.annotation.RequestMethod; -/* */ import org.springframework.web.bind.annotation.ResponseBody; -/* */ -/* */ @Controller -/* */ @RequestMapping({"/browse"}) -/* */ public class BrowseController extends BaseController { -/* 36 */ private String prefix = "browse"; -/* */ -/* */ @Autowired -/* */ private IConfigService configService; -/* */ -/* */ @Autowired -/* */ private IJsglService jsglService; -/* */ -/* */ @Autowired -/* */ private IBrowseService iBrowseService; -/* */ -/* */ @Autowired -/* */ private ICcglService ccglService; -/* */ -/* */ @Autowired -/* */ private ArchiveConfig archiveConfig; -/* */ -/* */ @GetMapping({"/browse/{archiveId}/{id}"}) -/* */ public String browse(@PathVariable("archiveId") long archiveId, @PathVariable("id") String id, ModelMap mmap) { -/* 55 */ long tableId = TableUtil.getTableIdByArchiveTypeId(archiveId); -/* 56 */ mmap.put("archiveTypeId", Long.valueOf(archiveId)); -/* 57 */ mmap.put("tableId", Long.valueOf(tableId)); -/* 58 */ mmap.put("id", id); -/* 59 */ boolean browseServerEnabled = this.archiveConfig.isBrowseServerEnabled(); -/* */ -/* 61 */ if (browseServerEnabled) { -/* 62 */ return this.prefix + "/browse"; -/* */ } -/* 64 */ return this.prefix + "/browsesimple"; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @GetMapping({"/appendAddForm/{archiveTypeId}/{type}/{id}"}) -/* */ @ResponseBody -/* */ public String appendAddForm(@PathVariable("archiveTypeId") String archiveTypeId, @PathVariable("type") String type, @PathVariable("id") String id) { -/* 79 */ return this.jsglService.appendAddFormByDataId(archiveTypeId, type, id, "true"); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @GetMapping({"/getDocumentListByFileTableIdAndFileId/{fileTableId}/{fileId}"}) -/* */ @ResponseBody -/* */ public AjaxResult getDocumentListByFileTableIdAndFileId(@PathVariable("fileTableId") String fileTableId, @PathVariable("fileId") String fileId) { -/* 91 */ List> list = this.iBrowseService.getDocumentListByFileTableIdAndFileId(fileTableId, fileId); -/* 92 */ return AjaxResult.success(list); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @GetMapping({"/getDocumentList/{fileTableId}/{fileId}"}) -/* */ @ResponseBody -/* */ public AjaxResult getDocumentList(@PathVariable("fileTableId") String fileTableId, @PathVariable("fileId") String fileId) { -/* 104 */ List> list = this.iBrowseService.getDocumentList(fileTableId, fileId); -/* 105 */ return AjaxResult.success(list); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @GetMapping({"/getDocument/{documentTableId}/{documentId}"}) -/* */ @ResponseBody -/* */ public Object getDocument(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId, HttpServletRequest request, HttpServletResponse response) { -/* 120 */ FileInputStream fis = null; -/* 121 */ ServletOutputStream ops = null; -/* 122 */ String filepath = this.iBrowseService.getDocumentPath(documentTableId, documentId, "false"); -/* */ try { -/* 124 */ File f = new File(filepath); -/* 125 */ if (f.exists()) { -/* 126 */ System.out.println(filepath + "===cunzai"); -/* 127 */ response.addHeader("Content-Disposition", "attachment;filename=\"" + new String(f.getName().getBytes("UTF-8"), "ISO8859-1") + "\""); -/* 128 */ response.setContentType("application/octet-stream; charset=GBK"); -/* 129 */ response.setHeader("Content-Length", String.valueOf(f.length())); -/* 130 */ response.setHeader("Pragma", "No-cache"); -/* 131 */ response.setHeader("Cache-Control", "No-cache"); -/* 132 */ response.setDateHeader("Expires", 0L); -/* 133 */ fis = new FileInputStream(f); -/* 134 */ ops = response.getOutputStream(); -/* 135 */ byte[] bf = new byte[1024]; -/* 136 */ int rl = fis.read(bf); -/* 137 */ while (rl > 0) { -/* 138 */ ops.write(bf, 0, rl); -/* 139 */ rl = fis.read(bf); -/* */ } -/* 141 */ ops.flush(); -/* 142 */ ops.close(); -/* 143 */ fis.close(); -/* */ } else { -/* 145 */ System.out.println(filepath + "===bucunzai"); -/* 146 */ response.sendRedirect("common/404.jsp"); -/* */ } -/* 148 */ } catch (Exception e) { -/* 149 */ e.printStackTrace(); -/* */ } finally { -/* */ try { -/* 152 */ if (fis != null) -/* 153 */ { + import com.archive.framework.web.controller.BaseController; + import com.archive.framework.web.domain.AjaxResult; + import com.archive.project.browse.service.IBrowseService; + import com.archive.project.dajs.jsgl.service.IJsglService; + import com.archive.project.dasz.ccgl.service.ICcglService; + import com.archive.project.system.config.service.IConfigService; + import java.io.File; + import java.io.FileInputStream; + import java.io.IOException; + import java.util.ArrayList; + import java.util.HashMap; + import java.util.List; + import java.util.Map; + import javax.servlet.ServletOutputStream; + import javax.servlet.http.HttpServletRequest; + import javax.servlet.http.HttpServletResponse; + 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.RequestMapping; + import org.springframework.web.bind.annotation.RequestMethod; + import org.springframework.web.bind.annotation.ResponseBody; + + @Controller + @RequestMapping({"/browse"}) + public class BrowseController extends BaseController { + private String prefix = "browse"; + + @Autowired + private IConfigService configService; + + @Autowired + private IJsglService jsglService; + + @Autowired + private IBrowseService iBrowseService; + + @Autowired + private ICcglService ccglService; + + @Autowired + private ArchiveConfig archiveConfig; + + @GetMapping({"/browse/{archiveId}/{id}"}) + public String browse(@PathVariable("archiveId") long archiveId, @PathVariable("id") String id, ModelMap mmap) { + long tableId = TableUtil.getTableIdByArchiveTypeId(archiveId); + mmap.put("archiveTypeId", Long.valueOf(archiveId)); + mmap.put("tableId", Long.valueOf(tableId)); + mmap.put("id", id); + boolean browseServerEnabled = this.archiveConfig.isBrowseServerEnabled(); + + if (browseServerEnabled) { + return this.prefix + "/browse"; + } + return this.prefix + "/browsesimple"; + } + + + + + + + + + + + @GetMapping({"/appendAddForm/{archiveTypeId}/{type}/{id}"}) + @ResponseBody + public String appendAddForm(@PathVariable("archiveTypeId") String archiveTypeId, @PathVariable("type") String type, @PathVariable("id") String id) { + return this.jsglService.appendAddFormByDataId(archiveTypeId, type, id, "true"); + } + + + + + + + + @GetMapping({"/getDocumentListByFileTableIdAndFileId/{fileTableId}/{fileId}"}) + @ResponseBody + public AjaxResult getDocumentListByFileTableIdAndFileId(@PathVariable("fileTableId") String fileTableId, @PathVariable("fileId") String fileId) { + List> list = this.iBrowseService.getDocumentListByFileTableIdAndFileId(fileTableId, fileId); + return AjaxResult.success(list); + } + + + + + + + + @GetMapping({"/getDocumentList/{fileTableId}/{fileId}"}) + @ResponseBody + public AjaxResult getDocumentList(@PathVariable("fileTableId") String fileTableId, @PathVariable("fileId") String fileId) { + List> list = this.iBrowseService.getDocumentList(fileTableId, fileId); + return AjaxResult.success(list); + } + + + + + + + + + + + @GetMapping({"/getDocument/{documentTableId}/{documentId}"}) + @ResponseBody + public Object getDocument(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId, HttpServletRequest request, HttpServletResponse response) { + FileInputStream fis = null; + ServletOutputStream ops = null; + String filepath = this.iBrowseService.getDocumentPath(documentTableId, documentId, "false"); + try { + File f = new File(filepath); + if (f.exists()) { + System.out.println(filepath + "===cunzai"); + response.addHeader("Content-Disposition", "attachment;filename=\"" + new String(f.getName().getBytes("UTF-8"), "ISO8859-1") + "\""); + response.setContentType("application/octet-stream; charset=GBK"); + response.setHeader("Content-Length", String.valueOf(f.length())); + response.setHeader("Pragma", "No-cache"); + response.setHeader("Cache-Control", "No-cache"); + response.setDateHeader("Expires", 0L); + fis = new FileInputStream(f); + ops = response.getOutputStream(); + byte[] bf = new byte[1024]; + int rl = fis.read(bf); + while (rl > 0) { + ops.write(bf, 0, rl); + rl = fis.read(bf); + } + ops.flush(); + ops.close(); + fis.close(); + } else { + System.out.println(filepath + "===bucunzai"); + response.sendRedirect("common/404.jsp"); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + if (fis != null) + { fis.close(); } -/* 154 */ if (ops != null) -/* 155 */ { + if (ops != null) + { ops.close(); } -/* 156 */ } catch (Exception e) { -/* 157 */ fis = null; -/* 158 */ ops = null; -/* */ } -/* */ } -/* 161 */ return null; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @GetMapping({"/FileOcr/{documentTableId}/{documentId}"}) -/* */ @ResponseBody -/* */ public AjaxResult FileOcr(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId) { -/* 174 */ String filepath = this.iBrowseService.getDocumentPath(documentTableId, documentId, "false"); -/* 175 */ String result2 = ""; -/* 176 */ String pdfSpiltImagePath = this.ccglService.getPathByLjbs("archive.pdfSpiltImagePath"); -/* */ try { -/* 178 */ String filepath1 = filepath.toLowerCase(); -/* 179 */ if (filepath1.contains(".jpg") || filepath1.contains(".png") || filepath1.contains(".gif") || filepath1.contains(".jpeg") || filepath1.contains(".tif")) { -/* 180 */ result2 = ImageOcr.ImageOcr(filepath); -/* 181 */ } else if (filepath1.contains(".pdf")) { -/* */ -/* 183 */ result2 = PdfOcr.getTextFromPdf(filepath, pdfSpiltImagePath); -/* 184 */ } else if (filepath1.contains(".ofd")) { -/* */ -/* 186 */ result2 = ""; -/* */ } -/* 188 */ } catch (Exception e) { -/* 189 */ System.out.println(e.getMessage()); -/* */ } -/* 191 */ return AjaxResult.success(result2); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @GetMapping({"/metaData/{documentTableId}/{documentId}"}) -/* */ public String metaData(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId, ModelMap mmap) { -/* 203 */ mmap.put("documentTableId", documentTableId); -/* 204 */ mmap.put("documentId", documentId); -/* 205 */ return this.prefix + "/metadata"; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @GetMapping({"/metaDataForm/{documentTableId}/{documentId}"}) -/* */ @ResponseBody -/* */ public String metaDataForm(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId, ModelMap mmap) { -/* 218 */ String filepath = this.iBrowseService.getDocumentPath(documentTableId, documentId, "false"); -/* 219 */ List> list = MetadataUtil.getMetadataAllByFile(filepath); -/* 220 */ StringBuilder html = new StringBuilder(); -/* 221 */ for (int i = 1; i <= list.size(); i++) { -/* */ -/* 223 */ if (i % 2 != 0) { -/* 224 */ html.append("
"); -/* */ } -/* */ -/* 227 */ 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
"); -/* */ -/* */ -/* */ -/* */ -/* */ -/* 237 */ if (i % 2 == 0 || i == list.size()) { -/* 238 */ html.append("
"); -/* */ } -/* */ } -/* 241 */ return html.toString(); -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @GetMapping({"/getPreviewUrl/{docTableId}/{docId}"}) -/* */ @ResponseBody -/* */ public Map getPreviewUrl(HttpServletRequest request, @PathVariable("docTableId") String docTableId, @PathVariable("docId") String docId) { -/* 254 */ Map map = new HashMap<>(); -/* 255 */ String originUrl = ""; -/* 256 */ String fileName = this.iBrowseService.getFileName(docTableId, docId); -/* 257 */ if (StringUtils.isNotEmpty(fileName)) { -/* 258 */ StringBuffer url = request.getRequestURL(); -/* 259 */ originUrl = url.toString(); -/* 260 */ originUrl = originUrl.substring(0, originUrl.indexOf("getPreviewUrl")); -/* 261 */ originUrl = originUrl + "browseDocument?docTableId=" + docTableId + "&docId=" + docId + "&fullfilename=" + fileName; -/* */ } -/* */ -/* 264 */ String browseServer = this.archiveConfig.getBrowseServer(); -/* 265 */ if (StringUtils.isNotEmpty(browseServer)) { -/* 266 */ boolean flag = HttpUtils.urlWhetherReachable(browseServer, 2000); -/* 267 */ if (flag) { -/* 268 */ if (browseServer.endsWith("/")) { -/* 269 */ browseServer = browseServer + "onlinePreview?url="; -/* */ } else { -/* 271 */ browseServer = browseServer + "/onlinePreview?url="; -/* */ } -/* */ } else { -/* 274 */ browseServer = ""; -/* */ } -/* */ } -/* 277 */ map.put("originUrl", originUrl); -/* 278 */ map.put("browseServer", browseServer); -/* 279 */ return map; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @RequestMapping(value = {"/browseDocument"}, method = {RequestMethod.GET}) -/* */ public void browseDocument(HttpServletRequest request, HttpServletResponse response) { -/* 289 */ String docTableId = request.getParameter("docTableId"); -/* 290 */ String docId = request.getParameter("docId"); -/* 291 */ String filePath = this.iBrowseService.getDocumentFilePath(docTableId, docId); -/* 292 */ File file = new File(filePath); -/* 293 */ if (file.exists()) { -/* 294 */ byte[] data = null; -/* 295 */ FileInputStream input = null; -/* */ try { -/* 297 */ input = new FileInputStream(file); -/* 298 */ data = new byte[input.available()]; -/* 299 */ input.read(data); -/* 300 */ response.getOutputStream().write(data); -/* 301 */ } catch (Exception e) { -/* 302 */ e.printStackTrace(); -/* */ } finally { -/* */ try { -/* 305 */ if (input != null) { -/* 306 */ input.close(); -/* */ } -/* 308 */ } catch (IOException e) { -/* 309 */ e.printStackTrace(); -/* */ } -/* */ } -/* */ } -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @GetMapping({"/getMetaData/{documentTableId}/{documentId}"}) -/* */ @ResponseBody -/* */ public AjaxResult getMetaData(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId) { -/* 324 */ String filepath = this.iBrowseService.getDocumentPath(documentTableId, documentId, "false"); -/* 325 */ List> list = new ArrayList<>(); -/* */ try { -/* 327 */ list = MetadataUtil.getMetadataAllByFile(filepath); -/* 328 */ } catch (Exception e) { -/* 329 */ e.printStackTrace(); -/* */ } -/* 331 */ return AjaxResult.success(list); -/* */ } -/* */ } + } catch (Exception e) { + fis = null; + ops = null; + } + } + return null; + } + + + + + + + + + @GetMapping({"/FileOcr/{documentTableId}/{documentId}"}) + @ResponseBody + public AjaxResult FileOcr(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId) { + String filepath = this.iBrowseService.getDocumentPath(documentTableId, documentId, "false"); + String result2 = ""; + String pdfSpiltImagePath = this.ccglService.getPathByLjbs("archive.pdfSpiltImagePath"); + try { + String filepath1 = filepath.toLowerCase(); + if (filepath1.contains(".jpg") || filepath1.contains(".png") || filepath1.contains(".gif") || filepath1.contains(".jpeg") || filepath1.contains(".tif")) { + result2 = ImageOcr.ImageOcr(filepath); + } else if (filepath1.contains(".pdf")) { + + result2 = PdfOcr.getTextFromPdf(filepath, pdfSpiltImagePath); + } else if (filepath1.contains(".ofd")) { + + result2 = ""; + } + } catch (Exception e) { + System.out.println(e.getMessage()); + } + return AjaxResult.success(result2); + } + + + + + + + + + @GetMapping({"/metaData/{documentTableId}/{documentId}"}) + public String metaData(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId, ModelMap mmap) { + mmap.put("documentTableId", documentTableId); + mmap.put("documentId", documentId); + return this.prefix + "/metadata"; + } + + + + + + + + + @GetMapping({"/metaDataForm/{documentTableId}/{documentId}"}) + @ResponseBody + public String metaDataForm(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId, ModelMap mmap) { + String filepath = this.iBrowseService.getDocumentPath(documentTableId, documentId, "false"); + List> list = MetadataUtil.getMetadataAllByFile(filepath); + StringBuilder html = new StringBuilder(); + for (int i = 1; i <= list.size(); i++) { + + if (i % 2 != 0) { + html.append("
"); + } + + 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 == list.size()) { + html.append("
"); + } + } + return html.toString(); + } + + + + + + + + + @GetMapping({"/getPreviewUrl/{docTableId}/{docId}"}) + @ResponseBody + public Map getPreviewUrl(HttpServletRequest request, @PathVariable("docTableId") String docTableId, @PathVariable("docId") String docId) { + Map map = new HashMap<>(); + String originUrl = ""; + String fileName = this.iBrowseService.getFileName(docTableId, docId); + if (StringUtils.isNotEmpty(fileName)) { + StringBuffer url = request.getRequestURL(); + originUrl = url.toString(); + originUrl = originUrl.substring(0, originUrl.indexOf("getPreviewUrl")); + originUrl = originUrl + "browseDocument?docTableId=" + docTableId + "&docId=" + docId + "&fullfilename=" + fileName; + } + + String browseServer = this.archiveConfig.getBrowseServer(); + if (StringUtils.isNotEmpty(browseServer)) { + boolean flag = HttpUtils.urlWhetherReachable(browseServer, 2000); + if (flag) { + if (browseServer.endsWith("/")) { + browseServer = browseServer + "onlinePreview?url="; + } else { + browseServer = browseServer + "/onlinePreview?url="; + } + } else { + browseServer = ""; + } + } + map.put("originUrl", originUrl); + map.put("browseServer", browseServer); + return map; + } + + + + + + + @RequestMapping(value = {"/browseDocument"}, method = {RequestMethod.GET}) + public void browseDocument(HttpServletRequest request, HttpServletResponse response) { + String docTableId = request.getParameter("docTableId"); + String docId = request.getParameter("docId"); + String filePath = this.iBrowseService.getDocumentFilePath(docTableId, docId); + File file = new File(filePath); + if (file.exists()) { + byte[] data = null; + FileInputStream input = null; + try { + input = new FileInputStream(file); + data = new byte[input.available()]; + input.read(data); + response.getOutputStream().write(data); + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + if (input != null) { + input.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + } + + + + + + + + @GetMapping({"/getMetaData/{documentTableId}/{documentId}"}) + @ResponseBody + public AjaxResult getMetaData(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId) { + String filepath = this.iBrowseService.getDocumentPath(documentTableId, documentId, "false"); + List> list = new ArrayList<>(); + try { + list = MetadataUtil.getMetadataAllByFile(filepath); + } catch (Exception e) { + e.printStackTrace(); + } + return AjaxResult.success(list); + } + } /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\browse\controller\BrowseController.class diff --git a/src/main/java/com/archive/project/browse/service/impl/BrowseServiceImpl.java b/src/main/java/com/archive/project/browse/service/impl/BrowseServiceImpl.java index 199371e..4a1127c 100644 --- a/src/main/java/com/archive/project/browse/service/impl/BrowseServiceImpl.java +++ b/src/main/java/com/archive/project/browse/service/impl/BrowseServiceImpl.java @@ -1,234 +1,234 @@ -/* */ package com.archive.project.browse.service.impl + package com.archive.project.browse.service.impl ; -/* */ -/* */ import com.archive.common.archiveUtil.PdfWaterMarkUtil; -/* */ import com.archive.common.archiveUtil.TableUtil; -/* */ import com.archive.common.utils.StringUtils; -/* */ import com.archive.project.browse.service.IBrowseService; -/* */ import com.archive.project.common.service.IExecuteSqlService; -/* */ import com.archive.project.dajs.archiveimportbatch.service.IArchiveImportBatchService; -/* */ import com.archive.project.dasz.physicaltable.mapper.PhysicalTableMapper; -/* */ import com.archive.project.dasz.physicaltablecolumn.mapper.PhysicalTableColumnMapper; -/* */ import com.archive.project.system.config.service.IConfigService; -/* */ import com.archive.project.system.dict.service.IDictTypeService; -/* */ import java.io.File; -/* */ import java.util.ArrayList; -/* */ import java.util.HashMap; -/* */ import java.util.LinkedHashMap; -/* */ import java.util.List; -/* */ import java.util.Map; -/* */ import org.apache.commons.io.FilenameUtils; -/* */ import org.springframework.beans.factory.annotation.Autowired; -/* */ import org.springframework.stereotype.Service; -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @Service -/* */ public class BrowseServiceImpl -/* */ implements IBrowseService -/* */ { -/* */ @Autowired -/* */ private PhysicalTableMapper physicalTableMapper; -/* */ @Autowired -/* */ private PhysicalTableColumnMapper physicalTableColumnMapper; -/* */ @Autowired -/* */ private IExecuteSqlService executeSqlService; -/* */ @Autowired -/* */ private IConfigService configService; -/* */ @Autowired -/* */ private IDictTypeService dictTypeService; -/* */ @Autowired -/* */ private IArchiveImportBatchService archiveImportBatchService; -/* */ -/* */ public List> getDocumentListByFileTableIdAndFileId(String fileTableId, String fileId) { -/* 58 */ List> list = new ArrayList<>(); -/* 59 */ String fileTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(fileTableId))); -/* */ -/* 61 */ String docTableName = fileTableName.toLowerCase().replace("_file", "_document"); -/* 62 */ docTableName = docTableName.toLowerCase().replace("_folder", "_document"); -/* 63 */ String docTableId = TableUtil.getTableId(docTableName); -/* 64 */ String sql = "select filehz,id,filename from " + docTableName + " where ownerid=" + fileId; -/* 65 */ List> doclist = this.executeSqlService.queryList(sql); -/* 66 */ for (int i = 0; i < doclist.size(); i++) { -/* 67 */ if (doclist.get(i) != null) { -/* 68 */ String docId = (((LinkedHashMap)doclist.get(i)).get("id") == null) ? "" : ((LinkedHashMap)doclist.get(i)).get("id").toString(); -/* 69 */ String dochz = (((LinkedHashMap)doclist.get(i)).get("filehz") == null) ? "" : ((LinkedHashMap)doclist.get(i)).get("filehz").toString(); -/* 70 */ String docName = (((LinkedHashMap)doclist.get(i)).get("filename") == null) ? "" : ((LinkedHashMap)doclist.get(i)).get("filename").toString(); -/* 71 */ if (!docId.equals("")) { -/* 72 */ Map map = new HashMap<>(); -/* 73 */ map.put("docId", docId); -/* 74 */ map.put("dochz", dochz.toLowerCase()); -/* 75 */ map.put("docName", docName); -/* 76 */ map.put("docTableId", docTableId); -/* 77 */ list.add(map); -/* */ } -/* */ } -/* */ } -/* 81 */ return list; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public List> getDocumentList(String fileTableId, String fileId) { -/* 91 */ List> list = new ArrayList<>(); -/* 92 */ String fileTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(fileTableId))); -/* */ -/* 94 */ String docTableName = fileTableName.toLowerCase().replace("_file", "_document"); -/* 95 */ docTableName = docTableName.toLowerCase().replace("_folder", "_document"); -/* 96 */ String docTableId = TableUtil.getTableId(docTableName); -/* 97 */ String sql = "select filehz, id, filename from " + docTableName + " where ownerid = " + fileId; -/* 98 */ List> doclist = this.executeSqlService.queryList(sql); -/* 99 */ for (int i = 0; i < doclist.size(); i++) { -/* 100 */ if (doclist.get(i) != null) { -/* 101 */ String docId = (((LinkedHashMap)doclist.get(i)).get("id") == null) ? "" : ((LinkedHashMap)doclist.get(i)).get("id").toString(); -/* 102 */ String dochz = (((LinkedHashMap)doclist.get(i)).get("filehz") == null) ? "" : ((LinkedHashMap)doclist.get(i)).get("filehz").toString(); -/* 103 */ String docName = (((LinkedHashMap)doclist.get(i)).get("filename") == null) ? "" : ((LinkedHashMap)doclist.get(i)).get("filename").toString(); -/* 104 */ if (!docId.equals("")) { -/* 105 */ Map map = new HashMap<>(); -/* 106 */ map.put("docId", docId); -/* 107 */ map.put("dochz", dochz.toLowerCase()); -/* 108 */ map.put("docName", docName); -/* 109 */ map.put("docTableId", docTableId); -/* 110 */ list.add(map); -/* */ } -/* */ } -/* */ } -/* 114 */ return list; -/* */ } -/* */ -/* */ -/* */ public String getFileName(String docTableId, String docId) { -/* 119 */ String fileName = ""; -/* 120 */ String docTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(docTableId))); -/* 121 */ String sql = "select filepath from " + docTableName + " where id = " + docId; -/* 122 */ String filePath = this.executeSqlService.getSingle(sql); -/* 123 */ if (StringUtils.isNotEmpty(filePath)) { -/* 124 */ File file = new File(filePath); -/* 125 */ if (file.exists()) { -/* 126 */ fileName = FilenameUtils.getName(filePath); -/* */ } -/* */ } -/* 129 */ return fileName; -/* */ } -/* */ -/* */ -/* */ public String getDocumentFilePath(String docTableId, String docId) { -/* 134 */ String filePath = ""; -/* 135 */ String docTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(docTableId))); -/* 136 */ String sql = "select filepath from " + docTableName + " where id = " + docId; -/* 137 */ filePath = this.executeSqlService.getSingle(sql); -/* 138 */ return filePath; -/* */ } -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ public String getDocumentPath(String documentTableId, String documentId, String iswater) { -/* 152 */ String path = ""; -/* 153 */ String DocTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(documentTableId))); -/* 154 */ if (iswater.equals("true")) { -/* */ -/* 156 */ String sql = "select filewaterpath,filepath from " + DocTableName + " where id=" + documentId; -/* 157 */ LinkedHashMap data = this.executeSqlService.getOne(sql); -/* 158 */ if (data != null && data.size() > 0) { -/* 159 */ String waterpath = (data.get("filewaterpath") == null) ? "" : data.get("filewaterpath").toString(); -/* 160 */ String filepath = (data.get("filepath") == null) ? "" : data.get("filepath").toString(); -/* 161 */ if (!waterpath.equals("")) { -/* 162 */ path = waterpath; -/* */ } else { -/* 164 */ File yfile = new File(filepath); -/* 165 */ String yfileName = yfile.getName().substring(0, yfile.getName().lastIndexOf(".")); -/* 166 */ String yhz = yfile.getName().substring(yfile.getName().lastIndexOf(".") + 1); -/* 167 */ if (yfile.exists()) { -/* 168 */ String newFileName = yfileName + "_water"; -/* 169 */ String newFilePath = yfile.getPath().replace(yfileName, newFileName); -/* */ -/* 171 */ String waterType = this.configService.selectConfigByKey("archive.waterMarkType"); -/* 172 */ if (waterType.equals("1")) { -/* 173 */ String waterText = this.configService.selectConfigByKey("archive.waterMarkText"); -/* 174 */ if (waterText != null && !waterText.equals("")) { -/* 175 */ if (yhz.toLowerCase().equals("pdf")) { -/* 176 */ PdfWaterMarkUtil.waterMarkforWriting(filepath, newFilePath, waterText, Integer.valueOf(45), 1.0F, 10); -/* */ -/* 178 */ String updatSql = "update " + DocTableName + " set filewaterpath='" + newFilePath + "' where id=" + documentId; -/* 179 */ this.executeSqlService.update(updatSql); -/* */ } else { -/* 181 */ System.out.println("~~~~~其他格式暂时无法添加水印~~~~~~"); -/* 182 */ path = filepath; -/* */ } -/* */ } else { -/* 185 */ System.out.println("~~~~~~~文字水印设置为空,无法生成水印文件~~~~~~~~~"); -/* 186 */ path = filepath; -/* */ } -/* */ } else { -/* 189 */ String waterImagePath = this.configService.selectConfigByKey("archive.waterMarkImage"); -/* 190 */ File file = new File(waterImagePath); -/* 191 */ if (file.exists()) { -/* 192 */ if (yhz.toLowerCase().equals("pdf")) { -/* 193 */ PdfWaterMarkUtil.pressImageWater(filepath, newFilePath, waterImagePath, 100, 100); -/* */ -/* 195 */ String updatSql = "update " + DocTableName + " set filewaterpath='" + newFilePath + "' where id=" + documentId; -/* 196 */ this.executeSqlService.update(updatSql); -/* */ } else { -/* 198 */ System.out.println("~~~~~其他格式暂时无法添加水印~~~~~~"); -/* 199 */ path = filepath; -/* */ } -/* */ } else { -/* 202 */ System.out.println("~~~~~~~图片水印文件不存在,无法生成水印文件~~~~~~~~~"); -/* 203 */ path = filepath; -/* */ } -/* */ } -/* */ } else { -/* 207 */ System.out.println("~~~~~~~原文件不存在,无法生成水印文件~~~~~~~~~"); -/* */ } -/* */ } -/* */ } -/* */ } else { -/* */ -/* 213 */ String sql = "select filepath from " + DocTableName + " where id=" + documentId; -/* 214 */ LinkedHashMap data = this.executeSqlService.getOne(sql); -/* 215 */ if (data != null && data.size() > 0) { -/* 216 */ path = (data.get("filepath") == null) ? "" : data.get("filepath").toString(); -/* */ } -/* */ } -/* 219 */ return path; -/* */ } -/* */ -/* */ -/* */ public static void main(String[] args) { -/* 224 */ File file = new File("D://smdocument.pdf"); -/* 225 */ System.out.println(file.getName().substring(0, file.getName().lastIndexOf("."))); -/* 226 */ System.out.println(file.getName().substring(file.getName().lastIndexOf(".") + 1)); -/* 227 */ System.out.println(file.getPath()); -/* */ } -/* */ } + + import com.archive.common.archiveUtil.PdfWaterMarkUtil; + import com.archive.common.archiveUtil.TableUtil; + import com.archive.common.utils.StringUtils; + import com.archive.project.browse.service.IBrowseService; + import com.archive.project.common.service.IExecuteSqlService; + import com.archive.project.dajs.archiveimportbatch.service.IArchiveImportBatchService; + import com.archive.project.dasz.physicaltable.mapper.PhysicalTableMapper; + import com.archive.project.dasz.physicaltablecolumn.mapper.PhysicalTableColumnMapper; + import com.archive.project.system.config.service.IConfigService; + import com.archive.project.system.dict.service.IDictTypeService; + import java.io.File; + import java.util.ArrayList; + import java.util.HashMap; + import java.util.LinkedHashMap; + import java.util.List; + import java.util.Map; + import org.apache.commons.io.FilenameUtils; + import org.springframework.beans.factory.annotation.Autowired; + import org.springframework.stereotype.Service; + + + + + + + + + + + + + + + + + + + @Service + public class BrowseServiceImpl + implements IBrowseService + { + @Autowired + private PhysicalTableMapper physicalTableMapper; + @Autowired + private PhysicalTableColumnMapper physicalTableColumnMapper; + @Autowired + private IExecuteSqlService executeSqlService; + @Autowired + private IConfigService configService; + @Autowired + private IDictTypeService dictTypeService; + @Autowired + private IArchiveImportBatchService archiveImportBatchService; + + public List> getDocumentListByFileTableIdAndFileId(String fileTableId, String fileId) { + List> list = new ArrayList<>(); + String fileTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(fileTableId))); + + String docTableName = fileTableName.toLowerCase().replace("_file", "_document"); + docTableName = docTableName.toLowerCase().replace("_folder", "_document"); + String docTableId = TableUtil.getTableId(docTableName); + String sql = "select filehz,id,filename from " + docTableName + " where ownerid=" + fileId; + List> doclist = this.executeSqlService.queryList(sql); + for (int i = 0; i < doclist.size(); i++) { + if (doclist.get(i) != null) { + String docId = (((LinkedHashMap)doclist.get(i)).get("id") == null) ? "" : ((LinkedHashMap)doclist.get(i)).get("id").toString(); + String dochz = (((LinkedHashMap)doclist.get(i)).get("filehz") == null) ? "" : ((LinkedHashMap)doclist.get(i)).get("filehz").toString(); + String docName = (((LinkedHashMap)doclist.get(i)).get("filename") == null) ? "" : ((LinkedHashMap)doclist.get(i)).get("filename").toString(); + if (!docId.equals("")) { + Map map = new HashMap<>(); + map.put("docId", docId); + map.put("dochz", dochz.toLowerCase()); + map.put("docName", docName); + map.put("docTableId", docTableId); + list.add(map); + } + } + } + return list; + } + + + + + + + + public List> getDocumentList(String fileTableId, String fileId) { + List> list = new ArrayList<>(); + String fileTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(fileTableId))); + + String docTableName = fileTableName.toLowerCase().replace("_file", "_document"); + docTableName = docTableName.toLowerCase().replace("_folder", "_document"); + String docTableId = TableUtil.getTableId(docTableName); + String sql = "select filehz, id, filename from " + docTableName + " where ownerid = " + fileId; + List> doclist = this.executeSqlService.queryList(sql); + for (int i = 0; i < doclist.size(); i++) { + if (doclist.get(i) != null) { + String docId = (((LinkedHashMap)doclist.get(i)).get("id") == null) ? "" : ((LinkedHashMap)doclist.get(i)).get("id").toString(); + String dochz = (((LinkedHashMap)doclist.get(i)).get("filehz") == null) ? "" : ((LinkedHashMap)doclist.get(i)).get("filehz").toString(); + String docName = (((LinkedHashMap)doclist.get(i)).get("filename") == null) ? "" : ((LinkedHashMap)doclist.get(i)).get("filename").toString(); + if (!docId.equals("")) { + Map map = new HashMap<>(); + map.put("docId", docId); + map.put("dochz", dochz.toLowerCase()); + map.put("docName", docName); + map.put("docTableId", docTableId); + list.add(map); + } + } + } + return list; + } + + + public String getFileName(String docTableId, String docId) { + String fileName = ""; + String docTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(docTableId))); + String sql = "select filepath from " + docTableName + " where id = " + docId; + String filePath = this.executeSqlService.getSingle(sql); + if (StringUtils.isNotEmpty(filePath)) { + File file = new File(filePath); + if (file.exists()) { + fileName = FilenameUtils.getName(filePath); + } + } + return fileName; + } + + + public String getDocumentFilePath(String docTableId, String docId) { + String filePath = ""; + String docTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(docTableId))); + String sql = "select filepath from " + docTableName + " where id = " + docId; + filePath = this.executeSqlService.getSingle(sql); + return filePath; + } + + + + + + + + + + + + public String getDocumentPath(String documentTableId, String documentId, String iswater) { + String path = ""; + String DocTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(documentTableId))); + if (iswater.equals("true")) { + + String sql = "select filewaterpath,filepath from " + DocTableName + " where id=" + documentId; + LinkedHashMap data = this.executeSqlService.getOne(sql); + if (data != null && data.size() > 0) { + String waterpath = (data.get("filewaterpath") == null) ? "" : data.get("filewaterpath").toString(); + String filepath = (data.get("filepath") == null) ? "" : data.get("filepath").toString(); + if (!waterpath.equals("")) { + path = waterpath; + } else { + File yfile = new File(filepath); + String yfileName = yfile.getName().substring(0, yfile.getName().lastIndexOf(".")); + String yhz = yfile.getName().substring(yfile.getName().lastIndexOf(".") + 1); + if (yfile.exists()) { + String newFileName = yfileName + "_water"; + String newFilePath = yfile.getPath().replace(yfileName, newFileName); + + String waterType = this.configService.selectConfigByKey("archive.waterMarkType"); + if (waterType.equals("1")) { + String waterText = this.configService.selectConfigByKey("archive.waterMarkText"); + if (waterText != null && !waterText.equals("")) { + if (yhz.toLowerCase().equals("pdf")) { + PdfWaterMarkUtil.waterMarkforWriting(filepath, newFilePath, waterText, Integer.valueOf(45), 1.0F, 10); + + String updatSql = "update " + DocTableName + " set filewaterpath='" + newFilePath + "' where id=" + documentId; + this.executeSqlService.update(updatSql); + } else { + System.out.println("~~~~~其他格式暂时无法添加水印~~~~~~"); + path = filepath; + } + } else { + System.out.println("~~~~~~~文字水印设置为空,无法生成水印文件~~~~~~~~~"); + path = filepath; + } + } else { + String waterImagePath = this.configService.selectConfigByKey("archive.waterMarkImage"); + File file = new File(waterImagePath); + if (file.exists()) { + if (yhz.toLowerCase().equals("pdf")) { + PdfWaterMarkUtil.pressImageWater(filepath, newFilePath, waterImagePath, 100, 100); + + String updatSql = "update " + DocTableName + " set filewaterpath='" + newFilePath + "' where id=" + documentId; + this.executeSqlService.update(updatSql); + } else { + System.out.println("~~~~~其他格式暂时无法添加水印~~~~~~"); + path = filepath; + } + } else { + System.out.println("~~~~~~~图片水印文件不存在,无法生成水印文件~~~~~~~~~"); + path = filepath; + } + } + } else { + System.out.println("~~~~~~~原文件不存在,无法生成水印文件~~~~~~~~~"); + } + } + } + } else { + + String sql = "select filepath from " + DocTableName + " where id=" + documentId; + LinkedHashMap data = this.executeSqlService.getOne(sql); + if (data != null && data.size() > 0) { + path = (data.get("filepath") == null) ? "" : data.get("filepath").toString(); + } + } + return path; + } + + + public static void main(String[] args) { + File file = new File("D://smdocument.pdf"); + System.out.println(file.getName().substring(0, file.getName().lastIndexOf("."))); + System.out.println(file.getName().substring(file.getName().lastIndexOf(".") + 1)); + System.out.println(file.getPath()); + } + } /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\browse\service\impl\BrowseServiceImpl.class diff --git a/src/main/java/com/archive/project/tool/build/BuildController.java b/src/main/java/com/archive/project/tool/build/BuildController.java index dd9de84..2e0a6ef 100644 --- a/src/main/java/com/archive/project/tool/build/BuildController.java +++ b/src/main/java/com/archive/project/tool/build/BuildController.java @@ -1,31 +1,31 @@ -/* */ package com.archive.project.tool.build + package com.archive.project.tool.build ; -/* */ -/* */ import com.archive.framework.web.controller.BaseController; -/* */ import org.apache.shiro.authz.annotation.RequiresPermissions; -/* */ import org.springframework.stereotype.Controller; -/* */ import org.springframework.web.bind.annotation.GetMapping; -/* */ import org.springframework.web.bind.annotation.RequestMapping; -/* */ -/* */ -/* */ -/* */ -/* */ -/* */ @Controller -/* */ @RequestMapping({"/tool/build"}) -/* */ public class BuildController -/* */ extends BaseController -/* */ { -/* 18 */ private String prefix = "tool/build"; -/* */ -/* */ -/* */ @RequiresPermissions({"tool:build:view"}) -/* */ @GetMapping -/* */ public String build() { -/* 24 */ return this.prefix + "/build"; -/* */ } -/* */ } + + import com.archive.framework.web.controller.BaseController; + import org.apache.shiro.authz.annotation.RequiresPermissions; + import org.springframework.stereotype.Controller; + import org.springframework.web.bind.annotation.GetMapping; + import org.springframework.web.bind.annotation.RequestMapping; + + + + + + @Controller + @RequestMapping({"/tool/build"}) + public class BuildController + extends BaseController + { + private String prefix = "tool/build"; + + + @RequiresPermissions({"tool:build:view"}) + @GetMapping + public String build() { + return this.prefix + "/build"; + } + } /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\tool\build\BuildController.class