From 1a69de7ac9d58ad8482b1540e13ee66b1adae291 Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期五, 23 七月 2021 17:38:17 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/test' into test
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoActivityServiceImpl.java | 25 ++++++++++++++++++++-----
1 files changed, 20 insertions(+), 5 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 12d7601..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);
@@ -110,8 +116,17 @@
}
BeanUtils.copyProperties(editEasyPhotoActivityDTO,photoActivityDO);
- photoActivityDO.setActivityStartAt(DateUtils.stringToDate(editEasyPhotoActivityDTO.getActivityStartAt(),DateUtils.ymdhms_format));
- photoActivityDO.setActivityEndAt(DateUtils.stringToDate(editEasyPhotoActivityDTO.getActivityEndAt(),DateUtils.ymdhms_format));
+ photoActivityDO.setActivityStartAt(DateUtils.stringToDate(editEasyPhotoActivityDTO.getActivityStartAt(),DateUtils.ymdhm_format));
+ photoActivityDO.setActivityEndAt(DateUtils.stringToDate(editEasyPhotoActivityDTO.getActivityEndAt(),DateUtils.ymdhm_format));
+ if(new Date().getTime() > photoActivityDO.getActivityStartAt().getTime()){
+ photoActivityDO.setStatus(ComActEasyPhotoActivityDO.status.jxz);
+ }else{
+ photoActivityDO.setStatus(ComActEasyPhotoActivityDO.status.dks);
+ }
+
+ if(new Date().getTime() > photoActivityDO.getActivityEndAt().getTime()){
+ photoActivityDO.setStatus(ComActEasyPhotoActivityDO.status.yjs);
+ }
if(this.baseMapper.updateById(photoActivityDO) > 0){
return R.ok();
}
--
Gitblit v1.7.1