|
@@ -30,7 +30,9 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
+import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@@ -164,7 +166,17 @@ public class IntegralShareService extends BaseService<IntegralShare> {
|
|
|
//分享时间
|
|
//分享时间
|
|
|
integralShareVO.setShareDate(LocalDateTime.now());
|
|
integralShareVO.setShareDate(LocalDateTime.now());
|
|
|
//截止时间
|
|
//截止时间
|
|
|
- integralShareVO.setEndDate(LocalDateTime.now().plusDays(integralTacticResponses.get(0).getShareValidTimes()));
|
|
|
|
|
|
|
+ if(Constant.IntegralType.INTEGRAL_TYPE_INVITE.getName().equals(integralShareVO.getIntegralType())) {
|
|
|
|
|
+ integralShareVO.setEndDate(LocalDateTime.now().plusHours(integralTacticResponses.get(0).getShareValidTimes()));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ // 获取当前日期时间
|
|
|
|
|
+ LocalDateTime currentDateTime = LocalDateTime.now(); // 设置时间为23点59分
|
|
|
|
|
+ LocalDateTime time2359 = currentDateTime.withHour(23).withMinute(59);
|
|
|
|
|
+ // 格式化时间为指定格式
|
|
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
+ String formattedDateTime = time2359.format(formatter);
|
|
|
|
|
+ integralShareVO.setEndDate(LocalDateTime.parse(formattedDateTime));
|
|
|
|
|
+ }
|
|
|
//实体转换
|
|
//实体转换
|
|
|
IntegralShare integralShare = integralShareConvert.convertToPo(integralShareVO);
|
|
IntegralShare integralShare = integralShareConvert.convertToPo(integralShareVO);
|
|
|
//新建
|
|
//新建
|