Search in sources :

Example 6 with PageResult

use of com.bc.pmpheep.back.plugin.PageResult in project pmph by BCSquad.

the class UserMessageServiceTest method testListMyMessageOfIcon.

@Test
@Rollback(Const.ISROLLBACK)
public void testListMyMessageOfIcon() {
    MyMessageVO myMessageVO = new MyMessageVO();
    myMessageVO.setUserId(1L);
    myMessageVO.setUserType(1);
    PageParameter pageParameter = new PageParameter<>();
    PageResult pageResult = new PageResult<>();
    pageParameter.setParameter(myMessageVO);
    pageResult = userMessageService.listMyMessageOfIcon(pageParameter);
    Assert.assertNotNull("查询成功了", pageResult);
}
Also used : MyMessageVO(com.bc.pmpheep.back.vo.MyMessageVO) PageParameter(com.bc.pmpheep.back.plugin.PageParameter) PageResult(com.bc.pmpheep.back.plugin.PageResult) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Example 7 with PageResult

use of com.bc.pmpheep.back.plugin.PageResult in project pmph by BCSquad.

the class WriterPointRuleServiceTest method getlistWriterPointRulePoint.

@SuppressWarnings({ "unused", "rawtypes", "unchecked" })
@Test
@Rollback(Const.ISROLLBACK)
public void getlistWriterPointRulePoint() {
    WriterPointRule writerPointRule = this.addWriterPointRulePoint();
    PageParameter pageParameter = new PageParameter<>();
    PageResult pageResult = new PageResult<>();
    WriterPointRuleVO writerPointRuleVO = new WriterPointRuleVO();
    pageParameter.setParameter(writerPointRuleVO);
    pageParameter.setPageSize(10);
    pageResult = writerPointRuleService.getlistWriterPointRulePoint(pageParameter);
    Assert.assertNotNull("分页数据失败", pageResult);
}
Also used : WriterPointRuleVO(com.bc.pmpheep.back.vo.WriterPointRuleVO) PageParameter(com.bc.pmpheep.back.plugin.PageParameter) WriterPointRule(com.bc.pmpheep.back.po.WriterPointRule) PageResult(com.bc.pmpheep.back.plugin.PageResult) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Example 8 with PageResult

use of com.bc.pmpheep.back.plugin.PageResult in project pmph by BCSquad.

the class WriterPointServiceTest method getListWriterPoint.

@SuppressWarnings({ "unused", "rawtypes", "unchecked" })
@Test
@Rollback(Const.ISROLLBACK)
public void getListWriterPoint() {
    WriterPoint writerPoint = this.addWriterPoints();
    PageParameter pageParameter = new PageParameter<>();
    PageResult pageResult = new PageResult<>();
    WriterPointVO writerPointVO = new WriterPointVO();
    pageParameter.setParameter(writerPointVO);
    pageParameter.setPageSize(10);
    pageResult = writerPointService.getListWriterPoint(pageParameter);
    Assert.assertNotNull("分页数据失败", pageResult);
}
Also used : WriterPointVO(com.bc.pmpheep.back.vo.WriterPointVO) PageParameter(com.bc.pmpheep.back.plugin.PageParameter) WriterPoint(com.bc.pmpheep.back.po.WriterPoint) PageResult(com.bc.pmpheep.back.plugin.PageResult) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Example 9 with PageResult

use of com.bc.pmpheep.back.plugin.PageResult in project pmph by BCSquad.

the class BookVideoServiceImpl method getVideoList.

@Override
public PageResult<BookVideoVO> getVideoList(Integer pageSize, Integer pageNumber, String bookName, Integer state, String upLoadTimeStart, String upLoadTimeEnd) {
    Map<String, Object> map = new HashMap<String, Object>(3);
    map.put("start", ((pageNumber - 1) * pageSize));
    map.put("pageSize", pageSize);
    bookName = StringUtil.toAllCheck(bookName);
    if (null != bookName) {
        map.put("bookName", bookName);
    }
    if (null != state && 0 != state.intValue()) {
        // all
        map.put("state", state);
    }
    // yyyy-MM-dd
    Timestamp startTime = null;
    if (StringUtil.notEmpty(upLoadTimeStart)) {
        startTime = DateUtil.str2Timestam(upLoadTimeStart);
        map.put("startTime", startTime);
    }
    if (StringUtil.notEmpty(upLoadTimeEnd)) {
        Timestamp endTime = DateUtil.str2Timestam(upLoadTimeEnd);
        if (ObjectUtil.notNull(startTime)) {
            if (startTime.compareTo(endTime) == 0) {
                endTime.setTime(startTime.getTime() + 24 * 60 * 60 * 1000);
            }
            map.put("endTime", endTime);
        }
    }
    PageResult<BookVideoVO> BookVideoVO2lst = new PageResult<BookVideoVO>();
    BookVideoVO2lst.setPageNumber(pageNumber);
    BookVideoVO2lst.setPageSize(pageSize);
    Integer total = bookVideoDao.getVideoListTotal(map);
    if (null != total && total > 0) {
        BookVideoVO2lst.setRows(bookVideoDao.getVideoList(map));
    }
    BookVideoVO2lst.setTotal(total);
    return BookVideoVO2lst;
}
Also used : HashMap(java.util.HashMap) BookVideoVO(com.bc.pmpheep.back.vo.BookVideoVO) PastBookVideoVO(com.bc.pmpheep.back.vo.PastBookVideoVO) Timestamp(java.sql.Timestamp) PageResult(com.bc.pmpheep.back.plugin.PageResult)

