From ce5772be030c03a502fe2b0afe99bd36bccfd73f Mon Sep 17 00:00:00 2001
From: liup <1454939542@qq.com>
Date: Fri, 27 Dec 2024 17:50:07 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E5=8D=95=E6=B5=81?=
=?UTF-8?q?=E7=A8=8B=E7=9B=B8=E5=85=B3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.idea/other.xml | 340 ++++++++++++++++++
.../bnframework/HBL/Thread/ThreadManager.java | 16 +-
.../business/ExecuteTheRecipe.java | 132 +++----
.../common/db/util/OrderDetailUtil.java | 27 +-
.../db/util/SubAttributeGroupDBUtil.java | 9 +
.../common/utils/CookTimeUtils.java | 108 +++---
.../bnframework/event/MakingStepEvent.java | 2 +-
.../bnframework/modbus/ModbusCenter.java | 9 +-
.../newui/activity/LoginHActivity.java | 6 +
.../newui/activity/MainHActivity.java | 2 +-
.../newui/activity/WelcomeActivity.java | 2 +-
.../newui/adapter/order/OrderInfoAdapter.java | 15 +
.../newui/dialog/check/FoodInfoDialog.java | 58 ++-
.../dialog/control/FoodPosSetDialog.java | 99 ++++-
.../dialog/control/WokControlDialog.java | 13 +-
.../fragment/cooking/CookingFragment.java | 33 +-
.../fragment/main/HomeDevicesFragment.java | 2 +-
.../fragment/main/HomeOrderFragment.java | 268 ++++++++++----
.../newui/widget/FoodPosSetView.java | 40 ++-
.../res/layout/item/layout/item_step_desc.xml | 2 +-
.../layout/new/layout/dialog_food_info.xml | 16 +-
.../layout/new/layout/dialog_food_pos_set.xml | 50 ++-
.../layout/new/layout/fragment_cooking.xml | 12 +-
.../res/layout/new/layout/item_order_info.xml | 15 +-
.../layout/new/layout/view_food_pos_set.xml | 8 +-
25 files changed, 1043 insertions(+), 241 deletions(-)
create mode 100644 .idea/other.xml
diff --git a/.idea/other.xml b/.idea/other.xml
new file mode 100644
index 00000000..b45a6e02
--- /dev/null
+++ b/.idea/other.xml
@@ -0,0 +1,340 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/bonait/bnframework/HBL/Thread/ThreadManager.java b/app/src/main/java/com/bonait/bnframework/HBL/Thread/ThreadManager.java
index 999d8ca9..1617cb2b 100644
--- a/app/src/main/java/com/bonait/bnframework/HBL/Thread/ThreadManager.java
+++ b/app/src/main/java/com/bonait/bnframework/HBL/Thread/ThreadManager.java
@@ -58,24 +58,30 @@ public class ThreadManager {
public void StartLong(String Key, boolean IsRestart, IThread _thread) {
if (!tm.containsKey(Key)) {
tm.put(Key, new ThreadModel());
+ if(tm.get(Key)==null){
+ return;
+ }
tm.get(Key).Task = _thread;
-
tm.get(Key).ThreadObj = new Thread(() -> {
MessageLog.ShowInfo("启动线程:" + Key);
- while (!tm.get(Key).IsCancel) {
+ while (tm.get(Key)!=null&&!tm.get(Key).IsCancel) {
if (IsRestart) {
try {
- tm.get(Key).Task.Run();
+ if(!tm.isEmpty() && tm.get(Key)!=null){
+ tm.get(Key).Task.Run();
+ }
} catch (Exception ex) {
MessageLog.ShowError("多线程:[" + Key + "] 运行发生异常,已重启,错误信息:" + ex.toString());
LogUtils.d("多线程:[" + Key + "] 运行发生异常,已重启,错误信息:" + ex.toString());
Sleep(RestartInterval);
+ ex.printStackTrace();
}
} else {
try {
tm.get(Key).Task.Run();
} catch (Exception e) {
- MessageLog.ShowError("多线程:[" + Key + "] 运行发生异常,已重启,错误信息:" + e.toString());
+ MessageLog.ShowError("多线程:[" + Key + "] 运行发生异常2,已重启,错误信息:" + e.toString());
+ e.printStackTrace();
}
}
}
@@ -123,7 +129,7 @@ public class ThreadManager {
for (HashMap.Entry entry : tm.entrySet()) {
entry.getValue().IsCancel = true;
}
- tm.clear();
+// tm.clear();
}
}
diff --git a/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java b/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
index 90520bcd..ce93b1ea 100644
--- a/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
+++ b/app/src/main/java/com/bonait/bnframework/business/ExecuteTheRecipe.java
@@ -9,10 +9,13 @@ import com.bonait.bnframework.common.constant.ConfigName;
import com.bonait.bnframework.common.db.QueryDB;
import com.bonait.bnframework.common.db.mode.BPA_GOODSRECIPE;
import com.bonait.bnframework.common.db.mode.BPA_GOODS_PROCESS_DETAIL;
+import com.bonait.bnframework.common.db.mode.BPA_GOODS_SUBATTRIBUTE_GROUP;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_DETAIL;
import com.bonait.bnframework.common.db.mode.BPA_SILOS;
import com.bonait.bnframework.common.db.util.GoodsProcessDetailDBUtil;
import com.bonait.bnframework.common.db.util.OrderDetailUtil;
+import com.bonait.bnframework.common.db.util.SubAttributeDBUtil;
+import com.bonait.bnframework.common.db.util.SubAttributeGroupDBUtil;
import com.bonait.bnframework.common.helper.I.IWriteCallBack;
import com.bonait.bnframework.event.MakingStepEvent;
import com.bonait.bnframework.modbus.ModbusCenter;
@@ -60,30 +63,29 @@ public class ExecuteTheRecipe {
if (ConfigName.MakeStatus[orderDetail.deviceNum -1] && orderDetail != null) {
boolean isError = false;
long startTime = System.currentTimeMillis(); //起始时间
- showlog("开始烹饪菜谱【" + orderDetail.goodsName + "】");
+ showlog(orderDetail.deviceNum,"开始烹饪菜谱【" + orderDetail.goodsName + "】");
try {
//获取工艺
- ArrayList goodsrecipes = GoodsProcessDetailDBUtil.getByGroupId(orderDetail.groupId);
+ ArrayList goodsrecipes = new ArrayList<>();
if(orderDetail.deviceNum ==1){
Wok1ModbusTcpServer.get().WriteBool("M52.0", (boolean) true, null);
- ConfigName.goodsProcess1.clear();
- ConfigName.goodsProcess1.addAll(goodsrecipes);
+ goodsrecipes = ConfigName.goodsProcess1;
}else if(orderDetail.deviceNum ==2){
Wok2ModbusTcpServer.get().WriteBool("M52.0", (boolean) true, null);
- ConfigName.goodsProcess2.clear();
- ConfigName.goodsProcess2.addAll(goodsrecipes);
+ goodsrecipes = ConfigName.goodsProcess2;
}else if(orderDetail.deviceNum ==3){
Wok3ModbusTcpServer.get().WriteBool("M52.0", (boolean) true, null);
- ConfigName.goodsProcess3.clear();
- ConfigName.goodsProcess3.addAll(goodsrecipes);
+ goodsrecipes = ConfigName.goodsProcess3;
}else if(orderDetail.deviceNum ==4){
Wok4ModbusTcpServer.get().WriteBool("M52.0", (boolean) true, null);
- ConfigName.goodsProcess4.clear();
- ConfigName.goodsProcess4.addAll(goodsrecipes);
+ goodsrecipes = ConfigName.goodsProcess4;
}
int m = 0;
if(!goodsrecipes.isEmpty()){
ConfigName.hasClear[orderDetail.deviceNum -1] = goodsrecipes.get(goodsrecipes.size()-1).processname.contains("清洗");
+ }else {
+ NewToastUtil.getInstance().showToast("商品工序为空!");
+ return;
}
for (BPA_GOODS_PROCESS_DETAIL item : goodsrecipes) {
@@ -94,7 +96,6 @@ public class ExecuteTheRecipe {
while (ConfigName.IsPause[orderDetail.deviceNum -1]) {
NewToastUtil.getInstance().showToast("当前菜品已暂停制作!");
RecordManager.getInstance().addLogRecord("订单处理日志",orderDetail.deviceNum +"号炒锅-"+",当前菜品已暂停制作");
-
Thread.sleep(500);
}
if(!ConfigName.IsStart[orderDetail.deviceNum -1]){
@@ -114,14 +115,14 @@ public class ExecuteTheRecipe {
boolean status = Execute(orderDetail.deviceNum,item, goodsrecipes, m);
m++;
}
+ long endTime = System.currentTimeMillis(); //结束时间
+ int time = (int) ((endTime - startTime) / 1000);
+ SubAttributeGroupDBUtil.updateMakeTime(orderDetail.groupId,time);
} catch (Exception ex) {
LogUtils.d("制作订单 异常信息:" + ex.getMessage());
isError = true;
- orderDetail.status = 3;
- OrderDetailUtil.update(orderDetail);
showToastErrorTip("异常信息:" + ex.getMessage());
- EventBus.getDefault().post(new MakingStepEvent(orderDetail.deviceNum,-1));
RecordManager.getInstance().addLogRecord("订单处理日志",orderDetail.deviceNum +"号炒锅("+orderDetail.goodsName+"-"+orderDetail.groupName+")-制作异常:"+ex.getMessage());
RecordManager.getInstance().addOrderRecords(orderDetail,orderDetail.deviceNum +"号炒锅-"+"异常");
} finally {
@@ -131,24 +132,19 @@ public class ExecuteTheRecipe {
WritePLC(orderDetail.deviceNum,"暂停开关", false, null);
Make位置(orderDetail.deviceNum,"原点位");
if(orderDetail.deviceNum ==1){
- ConfigName.goodsProcess1.clear();
Wok1ModbusTcpServer.get().WriteBool("M52.0", (boolean) false, null);
}else if(orderDetail.deviceNum ==2){
- ConfigName.goodsProcess2.clear();
Wok2ModbusTcpServer.get().WriteBool("M52.0", (boolean) false, null);
}else if(orderDetail.deviceNum ==3){
- ConfigName.goodsProcess3.clear();
Wok3ModbusTcpServer.get().WriteBool("M52.0", (boolean) false, null);
}else if(orderDetail.deviceNum ==4){
- ConfigName.goodsProcess4.clear();
Wok4ModbusTcpServer.get().WriteBool("M52.0", (boolean) false, null);
}
long endTime = System.currentTimeMillis(); //结束时间
int time = (int) ((endTime - startTime) / 1000);
Log.e("运行时长", String.format("方法使用时间 %d s", time));
- showlog("结束烹饪菜谱【" + orderDetail.goodsName + "】,关闭搅拌、关闭加热," + String.format("方法使用时间 %d s", time));
-
+ showlog(orderDetail.deviceNum,"结束烹饪菜谱【" + orderDetail.goodsName + "】,关闭搅拌、关闭加热," + String.format("方法使用时间 %d s", time));
if (ConfigName.IsForcedEnd[orderDetail.deviceNum -1])//强制结束
{
@@ -159,7 +155,7 @@ public class ExecuteTheRecipe {
showToastErrorTip("客官,当前菜品已强制结束!!!");
//初始化
// BottomClick("初始化");
- showlog("菜谱【" + orderDetail.goodsName + "】已强制结束...");
+ showlog(orderDetail.deviceNum,"菜谱【" + orderDetail.goodsName + "】已强制结束...");
ConfigName.IsForcedEnd[orderDetail.deviceNum -1] = false;
RecordManager.getInstance().addLogRecord("订单处理日志",orderDetail.deviceNum +"号炒锅("+orderDetail.goodsName+"-"+orderDetail.groupName+")-制作取消");
RecordManager.getInstance().addOrderRecords(orderDetail,orderDetail.deviceNum +"号炒锅-"+"取消");
@@ -171,6 +167,10 @@ public class ExecuteTheRecipe {
EventBus.getDefault().post(new MakingStepEvent(orderDetail.deviceNum,-3));
RecordManager.getInstance().addLogRecord("订单处理日志",orderDetail.deviceNum +"号炒锅("+orderDetail.goodsName+"-"+orderDetail.groupName+")-制作完成");
RecordManager.getInstance().addOrderRecords(orderDetail,orderDetail.deviceNum +"号炒锅-"+"完成");
+ }else {
+ orderDetail.status = 3;
+ OrderDetailUtil.update(orderDetail);
+ EventBus.getDefault().post(new MakingStepEvent(orderDetail.deviceNum,-1));
}
}
reset1(orderDetail.deviceNum);
@@ -193,17 +193,18 @@ public class ExecuteTheRecipe {
public static boolean Execute(int deviceNum,BPA_GOODS_PROCESS_DETAIL recipe, ArrayList all, int index) {
LogUtils.d(TAG+" Execute recipe="+recipe.toString());
boolean status = false;
+ NewToastUtil.getInstance().showToast(deviceNum+"号炒锅,执行步骤:"+(index+1)+"."+recipe.processname);
try {
//1.解析
if (ConfigName.IsForcedEnd[deviceNum-1]) {
- showlog("客官,小菠萝正在强制结束当前炒制菜品,请耐心等候!!!");
+ showlog(deviceNum,"客官,小菠萝正在强制结束当前炒制菜品,请耐心等候!!!");
return false;
}
if(deviceNum==1){
while (!Wok1ModbusTcpServer.get().plcIsConnect||!Robot1ModbusTcpServer.get().plcIsConnect
&&!ConfigName.IsForcedEnd[deviceNum-1]){
try{
- showlog("客官,检测到硬件已经断开连接,等待重连!!!");
+ showlog(deviceNum,"客官,检测到硬件已经断开连接,等待重连!!!");
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+" 检测到硬件已经断开连接,等待连接中 Wok:"
+ Wok1ModbusTcpServer.get().plcIsConnect+" Robot:"+ Robot1ModbusTcpServer.get().plcIsConnect);
Thread.sleep(100);
@@ -215,7 +216,7 @@ public class ExecuteTheRecipe {
while (!Wok2ModbusTcpServer.get().plcIsConnect||!Robot1ModbusTcpServer.get().plcIsConnect
&&!ConfigName.IsForcedEnd[deviceNum-1]){
try{
- showlog("客官,检测到硬件已经断开连接,等待重连!!!");
+ showlog(deviceNum,"客官,检测到硬件已经断开连接,等待重连!!!");
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+" 检测到硬件已经断开连接,等待连接中 Wok:"
+Wok2ModbusTcpServer.get().plcIsConnect+" Robot:"+ Robot1ModbusTcpServer.get().plcIsConnect);
Thread.sleep(100);
@@ -227,7 +228,7 @@ public class ExecuteTheRecipe {
while (!Wok3ModbusTcpServer.get().plcIsConnect||!Robot2ModbusTcpServer.get().plcIsConnect
&&!ConfigName.IsForcedEnd[deviceNum-1]){
try{
- showlog("客官,检测到硬件已经断开连接,等待重连!!!");
+ showlog(deviceNum,"客官,检测到硬件已经断开连接,等待重连!!!");
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+" 检测到硬件已经断开连接,等待连接中 Wok:"
+Wok3ModbusTcpServer.get().plcIsConnect+" Robot:"+ Robot2ModbusTcpServer.get().plcIsConnect);
Thread.sleep(100);
@@ -239,7 +240,7 @@ public class ExecuteTheRecipe {
while (!Wok4ModbusTcpServer.get().plcIsConnect||!Robot1ModbusTcpServer.get().plcIsConnect
&&!ConfigName.IsForcedEnd[deviceNum-1]){
try{
- showlog("客官,检测到硬件已经断开连接,等待重连!!!");
+ showlog(deviceNum,"客官,检测到硬件已经断开连接,等待重连!!!");
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+" 检测到硬件已经断开连接,等待连接中 Wok:"
+Wok4ModbusTcpServer.get().plcIsConnect+" Robot:"+ Robot2ModbusTcpServer.get().plcIsConnect);
Thread.sleep(100);
@@ -257,7 +258,7 @@ public class ExecuteTheRecipe {
{
Object gz = ReadPLC(deviceNum,"异常加热故障信息");
if (gz != null && (boolean) gz && !ConfigName.TEST) {
- showlog("客官,检测到硬件加热异常,已主动停止炒制,请联系海科人员!!!");
+ showlog(deviceNum,"客官,检测到硬件加热异常,已主动停止炒制,请联系海科人员!!!");
ConfigName.IsForcedEnd[deviceNum-1] = true;
String title = "加热异常-温馨提示!";
String message = "客官硬件加热异常,请联系海科人员,已强制停止炒制!";
@@ -328,7 +329,7 @@ public class ExecuteTheRecipe {
BPA_SILOS silos = bpa_silos.get(0);
if (val >= 32767) {
val = 32767;
- showlog("料仓" + silos.num + "出量克数溢出,已按照最大出量出料!!!");
+ showlog(deviceNum,"料仓" + silos.num + "出量克数溢出,已按照最大出量出料!!!");
}
formulation.put(silos, val);
@@ -405,7 +406,8 @@ public class ExecuteTheRecipe {
if (formulation.size() > 0) {
switch (processname){
case "主料":
- case "辅料":
+ case "调料小盆":
+ case "调料中盆":
case "出菜":
boolean isJre;
Object K = ReadPLC(deviceNum,"加热");
@@ -502,7 +504,7 @@ public class ExecuteTheRecipe {
Write_PLC_MainAccessory(deviceNum,formulation,1);
ConfigName.RobotIsWorking[deviceNum-1] = false;
break;
- case "调料大盆":
+ case "调料中盆":
ConfigName.RobotIsWorking[deviceNum-1] = true;
Write_PLC_MainAccessory(deviceNum,formulation,2);
ConfigName.RobotIsWorking[deviceNum-1] = false;
@@ -549,14 +551,14 @@ public class ExecuteTheRecipe {
@Override
public void onSuccess() {
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-"+"物料"+"料仓" + silos.num + "需求值"+val+"写入成功");
-// showlog("需求值写入成功!");
+// showlog(deviceNum,"需求值写入成功!");
IsComplete[0] = true;
}
@Override
public void onFailure(String ErrorMsg) {
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-"+"物料"+"料仓" + silos.num + "需求值"+val+"写入失败:"+ErrorMsg);
- showlog("需求值写入失败!尝试再次写入...错误原因:" + ErrorMsg);
+ showlog(deviceNum,"需求值写入失败!尝试再次写入...错误原因:" + ErrorMsg);
WritePLC(deviceNum,"料仓" + silos.num + "需求值", val, null);
IsComplete[0] = true;
}
@@ -590,7 +592,7 @@ public class ExecuteTheRecipe {
if (key.contains("(秒)")) {
val = Integer.parseInt(value);
} else {
- showlog("工序:" + key + "," + value);
+ showlog(deviceNum,"工序:" + key + "," + value);
writeValue = GetMXValue(key, value);
int finalWriteValue = writeValue;
WritePLC(deviceNum,key, writeValue, new IWriteCallBack() {
@@ -899,7 +901,7 @@ public class ExecuteTheRecipe {
*/
private static void Write_PLC_CleanPan(int deviceNum,HashMap data) {
try {
- showlog("准备清洗!");
+ showlog(deviceNum,"准备清洗!");
String qx_type = "一般清洗";
int val_csl=0;
int clearTime = 150;
@@ -908,7 +910,7 @@ public class ExecuteTheRecipe {
for (HashMap.Entry entry : data.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
- showlog("工序:" + key + "," + value);
+ showlog(deviceNum,"工序:" + key + "," + value);
if (key.contains("(秒)") && !ConfigName.IsForcedEnd[deviceNum-1]) {
int val = Integer.parseInt(value);
ThreadDelay(deviceNum,val,"Write_PLC_CleanPan");
@@ -941,7 +943,7 @@ public class ExecuteTheRecipe {
//等待清洗完成
ThreadWhileClear(deviceNum,"炒锅清洗反馈", 5);
Make位置(deviceNum,"原点位");
- showlog("炒锅清洗完成!");
+ showlog(deviceNum,"炒锅清洗完成!");
NewToastUtil.getInstance().showToast("炒锅清洗完成");
} catch (Exception ex) {
showToastErrorTip("异常信息:" + ex.getMessage());
@@ -981,7 +983,7 @@ public class ExecuteTheRecipe {
*/
public static void Write_PLC_MainIngredients(int deviceNum,HashMap data) {
try {
- showlog("准备倒入主料!");
+ showlog(deviceNum,"准备倒入主料!");
//判断炒制位置
String czwz = "炒菜位高";
String foodPosition = "Z1";
@@ -1055,7 +1057,7 @@ public class ExecuteTheRecipe {
*/
public static void Write_PLC_MainIngredients_shoudong(int deviceNum,HashMap data) {
try {
- showlog("准备倒入主料!");
+ showlog(deviceNum,"准备倒入主料!");
//判断炒制位置
String czwz = "炒菜位高";
String foodPosition = "Z1";
@@ -1109,14 +1111,14 @@ public class ExecuteTheRecipe {
}
/**
- * 写PLC投辅料
+ * 写PLC投调料
*
* @param data
- * @param type 1:小盆 2:大盆
+ * @param type 1:小盆 2:中盆
*/
public static void Write_PLC_MainAccessory(int deviceNum,HashMap data,int type) {
try {
- showlog("准备倒入辅料!");
+ showlog(deviceNum,"准备倒入调料"+(type==1?"小盆":"中盆"));
//判断炒制位置
String czwz = "炒菜位高";
String foodPosition = "F1";
@@ -1127,9 +1129,9 @@ public class ExecuteTheRecipe {
String value = entry.getValue();
if (key.contains("炒制位置")) {
czwz = value;
- }else if(key.contains("调料小盆位置")||key.contains("调料大盆位置")){
+ }else if(key.contains("调料小盆位置")||key.contains("调料中盆位置")){
foodPosition = value.replace("t","").replace("T","");
- }else if(key.contains("辅料名称")){
+ }else if(key.contains("调料名称")){
foodName = value;
}
}
@@ -1186,12 +1188,12 @@ public class ExecuteTheRecipe {
}
/**
- * 手动控制倒辅料
+ * 手动控制倒调料
* @param data
*/
public static void Write_PLC_MainAccessory_shoudong(int deviceNum,HashMap data,int type) {
try {
- showlog("准备倒入辅料!");
+ showlog(deviceNum,"准备倒入调料!"+(type==1?"小盆":"中盆"));
//判断炒制位置
String czwz = "炒菜位高";
String foodPosition = "F1";
@@ -1202,7 +1204,7 @@ public class ExecuteTheRecipe {
String value = entry.getValue();
if (key.contains("炒制位置")) {
czwz = value;
- }else if(key.contains("调料小盆位置")||key.contains("调料大盆位置")){
+ }else if(key.contains("调料小盆位置")||key.contains("调料中盆位置")){
foodPosition = value.replace("t","").replace("T","");
}else if(key.contains("调料名称")){
foodName = value;
@@ -1254,20 +1256,20 @@ public class ExecuteTheRecipe {
*/
public static void Write_PLC_MainOutdishes(int deviceNum,HashMap data,int index) {
try {
- showlog("准备出菜!");
+ showlog(deviceNum,"准备出菜!");
//先延迟
for (HashMap.Entry entry : data.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
- showlog("工序:" + key + "," + value);
+ showlog(deviceNum,"工序:" + key + "," + value);
if (key.contains("(秒)")) {
int val = Integer.parseInt(value);
ThreadDelay(deviceNum,val,"Write_PLC_MainOutdishes");
}
}
WritePLC(deviceNum,"加热", false, null);
- showlog("关闭搅拌、关闭加热!");
+ showlog(deviceNum,"关闭搅拌、关闭加热!");
Wait_Robot_No_Working(deviceNum);//等待机器人空闲
int num = deviceNum>2?(deviceNum-2):deviceNum;
@@ -1393,7 +1395,7 @@ public class ExecuteTheRecipe {
}else {
ThreadWhile(deviceNum,num+"#炒锅出餐完成");
}
- showlog("出菜完成,锅体准备回到原位!");
+ showlog(deviceNum,"出菜完成,锅体准备回到原位!");
} catch (Exception ex) {
showToastErrorTip("异常信息:" + ex.getMessage());
}
@@ -1420,7 +1422,7 @@ public class ExecuteTheRecipe {
public void onFailure(String ErrorMsg) {
}
});
- showlog("火力按钮点击,当前级别:" + data);
+ showlog(deviceNum,"火力按钮点击,当前级别:" + data);
} catch (Exception ex) {
showToastErrorTip("异常信息:" + ex.getMessage());
@@ -1519,7 +1521,7 @@ public class ExecuteTheRecipe {
int mmmm = delay - (int) ((System.currentTimeMillis() - startTime) / 1000);
if (AtPresentTime != mmmm) {
AtPresentTime = mmmm;
- showlog(deviceNum+"号炒锅,延迟等待中,剩余"+AtPresentTime+"秒");
+ showlog(deviceNum,deviceNum+"号炒锅,延迟等待中,剩余"+AtPresentTime+"秒");
}
} catch (InterruptedException ex) {
}
@@ -1540,8 +1542,8 @@ public class ExecuteTheRecipe {
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-ThreadWhile_WL-"+"等待物料("+name+")出料等待");
while (!IsComplete[0] && !ConfigName.IsForcedEnd[deviceNum-1]) {
- if ((System.currentTimeMillis() - a) > 1000 * whileTime) {
- showlog(name + ",异常超时退出!");
+ if ((System.currentTimeMillis() - a) > 1000 * 300) {
+ showlog(deviceNum,name + ",异常超时退出!");
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-ThreadWhile_WL-"+"异常超时退出");
break;
} else {
@@ -1552,7 +1554,7 @@ public class ExecuteTheRecipe {
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-ThreadWhile_WL-"+"true");
}else {
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-ThreadWhile_WL-"+"false");
- showlog(deviceNum+"号炒锅,等待"+name);
+ showlog(deviceNum,deviceNum+"号炒锅,等待"+name);
}
}else {
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-ThreadWhile_WL-"+"null");
@@ -1563,7 +1565,7 @@ public class ExecuteTheRecipe {
if (AtPresentTime != mmmm) {
AtPresentTime = mmmm;
}
-
+ showlog(deviceNum,deviceNum+"号炒锅出料剩余时间:"+mmmm+"秒");
Thread.sleep(500);//10 *6
} catch (InterruptedException e) {
IsComplete[0] = true;
@@ -1601,7 +1603,7 @@ public class ExecuteTheRecipe {
showToastErrorTip(deviceNum+"号锅取原料——"+name.replace("检测","未检测到位")+",请检查是否放置正确!");
}
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-ThreadWhile-"+name + ",false");
- showlog(deviceNum+"号炒锅,等待"+name);
+ showlog(deviceNum,deviceNum+"号炒锅,等待"+name);
LogUtils.d(TAG+" ThreadWhile name="+name+" false");
}
}else {
@@ -1628,7 +1630,7 @@ public class ExecuteTheRecipe {
while (!IsComplete[0] && !ConfigName.IsForcedEnd[deviceNum-1] && !ConfigName.TEST) {
if ((System.currentTimeMillis() - a) > 1000 * whileTime) {
- showlog(name + ",异常超时退出!");
+ showlog(deviceNum,name + ",异常超时退出!");
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-ThreadWhile-"+name + ",异常超时退出");
break;
} else {
@@ -1644,7 +1646,7 @@ public class ExecuteTheRecipe {
BottomClick1(deviceNum,value);
}
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-ThreadWhile-"+name + ",false");
- showlog(deviceNum+"号炒锅,等待"+name);
+ showlog(deviceNum,deviceNum+"号炒锅,等待"+name);
LogUtils.d(TAG+" ThreadWhile name="+name+" false");
}
}else {
@@ -1675,7 +1677,7 @@ public class ExecuteTheRecipe {
while (!IsComplete[0] && !ConfigName.IsForcedEnd[deviceNum-1]&& !ConfigName.TEST) {
if ((System.currentTimeMillis() - a) > 1000 * whileTime * k) {
- showlog(name + ",异常超时退出!");
+ showlog(deviceNum,name + ",异常超时退出!");
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-ThreadWhileClear-"+name + ",异常超时退出");
break;
} else {
@@ -1685,11 +1687,11 @@ public class ExecuteTheRecipe {
if (IsComplete[0]) {
LogUtils.d(TAG+" ThreadWhileClear name="+name+" true");
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-ThreadWhileClear-"+name + ",true");
- showlog(deviceNum+"号炒锅,清洗完成");
+ showlog(deviceNum,deviceNum+"号炒锅,清洗完成");
}else {
LogUtils.d(TAG+" ThreadWhileClear name="+name+" false");
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-ThreadWhileClear-"+name + ",false");
- showlog(deviceNum+"号炒锅,清洗中...");
+ showlog(deviceNum,deviceNum+"号炒锅,清洗中...");
}
}else {
RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"号炒锅-ThreadWhileClear-"+name + ",null");
@@ -1710,11 +1712,11 @@ public class ExecuteTheRecipe {
/**
* 显示日志
*/
- public static void showlog(String msg) {
+ public static void showlog(int deviceNum,String msg) {
LogUtils.d(TAG+" showlog msg="+msg);
- RecordManager.getInstance().addLogRecord("订单处理日志","炒锅-showlog-"+msg + "");
+ RecordManager.getInstance().addLogRecord("订单处理日志",deviceNum+"炒锅-showlog-"+msg + "");
if(ConfigName.getInstance().showCookingToast){
- NewToastUtil.getInstance().showToast(msg);
+ NewToastUtil.getInstance().showToast(deviceNum+"号炒锅,"+msg);
}
}
diff --git a/app/src/main/java/com/bonait/bnframework/common/db/util/OrderDetailUtil.java b/app/src/main/java/com/bonait/bnframework/common/db/util/OrderDetailUtil.java
index 1bde9522..1b15e5af 100644
--- a/app/src/main/java/com/bonait/bnframework/common/db/util/OrderDetailUtil.java
+++ b/app/src/main/java/com/bonait/bnframework/common/db/util/OrderDetailUtil.java
@@ -12,6 +12,7 @@ import com.bonait.bnframework.common.db.mode.BPA_GOODS_SUBATTRIBUTE_GROUP;
import com.bonait.bnframework.common.db.mode.BPA_ORDER_DETAIL;
import java.util.ArrayList;
+import java.util.List;
/**
* @author: liup
@@ -128,14 +129,13 @@ public class OrderDetailUtil {
public static BPA_ORDER_DETAIL resetOrder() {
String orderby = QueryDB.Desc_Time_Up;
- String where = "isDelete=? and status!=0";
+ String where = "isDelete=?";
String[] args = new String[]{"0"};
ArrayList