From cd7bec2448443f88eee6f73df68df829fc95eed9 Mon Sep 17 00:00:00 2001
From: 罗元桥 <2376770955@qq.com>
Date: 星期二, 29 六月 2021 11:25:24 +0800
Subject: [PATCH] Merge branch 'test' into 'master'

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 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 6a49d32..f325c99 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
@@ -11,16 +11,11 @@
 import com.panzhihua.common.model.vos.community.ComActEasyPhotoCommentVO;
 import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO;
 import com.panzhihua.common.model.vos.community.TodoEventsVO;
+import com.panzhihua.common.utlis.DateUtils;
 import com.panzhihua.common.utlis.SensitiveUtil;
 import com.panzhihua.common.utlis.StringUtils;
-import com.panzhihua.service_community.dao.ComActEasyPhotoCommentDAO;
-import com.panzhihua.service_community.dao.ComActEasyPhotoCommentUserDAO;
-import com.panzhihua.service_community.dao.ComActEasyPhotoDAO;
-import com.panzhihua.service_community.dao.ComActEasyPhotoUserDAO;
-import com.panzhihua.service_community.model.dos.ComActEasyPhotoCommentDO;
-import com.panzhihua.service_community.model.dos.ComActEasyPhotoCommentUserDO;
-import com.panzhihua.service_community.model.dos.ComActEasyPhotoDO;
-import com.panzhihua.service_community.model.dos.ComActEasyPhotoUserDO;
+import com.panzhihua.service_community.dao.*;
+import com.panzhihua.service_community.model.dos.*;
 import com.panzhihua.service_community.service.ComActEasyPhotoService;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
@@ -47,6 +42,8 @@
     private ComActEasyPhotoCommentDAO comActEasyPhotoCommentDAO ;
     @Resource
     private ComActEasyPhotoCommentUserDAO comActEasyPhotoCommentUserDAO ;
+    @Resource
+    private ComActEasyPhotoActivityMapper comActEasyPhotoActivityMapper;
     /**
      * 分页查询随手拍
      *
@@ -129,6 +126,15 @@
     public R addEasyPhoto(ComActEasyPhotoVO comActEasyPhotoVO) {
         ComActEasyPhotoDO comActEasyPhotoDO=new ComActEasyPhotoDO();
         BeanUtils.copyProperties(comActEasyPhotoVO,comActEasyPhotoDO);
+        //查询是否在活动时间内
+        Date nowDate = DateUtils.getCurrentDate(DateUtils.ymdhms_format);
+        List<ComActEasyPhotoActivityDO> photoActivityDOS = comActEasyPhotoActivityMapper.selectList(
+                new QueryWrapper<ComActEasyPhotoActivityDO>().lambda().eq(ComActEasyPhotoActivityDO::getCommunityId,comActEasyPhotoVO.getCommunityId())
+                        .le(ComActEasyPhotoActivityDO::getActivityStartAt,nowDate).ge(ComActEasyPhotoActivityDO::getActivityEndAt,nowDate));
+        if(!photoActivityDOS.isEmpty()){
+            ComActEasyPhotoActivityDO photoActivityDO = photoActivityDOS.get(0);
+            comActEasyPhotoDO.setActivityId(photoActivityDO.getId());
+        }
         int insert = comActEasyPhotoDAO.insert(comActEasyPhotoDO);
         if (insert>0) {
             return R.ok();

--
Gitblit v1.7.1