jiazx0107
2026-02-08 c7e9e47f7b75dd0a88c929d7fb0713e5f638fdf1
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.fzzy.igds.io.notify;
 
import com.fzzy.igds.constant.OrderRespEnum;
import com.fzzy.igds.data.QuantityProgressData;
import com.fzzy.igds.websocket.WebSocketPacket;
import com.fzzy.igds.websocket.WebSocketServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
 
/**
 * @Description
 * @Author CZT
 * @Date 2026/01/08 16:36
 */
@Slf4j
@Component
public class NotifyWebInvokerImpl implements NotifyWebInvoker {
 
    @Override
    public void notifyWeb(String companyId, OrderRespEnum orderResp,
                          String bizType, String notifyMsg) {
        // 通知前端
        WebSocketPacket packet = new WebSocketPacket();
        packet.setBizType(bizType);
        packet.setCompanyId(companyId);
        packet.setOrderResp(orderResp.getCode());
        packet.setData(notifyMsg);
        WebSocketServer.sendByPocket(packet);
    }
 
    @Override
    public void notifyQuantityProgress(QuantityProgressData progress) {
        // 通知前端进度信息
        WebSocketPacket packet = new WebSocketPacket();
        packet.setBizType("quantity");
        packet.setCompanyId(progress.getCompanyId());
        packet.setOrderResp(OrderRespEnum.ORDER_INPROGRESS.getCode());
        packet.setData(progress);
        packet.setDeptId(progress.getDeptId());
        WebSocketServer.sendByPocket(packet);
    }
 
}