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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations