feat:修改文件处理类型

dev
wangxy 8 months ago
parent 7f632da282
commit e6395c3828

@ -1,8 +1,8 @@
/* */ package com.archive.common.archiveUtil;
/* */
/* */ import com.archive.common.archiveUtil.ExcelUtilArchive;
/* */ import org.apache.poi.ss.usermodel.CellType;
/* */
package com.archive.common.archiveUtil;
import com.archive.common.archiveUtil.ExcelUtilArchive;
import org.apache.poi.ss.usermodel.CellType;
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\archiveUtil\ExcelUtilArchive$1.class

@ -1,146 +1,146 @@
/* */ package com.archive.common.convert;
/* */
/* */ import com.aspose.cells.IndividualFontConfigs;
/* */ import com.aspose.cells.License;
/* */ import com.aspose.cells.LoadOptions;
/* */ import com.aspose.cells.PdfSaveOptions;
/* */ import com.aspose.cells.SaveOptions;
/* */ import com.aspose.cells.Workbook;
/* */ import java.io.ByteArrayInputStream;
/* */ import java.io.FileOutputStream;
/* */ import java.io.InputStream;
/* */
/* */
/* */
/* */
/* */
/* */ public class ExcelToPdf
/* */ {
/* */ public static void main(String[] args) {
/* 20 */ excel2pdf("D:\\temp\\1.xls", "D:\\temp\\31.pdf");
/* */ }
/* */
/* */
/* */
/* */
/* */ public static boolean getLicense() {
/* 27 */ boolean result = false;
/* */ try {
/* 29 */ String license = "<License>\r\n <Data>\r\n <Products>\r\n <Product>Aspose.Total for Java</Product>\r\n <Product>Aspose.Words for Java</Product>\r\n </Products>\r\n <EditionType>Enterprise</EditionType>\r\n <SubscriptionExpiry>20991231</SubscriptionExpiry>\r\n <LicenseExpiry>20991231</LicenseExpiry>\r\n <SerialNumber>8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7</SerialNumber>\r\n </Data>\r\n <Signature>sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=</Signature>\r\n</License>";
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* 43 */ InputStream is = new ByteArrayInputStream(license.getBytes("UTF-8"));
/* 44 */ License aposeLic = new License();
/* 45 */ aposeLic.setLicense(is);
/* 46 */ result = true;
/* 47 */ } catch (Exception e) {
/* 48 */ e.printStackTrace();
/* */ }
/* 50 */ return result;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static void excel2pdf(String sourceFilePath, String desFilePathd) {
/* 60 */ if (!getLicense()) {
/* */ return;
/* */ }
/* */ try {
/* 64 */ if (isLinux()) {
/* 65 */ IndividualFontConfigs configs = new IndividualFontConfigs();
/* 66 */ configs.setFontFolder("/usr/share/fonts/chinese", true);
/* 67 */ LoadOptions loadOptions = new LoadOptions();
/* 68 */ loadOptions.setFontConfigs(configs);
/* */ }
/* */
/* */
/* */
/* 73 */ Workbook wb = new Workbook(sourceFilePath);
/* */
/* 75 */ FileOutputStream fileOS = new FileOutputStream(desFilePathd);
/* 76 */ PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
/* 77 */ pdfSaveOptions.setOnePagePerSheet(true);
/* 78 */ int[] autoDrawSheets = { 3 };
/* */
/* 80 */ autoDraw(wb, autoDrawSheets);
/* 81 */ int[] showSheets = { 0 };
/* */
/* 83 */ printSheetPage(wb, showSheets);
/* 84 */ wb.save(fileOS, (SaveOptions)pdfSaveOptions);
/* 85 */ fileOS.flush();
/* 86 */ fileOS.close();
/* */ }
/* 88 */ catch (Exception e) {
/* 89 */ e.printStackTrace();
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static void autoDraw(Workbook wb, int[] page) {
/* 99 */ if (null != page && page.length > 0) {
/* 100 */ for (int i = 0; i < page.length; i++) {
/* 101 */ wb.getWorksheets().get(i).getHorizontalPageBreaks().clear();
/* 102 */ wb.getWorksheets().get(i).getVerticalPageBreaks().clear();
/* */ }
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static void printSheetPage(Workbook wb, int[] page) {
/* */ int i;
/* 114 */ for (i = 1; i < wb.getWorksheets().getCount(); i++) {
/* 115 */ wb.getWorksheets().get(i).setVisible(false);
/* */ }
/* 117 */ if (null == page || page.length == 0) {
/* 118 */ wb.getWorksheets().get(0).setVisible(true);
/* */ } else {
/* 120 */ for (i = 0; i < page.length; i++) {
/* 121 */ wb.getWorksheets().get(i).setVisible(true);
/* */ }
/* */ }
/* */ }
/* */
/* */
/* */ public static boolean isLinux() {
/* 128 */ return System.getProperty("os.name").toLowerCase().contains("linux");
/* */ }
/* */
/* */ public static boolean isWindows() {
/* 132 */ return System.getProperty("os.name").toLowerCase().contains("windows");
/* */ }
/* */
/* */ public String JudgeSystem() {
/* 136 */ if (isLinux())
/* 137 */ return "linux";
/* 138 */ if (isWindows()) {
/* 139 */ return "windows";
/* */ }
/* 141 */ return "other system";
/* */ }
/* */ }
package com.archive.common.convert;
import com.aspose.cells.IndividualFontConfigs;
import com.aspose.cells.License;
import com.aspose.cells.LoadOptions;
import com.aspose.cells.PdfSaveOptions;
import com.aspose.cells.SaveOptions;
import com.aspose.cells.Workbook;
import java.io.ByteArrayInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
public class ExcelToPdf
{
public static void main(String[] args) {
excel2pdf("D:\\temp\\1.xls", "D:\\temp\\31.pdf");
}
public static boolean getLicense() {
boolean result = false;
try {
String license = "<License>\r\n <Data>\r\n <Products>\r\n <Product>Aspose.Total for Java</Product>\r\n <Product>Aspose.Words for Java</Product>\r\n </Products>\r\n <EditionType>Enterprise</EditionType>\r\n <SubscriptionExpiry>20991231</SubscriptionExpiry>\r\n <LicenseExpiry>20991231</LicenseExpiry>\r\n <SerialNumber>8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7</SerialNumber>\r\n </Data>\r\n <Signature>sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=</Signature>\r\n</License>";
InputStream is = new ByteArrayInputStream(license.getBytes("UTF-8"));
License aposeLic = new License();
aposeLic.setLicense(is);
result = true;
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
public static void excel2pdf(String sourceFilePath, String desFilePathd) {
if (!getLicense()) {
return;
}
try {
if (isLinux()) {
IndividualFontConfigs configs = new IndividualFontConfigs();
configs.setFontFolder("/usr/share/fonts/chinese", true);
LoadOptions loadOptions = new LoadOptions();
loadOptions.setFontConfigs(configs);
}
Workbook wb = new Workbook(sourceFilePath);
FileOutputStream fileOS = new FileOutputStream(desFilePathd);
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
pdfSaveOptions.setOnePagePerSheet(true);
int[] autoDrawSheets = { 3 };
autoDraw(wb, autoDrawSheets);
int[] showSheets = { 0 };
printSheetPage(wb, showSheets);
wb.save(fileOS, (SaveOptions)pdfSaveOptions);
fileOS.flush();
fileOS.close();
}
catch (Exception e) {
e.printStackTrace();
}
}
public static void autoDraw(Workbook wb, int[] page) {
if (null != page && page.length > 0) {
for (int i = 0; i < page.length; i++) {
wb.getWorksheets().get(i).getHorizontalPageBreaks().clear();
wb.getWorksheets().get(i).getVerticalPageBreaks().clear();
}
}
}
public static void printSheetPage(Workbook wb, int[] page) {
int i;
for (i = 1; i < wb.getWorksheets().getCount(); i++) {
wb.getWorksheets().get(i).setVisible(false);
}
if (null == page || page.length == 0) {
wb.getWorksheets().get(0).setVisible(true);
} else {
for (i = 0; i < page.length; i++) {
wb.getWorksheets().get(i).setVisible(true);
}
}
}
public static boolean isLinux() {
return System.getProperty("os.name").toLowerCase().contains("linux");
}
public static boolean isWindows() {
return System.getProperty("os.name").toLowerCase().contains("windows");
}
public String JudgeSystem() {
if (isLinux())
return "linux";
if (isWindows()) {
return "windows";
}
return "other system";
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\common\convert\ExcelToPdf.class

@ -1,45 +1,45 @@
/* */ package com.archive.common.utils
package com.archive.common.utils
;
/* */
/* */ import com.archive.common.utils.StringUtils;
/* */ import java.io.PrintWriter;
/* */ import java.io.StringWriter;
/* */ import org.apache.commons.lang3.exception.ExceptionUtils;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class ExceptionUtil
/* */ {
/* */ public static String getExceptionMessage(Throwable e) {
/* 20 */ StringWriter sw = new StringWriter();
/* 21 */ e.printStackTrace(new PrintWriter(sw, true));
/* 22 */ String str = sw.toString();
/* 23 */ return str;
/* */ }
/* */
/* */
/* */ public static String getRootErrorMseeage(Exception e) {
/* 28 */ Throwable root = ExceptionUtils.getRootCause(e);
/* 29 */ root = (root == null) ? e : root;
/* 30 */ if (root == null)
/* */ {
/* 32 */ return "";
/* */ }
/* 34 */ String msg = root.getMessage();
/* 35 */ if (msg == null)
/* */ {
/* 37 */ return "null";
/* */ }
/* 39 */ return StringUtils.defaultString(msg);
/* */ }
/* */ }
import com.archive.common.utils.StringUtils;
import java.io.PrintWriter;
import java.io.StringWriter;
import org.apache.commons.lang3.exception.ExceptionUtils;
public class ExceptionUtil
{
public static String getExceptionMessage(Throwable e) {
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw, true));
String str = sw.toString();
return str;
}
public static String getRootErrorMseeage(Exception e) {
Throwable root = ExceptionUtils.getRootCause(e);
root = (root == null) ? e : root;
if (root == null)
{
return "";
}
String msg = root.getMessage();
if (msg == null)
{
return "null";
}
return StringUtils.defaultString(msg);
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\ExceptionUtil.class

@ -1,158 +1,158 @@
/* */ package com.archive.common.utils.html;
/* */
/* */ import com.archive.common.utils.StringUtils;
/* */ import com.archive.common.utils.html.HTMLFilter;
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class EscapeUtil
/* */ {
/* */ public static final String RE_HTML_MARK = "(<[^<]*?>)|(<[\\s]*?/[^<]*?>)|(<[^<]*?/[\\s]*?>)";
/* 14 */ private static final char[][] TEXT = new char[64][];
/* */
/* */
/* */ static {
/* 18 */ for (int i = 0; i < 64; i++) {
/* */
/* 20 */ (new char[1])[0] = (char)i; TEXT[i] = new char[1];
/* */ }
/* */
/* */
/* 24 */ TEXT[39] = "&#039;".toCharArray();
/* 25 */ TEXT[34] = "&#34;".toCharArray();
/* 26 */ TEXT[38] = "&#38;".toCharArray();
/* 27 */ TEXT[60] = "&#60;".toCharArray();
/* 28 */ TEXT[62] = "&#62;".toCharArray();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String escape(String text) {
/* 39 */ return encode(text);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String unescape(String content) {
/* 50 */ return decode(content);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String clean(String content) {
/* 61 */ return (new HTMLFilter()).filter(content);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ private static String encode(String text) {
/* */ int len;
/* 73 */ if (text == null || (len = text.length()) == 0)
/* */ {
/* 75 */ return "";
/* */ }
/* 77 */ StringBuilder buffer = new StringBuilder(len + (len >> 2));
/* */
/* 79 */ for (int i = 0; i < len; i++) {
/* */
/* 81 */ char c = text.charAt(i);
/* 82 */ if (c < '@') {
/* */
/* 84 */ buffer.append(TEXT[c]);
/* */ }
/* */ else {
/* */
/* 88 */ buffer.append(c);
/* */ }
/* */ }
/* 91 */ return buffer.toString();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String decode(String content) {
/* 102 */ if (StringUtils.isEmpty(content))
/* */ {
/* 104 */ return content;
/* */ }
/* */
/* 107 */ StringBuilder tmp = new StringBuilder(content.length());
/* 108 */ int lastPos = 0, pos = 0;
/* */
/* 110 */ while (lastPos < content.length()) {
/* */
/* 112 */ pos = content.indexOf("%", lastPos);
/* 113 */ if (pos == lastPos) {
/* */
/* 115 */ if (content.charAt(pos + 1) == 'u') {
/* */
/* 117 */ char c = (char)Integer.parseInt(content.substring(pos + 2, pos + 6), 16);
/* 118 */ tmp.append(c);
/* 119 */ lastPos = pos + 6;
/* */
/* */ continue;
/* */ }
/* 123 */ char ch = (char)Integer.parseInt(content.substring(pos + 1, pos + 3), 16);
/* 124 */ tmp.append(ch);
/* 125 */ lastPos = pos + 3;
/* */
/* */ continue;
/* */ }
/* */
/* 130 */ if (pos == -1) {
/* */
/* 132 */ tmp.append(content.substring(lastPos));
/* 133 */ lastPos = content.length();
/* */
/* */ continue;
/* */ }
/* 137 */ tmp.append(content.substring(lastPos, pos));
/* 138 */ lastPos = pos;
/* */ }
/* */
/* */
/* 142 */ return tmp.toString();
/* */ }
/* */
/* */
/* */ public static void main(String[] args) {
/* 147 */ String html = "<script>alert(1);</script>";
/* */
/* */
/* */
/* 151 */ System.out.println(clean(html));
/* 152 */ System.out.println(escape(html));
/* 153 */ System.out.println(unescape(html));
/* */ }
/* */ }
package com.archive.common.utils.html;
import com.archive.common.utils.StringUtils;
import com.archive.common.utils.html.HTMLFilter;
public class EscapeUtil
{
public static final String RE_HTML_MARK = "(<[^<]*?>)|(<[\\s]*?/[^<]*?>)|(<[^<]*?/[\\s]*?>)";
private static final char[][] TEXT = new char[64][];
static {
for (int i = 0; i < 64; i++) {
(new char[1])[0] = (char)i; TEXT[i] = new char[1];
}
TEXT[39] = "&#039;".toCharArray();
TEXT[34] = "&#34;".toCharArray();
TEXT[38] = "&#38;".toCharArray();
TEXT[60] = "&#60;".toCharArray();
TEXT[62] = "&#62;".toCharArray();
}
public static String escape(String text) {
return encode(text);
}
public static String unescape(String content) {
return decode(content);
}
public static String clean(String content) {
return (new HTMLFilter()).filter(content);
}
private static String encode(String text) {
int len;
if (text == null || (len = text.length()) == 0)
{
return "";
}
StringBuilder buffer = new StringBuilder(len + (len >> 2));
for (int i = 0; i < len; i++) {
char c = text.charAt(i);
if (c < '@') {
buffer.append(TEXT[c]);
}
else {
buffer.append(c);
}
}
return buffer.toString();
}
public static String decode(String content) {
if (StringUtils.isEmpty(content))
{
return content;
}
StringBuilder tmp = new StringBuilder(content.length());
int lastPos = 0, pos = 0;
while (lastPos < content.length()) {
pos = content.indexOf("%", lastPos);
if (pos == lastPos) {
if (content.charAt(pos + 1) == 'u') {
char c = (char)Integer.parseInt(content.substring(pos + 2, pos + 6), 16);
tmp.append(c);
lastPos = pos + 6;
continue;
}
char ch = (char)Integer.parseInt(content.substring(pos + 1, pos + 3), 16);
tmp.append(ch);
lastPos = pos + 3;
continue;
}
if (pos == -1) {
tmp.append(content.substring(lastPos));
lastPos = content.length();
continue;
}
tmp.append(content.substring(lastPos, pos));
lastPos = pos;
}
return tmp.toString();
}
public static void main(String[] args) {
String html = "<script>alert(1);</script>";
System.out.println(clean(html));
System.out.println(escape(html));
System.out.println(unescape(html));
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\html\EscapeUtil.class

File diff suppressed because it is too large Load Diff

@ -1,82 +1,82 @@
/* */ package com.archive.framework.config.properties
package com.archive.framework.config.properties
;
/* */
/* */ import com.alibaba.druid.pool.DruidDataSource;
/* */ import org.springframework.beans.factory.annotation.Value;
/* */ import org.springframework.context.annotation.Configuration;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Configuration
/* */ public class DruidProperties
/* */ {
/* */ @Value("${spring.datasource.druid.initialSize}")
/* */ private int initialSize;
/* */ @Value("${spring.datasource.druid.minIdle}")
/* */ private int minIdle;
/* */ @Value("${spring.datasource.druid.maxActive}")
/* */ private int maxActive;
/* */ @Value("${spring.datasource.druid.maxWait}")
/* */ private int maxWait;
/* */ @Value("${spring.datasource.druid.timeBetweenEvictionRunsMillis}")
/* */ private int timeBetweenEvictionRunsMillis;
/* */ @Value("${spring.datasource.druid.minEvictableIdleTimeMillis}")
/* */ private int minEvictableIdleTimeMillis;
/* */ @Value("${spring.datasource.druid.maxEvictableIdleTimeMillis}")
/* */ private int maxEvictableIdleTimeMillis;
/* */ @Value("${spring.datasource.druid.validationQuery}")
/* */ private String validationQuery;
/* */ @Value("${spring.datasource.druid.testWhileIdle}")
/* */ private boolean testWhileIdle;
/* */ @Value("${spring.datasource.druid.testOnBorrow}")
/* */ private boolean testOnBorrow;
/* */ @Value("${spring.datasource.druid.testOnReturn}")
/* */ private boolean testOnReturn;
/* */
/* */ public DruidDataSource dataSource(DruidDataSource datasource) {
/* 51 */ datasource.setInitialSize(this.initialSize);
/* 52 */ datasource.setMaxActive(this.maxActive);
/* 53 */ datasource.setMinIdle(this.minIdle);
/* */
/* */
/* 56 */ datasource.setMaxWait(this.maxWait);
/* */
/* */
/* 59 */ datasource.setTimeBetweenEvictionRunsMillis(this.timeBetweenEvictionRunsMillis);
/* */
/* */
/* 62 */ datasource.setMinEvictableIdleTimeMillis(this.minEvictableIdleTimeMillis);
/* 63 */ datasource.setMaxEvictableIdleTimeMillis(this.maxEvictableIdleTimeMillis);
/* */
/* */
/* */
/* */
/* 68 */ datasource.setValidationQuery(this.validationQuery);
/* */
/* 70 */ datasource.setTestWhileIdle(this.testWhileIdle);
/* */
/* 72 */ datasource.setTestOnBorrow(this.testOnBorrow);
/* */
/* 74 */ datasource.setTestOnReturn(this.testOnReturn);
/* 75 */ return datasource;
/* */ }
/* */ }
import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
@Configuration
public class DruidProperties
{
@Value("${spring.datasource.druid.initialSize}")
private int initialSize;
@Value("${spring.datasource.druid.minIdle}")
private int minIdle;
@Value("${spring.datasource.druid.maxActive}")
private int maxActive;
@Value("${spring.datasource.druid.maxWait}")
private int maxWait;
@Value("${spring.datasource.druid.timeBetweenEvictionRunsMillis}")
private int timeBetweenEvictionRunsMillis;
@Value("${spring.datasource.druid.minEvictableIdleTimeMillis}")
private int minEvictableIdleTimeMillis;
@Value("${spring.datasource.druid.maxEvictableIdleTimeMillis}")
private int maxEvictableIdleTimeMillis;
@Value("${spring.datasource.druid.validationQuery}")
private String validationQuery;
@Value("${spring.datasource.druid.testWhileIdle}")
private boolean testWhileIdle;
@Value("${spring.datasource.druid.testOnBorrow}")
private boolean testOnBorrow;
@Value("${spring.datasource.druid.testOnReturn}")
private boolean testOnReturn;
public DruidDataSource dataSource(DruidDataSource datasource) {
datasource.setInitialSize(this.initialSize);
datasource.setMaxActive(this.maxActive);
datasource.setMinIdle(this.minIdle);
datasource.setMaxWait(this.maxWait);
datasource.setTimeBetweenEvictionRunsMillis(this.timeBetweenEvictionRunsMillis);
datasource.setMinEvictableIdleTimeMillis(this.minEvictableIdleTimeMillis);
datasource.setMaxEvictableIdleTimeMillis(this.maxEvictableIdleTimeMillis);
datasource.setValidationQuery(this.validationQuery);
datasource.setTestWhileIdle(this.testWhileIdle);
datasource.setTestOnBorrow(this.testOnBorrow);
datasource.setTestOnReturn(this.testOnReturn);
return datasource;
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\config\properties\DruidProperties.class

@ -1,31 +1,31 @@
/* */ package com.archive.framework.datasource
package com.archive.framework.datasource
;
/* */
/* */ import com.archive.framework.datasource.DynamicDataSourceContextHolder;
/* */ import java.util.Map;
/* */ import javax.sql.DataSource;
/* */ import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
/* */
/* */
/* */
/* */
/* */
/* */ public class DynamicDataSource
/* */ extends AbstractRoutingDataSource
/* */ {
/* */ public DynamicDataSource(DataSource defaultTargetDataSource, Map<Object, Object> targetDataSources) {
/* 16 */ setDefaultTargetDataSource(defaultTargetDataSource);
/* 17 */ setTargetDataSources(targetDataSources);
/* 18 */ afterPropertiesSet();
/* */ }
/* */
/* */
/* */
/* */ protected Object determineCurrentLookupKey() {
/* 24 */ return DynamicDataSourceContextHolder.getDataSourceType();
/* */ }
/* */ }
import com.archive.framework.datasource.DynamicDataSourceContextHolder;
import java.util.Map;
import javax.sql.DataSource;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
public class DynamicDataSource
extends AbstractRoutingDataSource
{
public DynamicDataSource(DataSource defaultTargetDataSource, Map<Object, Object> targetDataSources) {
setDefaultTargetDataSource(defaultTargetDataSource);
setTargetDataSources(targetDataSources);
afterPropertiesSet();
}
protected Object determineCurrentLookupKey() {
return DynamicDataSourceContextHolder.getDataSourceType();
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\datasource\DynamicDataSource.class

@ -1,50 +1,50 @@
/* */ package com.archive.framework.datasource
package com.archive.framework.datasource
;
/* */
/* */ import org.slf4j.Logger;
/* */ import org.slf4j.LoggerFactory;
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class DynamicDataSourceContextHolder
/* */ {
/* 13 */ public static final Logger log = LoggerFactory.getLogger(com.archive.framework.datasource.DynamicDataSourceContextHolder.class);
/* */
/* */
/* */
/* */
/* */
/* 19 */ private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<>();
/* */
/* */
/* */
/* */
/* */
/* */ public static void setDataSourceType(String dsType) {
/* 26 */ log.info("切换到{}数据源", dsType);
/* 27 */ CONTEXT_HOLDER.set(dsType);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public static String getDataSourceType() {
/* 35 */ return CONTEXT_HOLDER.get();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public static void clearDataSourceType() {
/* 43 */ CONTEXT_HOLDER.remove();
/* */ }
/* */ }
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class DynamicDataSourceContextHolder
{
public static final Logger log = LoggerFactory.getLogger(com.archive.framework.datasource.DynamicDataSourceContextHolder.class);
private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<>();
public static void setDataSourceType(String dsType) {
log.info("切换到{}数据源", dsType);
CONTEXT_HOLDER.set(dsType);
}
public static String getDataSourceType() {
return CONTEXT_HOLDER.get();
}
public static void clearDataSourceType() {
CONTEXT_HOLDER.remove();
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\datasource\DynamicDataSourceContextHolder.class

@ -1,51 +1,51 @@
/* */ package com.archive.framework.web.service
package com.archive.framework.web.service
;
/* */
/* */ import com.archive.project.system.dict.domain.DictData;
/* */ import com.archive.project.system.dict.service.IDictDataService;
/* */ import com.archive.project.system.dict.service.IDictTypeService;
/* */ import java.util.List;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Service;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Service("dict")
/* */ public class DictService
/* */ {
/* */ @Autowired
/* */ private IDictTypeService dictTypeService;
/* */ @Autowired
/* */ private IDictDataService dictDataService;
/* */
/* */ public List<DictData> getType(String dictType) {
/* 32 */ return this.dictTypeService.selectDictDataByType(dictType);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public String getLabel(String dictType, String dictValue) {
/* 44 */ return this.dictDataService.selectDictLabel(dictType, dictValue);
/* */ }
/* */ }
import com.archive.project.system.dict.domain.DictData;
import com.archive.project.system.dict.service.IDictDataService;
import com.archive.project.system.dict.service.IDictTypeService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("dict")
public class DictService
{
@Autowired
private IDictTypeService dictTypeService;
@Autowired
private IDictDataService dictDataService;
public List<DictData> getType(String dictType) {
return this.dictTypeService.selectDictDataByType(dictType);
}
public String getLabel(String dictType, String dictValue) {
return this.dictDataService.selectDictLabel(dictType, dictValue);
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\web\service\DictService.class

@ -1,113 +1,113 @@
/* */ package com.archive.project.document.controller
package com.archive.project.document.controller
;
/* */
/* */ import com.archive.common.archiveUtil.TableUtil;
/* */ import com.archive.framework.web.controller.BaseController;
/* */ import com.archive.framework.web.domain.AjaxResult;
/* */ import com.archive.framework.web.page.TableDataInfo;
/* */ import com.archive.project.dasz.archivetype.domain.ArchiveType;
/* */ import com.archive.project.dasz.archivetype.service.IArchiveTypeService;
/* */ import com.archive.project.dasz.physicaltable.service.IPhysicalTableService;
/* */ import com.archive.project.dasz.physicaltablecolumn.service.IPhysicalTableColumnService;
/* */ import com.archive.project.document.domain.Document;
/* */ import com.archive.project.document.service.IDocumentService;
/* */ import java.util.List;
/* */ import org.apache.shiro.authz.annotation.RequiresPermissions;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Controller;
/* */ import org.springframework.ui.ModelMap;
/* */ import org.springframework.web.bind.annotation.GetMapping;
/* */ import org.springframework.web.bind.annotation.PathVariable;
/* */ import org.springframework.web.bind.annotation.PostMapping;
/* */ import org.springframework.web.bind.annotation.RequestMapping;
/* */ import org.springframework.web.bind.annotation.ResponseBody;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Controller
/* */ @RequestMapping({"/document"})
/* */ public class DocumentController
/* */ extends BaseController
/* */ {
/* 47 */ private String prefix = "document";
/* */
/* */ @Autowired
/* */ private IDocumentService documentService;
/* */
/* */ @Autowired
/* */ private IArchiveTypeService archiveTypeService;
/* */
/* */ @Autowired
/* */ private IPhysicalTableColumnService physicalTableColumnService;
/* */
/* */ @Autowired
/* */ private IPhysicalTableService physicalTableService;
/* */
/* */
/* */ @RequiresPermissions({"document"})
/* */ @GetMapping
/* */ public String document() {
/* 65 */ return this.prefix + "/document";
/* */ }
/* */
/* */
/* */ @RequiresPermissions({"document:qwgl"})
/* */ @GetMapping({"/qwgl/{archiveId}/{type}/{id}"})
/* */ public String qwgl(@PathVariable("archiveId") long archiveId, @PathVariable("type") String type, @PathVariable("id") String id, ModelMap mmap) {
/* 72 */ long tableId = TableUtil.getTableIdByArchiveTypeId(archiveId);
/* 73 */ mmap.put("tableId", Long.valueOf(tableId));
/* 74 */ mmap.put("fileId", id);
/* 75 */ mmap.put("archiveTypeId", Long.valueOf(archiveId));
/* 76 */ return this.prefix + "/document";
/* */ }
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"document:list"})
/* */ @PostMapping({"/list"})
/* */ @ResponseBody
/* */ public TableDataInfo list(String ownerId, String tableId) {
/* 86 */ startPage();
/* 87 */ Document document = new Document();
/* 88 */ document.setTableId(tableId);
/* 89 */ document.setOwnerid(ownerId);
/* 90 */ List<Document> list = this.documentService.selectDocumentList(document);
/* 91 */ return getDataTable(list);
/* */ }
/* */
/* */ @PostMapping({"/delete"})
/* */ @ResponseBody
/* */ public AjaxResult delete(String id, String tableId) throws Exception {
/* 97 */ boolean res = this.documentService.deleteDocument(id, tableId);
/* */
/* 99 */ return AjaxResult.success(!res ? "false" : "true");
/* */ }
/* */
/* */ @PostMapping({"/getArchiveTypeByTableId"})
/* */ @ResponseBody
/* */ public AjaxResult getArchiveTypeByTableId(String tableId) {
/* 105 */ ArchiveType archiveType = this.documentService.selectArchiveTypeByTableId(tableId);
/* 106 */ return AjaxResult.success(archiveType);
/* */ }
/* */ }
import com.archive.common.archiveUtil.TableUtil;
import com.archive.framework.web.controller.BaseController;
import com.archive.framework.web.domain.AjaxResult;
import com.archive.framework.web.page.TableDataInfo;
import com.archive.project.dasz.archivetype.domain.ArchiveType;
import com.archive.project.dasz.archivetype.service.IArchiveTypeService;
import com.archive.project.dasz.physicaltable.service.IPhysicalTableService;
import com.archive.project.dasz.physicaltablecolumn.service.IPhysicalTableColumnService;
import com.archive.project.document.domain.Document;
import com.archive.project.document.service.IDocumentService;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping({"/document"})
public class DocumentController
extends BaseController
{
private String prefix = "document";
@Autowired
private IDocumentService documentService;
@Autowired
private IArchiveTypeService archiveTypeService;
@Autowired
private IPhysicalTableColumnService physicalTableColumnService;
@Autowired
private IPhysicalTableService physicalTableService;
@RequiresPermissions({"document"})
@GetMapping
public String document() {
return this.prefix + "/document";
}
@RequiresPermissions({"document:qwgl"})
@GetMapping({"/qwgl/{archiveId}/{type}/{id}"})
public String qwgl(@PathVariable("archiveId") long archiveId, @PathVariable("type") String type, @PathVariable("id") String id, ModelMap mmap) {
long tableId = TableUtil.getTableIdByArchiveTypeId(archiveId);
mmap.put("tableId", Long.valueOf(tableId));
mmap.put("fileId", id);
mmap.put("archiveTypeId", Long.valueOf(archiveId));
return this.prefix + "/document";
}
@RequiresPermissions({"document:list"})
@PostMapping({"/list"})
@ResponseBody
public TableDataInfo list(String ownerId, String tableId) {
startPage();
Document document = new Document();
document.setTableId(tableId);
document.setOwnerid(ownerId);
List<Document> list = this.documentService.selectDocumentList(document);
return getDataTable(list);
}
@PostMapping({"/delete"})
@ResponseBody
public AjaxResult delete(String id, String tableId) throws Exception {
boolean res = this.documentService.deleteDocument(id, tableId);
return AjaxResult.success(!res ? "false" : "true");
}
@PostMapping({"/getArchiveTypeByTableId"})
@ResponseBody
public AjaxResult getArchiveTypeByTableId(String tableId) {
ArchiveType archiveType = this.documentService.selectArchiveTypeByTableId(tableId);
return AjaxResult.success(archiveType);
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\document\controller\DocumentController.class

@ -1,140 +1,140 @@
/* */ package com.archive.project.document.domain;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class Document
/* */ {
/* */ private static final long serialVersionUID = 1L;
/* */ private Long id;
/* */ private String createTime;
/* */ private String createUser;
/* */ private String fileName;
/* */ private String filehz;
/* */ private String filesize;
/* */ private String filepath;
/* */ private String filewaterpath;
/* */ private Long batcharchivetypeid;
/* */ private String ownerid;
/* */ private String tableId;
/* */
/* */ public Long getId() {
/* 51 */ return this.id;
/* */ }
/* */
/* */ public void setId(Long id) {
/* 55 */ this.id = id;
/* */ }
/* */
/* */ public String getCreateTime() {
/* 59 */ return this.createTime;
/* */ }
/* */
/* */ public void setCreateTime(String createTime) {
/* 63 */ this.createTime = createTime;
/* */ }
/* */
/* */ public String getCreateUser() {
/* 67 */ return this.createUser;
/* */ }
/* */
/* */ public void setCreateUser(String createUser) {
/* 71 */ this.createUser = createUser;
/* */ }
/* */
/* */ public String getFileName() {
/* 75 */ return this.fileName;
/* */ }
/* */
/* */ public void setFileName(String fileName) {
/* 79 */ this.fileName = fileName;
/* */ }
/* */
/* */ public String getFilehz() {
/* 83 */ return this.filehz;
/* */ }
/* */
/* */ public void setFilehz(String filehz) {
/* 87 */ this.filehz = filehz;
/* */ }
/* */
/* */ public String getFilesize() {
/* 91 */ return this.filesize;
/* */ }
/* */
/* */ public void setFilesize(String filesize) {
/* 95 */ this.filesize = filesize;
/* */ }
/* */
/* */ public String getFilepath() {
/* 99 */ return this.filepath;
/* */ }
/* */
/* */ public void setFilepath(String filepath) {
/* 103 */ this.filepath = filepath;
/* */ }
/* */
/* */ public String getFilewaterpath() {
/* 107 */ return this.filewaterpath;
/* */ }
/* */
/* */ public void setFilewaterpath(String filewaterpath) {
/* 111 */ this.filewaterpath = filewaterpath;
/* */ }
/* */
/* */ public Long getBatcharchivetypeid() {
/* 115 */ return this.batcharchivetypeid;
/* */ }
/* */
/* */ public void setBatcharchivetypeid(Long batcharchivetypeid) {
/* 119 */ this.batcharchivetypeid = batcharchivetypeid;
/* */ }
/* */
/* */ public String getOwnerid() {
/* 123 */ return this.ownerid;
/* */ }
/* */
/* */ public void setOwnerid(String ownerid) {
/* 127 */ this.ownerid = ownerid;
/* */ }
/* */
/* */ public String getTableId() {
/* 131 */ return this.tableId;
/* */ }
/* */
/* */ public void setTableId(String tableId) {
/* 135 */ this.tableId = tableId;
/* */ }
/* */ }
package com.archive.project.document.domain;
public class Document
{
private static final long serialVersionUID = 1L;
private Long id;
private String createTime;
private String createUser;
private String fileName;
private String filehz;
private String filesize;
private String filepath;
private String filewaterpath;
private Long batcharchivetypeid;
private String ownerid;
private String tableId;
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getCreateTime() {
return this.createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getCreateUser() {
return this.createUser;
}
public void setCreateUser(String createUser) {
this.createUser = createUser;
}
public String getFileName() {
return this.fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getFilehz() {
return this.filehz;
}
public void setFilehz(String filehz) {
this.filehz = filehz;
}
public String getFilesize() {
return this.filesize;
}
public void setFilesize(String filesize) {
this.filesize = filesize;
}
public String getFilepath() {
return this.filepath;
}
public void setFilepath(String filepath) {
this.filepath = filepath;
}
public String getFilewaterpath() {
return this.filewaterpath;
}
public void setFilewaterpath(String filewaterpath) {
this.filewaterpath = filewaterpath;
}
public Long getBatcharchivetypeid() {
return this.batcharchivetypeid;
}
public void setBatcharchivetypeid(Long batcharchivetypeid) {
this.batcharchivetypeid = batcharchivetypeid;
}
public String getOwnerid() {
return this.ownerid;
}
public void setOwnerid(String ownerid) {
this.ownerid = ownerid;
}
public String getTableId() {
return this.tableId;
}
public void setTableId(String tableId) {
this.tableId = tableId;
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\document\domain\Document.class

@ -1,211 +1,211 @@
/* */ package com.archive.project.document.service.impl
package com.archive.project.document.service.impl
;
/* */
/* */ import com.archive.common.archiveUtil.FileUtils;
/* */ import com.archive.common.archiveUtil.TableUtil;
/* */ import com.archive.common.utils.DateUtils;
/* */ import com.archive.common.utils.security.ShiroUtils;
/* */ import com.archive.framework.config.ArchiveConfig;
/* */ import com.archive.project.common.service.IExecuteSqlService;
/* */ import com.archive.project.dajs.archiveimportbatch.service.IArchiveImportBatchService;
/* */ import com.archive.project.dasz.archivetype.domain.ArchiveType;
/* */ import com.archive.project.dasz.archivetype.mapper.ArchiveTypeMapper;
/* */ import com.archive.project.dasz.ccgl.service.ICcglService;
/* */ import com.archive.project.dasz.physicaltable.domain.PhysicalTable;
/* */ import com.archive.project.dasz.physicaltable.mapper.PhysicalTableMapper;
/* */ import com.archive.project.dasz.physicaltablecolumn.mapper.PhysicalTableColumnMapper;
/* */ import com.archive.project.document.domain.Document;
/* */ import com.archive.project.document.service.IDocumentService;
/* */ import com.archive.project.system.dict.service.IDictTypeService;
/* */ import com.archive.project.system.user.domain.User;
/* */ import java.io.File;
/* */ import java.io.IOException;
/* */ import java.util.ArrayList;
/* */ import java.util.HashMap;
/* */ import java.util.LinkedHashMap;
/* */ import java.util.List;
/* */ import java.util.Map;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Service;
/* */ import org.springframework.web.multipart.MultipartFile;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Service
/* */ public class DocumentServiceImpl
/* */ implements IDocumentService
/* */ {
/* */ @Autowired
/* */ private ArchiveTypeMapper archiveTypeMapper;
/* */ @Autowired
/* */ private PhysicalTableMapper physicalTableMapper;
/* */ @Autowired
/* */ private PhysicalTableColumnMapper physicalTableColumnMapper;
/* */ @Autowired
/* */ private IExecuteSqlService executeSqlService;
/* */ @Autowired
/* */ private ICcglService ccglService;
/* */ @Autowired
/* */ private IDictTypeService dictTypeService;
/* */ @Autowired
/* */ private IArchiveImportBatchService iArchiveImportBatchService;
/* */
/* */ public List<Document> selectDocumentList(Document document) {
/* 64 */ List<Document> list = new ArrayList<>();
/* 65 */ if (document.getOwnerid() != null && document.getTableId() != null) {
/* 66 */ String ownerid = document.getOwnerid();
/* 67 */ String tableId = document.getTableId();
/* 68 */ String tableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(tableId)));
/* 69 */ String docuumentTableName = tableName.toLowerCase().replace("_folder", "_document");
/* 70 */ docuumentTableName = docuumentTableName.toLowerCase().replace("_file", "_document");
/* 71 */ String docTableId = TableUtil.getTableId(docuumentTableName);
/* 72 */ String sql = "select id,create_Time,create_User,fileName,filehz,filesize,filepath,filewaterpath,batcharchivetypeid,ownerid,tableId from " + docuumentTableName + " where ownerid='" + ownerid + "' and tableId='" + tableId + "'";
/* */
/* 74 */ List<LinkedHashMap<String, Object>> datalist = this.executeSqlService.queryList(sql);
/* 75 */ for (int i = 0; i < datalist.size(); i++) {
/* 76 */ Document dc = new Document();
/* 77 */ dc.setId(Long.valueOf((((LinkedHashMap)datalist.get(i)).get("id") == null) ? 0L : Long.parseLong(((LinkedHashMap)datalist.get(i)).get("id").toString())));
/* 78 */ dc.setCreateTime((((LinkedHashMap)datalist.get(i)).get("create_Time") == null) ? "" : ((LinkedHashMap)datalist.get(i)).get("create_Time").toString());
/* 79 */ dc.setCreateUser((((LinkedHashMap)datalist.get(i)).get("create_User") == null) ? "" : ((LinkedHashMap)datalist.get(i)).get("create_User").toString());
/* 80 */ dc.setFileName((((LinkedHashMap)datalist.get(i)).get("fileName") == null) ? "" : ((LinkedHashMap)datalist.get(i)).get("fileName").toString());
/* 81 */ dc.setFilehz((((LinkedHashMap)datalist.get(i)).get("filehz") == null) ? "" : ((LinkedHashMap)datalist.get(i)).get("filehz").toString());
/* 82 */ dc.setFilesize((((LinkedHashMap)datalist.get(i)).get("filesize") == null) ? "" : ((LinkedHashMap)datalist.get(i)).get("filesize").toString());
/* 83 */ dc.setFilepath((((LinkedHashMap)datalist.get(i)).get("filepath") == null) ? "" : ((LinkedHashMap)datalist.get(i)).get("filepath").toString());
/* 84 */ dc.setFilewaterpath((((LinkedHashMap)datalist.get(i)).get("filewaterpath") == null) ? "" : ((LinkedHashMap)datalist.get(i)).get("filewaterpath").toString());
/* 85 */ dc.setBatcharchivetypeid(Long.valueOf((((LinkedHashMap)datalist.get(i)).get("batcharchivetypeid") == null) ? 0L : Long.parseLong(((LinkedHashMap)datalist.get(i)).get("batcharchivetypeid").toString())));
/* 86 */ dc.setOwnerid((((LinkedHashMap)datalist.get(i)).get("ownerid") == null) ? "0" : ((LinkedHashMap)datalist.get(i)).get("ownerid").toString());
/* 87 */ dc.setTableId((((LinkedHashMap)datalist.get(i)).get("tableId") == null) ? "0" : ((LinkedHashMap)datalist.get(i)).get("tableId").toString());
/* 88 */ list.add(dc);
/* */ }
/* */ }
/* 91 */ return list;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public Map<String, Object> getTableIdByArchiveTypeId(String archiveTypeId, String type) {
/* 105 */ Map<String, Object> map = new HashMap<>();
/* 106 */ PhysicalTable physicalTable = new PhysicalTable();
/* 107 */ physicalTable.setTableCode(type);
/* 108 */ physicalTable.setArchivetypeid(archiveTypeId);
/* 109 */ List<PhysicalTable> tablesList = this.physicalTableMapper.selectPhysicalTableList(physicalTable);
/* 110 */ if (tablesList != null && tablesList.size() > 0) {
/* 111 */ String tableName = ((PhysicalTable)tablesList.get(0)).getTablename();
/* 112 */ Long tableId = ((PhysicalTable)tablesList.get(0)).getId();
/* 113 */ map.put("tableId", tableId);
/* 114 */ map.put("tableName", tableName);
/* */ }
/* 116 */ return map;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public boolean uploadFile(MultipartFile[] files, long tableId, long id) throws IOException {
/* 128 */ boolean res = false;
/* 129 */ if (files != null) {
/* 130 */ for (int i = 0; i < files.length; i++) {
/* 131 */ String fileName = files[i].getOriginalFilename();
/* */
/* */
/* 134 */ String xdlj = this.ccglService.getCreateDocumentPathByFile(id, tableId);
/* 135 */ String filepath = ArchiveConfig.getInstance().getUploadPath() + File.separator + "DocumentFile" + File.separator + xdlj;
/* */
/* 137 */ File localFile = new File(filepath);
/* 138 */ if (!localFile.exists()) {
/* 139 */ localFile.mkdirs();
/* */ }
/* 141 */ String path = filepath + File.separator + fileName;
/* 142 */ File server_file = new File(path);
/* 143 */ files[i].transferTo(server_file);
/* 144 */ String newfileName = server_file.getName().substring(0, server_file.getName().lastIndexOf("."));
/* 145 */ String hz = server_file.getName().substring(server_file.getName().lastIndexOf(".") + 1, server_file.getName().length());
/* 146 */ String fileSize = FileUtils.changeValueType(Long.valueOf(server_file.length()));
/* */
/* 148 */ String tableName = TableUtil.getTableName(Long.valueOf(tableId));
/* 149 */ String docuumentTableName = tableName.toLowerCase().replace("_file", "_document");
/* 150 */ String docTableId = TableUtil.getTableId(docuumentTableName);
/* 151 */ long newId = this.iArchiveImportBatchService.getTableNewId(Long.parseLong(docTableId));
/* 152 */ User user = ShiroUtils.getSysUser();
/* 153 */ String loginName = user.getLoginName();
/* */
/* */
/* 156 */ String inserSql = "insert into " + docuumentTableName + "(id,ownerid,filename,filesize,filepath,filehz,tableId,create_user,create_time) values(" + newId + "," + id + ",'" + newfileName + "','" + fileSize + "','" + server_file.getPath().replaceAll("\\\\", "\\\\\\\\") + "','" + hz + "','" + tableId + "','" + loginName + "','" + DateUtils.getTime() + "')";
/* 157 */ res = this.executeSqlService.insert(inserSql);
/* 158 */ System.out.println("文件" + path + "上传成功");
/* */ }
/* */ }
/* 161 */ return res;
/* */ }
/* */
/* */
/* */ public boolean deleteDocument(String id, String tableId) throws Exception {
/* 166 */ boolean res = false;
/* 167 */ String fileTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(tableId)));
/* 168 */ String docTableName = fileTableName.toUpperCase().replace("_FOLDER", "_DOCUMENT");
/* 169 */ docTableName = docTableName.toUpperCase().replace("_FILE", "_DOCUMENT");
/* */
/* */
/* 172 */ String selectSql = "select filepath,filewaterpath,ownerid from " + docTableName + " where id=" + id;
/* 173 */ List<LinkedHashMap<String, Object>> datalist = this.executeSqlService.queryList(selectSql);
/* 174 */ if (datalist != null && datalist.size() > 0 && datalist.get(0) != null) {
/* 175 */ String path = (((LinkedHashMap)datalist.get(0)).get("filepath") == null) ? "" : ((LinkedHashMap)datalist.get(0)).get("filepath").toString();
/* */
/* 177 */ String waterPath = (((LinkedHashMap)datalist.get(0)).get("filewaterpath") == null) ? "" : ((LinkedHashMap)datalist.get(0)).get("filewaterpath").toString();
/* 178 */ String ownerId = (((LinkedHashMap)datalist.get(0)).get("ownerid") == null) ? "" : ((LinkedHashMap)datalist.get(0)).get("ownerid").toString();
/* 179 */ File file = new File(path);
/* 180 */ if (file.exists()) {
/* 181 */ file.delete();
/* */ }
/* 183 */ File waterFile = new File(waterPath);
/* 184 */ if (waterFile.exists()) {
/* 185 */ waterFile.delete();
/* */ }
/* 187 */ String sql = "delete from " + docTableName + " where id=" + id;
/* 188 */ res = this.executeSqlService.delete(sql);
/* */
/* 190 */ String updateSql = "update " + fileTableName + " set dqzws=dqzws-1 where id=" + ownerId;
/* 191 */ this.executeSqlService.update(updateSql);
/* */ }
/* 193 */ return res;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public ArchiveType selectArchiveTypeByTableId(String tableId) {
/* 203 */ long archiveTypeId = TableUtil.getArchiveTypeIdByTableId(Long.parseLong(tableId));
/* 204 */ return this.archiveTypeMapper.selectArchiveTypeById(Long.valueOf(archiveTypeId));
/* */ }
/* */ }
import com.archive.common.archiveUtil.FileUtils;
import com.archive.common.archiveUtil.TableUtil;
import com.archive.common.utils.DateUtils;
import com.archive.common.utils.security.ShiroUtils;
import com.archive.framework.config.ArchiveConfig;
import com.archive.project.common.service.IExecuteSqlService;
import com.archive.project.dajs.archiveimportbatch.service.IArchiveImportBatchService;
import com.archive.project.dasz.archivetype.domain.ArchiveType;
import com.archive.project.dasz.archivetype.mapper.ArchiveTypeMapper;
import com.archive.project.dasz.ccgl.service.ICcglService;
import com.archive.project.dasz.physicaltable.domain.PhysicalTable;
import com.archive.project.dasz.physicaltable.mapper.PhysicalTableMapper;
import com.archive.project.dasz.physicaltablecolumn.mapper.PhysicalTableColumnMapper;
import com.archive.project.document.domain.Document;
import com.archive.project.document.service.IDocumentService;
import com.archive.project.system.dict.service.IDictTypeService;
import com.archive.project.system.user.domain.User;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@Service
public class DocumentServiceImpl
implements IDocumentService
{
@Autowired
private ArchiveTypeMapper archiveTypeMapper;
@Autowired
private PhysicalTableMapper physicalTableMapper;
@Autowired
private PhysicalTableColumnMapper physicalTableColumnMapper;
@Autowired
private IExecuteSqlService executeSqlService;
@Autowired
private ICcglService ccglService;
@Autowired
private IDictTypeService dictTypeService;
@Autowired
private IArchiveImportBatchService iArchiveImportBatchService;
public List<Document> selectDocumentList(Document document) {
List<Document> list = new ArrayList<>();
if (document.getOwnerid() != null && document.getTableId() != null) {
String ownerid = document.getOwnerid();
String tableId = document.getTableId();
String tableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(tableId)));
String docuumentTableName = tableName.toLowerCase().replace("_folder", "_document");
docuumentTableName = docuumentTableName.toLowerCase().replace("_file", "_document");
String docTableId = TableUtil.getTableId(docuumentTableName);
String sql = "select id,create_Time,create_User,fileName,filehz,filesize,filepath,filewaterpath,batcharchivetypeid,ownerid,tableId from " + docuumentTableName + " where ownerid='" + ownerid + "' and tableId='" + tableId + "'";
List<LinkedHashMap<String, Object>> datalist = this.executeSqlService.queryList(sql);
for (int i = 0; i < datalist.size(); i++) {
Document dc = new Document();
dc.setId(Long.valueOf((((LinkedHashMap)datalist.get(i)).get("id") == null) ? 0L : Long.parseLong(((LinkedHashMap)datalist.get(i)).get("id").toString())));
dc.setCreateTime((((LinkedHashMap)datalist.get(i)).get("create_Time") == null) ? "" : ((LinkedHashMap)datalist.get(i)).get("create_Time").toString());
dc.setCreateUser((((LinkedHashMap)datalist.get(i)).get("create_User") == null) ? "" : ((LinkedHashMap)datalist.get(i)).get("create_User").toString());
dc.setFileName((((LinkedHashMap)datalist.get(i)).get("fileName") == null) ? "" : ((LinkedHashMap)datalist.get(i)).get("fileName").toString());
dc.setFilehz((((LinkedHashMap)datalist.get(i)).get("filehz") == null) ? "" : ((LinkedHashMap)datalist.get(i)).get("filehz").toString());
dc.setFilesize((((LinkedHashMap)datalist.get(i)).get("filesize") == null) ? "" : ((LinkedHashMap)datalist.get(i)).get("filesize").toString());
dc.setFilepath((((LinkedHashMap)datalist.get(i)).get("filepath") == null) ? "" : ((LinkedHashMap)datalist.get(i)).get("filepath").toString());
dc.setFilewaterpath((((LinkedHashMap)datalist.get(i)).get("filewaterpath") == null) ? "" : ((LinkedHashMap)datalist.get(i)).get("filewaterpath").toString());
dc.setBatcharchivetypeid(Long.valueOf((((LinkedHashMap)datalist.get(i)).get("batcharchivetypeid") == null) ? 0L : Long.parseLong(((LinkedHashMap)datalist.get(i)).get("batcharchivetypeid").toString())));
dc.setOwnerid((((LinkedHashMap)datalist.get(i)).get("ownerid") == null) ? "0" : ((LinkedHashMap)datalist.get(i)).get("ownerid").toString());
dc.setTableId((((LinkedHashMap)datalist.get(i)).get("tableId") == null) ? "0" : ((LinkedHashMap)datalist.get(i)).get("tableId").toString());
list.add(dc);
}
}
return list;
}
public Map<String, Object> getTableIdByArchiveTypeId(String archiveTypeId, String type) {
Map<String, Object> map = new HashMap<>();
PhysicalTable physicalTable = new PhysicalTable();
physicalTable.setTableCode(type);
physicalTable.setArchivetypeid(archiveTypeId);
List<PhysicalTable> tablesList = this.physicalTableMapper.selectPhysicalTableList(physicalTable);
if (tablesList != null && tablesList.size() > 0) {
String tableName = ((PhysicalTable)tablesList.get(0)).getTablename();
Long tableId = ((PhysicalTable)tablesList.get(0)).getId();
map.put("tableId", tableId);
map.put("tableName", tableName);
}
return map;
}
public boolean uploadFile(MultipartFile[] files, long tableId, long id) throws IOException {
boolean res = false;
if (files != null) {
for (int i = 0; i < files.length; i++) {
String fileName = files[i].getOriginalFilename();
String xdlj = this.ccglService.getCreateDocumentPathByFile(id, tableId);
String filepath = ArchiveConfig.getInstance().getUploadPath() + File.separator + "DocumentFile" + File.separator + xdlj;
File localFile = new File(filepath);
if (!localFile.exists()) {
localFile.mkdirs();
}
String path = filepath + File.separator + fileName;
File server_file = new File(path);
files[i].transferTo(server_file);
String newfileName = server_file.getName().substring(0, server_file.getName().lastIndexOf("."));
String hz = server_file.getName().substring(server_file.getName().lastIndexOf(".") + 1, server_file.getName().length());
String fileSize = FileUtils.changeValueType(Long.valueOf(server_file.length()));
String tableName = TableUtil.getTableName(Long.valueOf(tableId));
String docuumentTableName = tableName.toLowerCase().replace("_file", "_document");
String docTableId = TableUtil.getTableId(docuumentTableName);
long newId = this.iArchiveImportBatchService.getTableNewId(Long.parseLong(docTableId));
User user = ShiroUtils.getSysUser();
String loginName = user.getLoginName();
String inserSql = "insert into " + docuumentTableName + "(id,ownerid,filename,filesize,filepath,filehz,tableId,create_user,create_time) values(" + newId + "," + id + ",'" + newfileName + "','" + fileSize + "','" + server_file.getPath().replaceAll("\\\\", "\\\\\\\\") + "','" + hz + "','" + tableId + "','" + loginName + "','" + DateUtils.getTime() + "')";
res = this.executeSqlService.insert(inserSql);
System.out.println("文件" + path + "上传成功");
}
}
return res;
}
public boolean deleteDocument(String id, String tableId) throws Exception {
boolean res = false;
String fileTableName = TableUtil.getTableName(Long.valueOf(Long.parseLong(tableId)));
String docTableName = fileTableName.toUpperCase().replace("_FOLDER", "_DOCUMENT");
docTableName = docTableName.toUpperCase().replace("_FILE", "_DOCUMENT");
String selectSql = "select filepath,filewaterpath,ownerid from " + docTableName + " where id=" + id;
List<LinkedHashMap<String, Object>> datalist = this.executeSqlService.queryList(selectSql);
if (datalist != null && datalist.size() > 0 && datalist.get(0) != null) {
String path = (((LinkedHashMap)datalist.get(0)).get("filepath") == null) ? "" : ((LinkedHashMap)datalist.get(0)).get("filepath").toString();
String waterPath = (((LinkedHashMap)datalist.get(0)).get("filewaterpath") == null) ? "" : ((LinkedHashMap)datalist.get(0)).get("filewaterpath").toString();
String ownerId = (((LinkedHashMap)datalist.get(0)).get("ownerid") == null) ? "" : ((LinkedHashMap)datalist.get(0)).get("ownerid").toString();
File file = new File(path);
if (file.exists()) {
file.delete();
}
File waterFile = new File(waterPath);
if (waterFile.exists()) {
waterFile.delete();
}
String sql = "delete from " + docTableName + " where id=" + id;
res = this.executeSqlService.delete(sql);
String updateSql = "update " + fileTableName + " set dqzws=dqzws-1 where id=" + ownerId;
this.executeSqlService.update(updateSql);
}
return res;
}
public ArchiveType selectArchiveTypeByTableId(String tableId) {
long archiveTypeId = TableUtil.getArchiveTypeIdByTableId(Long.parseLong(tableId));
return this.archiveTypeMapper.selectArchiveTypeById(Long.valueOf(archiveTypeId));
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\document\service\impl\DocumentServiceImpl.class

@ -1,30 +1,30 @@
/* */ package com.archive.project.monitor.druid
package com.archive.project.monitor.druid
;
/* */
/* */ 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({"/monitor/data"})
/* */ public class DruidController
/* */ extends BaseController
/* */ {
/* 18 */ private String prefix = "/druid";
/* */
/* */
/* */ @RequiresPermissions({"monitor:data:view"})
/* */ @GetMapping
/* */ public String index() {
/* 24 */ return redirect(this.prefix + "/index");
/* */ }
/* */ }
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({"/monitor/data"})
public class DruidController
extends BaseController
{
private String prefix = "/druid";
@RequiresPermissions({"monitor:data:view"})
@GetMapping
public String index() {
return redirect(this.prefix + "/index");
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\monitor\druid\DruidController.class

@ -1,408 +1,408 @@
/* */ package com.archive.project.system.dept.service
package com.archive.project.system.dept.service
;
/* */
/* */ import com.archive.common.exception.BusinessException;
/* */ import com.archive.common.utils.StringUtils;
/* */ import com.archive.common.utils.security.ShiroUtils;
/* */ import com.archive.framework.aspectj.lang.annotation.DataScope;
/* */ import com.archive.framework.config.ArchiveConfig;
/* */ import com.archive.framework.web.domain.Ztree;
/* */ import com.archive.project.system.dept.domain.Dept;
/* */ import com.archive.project.system.dept.mapper.DeptMapper;
/* */ import com.archive.project.system.dept.service.IDeptService;
/* */ import com.archive.project.system.role.domain.Role;
/* */ import java.util.ArrayList;
/* */ import java.util.Iterator;
/* */ import java.util.List;
/* */ import org.apache.commons.lang3.ArrayUtils;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Service;
/* */ import org.springframework.transaction.annotation.Transactional;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Service
/* */ public class DeptServiceImpl
/* */ implements IDeptService
/* */ {
/* */ @Autowired
/* */ private DeptMapper deptMapper;
/* */ @Autowired
/* */ private ArchiveConfig archiveConfig;
/* */
/* */ @DataScope(deptAlias = "d")
/* */ public List<Dept> selectDeptList(Dept dept) {
/* 47 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 48 */ return this.deptMapper.selectDeptList(dept);
/* */ }
/* 50 */ if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 51 */ return this.deptMapper.selectDeptListSqlite(dept);
/* */ }
/* 53 */ return this.deptMapper.selectDeptList(dept);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @DataScope(deptAlias = "d")
/* */ public List<Ztree> selectDeptTree(Dept dept) {
/* 68 */ List<Dept> deptList = null;
/* 69 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 70 */ deptList = this.deptMapper.selectDeptList(dept);
/* */ }
/* 72 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 73 */ deptList = this.deptMapper.selectDeptListSqlite(dept);
/* */ }
/* 75 */ List<Ztree> ztrees = initZtree(deptList);
/* 76 */ return ztrees;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @DataScope(deptAlias = "d")
/* */ public List<Ztree> selectDeptTreeExcludeChild(Dept dept) {
/* 89 */ Long deptId = dept.getDeptId();
/* 90 */ List<Dept> deptList = null;
/* 91 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 92 */ deptList = this.deptMapper.selectDeptList(dept);
/* */ }
/* 94 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 95 */ deptList = this.deptMapper.selectDeptListSqlite(dept);
/* */ }
/* 97 */ Iterator<Dept> it = deptList.iterator();
/* 98 */ while (it.hasNext()) {
/* */
/* 100 */ Dept d = it.next();
/* 101 */ if (d.getDeptId().intValue() == deptId.longValue() ||
/* 102 */ ArrayUtils.contains((Object[])StringUtils.split(d.getAncestors(), ","), deptId + ""))
/* */ {
/* 104 */ it.remove();
/* */ }
/* */ }
/* 107 */ List<Ztree> ztrees = initZtree(deptList);
/* 108 */ return ztrees;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public List<Ztree> roleDeptTreeData(Role role) {
/* 120 */ Long roleId = role.getRoleId();
/* 121 */ List<Ztree> ztrees = new ArrayList<>();
/* 122 */ List<Dept> deptList = selectDeptList(new Dept());
/* 123 */ if (StringUtils.isNotNull(roleId)) {
/* */
/* 125 */ List<String> roleDeptList = null;
/* 126 */ if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 127 */ roleDeptList = this.deptMapper.selectRoleDeptTreeSqlite(roleId);
/* */ } else {
/* 129 */ roleDeptList = this.deptMapper.selectRoleDeptTree(roleId);
/* */ }
/* */
/* 132 */ ztrees = initZtree(deptList, roleDeptList);
/* */ }
/* */ else {
/* */
/* 136 */ ztrees = initZtree(deptList);
/* */ }
/* 138 */ return ztrees;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public List<Ztree> initZtree(List<Dept> deptList) {
/* 149 */ return initZtree(deptList, null);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public List<Ztree> initZtree(List<Dept> deptList, List<String> roleDeptList) {
/* 161 */ List<Ztree> ztrees = new ArrayList<>();
/* 162 */ boolean isCheck = StringUtils.isNotNull(roleDeptList);
/* 163 */ for (Dept dept : deptList) {
/* */
/* 165 */ if ("0".equals(dept.getStatus())) {
/* */
/* 167 */ Ztree ztree = new Ztree();
/* 168 */ ztree.setId(dept.getDeptId());
/* 169 */ ztree.setpId(dept.getParentId());
/* 170 */ ztree.setName(dept.getDeptName());
/* 171 */ ztree.setTitle(dept.getDeptName());
/* 172 */ if (isCheck)
/* */ {
/* 174 */ ztree.setChecked(roleDeptList.contains(dept.getDeptId() + dept.getDeptName()));
/* */ }
/* 176 */ ztrees.add(ztree);
/* */ }
/* */ }
/* 179 */ return ztrees;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int selectDeptCount(Long parentId) {
/* 191 */ Dept dept = new Dept();
/* 192 */ dept.setParentId(parentId);
/* 193 */ return this.deptMapper.selectDeptCount(dept);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public boolean checkDeptExistUser(Long deptId) {
/* 205 */ int result = this.deptMapper.checkDeptExistUser(deptId);
/* 206 */ return (result > 0);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int deleteDeptById(Long deptId) {
/* 218 */ return this.deptMapper.deleteDeptById(deptId);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int insertDept(Dept dept) {
/* 230 */ Dept info = this.deptMapper.selectDeptById(dept.getParentId());
/* */
/* 232 */ if (!"0".equals(info.getStatus()))
/* */ {
/* 234 */ throw new BusinessException("部门停用,不允许新增");
/* */ }
/* 236 */ dept.setCreateBy(ShiroUtils.getLoginName());
/* 237 */ dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
/* 238 */ if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 239 */ return this.deptMapper.insertDeptSqlite(dept);
/* */ }
/* 241 */ return this.deptMapper.insertDept(dept);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Transactional
/* */ public int updateDept(Dept dept) {
/* 255 */ Dept newParentDept = this.deptMapper.selectDeptById(dept.getParentId());
/* 256 */ Dept oldDept = selectDeptById(dept.getDeptId());
/* 257 */ if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) {
/* */
/* 259 */ String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId();
/* 260 */ String oldAncestors = oldDept.getAncestors();
/* 261 */ dept.setAncestors(newAncestors);
/* 262 */ updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors);
/* */ }
/* 264 */ dept.setUpdateBy(ShiroUtils.getLoginName());
/* 265 */ int result = 0;
/* 266 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 267 */ result = this.deptMapper.updateDept(dept);
/* */ }
/* 269 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 270 */ result = this.deptMapper.updateDeptSqlite(dept);
/* */ }
/* */
/* 273 */ if ("0".equals(dept.getStatus()))
/* */ {
/* */
/* 276 */ updateParentDeptStatus(dept);
/* */ }
/* 278 */ return result;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ private void updateParentDeptStatus(Dept dept) {
/* 288 */ String updateBy = dept.getUpdateBy();
/* 289 */ dept = this.deptMapper.selectDeptById(dept.getDeptId());
/* 290 */ dept.setUpdateBy(updateBy);
/* 291 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 292 */ this.deptMapper.updateDeptStatus(dept);
/* */ }
/* 294 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 295 */ this.deptMapper.updateDeptStatusSqlite(dept);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) {
/* 309 */ List<Dept> children = null;
/* 310 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 311 */ children = this.deptMapper.selectChildrenDeptById(deptId);
/* */ }
/* 313 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 314 */ children = this.deptMapper.selectChildrenDeptByIdSqlite(deptId);
/* */ }
/* */
/* 317 */ for (Dept child : children)
/* */ {
/* 319 */ child.setAncestors(child.getAncestors().replace(oldAncestors, newAncestors));
/* */ }
/* 321 */ if (children.size() > 0)
/* */ {
/* 323 */ this.deptMapper.updateDeptChildren(children);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void updateDeptChildren(Long deptId, String ancestors) {
/* 335 */ Dept dept = new Dept();
/* 336 */ dept.setParentId(deptId);
/* 337 */ List<Dept> childrens = null;
/* 338 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 339 */ childrens = this.deptMapper.selectDeptList(dept);
/* */ }
/* 341 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 342 */ childrens = this.deptMapper.selectDeptListSqlite(dept);
/* */ }
/* 344 */ for (Dept children : childrens)
/* */ {
/* 346 */ children.setAncestors(ancestors + "," + dept.getParentId());
/* */ }
/* 348 */ if (childrens.size() > 0)
/* */ {
/* 350 */ this.deptMapper.updateDeptChildren(childrens);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public Dept selectDeptById(Long deptId) {
/* 363 */ return this.deptMapper.selectDeptById(deptId);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int selectNormalChildrenDeptById(Long deptId) {
/* 375 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 376 */ return this.deptMapper.selectNormalChildrenDeptById(deptId);
/* */ }
/* 378 */ if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 379 */ return this.deptMapper.selectNormalChildrenDeptByIdSqlite(deptId);
/* */ }
/* 381 */ return this.deptMapper.selectNormalChildrenDeptById(deptId);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public String checkDeptNameUnique(Dept dept) {
/* 395 */ Long deptId = Long.valueOf(StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId().longValue());
/* 396 */ Dept info = this.deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId());
/* 397 */ if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue())
/* */ {
/* 399 */ return "1";
/* */ }
/* 401 */ return "0";
/* */ }
/* */ }
import com.archive.common.exception.BusinessException;
import com.archive.common.utils.StringUtils;
import com.archive.common.utils.security.ShiroUtils;
import com.archive.framework.aspectj.lang.annotation.DataScope;
import com.archive.framework.config.ArchiveConfig;
import com.archive.framework.web.domain.Ztree;
import com.archive.project.system.dept.domain.Dept;
import com.archive.project.system.dept.mapper.DeptMapper;
import com.archive.project.system.dept.service.IDeptService;
import com.archive.project.system.role.domain.Role;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class DeptServiceImpl
implements IDeptService
{
@Autowired
private DeptMapper deptMapper;
@Autowired
private ArchiveConfig archiveConfig;
@DataScope(deptAlias = "d")
public List<Dept> selectDeptList(Dept dept) {
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
return this.deptMapper.selectDeptList(dept);
}
if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
return this.deptMapper.selectDeptListSqlite(dept);
}
return this.deptMapper.selectDeptList(dept);
}
@DataScope(deptAlias = "d")
public List<Ztree> selectDeptTree(Dept dept) {
List<Dept> deptList = null;
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
deptList = this.deptMapper.selectDeptList(dept);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
deptList = this.deptMapper.selectDeptListSqlite(dept);
}
List<Ztree> ztrees = initZtree(deptList);
return ztrees;
}
@DataScope(deptAlias = "d")
public List<Ztree> selectDeptTreeExcludeChild(Dept dept) {
Long deptId = dept.getDeptId();
List<Dept> deptList = null;
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
deptList = this.deptMapper.selectDeptList(dept);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
deptList = this.deptMapper.selectDeptListSqlite(dept);
}
Iterator<Dept> it = deptList.iterator();
while (it.hasNext()) {
Dept d = it.next();
if (d.getDeptId().intValue() == deptId.longValue() ||
ArrayUtils.contains((Object[])StringUtils.split(d.getAncestors(), ","), deptId + ""))
{
it.remove();
}
}
List<Ztree> ztrees = initZtree(deptList);
return ztrees;
}
public List<Ztree> roleDeptTreeData(Role role) {
Long roleId = role.getRoleId();
List<Ztree> ztrees = new ArrayList<>();
List<Dept> deptList = selectDeptList(new Dept());
if (StringUtils.isNotNull(roleId)) {
List<String> roleDeptList = null;
if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
roleDeptList = this.deptMapper.selectRoleDeptTreeSqlite(roleId);
} else {
roleDeptList = this.deptMapper.selectRoleDeptTree(roleId);
}
ztrees = initZtree(deptList, roleDeptList);
}
else {
ztrees = initZtree(deptList);
}
return ztrees;
}
public List<Ztree> initZtree(List<Dept> deptList) {
return initZtree(deptList, null);
}
public List<Ztree> initZtree(List<Dept> deptList, List<String> roleDeptList) {
List<Ztree> ztrees = new ArrayList<>();
boolean isCheck = StringUtils.isNotNull(roleDeptList);
for (Dept dept : deptList) {
if ("0".equals(dept.getStatus())) {
Ztree ztree = new Ztree();
ztree.setId(dept.getDeptId());
ztree.setpId(dept.getParentId());
ztree.setName(dept.getDeptName());
ztree.setTitle(dept.getDeptName());
if (isCheck)
{
ztree.setChecked(roleDeptList.contains(dept.getDeptId() + dept.getDeptName()));
}
ztrees.add(ztree);
}
}
return ztrees;
}
public int selectDeptCount(Long parentId) {
Dept dept = new Dept();
dept.setParentId(parentId);
return this.deptMapper.selectDeptCount(dept);
}
public boolean checkDeptExistUser(Long deptId) {
int result = this.deptMapper.checkDeptExistUser(deptId);
return (result > 0);
}
public int deleteDeptById(Long deptId) {
return this.deptMapper.deleteDeptById(deptId);
}
public int insertDept(Dept dept) {
Dept info = this.deptMapper.selectDeptById(dept.getParentId());
if (!"0".equals(info.getStatus()))
{
throw new BusinessException("部门停用,不允许新增");
}
dept.setCreateBy(ShiroUtils.getLoginName());
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
return this.deptMapper.insertDeptSqlite(dept);
}
return this.deptMapper.insertDept(dept);
}
@Transactional
public int updateDept(Dept dept) {
Dept newParentDept = this.deptMapper.selectDeptById(dept.getParentId());
Dept oldDept = selectDeptById(dept.getDeptId());
if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) {
String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId();
String oldAncestors = oldDept.getAncestors();
dept.setAncestors(newAncestors);
updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors);
}
dept.setUpdateBy(ShiroUtils.getLoginName());
int result = 0;
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
result = this.deptMapper.updateDept(dept);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
result = this.deptMapper.updateDeptSqlite(dept);
}
if ("0".equals(dept.getStatus()))
{
updateParentDeptStatus(dept);
}
return result;
}
private void updateParentDeptStatus(Dept dept) {
String updateBy = dept.getUpdateBy();
dept = this.deptMapper.selectDeptById(dept.getDeptId());
dept.setUpdateBy(updateBy);
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
this.deptMapper.updateDeptStatus(dept);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
this.deptMapper.updateDeptStatusSqlite(dept);
}
}
public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) {
List<Dept> children = null;
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
children = this.deptMapper.selectChildrenDeptById(deptId);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
children = this.deptMapper.selectChildrenDeptByIdSqlite(deptId);
}
for (Dept child : children)
{
child.setAncestors(child.getAncestors().replace(oldAncestors, newAncestors));
}
if (children.size() > 0)
{
this.deptMapper.updateDeptChildren(children);
}
}
public void updateDeptChildren(Long deptId, String ancestors) {
Dept dept = new Dept();
dept.setParentId(deptId);
List<Dept> childrens = null;
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
childrens = this.deptMapper.selectDeptList(dept);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
childrens = this.deptMapper.selectDeptListSqlite(dept);
}
for (Dept children : childrens)
{
children.setAncestors(ancestors + "," + dept.getParentId());
}
if (childrens.size() > 0)
{
this.deptMapper.updateDeptChildren(childrens);
}
}
public Dept selectDeptById(Long deptId) {
return this.deptMapper.selectDeptById(deptId);
}
public int selectNormalChildrenDeptById(Long deptId) {
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
return this.deptMapper.selectNormalChildrenDeptById(deptId);
}
if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
return this.deptMapper.selectNormalChildrenDeptByIdSqlite(deptId);
}
return this.deptMapper.selectNormalChildrenDeptById(deptId);
}
public String checkDeptNameUnique(Dept dept) {
Long deptId = Long.valueOf(StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId().longValue());
Dept info = this.deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId());
if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue())
{
return "1";
}
return "0";
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\system\dept\service\DeptServiceImpl.class

@ -1,122 +1,122 @@
/* */ package com.archive.project.system.dict.controller
package com.archive.project.system.dict.controller
;
/* */
/* */ import com.archive.common.utils.poi.ExcelUtil;
/* */ import com.archive.framework.aspectj.lang.annotation.Log;
/* */ import com.archive.framework.aspectj.lang.enums.BusinessType;
/* */ import com.archive.framework.web.controller.BaseController;
/* */ import com.archive.framework.web.domain.AjaxResult;
/* */ import com.archive.framework.web.page.TableDataInfo;
/* */ import com.archive.project.system.dict.domain.DictData;
/* */ import com.archive.project.system.dict.service.IDictDataService;
/* */ import java.util.List;
/* */ import org.apache.shiro.authz.annotation.RequiresPermissions;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Controller;
/* */ import org.springframework.ui.ModelMap;
/* */ import org.springframework.validation.annotation.Validated;
/* */ import org.springframework.web.bind.annotation.GetMapping;
/* */ import org.springframework.web.bind.annotation.PathVariable;
/* */ import org.springframework.web.bind.annotation.PostMapping;
/* */ import org.springframework.web.bind.annotation.RequestMapping;
/* */ import org.springframework.web.bind.annotation.ResponseBody;
/* */
/* */
/* */
/* */
/* */
/* */ @Controller
/* */ @RequestMapping({"/system/dict/data"})
/* */ public class DictDataController
/* */ extends BaseController
/* */ {
/* 32 */ private String prefix = "system/dict/data";
/* */
/* */ @Autowired
/* */ private IDictDataService dictDataService;
/* */
/* */
/* */ @RequiresPermissions({"system:dict:view"})
/* */ @GetMapping
/* */ public String dictData() {
/* 41 */ return this.prefix + "/data";
/* */ }
/* */
/* */
/* */ @PostMapping({"/list"})
/* */ @RequiresPermissions({"system:dict:list"})
/* */ @ResponseBody
/* */ public TableDataInfo list(DictData dictData) {
/* 49 */ startPage();
/* 50 */ List<DictData> list = this.dictDataService.selectDictDataList(dictData);
/* 51 */ return getDataTable(list);
/* */ }
/* */
/* */
/* */ @Log(title = "字典数据", businessType = BusinessType.EXPORT)
/* */ @RequiresPermissions({"system:dict:export"})
/* */ @PostMapping({"/export"})
/* */ @ResponseBody
/* */ public AjaxResult export(DictData dictData) {
/* 60 */ List<DictData> list = this.dictDataService.selectDictDataList(dictData);
/* 61 */ ExcelUtil<DictData> util = new ExcelUtil(DictData.class);
/* 62 */ return util.exportExcel(list, "字典数据");
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/add/{dictType}"})
/* */ public String add(@PathVariable("dictType") String dictType, ModelMap mmap) {
/* 71 */ mmap.put("dictType", dictType);
/* 72 */ return this.prefix + "/add";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @Log(title = "字典数据", businessType = BusinessType.INSERT)
/* */ @RequiresPermissions({"system:dict:add"})
/* */ @PostMapping({"/add"})
/* */ @ResponseBody
/* */ public AjaxResult addSave(@Validated DictData dict) {
/* 84 */ return toAjax(this.dictDataService.insertDictData(dict));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/edit/{dictCode}"})
/* */ public String edit(@PathVariable("dictCode") Long dictCode, ModelMap mmap) {
/* 93 */ mmap.put("dict", this.dictDataService.selectDictDataById(dictCode));
/* 94 */ return this.prefix + "/edit";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @Log(title = "字典数据", businessType = BusinessType.UPDATE)
/* */ @RequiresPermissions({"system:dict:edit"})
/* */ @PostMapping({"/edit"})
/* */ @ResponseBody
/* */ public AjaxResult editSave(@Validated DictData dict) {
/* 106 */ return toAjax(this.dictDataService.updateDictData(dict));
/* */ }
/* */
/* */
/* */ @Log(title = "字典数据", businessType = BusinessType.DELETE)
/* */ @RequiresPermissions({"system:dict:remove"})
/* */ @PostMapping({"/remove"})
/* */ @ResponseBody
/* */ public AjaxResult remove(String ids) {
/* 115 */ return toAjax(this.dictDataService.deleteDictDataByIds(ids));
/* */ }
/* */ }
import com.archive.common.utils.poi.ExcelUtil;
import com.archive.framework.aspectj.lang.annotation.Log;
import com.archive.framework.aspectj.lang.enums.BusinessType;
import com.archive.framework.web.controller.BaseController;
import com.archive.framework.web.domain.AjaxResult;
import com.archive.framework.web.page.TableDataInfo;
import com.archive.project.system.dict.domain.DictData;
import com.archive.project.system.dict.service.IDictDataService;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping({"/system/dict/data"})
public class DictDataController
extends BaseController
{
private String prefix = "system/dict/data";
@Autowired
private IDictDataService dictDataService;
@RequiresPermissions({"system:dict:view"})
@GetMapping
public String dictData() {
return this.prefix + "/data";
}
@PostMapping({"/list"})
@RequiresPermissions({"system:dict:list"})
@ResponseBody
public TableDataInfo list(DictData dictData) {
startPage();
List<DictData> list = this.dictDataService.selectDictDataList(dictData);
return getDataTable(list);
}
@Log(title = "字典数据", businessType = BusinessType.EXPORT)
@RequiresPermissions({"system:dict:export"})
@PostMapping({"/export"})
@ResponseBody
public AjaxResult export(DictData dictData) {
List<DictData> list = this.dictDataService.selectDictDataList(dictData);
ExcelUtil<DictData> util = new ExcelUtil(DictData.class);
return util.exportExcel(list, "字典数据");
}
@GetMapping({"/add/{dictType}"})
public String add(@PathVariable("dictType") String dictType, ModelMap mmap) {
mmap.put("dictType", dictType);
return this.prefix + "/add";
}
@Log(title = "字典数据", businessType = BusinessType.INSERT)
@RequiresPermissions({"system:dict:add"})
@PostMapping({"/add"})
@ResponseBody
public AjaxResult addSave(@Validated DictData dict) {
return toAjax(this.dictDataService.insertDictData(dict));
}
@GetMapping({"/edit/{dictCode}"})
public String edit(@PathVariable("dictCode") Long dictCode, ModelMap mmap) {
mmap.put("dict", this.dictDataService.selectDictDataById(dictCode));
return this.prefix + "/edit";
}
@Log(title = "字典数据", businessType = BusinessType.UPDATE)
@RequiresPermissions({"system:dict:edit"})
@PostMapping({"/edit"})
@ResponseBody
public AjaxResult editSave(@Validated DictData dict) {
return toAjax(this.dictDataService.updateDictData(dict));
}
@Log(title = "字典数据", businessType = BusinessType.DELETE)
@RequiresPermissions({"system:dict:remove"})
@PostMapping({"/remove"})
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(this.dictDataService.deleteDictDataByIds(ids));
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\system\dict\controller\DictDataController.class

@ -1,190 +1,190 @@
/* */ package com.archive.project.system.dict.controller
package com.archive.project.system.dict.controller
;
/* */
/* */ import com.archive.common.utils.poi.ExcelUtil;
/* */ import com.archive.framework.aspectj.lang.annotation.Log;
/* */ import com.archive.framework.aspectj.lang.enums.BusinessType;
/* */ import com.archive.framework.web.controller.BaseController;
/* */ import com.archive.framework.web.domain.AjaxResult;
/* */ import com.archive.framework.web.domain.Ztree;
/* */ import com.archive.framework.web.page.TableDataInfo;
/* */ import com.archive.project.system.dict.domain.DictType;
/* */ import com.archive.project.system.dict.service.IDictTypeService;
/* */ import java.util.List;
/* */ import org.apache.shiro.authz.annotation.RequiresPermissions;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Controller;
/* */ import org.springframework.ui.ModelMap;
/* */ import org.springframework.validation.annotation.Validated;
/* */ import org.springframework.web.bind.annotation.GetMapping;
/* */ import org.springframework.web.bind.annotation.PathVariable;
/* */ import org.springframework.web.bind.annotation.PostMapping;
/* */ import org.springframework.web.bind.annotation.RequestMapping;
/* */ import org.springframework.web.bind.annotation.ResponseBody;
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Controller
/* */ @RequestMapping({"/system/dict"})
/* */ public class DictTypeController
/* */ extends BaseController
/* */ {
/* 34 */ private String prefix = "system/dict/type";
/* */
/* */ @Autowired
/* */ private IDictTypeService dictTypeService;
/* */
/* */
/* */ @RequiresPermissions({"system:dict:view"})
/* */ @GetMapping
/* */ public String dictType() {
/* 43 */ return this.prefix + "/type";
/* */ }
/* */
/* */
/* */ @PostMapping({"/list"})
/* */ @RequiresPermissions({"system:dict:list"})
/* */ @ResponseBody
/* */ public TableDataInfo list(DictType dictType) {
/* 51 */ startPage();
/* 52 */ List<DictType> list = this.dictTypeService.selectDictTypeList(dictType);
/* 53 */ return getDataTable(list);
/* */ }
/* */
/* */
/* */
/* */ @Log(title = "字典类型", businessType = BusinessType.EXPORT)
/* */ @RequiresPermissions({"system:dict:export"})
/* */ @PostMapping({"/export"})
/* */ @ResponseBody
/* */ public AjaxResult export(DictType dictType) {
/* 63 */ List<DictType> list = this.dictTypeService.selectDictTypeList(dictType);
/* 64 */ ExcelUtil<DictType> util = new ExcelUtil(DictType.class);
/* 65 */ return util.exportExcel(list, "字典类型");
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/add"})
/* */ public String add() {
/* 74 */ return this.prefix + "/add";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @Log(title = "字典类型", businessType = BusinessType.INSERT)
/* */ @RequiresPermissions({"system:dict:add"})
/* */ @PostMapping({"/add"})
/* */ @ResponseBody
/* */ public AjaxResult addSave(@Validated DictType dict) {
/* 86 */ if ("1".equals(this.dictTypeService.checkDictTypeUnique(dict)))
/* */ {
/* 88 */ return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
/* */ }
/* 90 */ return toAjax(this.dictTypeService.insertDictType(dict));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/edit/{dictId}"})
/* */ public String edit(@PathVariable("dictId") Long dictId, ModelMap mmap) {
/* 99 */ mmap.put("dict", this.dictTypeService.selectDictTypeById(dictId));
/* 100 */ return this.prefix + "/edit";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @Log(title = "字典类型", businessType = BusinessType.UPDATE)
/* */ @RequiresPermissions({"system:dict:edit"})
/* */ @PostMapping({"/edit"})
/* */ @ResponseBody
/* */ public AjaxResult editSave(@Validated DictType dict) {
/* 112 */ if ("1".equals(this.dictTypeService.checkDictTypeUnique(dict)))
/* */ {
/* 114 */ return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
/* */ }
/* 116 */ return toAjax(this.dictTypeService.updateDictType(dict));
/* */ }
/* */
/* */
/* */ @Log(title = "字典类型", businessType = BusinessType.DELETE)
/* */ @RequiresPermissions({"system:dict:remove"})
/* */ @PostMapping({"/remove"})
/* */ @ResponseBody
/* */ public AjaxResult remove(String ids) {
/* 125 */ return toAjax(this.dictTypeService.deleteDictTypeByIds(ids));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"system:dict:remove"})
/* */ @Log(title = "字典类型", businessType = BusinessType.CLEAN)
/* */ @GetMapping({"/clearCache"})
/* */ @ResponseBody
/* */ public AjaxResult clearCache() {
/* 137 */ this.dictTypeService.clearCache();
/* 138 */ return success();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @RequiresPermissions({"system:dict:list"})
/* */ @GetMapping({"/detail/{dictId}"})
/* */ public String detail(@PathVariable("dictId") Long dictId, ModelMap mmap) {
/* 148 */ mmap.put("dict", this.dictTypeService.selectDictTypeById(dictId));
/* 149 */ mmap.put("dictList", this.dictTypeService.selectDictTypeAll());
/* 150 */ return "system/dict/data/data";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @PostMapping({"/checkDictTypeUnique"})
/* */ @ResponseBody
/* */ public String checkDictTypeUnique(DictType dictType) {
/* 160 */ return this.dictTypeService.checkDictTypeUnique(dictType);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/selectDictTree/{columnId}/{dictType}"})
/* */ public String selectDeptTree(@PathVariable("columnId") Long columnId, @PathVariable("dictType") String dictType, ModelMap mmap) {
/* 170 */ mmap.put("columnId", columnId);
/* 171 */ mmap.put("dict", this.dictTypeService.selectDictTypeByType(dictType));
/* 172 */ return this.prefix + "/tree";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/treeData"})
/* */ @ResponseBody
/* */ public List<Ztree> treeData() {
/* 182 */ List<Ztree> ztrees = this.dictTypeService.selectDictTree(new DictType());
/* 183 */ return ztrees;
/* */ }
/* */ }
import com.archive.common.utils.poi.ExcelUtil;
import com.archive.framework.aspectj.lang.annotation.Log;
import com.archive.framework.aspectj.lang.enums.BusinessType;
import com.archive.framework.web.controller.BaseController;
import com.archive.framework.web.domain.AjaxResult;
import com.archive.framework.web.domain.Ztree;
import com.archive.framework.web.page.TableDataInfo;
import com.archive.project.system.dict.domain.DictType;
import com.archive.project.system.dict.service.IDictTypeService;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping({"/system/dict"})
public class DictTypeController
extends BaseController
{
private String prefix = "system/dict/type";
@Autowired
private IDictTypeService dictTypeService;
@RequiresPermissions({"system:dict:view"})
@GetMapping
public String dictType() {
return this.prefix + "/type";
}
@PostMapping({"/list"})
@RequiresPermissions({"system:dict:list"})
@ResponseBody
public TableDataInfo list(DictType dictType) {
startPage();
List<DictType> list = this.dictTypeService.selectDictTypeList(dictType);
return getDataTable(list);
}
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
@RequiresPermissions({"system:dict:export"})
@PostMapping({"/export"})
@ResponseBody
public AjaxResult export(DictType dictType) {
List<DictType> list = this.dictTypeService.selectDictTypeList(dictType);
ExcelUtil<DictType> util = new ExcelUtil(DictType.class);
return util.exportExcel(list, "字典类型");
}
@GetMapping({"/add"})
public String add() {
return this.prefix + "/add";
}
@Log(title = "字典类型", businessType = BusinessType.INSERT)
@RequiresPermissions({"system:dict:add"})
@PostMapping({"/add"})
@ResponseBody
public AjaxResult addSave(@Validated DictType dict) {
if ("1".equals(this.dictTypeService.checkDictTypeUnique(dict)))
{
return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
return toAjax(this.dictTypeService.insertDictType(dict));
}
@GetMapping({"/edit/{dictId}"})
public String edit(@PathVariable("dictId") Long dictId, ModelMap mmap) {
mmap.put("dict", this.dictTypeService.selectDictTypeById(dictId));
return this.prefix + "/edit";
}
@Log(title = "字典类型", businessType = BusinessType.UPDATE)
@RequiresPermissions({"system:dict:edit"})
@PostMapping({"/edit"})
@ResponseBody
public AjaxResult editSave(@Validated DictType dict) {
if ("1".equals(this.dictTypeService.checkDictTypeUnique(dict)))
{
return error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
return toAjax(this.dictTypeService.updateDictType(dict));
}
@Log(title = "字典类型", businessType = BusinessType.DELETE)
@RequiresPermissions({"system:dict:remove"})
@PostMapping({"/remove"})
@ResponseBody
public AjaxResult remove(String ids) {
return toAjax(this.dictTypeService.deleteDictTypeByIds(ids));
}
@RequiresPermissions({"system:dict:remove"})
@Log(title = "字典类型", businessType = BusinessType.CLEAN)
@GetMapping({"/clearCache"})
@ResponseBody
public AjaxResult clearCache() {
this.dictTypeService.clearCache();
return success();
}
@RequiresPermissions({"system:dict:list"})
@GetMapping({"/detail/{dictId}"})
public String detail(@PathVariable("dictId") Long dictId, ModelMap mmap) {
mmap.put("dict", this.dictTypeService.selectDictTypeById(dictId));
mmap.put("dictList", this.dictTypeService.selectDictTypeAll());
return "system/dict/data/data";
}
@PostMapping({"/checkDictTypeUnique"})
@ResponseBody
public String checkDictTypeUnique(DictType dictType) {
return this.dictTypeService.checkDictTypeUnique(dictType);
}
@GetMapping({"/selectDictTree/{columnId}/{dictType}"})
public String selectDeptTree(@PathVariable("columnId") Long columnId, @PathVariable("dictType") String dictType, ModelMap mmap) {
mmap.put("columnId", columnId);
mmap.put("dict", this.dictTypeService.selectDictTypeByType(dictType));
return this.prefix + "/tree";
}
@GetMapping({"/treeData"})
@ResponseBody
public List<Ztree> treeData() {
List<Ztree> ztrees = this.dictTypeService.selectDictTree(new DictType());
return ztrees;
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\system\dict\controller\DictTypeController.class

@ -1,181 +1,181 @@
/* */ package com.archive.project.system.dict.domain
package com.archive.project.system.dict.domain
;
/* */
/* */ import com.archive.framework.aspectj.lang.annotation.ColumnType;
import com.archive.framework.aspectj.lang.annotation.ColumnType;
import com.archive.framework.aspectj.lang.annotation.Excel;
/* */ import com.archive.framework.web.domain.BaseEntity;
/* */ import javax.validation.constraints.NotBlank;
/* */ import javax.validation.constraints.Size;
/* */ import org.apache.commons.lang3.builder.ToStringBuilder;
/* */ import org.apache.commons.lang3.builder.ToStringStyle;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class DictData
/* */ extends BaseEntity
/* */ {
/* */ private static final long serialVersionUID = 1L;
/* */ @Excel(name = "字典编码", cellType = ColumnType.NUMERIC)
/* */ private Long dictCode;
/* */ @Excel(name = "字典排序", cellType = ColumnType.NUMERIC)
/* */ private Long dictSort;
/* */ @Excel(name = "字典标签")
/* */ private String dictLabel;
/* */ @Excel(name = "字典键值")
/* */ private String dictValue;
/* */ @Excel(name = "字典类型")
/* */ private String dictType;
/* */ @Excel(name = "字典样式")
/* */ private String cssClass;
/* */ private String listClass;
/* */ @Excel(name = "是否默认", readConverterExp = "Y=是,N=否")
/* */ private String isDefault;
/* */ @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
/* */ private String status;
/* */
/* */ public Long getDictCode() {
/* 57 */ return this.dictCode;
/* */ }
/* */
/* */
/* */ public void setDictCode(Long dictCode) {
/* 62 */ this.dictCode = dictCode;
/* */ }
/* */
/* */
/* */ public Long getDictSort() {
/* 67 */ return this.dictSort;
/* */ }
/* */
/* */
/* */ public void setDictSort(Long dictSort) {
/* 72 */ this.dictSort = dictSort;
/* */ }
/* */
/* */
/* */ @NotBlank(message = "字典标签不能为空")
/* */ @Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
/* */ public String getDictLabel() {
/* 79 */ return this.dictLabel;
/* */ }
/* */
/* */
/* */ public void setDictLabel(String dictLabel) {
/* 84 */ this.dictLabel = dictLabel;
/* */ }
/* */
/* */
/* */ @NotBlank(message = "字典键值不能为空")
/* */ @Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
/* */ public String getDictValue() {
/* 91 */ return this.dictValue;
/* */ }
/* */
/* */
/* */ public void setDictValue(String dictValue) {
/* 96 */ this.dictValue = dictValue;
/* */ }
/* */
/* */
/* */ @NotBlank(message = "字典类型不能为空")
/* */ @Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
/* */ public String getDictType() {
/* 103 */ return this.dictType;
/* */ }
/* */
/* */
/* */ public void setDictType(String dictType) {
/* 108 */ this.dictType = dictType;
/* */ }
/* */
/* */
/* */ @Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
/* */ public String getCssClass() {
/* 114 */ return this.cssClass;
/* */ }
/* */
/* */
/* */ public void setCssClass(String cssClass) {
/* 119 */ this.cssClass = cssClass;
/* */ }
/* */
/* */
/* */ public String getListClass() {
/* 124 */ return this.listClass;
/* */ }
/* */
/* */
/* */ public void setListClass(String listClass) {
/* 129 */ this.listClass = listClass;
/* */ }
/* */
/* */
/* */ public boolean getDefault() {
/* 134 */ return "Y".equals(this.isDefault);
/* */ }
/* */
/* */
/* */ public String getIsDefault() {
/* 139 */ return this.isDefault;
/* */ }
/* */
/* */
/* */ public void setIsDefault(String isDefault) {
/* 144 */ this.isDefault = isDefault;
/* */ }
/* */
/* */
/* */ public String getStatus() {
/* 149 */ return this.status;
/* */ }
/* */
/* */
/* */ public void setStatus(String status) {
/* 154 */ this.status = status;
/* */ }
/* */
/* */ @Override
/* */ public String toString() {
/* 159 */ return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE))
/* 160 */ .append("dictCode", getDictCode())
/* 161 */ .append("dictSort", getDictSort())
/* 162 */ .append("dictLabel", getDictLabel())
/* 163 */ .append("dictValue", getDictValue())
/* 164 */ .append("dictType", getDictType())
/* 165 */ .append("cssClass", getCssClass())
/* 166 */ .append("listClass", getListClass())
/* 167 */ .append("isDefault", getIsDefault())
/* 168 */ .append("status", getStatus())
/* 169 */ .append("createBy", getCreateBy())
/* 170 */ .append("createTime", getCreateTime())
/* 171 */ .append("updateBy", getUpdateBy())
/* 172 */ .append("updateTime", getUpdateTime())
/* 173 */ .append("remark", getRemark())
/* 174 */ .toString();
/* */ }
/* */ }
import com.archive.framework.web.domain.BaseEntity;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
public class DictData
extends BaseEntity
{
private static final long serialVersionUID = 1L;
@Excel(name = "字典编码", cellType = ColumnType.NUMERIC)
private Long dictCode;
@Excel(name = "字典排序", cellType = ColumnType.NUMERIC)
private Long dictSort;
@Excel(name = "字典标签")
private String dictLabel;
@Excel(name = "字典键值")
private String dictValue;
@Excel(name = "字典类型")
private String dictType;
@Excel(name = "字典样式")
private String cssClass;
private String listClass;
@Excel(name = "是否默认", readConverterExp = "Y=是,N=否")
private String isDefault;
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
public Long getDictCode() {
return this.dictCode;
}
public void setDictCode(Long dictCode) {
this.dictCode = dictCode;
}
public Long getDictSort() {
return this.dictSort;
}
public void setDictSort(Long dictSort) {
this.dictSort = dictSort;
}
@NotBlank(message = "字典标签不能为空")
@Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
public String getDictLabel() {
return this.dictLabel;
}
public void setDictLabel(String dictLabel) {
this.dictLabel = dictLabel;
}
@NotBlank(message = "字典键值不能为空")
@Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
public String getDictValue() {
return this.dictValue;
}
public void setDictValue(String dictValue) {
this.dictValue = dictValue;
}
@NotBlank(message = "字典类型不能为空")
@Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
public String getDictType() {
return this.dictType;
}
public void setDictType(String dictType) {
this.dictType = dictType;
}
@Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
public String getCssClass() {
return this.cssClass;
}
public void setCssClass(String cssClass) {
this.cssClass = cssClass;
}
public String getListClass() {
return this.listClass;
}
public void setListClass(String listClass) {
this.listClass = listClass;
}
public boolean getDefault() {
return "Y".equals(this.isDefault);
}
public String getIsDefault() {
return this.isDefault;
}
public void setIsDefault(String isDefault) {
this.isDefault = isDefault;
}
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
}
@Override
public String toString() {
return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE))
.append("dictCode", getDictCode())
.append("dictSort", getDictSort())
.append("dictLabel", getDictLabel())
.append("dictValue", getDictValue())
.append("dictType", getDictType())
.append("cssClass", getCssClass())
.append("listClass", getListClass())
.append("isDefault", getIsDefault())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\system\dict\domain\DictData.class

@ -1,111 +1,111 @@
/* */ package com.archive.project.system.dict.domain
package com.archive.project.system.dict.domain
;
/* */
/* */ import com.archive.framework.aspectj.lang.annotation.ColumnType;
import com.archive.framework.aspectj.lang.annotation.ColumnType;
import com.archive.framework.aspectj.lang.annotation.Excel;
/* */ import com.archive.framework.web.domain.BaseEntity;
/* */ import javax.validation.constraints.NotBlank;
/* */ import javax.validation.constraints.Size;
/* */ import org.apache.commons.lang3.builder.ToStringBuilder;
/* */ import org.apache.commons.lang3.builder.ToStringStyle;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class DictType
/* */ extends BaseEntity
/* */ {
/* */ private static final long serialVersionUID = 1L;
/* */ @Excel(name = "字典主键", cellType = ColumnType.NUMERIC)
/* */ private Long dictId;
/* */ @Excel(name = "字典名称")
/* */ private String dictName;
/* */ @Excel(name = "字典类型")
/* */ private String dictType;
/* */ @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
/* */ private String status;
/* */ @Excel(name = "标签")
/* */ private String label;
/* */
/* */ public Long getDictId() {
/* 41 */ return this.dictId;
/* */ }
/* */
/* */
/* */ public void setDictId(Long dictId) {
/* 46 */ this.dictId = dictId;
/* */ }
/* */
/* */
/* */ @NotBlank(message = "字典名称不能为空")
/* */ @Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符")
/* */ public String getDictName() {
/* 53 */ return this.dictName;
/* */ }
/* */
/* */
/* */ public void setDictName(String dictName) {
/* 58 */ this.dictName = dictName;
/* */ }
/* */
/* */
/* */ @NotBlank(message = "字典类型不能为空")
/* */ @Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
/* */ public String getDictType() {
/* 65 */ return this.dictType;
/* */ }
/* */
/* */
/* */ public void setDictType(String dictType) {
/* 70 */ this.dictType = dictType;
/* */ }
/* */
/* */
/* */ public String getStatus() {
/* 75 */ return this.status;
/* */ }
/* */
/* */
/* */ public void setStatus(String status) {
/* 80 */ this.status = status;
/* */ }
/* */
/* */ public String getLabel() {
/* 84 */ return this.label;
/* */ }
/* */
/* */ public void setLabel(String label) {
/* 88 */ this.label = label;
/* */ }
/* */
/* */
/* */ public String toString() {
/* 93 */ return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE))
/* 94 */ .append("dictId", getDictId())
/* 95 */ .append("dictName", getDictName())
/* 96 */ .append("dictType", getDictType())
/* 97 */ .append("status", getStatus())
/* 98 */ .append("createBy", getCreateBy())
/* 99 */ .append("createTime", getCreateTime())
/* 100 */ .append("updateBy", getUpdateBy())
/* 101 */ .append("updateTime", getUpdateTime())
/* 102 */ .append("remark", getRemark())
/* 103 */ .toString();
/* */ }
/* */ }
import com.archive.framework.web.domain.BaseEntity;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
public class DictType
extends BaseEntity
{
private static final long serialVersionUID = 1L;
@Excel(name = "字典主键", cellType = ColumnType.NUMERIC)
private Long dictId;
@Excel(name = "字典名称")
private String dictName;
@Excel(name = "字典类型")
private String dictType;
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
@Excel(name = "标签")
private String label;
public Long getDictId() {
return this.dictId;
}
public void setDictId(Long dictId) {
this.dictId = dictId;
}
@NotBlank(message = "字典名称不能为空")
@Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符")
public String getDictName() {
return this.dictName;
}
public void setDictName(String dictName) {
this.dictName = dictName;
}
@NotBlank(message = "字典类型不能为空")
@Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
public String getDictType() {
return this.dictType;
}
public void setDictType(String dictType) {
this.dictType = dictType;
}
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
}
public String getLabel() {
return this.label;
}
public void setLabel(String label) {
this.label = label;
}
public String toString() {
return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE))
.append("dictId", getDictId())
.append("dictName", getDictName())
.append("dictType", getDictType())
.append("status", getStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\system\dict\domain\DictType.class

@ -1,146 +1,146 @@
/* */ package com.archive.project.system.dict.service
package com.archive.project.system.dict.service
;
/* */
/* */ import com.archive.common.utils.security.ShiroUtils;
/* */ import com.archive.common.utils.text.Convert;
/* */ import com.archive.framework.config.ArchiveConfig;
/* */ import com.archive.project.system.dict.domain.DictData;
/* */ import com.archive.project.system.dict.mapper.DictDataMapper;
/* */ import com.archive.project.system.dict.service.IDictDataService;
/* */ import com.archive.project.system.dict.utils.DictUtils;
/* */ import java.util.List;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Service;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Service
/* */ public class DictDataServiceImpl
/* */ implements IDictDataService
/* */ {
/* */ @Autowired
/* */ private DictDataMapper dictDataMapper;
/* */ @Autowired
/* */ private ArchiveConfig archiveConfig;
/* */
/* */ public List<DictData> selectDictDataList(DictData dictData) {
/* 40 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 41 */ return this.dictDataMapper.selectDictDataList(dictData);
/* */ }
/* 43 */ if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 44 */ return this.dictDataMapper.selectDictDataListSqlite(dictData);
/* */ }
/* 46 */ return this.dictDataMapper.selectDictDataList(dictData);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public String selectDictLabel(String dictType, String dictValue) {
/* 60 */ return this.dictDataMapper.selectDictLabel(dictType, dictValue);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public DictData selectDictDataById(Long dictCode) {
/* 72 */ return this.dictDataMapper.selectDictDataById(dictCode);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int deleteDictDataByIds(String ids) {
/* 84 */ int row = this.dictDataMapper.deleteDictDataByIds(Convert.toStrArray(ids));
/* 85 */ if (row > 0)
/* */ {
/* 87 */ DictUtils.clearDictCache();
/* */ }
/* 89 */ return row;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int insertDictData(DictData dictData) {
/* 101 */ dictData.setCreateBy(ShiroUtils.getLoginName());
/* 102 */ int row = 0;
/* 103 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 104 */ row = this.dictDataMapper.insertDictData(dictData);
/* */ }
/* 106 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 107 */ row = this.dictDataMapper.insertDictDataSqlite(dictData);
/* */ }
/* */
/* 110 */ if (row > 0)
/* */ {
/* 112 */ DictUtils.clearDictCache();
/* */ }
/* 114 */ return row;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int updateDictData(DictData dictData) {
/* 126 */ dictData.setUpdateBy(ShiroUtils.getLoginName());
/* 127 */ int row = 0;
/* 128 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 129 */ row = this.dictDataMapper.updateDictData(dictData);
/* */ }
/* 131 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 132 */ row = this.dictDataMapper.updateDictDataSqlite(dictData);
/* */ }
/* */
/* 135 */ if (row > 0)
/* */ {
/* 137 */ DictUtils.clearDictCache();
/* */ }
/* 139 */ return row;
/* */ }
/* */ }
import com.archive.common.utils.security.ShiroUtils;
import com.archive.common.utils.text.Convert;
import com.archive.framework.config.ArchiveConfig;
import com.archive.project.system.dict.domain.DictData;
import com.archive.project.system.dict.mapper.DictDataMapper;
import com.archive.project.system.dict.service.IDictDataService;
import com.archive.project.system.dict.utils.DictUtils;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class DictDataServiceImpl
implements IDictDataService
{
@Autowired
private DictDataMapper dictDataMapper;
@Autowired
private ArchiveConfig archiveConfig;
public List<DictData> selectDictDataList(DictData dictData) {
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
return this.dictDataMapper.selectDictDataList(dictData);
}
if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
return this.dictDataMapper.selectDictDataListSqlite(dictData);
}
return this.dictDataMapper.selectDictDataList(dictData);
}
public String selectDictLabel(String dictType, String dictValue) {
return this.dictDataMapper.selectDictLabel(dictType, dictValue);
}
public DictData selectDictDataById(Long dictCode) {
return this.dictDataMapper.selectDictDataById(dictCode);
}
public int deleteDictDataByIds(String ids) {
int row = this.dictDataMapper.deleteDictDataByIds(Convert.toStrArray(ids));
if (row > 0)
{
DictUtils.clearDictCache();
}
return row;
}
public int insertDictData(DictData dictData) {
dictData.setCreateBy(ShiroUtils.getLoginName());
int row = 0;
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
row = this.dictDataMapper.insertDictData(dictData);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
row = this.dictDataMapper.insertDictDataSqlite(dictData);
}
if (row > 0)
{
DictUtils.clearDictCache();
}
return row;
}
public int updateDictData(DictData dictData) {
dictData.setUpdateBy(ShiroUtils.getLoginName());
int row = 0;
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
row = this.dictDataMapper.updateDictData(dictData);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
row = this.dictDataMapper.updateDictDataSqlite(dictData);
}
if (row > 0)
{
DictUtils.clearDictCache();
}
return row;
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\system\dict\service\DictDataServiceImpl.class

@ -1,277 +1,277 @@
/* */ package com.archive.project.system.dict.service
package com.archive.project.system.dict.service
;
/* */
/* */ import com.archive.common.exception.BusinessException;
/* */ import com.archive.common.utils.StringUtils;
/* */ import com.archive.common.utils.security.ShiroUtils;
/* */ import com.archive.common.utils.text.Convert;
/* */ import com.archive.framework.config.ArchiveConfig;
/* */ import com.archive.framework.web.domain.Ztree;
/* */ import com.archive.project.system.dict.domain.DictData;
/* */ import com.archive.project.system.dict.domain.DictType;
/* */ import com.archive.project.system.dict.mapper.DictDataMapper;
/* */ import com.archive.project.system.dict.mapper.DictTypeMapper;
/* */ import com.archive.project.system.dict.service.IDictTypeService;
/* */ import com.archive.project.system.dict.utils.DictUtils;
/* */ import java.util.ArrayList;
/* */ import java.util.List;
/* */ import javax.annotation.PostConstruct;
/* */ import org.springframework.beans.factory.annotation.Autowired;
/* */ import org.springframework.stereotype.Service;
/* */ import org.springframework.transaction.annotation.Transactional;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Service
/* */ public class DictTypeServiceImpl
/* */ implements IDictTypeService
/* */ {
/* */ @Autowired
/* */ private DictTypeMapper dictTypeMapper;
/* */ @Autowired
/* */ private DictDataMapper dictDataMapper;
/* */ @Autowired
/* */ private ArchiveConfig archiveConfig;
/* */
/* */ @PostConstruct
/* */ public void init() {
/* 48 */ List<DictType> dictTypeList = this.dictTypeMapper.selectDictTypeAll();
/* 49 */ for (DictType dictType : dictTypeList) {
/* */
/* 51 */ List<DictData> dictDatas = this.dictDataMapper.selectDictDataByType(dictType.getDictType());
/* 52 */ DictUtils.setDictCache(dictType.getDictType(), dictDatas);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public List<DictType> selectDictTypeList(DictType dictType) {
/* 65 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 66 */ return this.dictTypeMapper.selectDictTypeList(dictType);
/* */ }
/* 68 */ if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 69 */ return this.dictTypeMapper.selectDictTypeListSqlite(dictType);
/* */ }
/* 71 */ return this.dictTypeMapper.selectDictTypeList(dictType);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public List<DictType> selectDictTypeAll() {
/* 84 */ return this.dictTypeMapper.selectDictTypeAll();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public List<DictData> selectDictDataByType(String dictType) {
/* 96 */ List<DictData> dictDatas = DictUtils.getDictCache(dictType);
/* 97 */ if (StringUtils.isNotEmpty(dictDatas))
/* */ {
/* 99 */ return dictDatas;
/* */ }
/* 101 */ dictDatas = this.dictDataMapper.selectDictDataByType(dictType);
/* 102 */ if (StringUtils.isNotEmpty(dictDatas)) {
/* */
/* 104 */ DictUtils.setDictCache(dictType, dictDatas);
/* 105 */ return dictDatas;
/* */ }
/* 107 */ return null;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public DictType selectDictTypeById(Long dictId) {
/* 119 */ return this.dictTypeMapper.selectDictTypeById(dictId);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public DictType selectDictTypeByType(String dictType) {
/* 131 */ return this.dictTypeMapper.selectDictTypeByType(dictType);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int deleteDictTypeByIds(String ids) {
/* 143 */ Long[] dictIds = Convert.toLongArray(ids);
/* 144 */ for (Long dictId : dictIds) {
/* */
/* 146 */ DictType dictType = selectDictTypeById(dictId);
/* 147 */ if (this.dictDataMapper.countDictDataByType(dictType.getDictType()) > 0)
/* */ {
/* 149 */ throw new BusinessException(String.format("%1$s已分配,不能删除", new Object[] { dictType.getDictName() }));
/* */ }
/* */ }
/* 152 */ int count = this.dictTypeMapper.deleteDictTypeByIds(dictIds);
/* 153 */ if (count > 0)
/* */ {
/* 155 */ DictUtils.clearDictCache();
/* */ }
/* 157 */ return count;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public void clearCache() {
/* 166 */ DictUtils.clearDictCache();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public int insertDictType(DictType dictType) {
/* 178 */ dictType.setCreateBy(ShiroUtils.getLoginName());
/* 179 */ int row = 0;
/* 180 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 181 */ row = this.dictTypeMapper.insertDictType(dictType);
/* */ }
/* 183 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 184 */ row = this.dictTypeMapper.insertDictTypeSqlite(dictType);
/* */ }
/* */
/* 187 */ if (row > 0)
/* */ {
/* 189 */ DictUtils.clearDictCache();
/* */ }
/* 191 */ return row;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Transactional
/* */ public int updateDictType(DictType dictType) {
/* 204 */ dictType.setUpdateBy(ShiroUtils.getLoginName());
/* 205 */ DictType oldDict = this.dictTypeMapper.selectDictTypeById(dictType.getDictId());
/* 206 */ this.dictDataMapper.updateDictDataType(oldDict.getDictType(), dictType.getDictType());
/* 207 */ int row = 0;
/* 208 */ if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
/* 209 */ row = this.dictTypeMapper.updateDictType(dictType);
/* */ }
/* 211 */ else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
/* 212 */ row = this.dictTypeMapper.updateDictTypeSqlite(dictType);
/* */ }
/* */
/* 215 */ if (row > 0)
/* */ {
/* 217 */ DictUtils.clearDictCache();
/* */ }
/* 219 */ return row;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public String checkDictTypeUnique(DictType dict) {
/* 231 */ Long dictId = Long.valueOf(StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId().longValue());
/* 232 */ DictType dictType = this.dictTypeMapper.checkDictTypeUnique(dict.getDictType());
/* 233 */ if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue())
/* */ {
/* 235 */ return "1";
/* */ }
/* 237 */ return "0";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public List<Ztree> selectDictTree(DictType dictType) {
/* 249 */ List<Ztree> ztrees = new ArrayList<>();
/* 250 */ List<DictType> dictList = this.dictTypeMapper.selectDictTypeList(dictType);
/* 251 */ for (DictType dict : dictList) {
/* */
/* 253 */ if ("0".equals(dict.getStatus())) {
/* */
/* 255 */ Ztree ztree = new Ztree();
/* 256 */ ztree.setId(dict.getDictId());
/* 257 */ ztree.setName(transDictName(dict));
/* 258 */ ztree.setTitle(dict.getDictType());
/* 259 */ ztrees.add(ztree);
/* */ }
/* */ }
/* 262 */ return ztrees;
/* */ }
/* */
/* */
/* */ public String transDictName(DictType dictType) {
/* 267 */ StringBuffer sb = new StringBuffer();
/* 268 */ sb.append("(" + dictType.getDictName() + ")");
/* 269 */ sb.append("&nbsp;&nbsp;&nbsp;" + dictType.getDictType());
/* 270 */ return sb.toString();
/* */ }
/* */ }
import com.archive.common.exception.BusinessException;
import com.archive.common.utils.StringUtils;
import com.archive.common.utils.security.ShiroUtils;
import com.archive.common.utils.text.Convert;
import com.archive.framework.config.ArchiveConfig;
import com.archive.framework.web.domain.Ztree;
import com.archive.project.system.dict.domain.DictData;
import com.archive.project.system.dict.domain.DictType;
import com.archive.project.system.dict.mapper.DictDataMapper;
import com.archive.project.system.dict.mapper.DictTypeMapper;
import com.archive.project.system.dict.service.IDictTypeService;
import com.archive.project.system.dict.utils.DictUtils;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
public class DictTypeServiceImpl
implements IDictTypeService
{
@Autowired
private DictTypeMapper dictTypeMapper;
@Autowired
private DictDataMapper dictDataMapper;
@Autowired
private ArchiveConfig archiveConfig;
@PostConstruct
public void init() {
List<DictType> dictTypeList = this.dictTypeMapper.selectDictTypeAll();
for (DictType dictType : dictTypeList) {
List<DictData> dictDatas = this.dictDataMapper.selectDictDataByType(dictType.getDictType());
DictUtils.setDictCache(dictType.getDictType(), dictDatas);
}
}
public List<DictType> selectDictTypeList(DictType dictType) {
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
return this.dictTypeMapper.selectDictTypeList(dictType);
}
if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
return this.dictTypeMapper.selectDictTypeListSqlite(dictType);
}
return this.dictTypeMapper.selectDictTypeList(dictType);
}
public List<DictType> selectDictTypeAll() {
return this.dictTypeMapper.selectDictTypeAll();
}
public List<DictData> selectDictDataByType(String dictType) {
List<DictData> dictDatas = DictUtils.getDictCache(dictType);
if (StringUtils.isNotEmpty(dictDatas))
{
return dictDatas;
}
dictDatas = this.dictDataMapper.selectDictDataByType(dictType);
if (StringUtils.isNotEmpty(dictDatas)) {
DictUtils.setDictCache(dictType, dictDatas);
return dictDatas;
}
return null;
}
public DictType selectDictTypeById(Long dictId) {
return this.dictTypeMapper.selectDictTypeById(dictId);
}
public DictType selectDictTypeByType(String dictType) {
return this.dictTypeMapper.selectDictTypeByType(dictType);
}
public int deleteDictTypeByIds(String ids) {
Long[] dictIds = Convert.toLongArray(ids);
for (Long dictId : dictIds) {
DictType dictType = selectDictTypeById(dictId);
if (this.dictDataMapper.countDictDataByType(dictType.getDictType()) > 0)
{
throw new BusinessException(String.format("%1$s已分配,不能删除", new Object[] { dictType.getDictName() }));
}
}
int count = this.dictTypeMapper.deleteDictTypeByIds(dictIds);
if (count > 0)
{
DictUtils.clearDictCache();
}
return count;
}
public void clearCache() {
DictUtils.clearDictCache();
}
public int insertDictType(DictType dictType) {
dictType.setCreateBy(ShiroUtils.getLoginName());
int row = 0;
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
row = this.dictTypeMapper.insertDictType(dictType);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
row = this.dictTypeMapper.insertDictTypeSqlite(dictType);
}
if (row > 0)
{
DictUtils.clearDictCache();
}
return row;
}
@Transactional
public int updateDictType(DictType dictType) {
dictType.setUpdateBy(ShiroUtils.getLoginName());
DictType oldDict = this.dictTypeMapper.selectDictTypeById(dictType.getDictId());
this.dictDataMapper.updateDictDataType(oldDict.getDictType(), dictType.getDictType());
int row = 0;
if ("mysql".equals(this.archiveConfig.getDatabaseType())) {
row = this.dictTypeMapper.updateDictType(dictType);
}
else if ("sqlite".equals(this.archiveConfig.getDatabaseType())) {
row = this.dictTypeMapper.updateDictTypeSqlite(dictType);
}
if (row > 0)
{
DictUtils.clearDictCache();
}
return row;
}
public String checkDictTypeUnique(DictType dict) {
Long dictId = Long.valueOf(StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId().longValue());
DictType dictType = this.dictTypeMapper.checkDictTypeUnique(dict.getDictType());
if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue())
{
return "1";
}
return "0";
}
public List<Ztree> selectDictTree(DictType dictType) {
List<Ztree> ztrees = new ArrayList<>();
List<DictType> dictList = this.dictTypeMapper.selectDictTypeList(dictType);
for (DictType dict : dictList) {
if ("0".equals(dict.getStatus())) {
Ztree ztree = new Ztree();
ztree.setId(dict.getDictId());
ztree.setName(transDictName(dict));
ztree.setTitle(dict.getDictType());
ztrees.add(ztree);
}
}
return ztrees;
}
public String transDictName(DictType dictType) {
StringBuffer sb = new StringBuffer();
sb.append("(" + dictType.getDictName() + ")");
sb.append("&nbsp;&nbsp;&nbsp;" + dictType.getDictType());
return sb.toString();
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\system\dict\service\DictTypeServiceImpl.class

@ -1,186 +1,186 @@
/* */ package com.archive.project.system.dict.utils
package com.archive.project.system.dict.utils
;
/* */
/* */ import com.archive.common.utils.CacheUtils;
/* */ import com.archive.common.utils.StringUtils;
/* */ import com.archive.project.system.dict.domain.DictData;
/* */ import java.util.List;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class DictUtils
/* */ {
/* */ public static final String SEPARATOR = ",";
/* */
/* */ public static void setDictCache(String key, List<DictData> dictDatas) {
/* 29 */ CacheUtils.put(getCacheName(), getCacheKey(key), dictDatas);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static List<DictData> getDictCache(String key) {
/* 40 */ Object cacheObj = CacheUtils.get(getCacheName(), getCacheKey(key));
/* 41 */ if (StringUtils.isNotNull(cacheObj)) {
/* */
/* 43 */ List<DictData> DictDatas = (List<DictData>)StringUtils.cast(cacheObj);
/* 44 */ return DictDatas;
/* */ }
/* 46 */ return null;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String getDictLabel(String dictType, String dictValue) {
/* 58 */ return getDictLabel(dictType, dictValue, ",");
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String getDictValue(String dictType, String dictLabel) {
/* 70 */ return getDictValue(dictType, dictLabel, ",");
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String getDictLabel(String dictType, String dictValue, String separator) {
/* 83 */ StringBuilder propertyString = new StringBuilder();
/* 84 */ List<DictData> datas = getDictCache(dictType);
/* */
/* 86 */ if (StringUtils.containsAny(separator, dictValue) && StringUtils.isNotEmpty(datas)) {
/* */
/* 88 */ for (DictData dict : datas) {
/* */
/* 90 */ for (String value : dictValue.split(separator)) {
/* */
/* 92 */ if (value.equals(dict.getDictValue())) {
/* */
/* 94 */ propertyString.append(dict.getDictLabel() + separator);
/* */
/* */
/* */ break;
/* */ }
/* */ }
/* */ }
/* */ } else {
/* 102 */ for (DictData dict : datas) {
/* */
/* 104 */ if (dictValue.equals(dict.getDictValue()))
/* */ {
/* 106 */ return dict.getDictLabel();
/* */ }
/* */ }
/* */ }
/* 110 */ return StringUtils.stripEnd(propertyString.toString(), separator);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String getDictValue(String dictType, String dictLabel, String separator) {
/* 123 */ StringBuilder propertyString = new StringBuilder();
/* 124 */ List<DictData> datas = getDictCache(dictType);
/* */
/* 126 */ if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty(datas)) {
/* */
/* 128 */ for (DictData dict : datas) {
/* */
/* 130 */ for (String label : dictLabel.split(separator)) {
/* */
/* 132 */ if (label.equals(dict.getDictLabel())) {
/* */
/* 134 */ propertyString.append(dict.getDictValue() + separator);
/* */
/* */
/* */ break;
/* */ }
/* */ }
/* */ }
/* */ } else {
/* 142 */ for (DictData dict : datas) {
/* */
/* 144 */ if (dictLabel.equals(dict.getDictLabel()))
/* */ {
/* 146 */ return dict.getDictValue();
/* */ }
/* */ }
/* */ }
/* 150 */ return StringUtils.stripEnd(propertyString.toString(), separator);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public static void clearDictCache() {
/* 158 */ CacheUtils.removeAll(getCacheName());
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String getCacheName() {
/* 168 */ return "sys-dict";
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String getCacheKey(String configKey) {
/* 179 */ return "sys_dict:" + configKey;
/* */ }
/* */ }
import com.archive.common.utils.CacheUtils;
import com.archive.common.utils.StringUtils;
import com.archive.project.system.dict.domain.DictData;
import java.util.List;
public class DictUtils
{
public static final String SEPARATOR = ",";
public static void setDictCache(String key, List<DictData> dictDatas) {
CacheUtils.put(getCacheName(), getCacheKey(key), dictDatas);
}
public static List<DictData> getDictCache(String key) {
Object cacheObj = CacheUtils.get(getCacheName(), getCacheKey(key));
if (StringUtils.isNotNull(cacheObj)) {
List<DictData> DictDatas = (List<DictData>)StringUtils.cast(cacheObj);
return DictDatas;
}
return null;
}
public static String getDictLabel(String dictType, String dictValue) {
return getDictLabel(dictType, dictValue, ",");
}
public static String getDictValue(String dictType, String dictLabel) {
return getDictValue(dictType, dictLabel, ",");
}
public static String getDictLabel(String dictType, String dictValue, String separator) {
StringBuilder propertyString = new StringBuilder();
List<DictData> datas = getDictCache(dictType);
if (StringUtils.containsAny(separator, dictValue) && StringUtils.isNotEmpty(datas)) {
for (DictData dict : datas) {
for (String value : dictValue.split(separator)) {
if (value.equals(dict.getDictValue())) {
propertyString.append(dict.getDictLabel() + separator);
break;
}
}
}
} else {
for (DictData dict : datas) {
if (dictValue.equals(dict.getDictValue()))
{
return dict.getDictLabel();
}
}
}
return StringUtils.stripEnd(propertyString.toString(), separator);
}
public static String getDictValue(String dictType, String dictLabel, String separator) {
StringBuilder propertyString = new StringBuilder();
List<DictData> datas = getDictCache(dictType);
if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty(datas)) {
for (DictData dict : datas) {
for (String label : dictLabel.split(separator)) {
if (label.equals(dict.getDictLabel())) {
propertyString.append(dict.getDictValue() + separator);
break;
}
}
}
} else {
for (DictData dict : datas) {
if (dictLabel.equals(dict.getDictLabel()))
{
return dict.getDictValue();
}
}
}
return StringUtils.stripEnd(propertyString.toString(), separator);
}
public static void clearDictCache() {
CacheUtils.removeAll(getCacheName());
}
public static String getCacheName() {
return "sys-dict";
}
public static String getCacheKey(String configKey) {
return "sys_dict:" + configKey;
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\system\dic\\utils\DictUtils.class

@ -1,34 +1,34 @@
/* */ package com.archive.project.ycts
package com.archive.project.ycts
;
/* */
/* */ import org.springframework.stereotype.Controller;
/* */ import org.springframework.web.bind.annotation.GetMapping;
/* */ import org.springframework.web.bind.annotation.RequestMapping;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ @Controller
/* */ @RequestMapping({"/ycts"})
/* */ public class ExceptionInfoController
/* */ {
/* 19 */ private String prefix = "ycts";
/* */
/* */
/* */
/* */
/* */
/* */ @GetMapping({"/fileNotExists"})
/* */ public String fileNotExists() {
/* 27 */ return this.prefix + "/fileNotExists";
/* */ }
/* */ }
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping({"/ycts"})
public class ExceptionInfoController
{
private String prefix = "ycts";
@GetMapping({"/fileNotExists"})
public String fileNotExists() {
return this.prefix + "/fileNotExists";
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\project\ycts\ExceptionInfoController.class

Loading…
Cancel
Save