cl
2024-07-12 ab63141eaf175c6c544d2ef37833dea9016d0d26
修改参数采集
已修改2个文件
13 ■■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/om/productionOrde/controller/OmProductionOrdeInfoController.java
@@ -141,7 +141,7 @@
        if(code.equals("success")){
            logger.info("请求工厂MES工单:入参pack{}出参pack:{}",paramProductNum,dataObject.getStr("productNum"));
            List<OmProductionOrdeInfo> check = omProductionOrdeInfoService.list(new LambdaQueryWrapper<OmProductionOrdeInfo>().eq(OmProductionOrdeInfo::getProductNum,dataObject.getStr("productNum")));
            if(check.size() == 0){
            if(check.isEmpty()){
                try {
                    log.info("请求工厂MES工单:入参pack{}出参pack:{}", paramProductNum, dataObject.getStr("productNum"));
                    OmProductionOrdeInfo omProductionOrdeInfo = new OmProductionOrdeInfo();
@@ -156,12 +156,15 @@
                    omProductionOrdeInfo.setCreateTime(new Date());
                    omProductionOrdeInfo.setCreateUser("工厂MES");
                    omProductionOrdeInfoService.save(omProductionOrdeInfo);
                    //写PLC
                    miloService.writeToOpcUa(ReadWriteEntity.builder().identifier("MOZU1." + paramOrder.getLineCode() + ".MES_WorkOrderNumber").value(dataObject.getStr("productionOrderNum")).build());
                    miloService.writeToOpcUa(ReadWriteEntity.builder().identifier("MOZU1." + paramOrder.getLineCode() + ".MES_ModuleCode").value(dataObject.getStr("productNum")).build());
                    miloService.writeToOpcUa(ReadWriteEntity.builder().identifier("MOZU1." + paramOrder.getLineCode() + ".WorkOrderNumber").value(dataObject.getStr("productionOrderNum")).build());
                    miloService.writeToOpcUa(ReadWriteEntity.builder().identifier("MOZU1." + paramOrder.getLineCode() + ".ModuleCode").value(dataObject.getStr("productNum")).build());
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }else{
                return AjaxResult.error("工单重复,请重新接收");
            }
        }else {
            return AjaxResult.error("接单失败,请联系管理员");
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -292,8 +292,8 @@
                WebSocketUsers.sendMessageToUserByText(map.get(device), dataObject.getStr("productNum"));
                //写PLC
                miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".MES_ModuleCode").value(dataObject.getStr("productNum")).build());
                miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".MES_WorkOrderNumber").value(dataObject.getStr("productionOrderNum")).build());
                miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".ModuleCode").value(dataObject.getStr("productNum")).build());
                miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".WorkOrderNumber").value(dataObject.getStr("productionOrderNum")).build());
            }
        } catch (Exception e) {