Search in sources :

Example 16 with TbMember

use of cn.exrick.manager.pojo.TbMember in project xmall by Exrick.

the class MemberServiceImpl method getRemoveMemberList.

@Override
public DataTablesResult getRemoveMemberList(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.selectByRemoveMemberInfo("%" + search + "%", minDate, maxDate, orderCol, orderDir);
        PageInfo<TbMember> pageInfo = new PageInfo<>(list);
        for (TbMember tbMember : list) {
            tbMember.setPassword("");
        }
        result.setRecordsFiltered((int) pageInfo.getTotal());
        result.setRecordsTotal(getRemoveMemberCount().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 17 with TbMember

use of cn.exrick.manager.pojo.TbMember in project xmall by Exrick.

the class MemberServiceImpl method getMemberByEditEmail.

@Override
public TbMember getMemberByEditEmail(Long id, String email) {
    TbMember tbMember = getMemberById(id);
    TbMember newTbMember = null;
    if (tbMember.getEmail() == null || !tbMember.getEmail().equals(email)) {
        newTbMember = getMemberByEmail(email);
    }
    newTbMember.setPassword("");
    return newTbMember;
}
Also used : TbMember(cn.exrick.manager.pojo.TbMember)

Aggregations

TbMember (cn.exrick.manager.pojo.TbMember)17 XmallException (cn.exrick.common.exception.XmallException)12 TbMemberExample (cn.exrick.manager.pojo.TbMemberExample)5 Date (java.util.Date)5 DataTablesResult (cn.exrick.common.pojo.DataTablesResult)2 Member (cn.exrick.manager.dto.front.Member)2 PageInfo (com.github.pagehelper.PageInfo)2 Gson (com.google.gson.Gson)2