Search in sources :

Example 11 with DataTablesResult

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

the class ItemController method getItemList.

@RequestMapping(value = "/item/list", method = RequestMethod.GET)
@ApiOperation(value = "分页搜索排序获取商品列表")
public DataTablesResult getItemList(int draw, int start, int length, int cid, @RequestParam("search[value]") String search, @RequestParam("order[0][column]") int orderCol, @RequestParam("order[0][dir]") String orderDir, String searchItem, String minDate, String maxDate) {
    // 获取客户端需要排序的列
    String[] cols = { "checkbox", "id", "image", "title", "sell_point", "price", "created", "updated", "status" };
    String orderColumn = cols[orderCol];
    if (orderColumn == null) {
        orderColumn = "created";
    }
    // 获取排序方式 默认为desc(asc)
    if (orderDir == null) {
        orderDir = "desc";
    }
    DataTablesResult result = itemService.getItemList(draw, start, length, cid, search, orderColumn, orderDir);
    return result;
}
Also used : DataTablesResult(cn.exrick.common.pojo.DataTablesResult) ApiOperation(io.swagger.annotations.ApiOperation)

Example 12 with DataTablesResult

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

the class ItemController method getItemSearchList.

@RequestMapping(value = "/item/listSearch", method = RequestMethod.GET)
@ApiOperation(value = "多条件分页搜索排序获取商品列表")
public DataTablesResult getItemSearchList(int draw, int start, int length, int cid, String searchKey, String minDate, String maxDate, @RequestParam("search[value]") String search, @RequestParam("order[0][column]") int orderCol, @RequestParam("order[0][dir]") String orderDir) {
    // 获取客户端需要排序的列
    String[] cols = { "checkbox", "id", "image", "title", "sell_point", "price", "created", "updated", "status" };
    // 默认排序列
    String orderColumn = cols[orderCol];
    if (orderColumn == null) {
        orderColumn = "created";
    }
    // 获取排序方式 默认为desc(asc)
    if (orderDir == null) {
        orderDir = "desc";
    }
    if (!search.isEmpty()) {
        searchKey = search;
    }
    DataTablesResult result = itemService.getItemSearchList(draw, start, length, cid, searchKey, minDate, maxDate, orderColumn, orderDir);
    return result;
}
Also used : DataTablesResult(cn.exrick.common.pojo.DataTablesResult) ApiOperation(io.swagger.annotations.ApiOperation)

Example 13 with DataTablesResult

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

the class MemberController method getDelMemberList.

@RequestMapping(value = "/member/list/remove", method = RequestMethod.GET)
@ApiOperation(value = "分页多条件搜索已删除会员列表")
public DataTablesResult getDelMemberList(int draw, int start, int length, String searchKey, String minDate, String maxDate, @RequestParam("search[value]") String search, @RequestParam("order[0][column]") int orderCol, @RequestParam("order[0][dir]") String orderDir) {
    // 获取客户端需要排序的列
    String[] cols = { "checkbox", "id", "username", "sex", "phone", "email", "address", "created", "updated", "state" };
    String orderColumn = cols[orderCol];
    // 默认排序列
    if (orderColumn == null) {
        orderColumn = "created";
    }
    // 获取排序方式 默认为desc(asc)
    if (orderDir == null) {
        orderDir = "desc";
    }
    if (!search.isEmpty()) {
        searchKey = search;
    }
    DataTablesResult result = memberService.getRemoveMemberList(draw, start, length, searchKey, minDate, maxDate, orderColumn, orderDir);
    return result;
}
Also used : DataTablesResult(cn.exrick.common.pojo.DataTablesResult) ApiOperation(io.swagger.annotations.ApiOperation)

Example 14 with DataTablesResult

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

the class SystemController method getShiroList.

@RequestMapping(value = "/sys/shiro/list", method = RequestMethod.GET)
@ApiOperation(value = "获取shiro过滤链配置")
public DataTablesResult getShiroList(@ModelAttribute TbUser tbUser) {
    DataTablesResult result = new DataTablesResult();
    List<TbShiroFilter> list = systemService.getShiroFilter();
    result.setData(list);
    result.setSuccess(true);
    return result;
}
Also used : DataTablesResult(cn.exrick.common.pojo.DataTablesResult) TbShiroFilter(cn.exrick.manager.pojo.TbShiroFilter) ApiOperation(io.swagger.annotations.ApiOperation)

Example 15 with DataTablesResult

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

the class ItemServiceImpl method getItemList.

@Override
public DataTablesResult getItemList(int draw, int start, int length, int cid, String search, String orderCol, String orderDir) {
    DataTablesResult result = new DataTablesResult();
    // 分页执行查询返回结果
    PageHelper.startPage(start / length + 1, length);
    List<TbItem> list = tbItemMapper.selectItemByCondition(cid, "%" + search + "%", orderCol, orderDir);
    PageInfo<TbItem> pageInfo = new PageInfo<>(list);
    result.setRecordsFiltered((int) pageInfo.getTotal());
    result.setRecordsTotal(getAllItemCount().getRecordsTotal());
    result.setDraw(draw);
    result.setData(list);
    return result;
}
Also used : PageInfo(com.github.pagehelper.PageInfo) DataTablesResult(cn.exrick.common.pojo.DataTablesResult) TbItem(cn.exrick.manager.pojo.TbItem)

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