TestController.java
2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package com.ruoyi.controller;
import com.ruoyi.common.core.domain.ResponseResult;
import com.ruoyi.job.DriverJob;
import com.ruoyi.service.driver.NewDriverService;
import com.ruoyi.service.key.location.LinggangKeyWorkLocationService;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
/**
* @author liujun
* @date 2024年07月30日 14:37
*/
@RestController
@RequestMapping("/test")
public class TestController {
@Autowired
private DriverJob driverJob;
@Autowired
private LinggangKeyWorkLocationService keyWorkLocationService;
@Autowired
private NewDriverService newDriverService;
@GetMapping(value = "/test")
@ApiOperation("test")
public ResponseResult<Boolean> test() {
// driverJob.getSchedulingInfo("02:30:30");
// Calendar calendar = Calendar.getInstance();
// calendar.setTime(new Date());
// calendar.set(Calendar.HOUR,2);
// calendar.set(Calendar.MINUTE,30);
// calendar.set(Calendar.SECOND,30);
// Date date = calendar.getTime();
Date date = new Date();
for (int i = 0; i < 2; i++) {
driverJob.runScheduling(DateUtils.addDays(date,i).getTime());
}
return ResponseResult.success();
}
@GetMapping(value = "/key/info/local")
@ApiOperation("/key/info/local")
public ResponseResult<Boolean> testKeyInfoLocal(@RequestParam("dateStr") String dateStr) {
keyWorkLocationService.insertJob(dateStr);
return ResponseResult.success();
}
@GetMapping(value = "/driver")
public ResponseResult<Boolean> insertDriver(){
newDriverService.insertJob();
return ResponseResult.success();
}
}