Search in sources :

Example 1 with WriterPointLogVO

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;
}
Also used : WriterPointLogVO(com.bc.pmpheep.back.vo.WriterPointLogVO) CheckedServiceException(com.bc.pmpheep.service.exception.CheckedServiceException) PageResult(com.bc.pmpheep.back.plugin.PageResult)

Example 2 with WriterPointLogVO

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));
}
Also used : WriterPointLogVO(com.bc.pmpheep.back.vo.WriterPointLogVO) PageParameter(com.bc.pmpheep.back.plugin.PageParameter) ResponseBean(com.bc.pmpheep.controller.bean.ResponseBean) LogDetail(com.bc.pmpheep.annotation.LogDetail) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 3 with WriterPointLogVO

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;
}
Also used : WriterPointLogVO(com.bc.pmpheep.back.vo.WriterPointLogVO) CheckedServiceException(com.bc.pmpheep.service.exception.CheckedServiceException) PageResult(com.bc.pmpheep.back.plugin.PageResult)

Example 4 with WriterPointLogVO

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));
}
Also used : WriterPointLogVO(com.bc.pmpheep.back.vo.WriterPointLogVO) PageParameter(com.bc.pmpheep.back.plugin.PageParameter) ResponseBean(com.bc.pmpheep.controller.bean.ResponseBean) LogDetail(com.bc.pmpheep.annotation.LogDetail) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 5 with WriterPointLogVO

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);
}
Also used : WriterPointLogVO(com.bc.pmpheep.back.vo.WriterPointLogVO) 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)

Aggregations

WriterPointLogVO (com.bc.pmpheep.back.vo.WriterPointLogVO)5 PageParameter (com.bc.pmpheep.back.plugin.PageParameter)3 PageResult (com.bc.pmpheep.back.plugin.PageResult)3 LogDetail (com.bc.pmpheep.annotation.LogDetail)2 ResponseBean (com.bc.pmpheep.controller.bean.ResponseBean)2 CheckedServiceException (com.bc.pmpheep.service.exception.CheckedServiceException)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)2 BaseTest (com.bc.pmpheep.test.BaseTest)1 Test (org.junit.Test)1 Rollback (org.springframework.test.annotation.Rollback)1