whycrzg
2021-02-23 351b9a53cb9ecebdf8f79db0117f540d9c42c2a4
src/main/java/com/fgkj/services/BattresdataService.java
@@ -1,19 +1,20 @@
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) {
@@ -98,14 +99,17 @@
      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;
   }