Example 10 with PageResult

use of com.bc.pmpheep.back.plugin.PageResult in project pmph by BCSquad.

the class BookVideoServiceImpl method getList.

@Override
public PageResult<PastBookVideoVO> getList(Integer pageSize, Integer pageNumber, String bookName) {
    Map<String, Object> map = new HashMap<String, Object>(3);
    if (!StringUtil.isEmpty(bookName)) {
        bookName = StringUtil.toAllCheck(bookName.trim());
        map.put("bookName", bookName);
    }
    map.put("start", ((pageNumber - 1) * pageSize));
    map.put("pageSize", pageSize);
    // 获取书籍的分页
    PageResult<Book> listBooks = bookService.listBook(pageSize, pageNumber, bookName);
    List<PastBookVideoVO> lst = new ArrayList<PastBookVideoVO>();
    Integer total = 0;
    if (null != listBooks && null != listBooks.getTotal() && listBooks.getTotal().intValue() > 0) {
        total = listBooks.getTotal();
        List<Long> bookIds = new ArrayList<Long>(listBooks.getRows().size());
        for (Book book : listBooks.getRows()) {
            bookIds.add(book.getId());
            PastBookVideoVO pastBookVideoVO = new PastBookVideoVO();
            pastBookVideoVO.setAuthor(book.getAuthor()).setBookId(book.getId()).setBookname(book.getBookname()).setImageUrl(book.getImageUrl()).setRevision(book.getRevision()).setSn(book.getSn());
            lst.add(pastBookVideoVO);
        }
        List<BookVideo> BookVideos = bookVideoDao.getBookVideoByBookIds(bookIds);
        for (PastBookVideoVO pastBookVideoVO : lst) {
            List<BookVideo> bookVideos = new ArrayList<BookVideo>();
            for (BookVideo BookVideo : BookVideos) {
                if (pastBookVideoVO.getBookId().equals(BookVideo.getBookId())) {
                    bookVideos.add(BookVideo);
                }
            }
            pastBookVideoVO.setBookVideos(bookVideos);
        }
    }
    PageResult<PastBookVideoVO> BookVideoVOlst = new PageResult<PastBookVideoVO>();
    BookVideoVOlst.setPageNumber(pageNumber);
    BookVideoVOlst.setPageSize(pageSize);
    BookVideoVOlst.setTotal(total);
    BookVideoVOlst.setRows(lst);
    return BookVideoVOlst;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) BookVideo(com.bc.pmpheep.back.po.BookVideo) PageResult(com.bc.pmpheep.back.plugin.PageResult) Book(com.bc.pmpheep.back.po.Book) PastBookVideoVO(com.bc.pmpheep.back.vo.PastBookVideoVO)

Aggregations

PageResult (com.bc.pmpheep.back.plugin.PageResult)57 CheckedServiceException (com.bc.pmpheep.service.exception.CheckedServiceException)33 PageParameter (com.bc.pmpheep.back.plugin.PageParameter)24 BaseTest (com.bc.pmpheep.test.BaseTest)20 Test (org.junit.Test)20 PmphUser (com.bc.pmpheep.back.po.PmphUser)17 ArrayList (java.util.ArrayList)13 Rollback (org.springframework.test.annotation.Rollback)12 HashMap (java.util.HashMap)8 CmsContentVO (com.bc.pmpheep.back.vo.CmsContentVO)4 MyMessageVO (com.bc.pmpheep.back.vo.MyMessageVO)4 OrgVO (com.bc.pmpheep.back.vo.OrgVO)4 WriterUserManagerVO (com.bc.pmpheep.back.vo.WriterUserManagerVO)4 PmphGroup (com.bc.pmpheep.back.po.PmphGroup)3 PmphRole (com.bc.pmpheep.back.po.PmphRole)3 SysOperation (com.bc.pmpheep.back.po.SysOperation)3 WriterUser (com.bc.pmpheep.back.po.WriterUser)3 PmphUserManagerVO (com.bc.pmpheep.back.vo.PmphUserManagerVO)3 Material (com.bc.pmpheep.back.po.Material)2 PmphDepartment (com.bc.pmpheep.back.po.PmphDepartment)2