feat:修改文件发送传输

dev
wangxy 8 months ago
parent 3738ff2610
commit a54694671a

@ -1,106 +1,106 @@
/* */ package com.archive.common.exception.base; package com.archive.common.exception.base;
/* */
/* */ import com.archive.common.utils.MessageUtils; import com.archive.common.utils.MessageUtils;
/* */ import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class BaseException public class BaseException
/* */ extends RuntimeException extends RuntimeException
/* */ { {
/* */ private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/* */ private String module; private String module;
/* */ private String code; private String code;
/* */ private Object[] args; private Object[] args;
/* */ private String defaultMessage; private String defaultMessage;
/* */
/* */ public BaseException(String module, String code, Object[] args, String defaultMessage) { public BaseException(String module, String code, Object[] args, String defaultMessage) {
/* 37 */ this.module = module; this.module = module;
/* 38 */ this.code = code; this.code = code;
/* 39 */ this.args = args; this.args = args;
/* 40 */ this.defaultMessage = defaultMessage; this.defaultMessage = defaultMessage;
/* */ } }
/* */
/* */
/* */ public BaseException(String module, String code, Object[] args) { public BaseException(String module, String code, Object[] args) {
/* 45 */ this(module, code, args, null); this(module, code, args, null);
/* */ } }
/* */
/* */
/* */ public BaseException(String module, String defaultMessage) { public BaseException(String module, String defaultMessage) {
/* 50 */ this(module, null, null, defaultMessage); this(module, null, null, defaultMessage);
/* */ } }
/* */
/* */
/* */ public BaseException(String code, Object[] args) { public BaseException(String code, Object[] args) {
/* 55 */ this(null, code, args, null); this(null, code, args, null);
/* */ } }
/* */
/* */
/* */ public BaseException(String defaultMessage) { public BaseException(String defaultMessage) {
/* 60 */ this(null, null, null, defaultMessage); this(null, null, null, defaultMessage);
/* */ } }
/* */
/* */
/* */
/* */ public String getMessage() { public String getMessage() {
/* 66 */ String message = null; String message = null;
/* 67 */ if (!StringUtils.isEmpty(this.code)) if (!StringUtils.isEmpty(this.code))
/* */ { {
/* 69 */ message = MessageUtils.message(this.code, this.args); message = MessageUtils.message(this.code, this.args);
/* */ } }
/* 71 */ if (message == null) if (message == null)
/* */ { {
/* 73 */ message = this.defaultMessage; message = this.defaultMessage;
/* */ } }
/* 75 */ return message; return message;
/* */ } }
/* */
/* */
/* */ public String getModule() { public String getModule() {
/* 80 */ return this.module; return this.module;
/* */ } }
/* */
/* */
/* */ public String getCode() { public String getCode() {
/* 85 */ return this.code; return this.code;
/* */ } }
/* */
/* */
/* */ public Object[] getArgs() { public Object[] getArgs() {
/* 90 */ return this.args; return this.args;
/* */ } }
/* */
/* */
/* */ public String getDefaultMessage() { public String getDefaultMessage() {
/* 95 */ return this.defaultMessage; return this.defaultMessage;
/* */ } }
/* */
/* */
/* */
/* */ public String toString() { public String toString() {
/* 101 */ return getClass() + "{module='" + this.module + '\'' + ", message='" + getMessage() + '\'' + '}'; 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 /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\exception\base\BaseException.class

@ -1,119 +1,119 @@
/* */ package com.archive.common.utils package com.archive.common.utils
; ;
/* */
/* */ import java.math.BigDecimal; import java.math.BigDecimal;
/* */ import java.math.RoundingMode; import java.math.RoundingMode;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class Arith public class Arith
/* */ { {
/* */ private static final int DEF_DIV_SCALE = 10; private static final int DEF_DIV_SCALE = 10;
/* */
/* */ public static double add(double v1, double v2) { public static double add(double v1, double v2) {
/* 30 */ BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b1 = new BigDecimal(Double.toString(v1));
/* 31 */ BigDecimal b2 = new BigDecimal(Double.toString(v2)); BigDecimal b2 = new BigDecimal(Double.toString(v2));
/* 32 */ return b1.add(b2).doubleValue(); return b1.add(b2).doubleValue();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static double sub(double v1, double v2) { public static double sub(double v1, double v2) {
/* 43 */ BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b1 = new BigDecimal(Double.toString(v1));
/* 44 */ BigDecimal b2 = new BigDecimal(Double.toString(v2)); BigDecimal b2 = new BigDecimal(Double.toString(v2));
/* 45 */ return b1.subtract(b2).doubleValue(); return b1.subtract(b2).doubleValue();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static double mul(double v1, double v2) { public static double mul(double v1, double v2) {
/* 56 */ BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b1 = new BigDecimal(Double.toString(v1));
/* 57 */ BigDecimal b2 = new BigDecimal(Double.toString(v2)); BigDecimal b2 = new BigDecimal(Double.toString(v2));
/* 58 */ return b1.multiply(b2).doubleValue(); return b1.multiply(b2).doubleValue();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static double div(double v1, double v2) { public static double div(double v1, double v2) {
/* 70 */ return div(v1, v2, 10); return div(v1, v2, 10);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static double div(double v1, double v2, int scale) { public static double div(double v1, double v2, int scale) {
/* 83 */ if (scale < 0) if (scale < 0)
/* */ { {
/* 85 */ throw new IllegalArgumentException("The scale must be a positive integer or zero"); throw new IllegalArgumentException("The scale must be a positive integer or zero");
/* */ } }
/* */
/* 88 */ BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b1 = new BigDecimal(Double.toString(v1));
/* 89 */ BigDecimal b2 = new BigDecimal(Double.toString(v2)); BigDecimal b2 = new BigDecimal(Double.toString(v2));
/* 90 */ if (b1.compareTo(BigDecimal.ZERO) == 0) if (b1.compareTo(BigDecimal.ZERO) == 0)
/* */ { {
/* 92 */ return BigDecimal.ZERO.doubleValue(); return BigDecimal.ZERO.doubleValue();
/* */ } }
/* 94 */ return b1.divide(b2, scale, RoundingMode.HALF_UP).doubleValue(); return b1.divide(b2, scale, RoundingMode.HALF_UP).doubleValue();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static double round(double v, int scale) { public static double round(double v, int scale) {
/* 105 */ if (scale < 0) if (scale < 0)
/* */ { {
/* 107 */ throw new IllegalArgumentException("The scale must be a positive integer or zero"); throw new IllegalArgumentException("The scale must be a positive integer or zero");
/* */ } }
/* */
/* 110 */ BigDecimal b = new BigDecimal(Double.toString(v)); BigDecimal b = new BigDecimal(Double.toString(v));
/* 111 */ BigDecimal one = new BigDecimal("1"); BigDecimal one = new BigDecimal("1");
/* 112 */ return b.divide(one, scale, RoundingMode.HALF_UP).doubleValue(); 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 /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\Arith.class

@ -1,113 +1,113 @@
/* */ package com.archive.common.utils.bean; package com.archive.common.utils.bean;
/* */
/* */ import java.lang.reflect.Method; import java.lang.reflect.Method;
/* */ import java.util.ArrayList; import java.util.ArrayList;
/* */ import java.util.List; import java.util.List;
/* */ import java.util.regex.Matcher; import java.util.regex.Matcher;
/* */ import java.util.regex.Pattern; import java.util.regex.Pattern;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class BeanUtils public class BeanUtils
/* */ extends org.springframework.beans.BeanUtils extends org.springframework.beans.BeanUtils
/* */ { {
/* */ private static final int BEAN_METHOD_PROP_INDEX = 3; private static final int BEAN_METHOD_PROP_INDEX = 3;
/* 20 */ private static final Pattern GET_PATTERN = Pattern.compile("get(\\p{javaUpperCase}\\w*)"); 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*)"); private static final Pattern SET_PATTERN = Pattern.compile("set(\\p{javaUpperCase}\\w*)");
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static void copyBeanProp(Object dest, Object src) { public static void copyBeanProp(Object dest, Object src) {
/* */ try { try {
/* 35 */ copyProperties(src, dest); copyProperties(src, dest);
/* */ } }
/* 37 */ catch (Exception e) { catch (Exception e) {
/* */
/* 39 */ e.printStackTrace(); e.printStackTrace();
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static List<Method> getSetterMethods(Object obj) { public static List<Method> getSetterMethods(Object obj) {
/* 52 */ List<Method> setterMethods = new ArrayList<>(); List<Method> setterMethods = new ArrayList<>();
/* */
/* */
/* 55 */ Method[] methods = obj.getClass().getMethods(); Method[] methods = obj.getClass().getMethods();
/* */
/* */
/* */
/* 59 */ for (Method method : methods) { for (Method method : methods) {
/* */
/* 61 */ Matcher m = SET_PATTERN.matcher(method.getName()); Matcher m = SET_PATTERN.matcher(method.getName());
/* 62 */ if (m.matches() && (method.getParameterTypes()).length == 1) if (m.matches() && (method.getParameterTypes()).length == 1)
/* */ { {
/* 64 */ setterMethods.add(method); setterMethods.add(method);
/* */ } }
/* */ } }
/* */
/* 68 */ return setterMethods; return setterMethods;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static List<Method> getGetterMethods(Object obj) { public static List<Method> getGetterMethods(Object obj) {
/* 81 */ List<Method> getterMethods = new ArrayList<>(); List<Method> getterMethods = new ArrayList<>();
/* */
/* 83 */ Method[] methods = obj.getClass().getMethods(); Method[] methods = obj.getClass().getMethods();
/* */
/* 85 */ for (Method method : methods) { for (Method method : methods) {
/* */
/* 87 */ Matcher m = GET_PATTERN.matcher(method.getName()); Matcher m = GET_PATTERN.matcher(method.getName());
/* 88 */ if (m.matches() && (method.getParameterTypes()).length == 0) if (m.matches() && (method.getParameterTypes()).length == 0)
/* */ { {
/* 90 */ getterMethods.add(method); getterMethods.add(method);
/* */ } }
/* */ } }
/* */
/* 94 */ return getterMethods; return getterMethods;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean isMethodPropEquals(String m1, String m2) { public static boolean isMethodPropEquals(String m1, String m2) {
/* 108 */ return m1.substring(3).equals(m2.substring(3)); 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 /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\bean\BeanUtils.class

@ -1,33 +1,33 @@
/* */ package com.archive.common.utils.security; package com.archive.common.utils.security;
/* */
/* */ import com.archive.framework.shiro.realm.UserRealm; import com.archive.framework.shiro.realm.UserRealm;
/* */ import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
/* */ import org.apache.shiro.mgt.RealmSecurityManager; import org.apache.shiro.mgt.RealmSecurityManager;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class AuthorizationUtils public class AuthorizationUtils
/* */ { {
/* */ public static void clearAllCachedAuthorizationInfo() { public static void clearAllCachedAuthorizationInfo() {
/* 19 */ getUserRealm().clearAllCachedAuthorizationInfo(); getUserRealm().clearAllCachedAuthorizationInfo();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public static UserRealm getUserRealm() { public static UserRealm getUserRealm() {
/* 27 */ RealmSecurityManager rsm = (RealmSecurityManager)SecurityUtils.getSecurityManager(); RealmSecurityManager rsm = (RealmSecurityManager)SecurityUtils.getSecurityManager();
/* 28 */ return (UserRealm) rsm.getRealms().iterator().next(); return (UserRealm) rsm.getRealms().iterator().next();
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\security\AuthorizationUtils.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\security\AuthorizationUtils.class

@ -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.Threads;
/* */ import com.archive.common.utils.spring.SpringUtils; import com.archive.common.utils.spring.SpringUtils;
/* */ import java.util.TimerTask; import java.util.TimerTask;
/* */ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledExecutorService;
/* */ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class AsyncManager public class AsyncManager
/* */ { {
/* 19 */ private final int OPERATE_DELAY_TIME = 10; private final int OPERATE_DELAY_TIME = 10;
/* */
/* */
/* */
/* */
/* 24 */ private ScheduledExecutorService executor = (ScheduledExecutorService)SpringUtils.getBean("scheduledExecutorService"); private ScheduledExecutorService executor = (ScheduledExecutorService)SpringUtils.getBean("scheduledExecutorService");
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* 33 */ private static com.archive.framework.manager.AsyncManager me = new com.archive.framework.manager.AsyncManager(); private static com.archive.framework.manager.AsyncManager me = new com.archive.framework.manager.AsyncManager();
/* */
/* */
/* */ public static com.archive.framework.manager.AsyncManager me() { public static com.archive.framework.manager.AsyncManager me() {
/* 37 */ return me; return me;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void execute(TimerTask task) { public void execute(TimerTask task) {
/* 47 */ this.executor.schedule(task, 10L, TimeUnit.MILLISECONDS); this.executor.schedule(task, 10L, TimeUnit.MILLISECONDS);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */ public void shutdown() { public void shutdown() {
/* 55 */ Threads.shutdownAndAwaitTermination(this.executor); Threads.shutdownAndAwaitTermination(this.executor);
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\manager\AsyncManager.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\manager\AsyncManager.class

@ -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.ServletUtils;
/* */ import com.archive.common.utils.security.ShiroUtils; import com.archive.common.utils.security.ShiroUtils;
/* */ import com.archive.project.monitor.online.domain.OnlineSession; import com.archive.project.monitor.online.domain.OnlineSession;
/* */ import com.archive.project.monitor.operlog.domain.OperLog; import com.archive.project.monitor.operlog.domain.OperLog;
/* */ import eu.bitwalker.useragentutils.UserAgent; import eu.bitwalker.useragentutils.UserAgent;
/* */ import java.util.TimerTask; import java.util.TimerTask;
/* */ import org.slf4j.Logger; import org.slf4j.Logger;
/* */ import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class AsyncFactory public class AsyncFactory
/* */ { {
/* 30 */ private static final Logger sys_user_logger = LoggerFactory.getLogger("sys-user"); private static final Logger sys_user_logger = LoggerFactory.getLogger("sys-user");
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static TimerTask syncSessionToDb(OnlineSession session) { public static TimerTask syncSessionToDb(OnlineSession session) {
/* 40 */ return null; return null;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static TimerTask recordOper(OperLog operLog) { public static TimerTask recordOper(OperLog operLog) {
/* 72 */ return null; return null;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static TimerTask recordLogininfor(String username, String status, String message, Object... args) { public static TimerTask recordLogininfor(String username, String status, String message, Object... args) {
/* 95 */ UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent")); UserAgent userAgent = UserAgent.parseUserAgentString(ServletUtils.getRequest().getHeader("User-Agent"));
/* 96 */ String ip = ShiroUtils.getIp(); String ip = ShiroUtils.getIp();
/* 97 */ return null; return null;
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\manager\factory\AsyncFactory.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\manager\factory\AsyncFactory.class

@ -1,119 +1,119 @@
/* */ package com.archive.framework.web.domain package com.archive.framework.web.domain
; ;
/* */
/* */ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
/* */ import com.google.common.collect.Maps; import com.google.common.collect.Maps;
/* */ import java.io.Serializable; import java.io.Serializable;
/* */ import java.util.Date; import java.util.Date;
/* */ import java.util.Map; import java.util.Map;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class BaseEntity public class BaseEntity
/* */ implements Serializable implements Serializable
/* */ { {
/* */ private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/* */ private String searchValue; private String searchValue;
/* */ private String createBy; private String createBy;
/* */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
/* */ private Date createTime; private Date createTime;
/* */ private String updateBy; private String updateBy;
/* */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
/* */ private Date updateTime; private Date updateTime;
/* */ private String remark; private String remark;
/* */ private Map<String, Object> params; private Map<String, Object> params;
/* */
/* */ public String getSearchValue() { public String getSearchValue() {
/* 43 */ return this.searchValue; return this.searchValue;
/* */ } }
/* */
/* */
/* */ public void setSearchValue(String searchValue) { public void setSearchValue(String searchValue) {
/* 48 */ this.searchValue = searchValue; this.searchValue = searchValue;
/* */ } }
/* */
/* */
/* */ public String getCreateBy() { public String getCreateBy() {
/* 53 */ return this.createBy; return this.createBy;
/* */ } }
/* */
/* */
/* */ public void setCreateBy(String createBy) { public void setCreateBy(String createBy) {
/* 58 */ this.createBy = createBy; this.createBy = createBy;
/* */ } }
/* */
/* */
/* */ public Date getCreateTime() { public Date getCreateTime() {
/* 63 */ return this.createTime; return this.createTime;
/* */ } }
/* */
/* */
/* */ public void setCreateTime(Date createTime) { public void setCreateTime(Date createTime) {
/* 68 */ this.createTime = createTime; this.createTime = createTime;
/* */ } }
/* */
/* */
/* */ public String getUpdateBy() { public String getUpdateBy() {
/* 73 */ return this.updateBy; return this.updateBy;
/* */ } }
/* */
/* */
/* */ public void setUpdateBy(String updateBy) { public void setUpdateBy(String updateBy) {
/* 78 */ this.updateBy = updateBy; this.updateBy = updateBy;
/* */ } }
/* */
/* */
/* */ public Date getUpdateTime() { public Date getUpdateTime() {
/* 83 */ return this.updateTime; return this.updateTime;
/* */ } }
/* */
/* */
/* */ public void setUpdateTime(Date updateTime) { public void setUpdateTime(Date updateTime) {
/* 88 */ this.updateTime = updateTime; this.updateTime = updateTime;
/* */ } }
/* */
/* */
/* */ public String getRemark() { public String getRemark() {
/* 93 */ return this.remark; return this.remark;
/* */ } }
/* */
/* */
/* */ public void setRemark(String remark) { public void setRemark(String remark) {
/* 98 */ this.remark = remark; this.remark = remark;
/* */ } }
/* */
/* */
/* */ public Map<String, Object> getParams() { public Map<String, Object> getParams() {
/* 103 */ if (this.params == null) if (this.params == null)
/* */ { {
/* 105 */ this.params = Maps.newHashMap(); this.params = Maps.newHashMap();
/* */ } }
/* 107 */ return this.params; return this.params;
/* */ } }
/* */
/* */
/* */ public void setParams(Map<String, Object> params) { public void setParams(Map<String, Object> params) {
/* 112 */ this.params = params; this.params = params;
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\web\domain\BaseEntity.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\web\domain\BaseEntity.class

@ -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.MetadataUtil;
/* */ import com.archive.common.archiveUtil.TableUtil; import com.archive.common.archiveUtil.TableUtil;
/* */ import com.archive.common.ocr.ImageOcr; import com.archive.common.ocr.ImageOcr;
/* */ import com.archive.common.ocr.PdfOcr; import com.archive.common.ocr.PdfOcr;
/* */ import com.archive.common.utils.StringUtils; import com.archive.common.utils.StringUtils;
/* */ import com.archive.common.utils.http.HttpUtils; import com.archive.common.utils.http.HttpUtils;
import com.archive.framework.config.ArchiveConfig; import com.archive.framework.config.ArchiveConfig;
/* */ import com.archive.framework.web.controller.BaseController; import com.archive.framework.web.controller.BaseController;
/* */ import com.archive.framework.web.domain.AjaxResult; import com.archive.framework.web.domain.AjaxResult;
/* */ import com.archive.project.browse.service.IBrowseService; import com.archive.project.browse.service.IBrowseService;
/* */ import com.archive.project.dajs.jsgl.service.IJsglService; import com.archive.project.dajs.jsgl.service.IJsglService;
/* */ import com.archive.project.dasz.ccgl.service.ICcglService; import com.archive.project.dasz.ccgl.service.ICcglService;
/* */ import com.archive.project.system.config.service.IConfigService; import com.archive.project.system.config.service.IConfigService;
/* */ import java.io.File; import java.io.File;
/* */ import java.io.FileInputStream; import java.io.FileInputStream;
/* */ import java.io.IOException; import java.io.IOException;
/* */ import java.util.ArrayList; import java.util.ArrayList;
/* */ import java.util.HashMap; import java.util.HashMap;
/* */ import java.util.List; import java.util.List;
/* */ import java.util.Map; import java.util.Map;
/* */ import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
/* */ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
/* */ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
/* */ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
/* */ import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
/* */ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
/* */ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
/* */ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
/* */ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
/* */ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
/* */
/* */ @Controller @Controller
/* */ @RequestMapping({"/browse"}) @RequestMapping({"/browse"})
/* */ public class BrowseController extends BaseController { public class BrowseController extends BaseController {
/* 36 */ private String prefix = "browse"; private String prefix = "browse";
/* */
/* */ @Autowired @Autowired
/* */ private IConfigService configService; private IConfigService configService;
/* */
/* */ @Autowired @Autowired
/* */ private IJsglService jsglService; private IJsglService jsglService;
/* */
/* */ @Autowired @Autowired
/* */ private IBrowseService iBrowseService; private IBrowseService iBrowseService;
/* */
/* */ @Autowired @Autowired
/* */ private ICcglService ccglService; private ICcglService ccglService;
/* */
/* */ @Autowired @Autowired
/* */ private ArchiveConfig archiveConfig; private ArchiveConfig archiveConfig;
/* */
/* */ @GetMapping({"/browse/{archiveId}/{id}"}) @GetMapping({"/browse/{archiveId}/{id}"})
/* */ public String browse(@PathVariable("archiveId") long archiveId, @PathVariable("id") String id, ModelMap mmap) { public String browse(@PathVariable("archiveId") long archiveId, @PathVariable("id") String id, ModelMap mmap) {
/* 55 */ long tableId = TableUtil.getTableIdByArchiveTypeId(archiveId); long tableId = TableUtil.getTableIdByArchiveTypeId(archiveId);
/* 56 */ mmap.put("archiveTypeId", Long.valueOf(archiveId)); mmap.put("archiveTypeId", Long.valueOf(archiveId));
/* 57 */ mmap.put("tableId", Long.valueOf(tableId)); mmap.put("tableId", Long.valueOf(tableId));
/* 58 */ mmap.put("id", id); mmap.put("id", id);
/* 59 */ boolean browseServerEnabled = this.archiveConfig.isBrowseServerEnabled(); boolean browseServerEnabled = this.archiveConfig.isBrowseServerEnabled();
/* */
/* 61 */ if (browseServerEnabled) { if (browseServerEnabled) {
/* 62 */ return this.prefix + "/browse"; return this.prefix + "/browse";
/* */ } }
/* 64 */ return this.prefix + "/browsesimple"; return this.prefix + "/browsesimple";
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/appendAddForm/{archiveTypeId}/{type}/{id}"}) @GetMapping({"/appendAddForm/{archiveTypeId}/{type}/{id}"})
/* */ @ResponseBody @ResponseBody
/* */ public String appendAddForm(@PathVariable("archiveTypeId") String archiveTypeId, @PathVariable("type") String type, @PathVariable("id") String id) { public String appendAddForm(@PathVariable("archiveTypeId") String archiveTypeId, @PathVariable("type") String type, @PathVariable("id") String id) {
/* 79 */ return this.jsglService.appendAddFormByDataId(archiveTypeId, type, id, "true"); return this.jsglService.appendAddFormByDataId(archiveTypeId, type, id, "true");
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/getDocumentListByFileTableIdAndFileId/{fileTableId}/{fileId}"}) @GetMapping({"/getDocumentListByFileTableIdAndFileId/{fileTableId}/{fileId}"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult getDocumentListByFileTableIdAndFileId(@PathVariable("fileTableId") String fileTableId, @PathVariable("fileId") String fileId) { public AjaxResult getDocumentListByFileTableIdAndFileId(@PathVariable("fileTableId") String fileTableId, @PathVariable("fileId") String fileId) {
/* 91 */ List<Map<String, String>> list = this.iBrowseService.getDocumentListByFileTableIdAndFileId(fileTableId, fileId); List<Map<String, String>> list = this.iBrowseService.getDocumentListByFileTableIdAndFileId(fileTableId, fileId);
/* 92 */ return AjaxResult.success(list); return AjaxResult.success(list);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/getDocumentList/{fileTableId}/{fileId}"}) @GetMapping({"/getDocumentList/{fileTableId}/{fileId}"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult getDocumentList(@PathVariable("fileTableId") String fileTableId, @PathVariable("fileId") String fileId) { public AjaxResult getDocumentList(@PathVariable("fileTableId") String fileTableId, @PathVariable("fileId") String fileId) {
/* 104 */ List<Map<String, String>> list = this.iBrowseService.getDocumentList(fileTableId, fileId); List<Map<String, String>> list = this.iBrowseService.getDocumentList(fileTableId, fileId);
/* 105 */ return AjaxResult.success(list); return AjaxResult.success(list);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/getDocument/{documentTableId}/{documentId}"}) @GetMapping({"/getDocument/{documentTableId}/{documentId}"})
/* */ @ResponseBody @ResponseBody
/* */ public Object getDocument(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId, HttpServletRequest request, HttpServletResponse response) { public Object getDocument(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId, HttpServletRequest request, HttpServletResponse response) {
/* 120 */ FileInputStream fis = null; FileInputStream fis = null;
/* 121 */ ServletOutputStream ops = null; ServletOutputStream ops = null;
/* 122 */ String filepath = this.iBrowseService.getDocumentPath(documentTableId, documentId, "false"); String filepath = this.iBrowseService.getDocumentPath(documentTableId, documentId, "false");
/* */ try { try {
/* 124 */ File f = new File(filepath); File f = new File(filepath);
/* 125 */ if (f.exists()) { if (f.exists()) {
/* 126 */ System.out.println(filepath + "===cunzai"); System.out.println(filepath + "===cunzai");
/* 127 */ response.addHeader("Content-Disposition", "attachment;filename=\"" + new String(f.getName().getBytes("UTF-8"), "ISO8859-1") + "\""); response.addHeader("Content-Disposition", "attachment;filename=\"" + new String(f.getName().getBytes("UTF-8"), "ISO8859-1") + "\"");
/* 128 */ response.setContentType("application/octet-stream; charset=GBK"); response.setContentType("application/octet-stream; charset=GBK");
/* 129 */ response.setHeader("Content-Length", String.valueOf(f.length())); response.setHeader("Content-Length", String.valueOf(f.length()));
/* 130 */ response.setHeader("Pragma", "No-cache"); response.setHeader("Pragma", "No-cache");
/* 131 */ response.setHeader("Cache-Control", "No-cache"); response.setHeader("Cache-Control", "No-cache");
/* 132 */ response.setDateHeader("Expires", 0L); response.setDateHeader("Expires", 0L);
/* 133 */ fis = new FileInputStream(f); fis = new FileInputStream(f);
/* 134 */ ops = response.getOutputStream(); ops = response.getOutputStream();
/* 135 */ byte[] bf = new byte[1024]; byte[] bf = new byte[1024];
/* 136 */ int rl = fis.read(bf); int rl = fis.read(bf);
/* 137 */ while (rl > 0) { while (rl > 0) {
/* 138 */ ops.write(bf, 0, rl); ops.write(bf, 0, rl);
/* 139 */ rl = fis.read(bf); rl = fis.read(bf);
/* */ } }
/* 141 */ ops.flush(); ops.flush();
/* 142 */ ops.close(); ops.close();
/* 143 */ fis.close(); fis.close();
/* */ } else { } else {
/* 145 */ System.out.println(filepath + "===bucunzai"); System.out.println(filepath + "===bucunzai");
/* 146 */ response.sendRedirect("common/404.jsp"); response.sendRedirect("common/404.jsp");
/* */ } }
/* 148 */ } catch (Exception e) { } catch (Exception e) {
/* 149 */ e.printStackTrace(); e.printStackTrace();
/* */ } finally { } finally {
/* */ try { try {
/* 152 */ if (fis != null) if (fis != null)
/* 153 */ { {
fis.close(); fis.close();
} }
/* 154 */ if (ops != null) if (ops != null)
/* 155 */ { {
ops.close(); ops.close();
} }
/* 156 */ } catch (Exception e) { } catch (Exception e) {
/* 157 */ fis = null; fis = null;
/* 158 */ ops = null; ops = null;
/* */ } }
/* */ } }
/* 161 */ return null; return null;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/FileOcr/{documentTableId}/{documentId}"}) @GetMapping({"/FileOcr/{documentTableId}/{documentId}"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult FileOcr(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId) { public AjaxResult FileOcr(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId) {
/* 174 */ String filepath = this.iBrowseService.getDocumentPath(documentTableId, documentId, "false"); String filepath = this.iBrowseService.getDocumentPath(documentTableId, documentId, "false");
/* 175 */ String result2 = ""; String result2 = "";
/* 176 */ String pdfSpiltImagePath = this.ccglService.getPathByLjbs("archive.pdfSpiltImagePath"); String pdfSpiltImagePath = this.ccglService.getPathByLjbs("archive.pdfSpiltImagePath");
/* */ try { try {
/* 178 */ String filepath1 = filepath.toLowerCase(); String filepath1 = filepath.toLowerCase();
/* 179 */ if (filepath1.contains(".jpg") || filepath1.contains(".png") || filepath1.contains(".gif") || filepath1.contains(".jpeg") || filepath1.contains(".tif")) { if (filepath1.contains(".jpg") || filepath1.contains(".png") || filepath1.contains(".gif") || filepath1.contains(".jpeg") || filepath1.contains(".tif")) {
/* 180 */ result2 = ImageOcr.ImageOcr(filepath); result2 = ImageOcr.ImageOcr(filepath);
/* 181 */ } else if (filepath1.contains(".pdf")) { } else if (filepath1.contains(".pdf")) {
/* */
/* 183 */ result2 = PdfOcr.getTextFromPdf(filepath, pdfSpiltImagePath); result2 = PdfOcr.getTextFromPdf(filepath, pdfSpiltImagePath);
/* 184 */ } else if (filepath1.contains(".ofd")) { } else if (filepath1.contains(".ofd")) {
/* */
/* 186 */ result2 = ""; result2 = "";
/* */ } }
/* 188 */ } catch (Exception e) { } catch (Exception e) {
/* 189 */ System.out.println(e.getMessage()); System.out.println(e.getMessage());
/* */ } }
/* 191 */ return AjaxResult.success(result2); return AjaxResult.success(result2);
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/metaData/{documentTableId}/{documentId}"}) @GetMapping({"/metaData/{documentTableId}/{documentId}"})
/* */ public String metaData(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId, ModelMap mmap) { public String metaData(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId, ModelMap mmap) {
/* 203 */ mmap.put("documentTableId", documentTableId); mmap.put("documentTableId", documentTableId);
/* 204 */ mmap.put("documentId", documentId); mmap.put("documentId", documentId);
/* 205 */ return this.prefix + "/metadata"; return this.prefix + "/metadata";
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/metaDataForm/{documentTableId}/{documentId}"}) @GetMapping({"/metaDataForm/{documentTableId}/{documentId}"})
/* */ @ResponseBody @ResponseBody
/* */ public String metaDataForm(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId, ModelMap mmap) { public String metaDataForm(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId, ModelMap mmap) {
/* 218 */ String filepath = this.iBrowseService.getDocumentPath(documentTableId, documentId, "false"); String filepath = this.iBrowseService.getDocumentPath(documentTableId, documentId, "false");
/* 219 */ List<Map<String, String>> list = MetadataUtil.getMetadataAllByFile(filepath); List<Map<String, String>> list = MetadataUtil.getMetadataAllByFile(filepath);
/* 220 */ StringBuilder html = new StringBuilder(); StringBuilder html = new StringBuilder();
/* 221 */ for (int i = 1; i <= list.size(); i++) { for (int i = 1; i <= list.size(); i++) {
/* */
/* 223 */ if (i % 2 != 0) { if (i % 2 != 0) {
/* 224 */ html.append("<div class=\"row\">"); html.append("<div class=\"row\">");
/* */ } }
/* */
/* 227 */ html.append("<div class=\"col-sm-6\">\r\n\t<div class=\"form-group\">\r\n\t\t<label class=\"col-sm-4 control-label is-required\">" + (String)((Map)list html.append("<div class=\"col-sm-6\">\r\n\t<div class=\"form-group\">\r\n\t\t<label class=\"col-sm-4 control-label is-required\">" + (String)((Map)list
/* */
/* 229 */ .get(i - 1)).get("propety") + "</label>\r\n\t\t<div class=\"col-sm-8\">\r\n\t\t\t<input required=\"required\" value=\"" + (String)((Map)list .get(i - 1)).get("propety") + "</label>\r\n\t\t<div class=\"col-sm-8\">\r\n\t\t\t<input required=\"required\" value=\"" + (String)((Map)list
/* */
/* 231 */ .get(i - 1)).get("propetyValue") + "\" class=\"form-control\" type=\"text\">\r\n\t\t</div>\r\n\t</div>\r\n </div>"); .get(i - 1)).get("propetyValue") + "\" class=\"form-control\" type=\"text\">\r\n\t\t</div>\r\n\t</div>\r\n </div>");
/* */
/* */
/* */
/* */
/* */
/* 237 */ if (i % 2 == 0 || i == list.size()) { if (i % 2 == 0 || i == list.size()) {
/* 238 */ html.append("</div>"); html.append("</div>");
/* */ } }
/* */ } }
/* 241 */ return html.toString(); return html.toString();
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/getPreviewUrl/{docTableId}/{docId}"}) @GetMapping({"/getPreviewUrl/{docTableId}/{docId}"})
/* */ @ResponseBody @ResponseBody
/* */ public Map<String, String> getPreviewUrl(HttpServletRequest request, @PathVariable("docTableId") String docTableId, @PathVariable("docId") String docId) { public Map<String, String> getPreviewUrl(HttpServletRequest request, @PathVariable("docTableId") String docTableId, @PathVariable("docId") String docId) {
/* 254 */ Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
/* 255 */ String originUrl = ""; String originUrl = "";
/* 256 */ String fileName = this.iBrowseService.getFileName(docTableId, docId); String fileName = this.iBrowseService.getFileName(docTableId, docId);
/* 257 */ if (StringUtils.isNotEmpty(fileName)) { if (StringUtils.isNotEmpty(fileName)) {
/* 258 */ StringBuffer url = request.getRequestURL(); StringBuffer url = request.getRequestURL();
/* 259 */ originUrl = url.toString(); originUrl = url.toString();
/* 260 */ originUrl = originUrl.substring(0, originUrl.indexOf("getPreviewUrl")); originUrl = originUrl.substring(0, originUrl.indexOf("getPreviewUrl"));
/* 261 */ originUrl = originUrl + "browseDocument?docTableId=" + docTableId + "&docId=" + docId + "&fullfilename=" + fileName; originUrl = originUrl + "browseDocument?docTableId=" + docTableId + "&docId=" + docId + "&fullfilename=" + fileName;
/* */ } }
/* */
/* 264 */ String browseServer = this.archiveConfig.getBrowseServer(); String browseServer = this.archiveConfig.getBrowseServer();
/* 265 */ if (StringUtils.isNotEmpty(browseServer)) { if (StringUtils.isNotEmpty(browseServer)) {
/* 266 */ boolean flag = HttpUtils.urlWhetherReachable(browseServer, 2000); boolean flag = HttpUtils.urlWhetherReachable(browseServer, 2000);
/* 267 */ if (flag) { if (flag) {
/* 268 */ if (browseServer.endsWith("/")) { if (browseServer.endsWith("/")) {
/* 269 */ browseServer = browseServer + "onlinePreview?url="; browseServer = browseServer + "onlinePreview?url=";
/* */ } else { } else {
/* 271 */ browseServer = browseServer + "/onlinePreview?url="; browseServer = browseServer + "/onlinePreview?url=";
/* */ } }
/* */ } else { } else {
/* 274 */ browseServer = ""; browseServer = "";
/* */ } }
/* */ } }
/* 277 */ map.put("originUrl", originUrl); map.put("originUrl", originUrl);
/* 278 */ map.put("browseServer", browseServer); map.put("browseServer", browseServer);
/* 279 */ return map; return map;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @RequestMapping(value = {"/browseDocument"}, method = {RequestMethod.GET}) @RequestMapping(value = {"/browseDocument"}, method = {RequestMethod.GET})
/* */ public void browseDocument(HttpServletRequest request, HttpServletResponse response) { public void browseDocument(HttpServletRequest request, HttpServletResponse response) {
/* 289 */ String docTableId = request.getParameter("docTableId"); String docTableId = request.getParameter("docTableId");
/* 290 */ String docId = request.getParameter("docId"); String docId = request.getParameter("docId");
/* 291 */ String filePath = this.iBrowseService.getDocumentFilePath(docTableId, docId); String filePath = this.iBrowseService.getDocumentFilePath(docTableId, docId);
/* 292 */ File file = new File(filePath); File file = new File(filePath);
/* 293 */ if (file.exists()) { if (file.exists()) {
/* 294 */ byte[] data = null; byte[] data = null;
/* 295 */ FileInputStream input = null; FileInputStream input = null;
/* */ try { try {
/* 297 */ input = new FileInputStream(file); input = new FileInputStream(file);
/* 298 */ data = new byte[input.available()]; data = new byte[input.available()];
/* 299 */ input.read(data); input.read(data);
/* 300 */ response.getOutputStream().write(data); response.getOutputStream().write(data);
/* 301 */ } catch (Exception e) { } catch (Exception e) {
/* 302 */ e.printStackTrace(); e.printStackTrace();
/* */ } finally { } finally {
/* */ try { try {
/* 305 */ if (input != null) { if (input != null) {
/* 306 */ input.close(); input.close();
/* */ } }
/* 308 */ } catch (IOException e) { } catch (IOException e) {
/* 309 */ e.printStackTrace(); e.printStackTrace();
/* */ } }
/* */ } }
/* */ } }
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/getMetaData/{documentTableId}/{documentId}"}) @GetMapping({"/getMetaData/{documentTableId}/{documentId}"})
/* */ @ResponseBody @ResponseBody
/* */ public AjaxResult getMetaData(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId) { public AjaxResult getMetaData(@PathVariable("documentTableId") String documentTableId, @PathVariable("documentId") String documentId) {
/* 324 */ String filepath = this.iBrowseService.getDocumentPath(documentTableId, documentId, "false"); String filepath = this.iBrowseService.getDocumentPath(documentTableId, documentId, "false");
/* 325 */ List<Map<String, String>> list = new ArrayList<>(); List<Map<String, String>> list = new ArrayList<>();
/* */ try { try {
/* 327 */ list = MetadataUtil.getMetadataAllByFile(filepath); list = MetadataUtil.getMetadataAllByFile(filepath);
/* 328 */ } catch (Exception e) { } catch (Exception e) {
/* 329 */ e.printStackTrace(); e.printStackTrace();
/* */ } }
/* 331 */ return AjaxResult.success(list); return AjaxResult.success(list);
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\browse\controller\BrowseController.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\browse\controller\BrowseController.class

@ -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.PdfWaterMarkUtil;
/* */ import com.archive.common.archiveUtil.TableUtil; import com.archive.common.archiveUtil.TableUtil;
/* */ import com.archive.common.utils.StringUtils; import com.archive.common.utils.StringUtils;
/* */ import com.archive.project.browse.service.IBrowseService; import com.archive.project.browse.service.IBrowseService;
/* */ import com.archive.project.common.service.IExecuteSqlService; import com.archive.project.common.service.IExecuteSqlService;
/* */ import com.archive.project.dajs.archiveimportbatch.service.IArchiveImportBatchService; import com.archive.project.dajs.archiveimportbatch.service.IArchiveImportBatchService;
/* */ import com.archive.project.dasz.physicaltable.mapper.PhysicalTableMapper; import com.archive.project.dasz.physicaltable.mapper.PhysicalTableMapper;
/* */ import com.archive.project.dasz.physicaltablecolumn.mapper.PhysicalTableColumnMapper; import com.archive.project.dasz.physicaltablecolumn.mapper.PhysicalTableColumnMapper;
/* */ import com.archive.project.system.config.service.IConfigService; import com.archive.project.system.config.service.IConfigService;
/* */ import com.archive.project.system.dict.service.IDictTypeService; import com.archive.project.system.dict.service.IDictTypeService;
/* */ import java.io.File; import java.io.File;
/* */ import java.util.ArrayList; import java.util.ArrayList;
/* */ import java.util.HashMap; import java.util.HashMap;
/* */ import java.util.LinkedHashMap; import java.util.LinkedHashMap;
/* */ import java.util.List; import java.util.List;
/* */ import java.util.Map; import java.util.Map;
/* */ import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
/* */ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Service @Service
/* */ public class BrowseServiceImpl public class BrowseServiceImpl
/* */ implements IBrowseService implements IBrowseService
/* */ { {
/* */ @Autowired @Autowired
/* */ private PhysicalTableMapper physicalTableMapper; private PhysicalTableMapper physicalTableMapper;
/* */ @Autowired @Autowired
/* */ private PhysicalTableColumnMapper physicalTableColumnMapper; private PhysicalTableColumnMapper physicalTableColumnMapper;
/* */ @Autowired @Autowired
/* */ private IExecuteSqlService executeSqlService; private IExecuteSqlService executeSqlService;
/* */ @Autowired @Autowired
/* */ private IConfigService configService; private IConfigService configService;
/* */ @Autowired @Autowired
/* */ private IDictTypeService dictTypeService; private IDictTypeService dictTypeService;
/* */ @Autowired @Autowired
/* */ private IArchiveImportBatchService archiveImportBatchService; private IArchiveImportBatchService archiveImportBatchService;
/* */
/* */ public List<Map<String, String>> getDocumentListByFileTableIdAndFileId(String fileTableId, String fileId) { public List<Map<String, String>> getDocumentListByFileTableIdAndFileId(String fileTableId, String fileId) {
/* 58 */ List<Map<String, String>> list = new ArrayList<>(); List<Map<String, String>> list = new ArrayList<>();
/* 59 */ String fileTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(fileTableId))); String fileTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(fileTableId)));
/* */
/* 61 */ String docTableName = fileTableName.toLowerCase().replace("_file", "_document"); String docTableName = fileTableName.toLowerCase().replace("_file", "_document");
/* 62 */ docTableName = docTableName.toLowerCase().replace("_folder", "_document"); docTableName = docTableName.toLowerCase().replace("_folder", "_document");
/* 63 */ String docTableId = TableUtil.getTableId(docTableName); String docTableId = TableUtil.getTableId(docTableName);
/* 64 */ String sql = "select filehz,id,filename from " + docTableName + " where ownerid=" + fileId; String sql = "select filehz,id,filename from " + docTableName + " where ownerid=" + fileId;
/* 65 */ List<LinkedHashMap<String, Object>> doclist = this.executeSqlService.queryList(sql); List<LinkedHashMap<String, Object>> doclist = this.executeSqlService.queryList(sql);
/* 66 */ for (int i = 0; i < doclist.size(); i++) { for (int i = 0; i < doclist.size(); i++) {
/* 67 */ if (doclist.get(i) != null) { if (doclist.get(i) != null) {
/* 68 */ String docId = (((LinkedHashMap)doclist.get(i)).get("id") == null) ? "" : ((LinkedHashMap)doclist.get(i)).get("id").toString(); 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(); 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(); String docName = (((LinkedHashMap)doclist.get(i)).get("filename") == null) ? "" : ((LinkedHashMap)doclist.get(i)).get("filename").toString();
/* 71 */ if (!docId.equals("")) { if (!docId.equals("")) {
/* 72 */ Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
/* 73 */ map.put("docId", docId); map.put("docId", docId);
/* 74 */ map.put("dochz", dochz.toLowerCase()); map.put("dochz", dochz.toLowerCase());
/* 75 */ map.put("docName", docName); map.put("docName", docName);
/* 76 */ map.put("docTableId", docTableId); map.put("docTableId", docTableId);
/* 77 */ list.add(map); list.add(map);
/* */ } }
/* */ } }
/* */ } }
/* 81 */ return list; return list;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public List<Map<String, String>> getDocumentList(String fileTableId, String fileId) { public List<Map<String, String>> getDocumentList(String fileTableId, String fileId) {
/* 91 */ List<Map<String, String>> list = new ArrayList<>(); List<Map<String, String>> list = new ArrayList<>();
/* 92 */ String fileTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(fileTableId))); String fileTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(fileTableId)));
/* */
/* 94 */ String docTableName = fileTableName.toLowerCase().replace("_file", "_document"); String docTableName = fileTableName.toLowerCase().replace("_file", "_document");
/* 95 */ docTableName = docTableName.toLowerCase().replace("_folder", "_document"); docTableName = docTableName.toLowerCase().replace("_folder", "_document");
/* 96 */ String docTableId = TableUtil.getTableId(docTableName); String docTableId = TableUtil.getTableId(docTableName);
/* 97 */ String sql = "select filehz, id, filename from " + docTableName + " where ownerid = " + fileId; String sql = "select filehz, id, filename from " + docTableName + " where ownerid = " + fileId;
/* 98 */ List<LinkedHashMap<String, Object>> doclist = this.executeSqlService.queryList(sql); List<LinkedHashMap<String, Object>> doclist = this.executeSqlService.queryList(sql);
/* 99 */ for (int i = 0; i < doclist.size(); i++) { for (int i = 0; i < doclist.size(); i++) {
/* 100 */ if (doclist.get(i) != null) { if (doclist.get(i) != null) {
/* 101 */ String docId = (((LinkedHashMap)doclist.get(i)).get("id") == null) ? "" : ((LinkedHashMap)doclist.get(i)).get("id").toString(); 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(); 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(); String docName = (((LinkedHashMap)doclist.get(i)).get("filename") == null) ? "" : ((LinkedHashMap)doclist.get(i)).get("filename").toString();
/* 104 */ if (!docId.equals("")) { if (!docId.equals("")) {
/* 105 */ Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
/* 106 */ map.put("docId", docId); map.put("docId", docId);
/* 107 */ map.put("dochz", dochz.toLowerCase()); map.put("dochz", dochz.toLowerCase());
/* 108 */ map.put("docName", docName); map.put("docName", docName);
/* 109 */ map.put("docTableId", docTableId); map.put("docTableId", docTableId);
/* 110 */ list.add(map); list.add(map);
/* */ } }
/* */ } }
/* */ } }
/* 114 */ return list; return list;
/* */ } }
/* */
/* */
/* */ public String getFileName(String docTableId, String docId) { public String getFileName(String docTableId, String docId) {
/* 119 */ String fileName = ""; String fileName = "";
/* 120 */ String docTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(docTableId))); String docTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(docTableId)));
/* 121 */ String sql = "select filepath from " + docTableName + " where id = " + docId; String sql = "select filepath from " + docTableName + " where id = " + docId;
/* 122 */ String filePath = this.executeSqlService.getSingle(sql); String filePath = this.executeSqlService.getSingle(sql);
/* 123 */ if (StringUtils.isNotEmpty(filePath)) { if (StringUtils.isNotEmpty(filePath)) {
/* 124 */ File file = new File(filePath); File file = new File(filePath);
/* 125 */ if (file.exists()) { if (file.exists()) {
/* 126 */ fileName = FilenameUtils.getName(filePath); fileName = FilenameUtils.getName(filePath);
/* */ } }
/* */ } }
/* 129 */ return fileName; return fileName;
/* */ } }
/* */
/* */
/* */ public String getDocumentFilePath(String docTableId, String docId) { public String getDocumentFilePath(String docTableId, String docId) {
/* 134 */ String filePath = ""; String filePath = "";
/* 135 */ String docTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(docTableId))); String docTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(docTableId)));
/* 136 */ String sql = "select filepath from " + docTableName + " where id = " + docId; String sql = "select filepath from " + docTableName + " where id = " + docId;
/* 137 */ filePath = this.executeSqlService.getSingle(sql); filePath = this.executeSqlService.getSingle(sql);
/* 138 */ return filePath; return filePath;
/* */ } }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public String getDocumentPath(String documentTableId, String documentId, String iswater) { public String getDocumentPath(String documentTableId, String documentId, String iswater) {
/* 152 */ String path = ""; String path = "";
/* 153 */ String DocTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(documentTableId))); String DocTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(documentTableId)));
/* 154 */ if (iswater.equals("true")) { if (iswater.equals("true")) {
/* */
/* 156 */ String sql = "select filewaterpath,filepath from " + DocTableName + " where id=" + documentId; String sql = "select filewaterpath,filepath from " + DocTableName + " where id=" + documentId;
/* 157 */ LinkedHashMap<String, Object> data = this.executeSqlService.getOne(sql); LinkedHashMap<String, Object> data = this.executeSqlService.getOne(sql);
/* 158 */ if (data != null && data.size() > 0) { if (data != null && data.size() > 0) {
/* 159 */ String waterpath = (data.get("filewaterpath") == null) ? "" : data.get("filewaterpath").toString(); String waterpath = (data.get("filewaterpath") == null) ? "" : data.get("filewaterpath").toString();
/* 160 */ String filepath = (data.get("filepath") == null) ? "" : data.get("filepath").toString(); String filepath = (data.get("filepath") == null) ? "" : data.get("filepath").toString();
/* 161 */ if (!waterpath.equals("")) { if (!waterpath.equals("")) {
/* 162 */ path = waterpath; path = waterpath;
/* */ } else { } else {
/* 164 */ File yfile = new File(filepath); File yfile = new File(filepath);
/* 165 */ String yfileName = yfile.getName().substring(0, yfile.getName().lastIndexOf(".")); String yfileName = yfile.getName().substring(0, yfile.getName().lastIndexOf("."));
/* 166 */ String yhz = yfile.getName().substring(yfile.getName().lastIndexOf(".") + 1); String yhz = yfile.getName().substring(yfile.getName().lastIndexOf(".") + 1);
/* 167 */ if (yfile.exists()) { if (yfile.exists()) {
/* 168 */ String newFileName = yfileName + "_water"; String newFileName = yfileName + "_water";
/* 169 */ String newFilePath = yfile.getPath().replace(yfileName, newFileName); String newFilePath = yfile.getPath().replace(yfileName, newFileName);
/* */
/* 171 */ String waterType = this.configService.selectConfigByKey("archive.waterMarkType"); String waterType = this.configService.selectConfigByKey("archive.waterMarkType");
/* 172 */ if (waterType.equals("1")) { if (waterType.equals("1")) {
/* 173 */ String waterText = this.configService.selectConfigByKey("archive.waterMarkText"); String waterText = this.configService.selectConfigByKey("archive.waterMarkText");
/* 174 */ if (waterText != null && !waterText.equals("")) { if (waterText != null && !waterText.equals("")) {
/* 175 */ if (yhz.toLowerCase().equals("pdf")) { if (yhz.toLowerCase().equals("pdf")) {
/* 176 */ PdfWaterMarkUtil.waterMarkforWriting(filepath, newFilePath, waterText, Integer.valueOf(45), 1.0F, 10); PdfWaterMarkUtil.waterMarkforWriting(filepath, newFilePath, waterText, Integer.valueOf(45), 1.0F, 10);
/* */
/* 178 */ String updatSql = "update " + DocTableName + " set filewaterpath='" + newFilePath + "' where id=" + documentId; String updatSql = "update " + DocTableName + " set filewaterpath='" + newFilePath + "' where id=" + documentId;
/* 179 */ this.executeSqlService.update(updatSql); this.executeSqlService.update(updatSql);
/* */ } else { } else {
/* 181 */ System.out.println("~~~~~其他格式暂时无法添加水印~~~~~~"); System.out.println("~~~~~其他格式暂时无法添加水印~~~~~~");
/* 182 */ path = filepath; path = filepath;
/* */ } }
/* */ } else { } else {
/* 185 */ System.out.println("~~~~~~~文字水印设置为空,无法生成水印文件~~~~~~~~~"); System.out.println("~~~~~~~文字水印设置为空,无法生成水印文件~~~~~~~~~");
/* 186 */ path = filepath; path = filepath;
/* */ } }
/* */ } else { } else {
/* 189 */ String waterImagePath = this.configService.selectConfigByKey("archive.waterMarkImage"); String waterImagePath = this.configService.selectConfigByKey("archive.waterMarkImage");
/* 190 */ File file = new File(waterImagePath); File file = new File(waterImagePath);
/* 191 */ if (file.exists()) { if (file.exists()) {
/* 192 */ if (yhz.toLowerCase().equals("pdf")) { if (yhz.toLowerCase().equals("pdf")) {
/* 193 */ PdfWaterMarkUtil.pressImageWater(filepath, newFilePath, waterImagePath, 100, 100); PdfWaterMarkUtil.pressImageWater(filepath, newFilePath, waterImagePath, 100, 100);
/* */
/* 195 */ String updatSql = "update " + DocTableName + " set filewaterpath='" + newFilePath + "' where id=" + documentId; String updatSql = "update " + DocTableName + " set filewaterpath='" + newFilePath + "' where id=" + documentId;
/* 196 */ this.executeSqlService.update(updatSql); this.executeSqlService.update(updatSql);
/* */ } else { } else {
/* 198 */ System.out.println("~~~~~其他格式暂时无法添加水印~~~~~~"); System.out.println("~~~~~其他格式暂时无法添加水印~~~~~~");
/* 199 */ path = filepath; path = filepath;
/* */ } }
/* */ } else { } else {
/* 202 */ System.out.println("~~~~~~~图片水印文件不存在,无法生成水印文件~~~~~~~~~"); System.out.println("~~~~~~~图片水印文件不存在,无法生成水印文件~~~~~~~~~");
/* 203 */ path = filepath; path = filepath;
/* */ } }
/* */ } }
/* */ } else { } else {
/* 207 */ System.out.println("~~~~~~~原文件不存在,无法生成水印文件~~~~~~~~~"); System.out.println("~~~~~~~原文件不存在,无法生成水印文件~~~~~~~~~");
/* */ } }
/* */ } }
/* */ } }
/* */ } else { } else {
/* */
/* 213 */ String sql = "select filepath from " + DocTableName + " where id=" + documentId; String sql = "select filepath from " + DocTableName + " where id=" + documentId;
/* 214 */ LinkedHashMap<String, Object> data = this.executeSqlService.getOne(sql); LinkedHashMap<String, Object> data = this.executeSqlService.getOne(sql);
/* 215 */ if (data != null && data.size() > 0) { if (data != null && data.size() > 0) {
/* 216 */ path = (data.get("filepath") == null) ? "" : data.get("filepath").toString(); path = (data.get("filepath") == null) ? "" : data.get("filepath").toString();
/* */ } }
/* */ } }
/* 219 */ return path; return path;
/* */ } }
/* */
/* */
/* */ public static void main(String[] args) { public static void main(String[] args) {
/* 224 */ File file = new File("D://smdocument.pdf"); File file = new File("D://smdocument.pdf");
/* 225 */ System.out.println(file.getName().substring(0, file.getName().lastIndexOf("."))); System.out.println(file.getName().substring(0, file.getName().lastIndexOf(".")));
/* 226 */ System.out.println(file.getName().substring(file.getName().lastIndexOf(".") + 1)); System.out.println(file.getName().substring(file.getName().lastIndexOf(".") + 1));
/* 227 */ System.out.println(file.getPath()); System.out.println(file.getPath());
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\browse\service\impl\BrowseServiceImpl.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\browse\service\impl\BrowseServiceImpl.class

@ -1,31 +1,31 @@
/* */ package com.archive.project.tool.build package com.archive.project.tool.build
; ;
/* */
/* */ import com.archive.framework.web.controller.BaseController; import com.archive.framework.web.controller.BaseController;
/* */ import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
/* */ import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
/* */ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
/* */ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
/* */
/* */
/* */
/* */
/* */
/* */ @Controller @Controller
/* */ @RequestMapping({"/tool/build"}) @RequestMapping({"/tool/build"})
/* */ public class BuildController public class BuildController
/* */ extends BaseController extends BaseController
/* */ { {
/* 18 */ private String prefix = "tool/build"; private String prefix = "tool/build";
/* */
/* */
/* */ @RequiresPermissions({"tool:build:view"}) @RequiresPermissions({"tool:build:view"})
/* */ @GetMapping @GetMapping
/* */ public String build() { public String build() {
/* 24 */ return this.prefix + "/build"; return this.prefix + "/build";
/* */ } }
/* */ } }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\tool\build\BuildController.class /* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\tool\build\BuildController.class

Loading…
Cancel
Save