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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package com.ld.igds.protocol.fzzy.analysis;
 
 
import com.alibaba.fastjson.JSONObject;
import com.ld.igds.models.DeviceSer;
import com.ld.igds.pressure.dto.PressureData;
import com.ld.igds.pressure.service.CorePressureService;
import com.ld.igds.protocol.fzzy.dto.ReMessage;
import com.ld.igds.protocol.fzzy.resp.Response3304;
import com.ld.igds.util.ContextUtil;
 
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
/**
 * 氮气解析
 *
 * @author andy
 */
@Component(AnalysisN2.BEAN_ID)
@Slf4j
public class AnalysisN2 {
 
    public static final String BEAN_ID = "fzzy.analysisN2";
 
 
    @Autowired
    private CorePressureService pressureService;
 
 
    public void analysis3301(ReMessage message, DeviceSer ser) {
    }
 
    public void analysis3302(ReMessage message, DeviceSer ser) {
    }
 
    public void analysis3303(ReMessage message, DeviceSer ser) {
    }
 
    /**
     * 气压返回
     *
     * @param reMessage
     * @param ser
     */
    public void analysis3304(ReMessage reMessage, DeviceSer ser) {
 
        Response3304 response = JSONObject.parseObject(reMessage.getContent(), Response3304.class);
 
        PressureData pressureData = new PressureData();
        pressureData.setBatchId(ContextUtil.getDefaultBatchId());
        pressureData.setDepotId(response.getHouseId());
        pressureData.setCheckUser(null);
        pressureData.setCompanyId(ser.getCompanyId());
        pressureData.setPointNum(1);
        pressureData.setPoints(null);
        pressureData.setPressure(response.getPAvg());
        pressureData.setPressureMax(response.getPMax());
        pressureData.setPressureMin(response.getPMin());
 
        pressureService.savePressure(pressureData);
 
        log.info("控制柜----->>>平台:气压解析完成-控制柜={}", ser.getName());
    }
}