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);
|
|
}*/
|
}
|