|  |  |  | 
|---|
|  |  |  | import com.matrix.core.tools.InternationaUtil; | 
|---|
|  |  |  | import com.matrix.core.tools.MdcUtil; | 
|---|
|  |  |  | import com.matrix.core.tools.StringUtils; | 
|---|
|  |  |  | import com.matrix.system.hive.plugin.message.StringUtil; | 
|---|
|  |  |  | import com.matrix.system.fenxiao.vo.ShopSalesmanApplyVo; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.io.Serializable; | 
|---|
|  |  |  | import java.util.HashMap; | 
|---|
|  |  |  | 
|---|
|  |  |  | * info会被国际化工具先处理,找不到国际化资源则显示原始信息 | 
|---|
|  |  |  | **/ | 
|---|
|  |  |  | private String info; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 单个对象返回参数 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private Object data; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private Map<Object, Object> mapInfo = new HashMap<>(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private List<?> rows; | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 总记录数 | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private String requestId; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static AjaxResult buildSuccessInstance(Object data) { | 
|---|
|  |  |  | AjaxResult result= new AjaxResult(STATUS_SUCCESS,""); | 
|---|
|  |  |  | result.data=data; | 
|---|
|  |  |  | return  result; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static AjaxResult buildSuccessInstance(Object data, String info) { | 
|---|
|  |  |  | AjaxResult result= new AjaxResult(STATUS_SUCCESS,info); | 
|---|
|  |  |  | result.data=data; | 
|---|
|  |  |  | return  result; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static AjaxResult buildSuccessInstance(String info) { | 
|---|
|  |  |  | 
|---|
|  |  |  | public static AjaxResult buildSuccessInstance(List<?> rows, Integer total) { | 
|---|
|  |  |  | return new AjaxResult(STATUS_SUCCESS, rows, total); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static AjaxResult buildSuccessInstance(List<?> rows, long total) { | 
|---|
|  |  |  | return new AjaxResult(STATUS_SUCCESS, rows, Integer.parseInt(total+"")); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public static AjaxResult buildSuccessInstance(List<?> rows) { | 
|---|
|  |  |  | return new AjaxResult(STATUS_SUCCESS, rows); | 
|---|
|  |  |  | 
|---|
|  |  |  | * 设置简单信息,这是一个便捷的方法 | 
|---|
|  |  |  | * | 
|---|
|  |  |  | * @param status | 
|---|
|  |  |  | * @param page | 
|---|
|  |  |  | * @param info | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public AjaxResult(String status, List<?> rows) { | 
|---|
|  |  |  | this.status = status; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.requestId= MdcUtil.getMdc(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | this.requestId = requestId; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Object getData() { | 
|---|
|  |  |  | return data; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setData(Object data) { | 
|---|
|  |  |  | this.data = data; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 在map对象中放置信息 | 
|---|
|  |  |  | * | 
|---|