@@ -41,7 +41,7 @@ public class ICSApp extends Application { | |||||
InitDBdata(); | InitDBdata(); | ||||
//4.初始化Main | //4.初始化Main | ||||
Main.getInstance(); | Main.getInstance(); | ||||
//DBdelete(); | |||||
//BusinessServer.Get().test(); | //BusinessServer.Get().test(); | ||||
//MessageLog.ShowAlertMessage(AlertLogEnum.传感器异常日志,"传感器异常"); | //MessageLog.ShowAlertMessage(AlertLogEnum.传感器异常日志,"传感器异常"); | ||||
//MessageLog.ShowAlertMessage(AlertLogEnum.异常订单未制作日志,"异常订单未制作日志"); | //MessageLog.ShowAlertMessage(AlertLogEnum.异常订单未制作日志,"异常订单未制作日志"); | ||||
@@ -99,6 +99,7 @@ public class BusinessServer { | |||||
String RecipesNames=""; | String RecipesNames=""; | ||||
for (ResGoodsRecipe item:goodsRecipes ){RecipesNames+=item.materialName+",";} | for (ResGoodsRecipe item:goodsRecipes ){RecipesNames+=item.materialName+",";} | ||||
DataBus.getInstance().UpdateGoodsMake(suborder.id,"步骤【" + key+ "】准备下发物料:"+RecipesNames,count); | DataBus.getInstance().UpdateGoodsMake(suborder.id,"步骤【" + key+ "】准备下发物料:"+RecipesNames,count); | ||||
ArrayList<Integer> liaochang=new ArrayList<Integer>(); | |||||
for (int m = 0; m < goodsRecipes.size(); m++) { | for (int m = 0; m < goodsRecipes.size(); m++) { | ||||
ResGoodsRecipe recipe=goodsRecipes.get(m); | ResGoodsRecipe recipe=goodsRecipes.get(m); | ||||
int materialType = recipe.materialType; | int materialType = recipe.materialType; | ||||
@@ -120,6 +121,7 @@ public class BusinessServer { | |||||
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志,message+"下发失败!物料没有管理料仓!"); | MessageLog.ShowUserMessage(UserLogEnum.订单处理日志,message+"下发失败!物料没有管理料仓!"); | ||||
}else | }else | ||||
{ | { | ||||
liaochang.add(silos.num); | |||||
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志,message+"准备下发【" + silos.num + "】号料仓PLC控制命令,需求量:=" + recipe.value); | MessageLog.ShowUserMessage(UserLogEnum.订单处理日志,message+"准备下发【" + silos.num + "】号料仓PLC控制命令,需求量:=" + recipe.value); | ||||
DeviceData.Get().setDemandValue((short) recipe.value, silos.num, new IWriteCallBack() { | DeviceData.Get().setDemandValue((short) recipe.value, silos.num, new IWriteCallBack() { | ||||
@Override | @Override | ||||
@@ -140,6 +142,23 @@ public class BusinessServer { | |||||
ModbusTcpServer.get().WriteBool(bs.plcvar, false); | ModbusTcpServer.get().WriteBool(bs.plcvar, false); | ||||
MessageLog.ShowUserMessage(UserLogEnum.订单处理日志,message+"下发成功!"); | 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() { | DeviceData.Get().setChargeMixtureStart(new IWriteCallBack() { | ||||
@@ -77,6 +77,7 @@ public class ddgl_activity extends AppCompatActivity implements View.OnClickLis | |||||
* 开始时间-结束时间 | * 开始时间-结束时间 | ||||
*/ | */ | ||||
EditText starttime, stoptime; | EditText starttime, stoptime; | ||||
TextView count; | |||||
/** | /** | ||||
* 日志类型 | * 日志类型 | ||||
*/ | */ | ||||
@@ -110,6 +111,7 @@ public class ddgl_activity extends AppCompatActivity implements View.OnClickLis | |||||
starttime = this.findViewById(R.id.starttime); | starttime = this.findViewById(R.id.starttime); | ||||
stoptime = this.findViewById(R.id.stoptime); | stoptime = this.findViewById(R.id.stoptime); | ||||
rzlx = this.findViewById(R.id.rzlx); | rzlx = this.findViewById(R.id.rzlx); | ||||
count=this.findViewById(R.id.count); | |||||
//通过Activity.getIntent()获取当前页面接收到的Intent。 getXxxExtra方法获取Intent传递过来的数据 | //通过Activity.getIntent()获取当前页面接收到的Intent。 getXxxExtra方法获取Intent传递过来的数据 | ||||
String msg = getIntent().getStringExtra("data"); | String msg = getIntent().getStringExtra("data"); | ||||
gongneng_title.setText(msg); | gongneng_title.setText(msg); | ||||
@@ -198,6 +200,7 @@ public class ddgl_activity extends AppCompatActivity implements View.OnClickLis | |||||
String lx= rzlx.getSelectedItem().toString(); | String lx= rzlx.getSelectedItem().toString(); | ||||
String text= edittext.getText().toString(); | String text= edittext.getText().toString(); | ||||
subOrders= QueryDB.GetSubOrders(str,stop, lx_map.get(lx),text); | 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); | adapter = new ddgl_adapter(ddgl_activity.this,R.layout.ddgl_item,subOrders); | ||||
datatab.setAdapter(adapter); | datatab.setAdapter(adapter); | ||||
} catch (Exception e) { | } catch (Exception e) { | ||||
@@ -19,7 +19,7 @@ | |||||
<RelativeLayout | <RelativeLayout | ||||
android:layout_width="0dp" | android:layout_width="0dp" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:layout_weight="3"> | |||||
android:layout_weight="2.5"> | |||||
<TextView | <TextView | ||||
android:id="@+id/bh" | android:id="@+id/bh" | ||||
@@ -34,7 +34,7 @@ | |||||
<RelativeLayout | <RelativeLayout | ||||
android:layout_width="0dp" | android:layout_width="0dp" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:layout_weight="1.5"> | |||||
android:layout_weight="2"> | |||||
<TextView | <TextView | ||||
android:id="@+id/time" | android:id="@+id/time" | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
@@ -178,6 +178,19 @@ | |||||
android:text="查询" | android:text="查询" | ||||
android:textColor="@color/foreground" | android:textColor="@color/foreground" | ||||
android:textSize="@dimen/textSize" /> | android:textSize="@dimen/textSize" /> | ||||
<TextView | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_marginLeft="25dp" | |||||
android:text="订单数量:" | |||||
android:textColor="@color/foreground"></TextView> | |||||
<TextView | |||||
android:id="@+id/count" | |||||
android:layout_width="wrap_content" | |||||
android:layout_height="wrap_content" | |||||
android:layout_marginLeft="5dp" | |||||
android:text="129" | |||||
android:textColor="@color/meunSelectForeground"></TextView> | |||||
</LinearLayout> | </LinearLayout> | ||||
</RelativeLayout> | </RelativeLayout> | ||||
@@ -224,7 +237,7 @@ | |||||
<RelativeLayout | <RelativeLayout | ||||
android:layout_width="0dp" | android:layout_width="0dp" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:layout_weight="3"> | |||||
android:layout_weight="2.5"> | |||||
<TextView | <TextView | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||
@@ -239,7 +252,7 @@ | |||||
<RelativeLayout | <RelativeLayout | ||||
android:layout_width="0dp" | android:layout_width="0dp" | ||||
android:layout_height="wrap_content" | android:layout_height="wrap_content" | ||||
android:layout_weight="1.5"> | |||||
android:layout_weight="2"> | |||||
<TextView | <TextView | ||||
android:layout_width="wrap_content" | android:layout_width="wrap_content" | ||||