use of com.bc.pmpheep.back.plugin.PageResult in project pmph by BCSquad.
the class SysOperationSeviceTest method testGetListSysOperation.
@Test
@Rollback(Const.ISROLLBACK)
public void testGetListSysOperation() {
PageParameter<SysOperation> pageParameter = new PageParameter<SysOperation>();
PageResult<SysOperation> pageResult = new PageResult<SysOperation>();
SysOperation sysOperation = new SysOperation(1L, "a", "a", DateUtil.getCurrentTime(), "/cms/content", "192.168.200.209", "aaaa", "pc");
pageParameter.setPageNumber(1);
pageParameter.setPageSize(10);
pageParameter.setParameter(sysOperation);
pageResult = sysOperationService.getListSysOperation(pageParameter);
Assert.assertNotNull("获取SysOperation列表失败", pageResult);
}
use of com.bc.pmpheep.back.plugin.PageResult in project pmph by BCSquad.
the class WriterPointLogServiceTest method getListWriterPointLog.
@SuppressWarnings({ "unused", "rawtypes", "unchecked" })
@Test
@Rollback(Const.ISROLLBACK)
public void getListWriterPointLog() {
Integer writerPointLog = this.addWriterPointLogs();
PageParameter pageParameter = new PageParameter<>();
PageResult pageResult = new PageResult<>();
WriterPointLogVO writerPointLogVO = new WriterPointLogVO();
pageParameter.setParameter(writerPointLogVO);
pageParameter.setPageSize(10);
pageResult = writerPointLogService.getListWriterPointLog(pageParameter);
Assert.assertNotNull("分页数据失败", pageResult);
}
use of com.bc.pmpheep.back.plugin.PageResult in project pmph by BCSquad.
the class WriterPointRuleServiceTest method getListWriterPointRule.
@SuppressWarnings({ "unused", "rawtypes", "unchecked" })
@Test
@Rollback(Const.ISROLLBACK)
public void getListWriterPointRule() {
WriterPointRule writerPointRule = this.addWriterPointRules();
PageParameter pageParameter = new PageParameter<>();
PageResult pageResult = new PageResult<>();
WriterPointRuleVO writerPointRuleVO = new WriterPointRuleVO();
pageParameter.setParameter(writerPointRuleVO);
pageParameter.setPageSize(10);
pageResult = writerPointRuleService.getListWriterPointRule(pageParameter);
Assert.assertNotNull("分页数据失败", pageResult);
}
use of com.bc.pmpheep.back.plugin.PageResult in project pmph by BCSquad.
the class PmphGroupFileServiceImpl method listGroupFile.
@Override
public PageResult<PmphGroupFileVO> listGroupFile(PageParameter<PmphGroupFileVO> pageParameter) {
if (ObjectUtil.isNull(pageParameter.getParameter().getGroupId())) {
throw new CheckedServiceException(CheckedExceptionBusiness.GROUP, CheckedExceptionResult.NULL_PARAM, "小组id不能为空");
}
String fileName = pageParameter.getParameter().getFileName();
if (StringUtil.notEmpty(fileName)) {
pageParameter.getParameter().setFileName(fileName);
}
PageResult<PmphGroupFileVO> pageResult = new PageResult<PmphGroupFileVO>();
PageParameterUitl.CopyPageParameter(pageParameter, pageResult);
int total = pmphGroupFileDao.getGroupFileTotal(pageParameter);
if (total > 0) {
List<PmphGroupFileVO> list = pmphGroupFileDao.listGroupFile(pageParameter);
for (PmphGroupFileVO pmphGroupFileVO : list) {
Double fileSize = pmphGroupFileVO.getFileSize();
if (ObjectUtil.notNull(fileSize)) {
if (fileSize > 0) {
pmphGroupFileVO.setFileLenth(String.format("%.2f", fileSize) + " KB");
} else {
pmphGroupFileVO.setFileLenth("0 KB");
}
if (fileSize > 1024) {
pmphGroupFileVO.setFileLenth(String.format("%.2f", fileSize / 1024) + " M");
}
if (fileSize > 1024 * 1024) {
pmphGroupFileVO.setFileLenth(String.format("%.2f", fileSize / 1024 / 1024) + " G");
}
} else {
pmphGroupFileVO.setFileLenth("大小不详");
}
pmphGroupFileVO.setFileId(RouteUtil.MONGODB_GROUP_FILE + pmphGroupFileVO.getFileId());
}
pageResult.setRows(list);
}
pageResult.setTotal(total);
return pageResult;
}
use of com.bc.pmpheep.back.plugin.PageResult in project pmph by BCSquad.
the class PmphGroupMemberServiceImpl method listGroupMemberManagerVOs.
@Override
public PageResult<PmphGroupMemberManagerVO> listGroupMemberManagerVOs(PageParameter<PmphGroupMemberManagerVO> pageParameter) throws CheckedServiceException {
if (null == pageParameter.getParameter().getGroupId()) {
throw new CheckedServiceException(CheckedExceptionBusiness.GROUP, CheckedExceptionResult.NULL_PARAM, "小组id不能为空");
}
String name = pageParameter.getParameter().getName();
if (StringUtil.notEmpty(name)) {
pageParameter.getParameter().setName(name);
}
PageResult<PmphGroupMemberManagerVO> pageResult = new PageResult<>();
PageParameterUitl.CopyPageParameter(pageParameter, pageResult);
int total = pmphGroupMemberDao.groupMemberTotal(pageParameter);
if (total > 0) {
List<PmphGroupMemberManagerVO> list = pmphGroupMemberDao.listGroupMemberManagerVOs(pageParameter);
for (PmphGroupMemberManagerVO pmphGroupMemberManagerVO : list) {
pmphGroupMemberManagerVO.setAvatar(RouteUtil.userAvatar(pmphGroupMemberManagerVO.getAvatar()));
if (pmphGroupMemberManagerVO.getIsWriter()) {
pmphGroupMemberManagerVO.setUserType(Const.SENDER_TYPE_2);
} else {
pmphGroupMemberManagerVO.setUserType(Const.SENDER_TYPE_1);
}
// 处理position
String position = pmphGroupMemberManagerVO.getPosition();
if (null != position && position.contains(",")) {
position = position.replace("无,", "").replace(",无", "");
String[] positions = position.split(",");
String tempPosition = positions[0];
for (int i = 1; i < positions.length; i++) {
if (!("," + tempPosition + ",").contains("," + positions[i] + ",")) {
tempPosition += "," + positions[i];
}
}
pmphGroupMemberManagerVO.setPosition(tempPosition);
}
// 处理position end
}
pageResult.setRows(list);
}
pageResult.setTotal(total);
return pageResult;
}
Aggregations