Bläddra i källkod

更新卡的

调味吧台第二版
fyf 1 år sedan
förälder
incheckning
858a58f015
2 ändrade filer med 135 tillägg och 124 borttagningar
  1. +91
    -85
      app/src/main/java/com/example/bpa/MainActivity.java
  2. +44
    -39
      app/src/main/java/com/example/bpa/helper/UpdateManager.java

+ 91
- 85
app/src/main/java/com/example/bpa/MainActivity.java Visa fil

@@ -488,103 +488,109 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen
*/
public void ShowDialog(String id) {
try {
OrderID = id;
ArrayList<BPA_SUBORDER> sub = QueryDB.GetSubOrderList(id);
DataBus.getInstance().GoodsSMMake.clear();
for (BPA_SUBORDER k : sub) {
ResGoodsMake make = new ResGoodsMake();
make.recipes = QueryDB.GetGoodsSrecipeList(k.goodsID);
BPA_GOODS good = QueryDB.GetGoodsId(k.goodsID);
if (good.name != null) {
make.good = QueryDB.GetGoodsId(k.goodsID);
make.subOrder = k;
if(!isFinishing())
{
OrderID = id;
ArrayList<BPA_SUBORDER> sub = QueryDB.GetSubOrderList(id);
DataBus.getInstance().GoodsSMMake.clear();
for (BPA_SUBORDER k : sub) {
ResGoodsMake make = new ResGoodsMake();
make.recipes = QueryDB.GetGoodsSrecipeList(k.goodsID);
BPA_GOODS good = QueryDB.GetGoodsId(k.goodsID);
if (good.name != null) {
make.good = QueryDB.GetGoodsId(k.goodsID);
make.subOrder = k;

make.makeMs = "";
make.makeProcess = 0;
if (k.status == 0) {
make.makeStatus = MakeStatus.等待制作;
} else if (k.status == 1) {
make.makeStatus = MakeStatus.制作中;
} else {
make.makeStatus = MakeStatus.制作完成;
make.makeMs = "";
make.makeProcess = 100;
for (ResGoodsRecipe recipe : make.recipes) {
recipe.makeProcess = 100;
make.makeProcess = 0;
if (k.status == 0) {
make.makeStatus = MakeStatus.等待制作;
} else if (k.status == 1) {
make.makeStatus = MakeStatus.制作中;
} else {
make.makeStatus = MakeStatus.制作完成;
make.makeMs = "";
make.makeProcess = 100;
for (ResGoodsRecipe recipe : make.recipes) {
recipe.makeProcess = 100;
}
}
// if(!make.makeStatus.equals(MakeStatus.制作完成))
{
DataBus.getInstance().GoodsSMMake.add(make);
}
}
// if(!make.makeStatus.equals(MakeStatus.制作完成))
{
DataBus.getInstance().GoodsSMMake.add(make);
}
}
}
if (DataBus.getInstance().GoodsSMMake.size() <= 0) {
runOnUiThread(new Runnable() {
if (DataBus.getInstance().GoodsSMMake.size() <= 0) {
runOnUiThread(new Runnable() {
@Override
public void run() {
T.show(MainActivity.this, "无可制作的订单!");
}
});
return;
}

ResGoodsMake statusMode = DataBus.getInstance().GoodsSMMake.get(0);


if (!DataBus.getInstance().PlcIsConnect) {
T.show(this, "PLC未连接,不允许制作!");
return;
}

if (BusinessServer.Get().Commoditys.size() > 0) {
T.show(this, "请等待前一饮品制作完成!");
return;
}

// 1.创建弹框对象,显示在当前页面
AlertDialog.Builder ab = new AlertDialog.Builder(this);
// 2.编辑弹框样式
// 2.1 创建标题
ab.setTitle("配料安全提示");
// 2.3 设置图标
ab.setIcon(R.mipmap.ts);
// 2.4 设置内容
ab.setMessage("请将碗放好后,务必保证碗在出料口下方,点击‘出料’开始出料?");
// 2.5 设置按钮
ab.setPositiveButton("取消出料", new DialogInterface.OnClickListener() {
@Override
public void run() {
T.show(MainActivity.this, "无可制作的订单!");
public void onClick(DialogInterface dialogInterface, int i) {
ActiveMax.MaxFrom(activity);//最大化
}
});
return;
}

ResGoodsMake statusMode = DataBus.getInstance().GoodsSMMake.get(0);
ab.setNeutralButton("开始出料", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
BusinessServer.Get().AddCommodity(statusMode.subOrder);
T.show(context, "开始下方配方:" + statusMode.good.name.toString());
ActiveMax.MaxFrom(activity);//最大化
Speech.startAuto("开始执行" + statusMode.good.name + "配料");
}
});
// 3.创建弹框
ab.create();
// 4.显示弹框
AlertDialog dialog = ab.show();


if (!DataBus.getInstance().PlcIsConnect) {
T.show(this, "PLC未连接,不允许制作!");
return;
}
//外部配料按钮
DeviceData.Get().OnIngredientButtonPressedNotify = new IRun() {
@Override
public void Run() {
dialog.dismiss();
BusinessServer.Get().AddCommodity(statusMode.subOrder);
T.show(context, "开始下方配方:" + statusMode.good.name.toString());
ActiveMax.MaxFrom(activity);//最大化
Speech.startAuto("开始执行" + statusMode.good.name + "配料");
}
};

if (BusinessServer.Get().Commoditys.size() > 0) {
T.show(this, "请等待前一饮品制作完成!");
return;
}

// 1.创建弹框对象,显示在当前页面
AlertDialog.Builder ab = new AlertDialog.Builder(this);
// 2.编辑弹框样式
// 2.1 创建标题
ab.setTitle("配料安全提示");
// 2.3 设置图标
ab.setIcon(R.mipmap.ts);
// 2.4 设置内容
ab.setMessage("请将碗放好后,务必保证碗在出料口下方,点击‘出料’开始出料?");
// 2.5 设置按钮
ab.setPositiveButton("取消出料", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
ActiveMax.MaxFrom(activity);//最大化
}
});
ab.setNeutralButton("开始出料", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
BusinessServer.Get().AddCommodity(statusMode.subOrder);
T.show(context, "开始下方配方:" + statusMode.good.name.toString());
ActiveMax.MaxFrom(activity);//最大化
Speech.startAuto("开始执行" + statusMode.good.name + "配料");
}
});
// 3.创建弹框
ab.create();
// 4.显示弹框
AlertDialog dialog = ab.show();


//外部配料按钮
DeviceData.Get().OnIngredientButtonPressedNotify = new IRun() {
@Override
public void Run() {
dialog.dismiss();
BusinessServer.Get().AddCommodity(statusMode.subOrder);
T.show(context, "开始下方配方:" + statusMode.good.name.toString());
ActiveMax.MaxFrom(activity);//最大化
Speech.startAuto("开始执行" + statusMode.good.name + "配料");
}
};


// runOnUiThread(new Runnable() {
// @Override
@@ -655,9 +661,9 @@ public class MainActivity extends FragmentActivity implements View.OnClickListen
String[] res = ((String) msg).split("[|]");
if (res.length >= 4) {
String Mgoodid = "";
String orderid = res[0];
String goodid = res[1];
String ggid = res[2];
String orderid = res[0];//P0003
String goodid = res[1];//P0003
String ggid = res[2];//A001,M002,T001
int num = 1;
try {
num = Integer.parseInt(res[3]);


+ 44
- 39
app/src/main/java/com/example/bpa/helper/UpdateManager.java Visa fil

@@ -322,46 +322,51 @@ public class UpdateManager {
}

private void showUpdateDialogNew(VersionResponse newVersionInfo) {
final AlertDialog alg = new AlertDialog.Builder(mContext).create();
alg.show();
Window win = alg.getWindow();
win.setContentView(R.layout.common_dialog_update);

//显示新版本内容
TextView title_update = (TextView) win.findViewById(R.id.title_update);
TextView title_date = (TextView) win.findViewById(R.id.title_date);
TextView title_size = (TextView) win.findViewById(R.id.title_size);
TextView versionDesc = (TextView) win.findViewById(R.id.versionDesc);
try {
VersionResponse mode = new VersionResponse();
title_update.setText(newVersionInfo.versionNo + "版本升级提示");
title_date.setText("发布时间:" + DataHelper.longToString(Long.parseLong(newVersionInfo.releaseDate), "yyyy-MM-dd HH:mm:ss"));
//title_size.setText("大小:"+newVersionInfo.getString("versionSize"));
//提示内容按";"进行整合,这里拆分到数组中
String desc =newVersionInfo.description==null?"暂无描述":( newVersionInfo.description.replace(";", "\n"));
versionDesc.setText(desc);
Button positiveButton = (Button) win.findViewById(R.id.PositiveButton);
Button negativeButton = (Button) win.findViewById(R.id.NegativeButton);
positiveButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
alg.dismiss();
showDownloadDialog();
ActiveMax.MaxFrom(activity);//最大化
}
});
negativeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
alg.dismiss();
ActiveMax.MaxFrom(activity);//最大化
}
});
} catch (Exception e) {
e.printStackTrace();
if(activity!=null && !activity.isFinishing())
{
final AlertDialog alg = new AlertDialog.Builder(mContext).create();
alg.show();
Window win = alg.getWindow();
win.setContentView(R.layout.common_dialog_update);

//显示新版本内容
TextView title_update = (TextView) win.findViewById(R.id.title_update);
TextView title_date = (TextView) win.findViewById(R.id.title_date);
TextView title_size = (TextView) win.findViewById(R.id.title_size);
TextView versionDesc = (TextView) win.findViewById(R.id.versionDesc);
try {
VersionResponse mode = new VersionResponse();
title_update.setText(newVersionInfo.versionNo + "版本升级提示");
title_date.setText("发布时间:" + DataHelper.longToString(Long.parseLong(newVersionInfo.releaseDate), "yyyy-MM-dd HH:mm:ss"));
//title_size.setText("大小:"+newVersionInfo.getString("versionSize"));
//提示内容按";"进行整合,这里拆分到数组中
String desc =newVersionInfo.description==null?"暂无描述":( newVersionInfo.description.replace(";", "\n"));
versionDesc.setText(desc);
Button positiveButton = (Button) win.findViewById(R.id.PositiveButton);
Button negativeButton = (Button) win.findViewById(R.id.NegativeButton);
positiveButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
alg.dismiss();
showDownloadDialog();
ActiveMax.MaxFrom(activity);//最大化
}
});
negativeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
alg.dismiss();
ActiveMax.MaxFrom(activity);//最大化
}
});
} catch (Exception e) {
e.printStackTrace();
}
}


}

/*


Laddar…
Avbryt
Spara