From d9eee1919dbff7ffddc48b1f4fee2ec41a54a2a2 Mon Sep 17 00:00:00 2001
From: huanghongfa <18228131219@163.com>
Date: 星期二, 05 一月 2021 18:19:52 +0800
Subject: [PATCH] 运营后台完成

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMicroWishServiceImpl.java |   41 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMicroWishServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMicroWishServiceImpl.java
index 17421bd..2df1137 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMicroWishServiceImpl.java
+++ b/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,8 +78,12 @@
     @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)) {
@@ -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();
+    }
+
+
+
 
 }

--
Gitblit v1.7.1