From ada9d2e3f734582a0d9ae8c00a936d8c8ed669d7 Mon Sep 17 00:00:00 2001
From: huanghongfa <18228131219@163.com>
Date: 星期五, 15 一月 2021 13:51:44 +0800
Subject: [PATCH] 微心愿详情bug

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java |   72 +++++++++++++++++++++++++++++++++---
 1 files changed, 66 insertions(+), 6 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java
index dac6d40..a8fe9d1 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java
@@ -6,6 +6,7 @@
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.panzhihua.common.model.vos.R;
 import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO;
+import com.panzhihua.common.model.vos.community.TodoEventsVO;
 import com.panzhihua.service_community.dao.ComActEasyPhotoDAO;
 import com.panzhihua.service_community.dao.ComActEasyPhotoUserDAO;
 import com.panzhihua.service_community.model.dos.ComActEasyPhotoDO;
@@ -16,6 +17,7 @@
 import org.springframework.util.ObjectUtils;
 
 import javax.annotation.Resource;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -41,10 +43,11 @@
         Page page = new Page<>();
         Long pageNum = comActEasyPhotoVO.getPageNum();
         Long pageSize = comActEasyPhotoVO.getPageSize();
-        if (ObjectUtils.isEmpty(pageNum)||0==pageNum) {
+        Long userId = comActEasyPhotoVO.getLogInUserId();
+        if (null==pageNum||0==pageNum) {
             pageNum = 1l;
         }
-        if (ObjectUtils.isEmpty(pageSize)||0==pageSize) {
+        if (null==pageSize||0==pageSize) {
             pageSize = 10l;
         }
         page.setSize(pageSize);
@@ -54,8 +57,7 @@
         if (!ObjectUtils.isEmpty(records)) {
             records.forEach(comActEasyPhotoVO1 -> {
                 Long id = comActEasyPhotoVO1.getId();
-                Long sponsorId = comActEasyPhotoVO1.getSponsorId();
-                ComActEasyPhotoUserDO comActEasyPhotoUserDO = comActEasyPhotoUserDAO.selectOne(new QueryWrapper<ComActEasyPhotoUserDO>().lambda().eq(ComActEasyPhotoUserDO::getEasyPhotoId, id).eq(ComActEasyPhotoUserDO::getUserId, sponsorId));
+                ComActEasyPhotoUserDO comActEasyPhotoUserDO = comActEasyPhotoUserDAO.selectOne(new QueryWrapper<ComActEasyPhotoUserDO>().lambda().eq(ComActEasyPhotoUserDO::getEasyPhotoId, id).eq(ComActEasyPhotoUserDO::getUserId, userId));
                 if (ObjectUtils.isEmpty(comActEasyPhotoUserDO)) {
                     comActEasyPhotoVO1.setHaveGiveThumbsUp(0);
                 }else {
@@ -77,8 +79,8 @@
     @Override
     public R detailEasyPhoto(Long id, Long userId) {
         ComActEasyPhotoVO comActEasyPhotoVO=comActEasyPhotoDAO.detailEasyPhoto(id);
-        if (ObjectUtils.isEmpty(comActEasyPhotoVO)) {
-            return R.fail();
+        if (ObjectUtils.isEmpty(comActEasyPhotoVO)||null==comActEasyPhotoVO.getStatus()) {
+            return R.fail("随手拍不存在");
         }
         ComActEasyPhotoUserDO comActEasyPhotoUserDO = comActEasyPhotoUserDAO.selectOne(new QueryWrapper<ComActEasyPhotoUserDO>().lambda().eq(ComActEasyPhotoUserDO::getEasyPhotoId, id).eq(ComActEasyPhotoUserDO::getUserId, userId));
         if (ObjectUtils.isEmpty(comActEasyPhotoUserDO)) {
@@ -141,4 +143,62 @@
         }
         return R.fail();
     }
+
+    /**
+     * 审核反馈随手拍
+     *
+     * @param comActEasyPhotoVO 操作参数
+     * @return 操作结果
+     */
+    @Override
+    public R putEasypHotoStatus(ComActEasyPhotoVO comActEasyPhotoVO) {
+        Integer type = comActEasyPhotoVO.getType();
+//        操作类型 1审核通过 2驳回  3反馈
+        ComActEasyPhotoDO cmActEasyPhotoDO=new ComActEasyPhotoDO();
+        cmActEasyPhotoDO.setId(comActEasyPhotoVO.getId());
+        cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getUserId());
+        Date date = new Date();
+        switch (type){
+            case 1:
+                int isNeedFeedBack = comActEasyPhotoVO.getIsNeedFeedBack().intValue();
+                if (isNeedFeedBack==1) {
+                    cmActEasyPhotoDO.setStatus(2);//进行中
+                    cmActEasyPhotoDO.setIsNeedFeedBack(1);
+                }else{
+                    cmActEasyPhotoDO.setStatus(4);//已完成
+                }
+                cmActEasyPhotoDO.setExamineAt(date);
+                break;
+            case 2:
+                cmActEasyPhotoDO.setStatus(3);//已驳回
+                cmActEasyPhotoDO.setExamineAt(date);
+                cmActEasyPhotoDO.setRejectReason(comActEasyPhotoVO.getRejectReason());
+                break;
+            case 3:
+                cmActEasyPhotoDO.setHandleResult(comActEasyPhotoVO.getHandleResult());
+                cmActEasyPhotoDO.setHandlePhotoList(comActEasyPhotoVO.getHandlePhotoList());
+                cmActEasyPhotoDO.setStatus(4);//已完成
+                cmActEasyPhotoDO.setFeedbackAt(date);
+                break;
+            default:break;
+        }
+        int update = comActEasyPhotoDAO.updateById(cmActEasyPhotoDO);
+        if (update>0) {
+            return R.ok();
+        }
+        return R.fail();
+    }
+
+    /**
+     * 随手拍是否有待审核和带反馈的事件
+     *
+     * @param communityId 社区id
+     * @param userId      登录用户id
+     * @return 待处理事件集合
+     */
+    @Override
+    public List<TodoEventsVO> selectNeedToDo(Long communityId, Long userId) {
+        List<TodoEventsVO> todoEventsVOS=comActEasyPhotoDAO.selectNeedToDo(communityId,userId);
+        return todoEventsVOS;
+    }
 }

--
Gitblit v1.7.1