whycxzp
2024-04-25 38d2dda917c189b7ba87d70196b99a34d50503b4
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
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.service.PwrdevHistorydataGwService;
import com.whyc.util.ActionUtil;
import com.whyc.util.ThreadLocalUtil;
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;
        /*testTime1 = ActionUtil.sdf.parse(recordTime1);
        testTime2 = ActionUtil.sdf.parse(recordTime2);*/
        testTime1 = ThreadLocalUtil.parse(recordTime1,1);
        testTime2 = ThreadLocalUtil.parse(recordTime2,1);
        return service.serchByCondition(testTime1, testTime2, devId);
    }
}