| | |
| | | Page page = new Page<>(); |
| | | Long pageNum = comActMicroWishVO.getPageNum(); |
| | | Long pageSize = comActMicroWishVO.getPageSize(); |
| | | if (ObjectUtils.isEmpty(pageNum) || 0 == pageNum) { |
| | | if (null==pageNum || 0 == pageNum) { |
| | | pageNum = 1l; |
| | | } |
| | | if (ObjectUtils.isEmpty(pageSize) || 0 == pageSize) { |
| | | if (null==pageSize || 0 == pageSize) { |
| | | pageSize = 10l; |
| | | } |
| | | page.setSize(pageSize); |
| | |
| | | @Override |
| | | public R detailMicroWish(Long id, Long userId) { |
| | | ComActMicroWishVO comActMicroWishVO = comActMicroWishDAO.detailMicroWish(id); |
| | | Integer starNum = comActMicroWishVO.getStarNum(); |
| | | if (null==starNum) { |
| | | comActMicroWishVO.setStarNum(0); |
| | | } |
| | | if (ObjectUtils.isEmpty(comActMicroWishVO)) { |
| | | return R.fail(); |
| | | return R.fail("心愿不存在"); |
| | | } |
| | | ComActMicroWishUserDO comActMicroWishUserDO = comActMicroWishUserDAO.selectOne(new QueryWrapper<ComActMicroWishUserDO>().lambda().eq(ComActMicroWishUserDO::getUserId, userId).eq(ComActMicroWishUserDO::getMicroWishId, id)); |
| | | if (ObjectUtils.isEmpty(comActMicroWishUserDO)) { |
| | |
| | | return R.fail(); |
| | | } |
| | | |
| | | /** |
| | | * 用户确认心愿 |
| | | * |
| | | * @param comActMicroWishVO 用户评价 |
| | | * @return 确认结果 |
| | | */ |
| | | @Override |
| | | public R putMicroWishConfirm(ComActMicroWishVO comActMicroWishVO) { |
| | | ComActMicroWishDO comActMicroWishDO1 = comActMicroWishDAO.selectById(comActMicroWishVO.getId()); |
| | | if (ObjectUtils.isEmpty(comActMicroWishDO1)) { |
| | | return R.fail("心愿不存在"); |
| | | } |
| | | Integer status = comActMicroWishDO1.getStatus(); |
| | | if (status.intValue()!=5) { |
| | | return R.fail("心愿状态不是待确认"); |
| | | } |
| | | ComActMicroWishDO comActMicroWishDO=new ComActMicroWishDO(); |
| | | comActMicroWishDO.setId(comActMicroWishVO.getId()); |
| | | comActMicroWishDO.setExamineAt(comActMicroWishVO.getExamineAt()); |
| | | comActMicroWishDO.setStatus(comActMicroWishVO.getStatus()); |
| | | comActMicroWishDO.setScore(comActMicroWishVO.getScore()); |
| | | comActMicroWishDO.setEvaluate(comActMicroWishVO.getEvaluate()); |
| | | int update = comActMicroWishDAO.updateById(comActMicroWishDO); |
| | | if (update>0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |