admin
2024-07-09 4e83fa344f6cba81412fb354e7f32a88a8f34fde
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -48,29 +48,36 @@
    private static final Logger logger = LoggerFactory.getLogger("sys-user");
    public SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    //新自动工站
    public List<String> automaticList = Arrays.asList("OP280","OP310A","OP310B", "OP300A","OP300B", "OP320A","OP320B", "OP340A","OP340B", "OP350A","OP350B", "OP360","OP365","OP370", "OP390", "OP470");
    public List<String> automaticList = Arrays.asList("POP270","POP282", "POP281", "POP283", "POP285", "POP286", "POP290","OP365","POP300", "POP320", "POP400");
    //采集模组工位 ModuleCode
    public List<String> moduleCodeList = Arrays.asList("OP300A","OP310A","OP310B","OP300B","OP320A","OP320B","OP340A","OP340B","OP365", "OP350A", "OP350B", "OP330");
    //区分模组型号工位
    public List<String> distinguishingModules = Arrays.asList("OP300","OP310", "OP340", "OP350", "OP330");
    public List<String> moduleCodeList = Arrays.asList("POP281","POP282","POP283","POP285","OP365", "POP286", "POP284");
    //区分小车码
    public List<String> agvId = Arrays.asList("OP360", "OP390", "OP470","OP280");
    //区分pack型号的工位
    public List<String> packIdList = Arrays.asList("OP280","OP360","OP390","OP470");
    public List<String> agvId = Arrays.asList("POP290", "POP320", "POP400","POP270");
    //测试设备手动工位
    public List<String> testList = Arrays.asList("OP430-1","OP430-2","OP430-3","OP430-4","OP480-1","OP480-2","OP480-3","OP440");
    public List<String> testList = Arrays.asList("POP360-1","POP360-2","POP360-3","POP360-4","POP410-1","POP410-2","POP410-3","POP370","POP420-1","POP420-2","POP420-3");
    //空的
    public List<String> nullList = Arrays.asList("OP250","OP260");
//    //新自动工站
//    public List<String> automaticList = Arrays.asList("OP280","OP310A","OP310B", "OP300A","OP300B", "OP320A","OP320B", "OP340A","OP340B", "OP350A","OP350B", "OP360","OP365","OP370", "OP390", "OP470");
//
//    //采集模组工位 ModuleCode
//    public List<String> moduleCodeList = Arrays.asList("OP300A","OP310A","OP310B","OP300B","OP320A","OP320B","OP340A","OP340B","OP365", "OP350A", "OP350B", "OP330");
//
//    //区分小车码
//    public List<String> agvId = Arrays.asList("OP360", "OP390", "OP470","OP280");
//
//    //测试设备手动工位
//    public List<String> testList = Arrays.asList("OP430-1","OP430-2","OP430-3","OP430-4","OP480-1","OP480-2","OP480-3","OP440");
//
//
//    //空的
//    public List<String> nullList = Arrays.asList("OP250","OP260");
    public static MiloService miloService;
@@ -219,7 +226,7 @@
//                                }
//
//                                if (deviceInterfaceOne != null && "1".equals(deviceInterfaceOne.getTotalResult())) {
//                                    writeToOpc(RecordDataDoneAddress, (short) 21);
//                                writeToOpcShort(RecordDataDoneAddress, (short) 21);
//                                } else {
//                                    writeToOpc(RecordDataDoneAddress, (short) 22);
//                                }
@@ -233,8 +240,8 @@
                    }
                }
                //保存拧紧数据
                else if (("AngleResult").equals(tab)) {
                    if("1".equals(tabVlaue)||"2".equals(tabVlaue)){
                else if (("TighteningFrequency").equals(tab)) {
                    if(!"0".equals(tabVlaue)){
                        List<String> list = new ArrayList<>();
                        String[] suffixes = {"Torque", "Angle", "TorqueResult", "AngleResult"};
@@ -246,9 +253,7 @@
                        List<Object> collect = list1.stream().map(ReadWriteEntity::getValue).collect(Collectors.toList());
                        String joinedString = String.join(",", collect.toString());
                        WebSocketUsers.sendMessageToUserByText(map.get(device), TightenTheConversionOkNg(joinedString));
                        if(device.contains("270") || device.contains("260")){
                            logger.info("读取到工位{}的Scaner数据:{}",device,TightenTheConversionOkNg(joinedString));
                        }
                        logger.info("读取到工位{}的Scaner数据:{}",device,TightenTheConversionOkNg(joinedString));
                    }
                }
            }
@@ -316,7 +321,7 @@
                    List<DaParamCollection> daParamCollectionList = SaveParamData(snCode,thoroughfare,device,workOrderNo,productCode);
                    //如果是末尾工站要报工
                    if(device.equals("OP500")){
                    if(device.equals("POP430")){
                        RestfulService.getWorkReportResultFeedback(snCode,device,format.format(new Date()));
                        //1、更新工单信息
                        updateOrderInfo(snCode);
@@ -611,7 +616,7 @@
        }
    }
    private static void writeToOpc(String identifier, short value) {
    private static void writeToOpcShort(String identifier, short value) {
        try {
            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(identifier).value(value).build());
        } catch (Exception e) {