diff --git a/app/src/main/java/com/example/bpa/MainActivity.java b/app/src/main/java/com/example/bpa/MainActivity.java
index 456992d..974ab01 100644
--- a/app/src/main/java/com/example/bpa/MainActivity.java
+++ b/app/src/main/java/com/example/bpa/MainActivity.java
@@ -101,7 +101,7 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen
*/
@Override
protected void onDestroy() {
- //MQTT.get().ConnMqttBroken(false);//释放mqtt
+ MQTT.get().ConnMqttBroken(false);//释放mqtt
ModbusTcpHelper.get().release();//释放modbus
super.onDestroy();
}
@@ -151,7 +151,7 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen
//PLC数据监控
ModbusTcpServer.get().Connect(ConfigName.getInstance().Address, ConfigName.getInstance().Post);
//MQTT数据监听
- //OrderServer.Get().MqttInit();
+ OrderServer.Get().MqttInit();
//消息中心
RegisterMessage();
}
@@ -274,11 +274,11 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen
for (SuOrderA item : order.orderDetail)//新增子订单
{
BPA_SUBORDER suborder = new BPA_SUBORDER();
+ suborder.id=item.id;
suborder.deviceID = ConfigName.getInstance().DeviceId;
suborder.userID = ConfigName.getInstance().user.userID;
suborder.orderID = item.orderInfo_Id;
-
- suborder.goodsID = QueryDB.GetGoodsALL().get(0).id;//"2f064965-8d63-4b00-9d14-c8d118791898";//item.goods_Id;
+ suborder.goodsID = item.goods_Id;//QueryDB.GetGoodsALL().get(0).id;//"2f064965-8d63-4b00-9d14-c8d118791898";//item.goods_Id;
suborder.number = 1;
suborder.status = 0;
suborder.goodImg = item.goodImg;
@@ -382,6 +382,8 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen
}
}
});
+
+
}
//endregion
}
\ No newline at end of file
diff --git a/app/src/main/java/com/example/bpa/Model/BPAPackage.java b/app/src/main/java/com/example/bpa/Model/BPAPackage.java
new file mode 100644
index 0000000..017b62b
--- /dev/null
+++ b/app/src/main/java/com/example/bpa/Model/BPAPackage.java
@@ -0,0 +1,20 @@
+package com.example.bpa.Model;
+
+import java.util.Date;
+
+/**
+ * 消息包
+ */
+public class BPAPackage {
+ public int MessageId;
+
+ public byte MessageVersion;
+
+ public int ClientId;
+
+ public int ClientType;//9 是MORKT
+
+ public String Timestamp;
+
+ public PushDeviceGoods Message;
+}
diff --git a/app/src/main/java/com/example/bpa/Model/BatchingsInfo.java b/app/src/main/java/com/example/bpa/Model/BatchingsInfo.java
index 8677c2d..74aad99 100644
--- a/app/src/main/java/com/example/bpa/Model/BatchingsInfo.java
+++ b/app/src/main/java/com/example/bpa/Model/BatchingsInfo.java
@@ -20,4 +20,8 @@ public class BatchingsInfo {
///
public String BomId;
public boolean IsReplace;
+ ///
+ /// 商品关联BomID
+ ///
+ public String GoodsBomId;
}
diff --git a/app/src/main/java/com/example/bpa/Model/GoodsBom.java b/app/src/main/java/com/example/bpa/Model/GoodsBom.java
index 21fc40f..3674c7d 100644
--- a/app/src/main/java/com/example/bpa/Model/GoodsBom.java
+++ b/app/src/main/java/com/example/bpa/Model/GoodsBom.java
@@ -8,4 +8,8 @@ public class GoodsBom {
/// 是否主料配方
///
public boolean IsMain;
+ ///
+ /// 商品关联BomID
+ ///
+ public String GoodsBomId;
}
diff --git a/app/src/main/java/com/example/bpa/Model/OrderStatusChange.java b/app/src/main/java/com/example/bpa/Model/OrderStatusChange.java
index 51dfa61..7c98c44 100644
--- a/app/src/main/java/com/example/bpa/Model/OrderStatusChange.java
+++ b/app/src/main/java/com/example/bpa/Model/OrderStatusChange.java
@@ -3,7 +3,7 @@ package com.example.bpa.Model;
public class OrderStatusChange {
public String SuborderId;
/**
- * 3 等待制作 4 制作中 5 制作完成等待取餐 6 取餐完成
+ * 4 制作中 5 制作完成等待取餐 6 取餐完成 11废弃
*/
public Integer CookingStatus ;
diff --git a/app/src/main/java/com/example/bpa/app/ICSApp.java b/app/src/main/java/com/example/bpa/app/ICSApp.java
index 2c4ca78..dc0a39d 100644
--- a/app/src/main/java/com/example/bpa/app/ICSApp.java
+++ b/app/src/main/java/com/example/bpa/app/ICSApp.java
@@ -13,14 +13,12 @@ import com.example.bpa.db.mode.BPA_LOG;
import com.example.bpa.db.mode.BPA_SILOS;
import com.example.bpa.db.mode.BPA_SILOSANDMATERIAL;
import com.example.bpa.db.mode.BPA_SUBORDER;
-import com.example.bpa.db.mode.BPA_SUGAR;
import com.example.bpa.db.mode.BPA_USER;
+import com.example.bpa.helper.AES;
import com.example.bpa.helper.MessageLog;
-import com.example.bpa.helper.ModbusTcpServer;
import com.example.bpa.helper.SdCart;
import com.example.bpa.helper.ToastUtil;
import com.example.bpa.service.BusinessServer;
-import com.example.bpa.service.OrderServer;
import com.example.bpa.view.mode.AlertLogEnum;
import com.example.bpa.view.mode.UserLogEnum;
@@ -41,7 +39,8 @@ public class ICSApp extends Application {
InitDBdata();
//4.初始化Main
Main.getInstance();
- //BusinessServer.Get().test();
+
+ BusinessServer.Get().test();
//MessageLog.ShowAlertMessage(AlertLogEnum.传感器异常日志,"传感器异常");
//MessageLog.ShowAlertMessage(AlertLogEnum.异常订单未制作日志,"异常订单未制作日志");
//MessageLog.ShowAlertMessage(AlertLogEnum.料仓缺料日志,"料仓缺料日志");
diff --git a/app/src/main/java/com/example/bpa/app/Main.java b/app/src/main/java/com/example/bpa/app/Main.java
index 0347885..398bb7f 100644
--- a/app/src/main/java/com/example/bpa/app/Main.java
+++ b/app/src/main/java/com/example/bpa/app/Main.java
@@ -12,7 +12,6 @@ import com.example.bpa.db.QueryDB;
import com.example.bpa.db.mode.BPA_SYSTEMSET;
import com.example.bpa.db.mode.BPA_USER;
import com.example.bpa.helper.AES;
-import com.example.bpa.helper.AESCBCUtils;
import com.example.bpa.helper.ConfigUtil;
import com.example.bpa.helper.HttpUtils;
import com.example.bpa.helper.Json;
@@ -238,7 +237,7 @@ public class Main {
public void GetOrder(String orderNumber)
{
//https://bpa.black-pa.com:21527/order/order/fullorderbynumber/202305111151562071
- orderNumber="202306051240019217";
+ orderNumber="454196868008775680";
//202202211310398967
//String api="https://bpa.black-pa.com:21528/kitchen/api/member-helper/memberinfobywechat/987654321";
Log.i("查询用户接口", ConfigName.getInstance().SaasAddress+ConfigName.getInstance().GetOrder+orderNumber);
diff --git a/app/src/main/java/com/example/bpa/config/ConfigName.java b/app/src/main/java/com/example/bpa/config/ConfigName.java
index a41949e..589fd3e 100644
--- a/app/src/main/java/com/example/bpa/config/ConfigName.java
+++ b/app/src/main/java/com/example/bpa/config/ConfigName.java
@@ -51,7 +51,7 @@ public class ConfigName {
/**
* 店铺设备号
*/
- public String AutKey="95";
+ public String AutKey="152.146";
/**
* 店铺设备号
*/
@@ -78,7 +78,7 @@ public class ConfigName {
/**
* 订阅主题
*/
- public String mqtt_topic="DOWN/TMC/BUSINESS/";
+ public String mqtt_topic="DOWN/MORKT/BUSINESS/";
//endregion
//region 环境配置
diff --git a/app/src/main/java/com/example/bpa/config/DataBus.java b/app/src/main/java/com/example/bpa/config/DataBus.java
index 0ca78be..857c3a5 100644
--- a/app/src/main/java/com/example/bpa/config/DataBus.java
+++ b/app/src/main/java/com/example/bpa/config/DataBus.java
@@ -3,8 +3,10 @@ package com.example.bpa.config;
import android.app.Activity;
import com.example.bpa.Model.OrderA;
+import com.example.bpa.Model.OrderStatusChange;
import com.example.bpa.Model.ResultA;
import com.example.bpa.R;
+import com.example.bpa.app.Main;
import com.example.bpa.db.mode.BPA_SUBORDER;
import com.example.bpa.service.DeviceData;
import com.example.bpa.db.QueryDB;
@@ -150,7 +152,6 @@ public class DataBus {
orderadapter.refresh();
}
}
-
}catch(Exception e){
}
}
@@ -207,6 +208,10 @@ public class DataBus {
GoodsMake.get(m).makeProcess=(count/ GoodsMake.get(m).recipes.size())*100;
goodmakeadapter.refresh();
+ OrderStatusChange change=new OrderStatusChange();
+ change.SuborderId=GoodsMake.get(m).subOrder.id;
+ change.CookingStatus=4;
+ Main.getInstance().SetOrderChanged(change);
return;
}
}
@@ -248,9 +253,14 @@ public class DataBus {
if(good!=null)
{
- //GoodsMakeOver.add(good);
GoodsMake.remove(good);
goodmakeadapter.refresh();
+
+ OrderStatusChange change=new OrderStatusChange();
+ change.SuborderId=good.subOrder.id;
+ change.CookingStatus=6;
+ change.GoodName=good.good.name;
+ Main.getInstance().SetOrderChanged(change);
}
}catch(Exception e){
}
diff --git a/app/src/main/java/com/example/bpa/db/QueryDB.java b/app/src/main/java/com/example/bpa/db/QueryDB.java
index 0136f34..28ff717 100644
--- a/app/src/main/java/com/example/bpa/db/QueryDB.java
+++ b/app/src/main/java/com/example/bpa/db/QueryDB.java
@@ -403,7 +403,7 @@ public class QueryDB {
* @return
*/
public static ArrayList GetSilosAndMaterialALL() {
- String orderby = Desc_Sort_Up + ',' + Desc_Time_Up;//先按排序 创建时间倒序
+ String orderby = Desc_Time_Up;//先按排序 创建时间倒序
String where = "isDelete=?";
String[] args = new String[]{"0"};
ArrayList data = new ArrayList<>();
@@ -607,6 +607,25 @@ public class QueryDB {
return data.size() > 0;
}
+ /**
+ * 判断商品数据是否存在
+ *
+ * @param id
+ * @return
+ */
+ public static boolean GetGoodsIDIs(String id) {
+ boolean isSucess = false;
+ String orderby = Desc_Time_Up;//出料顺序
+ String where = "isDelete=? and id=?";
+ String[] args = new String[]{"0", id};
+ ArrayList data = new ArrayList<>();
+ ArrayList