use of com.bc.pmpheep.back.vo.WriterPointLogVO in project pmph by BCSquad.
the class WriterPointLogServiceImpl method getListWriterPointLog.
@Override
public PageResult<WriterPointLogVO> getListWriterPointLog(PageParameter<WriterPointLogVO> pageParameter) throws CheckedServiceException {
PageResult<WriterPointLogVO> pageResult = new PageResult<WriterPointLogVO>();
// 开始时间
String startTime = pageParameter.getParameter().getStartTime();
// 结束时间
String endTime = pageParameter.getParameter().getEndTime();
Long userId = pageParameter.getParameter().getUserId();
WriterPointLogVO writerPointLogVO = new WriterPointLogVO();
if (StringUtil.isEmpty(startTime) && StringUtil.isEmpty(endTime)) {
writerPointLogVO.setStartTime(null);
writerPointLogVO.setEndTime(null);
} else {
writerPointLogVO.setStartTime(startTime + " 00:00:00");
writerPointLogVO.setEndTime(endTime + " 23:59:59");
}
if (StringUtil.isEmpty(startTime) && StringUtil.notEmpty(endTime)) {
writerPointLogVO.setStartTime(endTime + " 00:00:00");
writerPointLogVO.setEndTime(endTime + " 23:59:59");
} else if (StringUtil.isEmpty(endTime) && StringUtil.notEmpty(startTime)) {
writerPointLogVO.setStartTime(startTime + " 00:00:00");
writerPointLogVO.setEndTime(startTime + " 23:59:59");
}
if (ObjectUtil.notNull(userId)) {
writerPointLogVO.setUserId(userId);
} else {
throw new CheckedServiceException(CheckedExceptionBusiness.WRITER_POINT_MANAGEMENT, CheckedExceptionResult.NULL_PARAM, "参数为空");
}
pageParameter.setParameter(writerPointLogVO);
// 将页面大小和页面页码拷贝
PageParameterUitl.CopyPageParameter(pageParameter, pageResult);
// 包含数据总条数的数据集
List<WriterPointLogVO> writerPointLogVOs = writerPointLogDao.listWriterPointLogVO(pageParameter);
if (CollectionUtil.isNotEmpty(writerPointLogVOs)) {
Integer count = writerPointLogVOs.get(0).getCount();
pageResult.setTotal(count);
pageResult.setRows(writerPointLogVOs);
}
return pageResult;
}
use of com.bc.pmpheep.back.vo.WriterPointLogVO in project pmph by BCSquad.
the class WriterPointLogController method list.
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "分页查询用户积分获取记录列表")
@RequestMapping(value = "/list", method = RequestMethod.GET)
public ResponseBean list(@RequestParam("pageSize") Integer pageSize, @RequestParam("pageNumber") Integer pageNumber, @RequestParam("userId") Long userId, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime) {
PageParameter<WriterPointLogVO> pageParameter = new PageParameter<>(pageNumber, pageSize);
WriterPointLogVO writerPointLogVO = new WriterPointLogVO();
writerPointLogVO.setUserId(userId);
writerPointLogVO.setStartTime(startTime);
writerPointLogVO.setEndTime(endTime);
pageParameter.setParameter(writerPointLogVO);
return new ResponseBean(writerPointLogService.getListWriterPointLog(pageParameter));
}
use of com.bc.pmpheep.back.vo.WriterPointLogVO in project pmph by BCSquad.
the class WriterPointLogServiceImpl method getListWriterPointLogExchange.
@Override
public PageResult<WriterPointLogVO> getListWriterPointLogExchange(PageParameter<WriterPointLogVO> pageParameter) throws CheckedServiceException {
PageResult<WriterPointLogVO> pageResult = new PageResult<WriterPointLogVO>();
// 开始时间
String startTime = pageParameter.getParameter().getStartTime();
// 结束时间
String endTime = pageParameter.getParameter().getEndTime();
Long userId = pageParameter.getParameter().getUserId();
WriterPointLogVO writerPointLogVO = new WriterPointLogVO();
if (StringUtil.isEmpty(startTime) && StringUtil.isEmpty(endTime)) {
writerPointLogVO.setStartTime(null);
writerPointLogVO.setEndTime(null);
} else {
writerPointLogVO.setStartTime(startTime + " 00:00:00");
writerPointLogVO.setEndTime(endTime + " 23:59:59");
}
if (StringUtil.isEmpty(startTime) && StringUtil.notEmpty(endTime)) {
writerPointLogVO.setStartTime(endTime + " 00:00:00");
writerPointLogVO.setEndTime(endTime + " 23:59:59");
} else if (StringUtil.isEmpty(endTime) && StringUtil.notEmpty(startTime)) {
writerPointLogVO.setStartTime(startTime + " 00:00:00");
writerPointLogVO.setEndTime(startTime + " 23:59:59");
}
if (ObjectUtil.notNull(userId)) {
writerPointLogVO.setUserId(userId);
} else {
throw new CheckedServiceException(CheckedExceptionBusiness.WRITER_POINT_MANAGEMENT, CheckedExceptionResult.NULL_PARAM, "参数为空");
}
pageParameter.setParameter(writerPointLogVO);
// 将页面大小和页面页码拷贝
PageParameterUitl.CopyPageParameter(pageParameter, pageResult);
// 包含数据总条数的数据集
List<WriterPointLogVO> writerPointLogVOs = writerPointLogDao.listWriterPointLogVOExchange(pageParameter);
if (CollectionUtil.isNotEmpty(writerPointLogVOs)) {
Integer count = writerPointLogVOs.get(0).getCount();
pageResult.setTotal(count);
pageResult.setRows(writerPointLogVOs);
}
return pageResult;
}
use of com.bc.pmpheep.back.vo.WriterPointLogVO in project pmph by BCSquad.
the class WriterPointLogController method listExchange.
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "分页查询用户积分兑换记录列表")
@RequestMapping(value = "/listExchange", method = RequestMethod.GET)
public ResponseBean listExchange(@RequestParam("pageSize") Integer pageSize, @RequestParam("pageNumber") Integer pageNumber, @RequestParam("userId") Long userId, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime) {
PageParameter<WriterPointLogVO> pageParameter = new PageParameter<>(pageNumber, pageSize);
WriterPointLogVO writerPointLogVO = new WriterPointLogVO();
writerPointLogVO.setUserId(userId);
writerPointLogVO.setStartTime(startTime);
writerPointLogVO.setEndTime(endTime);
pageParameter.setParameter(writerPointLogVO);
return new ResponseBean(writerPointLogService.getListWriterPointLogExchange(pageParameter));
}
use of com.bc.pmpheep.back.vo.WriterPointLogVO 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);
}
Aggregations