whyclxw
1 天以前 a6c0ad601911684f1641c41c6abe4afe770bebb8
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
package com.whyc.controller;
 
import com.whyc.dto.Response;
import com.whyc.dto.SocreHehaviorDto;
import com.whyc.dto.Statistic.BattCompareStic;
import com.whyc.pojo.db_param.AppParam;
import com.whyc.pojo.db_user.User;
import com.whyc.service.AppParamService;
import com.whyc.service.BattresdataInfService;
import com.whyc.service.BatttestdataInfService;
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.*;
 
import java.text.ParseException;
import java.util.List;
import java.util.Map;
 
@RestController
@Api(tags = "蓄电池对比分析管理")
@RequestMapping("compare")
public class BattCompareController {
 
    @Autowired
    private BatttestdataInfService battTinfService;
 
    @Autowired
    private BattresdataInfService battRinfService;
 
    @Autowired
    private AppParamService appParamService;
 
    @ApiOperation(value = "蓄电池组对比分析界面(同一时间同一品牌/同一时间不同一品牌/不同一时间同一品牌)(1.2.15/16/17)")
    @PostMapping("getBattCompare15Statistic")
    public Response getBattCompare15Statistic(@RequestBody BattCompareStic stic) throws ParseException {
        User uinf= ActionUtil.getUser();
        stic.setUid(uinf.getId());
        if(stic.getInuseYear()!=null){
            int year=ActionUtil.getNowYear();
            stic.setInuseStartTime(ActionUtil.sdfwithday.parse(ActionUtil.getDayTime(year+1-stic.getInuseYear(),0,1,5)));
            stic.setInuseEndTime(ActionUtil.sdfwithday.parse(ActionUtil.getDayTime(year,11,31,5)));
        }
        return battTinfService.getBattCompare15Statistic(stic);
    }
 
    @ApiOperation(value = "点击右侧折线图画出电池组所有完整周期的实际容量变化图(1.2.15/16/17)")
    @GetMapping("getRealCapChangeByBattgroupId")
    public Response getRealCapChangeByBattgroupId(@RequestParam Integer battgroupId){
        return battTinfService.getRealCapChangeByBattgroupId(battgroupId);
    }
 
    @ApiOperation(value = "点击右侧折线图画出电池组所有完整周期的浮充电压变化图(1.2.15/16/17)")
    @GetMapping("getFloatGroupVolChangeByBattgroupId")
    public Response getFloatGroupVolChangeByBattgroupId(@RequestParam Integer battgroupId){
        return battTinfService.getFloatGroupVolChangeByBattgroupId(battgroupId);
    }
 
    @ApiOperation(value = "点击右侧折线图画出电池组单体的所有内阻测试单体内阻变化图(1.2.15/16/17)")
    @GetMapping("getMonResChangeByBattgroupId")
    public Response getMonResChangeByBattgroupId(@RequestParam Integer battgroupId,@RequestParam Integer monNum){
        return battRinfService.getMonResChangeByBattgroupId(battgroupId,monNum);
    }
 
    @ApiOperation(value = "弹窗根据设置的权重表格评分")
    @PostMapping("getScoreByHehavior")
    public Response getScoreByHehavior(@RequestBody SocreHehaviorDto dto) throws ParseException {
        User uinf= ActionUtil.getUser();
        dto.setUid(uinf.getId());
        if(dto.getInuseYear()!=null){
            int year=ActionUtil.getNowYear();
            dto.setInuseStartTime(ActionUtil.sdfwithday.parse(ActionUtil.getDayTime(year+1-dto.getInuseYear(),0,1,5)));
            dto.setInuseEndTime(ActionUtil.sdfwithday.parse(ActionUtil.getDayTime(year,11,31,5)));
        }
        if (dto.getProduct()!=null) {
            if(dto.getInuseYear()!=null){
                dto.setSelectType(1);
            }else{
                dto.setSelectType(2);
            }
        }else{
            if(dto.getInuseYear()!=null){
                dto.setSelectType(3);
            }else{
                dto.setSelectType(4);
            }
        }
        return battTinfService.getScoreByHehavior(dto);
    }
 
    @ApiOperation(value = "设置权重(1.2.16)")
    @PostMapping("setHehavior")
    public Response setHehavior(@RequestBody List<AppParam> List){
        return appParamService.setHehavior(List);
    }
 
    @ApiOperation(value = "读取权重(1.2.16)")
    @GetMapping("getHehavior")
    public Response getHehavior(){
        return appParamService.getHehavior();
    }
}