last version
This commit is contained in:
@@ -3,6 +3,8 @@ package com.ruoyi.common.core.controller;
|
||||
import java.beans.PropertyEditorSupport;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.WebDataBinder;
|
||||
@@ -90,6 +92,38 @@ public class BaseController
|
||||
return rspData;
|
||||
}
|
||||
|
||||
|
||||
protected TableDataInfo getDataTableByNewList(List<?> list,List<?> newList)
|
||||
{
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(newList);
|
||||
rspData.setTotal(new PageInfo(list).getTotal());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
protected TableDataInfo getDataTableByPage(Page<?> page)
|
||||
{
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(page.getRecords());
|
||||
rspData.setTotal(page.getTotal());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
protected TableDataInfo getDataTableByPageNewList(Page<?> page,List<?> newList)
|
||||
{
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(newList);
|
||||
rspData.setTotal(page.getTotal());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 返回成功
|
||||
*/
|
||||
|
||||
@@ -5,10 +5,7 @@ import org.springframework.beans.BeanWrapper;
|
||||
import org.springframework.beans.BeanWrapperImpl;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@@ -126,4 +123,19 @@ public class BeanUtils extends org.springframework.beans.BeanUtils
|
||||
String[] result = new String[emptyNames.size()];
|
||||
return emptyNames.toArray(result);
|
||||
}
|
||||
|
||||
public static String[] getZeroPropertyNames(Object source) {
|
||||
final BeanWrapper src = new BeanWrapperImpl(source);
|
||||
java.beans.PropertyDescriptor[] pds = src.getPropertyDescriptors();
|
||||
|
||||
Set<String> zeroValueNames = new HashSet<>();
|
||||
for (java.beans.PropertyDescriptor pd : pds) {
|
||||
Object srcValue = src.getPropertyValue(pd.getName());
|
||||
if (Objects.equals(srcValue, 0)) {
|
||||
zeroValueNames.add(pd.getName());
|
||||
}
|
||||
}
|
||||
String[] result = new String[zeroValueNames.size()];
|
||||
return zeroValueNames.toArray(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class FileUploadUtils
|
||||
/**
|
||||
* 默认大小 50M
|
||||
*/
|
||||
public static final long DEFAULT_MAX_SIZE = 256 * 1024 * 1024;
|
||||
public static final long DEFAULT_MAX_SIZE = 512 * 1024 * 1024;
|
||||
|
||||
/**
|
||||
* 默认的文件名最大长度 100
|
||||
|
||||
@@ -36,7 +36,10 @@ public class MimeTypeUtils
|
||||
// 视频格式
|
||||
"mp4", "avi", "rmvb",
|
||||
// pdf
|
||||
"pdf" };
|
||||
"pdf" ,
|
||||
// apk
|
||||
"apk"
|
||||
};
|
||||
|
||||
public static String getExtension(String prefix)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user