Search in sources :

Example 1 with DataTablesResult

use of cn.exrick.common.pojo.DataTablesResult in project xmall by Exrick.

the class MemberServiceImpl method getMemberList.

@Override
public DataTablesResult getMemberList(int draw, int start, int length, String search, String minDate, String maxDate, String orderCol, String orderDir) {
    DataTablesResult result = new DataTablesResult();
    try {
        // 分页
        PageHelper.startPage(start / length + 1, length);
        List<TbMember> list = tbMemberMapper.selectByMemberInfo("%" + search + "%", minDate, maxDate, orderCol, orderDir);
        PageInfo<TbMember> pageInfo = new PageInfo<>(list);
        for (TbMember tbMember : list) {
            tbMember.setPassword("");
        }
        result.setRecordsFiltered((int) pageInfo.getTotal());
        result.setRecordsTotal(getMemberCount().getRecordsTotal());
        result.setDraw(draw);
        result.setData(list);
    } catch (Exception e) {
        throw new XmallException("加载用户列表失败");
    }
    return result;
}
Also used : PageInfo(com.github.pagehelper.PageInfo) TbMember(cn.exrick.manager.pojo.TbMember) DataTablesResult(cn.exrick.common.pojo.DataTablesResult) XmallException(cn.exrick.common.exception.XmallException) XmallException(cn.exrick.common.exception.XmallException)

Example 2 with DataTablesResult

use of cn.exrick.common.pojo.DataTablesResult in project xmall by Exrick.

the class OrderServiceImpl method getOrderList.

@Override
public DataTablesResult getOrderList() {
    DataTablesResult result = new DataTablesResult();
    TbOrderExample example = new TbOrderExample();
    List<TbOrder> list = tbOrderMapper.selectByExample(example);
    if (list == null) {
        throw new XmallException("获取订单列表失败");
    }
    result.setSuccess(true);
    result.setData(list);
    return result;
}
Also used : DataTablesResult(cn.exrick.common.pojo.DataTablesResult) XmallException(cn.exrick.common.exception.XmallException)

Example 3 with DataTablesResult

use of cn.exrick.common.pojo.DataTablesResult in project xmall by Exrick.

the class SystemServiceImpl method getLogList.

@Override
public DataTablesResult getLogList() {
    DataTablesResult result = new DataTablesResult();
    TbLogExample example = new TbLogExample();
    List<TbLog> list = tbLogMapper.selectByExample(example);
    if (list == null) {
        throw new XmallException("获取日志列表失败");
    }
    result.setSuccess(true);
    result.setData(list);
    return result;
}
Also used : DataTablesResult(cn.exrick.common.pojo.DataTablesResult) XmallException(cn.exrick.common.exception.XmallException)

Example 4 with DataTablesResult

use of cn.exrick.common.pojo.DataTablesResult in project xmall by Exrick.

the class ThanksServiceImpl method getThanksList.

@Override
public DataTablesResult getThanksList() {
    DataTablesResult result = new DataTablesResult();
    TbThanksExample example = new TbThanksExample();
    List<TbThanks> list = tbThanksMapper.selectByExample(example);
    if (list == null) {
        throw new XmallException("获取捐赠列表失败");
    }
    result.setSuccess(true);
    result.setData(list);
    return result;
}
Also used : TbThanks(cn.exrick.manager.pojo.TbThanks) DataTablesResult(cn.exrick.common.pojo.DataTablesResult) TbThanksExample(cn.exrick.manager.pojo.TbThanksExample) XmallException(cn.exrick.common.exception.XmallException)

Example 5 with DataTablesResult

use of cn.exrick.common.pojo.DataTablesResult in project xmall by Exrick.

the class UserServiceImpl method getUserList.

@Override
public DataTablesResult getUserList() {
    DataTablesResult result = new DataTablesResult();
    TbUserExample example = new TbUserExample();
    List<TbUser> list = tbUserMapper.selectByExample(example);
    if (list == null) {
        throw new XmallException("获取用户列表失败");
    }
    for (TbUser tbUser : list) {
        String names = "";
        Iterator it = getRoles(tbUser.getUsername()).iterator();
        while (it.hasNext()) {
            names += it.next() + " ";
        }
        tbUser.setPassword("");
        tbUser.setRoleNames(names);
    }
    result.setData(list);
    return result;
}
Also used : DataTablesResult(cn.exrick.common.pojo.DataTablesResult) XmallException(cn.exrick.common.exception.XmallException)

Aggregations

DataTablesResult (cn.exrick.common.pojo.DataTablesResult)21 XmallException (cn.exrick.common.exception.XmallException)11 PageInfo (com.github.pagehelper.PageInfo)5 ApiOperation (io.swagger.annotations.ApiOperation)5 TbItem (cn.exrick.manager.pojo.TbItem)2 TbMember (cn.exrick.manager.pojo.TbMember)2 TbMemberExample (cn.exrick.manager.pojo.TbMemberExample)2 TbThanks (cn.exrick.manager.pojo.TbThanks)2 TbThanksExample (cn.exrick.manager.pojo.TbThanksExample)2 ArrayList (java.util.ArrayList)2 ContentDto (cn.exrick.manager.dto.ContentDto)1 ImageDto (cn.exrick.manager.dto.ImageDto)1 RoleDto (cn.exrick.manager.dto.RoleDto)1 TbContentCategory (cn.exrick.manager.pojo.TbContentCategory)1 TbImage (cn.exrick.manager.pojo.TbImage)1 TbImageExample (cn.exrick.manager.pojo.TbImageExample)1 TbItemExample (cn.exrick.manager.pojo.TbItemExample)1 TbShiroFilter (cn.exrick.manager.pojo.TbShiroFilter)1 ParseException (java.text.ParseException)1 SimpleDateFormat (java.text.SimpleDateFormat)1