whycrzg
2021-02-23 351b9a53cb9ecebdf8f79db0117f540d9c42c2a4
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
package com.fgkj.services;
 
import com.fgkj.dto.*;
import com.fgkj.mapper.impl.BattInfMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.ArrayList;
import java.util.List;
 
import javax.annotation.Resource;
@Service
public class Batt_Maint_DealarmService{
 
    ServiceModel model = new ServiceModel();
 
    @Resource
    private BattInfMapper binf;
 
    @Resource
    private Batttestdata_infService tservice;
 
    //1.1电池信息统计查询
    public ServiceModel serchByConditionNew(Object obj){
        Batt_Maint_Dealarm bmd = (Batt_Maint_Dealarm) obj;
        List list=binf.serchByConditionNew(bmd);
        if(list!=null&&list.size()>0){
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setMsg("查询失败!");
        }
        return model;
    }
    
    //1.2电池组统计分析查询    
    public List serchLow(Object obj){
        Batt_Maint_Dealarm bmd = (Batt_Maint_Dealarm) obj;
        Batttestdata_inf tdata = bmd.getTdata();//设定时间
        List<BattInf> list=binf.serchByTestType(bmd);
        List<AllModel> listAll=new ArrayList<AllModel>();
        if(list!=null&&list.size()>0){
            for(int i=0;i<list.size();i++){
                BattInf binf=list.get(i);
                tdata.setBattGroupId(binf.getBattGroupId());
                tdata.setGroup_vol(binf.getMonVolStd());//标存电压
                tdata.setTest_cap(binf.getMonCapStd());//标存容量
                tdata.setTest_record_count(binf.getNum());//次数
                //该电池组的放电结果
                ServiceModel tmodel=tservice.serchByTestType(tdata);
                AllModel allmodel=new AllModel();
                allmodel.setData(list.get(i));
                allmodel.setTmodel(tmodel);
                listAll.add(allmodel);
            }
        } 
        return listAll;
    }
 
 
 
     //1.4电池组性能评估
    public List serchGroupAssess(Object obj){
        Batt_Maint_Dealarm bmd = (Batt_Maint_Dealarm) obj;
        Batttestdata_inf tdata = bmd.getTdata();//设定时间
        List<BattInf> list=binf.serchGroupAssess(bmd);
        List<AllModel> listAll=new ArrayList<AllModel>();
        if(list!=null&&list.size()>0){
            for(int i=0;i<list.size();i++){
                BattInf binf=list.get(i);
                tdata.setBattGroupId(binf.getBattGroupId());
                tdata.setGroup_vol(binf.getMonVolStd());//标存电压
                tdata.setTest_cap(binf.getMonCapStd());//标存容量
                //该电池组的放电结果
                ServiceModel tmodel=tservice.serchDischargeTest(tdata);
                
                AllModel allmodel=new AllModel();
                allmodel.setData(list.get(i));
                allmodel.setTmodel(tmodel);
                listAll.add(allmodel);
            }
        } 
        /*for(AllModel a:listAll){
            System.out.println(a.getTmodel().getData());
        }*/
        //System.out.println(listAll.size());
        return listAll;
    }
 
    /*public static void main(String[] args) throws ParseException {
        BattInf bi = new BattInf();
        bi.setStationName("内蒙古");
        bi.setStationName1("内蒙古");
        bi.setBattGroupId(0);
        //bi.setBattGroupName("");
        bi.setBattGroupName1("");
        bi.setBattProducer("");
        bi.setMonCapStd(0f);
        bi.setMonVolStd(0f);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date date1 = sdf.parse("2000-01-01");
        Date date2 = sdf.parse("2020-01-01");
        bi.setBattProductDate(ActionUtil.getSimpDate(date1));
        bi.setBattProductDate1(ActionUtil.getSimpDate(date2));
        bi.setBattInUseDate(ActionUtil.getSimpDate(date1));
        bi.setBattInUseDate1(ActionUtil.getSimpDate(date2));
 
        Batt_maint_inf mainf = new Batt_maint_inf();
        mainf.setRemark("100");
        mainf.setMaint_done_time(ActionUtil.getSimpDate(date1));
        mainf.setMaint_done_time1(ActionUtil.getSimpDate(date2));
 
        Batttestdata_inf tdata = new Batttestdata_inf();
        tdata.setTest_type(3);
        tdata.setTest_starttype(3);
        tdata.setRecord_time(ActionUtil.getSimpDate(date1));
        tdata.setRecord_time1(ActionUtil.getSimpDate(date2));
        Page p=new Page();
        p.setPageCurr(1);
        p.setPageSize(10);
        User_inf uinf=new User_inf();
        uinf.setuName("0");
        uinf.setuId(1002);
        Batt_Maint_Dealarm bmd = new Batt_Maint_Dealarm();
        bmd.setBinf(bi);
        bmd.setMainf(mainf);
        bmd.setTdata(tdata);
        bmd.setPage(p);
        bmd.setUinf(uinf);
        
        Batt_Maint_DealarmService bs =new Batt_Maint_DealarmService();
        bs.serchByConditionNew(bmd);
        //bs.serchLow(bmd);
        //bs.serchByCondition(bmd);
        
    }*/
}