13693261870
2024-10-30 495292b588949bcb2cb15eaa9657619aca7f5579
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
package com.se.simu.controller;
 
import com.se.simu.domain.po.DataPo;
import com.se.simu.domain.vo.R;
import com.se.simu.helper.StringHelper;
import com.se.simu.service.GedbService;
import com.se.simu.service.ResultService;
import com.se.simu.service.SimuService;
import com.se.simu.service.UwService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
 
/**
 * Test控制器
 *
 * @author WWW
 * @date   2024-10-30
 */
@Api(tags = "Test")
@Slf4j
@RestController
@RequestMapping("/test")
@SuppressWarnings("ALL")
public class TestController extends BaseController {
    @Resource
    UwService uwService;
 
    @Resource
    GedbService gedbService;
 
    @Resource
    SimuService simuService;
 
    @Resource
    ResultService resultService;
 
    @ApiOperation(value = "当前时间 *")
    @GetMapping("/getTime")
    public Object getTime() {
        return System.currentTimeMillis();
    }
 
    @ApiOperation(value = "testCallExe *")
    @GetMapping("/testCallExe")
    public R<Object> testCallExe() {
        try {
            DataPo data = new DataPo();
            data.setInPath("20241010095328");
 
            String str = uwService.callExe(data);
 
            return success(str);
        } catch (Exception ex) {
            return fail(ex, null);
        }
    }
 
    @ApiOperation(value = "testResuslt *")
    @GetMapping("/testResuslt")
    public R<Object> testResuslt() {
        try {
            DataPo data = new DataPo();
            data.setEpsg(4548);
            data.setInPath("20241010095328");
            data.setStartTime(StringHelper.YMDHMS_FORMAT.parse("2024-09-30 00:00:00"));
 
            resultService.process(data);
 
            return success("ok");
        } catch (Exception ex) {
            return fail(ex, null);
        }
    }
 
    @ApiOperation(value = "testSww2Tif *")
    @GetMapping("/testSww2Tif")
    public R<Object> testSww2Tif() {
        try {
            DataPo data = new DataPo();
            data.setEpsg(4548);
            data.setInPath("20241010095328");
            data.setStartTime(StringHelper.YMDHMS_FORMAT.parse("2024-09-30 00:00:00"));
 
            Object rs = uwService.copeDrainFiles(data);
 
            return success(rs);
        } catch (Exception ex) {
            return fail(ex, null);
        }
    }
 
    @ApiOperation(value = "testRainfall *")
    @GetMapping("/testRainfall")
    public R<Object> testRainfall() {
        try {
            DataPo data = new DataPo();
            data.setEpsg(4548);
            data.setInPath("20241010095328");
            data.setStartTime(StringHelper.YMDHMS_FORMAT.parse("2024-09-30 00:00:00"));
 
            Object rs = uwService.copeDrainFiles(data);
 
            return success(rs);
        } catch (Exception ex) {
            return fail(ex, null);
        }
    }
 
}