Commit 64885d5c by songxiang

大老板的紧急需求

parent f89670d4
......@@ -14,7 +14,8 @@ public enum RoleCodeEnum {
merchant("merchant"), // 商户
channel("channel"), // 渠道
agent("agent"), // 代理
adviser("adviser"); // 顾问
adviser("adviser"), // 顾问
platform("platform"); // 平台
/**
* 值
......
......@@ -17,43 +17,63 @@ import com.pcloud.common.page.PageBeanNew;
*/
public class ResultUtils {
/**
* 集合查询结果判断
*
* @param lists
* @return
*/
public static <T> List<T> list(List<T> lists) {
if (!ListUtils.isEmpty(lists)) {
return lists;
}
return Lists.newArrayList();
}
/**
* map查询结果判断
*
* @param lists
* @return
*/
public static <K, V> Map<K, V> map(Map<K, V> map) {
if (!MapUtils.isEmpty(map)) {
return map;
}
return Maps.newHashMap();
}
/**
* 分页查询结果判断
*
* @param pageBeanNew
* @return
*/
public static <T> PageBeanNew<T> pageBeanNew(PageBeanNew<T> pageBeanNew, Integer currentPage, Integer numPerPage) {
if (pageBeanNew != null) {
return pageBeanNew;
}
return new PageBeanNew<T>(currentPage, numPerPage, 0, Lists.newArrayList());
}
/**
* 单个对象实例化
*
* @param t
* @param clazz
* @return
* @author songx
* @date 2019年1月14日,下午7:32:35
*/
public static <T> T object(T t, Class<T> clazz) {
if (t == null) {
return null;
}
try {
return clazz.newInstance();
} catch (Exception e) {
}
return null;
}
/**
* 集合查询结果判断
*
* @param lists
* @return
*/
public static <T> List<T> list(List<T> lists) {
if (!ListUtils.isEmpty(lists)) {
return lists;
}
return Lists.newArrayList();
}
/**
* map查询结果判断
*
* @param lists
* @return
*/
public static <K, V> Map<K, V> map(Map<K, V> map) {
if (!MapUtils.isEmpty(map)) {
return map;
}
return Maps.newHashMap();
}
/**
* 分页查询结果判断
*
* @param pageBeanNew
* @return
*/
public static <T> PageBeanNew<T> pageBeanNew(PageBeanNew<T> pageBeanNew, Integer currentPage, Integer numPerPage) {
if (pageBeanNew != null) {
return pageBeanNew;
}
return new PageBeanNew<T>(currentPage, numPerPage, 0, Lists.newArrayList());
}
}
/**
*
*/
package com.pcloud.common.vo;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
/**
* VO父类
*
* @author:songx
* @date:2019年1月14日,下午8:53:01
*/
@JsonInclude(value = Include.NON_NULL)
public class BaseVO implements Serializable {
/**
*
*/
private static final long serialVersionUID = -5943734920212204836L;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment