Browse Source

333

茶饮新(现场)
fyf 1 year ago
parent
commit
9da10a47e1
8 changed files with 172 additions and 8 deletions
  1. +28
    -0
      app/src/main/java/com/bonait/bnframework/common/constant/DataBus.java
  2. +7
    -0
      app/src/main/java/com/bonait/bnframework/common/db/res/ResGoodsMake.java
  3. +20
    -4
      app/src/main/java/com/bonait/bnframework/common/utils/UpdateAppUtils.java
  4. +10
    -3
      app/src/main/java/com/bonait/bnframework/modules/home/adapter/zdqxchid_adapter.java
  5. +45
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java
  6. +40
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/JiaoYan_lsjy_fragment.java
  7. +6
    -0
      app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/JiaoYan_zdqx_fragment.java
  8. +16
    -1
      app/src/main/res/layout/item/layout/zdqxchid_item.xml

+ 28
- 0
app/src/main/java/com/bonait/bnframework/common/constant/DataBus.java View File

@@ -137,6 +137,34 @@ public class DataBus {
make.recipes=QueryDB.GetGoodsSreciperecipeList(suborder.recipeID); make.recipes=QueryDB.GetGoodsSreciperecipeList(suborder.recipeID);
make.good=QueryDB.GetGoodsId(suborder.goodsID); make.good=QueryDB.GetGoodsId(suborder.goodsID);
make.goodsrecipename=QueryDB.GetGoodsRecipeNameId(suborder.recipeID); make.goodsrecipename=QueryDB.GetGoodsRecipeNameId(suborder.recipeID);

if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台"))
{
make.Gt1=false;
make.Gt2=false;
for (ResGoodsRecipe recipe:make.recipes)
{
BPA_SILOS silos = null;
List<BPA_SILOS> siloslist = QueryDB.GetSolisByMaterialID(recipe.materialID);
for (BPA_SILOS item : siloslist) {
if(silos==null)
silos = item;
}

if(silos!=null && silos.num==11)
{
make.Gt1=true;
}else if(silos!=null && silos.num==12)
{
make.Gt2=true;
}
}
}else
{
make.Gt1=false;
make.Gt2=false;
}

make.subOrder=suborder; make.subOrder=suborder;
make.makeStatus= MakeStatus.等待制作; make.makeStatus= MakeStatus.等待制作;
make.makeMs="等待下发物料!"; make.makeMs="等待下发物料!";


+ 7
- 0
app/src/main/java/com/bonait/bnframework/common/db/res/ResGoodsMake.java View File

@@ -42,6 +42,11 @@ public class ResGoodsMake {
* 是否可制作 * 是否可制作
*/ */
public boolean IsMake; public boolean IsMake;

public boolean Gt1;
public boolean Gt2;


public ResGoodsMake() public ResGoodsMake()
{ {
good=new BPA_GOODS(); good=new BPA_GOODS();
@@ -51,6 +56,8 @@ public class ResGoodsMake {
makeMs=""; makeMs="";
makeProcess=0; makeProcess=0;
IsMake=true; IsMake=true;
Gt1=false;
Gt2=false;
} }
} }



+ 20
- 4
app/src/main/java/com/bonait/bnframework/common/utils/UpdateAppUtils.java View File

@@ -74,10 +74,10 @@ public class UpdateAppUtils {
private static void doPost(final Context context) { private static void doPost(final Context context) {
VersionMode mode=new VersionMode(); VersionMode mode=new VersionMode();
//大炒 //大炒
mode.productCode="1679306986915368960";
mode.moduleCode="dcdjbbd";
mode.serverCode="1680766359592243200";
mode.branchCode="1679308856555737089";
// mode.productCode="1679306986915368960";
// mode.moduleCode="dcdjbbd";
// mode.serverCode="1680766359592243200";
// mode.branchCode="1679308856555737089";


//小炒网络v版本 //小炒网络v版本
// mode.productCode="1679306986915368960"; // mode.productCode="1679306986915368960";
@@ -90,6 +90,22 @@ public class UpdateAppUtils {
// mode.moduleCode="xcdjbbd"; // mode.moduleCode="xcdjbbd";
// mode.serverCode="1680766359592243200"; // mode.serverCode="1680766359592243200";
// mode.branchCode="1679308917918404609"; // mode.branchCode="1679308917918404609";

if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台"))
{
mode.productCode="1679307017135329280";
mode.moduleCode="ncapp";
mode.serverCode="1680767784879656960";
mode.branchCode="1679307481578999809";
}else
{
mode.productCode="1679307017135329280";
mode.moduleCode="twbt";
mode.serverCode="1680767784879656960";
mode.branchCode="1679309003247325185";
}

//调味吧台
String msg= new Json<VersionMode>().objectToJson(VersionMode.class, mode); String msg= new Json<VersionMode>().objectToJson(VersionMode.class, mode);
String getNewVersionUrl =ConfigName.getInstance().UpdateVersion; String getNewVersionUrl =ConfigName.getInstance().UpdateVersion;
MediaType JSON = MediaType.parse("application/json; charset=utf-8"); MediaType JSON = MediaType.parse("application/json; charset=utf-8");


+ 10
- 3
app/src/main/java/com/bonait/bnframework/modules/home/adapter/zdqxchid_adapter.java View File

@@ -11,6 +11,8 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;


import androidx.annotation.NonNull; import androidx.annotation.NonNull;
@@ -73,7 +75,7 @@ public class zdqxchid_adapter extends RecyclerView.Adapter<RecyclerView.ViewHold
temp=d[2]; temp=d[2];
} }
} }
myViewHolder.name.setText("步骤-"+position+1);
myViewHolder.name.setText("步骤-"+(position+1));
myViewHolder.edittext_pssj.setText(pssj+""); myViewHolder.edittext_pssj.setText(pssj+"");
myViewHolder.edittext_xhsj.setText(qxsj+""); myViewHolder.edittext_xhsj.setText(qxsj+"");
myViewHolder.edittext_qxwd.setText(temp+""); myViewHolder.edittext_qxwd.setText(temp+"");
@@ -82,6 +84,7 @@ public class zdqxchid_adapter extends RecyclerView.Adapter<RecyclerView.ViewHold
{ {
myViewHolder.status.setText("未开始"); myViewHolder.status.setText("未开始");
myViewHolder.status.setTextColor(Color.parseColor("#99a0aa")); myViewHolder.status.setTextColor(Color.parseColor("#99a0aa"));
myViewHolder.qxlc_layout.setBackgroundResource(R.color.activity_background1);
}else }else
{ {
myViewHolder.status.setText(goodsMake.exp); myViewHolder.status.setText(goodsMake.exp);
@@ -89,6 +92,7 @@ public class zdqxchid_adapter extends RecyclerView.Adapter<RecyclerView.ViewHold
if(goodsMake.exp.equals("执行中")) if(goodsMake.exp.equals("执行中"))
{ {
myViewHolder.status.setTextColor(Color.parseColor("#00A8E1")); myViewHolder.status.setTextColor(Color.parseColor("#00A8E1"));
myViewHolder.qxlc_layout.setBackgroundResource(R.color.selebottom);


if (!myViewHolder.edittext_pssj.getText().toString().equals("")) { if (!myViewHolder.edittext_pssj.getText().toString().equals("")) {
int k= (int)Math.round((Double.parseDouble(myViewHolder.edittext_pssj.getText().toString()) * 10)); int k= (int)Math.round((Double.parseDouble(myViewHolder.edittext_pssj.getText().toString()) * 10));
@@ -113,11 +117,10 @@ public class zdqxchid_adapter extends RecyclerView.Adapter<RecyclerView.ViewHold
}else //执行完成 }else //执行完成
{ {
myViewHolder.status.setTextColor(Color.parseColor("#FF4081")); myViewHolder.status.setTextColor(Color.parseColor("#FF4081"));
myViewHolder.qxlc_layout.setBackgroundResource(R.color.activity_background1);
} }
} }



myViewHolder.save_time.setOnClickListener(new View.OnClickListener() { myViewHolder.save_time.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
@@ -183,6 +186,8 @@ public class zdqxchid_adapter extends RecyclerView.Adapter<RecyclerView.ViewHold
TextView name;//保存时间 TextView name;//保存时间
TextView status;//保存时间 TextView status;//保存时间


RelativeLayout qxlc_layout;//李总

public ZDQXViewHolder(View view) { public ZDQXViewHolder(View view) {
super(view); super(view);
edittext_pssj =view.findViewById(R.id.edittext_pssj); edittext_pssj =view.findViewById(R.id.edittext_pssj);
@@ -192,6 +197,8 @@ public class zdqxchid_adapter extends RecyclerView.Adapter<RecyclerView.ViewHold
delete_time=view.findViewById(R.id.delete_time); delete_time=view.findViewById(R.id.delete_time);
name =view.findViewById(R.id.name); name =view.findViewById(R.id.name);
status =view.findViewById(R.id.status); status =view.findViewById(R.id.status);

qxlc_layout=view.findViewById(R.id.qxlc_layout);
} }
} }
} }

+ 45
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/MakeGoodFragment.java View File

@@ -235,6 +235,12 @@ public class MakeGoodFragment extends BaseFragment {
@Override @Override
public void clickListener(View v, Object data) { public void clickListener(View v, Object data) {
ResGoodsMake makegood=(ResGoodsMake)data; ResGoodsMake makegood=(ResGoodsMake)data;
if(!ConfigName.getInstance().PlcIsConnect)
{
ToastUtils.warning("设备已离线,请检查设备...");
return;
}

if(ExecuteTheRecipe.IsMakeGood) if(ExecuteTheRecipe.IsMakeGood)
{ {
ToastUtils.warning("请耐心等待上一商品制作完成..."); ToastUtils.warning("请耐心等待上一商品制作完成...");
@@ -252,6 +258,34 @@ public class MakeGoodFragment extends BaseFragment {
ToastUtils.warning("商品:"+makegood.good.name+",已制作完成..."); ToastUtils.warning("商品:"+makegood.good.name+",已制作完成...");
return; return;
} }

//判断温度是否到达
if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台"))
{
if(makegood.Gt1)
{
Object sx=ExecuteTheRecipe.ReadPLC("果糖左温度设置");
int wdsz=sx==null?0:(int)sx;

if(gt1wd<wdsz)
{
ToastUtils.warning("果糖左仓温度未达到设置值,不允许出料...");
return;
}
}
if(makegood.Gt2)
{
Object sx=ExecuteTheRecipe.ReadPLC("果糖右温度设置");
int wdsz=sx==null?0:(int)sx;

if(gt2wd<wdsz)
{
ToastUtils.warning("果糖右仓温度未达到设置值,不允许出料...");
return;
}
}
}

String title = "温馨提示!"; String title = "温馨提示!";
String message = "客官确定要开始制作【"+makegood.good.name+"】吗?"; String message = "客官确定要开始制作【"+makegood.good.name+"】吗?";
AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() { AlertDialogUtils.showDialog(context, title, message, new QMUIDialogAction.ActionListener() {
@@ -350,6 +384,9 @@ public class MakeGoodFragment extends BaseFragment {
String zhongliangxianshi="0g"; String zhongliangxianshi="0g";
String tempwd="0°C"; String tempwd="0°C";


int gt1wd=0;
int gt2wd=0;

/** /**
* 实时显示线程 * 实时显示线程
*/ */
@@ -373,6 +410,14 @@ public class MakeGoodFragment extends BaseFragment {
{ {
tempwd=String.valueOf(obj1) + "°C"; tempwd=String.valueOf(obj1) + "°C";
} }

if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台"))
{
Object obj2= ExecuteTheRecipe.ReadPLC("果糖左温度");
Object obj3= ExecuteTheRecipe.ReadPLC("果糖右温度");
gt1wd=obj2==null?0:(int)obj2;
gt2wd=obj3==null?0:(int)obj3;
}
} }
mHandler.sendEmptyMessage(0); mHandler.sendEmptyMessage(0);
Thread.sleep(100); Thread.sleep(100);


+ 40
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/JiaoYan_lsjy_fragment.java View File

@@ -171,9 +171,39 @@ public class JiaoYan_lsjy_fragment extends BaseFragment {
break; break;
case R.id.ksjz://开始校准 case R.id.ksjz://开始校准
//切换手动 //切换手动


//region 判断是否只勾选了一个料仓 //region 判断是否只勾选了一个料仓
SelectSilos(); SelectSilos();
//endregion //endregion

//判断是否为果糖
if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台"))
{
if(selectIndexSilos==11)
{
Object sx=ExecuteTheRecipe.ReadPLC("果糖左温度设置");
int wdsz=sx==null?0:(int)sx;

if(gt1wd<wdsz)
{
ToastUtils.warning("果糖左仓温度未达到设置值,不允许校准...");
return;
}
}else if(selectIndexSilos==12)
{
Object sx=ExecuteTheRecipe.ReadPLC("果糖右温度设置");
int wdsz=sx==null?0:(int)sx;
if(gt2wd<wdsz)
{
ToastUtils.warning("果糖右仓温度未达到设置值,不允许校准...");
return;
}
}
}



ExecuteTheRecipe.WritePLC("校准完成",false,null); ExecuteTheRecipe.WritePLC("校准完成",false,null);


ExecuteTheRecipe.WritePLC("手自切换", false, null); ExecuteTheRecipe.WritePLC("手自切换", false, null);
@@ -334,6 +364,8 @@ public class JiaoYan_lsjy_fragment extends BaseFragment {
} }
}; };
int zhongliangxianshi=0; int zhongliangxianshi=0;
int gt1wd=0;
int gt2wd=0;
/** /**
* 实时显示线程 * 实时显示线程
*/ */
@@ -349,6 +381,14 @@ public class JiaoYan_lsjy_fragment extends BaseFragment {
zhongliangxianshi=(int)obj;// zhongliangxianshi=(int)obj;//
mHandler.sendEmptyMessage(0); mHandler.sendEmptyMessage(0);
} }

if (!ConfigName.getInstance().versionSelectionEnum.equals("配料吧台"))
{
Object obj2= ExecuteTheRecipe.ReadPLC("果糖左温度");
Object obj3= ExecuteTheRecipe.ReadPLC("果糖右温度");
gt1wd=obj2==null?0:(int)obj2;
gt2wd=obj3==null?0:(int)obj3;
}
Thread.sleep(200); Thread.sleep(200);
} catch (InterruptedException e) { } catch (InterruptedException e) {
throw new RuntimeException(e); throw new RuntimeException(e);


+ 6
- 0
app/src/main/java/com/bonait/bnframework/modules/home/fragment/from/fragment/JiaoYan_zdqx_fragment.java View File

@@ -190,6 +190,12 @@ public class JiaoYan_zdqx_fragment extends BaseFragment {
IsStart=false; IsStart=false;
bt_start.setText("开始清洗"); bt_start.setText("开始清洗");
bt_start.setBackgroundResource(R.drawable.sz_bj); bt_start.setBackgroundResource(R.drawable.sz_bj);

for (BPA_SUGAR item:
DataBus.getInstance().zdqx) {
item.exp="";
}
DataBus.getInstance().zdqxchidAdapter.refresh();
} }
}; };




+ 16
- 1
app/src/main/res/layout/item/layout/zdqxchid_item.xml View File

@@ -3,11 +3,22 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"> android:layout_height="wrap_content">


<RelativeLayout
android:layout_margin="@dimen/dp_10"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:background="@color/selebottom"
android:id="@+id/qxlc_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout <LinearLayout
android:layout_margin="@dimen/dp_10"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:orientation="vertical">
android:orientation="vertical"
>
<TextView <TextView
android:id="@+id/name" android:id="@+id/name"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -143,4 +154,8 @@
android:textAlignment="center" android:textAlignment="center"
android:textSize="20dp"/> android:textSize="20dp"/>
</LinearLayout> </LinearLayout>
</RelativeLayout>

</RelativeLayout>

</RelativeLayout> </RelativeLayout>

Loading…
Cancel
Save