huanghongfa
2021-01-05 d9eee1919dbff7ffddc48b1f4fee2ec41a54a2a2
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMicroWishServiceImpl.java
@@ -43,10 +43,10 @@
        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);
@@ -78,6 +78,10 @@
    @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("心愿不存在");
        }
@@ -185,5 +189,36 @@
        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();
    }
}