|
@@ -8,6 +8,7 @@ import cn.hutool.json.JSONUtil;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import thyyxxk.webserver.config.envionment.JcptMobile;
|
|
@@ -22,7 +23,7 @@ import thyyxxk.webserver.service.hutoolcache.UserCache;
|
|
|
import thyyxxk.webserver.service.jcptmobile.JcptMobileService;
|
|
|
import thyyxxk.webserver.utils.R;
|
|
|
|
|
|
-import javax.annotation.PostConstruct;
|
|
|
+import javax.validation.Valid;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -35,7 +36,6 @@ public class SchedulingClassService {
|
|
|
private final JcptMobile jcptMobile;
|
|
|
private final JcptMobileService mobileService;
|
|
|
|
|
|
- @Scheduled(cron = "0 0 1 20 * ?")
|
|
|
public void create() {
|
|
|
DateTime now = DateTime.now();
|
|
|
// 获取下一个月的日期
|
|
@@ -44,7 +44,6 @@ public class SchedulingClassService {
|
|
|
createByMonth(nextMonth);
|
|
|
}
|
|
|
|
|
|
- @Scheduled(cron = "0 20 17 * * ?")
|
|
|
public void sendMessageData() {
|
|
|
String now = DateUtil.format(DateTime.now(), "yyyy-MM-dd");
|
|
|
SchedulingClass schedulingClass = dao.selectOne(SchedulingClass.lambdaQueryWrapper().eq(SchedulingClass::getSchedulingDate, now));
|
|
@@ -149,11 +148,10 @@ public class SchedulingClassService {
|
|
|
if (schedulingClass == null) {
|
|
|
return R.fail(ExceptionEnum.LOGICAL_ERROR, "没有找到数据");
|
|
|
}
|
|
|
-
|
|
|
- if (now.compareTo(schedulingClass.getSchedulingDate()) > 0) {
|
|
|
+ DateTime dateTime = DateTime.of(data.getSchedulingDate());
|
|
|
+ if (DateUtil.isSameDay(now, dateTime) && DateTime.now().compareTo(now) > 0) {
|
|
|
return R.fail(ExceptionEnum.LOGICAL_ERROR, "数据固话无法修改。");
|
|
|
}
|
|
|
-
|
|
|
dao.updateById(data);
|
|
|
return R.ok(ExceptionEnum.SUCCESS_AND_EL_MESSAGE);
|
|
|
}
|