lxw
2023-09-04 cbc09e1b6ce4c6674d75a96982848af6572f32b9
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
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.service.PwrdevHistorydataGwService;
import com.whyc.util.ActionUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.text.ParseException;
import java.util.Date;
 
@Api(tags = "在线监测-实时监控")
@RestController
@RequestMapping("pwrdevHistorydataGw")
public class PwrdevHistorydataGwController {
    @Autowired
    private PwrdevHistorydataGwService service;
 
    @ApiOperation(value = "查询电源历史实时数据-优化-多线程", notes = "参数:recordTime1,recordTime2,battGroupId,monNum(单体编号),note(电池组单体总数)")
    @GetMapping("serchByCondition")
    public Response serchByCondition(@RequestParam String recordTime1, @RequestParam String recordTime2, @RequestParam int devId) throws ParseException, InterruptedException {
        Date testTime1 = null;
        Date testTime2 = null;
        try {
            testTime1 = ActionUtil.sdf.parse(recordTime1);
            testTime2 = ActionUtil.sdf.parse(recordTime2);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return service.serchByCondition(testTime1, testTime2, devId);
    }
}