| | |
| | | package com.fgkj.services; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.fgkj.dto.Battresdata; |
| | | import com.fgkj.dto.ServiceModel; |
| | | import com.fgkj.mapper.impl.BattresdataMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | @Service |
| | | public class BattresdataService { |
| | | |
| | | private ServiceModel model; |
| | | ServiceModel model = new ServiceModel(); |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private BattresdataMapper mapper;; |
| | | |
| | | public ServiceModel add(Object obj) { |
| | |
| | | List<Battresdata> listNum=mapper.serchNum(bstop); |
| | | |
| | | if(listNum!=null && listNum.size()>0){ |
| | | model.setNewsum(listNum.get(listNum.size()-1).getMon_num());//最低电压编号 |
| | | model.setLowCH(listNum.get(listNum.size()-1).getMon_vol());//最低单体电压 |
| | | //TODO perry |
| | | // model.setNewsum(listNum.get(listNum.size()-1).getMon_num());//最低电压编号 |
| | | // model.setLowCH(listNum.get(listNum.size()-1).getMon_vol());//最低单体电压 |
| | | } |
| | | if(list!=null && list.size()>0){ |
| | | Float mon_avg=(float)Math.round(list.get(list.size()-1).getMon_avg()*1000)/1000; |
| | | model.setLowRH(mon_avg);//平均截至电压 |
| | | //TODO perry |
| | | // model.setLowRH(mon_avg);//平均截至电压 |
| | | }else{ |
| | | model.setLowRH(0f); |
| | | //TODO perry |
| | | // model.setLowRH(0f); |
| | | } |
| | | return model; |
| | | } |