|
@@ -24,6 +24,8 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
|
|
+import java.time.LocalTime;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
|
|
|
|
|
import static com.kym.entity.admin.Activity.APPLY_STATION_部分站点;
|
|
import static com.kym.entity.admin.Activity.APPLY_STATION_部分站点;
|
|
@@ -54,6 +56,9 @@ public class ActivityServiceImpl extends ServiceImpl<ActivityMapper, Activity> i
|
|
|
this.stationService = stationService;
|
|
this.stationService = stationService;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 新增活动
|
|
* 新增活动
|
|
|
*
|
|
*
|
|
@@ -169,9 +174,10 @@ public class ActivityServiceImpl extends ServiceImpl<ActivityMapper, Activity> i
|
|
|
.one();
|
|
.one();
|
|
|
var userRechargeRights = new UserRechargeRights().setUserId(this.useId).setRightsBalance(rechargeAmount);
|
|
var userRechargeRights = new UserRechargeRights().setUserId(this.useId).setRightsBalance(rechargeAmount);
|
|
|
BeanUtils.copyProperties(rechargeRights, userRechargeRights, "id");
|
|
BeanUtils.copyProperties(rechargeRights, userRechargeRights, "id");
|
|
|
- userRechargeRightsService.save(userRechargeRights);
|
|
|
|
|
|
|
+ // 计算有效期
|
|
|
|
|
+ var endTime = LocalDateTime.now().with(LocalTime.MAX).plusDays(rechargeRights.getValidity() - 1);
|
|
|
|
|
+ userRechargeRightsService.save(userRechargeRights.setStartTime(LocalDateTime.now()).setEndTime(endTime));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|