cl
2024-08-13 6435ce6cf62b75541e9e1455b89d199125ca792d
修改采集参数
已修改1个文件
25 ■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -167,12 +167,24 @@
                                    if (ObjectUtil.isNotNull(stationStatusObjcet)) {
                                        String stationStatus = stationStatusObjcet.toString();
                                        if (Constants.OP010.equals(device)) {
                                            CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
                                                updateOrderStatus(snCode, "3");//OP010工位更新工单状态为执行中
                                                reportFactoryMes(snCode, device, format.format(new Date()));//工厂MES报工
                                            });
                                            Object housingCodeObjcet = miloService.readFromOpcUa(thoroughfare + "." + device + ".HousingCode").getValue();//壳体条码,存到工单,返修用
                                            if (ObjectUtil.isNull(housingCodeObjcet)){
                                                result = 25;
                                            }else{
                                                String housingCode = housingCodeObjcet.toString();//壳体条码,存到工单,返修用
                                                if(housingCode.length()<10){
                                                    result = 25;
                                                }else{
                                                    CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
                                                        updateOrderStatus(snCode, "3",housingCode);//OP010工位更新工单状态为执行中,并更新主物料壳体条码
                                                        reportFactoryMes(snCode, device, format.format(new Date()));//工厂MES报工
                                                    });
                                                }
                                            }
                                        }
                                        result = savePassingStation(thoroughfare, device, snCode, orderNumber, stationStatus);//保存过站
                                        if(result == 21){
                                            result = savePassingStation(thoroughfare, device, snCode, orderNumber, stationStatus);//保存过站
                                        }
                                        if (result == 21) {
                                            result = saveParamCollection(device, snCode, orderNumber, stationStatus);//保存参数,发送工厂MES
                                        }
@@ -414,11 +426,12 @@
     * @param orderStatus 工单状态
     * @throws Exception e
     */
    private static void updateOrderStatus(String snCode,String orderStatus){
    private static void updateOrderStatus(String snCode,String orderStatus,String materialCode){
        try {
            //更新工单状态为已执行
            LambdaUpdateWrapper<OmProductionOrdeInfo> updateWrapper = new LambdaUpdateWrapper<>();
            updateWrapper.set(OmProductionOrdeInfo::getOrderStatus,orderStatus);
            updateWrapper.set(OmProductionOrdeInfo::getMaterialCode,materialCode);
            updateWrapper.eq(OmProductionOrdeInfo::getProductNum,snCode);
            omProductionOrdeInfoService.update(new OmProductionOrdeInfo(),updateWrapper);
        } catch (Exception e) {