1.前端推数据使用了最新的webSokect客户现场总是掉线,修改为接口方式
2.设备交互整体增加异常处理以及PLC连接方式改为短连接
37个文件已修改
2个文件已删除
1765 ■■■■■ 已修改文件
JiuMuMesParent/common/servicebase/src/main/java/com/mes/tools/S7control.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/common/servicebase/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/common/servicebase/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/gateway/target/gateway-1.0-SNAPSHOT.jar.original 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/AppRunnerConfig.java 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectFlipSlice.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectMachine.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectMarking.java 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/MachineTask.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCCleaning.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/PrimitiveTaskController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineDispensing.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineEdging.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineFlipSlice.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineLamination.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineLoad.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineMarking.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineRotate.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineSilkScreen.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineThread.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/resources/application-prod.yml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/target/classes/application-prod.yml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/target/deviceInteraction-1.0-SNAPSHOT.jar.original 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/config.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/package-lock.json 92 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/package.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/utils/constants.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Cleaning/cleaning.vue 134 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Edging/edging.vue 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/FlipSlice/flipSlice.vue 105 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/GlueDispenser/glueDispenser.vue 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Lamination/lamination.vue 114 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/ManualReporting/manualReporting.vue 140 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Marking/marking.vue 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/MechanicalArm/mechanicalArm.vue 169 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Rotate/rotate.vue 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/SilkScreen/SilkScreen.vue 100 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JiuMuMesParent/common/servicebase/src/main/java/com/mes/tools/S7control.java
@@ -293,7 +293,6 @@
        if (s7PLC == null) {
            return null;
        }
        // List<String> addresslist = GetAddressList(address, count, 16);
        byte[] bytes = null;
        try {
            bytes = s7PLC.readByte(address, count);
JiuMuMesParent/common/servicebase/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
@@ -4,15 +4,16 @@
com\mes\device\PlcBitInfo.class
com\mes\device\PlcBitObject.class
com\mes\utils\MD5.class
com\mes\tools\WebSocketServer.class
com\mes\common\config\Const.class
com\mes\service\PlcAgreement.class
com\mes\tools\DatabaseDesignDocUtil.class
com\mes\websocket\WebSocketServer.class
com\mes\utils\Result.class
com\mes\common\config\MybatisPlusConfig.class
com\mes\common\exception\ServiceException.class
com\mes\service\ModbusTcp.class
com\mes\utils\ResponseUtil.class
com\mes\websocket\WebSocketUtils.class
com\mes\common\handler\MyMetaObjectHandler.class
com\mes\device\PlcParameterObject.class
com\mes\entity\request\GeneralRequest.class
JiuMuMesParent/common/servicebase/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -1,4 +1,3 @@
D:\workfile\JiuMuMES\JiuMuMesParent\common\servicebase\src\main\java\com\mes\tools\WebSocketServer.java
D:\workfile\JiuMuMES\JiuMuMesParent\common\servicebase\src\main\java\com\mes\service\ModbusTcp.java
D:\workfile\JiuMuMES\JiuMuMesParent\common\servicebase\src\main\java\com\mes\common\handler\MyMetaObjectHandler.java
D:\workfile\JiuMuMES\JiuMuMesParent\common\servicebase\src\main\java\com\mes\common\config\Swagger2Config.java
@@ -11,11 +10,13 @@
D:\workfile\JiuMuMES\JiuMuMesParent\common\servicebase\src\main\java\com\mes\utils\HexUtil.java
D:\workfile\JiuMuMES\JiuMuMesParent\common\servicebase\src\main\java\com\mes\tools\CodeGet.java
D:\workfile\JiuMuMES\JiuMuMesParent\common\servicebase\src\main\java\com\mes\common\config\MybatisPlusConfig.java
D:\workfile\JiuMuMES\JiuMuMesParent\common\servicebase\src\main\java\com\mes\websocket\WebSocketServer.java
D:\workfile\JiuMuMES\JiuMuMesParent\common\servicebase\src\main\java\com\mes\service\PlcAgreement.java
D:\workfile\JiuMuMES\JiuMuMesParent\common\servicebase\src\main\java\com\mes\tools\HexConversion.java
D:\workfile\JiuMuMES\JiuMuMesParent\common\servicebase\src\main\java\com\mes\common\config\Const.java
D:\workfile\JiuMuMES\JiuMuMesParent\common\servicebase\src\main\java\com\mes\entity\request\GeneralRequest.java
D:\workfile\JiuMuMES\JiuMuMesParent\common\servicebase\src\main\java\com\mes\device\PlcBitInfo.java
D:\workfile\JiuMuMES\JiuMuMesParent\common\servicebase\src\main\java\com\mes\websocket\WebSocketUtils.java
D:\workfile\JiuMuMES\JiuMuMesParent\common\servicebase\src\main\java\com\mes\utils\ResponseUtil.java
D:\workfile\JiuMuMES\JiuMuMesParent\common\servicebase\src\main\java\com\mes\utils\ResultCodeEnum.java
D:\workfile\JiuMuMES\JiuMuMesParent\common\servicebase\src\main\java\com\mes\device\PlcParameterInfo.java
JiuMuMesParent/gateway/target/gateway-1.0-SNAPSHOT.jar.original
Binary files differ
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/AppRunnerConfig.java
@@ -46,29 +46,29 @@
        List<Machine> machineDispensing =machineMapper.selectList(new QueryWrapper<Machine>().lambda().eq(Machine::getName,"自动点胶机").eq(Machine::getState,"开工"));
        List<Machine> machineListRotate =machineMapper.selectList(new QueryWrapper<Machine>().lambda().eq(Machine::getName,"旋转台").eq(Machine::getState,"开工"));
        List<Machine> machineListLamination =machineMapper.selectList(new QueryWrapper<Machine>().lambda().eq(Machine::getName,"自动贴膜机").eq(Machine::getState,"开工"));
        for (Machine item:machineListLoad){
            new MachineLoad(item,primitiveTaskMapper,taskingMapper,machineMapper,taskingService,primitiveTaskService,lineConfigurationService).start();
        }
        for (Machine item:machineListEdging){
            new MachineEdging(item,taskingMapper,machineMapper,taskingService,primitiveTaskService,lineConfigurationService).start();
        }
        for (Machine item:machineListFlipSlice){
            new MachineFlipSlice(item,machineMapper,taskingService).start();
        }
        for (Machine item:machineListMarking){
            new MachineMarking(item,machineMapper,taskingService).start();
        }
        for (Machine item:machineListSilkScreen){
            new MachineSilkScreen(item,machineMapper,taskingService).start();
        }
        for (Machine item:machineDispensing){
            new MachineDispensing(item,machineMapper,taskingService).start();
        }
        for (Machine item:machineListRotate){
            new MachineRotate(item,machineMapper,taskingService).start();
        }
        for (Machine item:machineListLamination){
            new MachineLamination(item,machineMapper,taskingService).start();
        }
//        for (Machine item:machineListLoad){
//            new MachineLoad(item,primitiveTaskMapper,taskingMapper,machineMapper,taskingService,primitiveTaskService,lineConfigurationService).start();
//        }
//        for (Machine item:machineListEdging){
//            new MachineEdging(item,taskingMapper,machineMapper,taskingService,primitiveTaskService,lineConfigurationService).start();
//        }
//        for (Machine item:machineListFlipSlice){
//            new MachineFlipSlice(item,machineMapper,taskingService).start();
//        }
//        for (Machine item:machineListMarking){
//            new MachineMarking(item,machineMapper,taskingService).start();
//        }
//        for (Machine item:machineListSilkScreen){
//            new MachineSilkScreen(item,machineMapper,taskingService).start();
//        }
//        for (Machine item:machineDispensing){
//            new MachineDispensing(item,machineMapper,taskingService).start();
//        }
//        for (Machine item:machineListRotate){
//            new MachineRotate(item,machineMapper,taskingService).start();
//        }
//        for (Machine item:machineListLamination){
//            new MachineLamination(item,machineMapper,taskingService).start();
//        }
    }
}
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectFlipSlice.java
File was deleted
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectMachine.java
@@ -3,7 +3,6 @@
import com.github.xingshuangs.iot.protocol.s7.enums.EPlcType;
import com.mes.device.PlcParameterInfo;
import com.mes.device.PlcParameterObject;
import com.mes.service.ModbusTcp;
import com.mes.tools.InitUtil;
import com.mes.tools.S7control;
import lombok.extern.slf4j.Slf4j;
@@ -17,13 +16,14 @@
 * @Description:
 */
