feat:修改档案接收信息

dev
wangxy 8 months ago
parent 2394a60c5d
commit 09f858a611

@ -1,413 +1,412 @@
/* */ package com.archive.common.utils
package com.archive.common.utils
;
/* */
/* */ import com.archive.common.utils.text.StrFormatter;
/* */ import java.util.Collection;
/* */ import java.util.Map;
/* */ import org.apache.commons.lang3.StringUtils;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class StringUtils
/* */ extends StringUtils
/* */ {
/* */ private static final String NULLSTR = "";
/* */ private static final char SEPARATOR = '_';
/* */
/* */ public static <T> T nvl(T value, T defaultValue) {
/* 28 */ return (value != null) ? value : defaultValue;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean isEmpty(Collection<?> coll) {
/* 39 */ return (isNull(coll) || coll.isEmpty());
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean isNotEmpty(Collection<?> coll) {
/* 50 */ return !isEmpty(coll);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean isEmpty(Object[] objects) {
/* 61 */ return (isNull(objects) || objects.length == 0);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean isNotEmpty(Object[] objects) {
/* 72 */ return !isEmpty(objects);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean isEmpty(Map<?, ?> map) {
/* 83 */ return (isNull(map) || map.isEmpty());
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean isNotEmpty(Map<?, ?> map) {
/* 94 */ return !isEmpty(map);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean isEmpty(String str) {
/* 105 */ return (isNull(str) || "".equals(str.trim()));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean isNotEmpty(String str) {
/* 116 */ return !isEmpty(str);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean isNull(Object object) {
/* 127 */ return (object == null);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean isNotNull(Object object) {
/* 138 */ return !isNull(object);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean isArray(Object object) {
/* 149 */ return (isNotNull(object) && object.getClass().isArray());
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public static String trim(String str) {
/* 157 */ return (str == null) ? "" : str.trim();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String substring(String str, int start) {
/* 169 */ if (str == null)
/* */ {
/* 171 */ return "";
/* */ }
/* */
/* 174 */ if (start < 0)
/* */ {
/* 176 */ start = str.length() + start;
/* */ }
/* */
/* 179 */ if (start < 0)
/* */ {
/* 181 */ start = 0;
/* */ }
/* 183 */ if (start > str.length())
/* */ {
/* 185 */ return "";
/* */ }
/* */
/* 188 */ return str.substring(start);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String substring(String str, int start, int end) {
/* 201 */ if (str == null)
/* */ {
/* 203 */ return "";
/* */ }
/* */
/* 206 */ if (end < 0)
/* */ {
/* 208 */ end = str.length() + end;
/* */ }
/* 210 */ if (start < 0)
/* */ {
/* 212 */ start = str.length() + start;
/* */ }
/* */
/* 215 */ if (end > str.length())
/* */ {
/* 217 */ end = str.length();
/* */ }
/* */
/* 220 */ if (start > end)
/* */ {
/* 222 */ return "";
/* */ }
/* */
/* 225 */ if (start < 0)
/* */ {
/* 227 */ start = 0;
/* */ }
/* 229 */ if (end < 0)
/* */ {
/* 231 */ end = 0;
/* */ }
/* */
/* 234 */ return str.substring(start, end);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String format(String template, Object... params) {
/* 252 */ if (isEmpty(params) || isEmpty(template))
/* */ {
/* 254 */ return template;
/* */ }
/* 256 */ return StrFormatter.format(template, params);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public static String toUnderScoreCase(String str) {
/* 264 */ if (str == null)
/* */ {
/* 266 */ return null;
/* */ }
/* 268 */ StringBuilder sb = new StringBuilder();
/* */
/* 270 */ boolean preCharIsUpperCase = true;
/* */
/* 272 */ boolean curreCharIsUpperCase = true;
/* */
/* 274 */ boolean nexteCharIsUpperCase = true;
/* 275 */ for (int i = 0; i < str.length(); i++) {
/* */
/* 277 */ char c = str.charAt(i);
/* 278 */ if (i > 0) {
/* */
/* 280 */ preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1));
/* */ }
/* */ else {
/* */
/* 284 */ preCharIsUpperCase = false;
/* */ }
/* */
/* 287 */ curreCharIsUpperCase = Character.isUpperCase(c);
/* */
/* 289 */ if (i < str.length() - 1)
/* */ {
/* 291 */ nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1));
/* */ }
/* */
/* 294 */ if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) {
/* */
/* 296 */ sb.append('_');
/* */ }
/* 298 */ else if (i != 0 && !preCharIsUpperCase && curreCharIsUpperCase) {
/* */
/* 300 */ sb.append('_');
/* */ }
/* 302 */ sb.append(Character.toLowerCase(c));
/* */ }
/* 304 */ return sb.toString();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static boolean inStringIgnoreCase(String str, String... strs) {
/* 316 */ if (str != null && strs != null)
/* */ {
/* 318 */ for (String s : strs) {
/* */
/* 320 */ if (str.equalsIgnoreCase(trim(s)))
/* */ {
/* 322 */ return true;
/* */ }
/* */ }
/* */ }
/* 326 */ return false;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String convertToCamelCase(String name) {
/* 337 */ StringBuilder result = new StringBuilder();
/* */
/* 339 */ if (name == null || name.isEmpty())
/* */ {
/* */
/* 342 */ return "";
/* */ }
/* 344 */ if (!name.contains("_"))
/* */ {
/* */
/* 347 */ return name.substring(0, 1).toUpperCase() + name.substring(1);
/* */ }
/* */
/* 350 */ String[] camels = name.split("_");
/* 351 */ for (String camel : camels) {
/* */
/* */
/* 354 */ if (!camel.isEmpty()) {
/* */
/* */
/* */
/* */
/* 359 */ result.append(camel.substring(0, 1).toUpperCase());
/* 360 */ result.append(camel.substring(1).toLowerCase());
/* */ }
/* 362 */ } return result.toString();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static String toCamelCase(String s) {
/* 371 */ if (s == null)
/* */ {
/* 373 */ return null;
/* */ }
/* 375 */ if (s.indexOf('_') == -1)
/* */ {
/* 377 */ return s;
/* */ }
/* 379 */ s = s.toLowerCase();
/* 380 */ StringBuilder sb = new StringBuilder(s.length());
/* 381 */ boolean upperCase = false;
/* 382 */ for (int i = 0; i < s.length(); i++) {
/* */
/* 384 */ char c = s.charAt(i);
/* */
/* 386 */ if (c == '_') {
/* */
/* 388 */ upperCase = true;
/* */ }
/* 390 */ else if (upperCase) {
/* */
/* 392 */ sb.append(Character.toUpperCase(c));
/* 393 */ upperCase = false;
/* */ }
/* */ else {
/* */
/* 397 */ sb.append(c);
/* */ }
/* */ }
/* 400 */ return sb.toString();
/* */ }
/* */
/* */
/* */
/* */ public static <T> T cast(Object obj) {
/* 406 */ return (T)obj;
/* */ }
/* */ }
import com.archive.common.utils.text.StrFormatter;
import java.util.Collection;
import java.util.Map;
public class StringUtils
extends org.apache.commons.lang3.StringUtils
{
private static final String NULLSTR = "";
private static final char SEPARATOR = '_';
public static <T> T nvl(T value, T defaultValue) {
return (value != null) ? value : defaultValue;
}
public static boolean isEmpty(Collection<?> coll) {
return (isNull(coll) || coll.isEmpty());
}
public static boolean isNotEmpty(Collection<?> coll) {
return !isEmpty(coll);
}
public static boolean isEmpty(Object[] objects) {
return (isNull(objects) || objects.length == 0);
}
public static boolean isNotEmpty(Object[] objects) {
return !isEmpty(objects);
}
public static boolean isEmpty(Map<?, ?> map) {
return (isNull(map) || map.isEmpty());
}
public static boolean isNotEmpty(Map<?, ?> map) {
return !isEmpty(map);
}
public static boolean isEmpty(String str) {
return (isNull(str) || "".equals(str.trim()));
}
public static boolean isNotEmpty(String str) {
return !isEmpty(str);
}
public static boolean isNull(Object object) {
return (object == null);
}
public static boolean isNotNull(Object object) {
return !isNull(object);
}
public static boolean isArray(Object object) {
return (isNotNull(object) && object.getClass().isArray());
}
public static String trim(String str) {
return (str == null) ? "" : str.trim();
}
public static String substring(String str, int start) {
if (str == null)
{
return "";
}
if (start < 0)
{
start = str.length() + start;
}
if (start < 0)
{
start = 0;
}
if (start > str.length())
{
return "";
}
return str.substring(start);
}
public static String substring(String str, int start, int end) {
if (str == null)
{
return "";
}
if (end < 0)
{
end = str.length() + end;
}
if (start < 0)
{
start = str.length() + start;
}
if (end > str.length())
{
end = str.length();
}
if (start > end)
{
return "";
}
if (start < 0)
{
start = 0;
}
if (end < 0)
{
end = 0;
}
return str.substring(start, end);
}
public static String format(String template, Object... params) {
if (isEmpty(params) || isEmpty(template))
{
return template;
}
return StrFormatter.format(template, params);
}
public static String toUnderScoreCase(String str) {
if (str == null)
{
return null;
}
StringBuilder sb = new StringBuilder();
boolean preCharIsUpperCase = true;
boolean curreCharIsUpperCase = true;
boolean nexteCharIsUpperCase = true;
for (int i = 0; i < str.length(); i++) {
char c = str.charAt(i);
if (i > 0) {
preCharIsUpperCase = Character.isUpperCase(str.charAt(i - 1));
}
else {
preCharIsUpperCase = false;
}
curreCharIsUpperCase = Character.isUpperCase(c);
if (i < str.length() - 1)
{
nexteCharIsUpperCase = Character.isUpperCase(str.charAt(i + 1));
}
if (preCharIsUpperCase && curreCharIsUpperCase && !nexteCharIsUpperCase) {
sb.append('_');
}
else if (i != 0 && !preCharIsUpperCase && curreCharIsUpperCase) {
sb.append('_');
}
sb.append(Character.toLowerCase(c));
}
return sb.toString();
}
public static boolean inStringIgnoreCase(String str, String... strs) {
if (str != null && strs != null)
{
for (String s : strs) {
if (str.equalsIgnoreCase(trim(s)))
{
return true;
}
}
}
return false;
}
public static String convertToCamelCase(String name) {
StringBuilder result = new StringBuilder();
if (name == null || name.isEmpty())
{
return "";
}
if (!name.contains("_"))
{
return name.substring(0, 1).toUpperCase() + name.substring(1);
}
String[] camels = name.split("_");
for (String camel : camels) {
if (!camel.isEmpty()) {
result.append(camel.substring(0, 1).toUpperCase());
result.append(camel.substring(1).toLowerCase());
}
} return result.toString();
}
public static String toCamelCase(String s) {
if (s == null)
{
return null;
}
if (s.indexOf('_') == -1)
{
return s;
}
s = s.toLowerCase();
StringBuilder sb = new StringBuilder(s.length());
boolean upperCase = false;
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (c == '_') {
upperCase = true;
}
else if (upperCase) {
sb.append(Character.toUpperCase(c));
upperCase = false;
}
else {
sb.append(c);
}
}
return sb.toString();
}
public static <T> T cast(Object obj) {
return (T)obj;
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\commo\\utils\StringUtils.class

@ -7,9 +7,11 @@
/* */ import com.archive.common.utils.file.ImageUtils;
/* */ import com.archive.common.utils.reflect.ReflectUtils;
/* */ import com.archive.common.utils.text.Convert;
/* */ import com.archive.framework.aspectj.lang.annotation.Excel;
/* */ import com.archive.framework.aspectj.lang.annotation.ColumnType;
import com.archive.framework.aspectj.lang.annotation.Excel;
/* */ import com.archive.framework.aspectj.lang.annotation.Excels;
/* */ import com.archive.framework.config.ArchiveConfig;
/* */ import com.archive.framework.aspectj.lang.annotation.Type;
import com.archive.framework.config.ArchiveConfig;
/* */ import com.archive.framework.web.domain.AjaxResult;
/* */ import com.archive.project.system.dict.utils.DictUtils;
/* */ import java.io.File;
@ -80,7 +82,7 @@
/* */
/* */
/* */
/* */ private Excel.Type type;
/* */ private Type type;
/* */
/* */
/* */
@ -133,7 +135,7 @@
/* */ }
/* */
/* */
/* */ public void init(List<T> list, String sheetName, Excel.Type type) {
/* */ public void init(List<T> list, String sheetName, Type type) {
/* 137 */ if (list == null)
/* */ {
/* 139 */ list = new ArrayList<>();
@ -165,7 +167,7 @@
/* */
/* */
/* */ public List<T> importExcel(String sheetName, InputStream is) throws Exception {
/* 168 */ this.type = Excel.Type.IMPORT;
/* 168 */ this.type = Type.IMPORT;
/* 169 */ this.wb = WorkbookFactory.create(is);
/* 170 */ List<T> list = new ArrayList<>();
/* 171 */ Sheet sheet = null;
@ -215,7 +217,7 @@
/* */
/* 216 */ Field field = allFields[col];
/* 217 */ Excel attr = field.<Excel>getAnnotation(Excel.class);
/* 218 */ if (attr != null && (attr.type() == Excel.Type.ALL || attr.type() == this.type)) {
/* 218 */ if (attr != null && (attr.type() == Type.ALL || attr.type() == this.type)) {
/* */
/* */
/* 221 */ field.setAccessible(true);
@ -335,7 +337,7 @@
/* */
/* */
/* */ public AjaxResult exportExcel(List<T> list, String sheetName) {
/* 338 */ init(list, sheetName, Excel.Type.EXPORT);
/* 338 */ init(list, sheetName, Type.EXPORT);
/* 339 */ return exportExcel();
/* */ }
/* */
@ -347,7 +349,7 @@
/* */
/* */
/* */ public AjaxResult importTemplateExcel(String sheetName) {
/* 350 */ init(null, sheetName, Excel.Type.IMPORT);
/* 350 */ init(null, sheetName, Type.IMPORT);
/* 351 */ return exportExcel();
/* */ }
/* */
@ -376,7 +378,7 @@
/* 376 */ Excel excel = (Excel)os[1];
/* 377 */ createCell(excel, row, column++);
/* */ }
/* 379 */ if (Excel.Type.EXPORT.equals(this.type)) {
/* 379 */ if (Type.EXPORT.equals(this.type)) {
/* */
/* 381 */ fillExcelData(index, row);
/* 382 */ addStatisticsRow();
@ -537,15 +539,15 @@
/* */
/* */
/* */ public void setCellVo(Object value, Excel attr, Cell cell) {
/* 540 */ if (Excel.ColumnType.STRING == attr.cellType()) {
/* 540 */ if (ColumnType.STRING == attr.cellType()) {
/* */
/* 542 */ cell.setCellValue(StringUtils.isNull(value) ? attr.defaultValue() : (value + attr.suffix()));
/* */ }
/* 544 */ else if (Excel.ColumnType.NUMERIC == attr.cellType()) {
/* 544 */ else if (ColumnType.NUMERIC == attr.cellType()) {
/* */
/* 546 */ cell.setCellValue(StringUtils.contains(Convert.toStr(value), ".") ? Convert.toDouble(value).doubleValue() : Convert.toInt(value).intValue());
/* */ }
/* 548 */ else if (Excel.ColumnType.IMAGE == attr.cellType()) {
/* 548 */ else if (ColumnType.IMAGE == attr.cellType()) {
/* */
/* */
/* 551 */ XSSFClientAnchor xSSFClientAnchor = new XSSFClientAnchor(0, 0, 0, 0, (short)cell.getColumnIndex(), cell.getRow().getRowNum(), (short)(cell.getColumnIndex() + 1), cell.getRow().getRowNum() + 1);
@ -1002,7 +1004,7 @@
/* */
/* */
/* */ private void putToField(Field field, Excel attr) {
/* 1005 */ if (attr != null && (attr.type() == Excel.Type.ALL || attr.type() == this.type))
/* 1005 */ if (attr != null && (attr.type() == Type.ALL || attr.type() == this.type))
/* */ {
/* 1007 */ this.fields.add(new Object[] { field, attr });
/* */ }

@ -0,0 +1,135 @@
package com.archive.framework.aspectj.lang.annotation
;
import com.archive.framework.aspectj.lang.annotation.Excel;
public enum Align
{
AUTO(0), LEFT(1), CENTER(2), RIGHT(3);
private final int value;
Align(int value) {
this.value = value;
}
public int value() {
return this.value;
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\aspectj\lang\annotation\Excel$Align.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/

@ -1,135 +0,0 @@
/* */ package com.archive.framework.aspectj.lang.annotation
;
/* */
/* */ import com.archive.framework.aspectj.lang.annotation.Excel;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public enum Align
/* */ {
/* 115 */ AUTO(0), LEFT(1), CENTER(2), RIGHT(3);
/* */
/* */ private final int value;
/* */
/* */ Align(int value) {
/* 120 */ this.value = value;
/* */ }
/* */
/* */
/* */ public int value() {
/* 125 */ return this.value;
/* */ }
/* */ }
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\aspectj\lang\annotation\Excel$Align.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/

@ -1,182 +1,273 @@
/* */ package com.archive.framework.web.controller
package com.archive.framework.web.controller
;
/* */
/* */ import com.archive.common.utils.StringUtils;
/* */ import com.archive.common.utils.security.ShiroUtils;
/* */ import com.archive.common.utils.sql.SqlUtil;
/* */ import com.archive.framework.web.domain.AjaxResult;
/* */ import com.archive.framework.web.page.PageDomain;
/* */ import com.archive.framework.web.page.TableDataInfo;
/* */ import com.archive.framework.web.page.TableSupport;
/* */ import com.archive.project.system.user.domain.User;
/* */ import com.github.pagehelper.PageHelper;
/* */ import com.github.pagehelper.PageInfo;
/* */ import java.beans.PropertyEditor;
/* */ import java.util.Date;
/* */ import java.util.List;
/* */ import org.springframework.web.bind.WebDataBinder;
/* */ import org.springframework.web.bind.annotation.InitBinder;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class BaseController
/* */ {
/* */ @InitBinder
/* */ public void initBinder(WebDataBinder binder) {
/* 35 */ binder.registerCustomEditor(Date.class, (PropertyEditor)new Object(this));
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ protected void startPage() {
/* 50 */ PageDomain pageDomain = TableSupport.buildPageRequest();
/* 51 */ Integer pageNum = pageDomain.getPageNum();
/* 52 */ Integer pageSize = pageDomain.getPageSize();
/* 53 */ if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) {
/* */
/* 55 */ String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
/* 56 */ PageHelper.startPage(pageNum.intValue(), pageSize.intValue(), orderBy);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ protected void startOrderBy() {
/* 65 */ PageDomain pageDomain = TableSupport.buildPageRequest();
/* 66 */ if (StringUtils.isNotEmpty(pageDomain.getOrderBy())) {
/* */
/* 68 */ String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
/* 69 */ PageHelper.orderBy(orderBy);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ protected TableDataInfo getDataTable(List<?> list) {
/* 79 */ TableDataInfo rspData = new TableDataInfo();
/* 80 */ if (list != null) {
/* 81 */ rspData.setCode(0);
/* 82 */ rspData.setRows(list);
/* 83 */ rspData.setTotal((new PageInfo(list)).getTotal());
/* */ }
/* 85 */ return rspData;
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ protected AjaxResult toAjax(int rows) {
/* 96 */ return (rows > 0) ? success() : error();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ protected AjaxResult toAjax(boolean result) {
/* 107 */ return result ? success() : error();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public AjaxResult success() {
/* 115 */ return AjaxResult.success();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public AjaxResult error() {
/* 123 */ return AjaxResult.error();
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public AjaxResult success(String message) {
/* 131 */ return AjaxResult.success(message);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public AjaxResult error(String message) {
/* 139 */ return AjaxResult.error(message);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public AjaxResult error(AjaxResult.Type type, String message) {
/* 147 */ return new AjaxResult(type, message);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */ public String redirect(String url) {
/* 155 */ return StringUtils.format("redirect:{}", new Object[] { url });
/* */ }
/* */
/* */
/* */ public User getSysUser() {
/* 160 */ return ShiroUtils.getSysUser();
/* */ }
/* */
/* */
/* */ public void setSysUser(User user) {
/* 165 */ ShiroUtils.setSysUser(user);
/* */ }
/* */
/* */
/* */ public Long getUserId() {
/* 170 */ return getSysUser().getUserId();
/* */ }
/* */
/* */
/* */ public String getLoginName() {
/* 175 */ return getSysUser().getLoginName();
/* */ }
/* */ }
import com.archive.common.utils.DateUtils;
import com.archive.common.utils.StringUtils;
import com.archive.common.utils.security.ShiroUtils;
import com.archive.common.utils.sql.SqlUtil;
import com.archive.framework.web.domain.AjaxResult;
import com.archive.framework.web.domain.Type;
import com.archive.framework.web.page.PageDomain;
import com.archive.framework.web.page.TableDataInfo;
import com.archive.framework.web.page.TableSupport;
import com.archive.project.system.user.domain.User;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import java.beans.PropertyEditor;
import java.beans.PropertyEditorSupport;
import java.util.Date;
import java.util.List;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
public class BaseController
{
@InitBinder
public void initBinder(WebDataBinder binder) {
// Date 类型转换
binder.registerCustomEditor(Date.class, new PropertyEditorSupport() {
@Override
public void setAsText(String text) {
setValue(DateUtils.parseDate(text));
}
});
}
protected void startPage() {
PageDomain pageDomain = TableSupport.buildPageRequest();
Integer pageNum = pageDomain.getPageNum();
Integer pageSize = pageDomain.getPageSize();
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) {
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
PageHelper.startPage(pageNum.intValue(), pageSize.intValue(), orderBy);
}
}
protected void startOrderBy() {
PageDomain pageDomain = TableSupport.buildPageRequest();
if (StringUtils.isNotEmpty(pageDomain.getOrderBy())) {
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
PageHelper.orderBy(orderBy);
}
}
protected TableDataInfo getDataTable(List<?> list) {
TableDataInfo rspData = new TableDataInfo();
if (list != null) {
rspData.setCode(0);
rspData.setRows(list);
rspData.setTotal((new PageInfo(list)).getTotal());
}
return rspData;
}
protected AjaxResult toAjax(int rows) {
return (rows > 0) ? success() : error();
}
protected AjaxResult toAjax(boolean result) {
return result ? success() : error();
}
public AjaxResult success() {
return AjaxResult.success();
}
public AjaxResult error() {
return AjaxResult.error();
}
public AjaxResult success(String message) {
return AjaxResult.success(message);
}
public AjaxResult error(String message) {
return AjaxResult.error(message);
}
public AjaxResult error(Type type, String message) {
return new AjaxResult(type, message);
}
public String redirect(String url) {
return StringUtils.format("redirect:{}", new Object[]{url});
}
public User getSysUser() {
return ShiroUtils.getSysUser();
}
public void setSysUser(User user) {
ShiroUtils.setSysUser(user);
}
public Long getUserId() {
return getSysUser().getUserId();
}
public String getLoginName() {
return getSysUser().getLoginName();
}
}
/* Location: C:\Users\Administrator\Desktop\extracted.zip!\extracted\BOOT-INF\classes\com\archive\framework\web\controller\BaseController.class

@ -48,7 +48,7 @@
/* */ private Date startTimestamp;
/* */ private Date lastAccessTime;
/* */ private Long expireTime;
/* 49 */ private OnlineSession.OnlineStatus status = OnlineSession.OnlineStatus.on_line;
/* 49 */ private OnlineStatus status = OnlineStatus.on_line;
/* */
/* */
/* */ private OnlineSession session;
@ -154,12 +154,12 @@
/* */ }
/* */
/* */
/* */ public OnlineSession.OnlineStatus getStatus() {
/* */ public OnlineStatus getStatus() {
/* 156 */ return this.status;
/* */ }
/* */
/* */
/* */ public void setStatus(OnlineSession.OnlineStatus status) {
/* */ public void setStatus(OnlineStatus status) {
/* 161 */ this.status = status;
/* */ }
/* */
@ -173,7 +173,7 @@
/* 171 */ this.session = session;
/* */ }
/* */
/* */
/* */ @Override
/* */ public String toString() {
/* 176 */ return (new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE))
/* 177 */ .append("sessionId", getSessionId())

Loading…
Cancel
Save