2021与蓝度共同重构项目,服务端
zhanzhiqin
2022-05-13 bfc029692b701df071580ae22f69fcfde3d7d2cc
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
package com.sandu.ximon.admin.utils;
 
import com.sandu.common.util.SpringContextHolder;
import com.sandu.ximon.admin.manager.iot.frame.A5Frame;
import com.sandu.ximon.admin.manager.iot.rrpc.dto.CommonFrame;
import com.sandu.ximon.admin.service.InnerFrameDataService;
 
/**
 * @author ZZQ
 * @date 2022/5/13 15:06
 */
public class StoreOperationRecordsUtils {
    public static void storeInnerFrameData(String mac, String innerFrameTpye, A5Frame a5Frame, CommonFrame commonFrame) {
        String reportInnerFrame = "";
        if (commonFrame != null) {
            reportInnerFrame = commonFrame.getConnectType() + commonFrame.getFunctionCode() + commonFrame.getOrderType() + commonFrame.getPayloadLength() + commonFrame.getPayload();
        }
        String requstInnerFrame = a5Frame.getConnectType() + a5Frame.getFunctionCode() + a5Frame.getOrderType() + a5Frame.getPayloadLength() + a5Frame.getPayload();
        String syncType;
        if ("FE".equals(a5Frame.getConnectType())) {
            syncType = "同步";
        } else {
            syncType = "异步";
        }
        SpringContextHolder.getBean(InnerFrameDataService.class).storeInnerFrameData(mac, innerFrameTpye, syncType, requstInnerFrame, reportInnerFrame);
 
    }
 
    public static void storeOperationData(String mac, String innerFrameTpye, String syncType, String requsetInnerFrame, String reportInnerFrame) {
        //TODO
 
    }
}