| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.text.DecimalFormat; |
| | | import java.text.NumberFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | |
| | | log.info("气体检测开始解析"); |
| | | Res209 res209 = JSONObject.parseObject(reMessage.getContentStr(),Res209.class); |
| | | if(2==res209.getState()){ |
| | | |
| | | }else{ |
| | | log.info("气体没有采集完成,取消解析!"); |
| | | return; |
| | | } |
| | | DepotConf depotConf = commonService.getCacheDepotConfBySerId(ser.getCompanyId(),ser.getId() ); |
| | | //主体信息 |
| | | Gas gas = new Gas(); |
| | |
| | | info.setId(ContextUtil.buildInfoId(gas.getCompanyId(), gas.getDepotId(), gas.getBatchId())); |
| | | info.setPassCode(i+1); |
| | | info.setPerCo2(cO2ValArray[i].doubleValue()); |
| | | info.setPerO2(99 - (n2ValArray[i].doubleValue() /10 )); |
| | | NumberFormat numberFormat = new DecimalFormat("0.00"); |
| | | info.setPerO2(Double.parseDouble(numberFormat.format(99 - (n2ValArray[i].doubleValue() /10 )))); |
| | | info.setPerPh3(pH3ValArray[i].doubleValue()); |
| | | info.setPerN2(n2ValArray[i].doubleValue() / 10); |
| | | items.add(info); |