-
admin
2024-06-06 019f1c8bac7e8986d299aff70c123dedc1747d72
-
已修改3个文件
92 ■■■■ 文件已修改
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/doman/RestFulOrder.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
jcdm-main/src/main/java/com/jcdm/main/plcserver/sub/OPCUaSubscription.java
@@ -279,51 +279,53 @@
                    read = read + "ModuleCode";
                    if(device.equals("OP365")){
                        try {
                            result = saveStationInfo365(thoroughfare,device);
                            return result;
//                            result = saveStationInfo365(thoroughfare,device);
//                            return result;
                            saveStationInfo365(thoroughfare,device);
//                            return result;
                        }catch (Exception e){
                            e.printStackTrace();
                        }
                    }
                }else {
                    read = read + "PACKCode";
                    snCode = miloService.readFromOpcUa(read).getValue().toString();
                    if(null == snCode || "".equals(snCode)){
                        result = "22";
                    }else{
                        String workOrderNo = "";
                        String productCode = "";
                        //2、保存过站采集数据
                        Object orderNumberObject = miloService.readFromOpcUa(thoroughfare + "." + device + "." + "WorkOrderNumber").getValue();
                        if(orderNumberObject!=null){
                            workOrderNo = orderNumberObject.toString();
                        }
                        Object productCodeObject = miloService.readFromOpcUa(thoroughfare + "." + device + "." + "ProductType").getValue();
                        if(productCodeObject!=null){
                            productCode = productCodeObject.toString();
                        }
                        saveStationInfo(snCode,thoroughfare,device,workOrderNo,productCode);
                        //3、保存参数采集数据
                        SaveParamData(snCode,thoroughfare,device,workOrderNo,productCode);
                        //如果是末尾工站要报工
                        if(device.equals("OP500")){
                            RestfulService.getWorkReportResultFeedback(snCode,device,format.format(new Date()));
                            //1、更新工单信息
                            updateOrderInfo(snCode);
                        }
                        try{
                            daParamCollectionService.pushGeelycvMesFeedback(snCode,device);
                        }catch (Exception e){
                        }
                        result = "21";
                    }
                }
            }
            snCode = miloService.readFromOpcUa(read).getValue().toString();
            if(null == snCode || "".equals(snCode)){
                result = "22";
            }else{
                String workOrderNo = "";
                String productCode = "";
                //2、保存过站采集数据
                Object orderNumberObject = miloService.readFromOpcUa(thoroughfare + "." + device + "." + "WorkOrderNumber").getValue();
                if(orderNumberObject!=null){
                    workOrderNo = orderNumberObject.toString();
                }
                Object productCodeObject = miloService.readFromOpcUa(thoroughfare + "." + device + "." + "ProductType").getValue();
                if(productCodeObject!=null){
                    productCode = productCodeObject.toString();
                }
                saveStationInfo(snCode,thoroughfare,device,workOrderNo,productCode);
                //3、保存参数采集数据
                SaveParamData(snCode,thoroughfare,device,workOrderNo,productCode);
                //如果是末尾工站要报工
                if(device.equals("OP500")){
                    RestfulService.getWorkReportResultFeedback(snCode,device,format.format(new Date()));
                    //1、更新工单信息
                    updateOrderInfo(snCode);
                }
                try{
                    daParamCollectionService.pushGeelycvMesFeedback(snCode,device);
                }catch (Exception e){
                }
                result = "21";
            }
@@ -553,7 +555,7 @@
    /**
     * 保存过站采集
     */
    public String saveStationInfo365(String thoroughfare,String device) throws Exception {
    public void saveStationInfo365(String thoroughfare,String device) throws Exception {
        String RecordDataDoneAddress = thoroughfare + "." + device + ".RecordDataDone";
        String prefix = thoroughfare+"."+device+".";
        List<DaPassingStationCollection> passingStationCollections = new ArrayList<>();
@@ -590,11 +592,11 @@
                passingStationCollections.add(daPassingStationCollection);
            }
            daPassingStationCollectionService.saveBeachDaPassingStationCollection(passingStationCollections);
            //miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(21).build());
            return "21";
            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(21).build());
//            return "21";
        }else {
            //miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(22).build());
            return "22";
            miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(RecordDataDoneAddress).value(22).build());
//            return "22";
        }
    }
jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/doman/RestFulOrder.java
@@ -9,4 +9,5 @@
    private String materialCode;
    private String productionOrderNum;
    private Long planQty;
    private String createTime;
}
jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java
@@ -37,6 +37,8 @@
@RestController
@RequestMapping("/jcdmMes")
public class ExternalInterface {
    public SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    @Autowired
    private IDaTestDeviceInterfaceService daTestDeviceInterfaceService;
    @Autowired
@@ -176,6 +178,7 @@
            order.setMaterialCode(omProductionOrdeInfo.getMaterialCode());
            order.setStationCode(omProductionOrdeInfo.getStationCode());
            order.setPlanQty(omProductionOrdeInfo.getPlanQty());
            order.setCreateTime(format.format(omProductionOrdeInfo.getCreateTime()));
            restFulOrders.add(order);
        }
        return AjaxResult.success(restFulOrders);