From 3f7f5b1b98e66693f4f7f85a2eb73f654efbf938 Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期六, 24 七月 2021 13:36:30 +0800
Subject: [PATCH] 修改bug
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoActivityServiceImpl.java | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoActivityServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoActivityServiceImpl.java
index 4eaacb0..39bd6ea 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoActivityServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoActivityServiceImpl.java
@@ -72,16 +72,22 @@
if(count > 0){
return R.fail("在此期间已有活动,请勿重复添加");
}
+
+ Date nowDate = new Date();
ComActEasyPhotoActivityDO photoActivityDO = new ComActEasyPhotoActivityDO();
BeanUtils.copyProperties(addEasyPhotoActivityDTO,photoActivityDO);
photoActivityDO.setActivityStartAt(DateUtils.stringToDate(addEasyPhotoActivityDTO.getActivityStartAt(),DateUtils.ymdhm_format));
photoActivityDO.setActivityEndAt(DateUtils.stringToDate(addEasyPhotoActivityDTO.getActivityEndAt(),DateUtils.ymdhm_format));
photoActivityDO.setCreateAt(new Date());
photoActivityDO.setReleaseAt(new Date());
- if(new Date().getTime() > photoActivityDO.getActivityStartAt().getTime()){
- photoActivityDO.setStatus(2);
+ if(photoActivityDO.getActivityEndAt().getTime() <= nowDate.getTime()){
+ return R.fail("活动结束时间不可小于当前时间");
+ }
+
+ if(nowDate.getTime() >= photoActivityDO.getActivityStartAt().getTime()){
+ photoActivityDO.setStatus(ComActEasyPhotoActivityDO.status.jxz);
}else{
- photoActivityDO.setStatus(1);
+ photoActivityDO.setStatus(ComActEasyPhotoActivityDO.status.dks);
}
photoActivityDO.setCount(0);
--
Gitblit v1.7.1