whyclxw
2024-11-01 2bb5386f806cd9418b18da9ad0c4137d0212695b
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
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.service.BattgroupBaojigroupService;
import com.whyc.service.BatttestdataInfService;
import com.whyc.service.ExcelExportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
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 javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
 
@RestController
@Api(tags = "测试管理")
@RequestMapping("tinf")
public class BatttestdataInfController {
    @Autowired
    private BatttestdataInfService service;
 
    @Autowired
    private ExcelExportService exportService;
 
    @ApiOperation(value = "测试统计本年/本月")
    @GetMapping("getDevTinfByYearMonth")
    public Map<String, Object> getDevTinfByYearMonth(@RequestParam Integer uid){
        return service.getDevTinfByYearMonth(uid);
    }
 
    @ApiOperation(value = "测试统计本周")
    @GetMapping("getDevTinfByWeek")
    public Map<String, Object> getDevTinfByWeek(@RequestParam Integer uid){
        return service.getDevTinfByWeek(uid);
    }
 
    @ApiOperation(value = "获取设备的充放电记录")
    @GetMapping("getTinfById")
    public Response getTinfById(@RequestParam Integer devId){
        return service.getTinfById(devId);
    }
 
    @ApiOperation(value = "获取设备某次记录详细的单体放电过程")
    @GetMapping("getTdataById")
    public Response getTdataById(@RequestParam Integer devId,@RequestParam Integer testRecordCount){
        return service.getTdataById(devId,testRecordCount);
    }
 
    @ApiOperation(value = "导出某次记录详细的单体放电记录")
    @GetMapping("exportData")
    public void exportData(@RequestParam Integer devId, @RequestParam Integer testRecordCount
            , HttpServletResponse resp){
        if(devId/100000000==1){
            exportService.exportExcelA200(devId,testRecordCount,resp);
        }else{
            exportService.exportExcelActm(devId,testRecordCount,resp);
        }
 
    }
}