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 e72cb2e..d04cbdf 100644 --- a/app/src/main/java/com/example/bpa/app/ICSApp.java +++ b/app/src/main/java/com/example/bpa/app/ICSApp.java @@ -41,7 +41,7 @@ public class ICSApp extends Application { InitDBdata(); //4.初始化Main Main.getInstance(); - + //DBdelete(); //BusinessServer.Get().test(); //MessageLog.ShowAlertMessage(AlertLogEnum.传感器异常日志,"传感器异常"); //MessageLog.ShowAlertMessage(AlertLogEnum.异常订单未制作日志,"异常订单未制作日志"); diff --git a/app/src/main/java/com/example/bpa/service/BusinessServer.java b/app/src/main/java/com/example/bpa/service/BusinessServer.java index 17dc0d3..de2a566 100644 --- a/app/src/main/java/com/example/bpa/service/BusinessServer.java +++ b/app/src/main/java/com/example/bpa/service/BusinessServer.java @@ -99,6 +99,7 @@ public class BusinessServer { String RecipesNames=""; for (ResGoodsRecipe item:goodsRecipes ){RecipesNames+=item.materialName+",";} DataBus.getInstance().UpdateGoodsMake(suborder.id,"步骤【" + key+ "】准备下发物料:"+RecipesNames,count); + ArrayList liaochang=new ArrayList(); for (int m = 0; m < goodsRecipes.size(); m++) { ResGoodsRecipe recipe=goodsRecipes.get(m); int materialType = recipe.materialType; @@ -120,6 +121,7 @@ public class BusinessServer { MessageLog.ShowUserMessage(UserLogEnum.订单处理日志,message+"下发失败!物料没有管理料仓!"); }else { + liaochang.add(silos.num); MessageLog.ShowUserMessage(UserLogEnum.订单处理日志,message+"准备下发【" + silos.num + "】号料仓PLC控制命令,需求量:=" + recipe.value); DeviceData.Get().setDemandValue((short) recipe.value, silos.num, new IWriteCallBack() { @Override @@ -140,6 +142,23 @@ public class BusinessServer { ModbusTcpServer.get().WriteBool(bs.plcvar, false); MessageLog.ShowUserMessage(UserLogEnum.订单处理日志,message+"下发成功!"); } + + for (int k=1;k<=10;k++) + { + if(!liaochang.contains(k)) + { + DeviceData.Get().setDemandValue((short) 0, k, new IWriteCallBack() { + @Override + public void onSuccess() { + MessageLog.ShowInfo(message+"下发成功!"); + } + @Override + public void onFailure(String ErrorMsg) { + MessageLog.ShowInfo(message+"下发失败!"+ErrorMsg); + } + }); + } + } } //启动配料 DeviceData.Get().setChargeMixtureStart(new IWriteCallBack() { diff --git a/app/src/main/java/com/example/bpa/view/from/ddgl_activity.java b/app/src/main/java/com/example/bpa/view/from/ddgl_activity.java index 220e711..fde510e 100644 --- a/app/src/main/java/com/example/bpa/view/from/ddgl_activity.java +++ b/app/src/main/java/com/example/bpa/view/from/ddgl_activity.java @@ -77,6 +77,7 @@ public class ddgl_activity extends AppCompatActivity implements View.OnClickLis * 开始时间-结束时间 */ EditText starttime, stoptime; + TextView count; /** * 日志类型 */ @@ -110,6 +111,7 @@ public class ddgl_activity extends AppCompatActivity implements View.OnClickLis starttime = this.findViewById(R.id.starttime); stoptime = this.findViewById(R.id.stoptime); rzlx = this.findViewById(R.id.rzlx); + count=this.findViewById(R.id.count); //通过Activity.getIntent()获取当前页面接收到的Intent。 getXxxExtra方法获取Intent传递过来的数据 String msg = getIntent().getStringExtra("data"); gongneng_title.setText(msg); @@ -198,6 +200,7 @@ public class ddgl_activity extends AppCompatActivity implements View.OnClickLis String lx= rzlx.getSelectedItem().toString(); String text= edittext.getText().toString(); subOrders= QueryDB.GetSubOrders(str,stop, lx_map.get(lx),text); + count.setText(subOrders.size()+""); adapter = new ddgl_adapter(ddgl_activity.this,R.layout.ddgl_item,subOrders); datatab.setAdapter(adapter); } catch (Exception e) { diff --git a/app/src/main/res/layout/datatab/layout/ddgl_item.xml b/app/src/main/res/layout/datatab/layout/ddgl_item.xml index aa670c6..67d96b0 100644 --- a/app/src/main/res/layout/datatab/layout/ddgl_item.xml +++ b/app/src/main/res/layout/datatab/layout/ddgl_item.xml @@ -19,7 +19,7 @@ + android:layout_weight="2.5"> + android:layout_weight="2"> + + @@ -224,7 +237,7 @@ + android:layout_weight="2.5"> + android:layout_weight="2">