-
admin
2024-05-10 1c84aef7b3d88ce9f2ac5d3173f892a1cd727800
jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
@@ -313,4 +313,43 @@
            daParamCollectionMapper.insertDaParamCollection(saveData);
        });
    }
    @Override
    public void jrmSaveCampaignTimeParameters(DaParamCollection daParamCollection) {
        DaCollectionParamConf daCollectionParamConf = new DaCollectionParamConf();
        daCollectionParamConf.setProcessesCode(daParamCollection.getLocationCode());
        daCollectionParamConf.setCollectParameterId("OUTT");
        List<DaCollectionParamConf> daCollectionParamConfs = daCollectionParamConfMapper.selectDaCollectionParamConfList(daCollectionParamConf);
        DaParamCollection saveData = new DaParamCollection();
        saveData.setWorkOrderNo(daParamCollection.getWorkOrderNo());
        saveData.setProductCode(daParamCollection.getProductCode());
        saveData.setLocationCode(daParamCollection.getLocationCode());
        saveData.setSfcCode(daParamCollection.getProductBarcode());
        saveData.setParamCode(daCollectionParamConfs.get(0).getCollectParameterId());
        saveData.setParamName(daCollectionParamConfs.get(0).getCollectParameterName());
        saveData.setCollectionTime(new Date());
        saveData.setParamValue(DateUtil.formatDateTime(new Date()));
        daParamCollectionMapper.insertDaParamCollection(saveData);
        //更新过站记录表出站时间
        DaPassingStationCollection daPassingStationCollection = new DaPassingStationCollection();
        daPassingStationCollection.setWorkOrderNo(daParamCollection.getWorkOrderNo());
        daPassingStationCollection.setLocationCode(daParamCollection.getLocationCode());
        List<DaPassingStationCollection> daPassingStationCollections = daPassingStationCollectionMapper.selectDaPassingStationCollectionList(daPassingStationCollection);
        daPassingStationCollections.get(0).setOutboundTime(new Date());
        int i = daPassingStationCollectionMapper.updateDaPassingStationCollection(daPassingStationCollections.get(0));
//                OPCUaSubscription.SaveParamData(daParamCollection.getProductBarcode(),"OP",daParamCollection.getLocationCode(),daParamCollection.getWorkOrderNo(),daParamCollection.getProductCode());
        //给opc发21
        try {
//            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+daParamCollection.getLocationCode()+".RecordDataDone").value(21).build());
            String strA = daParamCollection.getLocationCode() + "A";
            String strB = daParamCollection.getLocationCode() + "B";
            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+strA+".RecordDataDone").value(21).build());
            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier("PACK."+strB+".RecordDataDone").value(21).build());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}