jiazx0107@163.com
2023-08-11 be175fe739e687cd1d45da58f2cb7dd0c36d001f
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.io.impl;
 
import com.ld.igds.constant.BizType;
import com.ld.igds.gas.dto.GasProgressData;
import com.ld.igds.io.constant.OrderRespEnum;
import com.ld.igds.pest.dto.PestProgressData;
import com.ld.igds.websocket.WebSocketPacket;
import com.ld.igds.websocket.WebSocketServer;
 
public class NotifyWebParent {
 
    public void notifyWeb(String companyId, OrderRespEnum orderResp,
            BizType bizType, String notifyMsg) {
        // 通知前端
        WebSocketPacket packet = new WebSocketPacket();
        packet.setBizType(bizType.getCode());
        packet.setCompanyId(companyId);
        packet.setOrderResp(orderResp.getCode());
        packet.setData(notifyMsg);
        WebSocketServer.sendByPocket(packet);
    }
 
    public void notifyGasProgress(GasProgressData progress) {
        // 通知前端进度信息
        WebSocketPacket packet = new WebSocketPacket();
        packet.setBizType(BizType.GAS.getCode());
        packet.setCompanyId(progress.getCompanyId());
        packet.setOrderResp(OrderRespEnum.ORDER_INPROGRESS.getCode());
        packet.setData(progress);
        WebSocketServer.sendByPocket(packet);
    }
 
    public void notifyPestProgress(PestProgressData progress) {
        // 通知前端进度信息
        WebSocketPacket packet = new WebSocketPacket();
        packet.setBizType(BizType.PEST.getCode());
        packet.setCompanyId(progress.getCompanyId());
        packet.setOrderResp(OrderRespEnum.ORDER_INPROGRESS.getCode());
        packet.setData(progress);
        WebSocketServer.sendByPocket(packet);
    }
 
}