perryhsu
2020-09-30 3ab47f8fdd1da2c97917c38b2510855d7c3963c4
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
package com.fgkj.controller;
 
import java.text.ParseException;
 
import com.fgkj.dto.BattInf;
import com.fgkj.dto.Batt_Maint_Dealarm;
import com.fgkj.dto.Batttestdata_inf;
import com.fgkj.dto.ServiceModel;
import com.fgkj.services.Batttestdata_infService;
import com.opensymphony.xwork2.ActionSupport;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
@RequestMapping("battTestDataInf")
@RestController
@Api
public class Batttestdata_infController{
    
    private ServiceModel model;
 
    @Autowired
    private Batttestdata_infService service;
 
    // private Batttestdata_inf bti;
    // private Batt_Maint_Dealarm bmd;
    
    @GetMapping("byInfo")
    public ServiceModel findByInfo(@RequestBody Batttestdata_inf bti){
        model=service.serchByCondition(bti);
        
        return model;
    }
    
    /**
     * 根据电池组id查询电池组的inf表中的放电信息
     */
    @GetMapping("battTestInfDataById")
    public ServiceModel searchBattTestInfDataById(@RequestBody Batttestdata_inf bti){
        // Batttestdata_inf bti = ActionUtil.getGson().fromJson(json, Batttestdata_inf.class);
        model=service.serchByCondition(bti);
        
        return model;
    }
    
    //0.7电测放电测试比例
    @GetMapping("testScale")
    public ServiceModel searchTestsCale(@RequestBody Batt_Maint_Dealarm bmd){
        try {
            model=service.serchByInfo(bmd);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        
        return model;
    }
    
    //0.10电池健康率
    @GetMapping("healthRate")
    public ServiceModel searchGood(){
        model=service.serchGood();
        
        return model;
    }
    
    //6.4.2根据条件查询符合条件的测试完成的电池组(蓄电池放电测试完成率)
    @GetMapping("completeRate")
    public ServiceModel serchComplete(@RequestBody Batttestdata_inf b){
        // Batttestdata_inf b=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result, Batttestdata_inf.class);
        ServiceModel model=service.serchComplete(b);
        
        return model;
    }
    
    //6.4.4根据条件查询符合条件的测试完成的电池组(蓄电池容量预警)
    @GetMapping("capWarning")
    public ServiceModel serchCap(@RequestBody Batttestdata_inf b){
        // Batttestdata_inf b=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result, Batttestdata_inf.class);
        ServiceModel model=service.serchCap(b);
        
        return model;
    }
    
    //电池组历史放电数据续航能力查询
    @GetMapping("battLife")
    public ServiceModel serchBattLife(@RequestBody BattInf binf){
        // BattInf binf = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result, BattInf.class);
        ServiceModel model = new ServiceModel();
        if(binf.getBattGroupId() == 0){
            model = service.serchBattLifeNow(binf);
        }else if(binf.getBattGroupId() == 1){
            model = service.serchBattLife(binf);
        }
        return model;
    }
    /* 根据电池组id查询电池组的inf表中的放电信息    <!------    跨域访问     --------->
     */
    @GetMapping("battTestInfDataById_ky")
    public ServiceModel searchBattTestInfDataById_ky(@RequestBody Batttestdata_inf bti){
        // Batttestdata_inf bti = ActionUtil.getGson().fromJson(json, Batttestdata_inf.class);
        model=service.serchByCondition_ky(bti);            
        
        return model;
    }
    
}