| | |
| | | import com.ld.igds.temp.dto.TempParam; |
| | | import com.ld.igds.util.BytesUtil; |
| | | import com.ld.igds.util.ContextUtil; |
| | | import com.ld.igds.util.NumberUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | Integer[] n2ValArray = res209.getN2ValArray(); |
| | | Integer[] pH3ValArray = res209.getPH3ValArray(); |
| | | Integer[] cO2ValArray = res209.getCO2ValArray(); |
| | | double sumO2 = 0.0, sumCo2 = 0.0, sumPh3 = 0.0, sumN2 = 0.0; |
| | | for (int i=0;i<res209.getCO2ValArray().length;i++){ |
| | | info = new GasInfo(); |
| | | info.setId(ContextUtil.buildInfoId(gas.getCompanyId(), gas.getDepotId(), gas.getBatchId())); |
| | |
| | | if (info.getPerN2() < gas.getPerN2Min()) { |
| | | gas.setPerN2Min(info.getPerN2()); |
| | | } |
| | | |
| | | sumO2 += info.getPerO2(); |
| | | sumCo2 += info.getPerCo2(); |
| | | sumPh3 += info.getPerPh3(); |
| | | sumN2 += info.getPerN2(); |
| | | //固定为:passCode,co2,o2,ph3,n2;passCode,co2,o2,ph3,n2;" |
| | | sb.append(info.getPassCode()); |
| | | sb.append(","); |
| | |
| | | sb.append(info.getPerN2()); |
| | | sb.append(";"); |
| | | } |
| | | |
| | | if(res209.getCO2ValArray().length>1){ |
| | | gas.setPerCo2(NumberUtil.keepPrecision(sumCo2/res209.getCO2ValArray().length, 2)); |
| | | gas.setPerO2(NumberUtil.keepPrecision(sumO2/res209.getCO2ValArray().length, 2)); |
| | | gas.setPerN2(NumberUtil.keepPrecision(sumN2/res209.getCO2ValArray().length, 2)); |
| | | gas.setPerPh3(NumberUtil.keepPrecision(sumPh3/res209.getCO2ValArray().length, 2)); |
| | | } |
| | | gas.setPoints(sb.toString()); |
| | | gasService.saveInfoGas(items); |
| | | |