Browse Source

ces3223223111

master
fyf 1 year ago
parent
commit
769ff0cab8
2 changed files with 12 additions and 8 deletions
  1. +12
    -4
      app/src/main/java/com/example/bpa/app/BusinessServer.java
  2. +0
    -4
      app/src/main/java/com/example/bpa/app/ICSApp.java

+ 12
- 4
app/src/main/java/com/example/bpa/app/BusinessServer.java View File

@@ -28,9 +28,10 @@ public class BusinessServer {
private BusinessServer() { private BusinessServer() {
} }


/**
* 商品制作队列
*/
ConcurrentLinkedQueue<String> Commoditys = new ConcurrentLinkedQueue<String>(); ConcurrentLinkedQueue<String> Commoditys = new ConcurrentLinkedQueue<String>();


/** /**
* 添加配方 * 添加配方
* *
@@ -40,8 +41,12 @@ public class BusinessServer {
Commoditys.offer(info); Commoditys.offer(info);
} }


/**
* 订单制作线程
*/
public void Start() { public void Start() {
DeviceData.Get().TestInit();
//DeviceData.Get().TestInit();

ThreadManager.Get().StartLong("配方执行业务流程", true, new IThread() { ThreadManager.Get().StartLong("配方执行业务流程", true, new IThread() {
@Override @Override
public void Run() throws InterruptedException { public void Run() throws InterruptedException {
@@ -60,6 +65,7 @@ public class BusinessServer {
for (LinkedHashMap.Entry<Integer, List<ResGoodsRecipe>> entry : rgrs.entrySet()) { for (LinkedHashMap.Entry<Integer, List<ResGoodsRecipe>> entry : rgrs.entrySet()) {
for (int m = 0; m < entry.getValue().size(); m++) { for (int m = 0; m < entry.getValue().size(); m++) {
int materialType = entry.getValue().get(m).materialType; int materialType = entry.getValue().get(m).materialType;
//1.正常物料
if (materialType == 1) { if (materialType == 1) {
//获取料仓信息 //获取料仓信息
List<BPA_SILOS> bss = QueryDB.GetSolisByMaterialID(entry.getValue().get(m).materialID); List<BPA_SILOS> bss = QueryDB.GetSolisByMaterialID(entry.getValue().get(m).materialID);
@@ -70,7 +76,9 @@ public class BusinessServer {
DeviceData.Get().setDemandValue((short) entry.getValue().get(m).value, bss.get(x).num, null); DeviceData.Get().setDemandValue((short) entry.getValue().get(m).value, bss.get(x).num, null);
} }
} }
} else if (materialType == 2) {
}
//2.果糖
else if (materialType == 2) {
BPA_SUGAR bs = QueryDB.GetsugarId(entry.getValue().get(m).materialID); BPA_SUGAR bs = QueryDB.GetsugarId(entry.getValue().get(m).materialID);
ModbusTcpServer.get().WriteBool(bs.plcvar, true); ModbusTcpServer.get().WriteBool(bs.plcvar, true);
} }


+ 0
- 4
app/src/main/java/com/example/bpa/app/ICSApp.java View File

@@ -30,20 +30,16 @@ public class ICSApp extends Application {
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();


MessageLog.MsgNotify = new IMessageLogNotify() { MessageLog.MsgNotify = new IMessageLogNotify() {
@Override @Override
public void ErrorMsg(String msg) { public void ErrorMsg(String msg) {
Log.e("Error", msg); Log.e("Error", msg);


} }

@Override @Override
public void InfoMsg(String msg, String datetime) { public void InfoMsg(String msg, String datetime) {
Log.i("Info", msg); Log.i("Info", msg);
} }

@Override @Override
public void WarnMsg(String msg) { public void WarnMsg(String msg) {
Log.w("Warn", msg); Log.w("Warn", msg);


Loading…
Cancel
Save