whycrzg
2021-02-20 aa885eba07f4b84390922b4b146d1806676293c0
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
package com.fgkj.controller;
 
import com.fgkj.dto.*;
import com.fgkj.services.Batt_maint_infService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import java.util.List;
 
@RequestMapping("battMaintInf")
@RestController
@Api(tags = "battMaintInf接口")
public class Batt_maint_infController{
 
    @Resource
    private Batt_maint_infService service;
 
    /*private Batt_maint_inf bmi;
    private Batt_Maint_Dealarm bd;
    private Batt_User_Permit bup;*/
    //private BattInf binf;
 
    
    //2.1电池故障维护记录查询
    @GetMapping("maint")
    @ApiOperation(notes = "",value="电池故障维护记录查询")
    public ServiceModel serchMaint(@RequestBody Batt_Maint_Dealarm bd){
        //System.out.println(bd);
        // bd = ActionUtil.getGson("yyyy-MM-dd").fromJson(result, Batt_Maint_Dealarm.class);
        ServiceModel model=service.serchMaint(bd);
        return model;
    }
    
    // 2.2电池故障处理统计查询
    /*
     * maint_result存放统计方式 
     * fault_caption存放维护区 
     * master_check存放包机人 
     * remark存放品牌
     */
    @GetMapping("byCondition")
    @ApiOperation(notes = "",value="电池故障处理统计查询")
    public List serchByCondition(@RequestBody Batt_User_Permit bup){
        // bup= ActionUtil.getGson("yyyy-MM-dd").fromJson(result, Batt_User_Permit.class);
        List list=service.serchByCondition(bup);        
        return list;
    }
    
    //0.3查询所有的维护记录(只传page对象)
    @GetMapping("/")
    @ApiOperation(notes = "",value="查询所有的维护记录(只传page对象)")
    public ServiceModel search(){
        ServiceModel model=service.search();
        return model;
    }
    
    //0.4电池组故障率
    @GetMapping("all")
    @ApiOperation(notes = "",value="电池组故障率")
    public ServiceModel searchAll(){
        ServiceModel model=service.searchAll();
        return model;
    }
    
    //0.4/0.8电池组故障率/维护率(最新)
    @GetMapping("byStationName")
    @ApiOperation(notes = "",value="电池组故障率/维护率(最新)")
    public ServiceModel searchByStationName(@RequestBody Batt_Maint_Dealarm bd) {
        ServiceModel model=service.searchByStationName(bd);    
        
        return model;
    }
    
    //根据电池组id查询电池的故障信息
    @GetMapping("byBattGroupId")
    @ApiOperation(notes = "",value="电池组id查询电池的故障信息")
    public ServiceModel searchByBattgroupId(@RequestBody Batt_maint_inf bmi){
        // bmi=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result, Batt_maint_inf.class);
        ServiceModel model=service.searchByBattgroupId(bmi);
        return model;
    }
    
    //2.1 电池维护记录查询(编辑记录)
    @PutMapping("/")
    @ApiOperation(notes = "",value="电池维护记录查询(编辑记录)")
    public ServiceModel update(@RequestBody Batt_maint_inf bmi,@RequestBody List<Batt_maint_process> process) {
        // bmi=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result, Batt_maint_inf.class);
        // List<Batt_maint_process> process = ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, new TypeToken<List<Batt_maint_process>>(){}.getType());
        ServiceModel model=service.update(bmi,process);
        return model;
    }
    //2.1 电池维护记录查询(删除记录)
    @DeleteMapping("/")
    @ApiOperation(notes = "",value="电池维护记录查询(删除记录)")
    public ServiceModel delete(@RequestBody Batt_maint_inf bmi) {
        // bmi=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result, Batt_maint_inf.class);
        ServiceModel model=service.delete(bmi);
        return model;
    }
 
 
    /*public static void main(String[] args) throws ParseException {
        Batt_maint_infService us = new Batt_maint_infService();
        
        BattInf binf = new BattInf();
        
         binf.setStationName("");
         binf.setStationName1("");
         binf.setBattGroupName("");
         binf.setBattGroupName1(""); 
         binf.setBattProducer("");
         binf.setMonCapStd(100f); binf.setMonVolStd(12f);
         binf.setBattGroupId(0);
        binf.setStationName("");
        binf.setStationName1("");
        //binf.setBattGroupName("");
        binf.setBattGroupId(0);
        binf.setBattGroupName1("");
        binf.setBattProducer("");
        binf.setMonCapStd(0f);
        binf.setMonVolStd(0f);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date date1 = sdf.parse("2000-01-01");
        Date date2 = sdf.parse("2016-07-14");
        binf.setBattProductDate(ActionUtil.getSimpDate(date1));
        binf.setBattProductDate1(ActionUtil.getSimpDate(date2));
        binf.setBattInUseDate(ActionUtil.getSimpDate(date1));
        binf.setBattInUseDate1(ActionUtil.getSimpDate(date2));
 
        *//*
          binf.getStationName1(), binf.getStationName(),
          binf.getBattGroupName(), binf.getBattProducer(),
          binf.getBattGroupName1(), binf.getBattProductDate(),
          binf.getBattProductDate1(), binf.getBattInUseDate(),
          binf.getBattInUseDate1(),uinf.getuName()
         *//*
 
        Batt_maintenance_inf minf = new Batt_maintenance_inf();
        minf.setRemark("100");
        minf.setMaintenance_time(ActionUtil.getSimpDate(date1));
        minf.setMaintenance_time1(ActionUtil.getSimpDate(date2));
 
        Batttestdata_inf tdata = new Batttestdata_inf();
        tdata.setTest_type(0);
        tdata.setRecord_time(ActionUtil.getSimpDate(date1));
        tdata.setRecord_time1(ActionUtil.getSimpDate(date2));
        
        User_inf uinf=new User_inf();
        uinf.setuName("0");
        
        Page p=new Page();
        p.setPageCurr(1);
        p.setPageSize(1);
        
        Batt_Maint_Dealarm bmd = new Batt_Maint_Dealarm();
        bmd.setBinf(binf);
        bmd.setMinf(minf);
        bmd.setTdata(tdata);
        bmd.setPage(p);
        bmd.setUinf(uinf);
        //List list=us.serchMaint(bmd);
        List list=us.serchByCondition(bmd);
        //System.out.println(list);
    }*/
    
}