jiazx0107@163.com
2023-05-17 620eab6cca2bc9ef9ea6d3067a0a5ba1deadbd1c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package com.ld.igds.gas;
 
import java.util.ArrayList;
import java.util.List;
 
import org.apache.commons.lang3.StringUtils;
 
import com.ld.igds.gas.dto.GasData;
import com.ld.igds.gas.dto.GasPoint;
import com.ld.igds.models.DicSysConf;
 
/**
 * 
 * @author: andy.jia
 * @description:
 * @version:
 * @data:2019年12月26日
 *
 */
public class GasDataBuilder {
 
    public static void updatePestData(GasData data, DicSysConf conf) {
        if (StringUtils.isEmpty(data.getPoints()))
            return;
 
        String[] attr = data.getPoints().split(";");// passCode,co2,o2,ph3,n2;passCode,co2,o2,ph3,n2;"
 
        List<GasPoint> list = new ArrayList<GasPoint>();
        GasPoint point;
        for (String string : attr) {
            point = new GasPoint();
            point.setPassCode(Integer.valueOf(string.split(",")[0]));
            point.setPerCo2(Double.valueOf(string.split(",")[1]));
            point.setPerO2(Double.valueOf(string.split(",")[2]));
            point.setPerPh3(Double.valueOf(string.split(",")[3]));
            point.setPerN2(Double.valueOf(string.split(",")[4]));
            point.setReceiveDate(data.getReceiveDate());
 
            list.add(point);
        }
        data.setListPoint(list);
    }
}