@Slf4j
public class S7objectMachine extends Thread {
public class S7objectMachine{
    public S7control plccontrol; // PLC通讯类实例
    private EPlcType plcType = EPlcType.S1200; // 西门子PLC类型
    private String ip = ""; // plc ip地址
    private int port = 102; // plc 端口号
    private String plcFileName=""; // json名称
    public PlcParameterObject PlcMesObject;
    public S7objectMachine(String ip,int port,String plcFileName,EPlcType plcType) {
        initialize(ip,port,plcFileName,plcType);
        if (plccontrol == null) {
@@ -51,14 +51,7 @@
        }
        log.info(logInfo);
    }
    @Override
    public void run() {
        while (this != null) {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
    public void readData() {
            try {
                byte[] resultValues=new byte[PlcMesObject.getPlcAddressLength()];
                int maxRead=1092;
@@ -76,9 +69,8 @@
                    PlcMesObject.setPlcParameterList(resultValues);
                }
            } catch (Exception e) {
                //log.info("异常:ip:{},port:{}",this.ip,this.port);
            }
            PlcMesObject=null;
            log.info("异常:ip:{},port:{},错误{}",this.ip,this.port,e.getMessage());
        }
    }
}
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/common/S7objectMarking.java
File was deleted
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/MachineTask.java
@@ -62,8 +62,8 @@
    private List<Machine> machineListLamination;
    //机械手
    @Scheduled(fixedDelay = 500)
    public void MarkingTasks() {
    //@Scheduled(fixedDelay = 500)
    public void loadTasks() {
        try {
            machineListLoad = machineMapper.selectList(new QueryWrapper<Machine>().lambda().eq(Machine::getName, "上片"));
            JSONObject jsonObject = new JSONObject();
@@ -92,7 +92,7 @@
    }
    //磨边机
    @Scheduled(fixedDelay = 500)
    //@Scheduled(fixedDelay = 500)
    public void edgingTasks() {
        try {
            machineListEdging = machineMapper.selectList(new QueryWrapper<Machine>().lambda().eq(Machine::getName, "磨边"));
@@ -113,7 +113,7 @@
    }
    //翻片台
    @Scheduled(fixedDelay = 500)
    //@Scheduled(fixedDelay = 500)
    public void flipSliceTasks() {
        try {
            machineListFlipSlice = machineMapper.selectList(new QueryWrapper<Machine>().lambda().eq(Machine::getName, "翻片"));
@@ -135,7 +135,7 @@
    }
    //打标机
    @Scheduled(fixedDelay = 500)
    //@Scheduled(fixedDelay = 500)
    public void markingTasks() {
        try {
            machineListMarking = machineMapper.selectList(new QueryWrapper<Machine>().lambda().eq(Machine::getName, "自动打标机"));
@@ -157,7 +157,7 @@
    }
    //丝印机
    @Scheduled(fixedDelay = 500)
    //@Scheduled(fixedDelay = 500)
    public void silkScreenTasks() {
        try {
            machineListSilkScreen = machineMapper.selectList(new QueryWrapper<Machine>().lambda().eq(Machine::getName, "自动丝印机"));
@@ -178,7 +178,7 @@
    }
    //点胶机
    @Scheduled(fixedDelay = 500)
    //@Scheduled(fixedDelay = 500)
    public void glueDispenserTasks() {
        try {
            machineListGlueDispenser = machineMapper.selectList(new QueryWrapper<Machine>().lambda().eq(Machine::getName, "自动点胶机"));
@@ -199,7 +199,7 @@
    }
    //旋转台
    @Scheduled(fixedDelay = 500)
    //@Scheduled(fixedDelay = 500)
    public void rotateTasks() {
        try {
            machineListRotate = machineMapper.selectList(new QueryWrapper<Machine>().lambda().eq(Machine::getName, "旋转台"));
@@ -220,7 +220,7 @@
    }
    //贴膜机
    @Scheduled(fixedDelay = 500)
    //@Scheduled(fixedDelay = 500)
    public void laminationTasks() {
        try {
            machineListLamination = machineMapper.selectList(new QueryWrapper<Machine>().lambda().eq(Machine::getName, "自动贴膜机"));
@@ -242,7 +242,7 @@
    //报工页面查询
    @Scheduled(fixedDelay = 1000)
    //@Scheduled(fixedDelay = 1000)
    public void manualReporting() {
        try {
            machineListScanQrCode = machineMapper.selectList(new QueryWrapper<Machine>().lambda().eq(Machine::getName, "识别报工"));
@@ -271,7 +271,7 @@
    }
    //线下玻璃查询
    @Scheduled(fixedDelay = 1000)
    //@Scheduled(fixedDelay = 1000)
    public void downLineTask() {
        try {
            JSONObject jsonObject = new JSONObject();
@@ -292,7 +292,6 @@
        } catch (Exception ex) {
            log.info("{}发送数据失败:{}", "rawGlassStorage", ex.getMessage());
        }
    }
//    public void webSocketServer(JSONObject jsonObject) {
//        try {
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/job/PLCCleaning.java
@@ -32,15 +32,18 @@
    public S7objectMachine s7objectMachine;
    //@Scheduled(fixedDelay = 500)
    public void cleaning() {
    public void cleaning() throws Exception {
        //磨边线速度  10.36.164.200
        Long machineId=8L;
        Machine machine=machineMapper.selectById(machineId);
        if (s7objectMachine==null){
            s7objectMachine=new S7objectMachine(machine.getIp(),machine.getPort(),"PlcCleaning", EPlcType.S200_SMART);
            s7objectMachine.start();
        }
        S7objectMachine s7objectMachine = new S7objectMachine(machine.getIp(),machine.getPort(),"PlcCleaning", EPlcType.S200_SMART);
        s7objectMachine.readData();//按照json文件读取内容
        PlcParameterObject plcParameterObject = s7objectMachine.PlcMesObject;
        if (plcParameterObject == null) {
            s7objectMachine.plccontrol.closeS7client();
            return;
        }
        try {
        PlcParameterInfo edgSpeed =plcParameterObject.getPlcParameter("edgSpeed");//磨边机速度
        PlcParameterInfo thinness =plcParameterObject.getPlcParameter("thinness");//厚度
        if (machine.getIsLog()>0){
@@ -53,6 +56,11 @@
            S7objectCleaning.getinstance().plccontrol.writeWord(edgSpeed.getAddress(), edgSpeedInt);
            S7objectCleaning.getinstance().plccontrol.writeWord(thinness.getAddress(), edgThinnessInt);
        }
        }catch (Exception e) {
            s7objectMachine.plccontrol.closeS7client();
            log.info("逻辑处理异常:设备id【{}】", machine.getId());
        }
    }
    //@Scheduled(fixedDelay = 1000)
    public void cleaningTask() {
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/md/controller/PrimitiveTaskController.java
@@ -2,12 +2,11 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mes.md.entity.KBBTJPDrawingBP;
import com.mes.md.entity.PrimitiveTask;
import com.mes.md.entity.TaskingLog;
import com.mes.md.entity.*;
import com.mes.md.mapper.KBBTJPDrawingBPMapper;
import com.mes.md.mapper.TaskingLogMapper;
import com.mes.md.service.KBBTJPDrawingBPService;
import com.mes.md.service.LineConfigurationService;
import com.mes.md.service.PrimitiveTaskService;
import com.mes.md.service.TaskingLogService;
import com.mes.utils.Result;
@@ -42,12 +41,15 @@
    TaskingLogService taskingLogService;
    @Autowired
    TaskingLogMapper taskingLogMapper;
    @Autowired
    LineConfigurationService lineConfigurationService;
    @ApiOperation("查询当前设备,未完工状态的线上任务")
    @PostMapping("/selectPrimitiveTask")
    @PostMapping("/findMachineTask")
    @ResponseBody
    public Result findMachineTask(@RequestBody PrimitiveTask primitiveTask) {
        List<PrimitiveTask> list =primitiveTaskService.selectPrimitiveTask(primitiveTask);
    public Result findMachineTask(@RequestBody Machine machine) {
        LineConfiguration lineConfiguration = lineConfigurationService.machineLineConfiguration(machine);
        List<PrimitiveTask> list =primitiveTaskService.findPrimitiveTasking(machine,lineConfiguration.getLineId());
        return Result.build(200,"成功",list);
    }
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineDispensing.java
@@ -29,7 +29,7 @@
        this.taskingService = taskingService;
    }
    public void plcStart() {
    public void plcStart()throws Exception {
        Machine machine = machineMapper.selectById(thisMachine.getId());
        String fileName = machine.getFileName();
        ModbusTcp modbusTcp1 = new ModbusTcp(machine.getIp(), machine.getPort(), fileName);
@@ -223,12 +223,14 @@
    @Override
    public void run() {
        while (this != null) {
        while (true) {
            try {
                Thread.sleep(1000);
                plcStart();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineEdging.java
@@ -48,7 +48,7 @@
        this.lineConfigurationService = lineConfigurationService;
    }
    public void plcStart() {
    public void plcStart() throws Exception{
        Machine machine=machineMapper.selectById(thisMachine.getId());
        ModbusTcp modbusTcp1 =new ModbusTcp(machine.getIp(),machine.getPort(),machine.getFileName());
        try {
@@ -325,12 +325,14 @@
    }
    @Override
    public void run() {
        while (this != null) {
        while (true) {
            try {
                Thread.sleep(1000);
                plcStart();
            } catch (InterruptedException e) {
                e.printStackTrace();
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineFlipSlice.java
@@ -19,10 +19,8 @@
    private MachineMapper machineMapper;
    private TaskingService taskingService;
    private S7objectMachine s7objectMachine;
    public static int thinness = 40;
    public static int edgSpeed = 40;
    //public static Long machineId = 6L;
    public List<Map> sendRecords = new ArrayList<>();
    public Machine thisMachine;
@@ -32,14 +30,16 @@
        this.taskingService = taskingService;
    }
    public void plcStart() {
        //Long machineId=26L;
    public void plcStart() throws Exception {
        Machine machine=machineMapper.selectById(thisMachine.getId());
        if (s7objectMachine==null){
            s7objectMachine=new S7objectMachine(machine.getIp(),machine.getPort(),machine.getFileName(), EPlcType.S1200);
            s7objectMachine.start();
        }
        S7objectMachine s7objectMachine = new S7objectMachine(machine.getIp(), machine.getPort(), machine.getFileName(), EPlcType.S1200);
        s7objectMachine.readData();//按照json文件读取内容
        PlcParameterObject plcParameterObject = s7objectMachine.PlcMesObject;
        if (plcParameterObject == null) {
            s7objectMachine.plccontrol.closeS7client();
            return;
        }
        try {
        PlcParameterInfo plcRequest =plcParameterObject.getPlcParameter("plcRequest");//请求字
        PlcParameterInfo plcRequestID =plcParameterObject.getPlcParameter("plcRequestID");//请求ID
        PlcParameterInfo plcRequestType =plcParameterObject.getPlcParameter("plcRequestType");//PLC请求
@@ -126,7 +126,10 @@
        }else if("0".equals(plcRequest.getValue())){
            nullMachine(machine);
        }
        } catch (Exception e) {
            s7objectMachine.plccontrol.closeS7client();
            log.info("逻辑处理异常:设备id【{}】", machine.getId());
        }
    }
@@ -136,14 +139,17 @@
            machineMapper.updateById(machine);
        }
    }
    @Override
    public void run() {
        while (this != null) {
        while (true) {
            try {
                Thread.sleep(1000);
                plcStart();
            } catch (InterruptedException e) {
                e.printStackTrace();
            } catch (Exception e) {
                log.info("{}", e.getMessage());
            }
        }
    }
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineLamination.java
@@ -22,19 +22,24 @@
    private TaskingService taskingService;
    private S7objectMachine s7objectMachine;
    public Machine thisMachine;
    public MachineLamination(Machine machine, MachineMapper machineMapper, TaskingService taskingService){
        this.thisMachine = machine;
        this.machineMapper = machineMapper;
        this.taskingService = taskingService;
    }
    public void plcStart() {
    public void plcStart()throws Exception {
            Machine machine=machineMapper.selectById(thisMachine.getId());
            if (s7objectMachine==null){
                s7objectMachine=new S7objectMachine(machine.getIp(),machine.getPort(),machine.getFileName(), EPlcType.S1200);
                s7objectMachine.start();
            }
        S7objectMachine s7objectMachine = new S7objectMachine(machine.getIp(), machine.getPort(), machine.getFileName(), EPlcType.S1200);
        s7objectMachine.readData();//按照json文件读取内容
            PlcParameterObject plcParameterObject = s7objectMachine.PlcMesObject;
        if (plcParameterObject == null) {
            s7objectMachine.plccontrol.closeS7client();
            return;
        }
        try {
            PlcParameterInfo plcRequest =plcParameterObject.getPlcParameter("plcRequest");//请求字
            PlcParameterInfo mesSend =plcParameterObject.getPlcParameter("mesSend");//发送字
            PlcParameterInfo lengthOutOfService =plcParameterObject.getPlcParameter("length");//长
@@ -60,8 +65,6 @@
                return;
            }
            if("1".equals(plcReport.getValue())&&"0".equals(mesConfirm.getValue())){
                int finishCount=taskingService.finishMachineTask(machine);
                log.info("3、任务完成");
                if(finishCount>0){//有任务
@@ -85,16 +88,23 @@
                    return;
                }
            }
        } catch (Exception e) {
            s7objectMachine.plccontrol.closeS7client();
            log.info("逻辑处理异常:设备id【{}】", machine.getId());
        }
        }
    @Override
    public void run() {
        while (this != null) {
        while (true) {
            try {
                Thread.sleep(1000);
                plcStart();
            } catch (InterruptedException e) {
                e.printStackTrace();
            } catch (Exception e) {
                log.info("{}", e.getMessage());
            }
        }
    }
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineLoad.java
@@ -47,7 +47,7 @@
        this.lineConfigurationService = lineConfigurationService;
    }
    public void plcStart() {
    public void plcStart() throws Exception{
        ModbusTcp modbusTcp1 = null;
        try {
            Machine machine = machineMapper.selectById(thisMachine.getId());
@@ -168,12 +168,14 @@
    @Override
    public void run() {
        while (this != null) {
        while (true) {
            try {
                Thread.sleep(1000);
                plcStart();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineMarking.java
@@ -25,22 +25,23 @@
    //public static Long machineId = 6L;
    public List<Map> sendRecords = new ArrayList<>();
    public Machine thisMachine;
    public MachineMarking(Machine machine,MachineMapper machineMapper, TaskingService taskingService){
        this.thisMachine = machine;
        this.machineMapper = machineMapper;
        this.taskingService = taskingService;
    }
    public void plcStart() {
            //Long machineId=12L;
    public void plcStart()throws Exception {
            Machine machine=machineMapper.selectById(thisMachine.getId());
//            S7objectMachine s7objectMachine=new S7objectMachine(machine.getIp(),machine.getPort(),"PlcMarking", EPlcType.S1500);
//            s7objectMachine.start();
            if (s7objectMachine==null){
                s7objectMachine=new S7objectMachine(machine.getIp(),machine.getPort(),machine.getFileName(), EPlcType.S1500);
                s7objectMachine.start();
            }
        S7objectMachine s7objectMachine = new S7objectMachine(machine.getIp(), machine.getPort(), machine.getFileName(), EPlcType.S1500);
        s7objectMachine.readData();//按照json文件读取内容
            PlcParameterObject plcParameterObject = s7objectMachine.PlcMesObject;
        if (plcParameterObject == null) {
            s7objectMachine.plccontrol.closeS7client();
            return;
        }
        try {
            PlcParameterInfo plcRequest =plcParameterObject.getPlcParameter("plcRequest");//请求字
            PlcParameterInfo plcRequestID =plcParameterObject.getPlcParameter("plcRequestID");//请求ID
            PlcParameterInfo mesSend =plcParameterObject.getPlcParameter("mesSend");//发送字
@@ -111,16 +112,23 @@
                    return;
                }
            }
        } catch (Exception e) {
            s7objectMachine.plccontrol.closeS7client();
            log.info("逻辑处理异常:设备id【{}】", machine.getId());
        }
        }
    @Override
    public void run() {
        while (this != null) {
        while (true) {
            try {
                Thread.sleep(1000);
                plcStart();
            } catch (InterruptedException e) {
                e.printStackTrace();
            } catch (Exception e) {
                log.info("{}", e.getMessage());
            }
        }
    }
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineRotate.java
@@ -29,15 +29,19 @@
        this.machineMapper = machineMapper;
        this.taskingService = taskingService;
    }
    public void plcStart() {
    public void plcStart() throws Exception {
        //旋转台
        //Long machineId=20L;
        Machine machine=machineMapper.selectById(thisMachine.getId());
        if (s7objectMachine==null){
            s7objectMachine=new S7objectMachine(machine.getIp(),machine.getPort(),machine.getFileName(), EPlcType.S1200);
            s7objectMachine.start();
        }
        S7objectMachine s7objectMachine = new S7objectMachine(machine.getIp(), machine.getPort(), machine.getFileName(), EPlcType.S1200);
        s7objectMachine.readData();//按照json文件读取内容
        PlcParameterObject plcParameterObject = s7objectMachine.PlcMesObject;
        if (plcParameterObject == null) {
            s7objectMachine.plccontrol.closeS7client();
            return;
        }
        try {
        PlcParameterInfo plcRequest =plcParameterObject.getPlcParameter("plcRequest");//请求字
        PlcParameterInfo plcRequestID =plcParameterObject.getPlcParameter("plcRequestID");//请求ID
        PlcParameterInfo plcRequestType =plcParameterObject.getPlcParameter("plcRequestType");//PLC请求
@@ -126,8 +130,13 @@
        }else if("0".equals(plcRequest.getValue())){
            nullMachine(machine);
        }
        } catch (Exception e) {
            s7objectMachine.plccontrol.closeS7client();
            log.info("逻辑处理异常:设备id【{}】", machine.getId());
        }
    }
    public void nullMachine(Machine machine) {
        if (!"".equals(machine.getRemark())){
            machine.setRemark("");
@@ -137,12 +146,14 @@
    @Override
    public void run() {
        while (this != null) {
        while (true) {
            try {
                Thread.sleep(1000);
                plcStart();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }catch (Exception e) {
                log.info("{}", e.getMessage());
            }
        }
    }
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineSilkScreen.java
@@ -28,7 +28,7 @@
        this.taskingService = taskingService;
    }
    public void plcStart() {
    public void plcStart() throws Exception{
            Machine machine=machineMapper.selectById(thisMachine.getId());
            String fileName=machine.getFileName();
            ModbusTcp modbusTcp1 =new ModbusTcp(machine.getIp(),machine.getPort(),fileName);
@@ -192,7 +192,6 @@
            } catch (Exception e) {
                log.info("交互逻辑错误");
            }
            modbusTcp1.close();
            //log.info("无可执行的条件");
        }
@@ -200,12 +199,14 @@
    @Override
    public void run() {
        while (this != null) {
        while (true) {
            try {
                Thread.sleep(1000);
                plcStart();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    }
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/java/com/mes/plcTaskThread/MachineThread.java
@@ -43,22 +43,6 @@
    public Long machineId = 2L;
    public List<Map> sendRecords = new ArrayList<>();
//    public void plcStart1(PlcAgreement plcAgreement,String zuKey) {
//        //逻辑组 :请求组,完成组,其他组
//        //List<Map<String,String>> map=new ArrayList<>();//逻辑组
//        Map<String,Map<String,Map<String,String>>> map=new HashMap<>();//请求逻辑组
//        Map<String,Map<String,String>> zuMap=map.get(zuKey);
//
//        for(String key:map.keySet()){
//            boolean istrue=false;
//            if(plcAgreement.getPlcParameter(key).getValueString()==map.get(key)){
//                istrue=true;
//            }
//            map.put(key,plcAgreement.getPlcParameter(key).getValueString());
//        }
//
//    }
    public void plcStart() {
        Machine machine=machineMapper.selectById(machineId);
JiuMuMesParent/moduleService/DeviceInteractionModule/src/main/resources/application-prod.yml
@@ -9,16 +9,16 @@
          username: root
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
#        salve_JomooKBB:
#          url: jdbc:sqlserver://localhost:1433;databasename=JomooKBB
#          username: sa
#          password: beibo.123/
#          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
        salve_JomooKBB:
          url: jdbc:sqlserver://172.18.19.85:1433;databasename=JomooKBB
          username: thok
          password: jomoo@123
          url: jdbc:sqlserver://localhost:1433;databasename=JomooKBB
          username: sa
          password: beibo.123/
          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
#        salve_JomooKBB:
#          url: jdbc:sqlserver://172.18.19.85:1433;databasename=JomooKBB
#          username: thok
#          password: jomoo@123
#          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
  cloud:
    nacos:
      discovery:
JiuMuMesParent/moduleService/DeviceInteractionModule/target/classes/application-prod.yml
@@ -9,16 +9,16 @@
          username: root
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
#        salve_JomooKBB:
#          url: jdbc:sqlserver://localhost:1433;databasename=JomooKBB
#          username: sa
#          password: beibo.123/
#          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
        salve_JomooKBB:
          url: jdbc:sqlserver://172.18.19.85:1433;databasename=JomooKBB
          username: thok
          password: jomoo@123
          url: jdbc:sqlserver://localhost:1433;databasename=JomooKBB
          username: sa
          password: beibo.123/
          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
#        salve_JomooKBB:
#          url: jdbc:sqlserver://172.18.19.85:1433;databasename=JomooKBB
#          username: thok
#          password: jomoo@123
#          driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
  cloud:
    nacos:
      discovery:
JiuMuMesParent/moduleService/DeviceInteractionModule/target/deviceInteraction-1.0-SNAPSHOT.jar.original
Binary files differ
JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
@@ -1,11 +1,15 @@
com\mes\energy\entity\EnergyConsumption.class
com\mes\md\mapper\TaskingMapper.class
com\mes\md\entity\Machine.class
com\mes\plannedAmount\service\impl\PlannedAmountImpl.class
com\mes\quantity\service\QuantityService.class
com\mes\yield\controller\YieldController.class
com\mes\md\mapper\RoleMapper.class
com\mes\md\service\TaskingLogService.class
com\mes\md\mapper\KBBTProgramsDeviceStatusLogBPMapper.class
com\mes\md\service\impl\ProjectServiceImpl.class
com\mes\md\service\impl\OrderOriginalPieceServiceImpl.class
com\mes\plannedAmount\controller\PlannedAmountController.class
com\mes\md\service\AccountService.class
com\mes\DeviceInteractionModuleApplication.class
com\mes\md\service\ProjectService.class
@@ -21,11 +25,15 @@
com\mes\md\mapper\KBBTJPDrawingBPMapper.class
com\mes\md\controller\GlassInfoController.class
com\mes\md\service\KBBTProgramsOperationLogBPService.class
com\mes\yield\service\impl\YieldServiceImpl.class
com\mes\md\mapper\PageMapper.class
com\mes\md\service\ProjectLogService.class
com\mes\md\entity\Project.class
com\mes\quantity\controller\QuantityController.class
com\mes\quantity\entity\Quantity.class
com\mes\md\mapper\PrimitiveTaskMapper.class
com\mes\md\service\impl\EdgeGrindingLogServiceImpl.class
com\mes\yield\mapper\YieldMapper.class
com\mes\job\AddTask.class
com\mes\md\entity\KBBTProgramsOperationLogBP.class
com\mes\md\entity\LineConfiguration.class
@@ -37,9 +45,11 @@
com\mes\edgstoragecage\service\EdgStorageCageService.class
com\mes\common\CommunicationProtocol.class
com\mes\md\entity\Line.class
com\mes\utilization\service\impl\UtilizationServiceImpl.class
com\mes\plcTaskThread\MachineEdging.class
com\mes\md\entity\EdgeGrindingLog.class
com\mes\md\service\OrderOriginalPieceService.class
com\mes\yield\service\YieldService.class
com\mes\md\service\impl\GlassInfoServiceImpl.class
com\mes\mechanicalMonitor\service\MechanicalMonitorService.class
com\mes\plcTaskThread\MachineSilkScreen.class
@@ -53,6 +63,7 @@
com\mes\md\mapper\WorkTaskDetailMapper.class
com\mes\md\service\LineService.class
com\mes\md\service\impl\PageServiceImpl.class
com\mes\quantity\mapper\QuantityMapper.class
com\mes\md\entity\TaskingLog.class
com\mes\md\service\impl\WorkTaskDetailServiceImpl.class
com\mes\md\service\impl\TaskLogServiceImpl.class
@@ -62,6 +73,7 @@
com\mes\md\service\LineConfigurationService.class
com\mes\md\entity\GlassInfo.class
com\mes\md\service\GlassInfoService.class
com\mes\utilization\entity\Utilization.class
com\mes\md\entity\Page.class
com\mes\job\PLCCleaning.class
com\mes\md\controller\RoleController.class
@@ -74,6 +86,7 @@
com\mes\md\controller\OrderOriginalPieceController.class
com\mes\md\controller\ProjectController.class
com\mes\md\entity\ProjectLog.class
com\mes\yield\entity\Yield.class
com\mes\md\service\EdgeGrindingLogService.class
com\mes\AppRunnerConfig.class
com\mes\plcTaskThread\MachineFlipSlice.class
@@ -98,12 +111,16 @@
com\mes\md\service\impl\KBBTJPDrawingBPServiceImpl.class
com\mes\md\mapper\ProjectMapper.class
com\mes\energy\service\EnergyConsumptionService.class
com\mes\common\S7objectMachine3.class
com\mes\md\controller\EquipmentLogController.class
com\mes\md\controller\TaskingLogController.class
com\mes\plannedAmount\mapper\PlannedAmountMapper.class
com\mes\common\SmbTool.class
com\mes\md\mapper\ProjectLogMapper.class
com\mes\plannedAmount\service\PlannedAmountService.class
com\mes\plcTaskThread\MachineMarking.class
com\mes\md\mapper\OrderOriginalPieceMapper.class
com\mes\plannedAmount\entity\PlannedAmount.class
com\mes\edgstoragecage\entity\EdgStorageCageDetails.class
com\mes\md\service\impl\RoleServiceImpl.class
com\mes\md\controller\MachineController.class
@@ -112,7 +129,7 @@
com\mes\md\service\impl\LineServiceImpl.class
com\mes\md\mapper\LineMapper.class
com\mes\md\mapper\EdgeGrindingLogMapper.class
com\mes\common\S7objectMarking.class
com\mes\utilization\service\UtilizationService.class
com\mes\md\entity\KBBTProgramsDeviceOlnlineLogBP.class
com\mes\md\entity\PrimitiveTask.class
com\mes\mechanicalMonitor\controller\MechanicalMonitorController.class
@@ -122,11 +139,11 @@
com\mes\job\MachineTask.class
com\mes\md\entity\Menu.class
com\mes\md\service\impl\LineConfigurationServiceImpl.class
com\mes\plcTaskThread\MachineDispensing.class
com\mes\common\S7object.class
com\mes\md\mapper\MenuMapper.class
com\mes\md\service\RoleMenuService.class
com\mes\edgstoragecage\service\impl\EdgStorageCageServiceImpl.class
com\mes\common\S7objectFlipSlice.class
com\mes\edgstoragecage\mapper\EdgStorageCageMapper.class
com\mes\energy\service\impl\EnergyConsumptionServiceImpl.class
com\mes\md\service\impl\ProjectLogServiceImpl.class
@@ -134,11 +151,14 @@
com\mes\md\service\TaskingService.class
com\mes\plcTaskThread\MachineThread.class
com\mes\md\service\RoleService.class
com\mes\quantity\service\impl\QuantityServiceImpl.class
com\mes\md\service\MachineService.class
com\mes\md\service\PageService.class
com\mes\utilization\controller\UtilizationController.class
com\mes\md\controller\ProjectLogController.class
com\mes\md\mapper\GlassInfoMapper.class
com\mes\md\service\impl\KBBTProgramsOperationLogBPServiceImpl.class
com\mes\md\entity\Tasking.class
com\mes\utilization\mapper\UtilizationMapper.class
com\mes\mechanicalMonitor\service\impl\MechanicalMonitorServiceImpl.class
com\mes\md\service\impl\MachineServiceImpl.class
JiuMuMesParent/moduleService/DeviceInteractionModule/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
@@ -1,5 +1,6 @@
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\LineConfiguration.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\edgstoragecage\mapper\EdgStorageCageMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\quantity\service\QuantityService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\common\CommunicationProtocol.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\DeviceInteractionModuleApplication.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\Role.java
@@ -9,9 +10,11 @@
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\MenuController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\ProjectLogMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\GlassInfoServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\yield\controller\YieldController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\WorkTaskDetailController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\KBBTProgramsOperationLogBPMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\MachineTask.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plannedAmount\service\PlannedAmountService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plcTaskThread\MachineThread.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\WorkTaskDetailServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\AccountService.java
@@ -23,12 +26,16 @@
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\Project.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\PrimitiveTaskServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\edgstoragecage\service\EdgStorageCageService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\quantity\entity\Quantity.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\EdgeGrindingLog.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\KBBTLensSortingMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plannedAmount\entity\PlannedAmount.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\TaskingController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\TaskLogServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\TaskingServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\yield\mapper\YieldMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\LineConfigurationService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\utilization\service\impl\UtilizationServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\AppRunnerConfig.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\AccountMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\ProjectMapper.java
@@ -51,7 +58,6 @@
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\energy\entity\EnergyConsumption.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\Page.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\mechanicalMonitor\entity\MechanicalMonitor.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\common\S7objectFlipSlice.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plcTaskThread\MachineLoad.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\job\PLCCleaning.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\TaskingLog.java
@@ -60,8 +66,8 @@
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\MachineController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\edgstoragecage\entity\EdgStorageCageDetails.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plcTaskThread\MachineFlipSlice.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plannedAmount\controller\PlannedAmountController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\ProjectLogController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\common\S7objectMarking.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\WorkTaskDetail.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\energy\service\impl\EnergyConsumptionServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\KBBTProgramsDeviceOlnlineLogBPMapper.java
@@ -77,21 +83,26 @@
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\LineMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\KBBTLensSorting.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plcTaskThread\MachineLamination.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\utilization\controller\UtilizationController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\ProjectLog.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\KBBTJPDrawingBP.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\PageService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plcTaskThread\MachineMarking.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\KBBTProgramsOperationLogBP.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plannedAmount\service\impl\PlannedAmountImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\mechanicalMonitor\service\impl\MechanicalMonitorServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\quantity\controller\QuantityController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\TaskLog.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\GlassInfo.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\OrderOriginalPieceMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\RoleController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\common\tcpIp.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\WorkTaskDetailService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\quantity\service\impl\QuantityServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\RoleService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\energy\controller\EnergyConsumptionController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\MachineServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\yield\service\impl\YieldServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\mechanicalMonitor\service\MechanicalMonitorService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\edgstoragecage\entity\EdgStorageCage.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\PrimitiveTaskMapper.java
@@ -103,6 +114,8 @@
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plcTaskThread\MachineRotate.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\EdgeGrindingLogService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\PrimitiveTaskService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plannedAmount\mapper\PlannedAmountMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\yield\entity\Yield.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\common\S7object.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\EdgeGrindingLogServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\ProjectServiceImpl.java
@@ -113,10 +126,13 @@
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\RoleMenuMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\EquipmentLogMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\EquipmentLog.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\utilization\mapper\UtilizationMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\LineConfigurationMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\LineServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\KBBTProgramsDeviceStatusLogBPMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\AccountController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plcTaskThread\MachineDispensing.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\utilization\entity\Utilization.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\KBBTProgramsDeviceStatusLogBP.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\MenuService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\Menu.java
@@ -133,12 +149,16 @@
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\TaskingLogService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\mechanicalMonitor\controller\MechanicalMonitorController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\KBBTProgramsOperationLogBPServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\common\S7objectMachine3.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\ProjectLogServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\mapper\TaskingMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\OrderOriginalPieceController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\utilization\service\UtilizationService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\common\S7objectCleaning.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\quantity\mapper\QuantityMapper.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\KBBTProgramsOperationLogBPService.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\plcTaskThread\MachineEdging.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\entity\PrimitiveTask.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\controller\EquipmentLogController.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\md\service\impl\RoleServiceImpl.java
D:\workfile\JiuMuMES\JiuMuMesParent\moduleService\DeviceInteractionModule\src\main\java\com\mes\yield\service\YieldService.java
UI-Project/config.js
@@ -1,13 +1,13 @@
export default {
  // serverUrl: "localhost:88/api",
  // serverUrl2: "localhost:88"
  serverUrl: "localhost:88/api",
  serverUrl2: "localhost:88"
  // serverUrl: "10.36.164.253:88/api",
  //  serverUrl2: "10.36.164.253:88"
  serverUrl: "10.36.164.200:88/api",
  serverUrl2: "10.36.164.200:88"
  // serverUrl: "10.36.164.200:88/api",
  // serverUrl2: "10.36.164.200:88"
    // serverUrl2: "127.0.0.1:88"npm
UI-Project/package-lock.json
@@ -28,6 +28,7 @@
        "vue-print-nb": "^1.7.5",
        "vue-router": "^4.2.4",
        "vue3-print-nb": "^0.1.4",
        "vxe-pc-ui": "^4.9.14",
        "vxe-table": "^4.5.15",
        "xe-utils": "^3.5.14",
        "xlsx": "^0.18.5"
@@ -546,6 +547,18 @@
        }
      }
    },
    "node_modules/@vxe-ui/core": {
      "version": "4.2.11",
      "resolved": "https://registry.npmmirror.com/@vxe-ui/core/-/core-4.2.11.tgz",
      "integrity": "sha512-Cv0XKTGgFD+CD2MGixxM+k60Y3tFEJYErQj59tuPd0y0HuSFc7sQk0fuXdbcNgxZxtAi4zX3nsDk3kY+/HeAgQ==",
      "dependencies": {
        "dom-zindex": "^1.0.6",
        "xe-utils": "^3.7.8"
      },
      "peerDependencies": {
        "vue": "^3.2.0"
      }
    },
    "node_modules/acorn": {
      "version": "8.12.0",
      "resolved": "https://registry.npmmirror.com/acorn/-/acorn-8.12.0.tgz",
@@ -834,9 +847,9 @@
      "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA=="
    },
    "node_modules/dom-zindex": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/dom-zindex/-/dom-zindex-1.0.1.tgz",
      "integrity": "sha512-M/MERVDZ8hguvjl6MAlLWSLYLS7PzEyXaTb5gEeJ+SF+e9iUC0sdvlzqe91MMDHBoy+nqw7wKcUOrDSyvMCrRg=="
      "version": "1.0.6",
      "resolved": "https://registry.npmmirror.com/dom-zindex/-/dom-zindex-1.0.6.tgz",
      "integrity": "sha512-FKWIhiU96bi3xpP9ewRMgANsoVmMUBnMnmpCT6dPMZOunVYJQmJhSRruoI0XSPoHeIif3kyEuiHbFrOJwEJaEA=="
    },
    "node_modules/echarts": {
      "version": "5.6.0",
@@ -2057,6 +2070,14 @@
        "vue": "^3.0.5"
      }
    },
    "node_modules/vxe-pc-ui": {
      "version": "4.9.14",
      "resolved": "https://registry.npmmirror.com/vxe-pc-ui/-/vxe-pc-ui-4.9.14.tgz",
      "integrity": "sha512-YtpLUU6x43UQnjPBMqgewAYdC9w5FGC/ZHO3ZiYl3fWt+HACkJgreJzgfX4z0QkzLdp/6vmDS4rvnH9vpdNmrw==",
      "dependencies": {
        "@vxe-ui/core": "^4.2.11"
      }
    },
    "node_modules/vxe-table": {
      "version": "4.5.15",
      "resolved": "https://registry.npmjs.org/vxe-table/-/vxe-table-4.5.15.tgz",
@@ -2118,9 +2139,9 @@
      }
    },
    "node_modules/xe-utils": {
      "version": "3.5.14",
      "resolved": "https://registry.npmjs.org/xe-utils/-/xe-utils-3.5.14.tgz",
      "integrity": "sha512-Xq6mS8dWwHBQsQUEBXcZYSaBV0KnNLoVWd0vRRDI3nKpbNxfs/LSCK0W21g1edLFnXYfKqg7hh5dakr3RtYY0A=="
      "version": "3.7.8",
      "resolved": "https://registry.npmmirror.com/xe-utils/-/xe-utils-3.7.8.tgz",
      "integrity": "sha512-V/k6B/ASYir6yLYhp62DnM17po9u1N9mou/rn4if5WoFCsAO49JpCiVpkDpwCv4zxGfWmhWgzmz4FytWF+pDVw=="
    },
    "node_modules/xlsx": {
      "version": "0.18.5",
@@ -2561,6 +2582,15 @@
        }
      }
    },
    "@vxe-ui/core": {
      "version": "4.2.11",
      "resolved": "https://registry.npmmirror.com/@vxe-ui/core/-/core-4.2.11.tgz",
      "integrity": "sha512-Cv0XKTGgFD+CD2MGixxM+k60Y3tFEJYErQj59tuPd0y0HuSFc7sQk0fuXdbcNgxZxtAi4zX3nsDk3kY+/HeAgQ==",
      "requires": {
        "dom-zindex": "^1.0.6",
        "xe-utils": "^3.7.8"
      }
    },
    "acorn": {
      "version": "8.12.0",
      "resolved": "https://registry.npmmirror.com/acorn/-/acorn-8.12.0.tgz",
@@ -2770,9 +2800,9 @@
      "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA=="
    },
    "dom-zindex": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/dom-zindex/-/dom-zindex-1.0.1.tgz",
      "integrity": "sha512-M/MERVDZ8hguvjl6MAlLWSLYLS7PzEyXaTb5gEeJ+SF+e9iUC0sdvlzqe91MMDHBoy+nqw7wKcUOrDSyvMCrRg=="
      "version": "1.0.6",
      "resolved": "https://registry.npmmirror.com/dom-zindex/-/dom-zindex-1.0.6.tgz",
      "integrity": "sha512-FKWIhiU96bi3xpP9ewRMgANsoVmMUBnMnmpCT6dPMZOunVYJQmJhSRruoI0XSPoHeIif3kyEuiHbFrOJwEJaEA=="
    },
    "echarts": {
      "version": "5.6.0",
@@ -3156,6 +3186,7 @@
        "vue-print-nb": "^1.7.5",
        "vue-router": "^4.2.4",
        "vue3-print-nb": "^0.1.4",
        "vxe-pc-ui": "*",
        "vxe-table": "^4.5.15",
        "xe-utils": "^3.5.14",
        "xlsx": "^0.18.5"
@@ -3532,6 +3563,15 @@
            }
          }
        },
        "@vxe-ui/core": {
          "version": "4.2.11",
          "resolved": "https://registry.npmmirror.com/@vxe-ui/core/-/core-4.2.11.tgz",
          "integrity": "sha512-Cv0XKTGgFD+CD2MGixxM+k60Y3tFEJYErQj59tuPd0y0HuSFc7sQk0fuXdbcNgxZxtAi4zX3nsDk3kY+/HeAgQ==",
          "requires": {
            "dom-zindex": "^1.0.6",
            "xe-utils": "^3.7.8"
          }
        },
        "acorn": {
          "version": "8.12.0",
          "resolved": "https://registry.npmmirror.com/acorn/-/acorn-8.12.0.tgz",
@@ -3741,9 +3781,9 @@
          "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA=="
        },
        "dom-zindex": {
          "version": "1.0.1",
          "resolved": "https://registry.npmjs.org/dom-zindex/-/dom-zindex-1.0.1.tgz",
          "integrity": "sha512-M/MERVDZ8hguvjl6MAlLWSLYLS7PzEyXaTb5gEeJ+SF+e9iUC0sdvlzqe91MMDHBoy+nqw7wKcUOrDSyvMCrRg=="
          "version": "1.0.6",
          "resolved": "https://registry.npmmirror.com/dom-zindex/-/dom-zindex-1.0.6.tgz",
          "integrity": "sha512-FKWIhiU96bi3xpP9ewRMgANsoVmMUBnMnmpCT6dPMZOunVYJQmJhSRruoI0XSPoHeIif3kyEuiHbFrOJwEJaEA=="
        },
        "echarts": {
          "version": "5.6.0",
@@ -4551,6 +4591,14 @@
            "vue": "^3.0.5"
          }
        },
        "vxe-pc-ui": {
          "version": "4.9.14",
          "resolved": "https://registry.npmmirror.com/vxe-pc-ui/-/vxe-pc-ui-4.9.14.tgz",
          "integrity": "sha512-YtpLUU6x43UQnjPBMqgewAYdC9w5FGC/ZHO3ZiYl3fWt+HACkJgreJzgfX4z0QkzLdp/6vmDS4rvnH9vpdNmrw==",
          "requires": {
            "@vxe-ui/core": "^4.2.11"
          }
        },
        "vxe-table": {
          "version": "4.5.15",
          "resolved": "https://registry.npmjs.org/vxe-table/-/vxe-table-4.5.15.tgz",
@@ -4596,9 +4644,9 @@
          }
        },
        "xe-utils": {
          "version": "3.5.14",
          "resolved": "https://registry.npmjs.org/xe-utils/-/xe-utils-3.5.14.tgz",
          "integrity": "sha512-Xq6mS8dWwHBQsQUEBXcZYSaBV0KnNLoVWd0vRRDI3nKpbNxfs/LSCK0W21g1edLFnXYfKqg7hh5dakr3RtYY0A=="
          "version": "3.7.8",
          "resolved": "https://registry.npmmirror.com/xe-utils/-/xe-utils-3.7.8.tgz",
          "integrity": "sha512-V/k6B/ASYir6yLYhp62DnM17po9u1N9mou/rn4if5WoFCsAO49JpCiVpkDpwCv4zxGfWmhWgzmz4FytWF+pDVw=="
        },
        "xlsx": {
          "version": "0.18.5",
@@ -5108,6 +5156,14 @@
        "vue": "^3.0.5"
      }
    },
    "vxe-pc-ui": {
      "version": "4.9.14",
      "resolved": "https://registry.npmmirror.com/vxe-pc-ui/-/vxe-pc-ui-4.9.14.tgz",
      "integrity": "sha512-YtpLUU6x43UQnjPBMqgewAYdC9w5FGC/ZHO3ZiYl3fWt+HACkJgreJzgfX4z0QkzLdp/6vmDS4rvnH9vpdNmrw==",
      "requires": {
        "@vxe-ui/core": "^4.2.11"
      }
    },
    "vxe-table": {
      "version": "4.5.15",
      "resolved": "https://registry.npmjs.org/vxe-table/-/vxe-table-4.5.15.tgz",
@@ -5153,9 +5209,9 @@
      }
    },
    "xe-utils": {
      "version": "3.5.14",
      "resolved": "https://registry.npmjs.org/xe-utils/-/xe-utils-3.5.14.tgz",
      "integrity": "sha512-Xq6mS8dWwHBQsQUEBXcZYSaBV0KnNLoVWd0vRRDI3nKpbNxfs/LSCK0W21g1edLFnXYfKqg7hh5dakr3RtYY0A=="
      "version": "3.7.8",
      "resolved": "https://registry.npmmirror.com/xe-utils/-/xe-utils-3.7.8.tgz",
      "integrity": "sha512-V/k6B/ASYir6yLYhp62DnM17po9u1N9mou/rn4if5WoFCsAO49JpCiVpkDpwCv4zxGfWmhWgzmz4FytWF+pDVw=="
    },
    "xlsx": {
      "version": "0.18.5",
UI-Project/package.json
@@ -28,6 +28,7 @@
    "vue-print-nb": "^1.7.5",
    "vue-router": "^4.2.4",
    "vue3-print-nb": "^0.1.4",
    "vxe-pc-ui": "^4.9.14",
    "vxe-table": "^4.5.15",
    "xe-utils": "^3.5.14",
    "xlsx": "^0.18.5"
UI-Project/src/utils/constants.js
@@ -1,4 +1,4 @@
//  export const WebSocketHost = "localhost";
  export const WebSocketHost = "localhost";
//  export const WebSocketHost = "10.36.164.253";
 export const WebSocketHost = "10.36.164.200";
 //export const WebSocketHost = "10.36.164.200";
 export const host = "88";
UI-Project/src/views/Cleaning/cleaning.vue
@@ -15,66 +15,94 @@
const loadData = ref([]);
const findMachine = ref([]);
const machineId=7;//当前页面的设备ID
//使用WebSocket方式展示数据
let socket = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/cleaning`;
// 定义消息处理函数,更新 receivedData 变量
const handleMessage = (data) => {
  // 更新 tableData 的数据
  loadData.value = data.taskingList[0];
  findMachine.value = data.machine[0];
  // console.log(data);
};
onUnmounted(() => {
  if (socket) {
    closeWebSocket(socket);
// 新增:定时任务ID(用于清除定时器)
const timerId = ref(null);
/**
 * 单次接口请求函数
 * 作用:调用后端接口,获取数据后交给 handleMessage 处理
 */
const fetchMachineData = async () => {
  try {
    // 任务数据
    request.post("/deviceInteraction/tasking/findMachineTask",{
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        loadData.value =responseData;
  }
});
onBeforeUnmount(() => {
  console.log("关闭了")
  closeWebSocket();
    // 设备数据
    request.post("/deviceInteraction/machine/findMachine",{
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        findMachine.value =responseData;
        if (Object.keys(findMachine.value).length === 0){
          if(findMachine.value.remark.toString()!=errorScanId&&findMachine.value.remark.toString()!=""&&findMachine.value.remark.toString()!=undefined){
            //有数据就弹窗
            if(errorOpen){
              ElMessageBox.close();
            }
            errorScanId=findMachine.value.remark.toString();
            errorInfoFuntion(findMachine.value.remark.toString());
            errorOpen=true;
          }else if(findMachine.value.remark.toString()==""&&errorOpen){
            ElMessageBox.close();
            errorOpen=false;
          }
        }
      }
    });
    // 线下数据
  } catch (err) {
    console.error('定时请求后端接口失败:', err);
  }
};
/**
 * 启动定时器
 * @param {number} interval - 定时间隔(毫秒,默认500ms,与后端任务频率对齐)
 */
const startTimer = (interval = 500) => {
  // 先清除已有定时器(避免重复创建)
  if (timerId.value) clearInterval(timerId.value);
  // 立即执行一次(避免首次等待间隔)
  fetchMachineData();
  // 创建新定时器
  timerId.value = setInterval(() => {
    fetchMachineData();
  }, interval);
};
/**
 * 清除定时器(避免内存泄漏)
 */
const clearTimer = () => {
  if (timerId.value) {
    clearInterval(timerId.value);
    timerId.value = null; // 重置ID
  }
};
// 组件卸载时清除定时器(关键:避免组件销毁后定时器仍运行)
onUnmounted(() => {
  clearTimer();
});
onMounted(async () => {
  //使用WebSocket方式展示数据
  socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  //使用接口方式展示数据
  //load();
  startTimer(500); // 500ms 间隔(可根据业务调整,如1000ms)
  // //使用WebSocket方式展示数据
  // socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  // //使用WebSocket方式展示数据
  // socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 初始化 WebSocket,并传递消息处理函数
});
// //获取数据
// const load = async() => {
//   //获取设备任务数据
//   try {
//     const response = await request.post('/deviceInteraction/tasking/findMachineTask',
//     {
//       "id": 11
//     }); // 替换为你的API端点
//     if (response.code === 200) {
//       loadData.value.findTaskingData= response.data;
//     } else {
//       ElMessage.warning(res.msg)
//     }
//   } catch (error) {
//     // console.error('Error fetching rects :', error);
//   }
//   //获取设备状态
//   try {
//     const response = await request.post('/deviceInteraction/machine/findMachine',
//     {
//       "id": 11
//     }); // 替换为你的API端点
//     if (response.code === 200) {
//       findMachine.value= response.data;
//     } else {
//       ElMessage.warning(res.msg)
//     }
//   } catch (error) {
//     // console.error('Error fetching rects :', error);
//   }
// }
//修改工作状态 【失败/正在工作/完工】
const workStatus = async(row,state) => {
  let url;
UI-Project/src/views/Edging/edging.vue
@@ -25,23 +25,40 @@
const pageParams=userInfo.user.menus[0].pages[1].params;
const pageParamsJson=JSON.parse(pageParams);
const machineId = pageParamsJson.machineId;//当前页面的设备ID
console.log(machineId);
var errorScanId;
var errorOpen=false;
//使用WebSocket方式展示数据
let socket = null;
let socketDownLineTask = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/edgingTask`;
const socketDownLineTaskUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/downLineTask`;
// 定义消息处理函数,更新 receivedData 变量
const handleMessage = (data) => {
  // 更新 tableData 的数据
  let dataJson = data[""+machineId][0];
// 新增:定时任务ID(用于清除定时器)
const timerId = ref(null);
/**
 * 单次接口请求函数
 * 作用:调用后端接口,获取数据后交给 handleMessage 处理
 */
const fetchMachineData = async () => {
  try {
    // 任务数据
    request.post("/deviceInteraction/tasking/findMachineTask",{
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        loadData.value =responseData;
      }
    });
  loadData.value = dataJson.taskingList[0];
  findMachine.value = dataJson.machine[0];
  sendRecords.value = dataJson.sendRecords[0].reverse();
    // 设备数据
    request.post("/deviceInteraction/machine/findMachine",{
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        findMachine.value =responseData;
        if (Object.keys(findMachine.value).length === 0){
  if(findMachine.value.remark.toString()!=errorScanId&&findMachine.value.remark.toString()!=""&&findMachine.value.remark.toString()!=undefined){
    //有数据就弹窗 
    if(errorOpen){
@@ -50,37 +67,58 @@
    errorScanId=findMachine.value.remark.toString();
    errorInfoFuntion(findMachine.value.remark.toString());
    errorOpen=true;
  }else if(findMachine.value.remark.toString()==""&&errorOpen){
    ElMessageBox.close();
    errorOpen=false;
  }
};
// 定义消息处理函数,更新 receivedData 变量
const handleMessage2 = (data) => {
  downLineTask.value = data.downLineTask[0];
  // console.log(data);
};
onUnmounted(() => {
  if (socket) {
    closeWebSocket(socket);
  }
  if (socketDownLineTask) {
    closeWebSocket(socketDownLineTask);
  }
});
onBeforeUnmount(() => {
  console.log("关闭了")
  closeWebSocket();
    // 线下数据
  } catch (err) {
    console.error('定时请求后端接口失败:', err);
  }
};
/**
 * 启动定时器
 * @param {number} interval - 定时间隔(毫秒,默认500ms,与后端任务频率对齐)
 */
const startTimer = (interval = 500) => {
  // 先清除已有定时器(避免重复创建)
  if (timerId.value) clearInterval(timerId.value);
  // 立即执行一次(避免首次等待间隔)
  fetchMachineData();
  // 创建新定时器
  timerId.value = setInterval(() => {
    fetchMachineData();
  }, interval);
};
/**
 * 清除定时器(避免内存泄漏)
 */
const clearTimer = () => {
  if (timerId.value) {
    clearInterval(timerId.value);
    timerId.value = null; // 重置ID
  }
};
// 组件卸载时清除定时器(关键:避免组件销毁后定时器仍运行)
onUnmounted(() => {
  clearTimer();
});
onMounted(async () => {
  //使用WebSocket方式展示数据
  socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  //使用WebSocket方式展示数据
  socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 初始化 WebSocket,并传递消息处理函数
  startTimer(500); // 500ms 间隔(可根据业务调整,如1000ms)
  // //使用WebSocket方式展示数据
  // socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  // //使用WebSocket方式展示数据
  // socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 初始化 WebSocket,并传递消息处理函数
});
//报警提示
const errorInfoFuntion = async (info) => {
  let infoScancode=info;
UI-Project/src/views/FlipSlice/flipSlice.vue
@@ -26,23 +26,40 @@
const pageParams=userInfo.user.menus[0].pages[2].params;
const pageParamsJson=JSON.parse(pageParams);
const machineId = pageParamsJson.machineId;//当前页面的设备ID
console.log(machineId);
//const machineId = 26;//当前页面的设备ID
var errorScanId;
var errorOpen=false;
//使用WebSocket方式展示数据
let socket = null;
let socketDownLineTask = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/flipSlice`;
const socketDownLineTaskUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/downLineTask`;
// 定义消息处理函数,更新 receivedData 变量
const handleMessage = (data) => {
  // 更新 tableData 的数据
  let dataJson = data[""+machineId][0];
// 新增:定时任务ID(用于清除定时器)
const timerId = ref(null);
/**
 * 单次接口请求函数
 * 作用:调用后端接口,获取数据后交给 handleMessage 处理
 */
const fetchMachineData = async () => {
  try {
    // 任务数据
    request.post("/deviceInteraction/tasking/findMachineTask",{
          "id": machineId
        }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        loadData.value =responseData;
      }
    });
  loadData.value = dataJson.taskingList[0];
  findMachine.value = dataJson.machine[0];
  sendRecords.value = dataJson.sendRecords[0].reverse();
    // 设备数据
    request.post("/deviceInteraction/machine/findMachine",{
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        findMachine.value =responseData;
        if (Object.keys(findMachine.value).length === 0){
  if(findMachine.value.remark.toString()!=errorScanId&&findMachine.value.remark.toString()!=""&&findMachine.value.remark.toString()!=undefined){
    //有数据就弹窗 
    if(errorOpen){
@@ -55,32 +72,58 @@
    ElMessageBox.close();
    errorOpen=false;
  }
};
// 定义消息处理函数,更新 receivedData 变量
const handleMessage2 = (data) => {
  downLineTask.value = data.downLineTask[0];
  // console.log(data);
};
onUnmounted(() => {
  if (socket) {
    closeWebSocket(socket);
  }
  if (socketDownLineTask) {
    closeWebSocket(socketDownLineTask);
  }
});
onBeforeUnmount(() => {
  console.log("关闭了")
  closeWebSocket();
    // 线下数据
  } catch (err) {
    console.error('定时请求后端接口失败:', err);
  }
};
/**
 * 启动定时器
 * @param {number} interval - 定时间隔(毫秒,默认500ms,与后端任务频率对齐)
 */
const startTimer = (interval = 500) => {
  // 先清除已有定时器(避免重复创建)
  if (timerId.value) clearInterval(timerId.value);
  // 立即执行一次(避免首次等待间隔)
  fetchMachineData();
  // 创建新定时器
  timerId.value = setInterval(() => {
    fetchMachineData();
  }, interval);
};
/**
 * 清除定时器(避免内存泄漏)
 */
const clearTimer = () => {
  if (timerId.value) {
    clearInterval(timerId.value);
    timerId.value = null; // 重置ID
  }
};
// 组件卸载时清除定时器(关键:避免组件销毁后定时器仍运行)
onUnmounted(() => {
  clearTimer();
});
onMounted(async () => {
  //使用WebSocket方式展示数据
  socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  //使用WebSocket方式展示数据
  socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 初始化 WebSocket,并传递消息处理函数
  startTimer(500); // 500ms 间隔(可根据业务调整,如1000ms)
  // //使用WebSocket方式展示数据
  // socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  // //使用WebSocket方式展示数据
  // socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 初始化 WebSocket,并传递消息处理函数
});
//报警提示
const errorInfoFuntion = async (info) => {
  let infoScancode=info;
UI-Project/src/views/GlueDispenser/glueDispenser.vue
@@ -24,50 +24,82 @@
const userInfo=JSON.parse(window.localStorage.getItem('userInfo'));
const pageParams=userInfo.user.menus[0].pages[8].params;
const pageParamsJson=JSON.parse(pageParams);
console.log(pageParams);
console.log(userInfo.user);
const machineId = pageParamsJson.machineId;//当前页面的设备ID
console.log(machineId);
//使用WebSocket方式展示数据
let socket = null;
let socketDownLineTask = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/glueDispenser`;
const socketDownLineTaskUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/downLineTask`;
// 定义消息处理函数,更新 receivedData 变量
const handleMessage = (data) => {
  // 更新 tableData 的数据
  let dataJson = data[""+machineId][0];
  loadData.value = dataJson.taskingList[0];
  findMachine.value = dataJson.machine[0];
  sendRecords.value = dataJson.sendRecords[0].reverse();
};
// 定义消息处理函数,更新 receivedData 变量
const handleMessage2 = (data) => {
  downLineTask.value = data.downLineTask[0];
  // console.log(data);
};
onUnmounted(() => {
  if (socket) {
    closeWebSocket(socket);
  }
  if (socketDownLineTask) {
    closeWebSocket(socketDownLineTask);
// 新增:定时任务ID(用于清除定时器)
const timerId = ref(null);
/**
 * 单次接口请求函数
 * 作用:调用后端接口,获取数据后交给 handleMessage 处理
 */
const fetchMachineData = async () => {
  try {
    // 任务数据
    request.post("/deviceInteraction/tasking/findMachineTask",{
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        loadData.value =responseData;
  }
});
onBeforeUnmount(() => {
  console.log("关闭了")
  closeWebSocket();
    // 设备数据
    request.post("/deviceInteraction/machine/findMachine",{
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        findMachine.value =responseData;
      }
    });
    // 线下数据
  } catch (err) {
    console.error('定时请求后端接口失败:', err);
  }
};
/**
 * 启动定时器
 * @param {number} interval - 定时间隔(毫秒,默认500ms,与后端任务频率对齐)
 */
const startTimer = (interval = 500) => {
  // 先清除已有定时器(避免重复创建)
  if (timerId.value) clearInterval(timerId.value);
  // 立即执行一次(避免首次等待间隔)
  fetchMachineData();
  // 创建新定时器
  timerId.value = setInterval(() => {
    fetchMachineData();
  }, interval);
};
/**
 * 清除定时器(避免内存泄漏)
 */
const clearTimer = () => {
  if (timerId.value) {
    clearInterval(timerId.value);
    timerId.value = null; // 重置ID
  }
};
// 组件卸载时清除定时器(关键:避免组件销毁后定时器仍运行)
onUnmounted(() => {
  clearTimer();
});
onMounted(async () => {
  //使用WebSocket方式展示数据
  socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  //使用WebSocket方式展示数据
  socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 初始化 WebSocket,并传递消息处理函数
  startTimer(500); // 500ms 间隔(可根据业务调整,如1000ms)
  // //使用WebSocket方式展示数据
  // socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  // //使用WebSocket方式展示数据
  // socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 初始化 WebSocket,并传递消息处理函数
});
//报警提示
const errorInfoFuntion = async (info) => {
UI-Project/src/views/Lamination/lamination.vue
@@ -31,44 +31,92 @@
//const machineId = 21;//当前页面的设备ID
var errorScanId;
var errorOpen=false;
//使用WebSocket方式展示数据
let socket = null;
let socketDownLineTask = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/lamination`;
const socketDownLineTaskUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/downLineTask`;
// 定义消息处理函数,更新 receivedData 变量
const handleMessage = (data) => {
  // 更新 tableData 的数据
  let dataJson = data[""+machineId][0];
  loadData.value = dataJson.taskingList[0];
  findMachine.value = dataJson.machine[0];
  sendRecords.value = dataJson.sendRecords[0].reverse();
};
// 定义消息处理函数,更新 receivedData 变量
const handleMessage2 = (data) => {
  downLineTask.value = data.downLineTask[0];
  // console.log(data);
};
onUnmounted(() => {
  if (socket) {
    closeWebSocket(socket);
  }
  if (socketDownLineTask) {
    closeWebSocket(socketDownLineTask);
// 新增:定时任务ID(用于清除定时器)
const timerId = ref(null);
/**
 * 单次接口请求函数
 * 作用:调用后端接口,获取数据后交给 handleMessage 处理
 */
const fetchMachineData = async () => {
  try {
    // 任务数据
    request.post("/deviceInteraction/tasking/findMachineTask",{
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        loadData.value =responseData;
  }
});
onBeforeUnmount(() => {
  console.log("关闭了")
  closeWebSocket();
    // 设备数据
    request.post("/deviceInteraction/machine/findMachine",{
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        findMachine.value =responseData;
        if (Object.keys(findMachine.value).length === 0){
          if(findMachine.value.remark.toString()!=errorScanId&&findMachine.value.remark.toString()!=""&&findMachine.value.remark.toString()!=undefined){
            //有数据就弹窗
            if(errorOpen){
              ElMessageBox.close();
            }
            errorScanId=findMachine.value.remark.toString();
            errorInfoFuntion(findMachine.value.remark.toString());
            errorOpen=true;
          }else if(findMachine.value.remark.toString()==""&&errorOpen){
            ElMessageBox.close();
            errorOpen=false;
          }
        }
      }
    });
    // 线下数据
  } catch (err) {
    console.error('定时请求后端接口失败:', err);
  }
};
/**
 * 启动定时器
 * @param {number} interval - 定时间隔(毫秒,默认500ms,与后端任务频率对齐)
 */
const startTimer = (interval = 500) => {
  // 先清除已有定时器(避免重复创建)
  if (timerId.value) clearInterval(timerId.value);
  // 立即执行一次(避免首次等待间隔)
  fetchMachineData();
  // 创建新定时器
  timerId.value = setInterval(() => {
    fetchMachineData();
  }, interval);
};
/**
 * 清除定时器(避免内存泄漏)
 */
const clearTimer = () => {
  if (timerId.value) {
    clearInterval(timerId.value);
    timerId.value = null; // 重置ID
  }
};
// 组件卸载时清除定时器(关键:避免组件销毁后定时器仍运行)
onUnmounted(() => {
  clearTimer();
});
onMounted(async () => {
  //使用WebSocket方式展示数据
  socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  //使用WebSocket方式展示数据
  socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 初始化 WebSocket,并传递消息处理函数
  startTimer(500); // 500ms 间隔(可根据业务调整,如1000ms)
  // //使用WebSocket方式展示数据
  // socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  // //使用WebSocket方式展示数据
  // socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 初始化 WebSocket,并传递消息处理函数
});
//报警提示
const errorInfoFuntion = async (info) => {
UI-Project/src/views/ManualReporting/manualReporting.vue
@@ -16,7 +16,7 @@
const blind = ref(false)
const errorInfo = ref(true)
const loadData = ref([]);
const taskinggoruby = ref([]);
const findMachine = ref([]);
const sendRecords = ref([]);
const downLineTask = ref([]);
@@ -31,20 +31,65 @@
console.log(machineId);
var errorScanId;
var errorOpen=false;
//使用WebSocket方式展示数据
let socket = null;
let socketDownLineTask = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/manualReporting`;
const socketDownLineTaskUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/downLineTask`;
// 定义消息处理函数,更新 receivedData 变量
const handleMessage = (data) => {
  // 更新 tableData 的数据
  //taskinggoruby.value = data.taskinggoruby[0];
  //loadData.value =getDataSort(data.taskingList[0]);
  const dataJson = data[""+machineId][0];
  loadData.value = dataJson.taskingList[0];
  findMachine.value = dataJson.machine[0];
// 分组后的统计数据
const taskingGroupBy = ref([]);
// 分组并统计的方法
const groupAndCount = () => {
  // 创建一个临时对象用于分组计数
  const groupMap = {};
  // 遍历原始数据
  loadData.value.forEach(item => {
    // 生成唯一的分组键(组合三个字段)
    const groupKey = `${item.scanId || ''}-${item.batchNumber || ''}-${item.taskType || ''}`;
    // 检查该分组是否已存在
    if (groupMap[groupKey]) {
      // 已存在则数量+1
      groupMap[groupKey].reportCount++;
    } else {
      // 不存在则创建新分组
      groupMap[groupKey] = {
        scanId: item.scanId,
        batchNumber: item.batchNumber,
        taskType: item.taskType,
        taskQuantity: item.taskQuantity,
        reportCount:1
  
      };
    }
  });
  console.log(taskingGroupBy.value);
  // 将对象转换为数组
  taskingGroupBy.value = Object.values(groupMap);
};
// 新增:定时任务ID(用于清除定时器)
const timerId = ref(null);
/**
 * 单次接口请求函数
 * 作用:调用后端接口,获取数据后交给 handleMessage 处理
 */
const fetchMachineData = async () => {
  try {
    // 任务数据
    request.post("/deviceInteraction/tasking/findMachineTask",{
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        loadData.value =responseData;
        groupAndCount();
      }
    });
    // 设备数据
    request.post("/deviceInteraction/machine/findMachine",{
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        findMachine.value =responseData;
        if (Object.keys(findMachine.value).length === 0){
  if(findMachine.value.remark.toString()!=errorScanId&&findMachine.value.remark.toString()!=""&&findMachine.value.remark.toString()!=undefined){
    //有数据就弹窗 
    if(errorOpen){
@@ -57,31 +102,51 @@
    ElMessageBox.close();
    errorOpen=false;
  }
};
// 定义消息处理函数,更新 receivedData 变量
const handleMessage2 = (data) => {
  downLineTask.value = data.downLineTask[0];
  // console.log(data);
};
onUnmounted(() => {
  if (socket) {
    closeWebSocket(socket);
  }
  if (socketDownLineTask) {
    closeWebSocket(socketDownLineTask);
  }
});
onBeforeUnmount(() => {
  console.log("关闭了")
  closeWebSocket();
    // 线下数据
  } catch (err) {
    console.error('定时请求后端接口失败:', err);
  }
};
/**
 * 启动定时器
 * @param {number} interval - 定时间隔(毫秒,默认500ms,与后端任务频率对齐)
 */
const startTimer = (interval = 500) => {
  // 先清除已有定时器(避免重复创建)
  if (timerId.value) clearInterval(timerId.value);
  // 立即执行一次(避免首次等待间隔)
  fetchMachineData();
  // 创建新定时器
  timerId.value = setInterval(() => {
    fetchMachineData();
  }, interval);
};
/**
 * 清除定时器(避免内存泄漏)
 */
const clearTimer = () => {
  if (timerId.value) {
    clearInterval(timerId.value);
    timerId.value = null; // 重置ID
  }
};
// 组件卸载时清除定时器(关键:避免组件销毁后定时器仍运行)
onUnmounted(() => {
  clearTimer();
});
onMounted(async () => {
  //使用WebSocket方式展示数据
  socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  //使用WebSocket方式展示数据
  socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 初始化 WebSocket,并传递消息处理函数
  startTimer(500); // 500ms 间隔(可根据业务调整,如1000ms)
  // //使用WebSocket方式展示数据
  // socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  // //使用WebSocket方式展示数据
  // socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 初始化 WebSocket,并传递消息处理函数
});
//报警提示
const errorInfoFuntion = async (info) => {
@@ -362,7 +427,7 @@
    <div id="main-body" style="min-height:240px;">
      <!-- 表格内容 -->
      <el-table :data="taskinggoruby" stripe
      <el-table :data="taskingGroupBy" stripe
        :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129', textAlign: 'center' }"
        :cell-style="{ textAlign: 'center' }">
        <!-- <el-table-column type="selection" min-width="30" /> -->
@@ -383,13 +448,6 @@
        <el-table-column prop="scanId" :label="$t('glassInfo.scanId')" />
        <el-table-column prop="taskQuantity" :label="$t('glassInfo.taskQuantity')" />
        <el-table-column prop="reportCount" :label="$t('glassInfo.reportCount')" />
        <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270">
          <template #default="scope">
            <el-button size="mini" link type="primary" plain @click="damagedTask(scope.row)">{{ $t('functionState.lose')
              }}</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
UI-Project/src/views/Marking/marking.vue
@@ -24,31 +24,78 @@
const machineId = pageParamsJson.machineId;//当前页面的设备ID
console.log(machineId);
//const machineId=12;//当前页面的设备ID
//使用WebSocket方式展示数据
let socket = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/marking`;
// 定义消息处理函数,更新 receivedData 变量
const handleMessage = (data) => {
  // 更新 tableData 的数据
  let dataJson = data[""+machineId][0];
  loadData.value = dataJson.taskingList[0];
  findMachine.value = dataJson.machine[0];
  sendRecords.value = dataJson.sendRecords[0];
};
onUnmounted(() => {
  if (socket) {
    closeWebSocket(socket);
// 新增:定时任务ID(用于清除定时器)
const timerId = ref(null);
/**
 * 单次接口请求函数
 * 作用:调用后端接口,获取数据后交给 handleMessage 处理
 */
const fetchMachineData = async () => {
  try {
    // 任务数据
    request.post("/deviceInteraction/tasking/findMachineTask",{
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        loadData.value =responseData;
  }
});
onBeforeUnmount(() => {
  console.log("关闭了")
  closeWebSocket();
    // 设备数据
    request.post("/deviceInteraction/machine/findMachine",{
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        findMachine.value =responseData;
      }
    });
    // 线下数据
  } catch (err) {
    console.error('定时请求后端接口失败:', err);
  }
};
/**
 * 启动定时器
 * @param {number} interval - 定时间隔(毫秒,默认500ms,与后端任务频率对齐)
 */
const startTimer = (interval = 500) => {
  // 先清除已有定时器(避免重复创建)
  if (timerId.value) clearInterval(timerId.value);
  // 立即执行一次(避免首次等待间隔)
  fetchMachineData();
  // 创建新定时器
  timerId.value = setInterval(() => {
    fetchMachineData();
  }, interval);
};
/**
 * 清除定时器(避免内存泄漏)
 */
const clearTimer = () => {
  if (timerId.value) {
    clearInterval(timerId.value);
    timerId.value = null; // 重置ID
  }
};
// 组件卸载时清除定时器(关键:避免组件销毁后定时器仍运行)
onUnmounted(() => {
  clearTimer();
});
onMounted(async () => {
  //使用WebSocket方式展示数据
  socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  startTimer(500); // 500ms 间隔(可根据业务调整,如1000ms)
  // //使用WebSocket方式展示数据
  // socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  // //使用WebSocket方式展示数据
  // socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 初始化 WebSocket,并传递消息处理函数
});
//修改工作状态 【失败/正在工作/完工】
const workStatus = async(row,state) => {
UI-Project/src/views/MechanicalArm/mechanicalArm.vue
@@ -6,6 +6,7 @@
import { useI18n } from 'vue-i18n'
import { WebSocketHost, host } from '@/utils/constants'
import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService';
let language = ref(localStorage.getItem('lang') || 'zh')
const { t } = useI18n()
const requestData = reactive({
@@ -30,13 +31,121 @@
const machineId = pageParamsJson.machineId;//当前页面的设备ID
console.log(machineId);
var errorScanId;
// 新增:定时任务ID(用于清除定时器)
const timerId = ref(null);
/**
 * 单次接口请求函数
 * 作用:调用后端接口,获取数据后交给 handleMessage 处理
 */
const fetchMachineData = async () => {
  try {
    // 已领取的任务数据
    request.post("/deviceInteraction/primitiveTask/findMachineTask",{
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        loadData.value = responseData;
      }
    });
    // 线下数据
  } catch (err) {
    console.error('定时请求后端接口【已领取的任务数据】失败:', err);
  }
  try {
    // 可领取的任务数据
    request.post("/deviceInteraction/primitiveTask/findKBBTJPDrawingBP").then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        findPrimitiveTask.value = responseData;
      }
    });
  } catch (err) {
    console.error('定时请求后端接口【可领取的任务数据:客户表】失败:', err);
  }
  try {
    // 设备数据
    request.post("/deviceInteraction/machine/findMachine", {
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        findMachine.value = responseData;
        if (Object.keys(findMachine.value).length === 0) {
          if (findMachine.value.mode == "1") {
            modevalue.value = {
              value: '1',
              label: '标准',
            };
          } else if (findMachine.value.mode == "2") {
            modevalue.value = {
              value: '2',
              label: '定制',
            };
          } else if (findMachine.value.mode == "3") {
            modevalue.value = {
              value: '3',
              label: '手动',
            };
          }
        }
      }
    });
  } catch (err) {
    console.error('定时请求后端接口失败【设备数据】:', err);
  }
};
/**
 * 启动定时器
 * @param {number} interval - 定时间隔(毫秒,默认500ms,与后端任务频率对齐)
 */
const startTimer = (interval = 500) => {
  // 先清除已有定时器(避免重复创建)
  if (timerId.value) clearInterval(timerId.value);
  // 立即执行一次(避免首次等待间隔)
  fetchMachineData();
  // 创建新定时器
  timerId.value = setInterval(() => {
    fetchMachineData();
  }, interval);
};
/**
 * 清除定时器(避免内存泄漏)
 */
const clearTimer = () => {
  if (timerId.value) {
    clearInterval(timerId.value);
    timerId.value = null; // 重置ID
  }
};
// 组件卸载时清除定时器(关键:避免组件销毁后定时器仍运行)
onUnmounted(() => {
  clearTimer();
});
onMounted(async () => {
  startTimer(500); // 500ms 间隔(可根据业务调整,如1000ms)
  // //使用WebSocket方式展示数据
  // socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  // //使用WebSocket方式展示数据
  // socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 初始化 WebSocket,并传递消息处理函数
});
//使用WebSocket方式展示数据
let socket = null;
let socketDownLineTask = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/loadTask`;
const socketDownLineTaskUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/downLineTask`;
// 定义消息处理函数,更新 receivedData 变量
const handleMessage = (data) => {
@@ -89,38 +198,6 @@
  socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 初始化 WebSocket,并传递消息处理函数
  
});
//报警提示
const errorInfoFuntion = async (info) => {
  let infoScancode = '扫码ID:' + info.scanId + '  ' + info.scanCode;
  ElMessageBox.confirm(
    infoScancode,
    t('delivery.prompt'),
    {
      confirmButtonText: t('functionState.sureStart'),
      cancelButtonText: t('functionState.cancel'),
      type: 'warning',
    }
  )
    .then(() => {
      //重新补单
      request.post("/deviceInteraction/tasking/glassAgainTopLine",
        {
          "scanId": info.scanId,
        }).then((res) => { // 替换为你的API端点
          if (res.code === 200) {
            ElMessage.success(res.message);
          } else {
            ElMessage.warning(res.message)
          }
        })
    })
    .catch(() => {
      ElMessage({
        type: 'info',
        message: t('functionState.cancel'),
      })
    })
}
//修改工作状态 【失败/正在工作/完工】
const workStatus = async (row, state) => {
  let url;
@@ -431,7 +508,9 @@
        <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="70">
          <template #default="scope">
            <el-button size="small" link type="primary" plain @click="startOrStopTask(scope.row, findMachine.id, 1)">{{
              $t('functionState.getTask') }}</el-button>
                $t('functionState.getTask')
              }}
            </el-button>
          </template>
        </el-table-column>
      </el-table>
@@ -444,7 +523,8 @@
      </div>
      <div>
        手动输入上片数量:
        <el-input v-model="blindModeNumberLocal" style="width: 200px;" type="Number" id="blindMode" @keyup.enter="fetchSubmit"></el-input>
        <el-input v-model="blindModeNumberLocal" style="width: 200px;" type="Number" id="blindMode"
                  @keyup.enter="fetchSubmit"></el-input>
        
      </div>
      <!-- <div>
@@ -464,16 +544,23 @@
        </el-select>
        
        <span>
          <span @click="modeShow" style="margin-left: 40px;">{{ findMachine.mode=="3"? ("上片数量:"+findMachine.taskCount):"" }}</span>
          <span style="margin-left: 40px;">{{ findMachine.mode=="3"? ("已完成数量:"+findMachine.finshCount):"" }}</span>
          <span @click="modeShow" style="margin-left: 40px;">{{
              findMachine.mode == "3" ? ("上片数量:" + findMachine.taskCount) : ""
            }}</span>
          <span style="margin-left: 40px;">{{
              findMachine.mode == "3" ? ("已完成数量:" + findMachine.finshCount) : ""
            }}</span>
        </span>
        
        
      </div>
      <br>
      <el-button :type="(findMachine['state'] == '暂停' ? 'danger' : 'success')" id="ButtonMachineStatus"
        @click="machineStatus((findMachine['state'] == '暂停' ? '开工' : '暂停'))">{{ findMachine['state'] == '开工' ?
        $t('functionState.start') : $t('functionState.stop') }}</el-button>
                 @click="machineStatus((findMachine['state'] == '暂停' ? '开工' : '暂停'))">{{
          findMachine['state'] == '开工' ?
              $t('functionState.start') : $t('functionState.stop')
        }}
      </el-button>
      <el-button type="primary" id="ButtonTopLine" @click="topLineShow">{{ $t('functionState.getTask') }}</el-button>
    </div>
@@ -519,7 +606,9 @@
        <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270">
          <template #default="scope">
            <el-button size="mini" link type="primary" plain @click="startOrStopTask(scope.row, 2, 2)">{{
              $t('functionState.stopTask') }}</el-button>
                $t('functionState.stopTask')
              }}
            </el-button>
          </template>
        </el-table-column>
      </el-table>
UI-Project/src/views/Rotate/rotate.vue
@@ -29,20 +29,35 @@
//const machineId = 20;//当前页面的设备ID
var errorScanId;
var errorOpen=false;
//使用WebSocket方式展示数据
let socket = null;
let socketDownLineTask = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/rotate`;
const socketDownLineTaskUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/downLineTask`;
// 定义消息处理函数,更新 receivedData 变量
const handleMessage = (data) => {
  // 更新 tableData 的数据
  let dataJson = data[""+machineId][0];
// 新增:定时任务ID(用于清除定时器)
  loadData.value = dataJson.taskingList[0];
  findMachine.value = dataJson.machine[0];
  sendRecords.value = dataJson.sendRecords[0].reverse();
const timerId = ref(null);
/**
 * 单次接口请求函数
 * 作用:调用后端接口,获取数据后交给 handleMessage 处理
 */
const fetchMachineData = async () => {
  try {
    // 任务数据
    request.post("/deviceInteraction/tasking/findMachineTask",{
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        loadData.value =responseData;
      }
    });
  
    // 设备数据
    request.post("/deviceInteraction/machine/findMachine",{
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        findMachine.value =responseData;
        if (Object.keys(findMachine.value).length === 0){
  if(findMachine.value.remark.toString()!=errorScanId&&findMachine.value.remark.toString()!=""&&findMachine.value.remark.toString()!=undefined){
    //有数据就弹窗 
    if(errorOpen){
@@ -55,31 +70,52 @@
    ElMessageBox.close();
    errorOpen=false;
  }
};
// 定义消息处理函数,更新 receivedData 变量
const handleMessage2 = (data) => {
  downLineTask.value = data.downLineTask[0];
  // console.log(data);
};
onUnmounted(() => {
  if (socket) {
    closeWebSocket(socket);
  }
  if (socketDownLineTask) {
    closeWebSocket(socketDownLineTask);
  }
});
onBeforeUnmount(() => {
  console.log("关闭了")
  closeWebSocket();
    // 线下数据
  } catch (err) {
    console.error('定时请求后端接口失败:', err);
  }
};
/**
 * 启动定时器
 * @param {number} interval - 定时间隔(毫秒,默认500ms,与后端任务频率对齐)
 */
const startTimer = (interval = 500) => {
  // 先清除已有定时器(避免重复创建)
  if (timerId.value) clearInterval(timerId.value);
  // 立即执行一次(避免首次等待间隔)
  fetchMachineData();
  // 创建新定时器
  timerId.value = setInterval(() => {
    fetchMachineData();
  }, interval);
};
/**
 * 清除定时器(避免内存泄漏)
 */
const clearTimer = () => {
  if (timerId.value) {
    clearInterval(timerId.value);
    timerId.value = null; // 重置ID
  }
};
// 组件卸载时清除定时器(关键:避免组件销毁后定时器仍运行)
onUnmounted(() => {
  clearTimer();
});
onMounted(async () => {
  //使用WebSocket方式展示数据
  socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  //使用WebSocket方式展示数据
  socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 初始化 WebSocket,并传递消息处理函数
  startTimer(500); // 500ms 间隔(可根据业务调整,如1000ms)
  // //使用WebSocket方式展示数据
  // socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  // //使用WebSocket方式展示数据
  // socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 初始化 WebSocket,并传递消息处理函数
});
//报警提示
const errorInfoFuntion = async (info) => {
UI-Project/src/views/SilkScreen/SilkScreen.vue
@@ -24,30 +24,92 @@
const machineId = pageParamsJson.machineId;//当前页面的设备ID
console.log(machineId);
//const machineId=14;//当前页面的设备ID
//使用WebSocket方式展示数据
let socket = null;
const socketUrl = `ws://${WebSocketHost}:${host}/api/deviceInteraction/api/talk/silkScreenTask`;
// 定义消息处理函数,更新 receivedData 变量
const handleMessage = (data) => {
  // 更新 tableData 的数据
  let dataJson = data[""+machineId][0];
  loadData.value = dataJson.taskingList[0];
  findMachine.value = dataJson.machine[0];
  sendRecords.value = dataJson.sendRecords[0];
};
onUnmounted(() => {
  if (socket) {
    closeWebSocket(socket);
// 新增:定时任务ID(用于清除定时器)
const timerId = ref(null);
/**
 * 单次接口请求函数
 * 作用:调用后端接口,获取数据后交给 handleMessage 处理
 */
const fetchMachineData = async () => {
  try {
    // 任务数据
    request.post("/deviceInteraction/tasking/findMachineTask",{
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        loadData.value =responseData;
  }
});
onBeforeUnmount(() => {
  console.log("关闭了")
  closeWebSocket();
    // 设备数据
    request.post("/deviceInteraction/machine/findMachine",{
      "id": machineId
    }).then((res) => { // 替换为你的API端点
      if (res.code === 200) {
        // 假设后端返回的数据格式与 handleMessage 预期一致
        const responseData = res.data || {};
        findMachine.value =responseData;
        if (Object.keys(findMachine.value).length === 0){
          if(findMachine.value.remark.toString()!=errorScanId&&findMachine.value.remark.toString()!=""&&findMachine.value.remark.toString()!=undefined){
            //有数据就弹窗
            if(errorOpen){
              ElMessageBox.close();
            }
            errorScanId=findMachine.value.remark.toString();
            errorInfoFuntion(findMachine.value.remark.toString());
            errorOpen=true;
          }else if(findMachine.value.remark.toString()==""&&errorOpen){
            ElMessageBox.close();
            errorOpen=false;
          }
        }
      }
    });
    // 线下数据
  } catch (err) {
    console.error('定时请求后端接口失败:', err);
  }
};
/**
 * 启动定时器
 * @param {number} interval - 定时间隔(毫秒,默认500ms,与后端任务频率对齐)
 */
const startTimer = (interval = 500) => {
  // 先清除已有定时器(避免重复创建)
  if (timerId.value) clearInterval(timerId.value);
  // 立即执行一次(避免首次等待间隔)
  fetchMachineData();
  // 创建新定时器
  timerId.value = setInterval(() => {
    fetchMachineData();
  }, interval);
};
/**
 * 清除定时器(避免内存泄漏)
 */
const clearTimer = () => {
  if (timerId.value) {
    clearInterval(timerId.value);
    timerId.value = null; // 重置ID
  }
};
// 组件卸载时清除定时器(关键:避免组件销毁后定时器仍运行)
onUnmounted(() => {
  clearTimer();
});
onMounted(async () => {
  //使用WebSocket方式展示数据
  socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  startTimer(500); // 500ms 间隔(可根据业务调整,如1000ms)
  // //使用WebSocket方式展示数据
  // socket = initializeWebSocket(socketUrl, handleMessage);// 初始化 WebSocket,并传递消息处理函数
  // //使用WebSocket方式展示数据
  // socketDownLineTask = initializeWebSocket(socketDownLineTaskUrl, handleMessage2);// 初始化 WebSocket,并传递消息处理函数
});
//修改工作状态 【失败/正在工作/完工】
const workStatus = async(row,state) => {