From 1eac7ccd54e628a324898400ac6d65a3280b1172 Mon Sep 17 00:00:00 2001 From: fyf Date: Wed, 13 Sep 2023 10:16:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0PLC=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/example/bpa/MainActivity.java | 18 ++++++++--------- .../com/example/bpa/service/OrderServer.java | 2 +- .../bpa/view/adapter/maingoods_adapter.java | 20 +++++++++---------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/com/example/bpa/MainActivity.java b/app/src/main/java/com/example/bpa/MainActivity.java index 3f70301..eaa31be 100644 --- a/app/src/main/java/com/example/bpa/MainActivity.java +++ b/app/src/main/java/com/example/bpa/MainActivity.java @@ -530,15 +530,15 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen ResGoodsMake statusMode = DataBus.getInstance().GoodsSMMake.get(0); -// if (!DataBus.getInstance().PlcIsConnect) { -// T.show(this, "PLC未连接,不允许制作!"); -// return; -// } -// -// if (BusinessServer.Get().Commoditys.size() > 0) { -// T.show(this, "请等待前一饮品制作完成!"); -// return; -// } + if (!DataBus.getInstance().PlcIsConnect) { + T.show(this, "PLC未连接,不允许制作!"); + return; + } + + if (BusinessServer.Get().Commoditys.size() > 0) { + T.show(this, "请等待前一饮品制作完成!"); + return; + } // 1.创建弹框对象,显示在当前页面 AlertDialog.Builder ab = new AlertDialog.Builder(this); diff --git a/app/src/main/java/com/example/bpa/service/OrderServer.java b/app/src/main/java/com/example/bpa/service/OrderServer.java index 3da76a9..4182851 100644 --- a/app/src/main/java/com/example/bpa/service/OrderServer.java +++ b/app/src/main/java/com/example/bpa/service/OrderServer.java @@ -379,7 +379,7 @@ public class OrderServer { { da.id=java.util.UUID.randomUUID().toString(); da.materialID = a.BatchingId; - da.value =String.format ("%.1f", a.ActionValue); + da.value =String.format ("%.1f", Double.parseDouble(a.ActionValue)); da.sort =Integer.parseInt(actions.Sort); QueryDB.AddGoodsSrecipe(da); } diff --git a/app/src/main/java/com/example/bpa/view/adapter/maingoods_adapter.java b/app/src/main/java/com/example/bpa/view/adapter/maingoods_adapter.java index 3465395..01fb7b1 100644 --- a/app/src/main/java/com/example/bpa/view/adapter/maingoods_adapter.java +++ b/app/src/main/java/com/example/bpa/view/adapter/maingoods_adapter.java @@ -129,16 +129,16 @@ public class maingoods_adapter extends RecyclerView.Adapter 0) { -// T.show(view.getContext(), "请等待前一饮品制作完成!"); -// return; -// } + if(!DataBus.getInstance().PlcIsConnect) + { + T.show(view.getContext(),"PLC未连接,不允许下单!"); + return; + } + + if (BusinessServer.Get().Commoditys.size() > 0) { + T.show(view.getContext(), "请等待前一饮品制作完成!"); + return; + } BPA_ORDER order=new BPA_ORDER(); order.thirdPartyID="手动下单";