wujian
2024-03-28 1e39c55183c1f54d1587bf3a86b4c2210bcd592e
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -24,7 +24,7 @@
public class OPCUaSubscription implements SubscriptionCallback {
    //自动工位
    public List<String> automaticList = Arrays.asList("OP230","OP300","OP280", "OP320", "OP340", "OP350", "OP360","OP370", "OP390", "OP470", "OP530", "OP540");
    public List<String> automaticList = Arrays.asList("OP300","OP280", "OP320", "OP340", "OP350", "OP360","OP370", "OP390", "OP470", "OP530", "OP540");
    public static MiloService miloService;
@@ -32,9 +32,9 @@
    public IDaPassingStationCollectionService daPassingStationCollectionService;
    public IDaCollectionParamConfService collectionParamConfService;
    public static IDaCollectionParamConfService collectionParamConfService;
    public IDaParamCollectionService daParamCollectionService;
    public static IDaParamCollectionService daParamCollectionService;
    public OPCUaSubscription(MiloService miloService,
                             IDaPassingStationCollectionService daPassingStationCollectionService,
@@ -110,15 +110,6 @@
                //保存拧紧数据
                else if (("AngleResult").equals(tab)) {
                    if("1".equals(tabVlaue)||"2".equals(tabVlaue)){
//                        String Torque = thoroughfare + "." + device + ".Torque";
//                        String Angle = thoroughfare + "." + device + ".Angle";
//                        String Result = thoroughfare + "." + device + ".Result";
//                        String Result1 = thoroughfare + "." + device + ".Result1";
//                        List<String> list = new ArrayList();
//                        list.add(Torque);
//                        list.add(Angle);
//                        list.add(Result);
//                        list.add(Result1);
                        List<String> list = new ArrayList<>();
                        String[] suffixes = {"Torque", "Angle", "Result", "Result1"};
@@ -167,7 +158,7 @@
                //2、保存过站采集数据
                saveStationInfo(PACKCodeParam,thoroughfare,device);
                //3、保存参数采集数据
                SaveParamData(PACKCodeParam,thoroughfare,device);
                SaveParamData(PACKCodeParam,thoroughfare,device,"","");
                result = "21";
@@ -198,7 +189,7 @@
        daPassingStationCollectionService.insertDaPassingStationCollection(daPassingStationCollection);
    }
    public void SaveParamData(String packCode,String thoroughfare,String device) throws Exception {
    public static void SaveParamData(String packCode,String thoroughfare,String device,String workOrderNo,String productType) throws Exception {
        List<DaCollectionParamConf> list;
        DaCollectionParamConf daCollectionParamConf = new DaCollectionParamConf();
        daCollectionParamConf.setGatherAddress(thoroughfare+ "." + device);
@@ -227,10 +218,13 @@
                    //ParamCollection.setState("合格");
                    ParamCollection.setType(list.get(i).getCollectParameterType());
                    ParamCollection.setCollectionTime(new Date());
                    daParamCollectionService.insertDaParamCollection(ParamCollection);
                    ParamCollection.setWorkOrderNo(workOrderNo);
                    ParamCollection.setProductCode(productType);
                    daParamCollectionlist.add(ParamCollection);
//                    daParamCollectionService.insertDaParamCollection(ParamCollection);
                }
            }
    //            daParamCollectionService.saveBeachDaParamCollection(daParamCollectionlist);
            daParamCollectionService.saveBeachDaParamCollection(daParamCollectionlist);
        }
    }