三七 1 giorno fa
parent
commit
3730595eaf

+ 20 - 0
fs-qw-task/src/main/java/com/fs/app/controller/CommonController.java

@@ -29,6 +29,9 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.Arrays;
 import java.util.List;
 
@@ -87,6 +90,23 @@ public class CommonController {
     private IFsUserCourseCountService userCourseCountService;
 
 
+    @GetMapping("/sopguanfan")
+    public R sop(String dateTime) throws Exception {
+
+        LocalDateTime localDateTime = DateUtil.parseLocalDateTime(dateTime);
+
+        int currentHour = localDateTime.getHour();
+        LocalDate localDate = localDateTime.toLocalDate();
+
+        String taskStartTime = localDate.atTime(currentHour, 0, 0)
+                .format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
+        String taskEndTime = localDate.atTime(currentHour, 59, 59)
+                .format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
+
+        qwSopLogsService.createCorpMassSendingByUserLogs( taskStartTime, taskEndTime);
+        return R.ok();
+    }
+
     @GetMapping("/testSop")
     public R testSop() throws Exception {